;
! 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] = "df1d0581-1c54-cbeb-6fb9-371d6c264815")
    } catch (e) {}
}();
(globalThis.TURBOPACK || (globalThis.TURBOPACK = [])).push(["object" == typeof document ? document.currentScript : void 0, 827681, e => {
    "use strict";
    e.s(["AuthRoute", 0, {
        CONNECTORS: "connectors",
        CONNECT: "connect",
        ONBOARDING: "onboarding"
    }, "AuthenticationStatusStates", 0, {
        PERSISTING: "persisting",
        IDLE: "idle",
        PENDING: "pending",
        SUCCESS: "success",
        REJECTED: "rejected",
        ERROR: "error",
        ACCOUNT_DELETED: "account_deleted"
    }, "ConnectorRoute", 0, {
        LOGIN: "login",
        SIGNUP: "signup"
    }, "ConnectorStates", 0, {
        DISCONNECTED: "disconnected",
        RECONNECTING: "reconnecting",
        CONNECTING: "connecting",
        CONNECTED: "connected",
        FAILED: "failed",
        REJECTED: "rejected",
        UNAVAILABLE: "unavailable"
    }, "OnboardingRoute", 0, {
        CREATEACCOUNT: "createaccount",
        CAPTUREEOAEMAIL: "captureeoaemail",
        ENABLEEOATRADING: "enabletrading",
        APPROVETRADING: "approvetrading",
        AUTOREDEEM: "autoredeem",
        FUNDACCOUNT: "fundaccount"
    }])
}, 463621, e => {
    "use strict";
    e.s(["getAction", 0, function(e, t, r) {
        let n = e[t.name];
        if ("function" == typeof n) return n;
        let a = e[r];
        return "function" == typeof a ? a : r => t(e, r)
    }])
}, 915341, 659662, e => {
    "use strict";
    let t = "3.4.11";
    e.s(["version", 0, t], 659662);
    var r, n, a = function(e, t, r, n) {
        if ("a" === r && !n) throw TypeError("Private accessor was defined without a getter");
        if ("function" == typeof t ? e !== t || !n : !t.has(e)) throw TypeError("Cannot read private member from an object whose class did not declare it");
        return "m" === r ? n : "a" === r ? n.call(e) : n ? n.value : t.get(e)
    };
    class i extends Error {
        get docsBaseUrl() {
            return "https://wagmi.sh/core"
        }
        get version() {
            return `@wagmi/core@${t}`
        }
        constructor(e, t = {}) {
            super(), r.add(this), Object.defineProperty(this, "details", {
                enumerable: !0,
                configurable: !0,
                writable: !0,
                value: void 0
            }), Object.defineProperty(this, "docsPath", {
                enumerable: !0,
                configurable: !0,
                writable: !0,
                value: void 0
            }), Object.defineProperty(this, "metaMessages", {
                enumerable: !0,
                configurable: !0,
                writable: !0,
                value: void 0
            }), Object.defineProperty(this, "shortMessage", {
                enumerable: !0,
                configurable: !0,
                writable: !0,
                value: void 0
            }), Object.defineProperty(this, "name", {
                enumerable: !0,
                configurable: !0,
                writable: !0,
                value: "WagmiCoreError"
            });
            const n = t.cause instanceof i ? t.cause.details : t.cause ? .message ? t.cause.message : t.details,
                a = t.cause instanceof i && t.cause.docsPath || t.docsPath;
            this.message = [e || "An error occurred.", "", ...t.metaMessages ? [...t.metaMessages, ""] : [], ...a ? [`Docs: ${this.docsBaseUrl}${a}.html${t.docsSlug?`#${t.docsSlug}`:""}`] : [], ...n ? [`Details: ${n}`] : [], `Version: ${this.version}`].join("\n"), t.cause && (this.cause = t.cause), this.details = n, this.docsPath = a, this.metaMessages = t.metaMessages, this.shortMessage = e
        }
        walk(e) {
            return a(this, r, "m", n).call(this, this, e)
        }
    }
    r = new WeakSet, n = function e(t, n) {
        return n ? .(t) ? t : t.cause ? a(this, r, "m", e).call(this, t.cause, n) : t
    }, e.s(["BaseError", 0, i], 915341)
}, 788494, e => {
    "use strict";
    var t = e.i(915341);
    class r extends t.BaseError {
        constructor() {
            super("Chain not configured."), Object.defineProperty(this, "name", {
                enumerable: !0,
                configurable: !0,
                writable: !0,
                value: "ChainNotConfiguredError"
            })
        }
    }
    class n extends t.BaseError {
        constructor() {
            super("Connector already connected."), Object.defineProperty(this, "name", {
                enumerable: !0,
                configurable: !0,
                writable: !0,
                value: "ConnectorAlreadyConnectedError"
            })
        }
    }
    class a extends t.BaseError {
        constructor() {
            super("Connector not connected."), Object.defineProperty(this, "name", {
                enumerable: !0,
                configurable: !0,
                writable: !0,
                value: "ConnectorNotConnectedError"
            })
        }
    }
    t.BaseError;
    class i extends t.BaseError {
        constructor({
            address: e,
            connector: t
        }) {
            super(`Account "${e}" not found for connector "${t.name}".`), Object.defineProperty(this, "name", {
                enumerable: !0,
                configurable: !0,
                writable: !0,
                value: "ConnectorAccountNotFoundError"
            })
        }
    }
    class o extends t.BaseError {
        constructor({
            connectionChainId: e,
            connectorChainId: t
        }) {
            super(`The current chain of the connector (id: ${t}) does not match the connection's chain (id: ${e}).`, {
                metaMessages: [`Current Chain ID:  ${t}`, `Expected Chain ID: ${e}`]
            }), Object.defineProperty(this, "name", {
                enumerable: !0,
                configurable: !0,
                writable: !0,
                value: "ConnectorChainMismatchError"
            })
        }
    }
    class s extends t.BaseError {
        constructor({
            connector: e
        }) {
            super(`Connector "${e.name}" unavailable while reconnecting.`, {
                details: "During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uid`. All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored. This error commonly occurs for connectors that asynchronously inject after reconnection has already started."
            }), Object.defineProperty(this, "name", {
                enumerable: !0,
                configurable: !0,
                writable: !0,
                value: "ConnectorUnavailableReconnectingError"
            })
        }
    }
    e.s(["ChainNotConfiguredError", 0, r, "ConnectorAccountNotFoundError", 0, i, "ConnectorAlreadyConnectedError", 0, n, "ConnectorChainMismatchError", 0, o, "ConnectorNotConnectedError", 0, a, "ConnectorUnavailableReconnectingError", 0, s])
}, 922448, e => {
    "use strict";
    var t = e.i(212146),
        r = e.i(883798),
        n = e.i(113967),
        a = e.i(372387),
        i = e.i(788494);
    async function o(e, s = {}) {
        let l, {
            assertChainId: c = !0
        } = s;
        if (s.connector) {
            let {
                connector: t
            } = s;
            if ("reconnecting" === e.state.status && !t.getAccounts && !t.getChainId) throw new i.ConnectorUnavailableReconnectingError({
                connector: t
            });
            let [r, n] = await Promise.all([t.getAccounts().catch(e => {
                if (null === s.account) return [];
                throw e
            }), t.getChainId()]);
            l = {
                accounts: r,
                chainId: n,
                connector: t
            }
        } else l = e.state.connections.get(e.state.current);
        if (!l) throw new i.ConnectorNotConnectedError;
        let u = s.chainId ? ? l.chainId,
            d = await l.connector.getChainId();
        if (c && d !== u) throw new i.ConnectorChainMismatchError({
            connectionChainId: u,
            connectorChainId: d
        });
        let f = l.connector;
        if (f.getClient) return f.getClient({
            chainId: u
        });
        let p = (0, a.parseAccount)(s.account ? ? l.accounts[0]);
        if (p && (p.address = (0, n.getAddress)(p.address)), s.account && !l.accounts.some(e => e.toLowerCase() === p.address.toLowerCase())) throw new i.ConnectorAccountNotFoundError({
            address: p.address,
            connector: f
        });
        let h = e.chains.find(e => e.id === u),
            m = await l.connector.getProvider({
                chainId: u
            });
        return (0, t.createClient)({
            account: p,
            chain: h,
            name: "Connector Client",
            transport: e => (0, r.custom)(m)({ ...e,
                retryCount: 0
            })
        })
    }
    e.s(["getConnectorClient", 0, o])
}, 251757, e => {
    "use strict";
    var t = e.i(749084),
        r = e.i(463621),
        n = e.i(922448);
    async function a(e, a) {
        let i, {
            account: o,
            connector: s,
            ...l
        } = a;
        return i = "object" == typeof o && "local" === o.type ? e.getClient() : await (0, n.getConnectorClient)(e, {
            account: o,
            connector: s
        }), (0, r.getAction)(i, t.signMessage, "signMessage")({ ...l,
            ...o ? {
                account: o
            } : {}
        })
    }
    e.s(["signMessage", 0, a])
}, 955811, e => {
    "use strict";
    e.s(["swallow", 0, e => {
        try {
            return e()
        } catch {
            return
        }
    }])
}, 94371, 970464, 684129, e => {
    "use strict";

    function t(e, t) {
        return JSON.parse(e, (e, r) => {
            let n = r;
            return n ? .__type === "bigint" && (n = BigInt(n.value)), n ? .__type === "Map" && (n = new Map(n.value)), t ? .(e, n) ? ? n
        })
    }

    function r(e, t) {
        return e.slice(0, t).join(".") || "."
    }

    function n(e, t) {
        let {
            length: r
        } = e;
        for (let n = 0; n < r; ++n)
            if (e[n] === t) return n + 1;
        return 0
    }

    function a(e, t, a, i) {
        var o;
        let s, l, c, u;
        return JSON.stringify(e, (o = (e, r) => {
            let n = r;
            return "bigint" == typeof n && (n = {
                __type: "bigint",
                value: r.toString()
            }), n instanceof Map && (n = {
                __type: "Map",
                value: Array.from(r.entries())
            }), t ? .(e, n) ? ? n
        }, s = true, l = "function" == typeof i, c = [], u = [], function(e, t) {
            if ("object" == typeof t)
                if (c.length) {
                    let a = n(c, this);
                    0 === a ? c[c.length] = this : (c.splice(a), u.splice(a)), u[u.length] = e;
                    let o = n(c, t);
                    if (0 !== o) return l ? i.call(this, e, t, r(u, o)) : `[ref=${r(u,o)}]`
                } else c[0] = t, u[0] = e;
            return s ? o.call(this, e, t) : t
        }), a ? ? void 0)
    }
    e.s(["deserialize", 0, t], 970464), e.s(["serialize", 0, a], 684129);
    let i = {
        getItem: () => null,
        setItem: () => {},
        removeItem: () => {}
    };
    e.s(["createStorage", 0, function(e) {
        let {
            deserialize: r = t,
            key: n = "wagmi",
            serialize: o = a,
            storage: s = i
        } = e;

        function l(e) {
            return e instanceof Promise ? e.then(e => e).catch(() => null) : e
        }
        return { ...s,
            key: n,
            async getItem(e, t) {
                let a = s.getItem(`${n}.${e}`),
                    i = await l(a);
                return i ? r(i) ? ? null : t ? ? null
            },
            async setItem(e, t) {
                let r = `${n}.${e}`;
                null === t ? await l(s.removeItem(r)) : await l(s.setItem(r, o(t)))
            },
            async removeItem(e) {
                await l(s.removeItem(`${n}.${e}`))
            }
        }
    }, "getDefaultStorage", 0, function() {
        let e = "u" > typeof window && window.localStorage ? window.localStorage : i;
        return {
            getItem: t => e.getItem(t),
            removeItem(t) {
                e.removeItem(t)
            },
            setItem(t, r) {
                try {
                    e.setItem(t, r)
                } catch {}
            }
        }
    }, "noopStorage", 0, i], 94371)
}, 905333, 775404, 399482, e => {
    "use strict";
    var t = e.i(955811),
        r = e.i(94371);
    let n = () => {
        if (!window.localStorage) return r.noopStorage;
        let e = window.localStorage.setItem.bind(window.localStorage);
        return {
            removeItem: window.localStorage.removeItem.bind(window.localStorage),
            getItem: window.localStorage.getItem.bind(window.localStorage),
            setItem: (r, n) => {
                (0, t.swallow)(() => e(r, n))
            }
        }
    };

    function a(e) {
        if (e) try {
            return JSON.parse(e)
        } catch {
            return
        }
    }

    function i(e) {
        try {
            return JSON.stringify(e)
        } catch {
            return
        }
    }
    e.s(["createLocalStorage", 0, n], 775404);
    let o = {
        account: "polymarket.auth.cache.account"
    };
    class s {#
        e;
        keys;
        constructor({
            storage: e = n(),
            config: t
        } = {}) {
            this.#e = e, t ? this.keys = { ...o,
                ...t
            } : this.keys = o
        }
        get all() {
            let e = a(this.#e ? .getItem(this.keys.account));
            if (e && "object" == typeof e) return e
        }
        set all(e) {
            let r = i(e);
            r && (0, t.swallow)(() => this.#e ? .setItem(this.keys.account, r))
        }
        clear() {
            (0, t.swallow)(() => this.#e ? .removeItem(this.keys.account))
        }
        get(e) {
            let t = this.all;
            if (t) return t[e]
        }
        update(e, t) {
            let r = this.all ? ? {};
            this.all = { ...r,
                [e]: t
            }
        }
    }
    let l = {
        email: "polymarket.auth.lastUsedEmail"
    };
    class c {#
        e;
        keys;
        constructor({
            storage: e = n(),
            config: t
        } = {}) {
            this.#e = e, t ? this.keys = { ...l,
                ...t
            } : this.keys = l
        }
        get value() {
            return (0, t.swallow)(() => this.#e ? .getItem(this.keys.email) ? ? void 0)
        }
        set value(e) {
            (0, t.swallow)(() => this.#e ? .setItem(this.keys.email, e))
        }
        clear() {
            (0, t.swallow)(() => this.#e ? .removeItem(this.keys.email))
        }
    }
    let u = {
        wallet: "polymarket.auth.proxyWallet"
    };
    class d {#
        e;
        keys;
        constructor({
            storage: e = n(),
            config: t
        } = {}) {
            this.#e = e, t ? this.keys = { ...u,
                ...t
            } : this.keys = u
        }
        get value() {
            return (0, t.swallow)(() => this.#e ? .getItem(this.keys.wallet) ? ? void 0)
        }
        set value(e) {
            (0, t.swallow)(() => this.#e ? .setItem(this.keys.wallet, e))
        }
        clear() {
            (0, t.swallow)(() => this.#e ? .removeItem(this.keys.wallet))
        }
    }
    let f = {
        state: "polymarket.auth.params"
    };
    class p {#
        e;
        keys;
        constructor({
            storage: e = n(),
            config: t
        } = {}) {
            this.#e = e, t ? this.keys = { ...f,
                ...t
            } : this.keys = f
        }
        get value() {
            return a(this.#e ? .getItem(this.keys.state))
        }
        set value(e) {
            let r = i(e);
            r && (0, t.swallow)(() => this.#e ? .setItem(this.keys.state, r))
        }
        update(e) {
            let t = this.value;
            if (!t) return;
            let r = { ...t,
                ...e
            };
            return this.value = r, r
        }
        get exists() {
            return !!this.value
        }
        clear() {
            (0, t.swallow)(() => this.#e ? .removeItem(this.keys.state))
        }
        get magic() {
            let e = this.value;
            if (e && "magic" === e.type) return e
        }
        get oauth() {
            let e = this.magic;
            if (e && "oauth" === e.magicAuthType) return e
        }
        get email() {
            let e = this.magic;
            if (e && "email" === e.magicAuthType) return e
        }
        getMagicState({
            type: e,
            connectionStates: t
        } = {}) {
            let r = this.magic;
            if (r && (!e || e === r.magicAuthType) && (!t || t.includes(r.connectionState))) return r
        }
        get canReconnect() {
            let e = this.magic;
            return !!e && "ready" === e.connectionState
        }
        get oauthReconnecting() {
            let e = this.oauth;
            return !!e && ("requesting" === e.connectionState || "redirect" === e.connectionState || "after-redirect-result" === e.connectionState || "pending" === e.connectionState)
        }
        get oauthRedirected() {
            let e = this.oauth;
            return !!e && "after-redirect-result" === e.connectionState
        }
    }
    class h {
        state;
        accounts;
        email;
        wallets;
        constructor({
            storage: e = n(),
            config: t
        } = {}) {
            this.accounts = new s({
                storage: e,
                config: t ? .accounts
            }), this.email = new c({
                storage: e,
                config: t ? .email
            }), this.wallets = new d({
                storage: e,
                config: t ? .wallets
            }), this.state = new p({
                storage: e,
                config: t ? .state
            })
        }
    }
    let m = e => new h(e);
    e.s(["createWalletCache", 0, m], 399482), e.s(["isCoinbaseWalletConnector", 0, e => "coinbaseWalletSDK" === e, "isDenylistedConnector", 0, e => e && ["app.keplr", "app.backpack"].includes(e), "isInjectedConnector", 0, e => "injected" === e, "isMagicConnector", 0, e => "magic" === e, "isMagicOauthConnector", 0, e => "magic" === e && !!m().state.oauth, "isRabbyConnector", 0, e => "rabby" === e || "io.rabby" === e, "isWalletConnectConnector", 0, e => "walletConnect" === e], 905333)
}, 447660, e => {
    "use strict";
    var t = e.i(93257),
        r = e.i(251757),
        n = e.i(905333),
        a = e.i(621030);
    class i extends a.BaseError {
        constructor(e) {
            const {
                docsPath: t,
                field: r,
                metaMessages: n
            } = e;
            super(`Invalid Sign-In with Ethereum message field "${r}".`, {
                docsPath: t,
                metaMessages: n,
                name: "SiweInvalidMessageFieldError"
            })
        }
    }
    var o = e.i(113967);

    function s(e) {
        if (/[^a-z0-9:/?#[\]@!$&'()*+,;=.\-_~%]/i.test(e) || /%[^0-9a-f]/i.test(e) || /%[0-9a-f](:?[^0-9a-f]|$)/i.test(e)) return !1;
        let t = e.match(/(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/),
            r = t[1],
            n = t[2],
            a = t[3],
            i = t[4],
            o = t[5];
        if (!(r ? .length && a.length >= 0)) return !1;
        if (n ? .length) {
            if (!(0 === a.length || /^\//.test(a))) return !1
        } else if (/^\/\//.test(a)) return !1;
        if (!/^[a-z][a-z0-9+\-.]*$/.test(r.toLowerCase())) return !1;
        let s = "";
        return s += `${r}:`, n ? .length && (s += `//${n}`), s += a, i ? .length && (s += `?${i}`), o ? .length && (s += `#${o}`), s
    }
    let l = /^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(:[0-9]{1,5})?$/,
        c = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(:[0-9]{1,5})?$/,
        u = /^localhost(:[0-9]{1,5})?$/,
        d = /^[a-zA-Z0-9]{8,}$/,
        f = /^([a-zA-Z][a-zA-Z0-9+-.]*)$/,
        p = "polymarket.com",
        h = "Welcome to Polymarket! Sign to connect.",
        m = {
            magic: 6048e5,
            eoa: 6048e5
        },
        y = {
            magic: 6048e5,
            eoa: 6048e5
        },
        g = async ({
            chainId: e,
            connector: t
        }) => {
            try {
                let r = t.getMagicSDK({
                        chainId: e
                    }),
                    n = await r.user.getIdToken();
                return {
                    status: "success",
                    data: n
                }
            } catch (e) {
                return {
                    status: "failure",
                    error: e
                }
            }
        },
        b = async ({
            account: e,
            chainId: a,
            connector: g,
            nonce: b,
            uri: v,
            config: x
        }) => {
            try {
                var w;
                let _, C, E, S = (C = (_ = Date.now()) + m.eoa, {
                        tokenExpiration: E = _ + y.eoa,
                        sessionExpiration: Math.min(E, C),
                        requiresGammaRefresh: !0
                    }),
                    {
                        fields: A,
                        message: I
                    } = (w = {
                        address: e,
                        chainId: a,
                        nonce: b,
                        issuedAt: new Date().toISOString(),
                        expirationTime: new Date(S.sessionExpiration).toISOString(),
                        uri: v
                    }, {
                        fields: {
                            domain: p,
                            address: w.address,
                            statement: h,
                            uri: w.uri,
                            version: "1",
                            chainId: w.chainId,
                            nonce: w.nonce,
                            ...w.issuedAt && {
                                issuedAt: w.issuedAt
                            },
                            ...w.expirationTime && {
                                expirationTime: w.expirationTime
                            }
                        },
                        message: function(e) {
                            let {
                                chainId: t,
                                domain: r,
                                expirationTime: n,
                                issuedAt: a = new Date,
                                nonce: p,
                                notBefore: h,
                                requestId: m,
                                resources: y,
                                scheme: g,
                                uri: b,
                                version: v
                            } = e; {
                                if (t !== Math.floor(t)) throw new i({
                                    field: "chainId",
                                    metaMessages: ["- Chain ID must be a EIP-155 chain ID.", "- See https://eips.ethereum.org/EIPS/eip-155", "", `Provided value: ${t}`]
                                });
                                if (!(l.test(r) || c.test(r) || u.test(r))) throw new i({
                                    field: "domain",
                                    metaMessages: ["- Domain must be an RFC 3986 authority.", "- See https://www.rfc-editor.org/rfc/rfc3986", "", `Provided value: ${r}`]
                                });
                                if (!d.test(p)) throw new i({
                                    field: "nonce",
                                    metaMessages: ["- Nonce must be at least 8 characters.", "- Nonce must be alphanumeric.", "", `Provided value: ${p}`]
                                });
                                if (!s(b)) throw new i({
                                    field: "uri",
                                    metaMessages: ["- URI must be a RFC 3986 URI referring to the resource that is the subject of the signing.", "- See https://www.rfc-editor.org/rfc/rfc3986", "", `Provided value: ${b}`]
                                });
                                if ("1" !== v) throw new i({
                                    field: "version",
                                    metaMessages: ["- Version must be '1'.", "", `Provided value: ${v}`]
                                });
                                if (g && !f.test(g)) throw new i({
                                    field: "scheme",
                                    metaMessages: ["- Scheme must be an RFC 3986 URI scheme.", "- See https://www.rfc-editor.org/rfc/rfc3986#section-3.1", "", `Provided value: ${g}`]
                                });
                                let n = e.statement;
                                if (n ? .includes("\n")) throw new i({
                                    field: "statement",
                                    metaMessages: ["- Statement must not include '\\n'.", "", `Provided value: ${n}`]
                                })
                            }
                            let x = (0, o.getAddress)(e.address),
                                w = g ? `${g}://${r}` : r,
                                _ = e.statement ? `${e.statement}
` : "",
                                C = `${w} wants you to sign in with your Ethereum account:
${x}

${_}`,
                                E = `URI: ${b}
Version: ${v}
Chain ID: ${t}
Nonce: ${p}
Issued At: ${a.toISOString()}`;
                            if (n && (E += `
Expiration Time: ${n.toISOString()}`), h && (E += `
Not Before: ${h.toISOString()}`), m && (E += `
Request ID: ${m}`), y) {
                                let e = "\nResources:";
                                for (let t of y) {
                                    if (!s(t)) throw new i({
                                        field: "resources",
                                        metaMessages: ["- Every resource must be a RFC 3986 URI.", "- See https://www.rfc-editor.org/rfc/rfc3986", "", `Provided value: ${t}`]
                                    });
                                    e += `
- ${t}`
                                }
                                E += e
                            }
                            return `${C}
${E}`
                        }({
                            address: w.address,
                            chainId: w.chainId,
                            domain: p,
                            nonce: w.nonce,
                            statement: h,
                            uri: w.uri,
                            version: "1",
                            ...w.issuedAt && {
                                issuedAt: new Date(w.issuedAt)
                            },
                            ...w.expirationTime && {
                                expirationTime: new Date(w.expirationTime)
                            }
                        })
                    });
                (0, n.isRabbyConnector)(g ? .id) && (await g ? .isAuthorized(), await new Promise(e => setTimeout(e, 500)));
                let T = await (0, r.signMessage)(x, {
                        message: I
                    }),
                    k = t.Buffer.from(`${JSON.stringify(A)}:::${T}`).toString("base64");
                return {
                    status: "success",
                    data: k
                }
            } catch (e) {
                return {
                    status: "failure",
                    error: e
                }
            }
        },
        v = async ({
            account: e,
            chainId: t,
            connector: r,
            nonce: a,
            uri: i,
            config: o
        }) => (0, n.isMagicConnector)(r ? .id) ? g({
            chainId: t,
            connector: r
        }) : b({
            account: e,
            chainId: t,
            connector: r,
            nonce: a,
            uri: i,
            config: o
        });
    e.s(["getToken", 0, v], 447660)
}, 601550, 68126, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(289780),
        n = e.i(698157),
        a = e.i(756013),
        i = class extends n.Removable {#
            t;#
            r;#
            n;#
            a;
            constructor(e) {
                super(), this.#t = e.client, this.mutationId = e.mutationId, this.#n = e.mutationCache, this.#r = [], this.state = e.state || o(), this.setOptions(e.options), this.scheduleGc()
            }
            setOptions(e) {
                this.options = e, this.updateGcTime(this.options.gcTime)
            }
            get meta() {
                return this.options.meta
            }
            addObserver(e) {
                this.#r.includes(e) || (this.#r.push(e), this.clearGcTimeout(), this.#n.notify({
                    type: "observerAdded",
                    mutation: this,
                    observer: e
                }))
            }
            removeObserver(e) {
                this.#r = this.#r.filter(t => t !== e), this.scheduleGc(), this.#n.notify({
                    type: "observerRemoved",
                    mutation: this,
                    observer: e
                })
            }
            optionalRemove() {
                this.#r.length || ("pending" === this.state.status ? this.scheduleGc() : this.#n.remove(this))
            }
            continue () {
                return this.#a ? .continue() ? ? this.execute(this.state.variables)
            }
            async execute(e) {
                let t = () => {
                        this.#i({
                            type: "continue"
                        })
                    },
                    r = {
                        client: this.#t,
                        meta: this.options.meta,
                        mutationKey: this.options.mutationKey
                    };
                this.#a = (0, a.createRetryer)({
                    fn: () => this.options.mutationFn ? this.options.mutationFn(e, r) : Promise.reject(Error("No mutationFn found")),
                    onFail: (e, t) => {
                        this.#i({
                            type: "failed",
                            failureCount: e,
                            error: t
                        })
                    },
                    onPause: () => {
                        this.#i({
                            type: "pause"
                        })
                    },
                    onContinue: t,
                    retry: this.options.retry ? ? 0,
                    retryDelay: this.options.retryDelay,
                    networkMode: this.options.networkMode,
                    canRun: () => this.#n.canRun(this)
                });
                let n = "pending" === this.state.status,
                    i = !this.#a.canStart();
                try {
                    if (n) t();
                    else {
                        this.#i({
                            type: "pending",
                            variables: e,
                            isPaused: i
                        }), this.#n.config.onMutate && await this.#n.config.onMutate(e, this, r);
                        let t = await this.options.onMutate ? .(e, r);
                        t !== this.state.context && this.#i({
                            type: "pending",
                            context: t,
                            variables: e,
                            isPaused: i
                        })
                    }
                    let a = await this.#a.start();
                    return await this.#n.config.onSuccess ? .(a, e, this.state.context, this, r), await this.options.onSuccess ? .(a, e, this.state.context, r), await this.#n.config.onSettled ? .(a, null, this.state.variables, this.state.context, this, r), await this.options.onSettled ? .(a, null, e, this.state.context, r), this.#i({
                        type: "success",
                        data: a
                    }), a
                } catch (t) {
                    try {
                        await this.#n.config.onError ? .(t, e, this.state.context, this, r)
                    } catch (e) {
                        Promise.reject(e)
                    }
                    try {
                        await this.options.onError ? .(t, e, this.state.context, r)
                    } catch (e) {
                        Promise.reject(e)
                    }
                    try {
                        await this.#n.config.onSettled ? .(void 0, t, this.state.variables, this.state.context, this, r)
                    } catch (e) {
                        Promise.reject(e)
                    }
                    try {
                        await this.options.onSettled ? .(void 0, t, e, this.state.context, r)
                    } catch (e) {
                        Promise.reject(e)
                    }
                    throw this.#i({
                        type: "error",
                        error: t
                    }), t
                } finally {
                    this.#n.runNext(this)
                }
            }#
            i(e) {
                this.state = (t => {
                    switch (e.type) {
                        case "failed":
                            return { ...t,
                                failureCount: e.failureCount,
                                failureReason: e.error
                            };
                        case "pause":
                            return { ...t,
                                isPaused: !0
                            };
                        case "continue":
                            return { ...t,
                                isPaused: !1
                            };
                        case "pending":
                            return { ...t,
                                context: e.context,
                                data: void 0,
                                failureCount: 0,
                                failureReason: null,
                                error: null,
                                isPaused: e.isPaused,
                                status: "pending",
                                variables: e.variables,
                                submittedAt: Date.now()
                            };
                        case "success":
                            return { ...t,
                                data: e.data,
                                failureCount: 0,
                                failureReason: null,
                                error: null,
                                status: "success",
                                isPaused: !1
                            };
                        case "error":
                            return { ...t,
                                data: void 0,
                                error: e.error,
                                failureCount: t.failureCount + 1,
                                failureReason: e.error,
                                isPaused: !1,
                                status: "error"
                            }
                    }
                })(this.state), r.notifyManager.batch(() => {
                    this.#r.forEach(t => {
                        t.onMutationUpdate(e)
                    }), this.#n.notify({
                        mutation: this,
                        type: "updated",
                        action: e
                    })
                })
            }
        };

    function o() {
        return {
            context: void 0,
            data: void 0,
            error: null,
            failureCount: 0,
            failureReason: null,
            isPaused: !1,
            status: "idle",
            variables: void 0,
            submittedAt: 0
        }
    }
    e.s(["Mutation", 0, i, "getDefaultState", 0, o], 68126);
    var s = e.i(698576),
        l = e.i(122538),
        c = class extends s.Subscribable {#
            t;#
            o = void 0;#
            s;#
            l;
            constructor(e, t) {
                super(), this.#t = e, this.setOptions(t), this.bindMethods(), this.#c()
            }
            bindMethods() {
                this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this)
            }
            setOptions(e) {
                let t = this.options;
                this.options = this.#t.defaultMutationOptions(e), (0, l.shallowEqualObjects)(this.options, t) || this.#t.getMutationCache().notify({
                    type: "observerOptionsUpdated",
                    mutation: this.#s,
                    observer: this
                }), t ? .mutationKey && this.options.mutationKey && (0, l.hashKey)(t.mutationKey) !== (0, l.hashKey)(this.options.mutationKey) ? this.reset() : this.#s ? .state.status === "pending" && this.#s.setOptions(this.options)
            }
            onUnsubscribe() {
                this.hasListeners() || this.#s ? .removeObserver(this)
            }
            onMutationUpdate(e) {
                this.#c(), this.#u(e)
            }
            getCurrentResult() {
                return this.#o
            }
            reset() {
                this.#s ? .removeObserver(this), this.#s = void 0, this.#c(), this.#u()
            }
            mutate(e, t) {
                return this.#l = t, this.#s ? .removeObserver(this), this.#s = this.#t.getMutationCache().build(this.#t, this.options), this.#s.addObserver(this), this.#s.execute(e)
            }#
            c() {
                let e = this.#s ? .state ? ? o();
                this.#o = { ...e,
                    isPending: "pending" === e.status,
                    isSuccess: "success" === e.status,
                    isError: "error" === e.status,
                    isIdle: "idle" === e.status,
                    mutate: this.mutate,
                    reset: this.reset
                }
            }#
            u(e) {
                r.notifyManager.batch(() => {
                    if (this.#l && this.hasListeners()) {
                        let t = this.#o.variables,
                            r = this.#o.context,
                            n = {
                                client: this.#t,
                                meta: this.options.meta,
                                mutationKey: this.options.mutationKey
                            };
                        if (e ? .type === "success") {
                            try {
                                this.#l.onSuccess ? .(e.data, t, r, n)
                            } catch (e) {
                                Promise.reject(e)
                            }
                            try {
                                this.#l.onSettled ? .(e.data, null, t, r, n)
                            } catch (e) {
                                Promise.reject(e)
                            }
                        } else if (e ? .type === "error") {
                            try {
                                this.#l.onError ? .(e.error, t, r, n)
                            } catch (e) {
                                Promise.reject(e)
                            }
                            try {
                                this.#l.onSettled ? .(void 0, e.error, t, r, n)
                            } catch (e) {
                                Promise.reject(e)
                            }
                        }
                    }
                    this.listeners.forEach(e => {
                        e(this.#o)
                    })
                })
            }
        },
        u = e.i(318594);
    e.s(["useMutation", 0, function(e, n) {
        let a = (0, u.useQueryClient)(n),
            [i] = t.useState(() => new c(a, e));
        t.useEffect(() => {
            i.setOptions(e)
        }, [i, e]);
        let o = t.useSyncExternalStore(t.useCallback(e => i.subscribe(r.notifyManager.batchCalls(e)), [i]), () => i.getCurrentResult(), () => i.getCurrentResult()),
            s = t.useCallback((e, t) => {
                i.mutate(e, t).catch(l.noop)
            }, [i]);
        if (o.error && (0, l.shouldThrowError)(i.options.throwOnError, [o.error])) throw o.error;
        return { ...o,
            mutate: s,
            mutateAsync: o.mutate
        }
    }], 601550)
}, 923095, 784357, 851271, 459434, 263749, 573337, 693116, e => {
    "use strict";
    let t, r, n, a = Object.freeze({
        status: "aborted"
    });

    function i(e, t, r) {
        function n(r, n) {
            if (r._zod || Object.defineProperty(r, "_zod", {
                    value: {
                        def: n,
                        constr: o,
                        traits: new Set
                    },
                    enumerable: !1
                }), r._zod.traits.has(e)) return;
            r._zod.traits.add(e), t(r, n);
            let a = o.prototype,
                i = Object.keys(a);
            for (let e = 0; e < i.length; e++) {
                let t = i[e];
                t in r || (r[t] = a[t].bind(r))
            }
        }
        let a = r ? .Parent ? ? Object;
        class i extends a {}

        function o(e) {
            var t;
            let a = r ? .Parent ? new i : this;
            for (let r of (n(a, e), (t = a._zod).deferred ? ? (t.deferred = []), a._zod.deferred)) r();
            return a
        }
        return Object.defineProperty(i, "name", {
            value: e
        }), Object.defineProperty(o, "init", {
            value: n
        }), Object.defineProperty(o, Symbol.hasInstance, {
            value: t => !!r ? .Parent && t instanceof r.Parent || t ? ._zod ? .traits ? .has(e)
        }), Object.defineProperty(o, "name", {
            value: e
        }), o
    }
    let o = Symbol("zod_brand");
    class s extends Error {
        constructor() {
            super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")
        }
    }
    class l extends Error {
        constructor(e) {
            super(`Encountered unidirectional transform during encode: ${e}`), this.name = "ZodEncodeError"
        }
    }(nl = globalThis).__zod_globalConfig ? ? (nl.__zod_globalConfig = {});
    let c = globalThis.__zod_globalConfig;

    function u(e) {
        return e && Object.assign(c, e), c
    }

    function d(e) {
        let t = Object.values(e).filter(e => "number" == typeof e);
        return Object.entries(e).filter(([e, r]) => -1 === t.indexOf(+e)).map(([e, t]) => t)
    }

    function f(e, t = "|") {
        return e.map(e => P(e)).join(t)
    }

    function p(e, t) {
        return "bigint" == typeof t ? t.toString() : t
    }

    function h(e) {
        return {
            get value() {
                {
                    let t = e();
                    return Object.defineProperty(this, "value", {
                        value: t
                    }), t
                }
            }
        }
    }

    function m(e) {
        return null == e
    }

    function y(e) {
        let t = +!!e.startsWith("^"),
            r = e.endsWith("$") ? e.length - 1 : e.length;
        return e.slice(t, r)
    }

    function g(e, t) {
        let r = e / t,
            n = Math.round(r),
            a = Number.EPSILON * Math.max(Math.abs(r), 1);
        return Math.abs(r - n) < a ? 0 : r - n
    }
    e.s(["$ZodAsyncError", 0, s, "$ZodEncodeError", 0, l, "$brand", 0, o, "$constructor", 0, i, "NEVER", 0, a, "config", 0, u, "globalConfig", 0, c], 634760);
    let b = Symbol("evaluating");

    function v(e, t, r) {
        let n;
        Object.defineProperty(e, t, {
            get() {
                if (n !== b) return void 0 === n && (n = b, n = r()), n
            },
            set(r) {
                Object.defineProperty(e, t, {
                    value: r
                })
            },
            configurable: !0
        })
    }

    function x(e, t, r) {
        Object.defineProperty(e, t, {
            value: r,
            writable: !0,
            enumerable: !0,
            configurable: !0
        })
    }

    function w(...e) {
        let t = {};
        for (let r of e) Object.assign(t, Object.getOwnPropertyDescriptors(r));
        return Object.defineProperties({}, t)
    }

    function _(e) {
        return JSON.stringify(e)
    }

    function C(e) {
        return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "")
    }
    let E = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {};

    function S(e) {
        return "object" == typeof e && null !== e && !Array.isArray(e)
    }
    let A = h(() => {
        if (c.jitless || "u" > typeof navigator && navigator ? .userAgent ? .includes("Cloudflare")) return !1;
        try {
            return Function(""), !0
        } catch (e) {
            return !1
        }
    });

    function I(e) {
        if (!1 === S(e)) return !1;
        let t = e.constructor;
        if (void 0 === t || "function" != typeof t) return !0;
        let r = t.prototype;
        return !1 !== S(r) && !1 !== Object.prototype.hasOwnProperty.call(r, "isPrototypeOf")
    }

    function T(e) {
        return I(e) ? { ...e
        } : Array.isArray(e) ? [...e] : e instanceof Map ? new Map(e) : e instanceof Set ? new Set(e) : e
    }
    let k = new Set(["string", "number", "symbol"]),
        O = new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);

    function R(e) {
        return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")
    }

    function N(e, t, r) {
        let n = new e._zod.constr(t ? ? e._zod.def);
        return (!t || r ? .parent) && (n._zod.parent = e), n
    }

    function M(e) {
        if (!e) return {};
        if ("string" == typeof e) return {
            error: () => e
        };
        if (e ? .message !== void 0) {
            if (e ? .error !== void 0) throw Error("Cannot specify both `message` and `error` params");
            e.error = e.message
        }
        return (delete e.message, "string" == typeof e.error) ? { ...e,
            error: () => e.error
        } : e
    }

    function P(e) {
        return "bigint" == typeof e ? e.toString() + "n" : "string" == typeof e ? `"${e}"` : `${e}`
    }

    function D(e) {
        return Object.keys(e).filter(t => "optional" === e[t]._zod.optin && "optional" === e[t]._zod.optout)
    }
    let j = {
            safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
            int32: [-0x80000000, 0x7fffffff],
            uint32: [0, 0xffffffff],
            float32: [-34028234663852886e22, 34028234663852886e22],
            float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
        },
        L = {
            int64: [BigInt("-9223372036854775808"), BigInt("9223372036854775807")],
            uint64: [BigInt(0), BigInt("18446744073709551615")]
        };

    function F(e, t = 0) {
        if (!0 === e.aborted) return !0;
        for (let r = t; r < e.issues.length; r++)
            if (e.issues[r] ? .continue !== !0) return !0;
        return !1
    }

    function U(e, t = 0) {
        if (!0 === e.aborted) return !0;
        for (let r = t; r < e.issues.length; r++)
            if (e.issues[r] ? .continue === !1) return !0;
        return !1
    }

    function $(e, t) {
        return t.map(t => (t.path ? ? (t.path = []), t.path.unshift(e), t))
    }

    function z(e) {
        return "string" == typeof e ? e : e ? .message
    }

    function B(e, t, r) {
        let n = e.message ? e.message : z(e.inst ? ._zod.def ? .error ? .(e)) ? ? z(t ? .error ? .(e)) ? ? z(r.customError ? .(e)) ? ? z(r.localeError ? .(e)) ? ? "Invalid input",
            {
                inst: a,
                continue: i,
                input: o,
                ...s
            } = e;
        return s.path ? ? (s.path = []), s.message = n, t ? .reportInput && (s.input = o), s
    }

    function q(e) {
        return e instanceof Set ? "set" : e instanceof Map ? "map" : e instanceof File ? "file" : "unknown"
    }

    function W(e) {
        return Array.isArray(e) ? "array" : "string" == typeof e ? "string" : "unknown"
    }

    function Z(e) {
        let t = typeof e;
        switch (t) {
            case "number":
                return Number.isNaN(e) ? "nan" : "number";
            case "object":
                if (null === e) return "null";
                if (Array.isArray(e)) return "array";
                if (e && Object.getPrototypeOf(e) !== Object.prototype && "constructor" in e && e.constructor) return e.constructor.name
        }
        return t
    }

    function V(...e) {
        let [t, r, n] = e;
        return "string" == typeof t ? {
            message: t,
            code: "custom",
            input: r,
            inst: n
        } : { ...t
        }
    }

    function K(e) {
        let t = atob(e),
            r = new Uint8Array(t.length);
        for (let e = 0; e < t.length; e++) r[e] = t.charCodeAt(e);
        return r
    }

    function H(e) {
        let t = "";
        for (let r = 0; r < e.length; r++) t += String.fromCharCode(e[r]);
        return btoa(t)
    }
    e.s(["BIGINT_FORMAT_RANGES", 0, L, "Class", 0, class {
        constructor(...e) {}
    }, "NUMBER_FORMAT_RANGES", 0, j, "aborted", 0, F, "allowsEval", 0, A, "assert", 0, function(e) {}, "assertEqual", 0, function(e) {
        return e
    }, "assertIs", 0, function(e) {}, "assertNever", 0, function(e) {
        throw Error("Unexpected value in exhaustive check")
    }, "assertNotEqual", 0, function(e) {
        return e
    }, "assignProp", 0, x, "base64ToUint8Array", 0, K, "base64urlToUint8Array", 0, function(e) {
        let t = e.replace(/-/g, "+").replace(/_/g, "/"),
            r = "=".repeat((4 - t.length % 4) % 4);
        return K(t + r)
    }, "cached", 0, h, "captureStackTrace", 0, E, "cleanEnum", 0, function(e) {
        return Object.entries(e).filter(([e, t]) => Number.isNaN(Number.parseInt(e, 10))).map(e => e[1])
    }, "cleanRegex", 0, y, "clone", 0, N, "cloneDef", 0, function(e) {
        return w(e._zod.def)
    }, "createTransparentProxy", 0, function(e) {
        let t;
        return new Proxy({}, {
            get: (r, n, a) => (t ? ? (t = e()), Reflect.get(t, n, a)),
            set: (r, n, a, i) => (t ? ? (t = e()), Reflect.set(t, n, a, i)),
            has: (r, n) => (t ? ? (t = e()), Reflect.has(t, n)),
            deleteProperty: (r, n) => (t ? ? (t = e()), Reflect.deleteProperty(t, n)),
            ownKeys: r => (t ? ? (t = e()), Reflect.ownKeys(t)),
            getOwnPropertyDescriptor: (r, n) => (t ? ? (t = e()), Reflect.getOwnPropertyDescriptor(t, n)),
            defineProperty: (r, n, a) => (t ? ? (t = e()), Reflect.defineProperty(t, n, a))
        })
    }, "defineLazy", 0, v, "esc", 0, _, "escapeRegex", 0, R, "explicitlyAborted", 0, U, "extend", 0, function(e, t) {
        if (!I(t)) throw Error("Invalid input to extend: expected a plain object");
        let r = e._zod.def.checks;
        if (r && r.length > 0) {
            let r = e._zod.def.shape;
            for (let e in t)
                if (void 0 !== Object.getOwnPropertyDescriptor(r, e)) throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")
        }
        let n = w(e._zod.def, {
            get shape() {
                let r = { ...e._zod.def.shape,
                    ...t
                };
                return x(this, "shape", r), r
            }
        });
        return N(e, n)
    }, "finalizeIssue", 0, B, "floatSafeRemainder", 0, g, "getElementAtPath", 0, function(e, t) {
        return t ? t.reduce((e, t) => e ? .[t], e) : e
    }, "getEnumValues", 0, d, "getLengthableOrigin", 0, W, "getParsedType", 0, e => {
        let t = typeof e;
        switch (t) {
            case "undefined":
                return "undefined";
            case "string":
                return "string";
            case "number":
                return Number.isNaN(e) ? "nan" : "number";
            case "boolean":
                return "boolean";
            case "function":
                return "function";
            case "bigint":
                return "bigint";
            case "symbol":
                return "symbol";
            case "object":
                if (Array.isArray(e)) return "array";
                if (null === e) return "null";
                if (e.then && "function" == typeof e.then && e.catch && "function" == typeof e.catch) return "promise";
                if ("u" > typeof Map && e instanceof Map) return "map";
                if ("u" > typeof Set && e instanceof Set) return "set";
                if ("u" > typeof Date && e instanceof Date) return "date";
                if ("u" > typeof File && e instanceof File) return "file";
                return "object";
            default:
                throw Error(`Unknown data type: ${t}`)
        }
    }, "getSizableOrigin", 0, q, "hexToUint8Array", 0, function(e) {
        let t = e.replace(/^0x/, "");
        if (t.length % 2 != 0) throw Error("Invalid hex string length");
        let r = new Uint8Array(t.length / 2);
        for (let e = 0; e < t.length; e += 2) r[e / 2] = Number.parseInt(t.slice(e, e + 2), 16);
        return r
    }, "isObject", 0, S, "isPlainObject", 0, I, "issue", 0, V, "joinValues", 0, f, "jsonStringifyReplacer", 0, p, "merge", 0, function(e, t) {
        if (e._zod.def.checks ? .length) throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
        let r = w(e._zod.def, {
            get shape() {
                let r = { ...e._zod.def.shape,
                    ...t._zod.def.shape
                };
                return x(this, "shape", r), r
            },
            get catchall() {
                return t._zod.def.catchall
            },
            checks: t._zod.def.checks ? ? []
        });
        return N(e, r)
    }, "mergeDefs", 0, w, "normalizeParams", 0, M, "nullish", 0, m, "numKeys", 0, function(e) {
        let t = 0;
        for (let r in e) Object.prototype.hasOwnProperty.call(e, r) && t++;
        return t
    }, "objectClone", 0, function(e) {
        return Object.create(Object.getPrototypeOf(e), Object.getOwnPropertyDescriptors(e))
    }, "omit", 0, function(e, t) {
        let r = e._zod.def,
            n = r.checks;
        if (n && n.length > 0) throw Error(".omit() cannot be used on object schemas containing refinements");
        let a = w(e._zod.def, {
            get shape() {
                let n = { ...e._zod.def.shape
                };
                for (let e in t) {
                    if (!(e in r.shape)) throw Error(`Unrecognized key: "${e}"`);
                    t[e] && delete n[e]
                }
                return x(this, "shape", n), n
            },
            checks: []
        });
        return N(e, a)
    }, "optionalKeys", 0, D, "parsedType", 0, Z, "partial", 0, function(e, t, r) {
        let n = t._zod.def.checks;
        if (n && n.length > 0) throw Error(".partial() cannot be used on object schemas containing refinements");
        let a = w(t._zod.def, {
            get shape() {
                let n = t._zod.def.shape,
                    a = { ...n
                    };
                if (r)
                    for (let t in r) {
                        if (!(t in n)) throw Error(`Unrecognized key: "${t}"`);
                        r[t] && (a[t] = e ? new e({
                            type: "optional",
                            innerType: n[t]
                        }) : n[t])
                    } else
                        for (let t in n) a[t] = e ? new e({
                            type: "optional",
                            innerType: n[t]
                        }) : n[t];
                return x(this, "shape", a), a
            },
            checks: []
        });
        return N(t, a)
    }, "pick", 0, function(e, t) {
        let r = e._zod.def,
            n = r.checks;
        if (n && n.length > 0) throw Error(".pick() cannot be used on object schemas containing refinements");
        let a = w(e._zod.def, {
            get shape() {
                let e = {};
                for (let n in t) {
                    if (!(n in r.shape)) throw Error(`Unrecognized key: "${n}"`);
                    t[n] && (e[n] = r.shape[n])
                }
                return x(this, "shape", e), e
            },
            checks: []
        });
        return N(e, a)
    }, "prefixIssues", 0, $, "primitiveTypes", 0, O, "promiseAllObject", 0, function(e) {
        let t = Object.keys(e);
        return Promise.all(t.map(t => e[t])).then(e => {
            let r = {};
            for (let n = 0; n < t.length; n++) r[t[n]] = e[n];
            return r
        })
    }, "propertyKeyTypes", 0, k, "randomString", 0, function(e = 10) {
        let t = "abcdefghijklmnopqrstuvwxyz",
            r = "";
        for (let n = 0; n < e; n++) r += t[Math.floor(Math.random() * t.length)];
        return r
    }, "required", 0, function(e, t, r) {
        let n = w(t._zod.def, {
            get shape() {
                let n = t._zod.def.shape,
                    a = { ...n
                    };
                if (r)
                    for (let t in r) {
                        if (!(t in a)) throw Error(`Unrecognized key: "${t}"`);
                        r[t] && (a[t] = new e({
                            type: "nonoptional",
                            innerType: n[t]
                        }))
                    } else
                        for (let t in n) a[t] = new e({
                            type: "nonoptional",
                            innerType: n[t]
                        });
                return x(this, "shape", a), a
            }
        });
        return N(t, n)
    }, "safeExtend", 0, function(e, t) {
        if (!I(t)) throw Error("Invalid input to safeExtend: expected a plain object");
        let r = w(e._zod.def, {
            get shape() {
                let r = { ...e._zod.def.shape,
                    ...t
                };
                return x(this, "shape", r), r
            }
        });
        return N(e, r)
    }, "shallowClone", 0, T, "slugify", 0, C, "stringifyPrimitive", 0, P, "uint8ArrayToBase64", 0, H, "uint8ArrayToBase64url", 0, function(e) {
        return H(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "")
    }, "uint8ArrayToHex", 0, function(e) {
        return Array.from(e).map(e => e.toString(16).padStart(2, "0")).join("")
    }, "unwrapMessage", 0, z], 132412);
    u({
        localeError: (t = {
            string: {
                unit: "characters",
                verb: "to have"
            },
            file: {
                unit: "bytes",
                verb: "to have"
            },
            array: {
                unit: "items",
                verb: "to have"
            },
            set: {
                unit: "items",
                verb: "to have"
            },
            map: {
                unit: "entries",
                verb: "to have"
            }
        }, r = {
            regex: "input",
            email: "email address",
            url: "URL",
            emoji: "emoji",
            uuid: "UUID",
            uuidv4: "UUIDv4",
            uuidv6: "UUIDv6",
            nanoid: "nanoid",
            guid: "GUID",
            cuid: "cuid",
            cuid2: "cuid2",
            ulid: "ULID",
            xid: "XID",
            ksuid: "KSUID",
            datetime: "ISO datetime",
            date: "ISO date",
            time: "ISO time",
            duration: "ISO duration",
            ipv4: "IPv4 address",
            ipv6: "IPv6 address",
            mac: "MAC address",
            cidrv4: "IPv4 range",
            cidrv6: "IPv6 range",
            base64: "base64-encoded string",
            base64url: "base64url-encoded string",
            json_string: "JSON string",
            e164: "E.164 number",
            jwt: "JWT",
            template_literal: "input"
        }, n = {
            nan: "NaN"
        }, e => {
            switch (e.code) {
                case "invalid_type":
                    {
                        let t = n[e.expected] ? ? e.expected,
                            r = Z(e.input),
                            a = n[r] ? ? r;
                        return `Invalid input: expected ${t}, received ${a}`
                    }
                case "invalid_value":
                    if (1 === e.values.length) return `Invalid input: expected ${P(e.values[0])}`;
                    return `Invalid option: expected one of ${f(e.values,"|")}`;
                case "too_big":
                    {
                        let r = e.inclusive ? "<=" : "<",
                            n = t[e.origin] ? ? null;
                        if (n) return `Too big: expected ${e.origin??"value"} to have ${r}${e.maximum.toString()} ${n.unit??"elements"}`;
                        return `Too big: expected ${e.origin??"value"} to be ${r}${e.maximum.toString()}`
                    }
                case "too_small":
                    {
                        let r = e.inclusive ? ">=" : ">",
                            n = t[e.origin] ? ? null;
                        if (n) return `Too small: expected ${e.origin} to have ${r}${e.minimum.toString()} ${n.unit}`;
                        return `Too small: expected ${e.origin} to be ${r}${e.minimum.toString()}`
                    }
                case "invalid_format":
                    if ("starts_with" === e.format) return `Invalid string: must start with "${e.prefix}"`;
                    if ("ends_with" === e.format) return `Invalid string: must end with "${e.suffix}"`;
                    if ("includes" === e.format) return `Invalid string: must include "${e.includes}"`;
                    if ("regex" === e.format) return `Invalid string: must match pattern ${e.pattern}`;
                    return `Invalid ${r[e.format]??e.format}`;
                case "not_multiple_of":
                    return `Invalid number: must be a multiple of ${e.divisor}`;
                case "unrecognized_keys":
                    return `Unrecognized key${e.keys.length>1?"s":""}: ${f(e.keys,", ")}`;
                case "invalid_key":
                    return `Invalid key in ${e.origin}`;
                case "invalid_union":
                    if (e.options && Array.isArray(e.options) && e.options.length > 0) {
                        let t = e.options.map(e => `'${e}'`).join(" | ");
                        return `Invalid discriminator value. Expected ${t}`
                    }
                    return "Invalid input";
                case "invalid_element":
                    return `Invalid value in ${e.origin}`;
                default:
                    return "Invalid input"
            }
        })
    }), e.s([], 64014), e.i(64014), e.s([], 503444), e.i(503444), e.i(634760);
    let G = (e, t) => {
            e.name = "$ZodError", Object.defineProperty(e, "_zod", {
                value: e._zod,
                enumerable: !1
            }), Object.defineProperty(e, "issues", {
                value: t,
                enumerable: !1
            }), e.message = JSON.stringify(t, p, 2), Object.defineProperty(e, "toString", {
                value: () => e.message,
                enumerable: !1
            })
        },
        Q = i("$ZodError", G),
        J = i("$ZodError", G, {
            Parent: Error
        });

    function Y(e, t = e => e.message) {
        let r = {},
            n = [];
        for (let a of e.issues) a.path.length > 0 ? (r[a.path[0]] = r[a.path[0]] || [], r[a.path[0]].push(t(a))) : n.push(t(a));
        return {
            formErrors: n,
            fieldErrors: r
        }
    }

    function X(e, t = e => e.message) {
        let r = {
                _errors: []
            },
            n = (e, a = []) => {
                for (let i of e.issues)
                    if ("invalid_union" === i.code && i.errors.length) i.errors.map(e => n({
                        issues: e
                    }, [...a, ...i.path]));
                    else if ("invalid_key" === i.code) n({
                    issues: i.issues
                }, [...a, ...i.path]);
                else if ("invalid_element" === i.code) n({
                    issues: i.issues
                }, [...a, ...i.path]);
                else {
                    let e = [...a, ...i.path];
                    if (0 === e.length) r._errors.push(t(i));
                    else {
                        let n = r,
                            a = 0;
                        for (; a < e.length;) {
                            let r = e[a];
                            a === e.length - 1 ? (n[r] = n[r] || {
                                _errors: []
                            }, n[r]._errors.push(t(i))) : n[r] = n[r] || {
                                _errors: []
                            }, n = n[r], a++
                        }
                    }
                }
            };
        return n(e), r
    }

    function ee(e, t = e => e.message) {
        let r = {
                errors: []
            },
            n = (e, a = []) => {
                var i, o;
                for (let s of e.issues)
                    if ("invalid_union" === s.code && s.errors.length) s.errors.map(e => n({
                        issues: e
                    }, [...a, ...s.path]));
                    else if ("invalid_key" === s.code) n({
                    issues: s.issues
                }, [...a, ...s.path]);
                else if ("invalid_element" === s.code) n({
                    issues: s.issues
                }, [...a, ...s.path]);
                else {
                    let e = [...a, ...s.path];
                    if (0 === e.length) {
                        r.errors.push(t(s));
                        continue
                    }
                    let n = r,
                        l = 0;
                    for (; l < e.length;) {
                        let r = e[l],
                            a = l === e.length - 1;
                        "string" == typeof r ? (n.properties ? ? (n.properties = {}), (i = n.properties)[r] ? ? (i[r] = {
                            errors: []
                        }), n = n.properties[r]) : (n.items ? ? (n.items = []), (o = n.items)[r] ? ? (o[r] = {
                            errors: []
                        }), n = n.items[r]), a && n.errors.push(t(s)), l++
                    }
                }
            };
        return n(e), r
    }

    function et(e) {
        let t = [];
        for (let r of e.map(e => "object" == typeof e ? e.key : e)) "number" == typeof r ? t.push(`[${r}]`) : "symbol" == typeof r ? t.push(`[${JSON.stringify(String(r))}]`) : /[^\w$]/.test(r) ? t.push(`[${JSON.stringify(r)}]`) : (t.length && t.push("."), t.push(r));
        return t.join("")
    }

    function er(e) {
        let t = [];
        for (let r of [...e.issues].sort((e, t) => (e.path ? ? []).length - (t.path ? ? []).length)) t.push(`✖ ${r.message}`), r.path ? .length && t.push(`  → at ${et(r.path)}`);
        return t.join("\n")
    }
    e.s(["$ZodError", 0, Q, "$ZodRealError", 0, J, "flattenError", 0, Y, "formatError", 0, X, "prettifyError", 0, er, "toDotPath", 0, et, "treeifyError", 0, ee], 784357);
    let en = e => (t, r, n, a) => {
            let i = n ? { ...n,
                    async: !1
                } : {
                    async: !1
                },
                o = t._zod.run({
                    value: r,
                    issues: []
                }, i);
            if (o instanceof Promise) throw new s;
            if (o.issues.length) {
                let t = new(a ? .Err ? ? e)(o.issues.map(e => B(e, i, u())));
                throw E(t, a ? .callee), t
            }
            return o.value
        },
        ea = en(J),
        ei = e => async (t, r, n, a) => {
            let i = n ? { ...n,
                    async: !0
                } : {
                    async: !0
                },
                o = t._zod.run({
                    value: r,
                    issues: []
                }, i);
            if (o instanceof Promise && (o = await o), o.issues.length) {
                let t = new(a ? .Err ? ? e)(o.issues.map(e => B(e, i, u())));
                throw E(t, a ? .callee), t
            }
            return o.value
        },
        eo = ei(J),
        es = e => (t, r, n) => {
            let a = n ? { ...n,
                    async: !1
                } : {
                    async: !1
                },
                i = t._zod.run({
                    value: r,
                    issues: []
                }, a);
            if (i instanceof Promise) throw new s;
            return i.issues.length ? {
                success: !1,
                error: new(e ? ? Q)(i.issues.map(e => B(e, a, u())))
            } : {
                success: !0,
                data: i.value
            }
        },
        el = es(J),
        ec = e => async (t, r, n) => {
            let a = n ? { ...n,
                    async: !0
                } : {
                    async: !0
                },
                i = t._zod.run({
                    value: r,
                    issues: []
                }, a);
            return i instanceof Promise && (i = await i), i.issues.length ? {
                success: !1,
                error: new e(i.issues.map(e => B(e, a, u())))
            } : {
                success: !0,
                data: i.value
            }
        },
        eu = ec(J),
        ed = e => (t, r, n) => {
            let a = n ? { ...n,
                direction: "backward"
            } : {
                direction: "backward"
            };
            return en(e)(t, r, a)
        },
        ef = ed(J),
        ep = e => (t, r, n) => en(e)(t, r, n),
        eh = ep(J),
        em = e => async (t, r, n) => {
            let a = n ? { ...n,
                direction: "backward"
            } : {
                direction: "backward"
            };
            return ei(e)(t, r, a)
        },
        ey = em(J),
        eg = e => async (t, r, n) => ei(e)(t, r, n),
        eb = eg(J),
        ev = e => (t, r, n) => {
            let a = n ? { ...n,
                direction: "backward"
            } : {
                direction: "backward"
            };
            return es(e)(t, r, a)
        },
        ex = ev(J),
        ew = e => (t, r, n) => es(e)(t, r, n),
        e_ = ew(J),
        eC = e => async (t, r, n) => {
            let a = n ? { ...n,
                direction: "backward"
            } : {
                direction: "backward"
            };
            return ec(e)(t, r, a)
        },
        eE = eC(J),
        eS = e => async (t, r, n) => ec(e)(t, r, n),
        eA = eS(J);
    e.s(["_decode", 0, ep, "_decodeAsync", 0, eg, "_encode", 0, ed, "_encodeAsync", 0, em, "_parse", 0, en, "_parseAsync", 0, ei, "_safeDecode", 0, ew, "_safeDecodeAsync", 0, eS, "_safeEncode", 0, ev, "_safeEncodeAsync", 0, eC, "_safeParse", 0, es, "_safeParseAsync", 0, ec, "decode", 0, eh, "decodeAsync", 0, eb, "encode", 0, ef, "encodeAsync", 0, ey, "parse", 0, ea, "parseAsync", 0, eo, "safeDecode", 0, e_, "safeDecodeAsync", 0, eA, "safeEncode", 0, ex, "safeEncodeAsync", 0, eE, "safeParse", 0, el, "safeParseAsync", 0, eu], 851271), e.i(851271), e.i(784357);
    let eI = /^[cC][0-9a-z]{6,}$/,
        eT = /^[0-9a-z]+$/,
        ek = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,
        eO = /^[0-9a-vA-V]{20}$/,
        eR = /^[A-Za-z0-9]{27}$/,
        eN = /^[a-zA-Z0-9_-]{21}$/,
        eM = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,
        eP = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,
        eD = e => e ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,
        ej = eD(4),
        eL = eD(6),
        eF = eD(7),
        eU = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,
        e$ = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;

    function ez() {
        return RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")
    }
    let eB = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
        eq = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,
        eW = e => {
            let t = R(e ? ? ":");
            return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)
        },
        eZ = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,
        eV = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,
        eK = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,
        eH = /^[A-Za-z0-9_-]*$/,
        eG = /^https?$/,
        eQ = /^\+[1-9]\d{6,14}$/,
        eJ = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",
        eY = RegExp(`^${eJ}$`);

    function eX(e) {
        let t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
        return "number" == typeof e.precision ? -1 === e.precision ? `${t}` : 0 === e.precision ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`
    }

    function e0(e) {
        return RegExp(`^${eX(e)}$`)
    }

    function e1(e) {
        let t = eX({
                precision: e.precision
            }),
            r = ["Z"];
        e.local && r.push(""), e.offset && r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
        let n = `${t}(?:${r.join("|")})`;
        return RegExp(`^${eJ}T(?:${n})$`)
    }
    let e2 = e => {
            let t = e ? `[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}` : "[\\s\\S]*";
            return RegExp(`^${t}$`)
        },
        e6 = /^-?\d+n?$/,
        e5 = /^-?\d+$/,
        e3 = /^-?\d+(?:\.\d+)?$/,
        e4 = /^(?:true|false)$/i,
        e8 = /^null$/i,
        e7 = /^undefined$/i,
        e9 = /^[^A-Z]*$/,
        te = /^[^a-z]*$/;

    function tt(e, t) {
        return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)
    }

    function tr(e) {
        return RegExp(`^[A-Za-z0-9_-]{${e}}$`)
    }
    let tn = tt(22, "=="),
        ta = tr(22),
        ti = tt(27, "="),
        to = tr(27),
        ts = tt(43, "="),
        tl = tr(43),
        tc = tt(64, ""),
        tu = tr(64),
        td = tt(86, "=="),
        tf = tr(86);
    e.s(["base64", 0, eK, "base64url", 0, eH, "bigint", 0, e6, "boolean", 0, e4, "browserEmail", 0, /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, "cidrv4", 0, eZ, "cidrv6", 0, eV, "cuid", 0, eI, "cuid2", 0, eT, "date", 0, eY, "datetime", 0, e1, "domain", 0, /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/, "duration", 0, eM, "e164", 0, eQ, "email", 0, eU, "emoji", 0, ez, "extendedDuration", 0, /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, "guid", 0, eP, "hex", 0, /^[0-9a-fA-F]*$/, "hostname", 0, /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, "html5Email", 0, /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, "httpProtocol", 0, eG, "idnEmail", 0, e$, "integer", 0, e5, "ipv4", 0, eB, "ipv6", 0, eq, "ksuid", 0, eR, "lowercase", 0, e9, "mac", 0, eW, "md5_base64", 0, tn, "md5_base64url", 0, ta, "md5_hex", 0, /^[0-9a-fA-F]{32}$/, "nanoid", 0, eN, "null", 0, e8, "number", 0, e3, "rfc5322Email", 0, /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, "sha1_base64", 0, ti, "sha1_base64url", 0, to, "sha1_hex", 0, /^[0-9a-fA-F]{40}$/, "sha256_base64", 0, ts, "sha256_base64url", 0, tl, "sha256_hex", 0, /^[0-9a-fA-F]{64}$/, "sha384_base64", 0, tc, "sha384_base64url", 0, tu, "sha384_hex", 0, /^[0-9a-fA-F]{96}$/, "sha512_base64", 0, td, "sha512_base64url", 0, tf, "sha512_hex", 0, /^[0-9a-fA-F]{128}$/, "string", 0, e2, "time", 0, e0, "ulid", 0, ek, "undefined", 0, e7, "unicodeEmail", 0, e$, "uppercase", 0, te, "uuid", 0, eD, "uuid4", 0, ej, "uuid6", 0, eL, "uuid7", 0, eF, "xid", 0, eO], 43513);
    let tp = i("$ZodCheck", (e, t) => {
            var r;
            e._zod ? ? (e._zod = {}), e._zod.def = t, (r = e._zod).onattach ? ? (r.onattach = [])
        }),
        th = {
            number: "number",
            bigint: "bigint",
            object: "date"
        },
        tm = i("$ZodCheckLessThan", (e, t) => {
            tp.init(e, t);
            let r = th[typeof t.value];
            e._zod.onattach.push(e => {
                let r = e._zod.bag,
                    n = (t.inclusive ? r.maximum : r.exclusiveMaximum) ? ? 1 / 0;
                t.value < n && (t.inclusive ? r.maximum = t.value : r.exclusiveMaximum = t.value)
            }), e._zod.check = n => {
                (t.inclusive ? n.value <= t.value : n.value < t.value) || n.issues.push({
                    origin: r,
                    code: "too_big",
                    maximum: "object" == typeof t.value ? t.value.getTime() : t.value,
                    input: n.value,
                    inclusive: t.inclusive,
                    inst: e,
                    continue: !t.abort
                })
            }
        }),
        ty = i("$ZodCheckGreaterThan", (e, t) => {
            tp.init(e, t);
            let r = th[typeof t.value];
            e._zod.onattach.push(e => {
                let r = e._zod.bag,
                    n = (t.inclusive ? r.minimum : r.exclusiveMinimum) ? ? -1 / 0;
                t.value > n && (t.inclusive ? r.minimum = t.value : r.exclusiveMinimum = t.value)
            }), e._zod.check = n => {
                (t.inclusive ? n.value >= t.value : n.value > t.value) || n.issues.push({
                    origin: r,
                    code: "too_small",
                    minimum: "object" == typeof t.value ? t.value.getTime() : t.value,
                    input: n.value,
                    inclusive: t.inclusive,
                    inst: e,
                    continue: !t.abort
                })
            }
        }),
        tg = i("$ZodCheckMultipleOf", (e, t) => {
            tp.init(e, t), e._zod.onattach.push(e => {
                var r;
                (r = e._zod.bag).multipleOf ? ? (r.multipleOf = t.value)
            }), e._zod.check = r => {
                if (typeof r.value != typeof t.value) throw Error("Cannot mix number and bigint in multiple_of check.");
                ("bigint" == typeof r.value ? r.value % t.value === BigInt(0) : 0 === g(r.value, t.value)) || r.issues.push({
                    origin: typeof r.value,
                    code: "not_multiple_of",
                    divisor: t.value,
                    input: r.value,
                    inst: e,
                    continue: !t.abort
                })
            }
        }),
        tb = i("$ZodCheckNumberFormat", (e, t) => {
            tp.init(e, t), t.format = t.format || "float64";
            let r = t.format ? .includes("int"),
                n = r ? "int" : "number",
                [a, i] = j[t.format];
            e._zod.onattach.push(e => {
                let n = e._zod.bag;
                n.format = t.format, n.minimum = a, n.maximum = i, r && (n.pattern = e5)
            }), e._zod.check = o => {
                let s = o.value;
                if (r) {
                    if (!Number.isInteger(s)) return void o.issues.push({
                        expected: n,
                        format: t.format,
                        code: "invalid_type",
                        continue: !1,
                        input: s,
                        inst: e
                    });
                    if (!Number.isSafeInteger(s)) return void(s > 0 ? o.issues.push({
                        input: s,
                        code: "too_big",
                        maximum: Number.MAX_SAFE_INTEGER,
                        note: "Integers must be within the safe integer range.",
                        inst: e,
                        origin: n,
                        inclusive: !0,
                        continue: !t.abort
                    }) : o.issues.push({
                        input: s,
                        code: "too_small",
                        minimum: Number.MIN_SAFE_INTEGER,
                        note: "Integers must be within the safe integer range.",
                        inst: e,
                        origin: n,
                        inclusive: !0,
                        continue: !t.abort
                    }))
                }
                s < a && o.issues.push({
                    origin: "number",
                    input: s,
                    code: "too_small",
                    minimum: a,
                    inclusive: !0,
                    inst: e,
                    continue: !t.abort
                }), s > i && o.issues.push({
                    origin: "number",
                    input: s,
                    code: "too_big",
                    maximum: i,
                    inclusive: !0,
                    inst: e,
                    continue: !t.abort
                })
            }
        }),
        tv = i("$ZodCheckBigIntFormat", (e, t) => {
            tp.init(e, t);
            let [r, n] = L[t.format];
            e._zod.onattach.push(e => {
                let a = e._zod.bag;
                a.format = t.format, a.minimum = r, a.maximum = n
            }), e._zod.check = a => {
                let i = a.value;
                i < r && a.issues.push({
                    origin: "bigint",
                    input: i,
                    code: "too_small",
                    minimum: r,
                    inclusive: !0,
                    inst: e,
                    continue: !t.abort
                }), i > n && a.issues.push({
                    origin: "bigint",
                    input: i,
                    code: "too_big",
                    maximum: n,
                    inclusive: !0,
                    inst: e,
                    continue: !t.abort
                })
            }
        }),
        tx = i("$ZodCheckMaxSize", (e, t) => {
            var r;
            tp.init(e, t), (r = e._zod.def).when ? ? (r.when = e => {
                let t = e.value;
                return !m(t) && void 0 !== t.size
            }), e._zod.onattach.push(e => {
                let r = e._zod.bag.maximum ? ? 1 / 0;
                t.maximum < r && (e._zod.bag.maximum = t.maximum)
            }), e._zod.check = r => {
                let n = r.value;
                n.size <= t.maximum || r.issues.push({
                    origin: q(n),
                    code: "too_big",
                    maximum: t.maximum,
                    inclusive: !0,
                    input: n,
                    inst: e,
                    continue: !t.abort
                })
            }
        }),
        tw = i("$ZodCheckMinSize", (e, t) => {
            var r;
            tp.init(e, t), (r = e._zod.def).when ? ? (r.when = e => {
                let t = e.value;
                return !m(t) && void 0 !== t.size
            }), e._zod.onattach.push(e => {
                let r = e._zod.bag.minimum ? ? -1 / 0;
                t.minimum > r && (e._zod.bag.minimum = t.minimum)
            }), e._zod.check = r => {
                let n = r.value;
                n.size >= t.minimum || r.issues.push({
                    origin: q(n),
                    code: "too_small",
                    minimum: t.minimum,
                    inclusive: !0,
                    input: n,
                    inst: e,
                    continue: !t.abort
                })
            }
        }),
        t_ = i("$ZodCheckSizeEquals", (e, t) => {
            var r;
            tp.init(e, t), (r = e._zod.def).when ? ? (r.when = e => {
                let t = e.value;
                return !m(t) && void 0 !== t.size
            }), e._zod.onattach.push(e => {
                let r = e._zod.bag;
                r.minimum = t.size, r.maximum = t.size, r.size = t.size
            }), e._zod.check = r => {
                let n = r.value,
                    a = n.size;
                if (a === t.size) return;
                let i = a > t.size;
                r.issues.push({
                    origin: q(n),
                    ...i ? {
                        code: "too_big",
                        maximum: t.size
                    } : {
                        code: "too_small",
                        minimum: t.size
                    },
                    inclusive: !0,
                    exact: !0,
                    input: r.value,
                    inst: e,
                    continue: !t.abort
                })
            }
        }),
        tC = i("$ZodCheckMaxLength", (e, t) => {
            var r;
            tp.init(e, t), (r = e._zod.def).when ? ? (r.when = e => {
                let t = e.value;
                return !m(t) && void 0 !== t.length
            }), e._zod.onattach.push(e => {
                let r = e._zod.bag.maximum ? ? 1 / 0;
                t.maximum < r && (e._zod.bag.maximum = t.maximum)
            }), e._zod.check = r => {
                let n = r.value;
                if (n.length <= t.maximum) return;
                let a = W(n);
                r.issues.push({
                    origin: a,
                    code: "too_big",
                    maximum: t.maximum,
                    inclusive: !0,
                    input: n,
                    inst: e,
                    continue: !t.abort
                })
            }
        }),
        tE = i("$ZodCheckMinLength", (e, t) => {
            var r;
            tp.init(e, t), (r = e._zod.def).when ? ? (r.when = e => {
                let t = e.value;
                return !m(t) && void 0 !== t.length
            }), e._zod.onattach.push(e => {
                let r = e._zod.bag.minimum ? ? -1 / 0;
                t.minimum > r && (e._zod.bag.minimum = t.minimum)
            }), e._zod.check = r => {
                let n = r.value;
                if (n.length >= t.minimum) return;
                let a = W(n);
                r.issues.push({
                    origin: a,
                    code: "too_small",
                    minimum: t.minimum,
                    inclusive: !0,
                    input: n,
                    inst: e,
                    continue: !t.abort
                })
            }
        }),
        tS = i("$ZodCheckLengthEquals", (e, t) => {
            var r;
            tp.init(e, t), (r = e._zod.def).when ? ? (r.when = e => {
                let t = e.value;
                return !m(t) && void 0 !== t.length
            }), e._zod.onattach.push(e => {
                let r = e._zod.bag;
                r.minimum = t.length, r.maximum = t.length, r.length = t.length
            }), e._zod.check = r => {
                let n = r.value,
                    a = n.length;
                if (a === t.length) return;
                let i = W(n),
                    o = a > t.length;
                r.issues.push({
                    origin: i,
                    ...o ? {
                        code: "too_big",
                        maximum: t.length
                    } : {
                        code: "too_small",
                        minimum: t.length
                    },
                    inclusive: !0,
                    exact: !0,
                    input: r.value,
                    inst: e,
                    continue: !t.abort
                })
            }
        }),
        tA = i("$ZodCheckStringFormat", (e, t) => {
            var r, n;
            tp.init(e, t), e._zod.onattach.push(e => {
                let r = e._zod.bag;
                r.format = t.format, t.pattern && (r.patterns ? ? (r.patterns = new Set), r.patterns.add(t.pattern))
            }), t.pattern ? (r = e._zod).check ? ? (r.check = r => {
                t.pattern.lastIndex = 0, t.pattern.test(r.value) || r.issues.push({
                    origin: "string",
                    code: "invalid_format",
                    format: t.format,
                    input: r.value,
                    ...t.pattern ? {
                        pattern: t.pattern.toString()
                    } : {},
                    inst: e,
                    continue: !t.abort
                })
            }) : (n = e._zod).check ? ? (n.check = () => {})
        }),
        tI = i("$ZodCheckRegex", (e, t) => {
            tA.init(e, t), e._zod.check = r => {
                t.pattern.lastIndex = 0, t.pattern.test(r.value) || r.issues.push({
                    origin: "string",
                    code: "invalid_format",
                    format: "regex",
                    input: r.value,
                    pattern: t.pattern.toString(),
                    inst: e,
                    continue: !t.abort
                })
            }
        }),
        tT = i("$ZodCheckLowerCase", (e, t) => {
            t.pattern ? ? (t.pattern = e9), tA.init(e, t)
        }),
        tk = i("$ZodCheckUpperCase", (e, t) => {
            t.pattern ? ? (t.pattern = te), tA.init(e, t)
        }),
        tO = i("$ZodCheckIncludes", (e, t) => {
            tp.init(e, t);
            let r = R(t.includes),
                n = new RegExp("number" == typeof t.position ? `^.{${t.position}}${r}` : r);
            t.pattern = n, e._zod.onattach.push(e => {
                let t = e._zod.bag;
                t.patterns ? ? (t.patterns = new Set), t.patterns.add(n)
            }), e._zod.check = r => {
                r.value.includes(t.includes, t.position) || r.issues.push({
                    origin: "string",
                    code: "invalid_format",
                    format: "includes",
                    includes: t.includes,
                    input: r.value,
                    inst: e,
                    continue: !t.abort
                })
            }
        }),
        tR = i("$ZodCheckStartsWith", (e, t) => {
            tp.init(e, t);
            let r = RegExp(`^${R(t.prefix)}.*`);
            t.pattern ? ? (t.pattern = r), e._zod.onattach.push(e => {
                let t = e._zod.bag;
                t.patterns ? ? (t.patterns = new Set), t.patterns.add(r)
            }), e._zod.check = r => {
                r.value.startsWith(t.prefix) || r.issues.push({
                    origin: "string",
                    code: "invalid_format",
                    format: "starts_with",
                    prefix: t.prefix,
                    input: r.value,
                    inst: e,
                    continue: !t.abort
                })
            }
        }),
        tN = i("$ZodCheckEndsWith", (e, t) => {
            tp.init(e, t);
            let r = RegExp(`.*${R(t.suffix)}$`);
            t.pattern ? ? (t.pattern = r), e._zod.onattach.push(e => {
                let t = e._zod.bag;
                t.patterns ? ? (t.patterns = new Set), t.patterns.add(r)
            }), e._zod.check = r => {
                r.value.endsWith(t.suffix) || r.issues.push({
                    origin: "string",
                    code: "invalid_format",
                    format: "ends_with",
                    suffix: t.suffix,
                    input: r.value,
                    inst: e,
                    continue: !t.abort
                })
            }
        });

    function tM(e, t, r) {
        e.issues.length && t.issues.push(...$(r, e.issues))
    }
    let tP = i("$ZodCheckProperty", (e, t) => {
            tp.init(e, t), e._zod.check = e => {
                let r = t.schema._zod.run({
                    value: e.value[t.property],
                    issues: []
                }, {});
                if (r instanceof Promise) return r.then(r => tM(r, e, t.property));
                tM(r, e, t.property)
            }
        }),
        tD = i("$ZodCheckMimeType", (e, t) => {
            tp.init(e, t);
            let r = new Set(t.mime);
            e._zod.onattach.push(e => {
                e._zod.bag.mime = t.mime
            }), e._zod.check = n => {
                r.has(n.value.type) || n.issues.push({
                    code: "invalid_value",
                    values: t.mime,
                    input: n.value.type,
                    inst: e,
                    continue: !t.abort
                })
            }
        }),
        tj = i("$ZodCheckOverwrite", (e, t) => {
            tp.init(e, t), e._zod.check = e => {
                e.value = t.tx(e.value)
            }
        });
    e.s(["$ZodCheck", 0, tp, "$ZodCheckBigIntFormat", 0, tv, "$ZodCheckEndsWith", 0, tN, "$ZodCheckGreaterThan", 0, ty, "$ZodCheckIncludes", 0, tO, "$ZodCheckLengthEquals", 0, tS, "$ZodCheckLessThan", 0, tm, "$ZodCheckLowerCase", 0, tT, "$ZodCheckMaxLength", 0, tC, "$ZodCheckMaxSize", 0, tx, "$ZodCheckMimeType", 0, tD, "$ZodCheckMinLength", 0, tE, "$ZodCheckMinSize", 0, tw, "$ZodCheckMultipleOf", 0, tg, "$ZodCheckNumberFormat", 0, tb, "$ZodCheckOverwrite", 0, tj, "$ZodCheckProperty", 0, tP, "$ZodCheckRegex", 0, tI, "$ZodCheckSizeEquals", 0, t_, "$ZodCheckStartsWith", 0, tR, "$ZodCheckStringFormat", 0, tA, "$ZodCheckUpperCase", 0, tk], 32912);
    class tL {
        constructor(e = []) {
            this.content = [], this.indent = 0, this && (this.args = e)
        }
        indented(e) {
            this.indent += 1, e(this), this.indent -= 1
        }
        write(e) {
            if ("function" == typeof e) {
                e(this, {
                    execution: "sync"
                }), e(this, {
                    execution: "async"
                });
                return
            }
            let t = e.split("\n").filter(e => e),
                r = Math.min(...t.map(e => e.length - e.trimStart().length));
            for (let e of t.map(e => e.slice(r)).map(e => " ".repeat(2 * this.indent) + e)) this.content.push(e)
        }
        compile() {
            return Function(...this ? .args, [...(this ? .content ? ? [""]).map(e => `  ${e}`)].join("\n"))
        }
    }
    e.s(["Doc", 0, tL], 4651);
    let tF = {
        major: 4,
        minor: 4,
        patch: 3
    };
    e.s(["version", 0, tF], 415432);
    let tU = i("$ZodType", (e, t) => {
            var r;
            e ? ? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = tF;
            let n = [...e._zod.def.checks ? ? []];
            for (let t of (e._zod.traits.has("$ZodCheck") && n.unshift(e), n))
                for (let r of t._zod.onattach) r(e);
            if (0 === n.length)(r = e._zod).deferred ? ? (r.deferred = []), e._zod.deferred ? .push(() => {
                e._zod.run = e._zod.parse
            });
            else {
                let t = (e, t, r) => {
                        let n, a = F(e);
                        for (let i of t) {
                            if (i._zod.def.when) {
                                if (U(e) || !i._zod.def.when(e)) continue
                            } else if (a) continue;
                            let t = e.issues.length,
                                o = i._zod.check(e);
                            if (o instanceof Promise && r ? .async === !1) throw new s;
                            if (n || o instanceof Promise) n = (n ? ? Promise.resolve()).then(async () => {
                                await o, e.issues.length !== t && (a || (a = F(e, t)))
                            });
                            else {
                                if (e.issues.length === t) continue;
                                a || (a = F(e, t))
                            }
                        }
                        return n ? n.then(() => e) : e
                    },
                    r = (r, a, i) => {
                        if (F(r)) return r.aborted = !0, r;
                        let o = t(a, n, i);
                        if (o instanceof Promise) {
                            if (!1 === i.async) throw new s;
                            return o.then(t => e._zod.parse(t, i))
                        }
                        return e._zod.parse(o, i)
                    };
                e._zod.run = (a, i) => {
                    if (i.skipChecks) return e._zod.parse(a, i);
                    if ("backward" === i.direction) {
                        let t = e._zod.parse({
                            value: a.value,
                            issues: []
                        }, { ...i,
                            skipChecks: !0
                        });
                        return t instanceof Promise ? t.then(e => r(e, a, i)) : r(t, a, i)
                    }
                    let o = e._zod.parse(a, i);
                    if (o instanceof Promise) {
                        if (!1 === i.async) throw new s;
                        return o.then(e => t(e, n, i))
                    }
                    return t(o, n, i)
                }
            }
            v(e, "~standard", () => ({
                validate: t => {
                    try {
                        let r = el(e, t);
                        return r.success ? {
                            value: r.data
                        } : {
                            issues: r.error ? .issues
                        }
                    } catch (r) {
                        return eu(e, t).then(e => e.success ? {
                            value: e.data
                        } : {
                            issues: e.error ? .issues
                        })
                    }
                },
                vendor: "zod",
                version: 1
            }))
        }),
        t$ = i("$ZodString", (e, t) => {
            tU.init(e, t), e._zod.pattern = [...e ? ._zod.bag ? .patterns ? ? []].pop() ? ? e2(e._zod.bag), e._zod.parse = (r, n) => {
                if (t.coerce) try {
                    r.value = String(r.value)
                } catch (e) {}
                return "string" == typeof r.value || r.issues.push({
                    expected: "string",
                    code: "invalid_type",
                    input: r.value,
                    inst: e
                }), r
            }
        }),
        tz = i("$ZodStringFormat", (e, t) => {
            tA.init(e, t), t$.init(e, t)
        }),
        tB = i("$ZodGUID", (e, t) => {
            t.pattern ? ? (t.pattern = eP), tz.init(e, t)
        }),
        tq = i("$ZodUUID", (e, t) => {
            if (t.version) {
                let e = {
                    v1: 1,
                    v2: 2,
                    v3: 3,
                    v4: 4,
                    v5: 5,
                    v6: 6,
                    v7: 7,
                    v8: 8
                }[t.version];
                if (void 0 === e) throw Error(`Invalid UUID version: "${t.version}"`);
                t.pattern ? ? (t.pattern = eD(e))
            } else t.pattern ? ? (t.pattern = eD());
            tz.init(e, t)
        }),
        tW = i("$ZodEmail", (e, t) => {
            t.pattern ? ? (t.pattern = eU), tz.init(e, t)
        }),
        tZ = i("$ZodURL", (e, t) => {
            tz.init(e, t), e._zod.check = r => {
                try {
                    let n = r.value.trim();
                    if (!t.normalize && t.protocol ? .source === eG.source && !/^https?:\/\//i.test(n)) return void r.issues.push({
                        code: "invalid_format",
                        format: "url",
                        note: "Invalid URL format",
                        input: r.value,
                        inst: e,
                        continue: !t.abort
                    });
                    let a = new URL(n);
                    t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(a.hostname) || r.issues.push({
                        code: "invalid_format",
                        format: "url",
                        note: "Invalid hostname",
                        pattern: t.hostname.source,
                        input: r.value,
                        inst: e,
                        continue: !t.abort
                    })), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(a.protocol.endsWith(":") ? a.protocol.slice(0, -1) : a.protocol) || r.issues.push({
                        code: "invalid_format",
                        format: "url",
                        note: "Invalid protocol",
                        pattern: t.protocol.source,
                        input: r.value,
                        inst: e,
                        continue: !t.abort
                    })), t.normalize ? r.value = a.href : r.value = n;
                    return
                } catch (n) {
                    r.issues.push({
                        code: "invalid_format",
                        format: "url",
                        input: r.value,
                        inst: e,
                        continue: !t.abort
                    })
                }
            }
        }),
        tV = i("$ZodEmoji", (e, t) => {
            t.pattern ? ? (t.pattern = ez()), tz.init(e, t)
        }),
        tK = i("$ZodNanoID", (e, t) => {
            t.pattern ? ? (t.pattern = eN), tz.init(e, t)
        }),
        tH = i("$ZodCUID", (e, t) => {
            t.pattern ? ? (t.pattern = eI), tz.init(e, t)
        }),
        tG = i("$ZodCUID2", (e, t) => {
            t.pattern ? ? (t.pattern = eT), tz.init(e, t)
        }),
        tQ = i("$ZodULID", (e, t) => {
            t.pattern ? ? (t.pattern = ek), tz.init(e, t)
        }),
        tJ = i("$ZodXID", (e, t) => {
            t.pattern ? ? (t.pattern = eO), tz.init(e, t)
        }),
        tY = i("$ZodKSUID", (e, t) => {
            t.pattern ? ? (t.pattern = eR), tz.init(e, t)
        }),
        tX = i("$ZodISODateTime", (e, t) => {
            t.pattern ? ? (t.pattern = e1(t)), tz.init(e, t)
        }),
        t0 = i("$ZodISODate", (e, t) => {
            t.pattern ? ? (t.pattern = eY), tz.init(e, t)
        }),
        t1 = i("$ZodISOTime", (e, t) => {
            t.pattern ? ? (t.pattern = e0(t)), tz.init(e, t)
        }),
        t2 = i("$ZodISODuration", (e, t) => {
            t.pattern ? ? (t.pattern = eM), tz.init(e, t)
        }),
        t6 = i("$ZodIPv4", (e, t) => {
            t.pattern ? ? (t.pattern = eB), tz.init(e, t), e._zod.bag.format = "ipv4"
        }),
        t5 = i("$ZodIPv6", (e, t) => {
            t.pattern ? ? (t.pattern = eq), tz.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = r => {
                try {
                    new URL(`http://[${r.value}]`)
                } catch {
                    r.issues.push({
                        code: "invalid_format",
                        format: "ipv6",
                        input: r.value,
                        inst: e,
                        continue: !t.abort
                    })
                }
            }
        }),
        t3 = i("$ZodMAC", (e, t) => {
            t.pattern ? ? (t.pattern = eW(t.delimiter)), tz.init(e, t), e._zod.bag.format = "mac"
        }),
        t4 = i("$ZodCIDRv4", (e, t) => {
            t.pattern ? ? (t.pattern = eZ), tz.init(e, t)
        }),
        t8 = i("$ZodCIDRv6", (e, t) => {
            t.pattern ? ? (t.pattern = eV), tz.init(e, t), e._zod.check = r => {
                let n = r.value.split("/");
                try {
                    if (2 !== n.length) throw Error();
                    let [e, t] = n;
                    if (!t) throw Error();
                    let r = Number(t);
                    if (`${r}` !== t || r < 0 || r > 128) throw Error();
                    new URL(`http://[${e}]`)
                } catch {
                    r.issues.push({
                        code: "invalid_format",
                        format: "cidrv6",
                        input: r.value,
                        inst: e,
                        continue: !t.abort
                    })
                }
            }
        });

    function t7(e) {
        if ("" === e) return !0;
        if (/\s/.test(e) || e.length % 4 != 0) return !1;
        try {
            return atob(e), !0
        } catch {
            return !1
        }
    }
    let t9 = i("$ZodBase64", (e, t) => {
        t.pattern ? ? (t.pattern = eK), tz.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = r => {
            t7(r.value) || r.issues.push({
                code: "invalid_format",
                format: "base64",
                input: r.value,
                inst: e,
                continue: !t.abort
            })
        }
    });

    function re(e) {
        if (!eH.test(e)) return !1;
        let t = e.replace(/[-_]/g, e => "-" === e ? "+" : "/");
        return t7(t.padEnd(4 * Math.ceil(t.length / 4), "="))
    }
    let rt = i("$ZodBase64URL", (e, t) => {
            t.pattern ? ? (t.pattern = eH), tz.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = r => {
                re(r.value) || r.issues.push({
                    code: "invalid_format",
                    format: "base64url",
                    input: r.value,
                    inst: e,
                    continue: !t.abort
                })
            }
        }),
        rr = i("$ZodE164", (e, t) => {
            t.pattern ? ? (t.pattern = eQ), tz.init(e, t)
        });

    function rn(e, t = null) {
        try {
            let r = e.split(".");
            if (3 !== r.length) return !1;
            let [n] = r;
            if (!n) return !1;
            let a = JSON.parse(atob(n));
            if ("typ" in a && a ? .typ !== "JWT" || !a.alg || t && (!("alg" in a) || a.alg !== t)) return !1;
            return !0
        } catch {
            return !1
        }
    }
    let ra = i("$ZodJWT", (e, t) => {
            tz.init(e, t), e._zod.check = r => {
                rn(r.value, t.alg) || r.issues.push({
                    code: "invalid_format",
                    format: "jwt",
                    input: r.value,
                    inst: e,
                    continue: !t.abort
                })
            }
        }),
        ri = i("$ZodCustomStringFormat", (e, t) => {
            tz.init(e, t), e._zod.check = r => {
                t.fn(r.value) || r.issues.push({
                    code: "invalid_format",
                    format: t.format,
                    input: r.value,
                    inst: e,
                    continue: !t.abort
                })
            }
        }),
        ro = i("$ZodNumber", (e, t) => {
            tU.init(e, t), e._zod.pattern = e._zod.bag.pattern ? ? e3, e._zod.parse = (r, n) => {
                if (t.coerce) try {
                    r.value = Number(r.value)
                } catch (e) {}
                let a = r.value;
                if ("number" == typeof a && !Number.isNaN(a) && Number.isFinite(a)) return r;
                let i = "number" == typeof a ? Number.isNaN(a) ? "NaN" : Number.isFinite(a) ? void 0 : "Infinity" : void 0;
                return r.issues.push({
                    expected: "number",
                    code: "invalid_type",
                    input: a,
                    inst: e,
                    ...i ? {
                        received: i
                    } : {}
                }), r
            }
        }),
        rs = i("$ZodNumberFormat", (e, t) => {
            tb.init(e, t), ro.init(e, t)
        }),
        rl = i("$ZodBoolean", (e, t) => {
            tU.init(e, t), e._zod.pattern = e4, e._zod.parse = (r, n) => {
                if (t.coerce) try {
                    r.value = !!r.value
                } catch (e) {}
                let a = r.value;
                return "boolean" == typeof a || r.issues.push({
                    expected: "boolean",
                    code: "invalid_type",
                    input: a,
                    inst: e
                }), r
            }
        }),
        rc = i("$ZodBigInt", (e, t) => {
            tU.init(e, t), e._zod.pattern = e6, e._zod.parse = (r, n) => {
                if (t.coerce) try {
                    r.value = BigInt(r.value)
                } catch (e) {}
                return "bigint" == typeof r.value || r.issues.push({
                    expected: "bigint",
                    code: "invalid_type",
                    input: r.value,
                    inst: e
                }), r
            }
        }),
        ru = i("$ZodBigIntFormat", (e, t) => {
            tv.init(e, t), rc.init(e, t)
        }),
        rd = i("$ZodSymbol", (e, t) => {
            tU.init(e, t), e._zod.parse = (t, r) => {
                let n = t.value;
                return "symbol" == typeof n || t.issues.push({
                    expected: "symbol",
                    code: "invalid_type",
                    input: n,
                    inst: e
                }), t
            }
        }),
        rf = i("$ZodUndefined", (e, t) => {
            tU.init(e, t), e._zod.pattern = e7, e._zod.values = new Set([void 0]), e._zod.parse = (t, r) => {
                let n = t.value;
                return void 0 === n || t.issues.push({
                    expected: "undefined",
                    code: "invalid_type",
                    input: n,
                    inst: e
                }), t
            }
        }),
        rp = i("$ZodNull", (e, t) => {
            tU.init(e, t), e._zod.pattern = e8, e._zod.values = new Set([null]), e._zod.parse = (t, r) => {
                let n = t.value;
                return null === n || t.issues.push({
                    expected: "null",
                    code: "invalid_type",
                    input: n,
                    inst: e
                }), t
            }
        }),
        rh = i("$ZodAny", (e, t) => {
            tU.init(e, t), e._zod.parse = e => e
        }),
        rm = i("$ZodUnknown", (e, t) => {
            tU.init(e, t), e._zod.parse = e => e
        }),
        ry = i("$ZodNever", (e, t) => {
            tU.init(e, t), e._zod.parse = (t, r) => (t.issues.push({
                expected: "never",
                code: "invalid_type",
                input: t.value,
                inst: e
            }), t)
        }),
        rg = i("$ZodVoid", (e, t) => {
            tU.init(e, t), e._zod.parse = (t, r) => {
                let n = t.value;
                return void 0 === n || t.issues.push({
                    expected: "void",
                    code: "invalid_type",
                    input: n,
                    inst: e
                }), t
            }
        }),
        rb = i("$ZodDate", (e, t) => {
            tU.init(e, t), e._zod.parse = (r, n) => {
                if (t.coerce) try {
                    r.value = new Date(r.value)
                } catch (e) {}
                let a = r.value,
                    i = a instanceof Date;
                return i && !Number.isNaN(a.getTime()) || r.issues.push({
                    expected: "date",
                    code: "invalid_type",
                    input: a,
                    ...i ? {
                        received: "Invalid Date"
                    } : {},
                    inst: e
                }), r
            }
        });

    function rv(e, t, r) {
        e.issues.length && t.issues.push(...$(r, e.issues)), t.value[r] = e.value
    }
    let rx = i("$ZodArray", (e, t) => {
        tU.init(e, t), e._zod.parse = (r, n) => {
            let a = r.value;
            if (!Array.isArray(a)) return r.issues.push({
                expected: "array",
                code: "invalid_type",
                input: a,
                inst: e
            }), r;
            r.value = Array(a.length);
            let i = [];
            for (let e = 0; e < a.length; e++) {
                let o = a[e],
                    s = t.element._zod.run({
                        value: o,
                        issues: []
                    }, n);
                s instanceof Promise ? i.push(s.then(t => rv(t, r, e))) : rv(s, r, e)
            }
            return i.length ? Promise.all(i).then(() => r) : r
        }
    });

    function rw(e, t, r, n, a, i) {
        let o = r in n;
        if (e.issues.length) {
            if (a && i && !o) return;
            t.issues.push(...$(r, e.issues))
        }
        if (!o && !a) {
            e.issues.length || t.issues.push({
                code: "invalid_type",
                expected: "nonoptional",
                input: void 0,
                path: [r]
            });
            return
        }
        void 0 === e.value ? o && (t.value[r] = void 0) : t.value[r] = e.value
    }

    function r_(e) {
        let t = Object.keys(e.shape);
        for (let r of t)
            if (!e.shape ? .[r] ? ._zod ? .traits ? .has("$ZodType")) throw Error(`Invalid element at key "${r}": expected a Zod schema`);
        let r = D(e.shape);
        return { ...e,
            keys: t,
            keySet: new Set(t),
            numKeys: t.length,
            optionalKeys: new Set(r)
        }
    }

    function rC(e, t, r, n, a, i) {
        let o = [],
            s = a.keySet,
            l = a.catchall._zod,
            c = l.def.type,
            u = "optional" === l.optin,
            d = "optional" === l.optout;
        for (let a in t) {
            if ("__proto__" === a || s.has(a)) continue;
            if ("never" === c) {
                o.push(a);
                continue
            }
            let i = l.run({
                value: t[a],
                issues: []
            }, n);
            i instanceof Promise ? e.push(i.then(e => rw(e, r, a, t, u, d))) : rw(i, r, a, t, u, d)
        }
        return (o.length && r.issues.push({
            code: "unrecognized_keys",
            keys: o,
            input: t,
            inst: i
        }), e.length) ? Promise.all(e).then(() => r) : r
    }
    let rE = i("$ZodObject", (e, t) => {
            let r;
            tU.init(e, t);
            let n = Object.getOwnPropertyDescriptor(t, "shape");
            if (!n ? .get) {
                let e = t.shape;
                Object.defineProperty(t, "shape", {
                    get: () => {
                        let r = { ...e
                        };
                        return Object.defineProperty(t, "shape", {
                            value: r
                        }), r
                    }
                })
            }
            let a = h(() => r_(t));
            v(e._zod, "propValues", () => {
                let e = t.shape,
                    r = {};
                for (let t in e) {
                    let n = e[t]._zod;
                    if (n.values)
                        for (let e of (r[t] ? ? (r[t] = new Set), n.values)) r[t].add(e)
                }
                return r
            });
            let i = t.catchall;
            e._zod.parse = (t, n) => {
                r ? ? (r = a.value);
                let o = t.value;
                if (!S(o)) return t.issues.push({
                    expected: "object",
                    code: "invalid_type",
                    input: o,
                    inst: e
                }), t;
                t.value = {};
                let s = [],
                    l = r.shape;
                for (let e of r.keys) {
                    let r = l[e],
                        a = "optional" === r._zod.optin,
                        i = "optional" === r._zod.optout,
                        c = r._zod.run({
                            value: o[e],
                            issues: []
                        }, n);
                    c instanceof Promise ? s.push(c.then(r => rw(r, t, e, o, a, i))) : rw(c, t, e, o, a, i)
                }
                return i ? rC(s, o, t, n, a.value, e) : s.length ? Promise.all(s).then(() => t) : t
            }
        }),
        rS = i("$ZodObjectJIT", (e, t) => {
            let r, n;
            rE.init(e, t);
            let a = e._zod.parse,
                i = h(() => r_(t)),
                o = !c.jitless,
                s = o && A.value,
                l = t.catchall;
            e._zod.parse = (c, u) => {
                n ? ? (n = i.value);
                let d = c.value;
                return S(d) ? o && s && u ? .async === !1 && !0 !== u.jitless ? (r || (r = (e => {
                    let t = new tL(["shape", "payload", "ctx"]),
                        r = i.value,
                        n = e => {
                            let t = _(e);
                            return `shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`
                        };
                    t.write("const input = payload.value;");
                    let a = Object.create(null),
                        o = 0;
                    for (let e of r.keys) a[e] = `key_${o++}`;
                    for (let i of (t.write("const newResult = {};"), r.keys)) {
                        let r = a[i],
                            o = _(i),
                            s = e[i],
                            l = s ? ._zod ? .optin === "optional",
                            c = s ? ._zod ? .optout === "optional";
                        t.write(`const ${r} = ${n(i)};`), l && c ? t.write(`
        if (${r}.issues.length) {
          if (${o} in input) {
            payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
              ...iss,
              path: iss.path ? [${o}, ...iss.path] : [${o}]
            })));
          }
        }
        
        if (${r}.value === undefined) {
          if (${o} in input) {
            newResult[${o}] = undefined;
          }
        } else {
          newResult[${o}] = ${r}.value;
        }
        
      `) : l ? t.write(`
        if (${r}.issues.length) {
          payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
            ...iss,
            path: iss.path ? [${o}, ...iss.path] : [${o}]
          })));
        }
        
        if (${r}.value === undefined) {
          if (${o} in input) {
            newResult[${o}] = undefined;
          }
        } else {
          newResult[${o}] = ${r}.value;
        }
        
      `) : t.write(`
        const ${r}_present = ${o} in input;
        if (${r}.issues.length) {
          payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
            ...iss,
            path: iss.path ? [${o}, ...iss.path] : [${o}]
          })));
        }
        if (!${r}_present && !${r}.issues.length) {
          payload.issues.push({
            code: "invalid_type",
            expected: "nonoptional",
            input: undefined,
            path: [${o}]
          });
        }

        if (${r}_present) {
          if (${r}.value === undefined) {
            newResult[${o}] = undefined;
          } else {
            newResult[${o}] = ${r}.value;
          }
        }

      `)
                    }
                    t.write("payload.value = newResult;"), t.write("return payload;");
                    let s = t.compile();
                    return (t, r) => s(e, t, r)
                })(t.shape)), c = r(c, u), l) ? rC([], d, c, u, n, e) : c : a(c, u) : (c.issues.push({
                    expected: "object",
                    code: "invalid_type",
                    input: d,
                    inst: e
                }), c)
            }
        });

    function rA(e, t, r, n) {
        for (let r of e)
            if (0 === r.issues.length) return t.value = r.value, t;
        let a = e.filter(e => !F(e));
        return 1 === a.length ? (t.value = a[0].value, a[0]) : (t.issues.push({
            code: "invalid_union",
            input: t.value,
            inst: r,
            errors: e.map(e => e.issues.map(e => B(e, n, u())))
        }), t)
    }
    let rI = i("$ZodUnion", (e, t) => {
        tU.init(e, t), v(e._zod, "optin", () => t.options.some(e => "optional" === e._zod.optin) ? "optional" : void 0), v(e._zod, "optout", () => t.options.some(e => "optional" === e._zod.optout) ? "optional" : void 0), v(e._zod, "values", () => {
            if (t.options.every(e => e._zod.values)) return new Set(t.options.flatMap(e => Array.from(e._zod.values)))
        }), v(e._zod, "pattern", () => {
            if (t.options.every(e => e._zod.pattern)) {
                let e = t.options.map(e => e._zod.pattern);
                return RegExp(`^(${e.map(e=>y(e.source)).join("|")})$`)
            }
        });
        let r = 1 === t.options.length ? t.options[0]._zod.run : null;
        e._zod.parse = (n, a) => {
            if (r) return r(n, a);
            let i = !1,
                o = [];
            for (let e of t.options) {
                let t = e._zod.run({
                    value: n.value,
                    issues: []
                }, a);
                if (t instanceof Promise) o.push(t), i = !0;
                else {
                    if (0 === t.issues.length) return t;
                    o.push(t)
                }
            }
            return i ? Promise.all(o).then(t => rA(t, n, e, a)) : rA(o, n, e, a)
        }
    });

    function rT(e, t, r, n) {
        let a = e.filter(e => 0 === e.issues.length);
        return 1 === a.length ? t.value = a[0].value : 0 === a.length ? t.issues.push({
            code: "invalid_union",
            input: t.value,
            inst: r,
            errors: e.map(e => e.issues.map(e => B(e, n, u())))
        }) : t.issues.push({
            code: "invalid_union",
            input: t.value,
            inst: r,
            errors: [],
            inclusive: !1
        }), t
    }
    let rk = i("$ZodXor", (e, t) => {
            rI.init(e, t), t.inclusive = !1;
            let r = 1 === t.options.length ? t.options[0]._zod.run : null;
            e._zod.parse = (n, a) => {
                if (r) return r(n, a);
                let i = !1,
                    o = [];
                for (let e of t.options) {
                    let t = e._zod.run({
                        value: n.value,
                        issues: []
                    }, a);
                    t instanceof Promise ? (o.push(t), i = !0) : o.push(t)
                }
                return i ? Promise.all(o).then(t => rT(t, n, e, a)) : rT(o, n, e, a)
            }
        }),
        rO = i("$ZodDiscriminatedUnion", (e, t) => {
            t.inclusive = !1, rI.init(e, t);
            let r = e._zod.parse;
            v(e._zod, "propValues", () => {
                let e = {};
                for (let r of t.options) {
                    let n = r._zod.propValues;
                    if (!n || 0 === Object.keys(n).length) throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);
                    for (let [t, r] of Object.entries(n))
                        for (let n of (e[t] || (e[t] = new Set), r)) e[t].add(n)
                }
                return e
            });
            let n = h(() => {
                let e = t.options,
                    r = new Map;
                for (let n of e) {
                    let e = n._zod.propValues ? .[t.discriminator];
                    if (!e || 0 === e.size) throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);
                    for (let t of e) {
                        if (r.has(t)) throw Error(`Duplicate discriminator value "${String(t)}"`);
                        r.set(t, n)
                    }
                }
                return r
            });
            e._zod.parse = (a, i) => {
                let o = a.value;
                if (!S(o)) return a.issues.push({
                    code: "invalid_type",
                    expected: "object",
                    input: o,
                    inst: e
                }), a;
                let s = n.value.get(o ? .[t.discriminator]);
                return s ? s._zod.run(a, i) : t.unionFallback || "backward" === i.direction ? r(a, i) : (a.issues.push({
                    code: "invalid_union",
                    errors: [],
                    note: "No matching discriminator",
                    discriminator: t.discriminator,
                    options: Array.from(n.value.keys()),
                    input: o,
                    path: [t.discriminator],
                    inst: e
                }), a)
            }
        }),
        rR = i("$ZodIntersection", (e, t) => {
            tU.init(e, t), e._zod.parse = (e, r) => {
                let n = e.value,
                    a = t.left._zod.run({
                        value: n,
                        issues: []
                    }, r),
                    i = t.right._zod.run({
                        value: n,
                        issues: []
                    }, r);
                return a instanceof Promise || i instanceof Promise ? Promise.all([a, i]).then(([t, r]) => rN(e, t, r)) : rN(e, a, i)
            }
        });

    function rN(e, t, r) {
        let n, a = new Map;
        for (let r of t.issues)
            if ("unrecognized_keys" === r.code)
                for (let e of (n ? ? (n = r), r.keys)) a.has(e) || a.set(e, {}), a.get(e).l = !0;
            else e.issues.push(r);
        for (let t of r.issues)
            if ("unrecognized_keys" === t.code)
                for (let e of t.keys) a.has(e) || a.set(e, {}), a.get(e).r = !0;
            else e.issues.push(t);
        let i = [...a].filter(([, e]) => e.l && e.r).map(([e]) => e);
        if (i.length && n && e.issues.push({ ...n,
                keys: i
            }), F(e)) return e;
        let o = function e(t, r) {
            if (t === r || t instanceof Date && r instanceof Date && +t == +r) return {
                valid: !0,
                data: t
            };
            if (I(t) && I(r)) {
                let n = Object.keys(r),
                    a = Object.keys(t).filter(e => -1 !== n.indexOf(e)),
                    i = { ...t,
                        ...r
                    };
                for (let n of a) {
                    let a = e(t[n], r[n]);
                    if (!a.valid) return {
                        valid: !1,
                        mergeErrorPath: [n, ...a.mergeErrorPath]
                    };
                    i[n] = a.data
                }
                return {
                    valid: !0,
                    data: i
                }
            }
            if (Array.isArray(t) && Array.isArray(r)) {
                if (t.length !== r.length) return {
                    valid: !1,
                    mergeErrorPath: []
                };
                let n = [];
                for (let a = 0; a < t.length; a++) {
                    let i = e(t[a], r[a]);
                    if (!i.valid) return {
                        valid: !1,
                        mergeErrorPath: [a, ...i.mergeErrorPath]
                    };
                    n.push(i.data)
                }
                return {
                    valid: !0,
                    data: n
                }
            }
            return {
                valid: !1,
                mergeErrorPath: []
            }
        }(t.value, r.value);
        if (!o.valid) throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);
        return e.value = o.data, e
    }
    let rM = i("$ZodTuple", (e, t) => {
        tU.init(e, t);
        let r = t.items;
        e._zod.parse = (n, a) => {
            let i = n.value;
            if (!Array.isArray(i)) return n.issues.push({
                input: i,
                inst: e,
                expected: "tuple",
                code: "invalid_type"
            }), n;
            n.value = [];
            let o = [],
                s = rP(r, "optin"),
                l = rP(r, "optout");
            if (!t.rest) {
                if (i.length < s) return n.issues.push({
                    code: "too_small",
                    minimum: s,
                    inclusive: !0,
                    input: i,
                    inst: e,
                    origin: "array"
                }), n;
                i.length > r.length && n.issues.push({
                    code: "too_big",
                    maximum: r.length,
                    inclusive: !0,
                    input: i,
                    inst: e,
                    origin: "array"
                })
            }
            let c = Array(r.length);
            for (let e = 0; e < r.length; e++) {
                let t = r[e]._zod.run({
                    value: i[e],
                    issues: []
                }, a);
                t instanceof Promise ? o.push(t.then(t => {
                    c[e] = t
                })) : c[e] = t
            }
            if (t.rest) {
                let e = r.length - 1;
                for (let s of i.slice(r.length)) {
                    e++;
                    let r = t.rest._zod.run({
                        value: s,
                        issues: []
                    }, a);
                    r instanceof Promise ? o.push(r.then(t => rD(t, n, e))) : rD(r, n, e)
                }
            }
            return o.length ? Promise.all(o).then(() => rj(c, n, r, i, l)) : rj(c, n, r, i, l)
        }
    });

    function rP(e, t) {
        for (let r = e.length - 1; r >= 0; r--)
            if ("optional" !== e[r]._zod[t]) return r + 1;
        return 0
    }

    function rD(e, t, r) {
        e.issues.length && t.issues.push(...$(r, e.issues)), t.value[r] = e.value
    }

    function rj(e, t, r, n, a) {
        for (let i = 0; i < r.length; i++) {
            let r = e[i],
                o = i < n.length;
            if (r.issues.length) {
                if (!o && i >= a) {
                    t.value.length = i;
                    break
                }
                t.issues.push(...$(i, r.issues))
            }
            t.value[i] = r.value
        }
        for (let e = t.value.length - 1; e >= n.length; e--)
            if ("optional" === r[e]._zod.optout && void 0 === t.value[e]) t.value.length = e;
            else break;
        return t
    }
    let rL = i("$ZodRecord", (e, t) => {
            tU.init(e, t), e._zod.parse = (r, n) => {
                let a = r.value;
                if (!I(a)) return r.issues.push({
                    expected: "record",
                    code: "invalid_type",
                    input: a,
                    inst: e
                }), r;
                let i = [],
                    o = t.keyType._zod.values;
                if (o) {
                    let s;
                    r.value = {};
                    let l = new Set;
                    for (let s of o)
                        if ("string" == typeof s || "number" == typeof s || "symbol" == typeof s) {
                            l.add("number" == typeof s ? s.toString() : s);
                            let o = t.keyType._zod.run({
                                value: s,
                                issues: []
                            }, n);
                            if (o instanceof Promise) throw Error("Async schemas not supported in object keys currently");
                            if (o.issues.length) {
                                r.issues.push({
                                    code: "invalid_key",
                                    origin: "record",
                                    issues: o.issues.map(e => B(e, n, u())),
                                    input: s,
                                    path: [s],
                                    inst: e
                                });
                                continue
                            }
                            let c = o.value,
                                d = t.valueType._zod.run({
                                    value: a[s],
                                    issues: []
                                }, n);
                            d instanceof Promise ? i.push(d.then(e => {
                                e.issues.length && r.issues.push(...$(s, e.issues)), r.value[c] = e.value
                            })) : (d.issues.length && r.issues.push(...$(s, d.issues)), r.value[c] = d.value)
                        }
                    for (let e in a) l.has(e) || (s = s ? ? []).push(e);
                    s && s.length > 0 && r.issues.push({
                        code: "unrecognized_keys",
                        input: a,
                        inst: e,
                        keys: s
                    })
                } else
                    for (let o of (r.value = {}, Reflect.ownKeys(a))) {
                        if ("__proto__" === o || !Object.prototype.propertyIsEnumerable.call(a, o)) continue;
                        let s = t.keyType._zod.run({
                            value: o,
                            issues: []
                        }, n);
                        if (s instanceof Promise) throw Error("Async schemas not supported in object keys currently");
                        if ("string" == typeof o && e3.test(o) && s.issues.length) {
                            let e = t.keyType._zod.run({
                                value: Number(o),
                                issues: []
                            }, n);
                            if (e instanceof Promise) throw Error("Async schemas not supported in object keys currently");
                            0 === e.issues.length && (s = e)
                        }
                        if (s.issues.length) {
                            "loose" === t.mode ? r.value[o] = a[o] : r.issues.push({
                                code: "invalid_key",
                                origin: "record",
                                issues: s.issues.map(e => B(e, n, u())),
                                input: o,
                                path: [o],
                                inst: e
                            });
                            continue
                        }
                        let l = t.valueType._zod.run({
                            value: a[o],
                            issues: []
                        }, n);
                        l instanceof Promise ? i.push(l.then(e => {
                            e.issues.length && r.issues.push(...$(o, e.issues)), r.value[s.value] = e.value
                        })) : (l.issues.length && r.issues.push(...$(o, l.issues)), r.value[s.value] = l.value)
                    }
                return i.length ? Promise.all(i).then(() => r) : r
            }
        }),
        rF = i("$ZodMap", (e, t) => {
            tU.init(e, t), e._zod.parse = (r, n) => {
                let a = r.value;
                if (!(a instanceof Map)) return r.issues.push({
                    expected: "map",
                    code: "invalid_type",
                    input: a,
                    inst: e
                }), r;
                let i = [];
                for (let [o, s] of (r.value = new Map, a)) {
                    let l = t.keyType._zod.run({
                            value: o,
                            issues: []
                        }, n),
                        c = t.valueType._zod.run({
                            value: s,
                            issues: []
                        }, n);
                    l instanceof Promise || c instanceof Promise ? i.push(Promise.all([l, c]).then(([t, i]) => {
                        rU(t, i, r, o, a, e, n)
                    })) : rU(l, c, r, o, a, e, n)
                }
                return i.length ? Promise.all(i).then(() => r) : r
            }
        });

    function rU(e, t, r, n, a, i, o) {
        e.issues.length && (k.has(typeof n) ? r.issues.push(...$(n, e.issues)) : r.issues.push({
            code: "invalid_key",
            origin: "map",
            input: a,
            inst: i,
            issues: e.issues.map(e => B(e, o, u()))
        })), t.issues.length && (k.has(typeof n) ? r.issues.push(...$(n, t.issues)) : r.issues.push({
            origin: "map",
            code: "invalid_element",
            input: a,
            inst: i,
            key: n,
            issues: t.issues.map(e => B(e, o, u()))
        })), r.value.set(e.value, t.value)
    }
    let r$ = i("$ZodSet", (e, t) => {
        tU.init(e, t), e._zod.parse = (r, n) => {
            let a = r.value;
            if (!(a instanceof Set)) return r.issues.push({
                input: a,
                inst: e,
                expected: "set",
                code: "invalid_type"
            }), r;
            let i = [];
            for (let e of (r.value = new Set, a)) {
                let a = t.valueType._zod.run({
                    value: e,
                    issues: []
                }, n);
                a instanceof Promise ? i.push(a.then(e => rz(e, r))) : rz(a, r)
            }
            return i.length ? Promise.all(i).then(() => r) : r
        }
    });

    function rz(e, t) {
        e.issues.length && t.issues.push(...e.issues), t.value.add(e.value)
    }
    let rB = i("$ZodEnum", (e, t) => {
            tU.init(e, t);
            let r = d(t.entries),
                n = new Set(r);
            e._zod.values = n, e._zod.pattern = RegExp(`^(${r.filter(e=>k.has(typeof e)).map(e=>"string"==typeof e?R(e):e.toString()).join("|")})$`), e._zod.parse = (t, a) => {
                let i = t.value;
                return n.has(i) || t.issues.push({
                    code: "invalid_value",
                    values: r,
                    input: i,
                    inst: e
                }), t
            }
        }),
        rq = i("$ZodLiteral", (e, t) => {
            if (tU.init(e, t), 0 === t.values.length) throw Error("Cannot create literal schema with no valid values");
            let r = new Set(t.values);
            e._zod.values = r, e._zod.pattern = RegExp(`^(${t.values.map(e=>"string"==typeof e?R(e):e?R(e.toString()):String(e)).join("|")})$`), e._zod.parse = (n, a) => {
                let i = n.value;
                return r.has(i) || n.issues.push({
                    code: "invalid_value",
                    values: t.values,
                    input: i,
                    inst: e
                }), n
            }
        }),
        rW = i("$ZodFile", (e, t) => {
            tU.init(e, t), e._zod.parse = (t, r) => {
                let n = t.value;
                return n instanceof File || t.issues.push({
                    expected: "file",
                    code: "invalid_type",
                    input: n,
                    inst: e
                }), t
            }
        }),
        rZ = i("$ZodTransform", (e, t) => {
            tU.init(e, t), e._zod.optin = "optional", e._zod.parse = (r, n) => {
                if ("backward" === n.direction) throw new l(e.constructor.name);
                let a = t.transform(r.value, r);
                if (n.async) return (a instanceof Promise ? a : Promise.resolve(a)).then(e => (r.value = e, r.fallback = !0, r));
                if (a instanceof Promise) throw new s;
                return r.value = a, r.fallback = !0, r
            }
        });

    function rV(e, t) {
        return void 0 === t && (e.issues.length || e.fallback) ? {
            issues: [],
            value: void 0
        } : e
    }
    let rK = i("$ZodOptional", (e, t) => {
            tU.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", v(e._zod, "values", () => t.innerType._zod.values ? new Set([...t.innerType._zod.values, void 0]) : void 0), v(e._zod, "pattern", () => {
                let e = t.innerType._zod.pattern;
                return e ? RegExp(`^(${y(e.source)})?$`) : void 0
            }), e._zod.parse = (e, r) => {
                if ("optional" === t.innerType._zod.optin) {
                    let n = e.value,
                        a = t.innerType._zod.run(e, r);
                    return a instanceof Promise ? a.then(e => rV(e, n)) : rV(a, n)
                }
                return void 0 === e.value ? e : t.innerType._zod.run(e, r)
            }
        }),
        rH = i("$ZodExactOptional", (e, t) => {
            rK.init(e, t), v(e._zod, "values", () => t.innerType._zod.values), v(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (e, r) => t.innerType._zod.run(e, r)
        }),
        rG = i("$ZodNullable", (e, t) => {
            tU.init(e, t), v(e._zod, "optin", () => t.innerType._zod.optin), v(e._zod, "optout", () => t.innerType._zod.optout), v(e._zod, "pattern", () => {
                let e = t.innerType._zod.pattern;
                return e ? RegExp(`^(${y(e.source)}|null)$`) : void 0
            }), v(e._zod, "values", () => t.innerType._zod.values ? new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (e, r) => null === e.value ? e : t.innerType._zod.run(e, r)
        }),
        rQ = i("$ZodDefault", (e, t) => {
            tU.init(e, t), e._zod.optin = "optional", v(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, r) => {
                if ("backward" === r.direction) return t.innerType._zod.run(e, r);
                if (void 0 === e.value) return e.value = t.defaultValue, e;
                let n = t.innerType._zod.run(e, r);
                return n instanceof Promise ? n.then(e => rJ(e, t)) : rJ(n, t)
            }
        });

    function rJ(e, t) {
        return void 0 === e.value && (e.value = t.defaultValue), e
    }
    let rY = i("$ZodPrefault", (e, t) => {
            tU.init(e, t), e._zod.optin = "optional", v(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, r) => ("backward" === r.direction || void 0 === e.value && (e.value = t.defaultValue), t.innerType._zod.run(e, r))
        }),
        rX = i("$ZodNonOptional", (e, t) => {
            tU.init(e, t), v(e._zod, "values", () => {
                let e = t.innerType._zod.values;
                return e ? new Set([...e].filter(e => void 0 !== e)) : void 0
            }), e._zod.parse = (r, n) => {
                let a = t.innerType._zod.run(r, n);
                return a instanceof Promise ? a.then(t => r0(t, e)) : r0(a, e)
            }
        });

    function r0(e, t) {
        return e.issues.length || void 0 !== e.value || e.issues.push({
            code: "invalid_type",
            expected: "nonoptional",
            input: e.value,
            inst: t
        }), e
    }
    let r1 = i("$ZodSuccess", (e, t) => {
            tU.init(e, t), e._zod.parse = (e, r) => {
                if ("backward" === r.direction) throw new l("ZodSuccess");
                let n = t.innerType._zod.run(e, r);
                return n instanceof Promise ? n.then(t => (e.value = 0 === t.issues.length, e)) : (e.value = 0 === n.issues.length, e)
            }
        }),
        r2 = i("$ZodCatch", (e, t) => {
            tU.init(e, t), e._zod.optin = "optional", v(e._zod, "optout", () => t.innerType._zod.optout), v(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, r) => {
                if ("backward" === r.direction) return t.innerType._zod.run(e, r);
                let n = t.innerType._zod.run(e, r);
                return n instanceof Promise ? n.then(n => (e.value = n.value, n.issues.length && (e.value = t.catchValue({ ...e,
                    error: {
                        issues: n.issues.map(e => B(e, r, u()))
                    },
                    input: e.value
                }), e.issues = [], e.fallback = !0), e)) : (e.value = n.value, n.issues.length && (e.value = t.catchValue({ ...e,
                    error: {
                        issues: n.issues.map(e => B(e, r, u()))
                    },
                    input: e.value
                }), e.issues = [], e.fallback = !0), e)
            }
        }),
        r6 = i("$ZodNaN", (e, t) => {
            tU.init(e, t), e._zod.parse = (t, r) => ("number" == typeof t.value && Number.isNaN(t.value) || t.issues.push({
                input: t.value,
                inst: e,
                expected: "nan",
                code: "invalid_type"
            }), t)
        }),
        r5 = i("$ZodPipe", (e, t) => {
            tU.init(e, t), v(e._zod, "values", () => t.in._zod.values), v(e._zod, "optin", () => t.in._zod.optin), v(e._zod, "optout", () => t.out._zod.optout), v(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (e, r) => {
                if ("backward" === r.direction) {
                    let n = t.out._zod.run(e, r);
                    return n instanceof Promise ? n.then(e => r3(e, t.in, r)) : r3(n, t.in, r)
                }
                let n = t.in._zod.run(e, r);
                return n instanceof Promise ? n.then(e => r3(e, t.out, r)) : r3(n, t.out, r)
            }
        });

    function r3(e, t, r) {
        return e.issues.length ? (e.aborted = !0, e) : t._zod.run({
            value: e.value,
            issues: e.issues,
            fallback: e.fallback
        }, r)
    }
    let r4 = i("$ZodCodec", (e, t) => {
        tU.init(e, t), v(e._zod, "values", () => t.in._zod.values), v(e._zod, "optin", () => t.in._zod.optin), v(e._zod, "optout", () => t.out._zod.optout), v(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (e, r) => {
            if ("forward" === (r.direction || "forward")) {
                let n = t.in._zod.run(e, r);
                return n instanceof Promise ? n.then(e => r8(e, t, r)) : r8(n, t, r)
            } {
                let n = t.out._zod.run(e, r);
                return n instanceof Promise ? n.then(e => r8(e, t, r)) : r8(n, t, r)
            }
        }
    });

    function r8(e, t, r) {
        if (e.issues.length) return e.aborted = !0, e;
        if ("forward" === (r.direction || "forward")) {
            let n = t.transform(e.value, e);
            return n instanceof Promise ? n.then(n => r7(e, n, t.out, r)) : r7(e, n, t.out, r)
        } {
            let n = t.reverseTransform(e.value, e);
            return n instanceof Promise ? n.then(n => r7(e, n, t.in, r)) : r7(e, n, t.in, r)
        }
    }

    function r7(e, t, r, n) {
        return e.issues.length ? (e.aborted = !0, e) : r._zod.run({
            value: t,
            issues: e.issues
        }, n)
    }
    let r9 = i("$ZodPreprocess", (e, t) => {
            r5.init(e, t)
        }),
        ne = i("$ZodReadonly", (e, t) => {
            tU.init(e, t), v(e._zod, "propValues", () => t.innerType._zod.propValues), v(e._zod, "values", () => t.innerType._zod.values), v(e._zod, "optin", () => t.innerType ? ._zod ? .optin), v(e._zod, "optout", () => t.innerType ? ._zod ? .optout), e._zod.parse = (e, r) => {
                if ("backward" === r.direction) return t.innerType._zod.run(e, r);
                let n = t.innerType._zod.run(e, r);
                return n instanceof Promise ? n.then(nt) : nt(n)
            }
        });

    function nt(e) {
        return e.value = Object.freeze(e.value), e
    }
    let nr = i("$ZodTemplateLiteral", (e, t) => {
            tU.init(e, t);
            let r = [];
            for (let e of t.parts)
                if ("object" == typeof e && null !== e) {
                    if (!e._zod.pattern) throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);
                    let t = e._zod.pattern instanceof RegExp ? e._zod.pattern.source : e._zod.pattern;
                    if (!t) throw Error(`Invalid template literal part: ${e._zod.traits}`);
                    let n = +!!t.startsWith("^"),
                        a = t.endsWith("$") ? t.length - 1 : t.length;
                    r.push(t.slice(n, a))
                } else if (null === e || O.has(typeof e)) r.push(R(`${e}`));
            else throw Error(`Invalid template literal part: ${e}`);
            e._zod.pattern = RegExp(`^${r.join("")}$`), e._zod.parse = (r, n) => ("string" != typeof r.value ? r.issues.push({
                input: r.value,
                inst: e,
                expected: "string",
                code: "invalid_type"
            }) : (e._zod.pattern.lastIndex = 0, e._zod.pattern.test(r.value) || r.issues.push({
                input: r.value,
                inst: e,
                code: "invalid_format",
                format: t.format ? ? "template_literal",
                pattern: e._zod.pattern.source
            })), r)
        }),
        nn = i("$ZodFunction", (e, t) => (tU.init(e, t), e._def = t, e._zod.def = t, e.implement = t => {
            if ("function" != typeof t) throw Error("implement() must be called with a function");
            return function(...r) {
                let n = Reflect.apply(t, this, e._def.input ? ea(e._def.input, r) : r);
                return e._def.output ? ea(e._def.output, n) : n
            }
        }, e.implementAsync = t => {
            if ("function" != typeof t) throw Error("implementAsync() must be called with a function");
            return async function(...r) {
                let n = e._def.input ? await eo(e._def.input, r) : r,
                    a = await Reflect.apply(t, this, n);
                return e._def.output ? await eo(e._def.output, a) : a
            }
        }, e._zod.parse = (t, r) => ("function" != typeof t.value ? t.issues.push({
            code: "invalid_type",
            expected: "function",
            input: t.value,
            inst: e
        }) : e._def.output && "promise" === e._def.output._zod.def.type ? t.value = e.implementAsync(t.value) : t.value = e.implement(t.value), t), e.input = (...t) => {
            let r = e.constructor;
            return new r(Array.isArray(t[0]) ? {
                type: "function",
                input: new rM({
                    type: "tuple",
                    items: t[0],
                    rest: t[1]
                }),
                output: e._def.output
            } : {
                type: "function",
                input: t[0],
                output: e._def.output
            })
        }, e.output = t => new e.constructor({
            type: "function",
            input: e._def.input,
            output: t
        }), e)),
        na = i("$ZodPromise", (e, t) => {
            tU.init(e, t), e._zod.parse = (e, r) => Promise.resolve(e.value).then(e => t.innerType._zod.run({
                value: e,
                issues: []
            }, r))
        }),
        ni = i("$ZodLazy", (e, t) => {
            tU.init(e, t), v(e._zod, "innerType", () => (t._cachedInner || (t._cachedInner = t.getter()), t._cachedInner)), v(e._zod, "pattern", () => e._zod.innerType ? ._zod ? .pattern), v(e._zod, "propValues", () => e._zod.innerType ? ._zod ? .propValues), v(e._zod, "optin", () => e._zod.innerType ? ._zod ? .optin ? ? void 0), v(e._zod, "optout", () => e._zod.innerType ? ._zod ? .optout ? ? void 0), e._zod.parse = (t, r) => e._zod.innerType._zod.run(t, r)
        }),
        no = i("$ZodCustom", (e, t) => {
            tp.init(e, t), tU.init(e, t), e._zod.parse = (e, t) => e, e._zod.check = r => {
                let n = r.value,
                    a = t.fn(n);
                if (a instanceof Promise) return a.then(t => ns(t, r, n, e));
                ns(a, r, n, e)
            }
        });

    function ns(e, t, r, n) {
        if (!e) {
            let e = {
                code: "custom",
                input: r,
                inst: n,
                path: [...n._zod.def.path ? ? []],
                continue: !n._zod.def.abort
            };
            n._zod.def.params && (e.params = n._zod.def.params), t.issues.push(V(e))
        }
    }
    e.s(["$ZodAny", 0, rh, "$ZodArray", 0, rx, "$ZodBase64", 0, t9, "$ZodBase64URL", 0, rt, "$ZodBigInt", 0, rc, "$ZodBigIntFormat", 0, ru, "$ZodBoolean", 0, rl, "$ZodCIDRv4", 0, t4, "$ZodCIDRv6", 0, t8, "$ZodCUID", 0, tH, "$ZodCUID2", 0, tG, "$ZodCatch", 0, r2, "$ZodCodec", 0, r4, "$ZodCustom", 0, no, "$ZodCustomStringFormat", 0, ri, "$ZodDate", 0, rb, "$ZodDefault", 0, rQ, "$ZodDiscriminatedUnion", 0, rO, "$ZodE164", 0, rr, "$ZodEmail", 0, tW, "$ZodEmoji", 0, tV, "$ZodEnum", 0, rB, "$ZodExactOptional", 0, rH, "$ZodFile", 0, rW, "$ZodFunction", 0, nn, "$ZodGUID", 0, tB, "$ZodIPv4", 0, t6, "$ZodIPv6", 0, t5, "$ZodISODate", 0, t0, "$ZodISODateTime", 0, tX, "$ZodISODuration", 0, t2, "$ZodISOTime", 0, t1, "$ZodIntersection", 0, rR, "$ZodJWT", 0, ra, "$ZodKSUID", 0, tY, "$ZodLazy", 0, ni, "$ZodLiteral", 0, rq, "$ZodMAC", 0, t3, "$ZodMap", 0, rF, "$ZodNaN", 0, r6, "$ZodNanoID", 0, tK, "$ZodNever", 0, ry, "$ZodNonOptional", 0, rX, "$ZodNull", 0, rp, "$ZodNullable", 0, rG, "$ZodNumber", 0, ro, "$ZodNumberFormat", 0, rs, "$ZodObject", 0, rE, "$ZodObjectJIT", 0, rS, "$ZodOptional", 0, rK, "$ZodPipe", 0, r5, "$ZodPrefault", 0, rY, "$ZodPreprocess", 0, r9, "$ZodPromise", 0, na, "$ZodReadonly", 0, ne, "$ZodRecord", 0, rL, "$ZodSet", 0, r$, "$ZodString", 0, t$, "$ZodStringFormat", 0, tz, "$ZodSuccess", 0, r1, "$ZodSymbol", 0, rd, "$ZodTemplateLiteral", 0, nr, "$ZodTransform", 0, rZ, "$ZodTuple", 0, rM, "$ZodType", 0, tU, "$ZodULID", 0, tQ, "$ZodURL", 0, tZ, "$ZodUUID", 0, tq, "$ZodUndefined", 0, rf, "$ZodUnion", 0, rI, "$ZodUnknown", 0, rm, "$ZodVoid", 0, rg, "$ZodXID", 0, tJ, "$ZodXor", 0, rk, "isValidBase64", 0, t7, "isValidBase64URL", 0, re, "isValidJWT", 0, rn], 692176), e.i(692176), e.s(["$ZodAny", 0, rh, "$ZodArray", 0, rx, "$ZodBase64", 0, t9, "$ZodBase64URL", 0, rt, "$ZodBigInt", 0, rc, "$ZodBigIntFormat", 0, ru, "$ZodBoolean", 0, rl, "$ZodCIDRv4", 0, t4, "$ZodCIDRv6", 0, t8, "$ZodCUID", 0, tH, "$ZodCUID2", 0, tG, "$ZodCatch", 0, r2, "$ZodCodec", 0, r4, "$ZodCustom", 0, no, "$ZodCustomStringFormat", 0, ri, "$ZodDate", 0, rb, "$ZodDefault", 0, rQ, "$ZodDiscriminatedUnion", 0, rO, "$ZodE164", 0, rr, "$ZodEmail", 0, tW, "$ZodEmoji", 0, tV, "$ZodEnum", 0, rB, "$ZodExactOptional", 0, rH, "$ZodFile", 0, rW, "$ZodFunction", 0, nn, "$ZodGUID", 0, tB, "$ZodIPv4", 0, t6, "$ZodIPv6", 0, t5, "$ZodISODate", 0, t0, "$ZodISODateTime", 0, tX, "$ZodISODuration", 0, t2, "$ZodISOTime", 0, t1, "$ZodIntersection", 0, rR, "$ZodJWT", 0, ra, "$ZodKSUID", 0, tY, "$ZodLazy", 0, ni, "$ZodLiteral", 0, rq, "$ZodMAC", 0, t3, "$ZodMap", 0, rF, "$ZodNaN", 0, r6, "$ZodNanoID", 0, tK, "$ZodNever", 0, ry, "$ZodNonOptional", 0, rX, "$ZodNull", 0, rp, "$ZodNullable", 0, rG, "$ZodNumber", 0, ro, "$ZodNumberFormat", 0, rs, "$ZodObject", 0, rE, "$ZodObjectJIT", 0, rS, "$ZodOptional", 0, rK, "$ZodPipe", 0, r5, "$ZodPrefault", 0, rY, "$ZodPreprocess", 0, r9, "$ZodPromise", 0, na, "$ZodReadonly", 0, ne, "$ZodRecord", 0, rL, "$ZodSet", 0, r$, "$ZodString", 0, t$, "$ZodStringFormat", 0, tz, "$ZodSuccess", 0, r1, "$ZodSymbol", 0, rd, "$ZodTemplateLiteral", 0, nr, "$ZodTransform", 0, rZ, "$ZodTuple", 0, rM, "$ZodType", 0, tU, "$ZodULID", 0, tQ, "$ZodURL", 0, tZ, "$ZodUUID", 0, tq, "$ZodUndefined", 0, rf, "$ZodUnion", 0, rI, "$ZodUnknown", 0, rm, "$ZodVoid", 0, rg, "$ZodXID", 0, tJ, "$ZodXor", 0, rk, "clone", 0, N, "isValidBase64", 0, t7, "isValidBase64URL", 0, re, "isValidJWT", 0, rn], 32887), e.i(32887), e.i(32912), e.i(415432);
    var nl, nc, nu, nd = e.i(132412),
        nf = e.i(43513);
    let np = Symbol("ZodOutput"),
        nh = Symbol("ZodInput");
    class nm {
        constructor() {
            this._map = new WeakMap, this._idmap = new Map
        }
        add(e, ...t) {
            let r = t[0];
            return this._map.set(e, r), r && "object" == typeof r && "id" in r && this._idmap.set(r.id, e), this
        }
        clear() {
            return this._map = new WeakMap, this._idmap = new Map, this
        }
        remove(e) {
            let t = this._map.get(e);
            return t && "object" == typeof t && "id" in t && this._idmap.delete(t.id), this._map.delete(e), this
        }
        get(e) {
            let t = e._zod.parent;
            if (t) {
                let r = { ...this.get(t) ? ? {}
                };
                delete r.id;
                let n = { ...r,
                    ...this._map.get(e)
                };
                return Object.keys(n).length ? n : void 0
            }
            return this._map.get(e)
        }
        has(e) {
            return this._map.has(e)
        }
    }

    function ny() {
        return new nm
    }(nc = globalThis).__zod_globalRegistry ? ? (nc.__zod_globalRegistry = ny());
    let ng = globalThis.__zod_globalRegistry;

    function nb(e, t) {
        return new e({
            type: "string",
            ...M(t)
        })
    }

    function nv(e, t) {
        return new e({
            type: "string",
            coerce: !0,
            ...M(t)
        })
    }

    function nx(e, t) {
        return new e({
            type: "string",
            format: "email",
            check: "string_format",
            abort: !1,
            ...M(t)
        })
    }

    function nw(e, t) {
        return new e({
            type: "string",
            format: "guid",
            check: "string_format",
            abort: !1,
            ...M(t)
        })
    }

    function n_(e, t) {
        return new e({
            type: "string",
            format: "uuid",
            check: "string_format",
            abort: !1,
            ...M(t)
        })
    }

    function nC(e, t) {
        return new e({
            type: "string",
            format: "uuid",
            check: "string_format",
            abort: !1,
            version: "v4",
            ...M(t)
        })
    }

    function nE(e, t) {
        return new e({
            type: "string",
            format: "uuid",
            check: "string_format",
            abort: !1,
            version: "v6",
            ...M(t)
        })
    }

    function nS(e, t) {
        return new e({
            type: "string",
            format: "uuid",
            check: "string_format",
            abort: !1,
            version: "v7",
            ...M(t)
        })
    }

    function nA(e, t) {
        return new e({
            type: "string",
            format: "url",
            check: "string_format",
            abort: !1,
            ...M(t)
        })
    }

    function nI(e, t) {
        return new e({
            type: "string",
            format: "emoji",
            check: "string_format",
            abort: !1,
            ...M(t)
        })
    }

    function nT(e, t) {
        return new e({
            type: "string",
            format: "nanoid",
            check: "string_format",
            abort: !1,
            ...M(t)
        })
    }

    function nk(e, t) {
        return new e({
            type: "string",
            format: "cuid",
            check: "string_format",
            abort: !1,
            ...M(t)
        })
    }

    function nO(e, t) {
        return new e({
            type: "string",
            format: "cuid2",
            check: "string_format",
            abort: !1,
            ...M(t)
        })
    }

    function nR(e, t) {
        return new e({
            type: "string",
            format: "ulid",
            check: "string_format",
            abort: !1,
            ...M(t)
        })
    }

    function nN(e, t) {
        return new e({
            type: "string",
            format: "xid",
            check: "string_format",
            abort: !1,
            ...M(t)
        })
    }

    function nM(e, t) {
        return new e({
            type: "string",
            format: "ksuid",
            check: "string_format",
            abort: !1,
            ...M(t)
        })
    }

    function nP(e, t) {
        return new e({
            type: "string",
            format: "ipv4",
            check: "string_format",
            abort: !1,
            ...M(t)
        })
    }

    function nD(e, t) {
        return new e({
            type: "string",
            format: "ipv6",
            check: "string_format",
            abort: !1,
            ...M(t)
        })
    }

    function nj(e, t) {
        return new e({
            type: "string",
            format: "mac",
            check: "string_format",
            abort: !1,
            ...M(t)
        })
    }

    function nL(e, t) {
        return new e({
            type: "string",
            format: "cidrv4",
            check: "string_format",
            abort: !1,
            ...M(t)
        })
    }

    function nF(e, t) {
        return new e({
            type: "string",
            format: "cidrv6",
            check: "string_format",
            abort: !1,
            ...M(t)
        })
    }

    function nU(e, t) {
        return new e({
            type: "string",
            format: "base64",
            check: "string_format",
            abort: !1,
            ...M(t)
        })
    }

    function n$(e, t) {
        return new e({
            type: "string",
            format: "base64url",
            check: "string_format",
            abort: !1,
            ...M(t)
        })
    }

    function nz(e, t) {
        return new e({
            type: "string",
            format: "e164",
            check: "string_format",
            abort: !1,
            ...M(t)
        })
    }

    function nB(e, t) {
        return new e({
            type: "string",
            format: "jwt",
            check: "string_format",
            abort: !1,
            ...M(t)
        })
    }
    e.s(["$ZodRegistry", 0, nm, "$input", 0, nh, "$output", 0, np, "globalRegistry", 0, ng, "registry", 0, ny], 832927), e.i(832927), e.i(4651);
    let nq = {
        Any: null,
        Minute: -1,
        Second: 0,
        Millisecond: 3,
        Microsecond: 6
    };

    function nW(e, t) {
        return new e({
            type: "string",
            format: "datetime",
            check: "string_format",
            offset: !1,
            local: !1,
            precision: null,
            ...M(t)
        })
    }

    function nZ(e, t) {
        return new e({
            type: "string",
            format: "date",
            check: "string_format",
            ...M(t)
        })
    }

    function nV(e, t) {
        return new e({
            type: "string",
            format: "time",
            check: "string_format",
            precision: null,
            ...M(t)
        })
    }

    function nK(e, t) {
        return new e({
            type: "string",
            format: "duration",
            check: "string_format",
            ...M(t)
        })
    }

    function nH(e, t) {
        return new e({
            type: "number",
            checks: [],
            ...M(t)
        })
    }

    function nG(e, t) {
        return new e({
            type: "number",
            coerce: !0,
            checks: [],
            ...M(t)
        })
    }

    function nQ(e, t) {
        return new e({
            type: "number",
            check: "number_format",
            abort: !1,
            format: "safeint",
            ...M(t)
        })
    }

    function nJ(e, t) {
        return new e({
            type: "number",
            check: "number_format",
            abort: !1,
            format: "float32",
            ...M(t)
        })
    }

    function nY(e, t) {
        return new e({
            type: "number",
            check: "number_format",
            abort: !1,
            format: "float64",
            ...M(t)
        })
    }

    function nX(e, t) {
        return new e({
            type: "number",
            check: "number_format",
            abort: !1,
            format: "int32",
            ...M(t)
        })
    }

    function n0(e, t) {
        return new e({
            type: "number",
            check: "number_format",
            abort: !1,
            format: "uint32",
            ...M(t)
        })
    }

    function n1(e, t) {
        return new e({
            type: "boolean",
            ...M(t)
        })
    }

    function n2(e, t) {
        return new e({
            type: "boolean",
            coerce: !0,
            ...M(t)
        })
    }

    function n6(e, t) {
        return new e({
            type: "bigint",
            ...M(t)
        })
    }

    function n5(e, t) {
        return new e({
            type: "bigint",
            coerce: !0,
            ...M(t)
        })
    }

    function n3(e, t) {
        return new e({
            type: "bigint",
            check: "bigint_format",
            abort: !1,
            format: "int64",
            ...M(t)
        })
    }

    function n4(e, t) {
        return new e({
            type: "bigint",
            check: "bigint_format",
            abort: !1,
            format: "uint64",
            ...M(t)
        })
    }

    function n8(e, t) {
        return new e({
            type: "symbol",
            ...M(t)
        })
    }

    function n7(e, t) {
        return new e({
            type: "undefined",
            ...M(t)
        })
    }

    function n9(e, t) {
        return new e({
            type: "null",
            ...M(t)
        })
    }

    function ae(e) {
        return new e({
            type: "any"
        })
    }

    function at(e) {
        return new e({
            type: "unknown"
        })
    }

    function ar(e, t) {
        return new e({
            type: "never",
            ...M(t)
        })
    }

    function an(e, t) {
        return new e({
            type: "void",
            ...M(t)
        })
    }

    function aa(e, t) {
        return new e({
            type: "date",
            ...M(t)
        })
    }

    function ai(e, t) {
        return new e({
            type: "date",
            coerce: !0,
            ...M(t)
        })
    }

    function ao(e, t) {
        return new e({
            type: "nan",
            ...M(t)
        })
    }

    function as(e, t) {
        return new tm({
            check: "less_than",
            ...M(t),
            value: e,
            inclusive: !1
        })
    }

    function al(e, t) {
        return new tm({
            check: "less_than",
            ...M(t),
            value: e,
            inclusive: !0
        })
    }

    function ac(e, t) {
        return new ty({
            check: "greater_than",
            ...M(t),
            value: e,
            inclusive: !1
        })
    }

    function au(e, t) {
        return new ty({
            check: "greater_than",
            ...M(t),
            value: e,
            inclusive: !0
        })
    }

    function ad(e) {
        return ac(0, e)
    }

    function af(e) {
        return as(0, e)
    }

    function ap(e) {
        return al(0, e)
    }

    function ah(e) {
        return au(0, e)
    }

    function am(e, t) {
        return new tg({
            check: "multiple_of",
            ...M(t),
            value: e
        })
    }

    function ay(e, t) {
        return new tx({
            check: "max_size",
            ...M(t),
            maximum: e
        })
    }

    function ag(e, t) {
        return new tw({
            check: "min_size",
            ...M(t),
            minimum: e
        })
    }

    function ab(e, t) {
        return new t_({
            check: "size_equals",
            ...M(t),
            size: e
        })
    }

    function av(e, t) {
        return new tC({
            check: "max_length",
            ...M(t),
            maximum: e
        })
    }

    function ax(e, t) {
        return new tE({
            check: "min_length",
            ...M(t),
            minimum: e
        })
    }

    function aw(e, t) {
        return new tS({
            check: "length_equals",
            ...M(t),
            length: e
        })
    }

    function a_(e, t) {
        return new tI({
            check: "string_format",
            format: "regex",
            ...M(t),
            pattern: e
        })
    }

    function aC(e) {
        return new tT({
            check: "string_format",
            format: "lowercase",
            ...M(e)
        })
    }

    function aE(e) {
        return new tk({
            check: "string_format",
            format: "uppercase",
            ...M(e)
        })
    }

    function aS(e, t) {
        return new tO({
            check: "string_format",
            format: "includes",
            ...M(t),
            includes: e
        })
    }

    function aA(e, t) {
        return new tR({
            check: "string_format",
            format: "starts_with",
            ...M(t),
            prefix: e
        })
    }

    function aI(e, t) {
        return new tN({
            check: "string_format",
            format: "ends_with",
            ...M(t),
            suffix: e
        })
    }

    function aT(e, t, r) {
        return new tP({
            check: "property",
            property: e,
            schema: t,
            ...M(r)
        })
    }

    function ak(e, t) {
        return new tD({
            check: "mime_type",
            mime: e,
            ...M(t)
        })
    }

    function aO(e) {
        return new tj({
            check: "overwrite",
            tx: e
        })
    }

    function aR(e) {
        return aO(t => t.normalize(e))
    }

    function aN() {
        return aO(e => e.trim())
    }

    function aM() {
        return aO(e => e.toLowerCase())
    }

    function aP() {
        return aO(e => e.toUpperCase())
    }

    function aD() {
        return aO(e => C(e))
    }

    function aj(e, t, r) {
        return new e({
            type: "array",
            element: t,
            ...M(r)
        })
    }

    function aL(e, t, r) {
        return new e({
            type: "union",
            options: t,
            ...M(r)
        })
    }

    function aF(e, t, r) {
        return new e({
            type: "union",
            options: t,
            inclusive: !1,
            ...M(r)
        })
    }

    function aU(e, t, r, n) {
        return new e({
            type: "union",
            options: r,
            discriminator: t,
            ...M(n)
        })
    }

    function a$(e, t, r) {
        return new e({
            type: "intersection",
            left: t,
            right: r
        })
    }

    function az(e, t, r, n) {
        let a = r instanceof tU,
            i = a ? n : r;
        return new e({
            type: "tuple",
            items: t,
            rest: a ? r : null,
            ...M(i)
        })
    }

    function aB(e, t, r, n) {
        return new e({
            type: "record",
            keyType: t,
            valueType: r,
            ...M(n)
        })
    }

    function aq(e, t, r, n) {
        return new e({
            type: "map",
            keyType: t,
            valueType: r,
            ...M(n)
        })
    }

    function aW(e, t, r) {
        return new e({
            type: "set",
            valueType: t,
            ...M(r)
        })
    }

    function aZ(e, t, r) {
        return new e({
            type: "enum",
            entries: Array.isArray(t) ? Object.fromEntries(t.map(e => [e, e])) : t,
            ...M(r)
        })
    }

    function aV(e, t, r) {
        return new e({
            type: "enum",
            entries: t,
            ...M(r)
        })
    }

    function aK(e, t, r) {
        return new e({
            type: "literal",
            values: Array.isArray(t) ? t : [t],
            ...M(r)
        })
    }

    function aH(e, t) {
        return new e({
            type: "file",
            ...M(t)
        })
    }

    function aG(e, t) {
        return new e({
            type: "transform",
            transform: t
        })
    }

    function aQ(e, t) {
        return new e({
            type: "optional",
            innerType: t
        })
    }

    function aJ(e, t) {
        return new e({
            type: "nullable",
            innerType: t
        })
    }

    function aY(e, t, r) {
        return new e({
            type: "default",
            innerType: t,
            get defaultValue() {
                return "function" == typeof r ? r() : T(r)
            }
        })
    }

    function aX(e, t, r) {
        return new e({
            type: "nonoptional",
            innerType: t,
            ...M(r)
        })
    }

    function a0(e, t) {
        return new e({
            type: "success",
            innerType: t
        })
    }

    function a1(e, t, r) {
        return new e({
            type: "catch",
            innerType: t,
            catchValue: "function" == typeof r ? r : () => r
        })
    }

    function a2(e, t, r) {
        return new e({
            type: "pipe",
            in: t,
            out: r
        })
    }

    function a6(e, t) {
        return new e({
            type: "readonly",
            innerType: t
        })
    }

    function a5(e, t, r) {
        return new e({
            type: "template_literal",
            parts: t,
            ...M(r)
        })
    }

    function a3(e, t) {
        return new e({
            type: "lazy",
            getter: t
        })
    }

    function a4(e, t) {
        return new e({
            type: "promise",
            innerType: t
        })
    }

    function a8(e, t, r) {
        let n = M(r);
        return n.abort ? ? (n.abort = !0), new e({
            type: "custom",
            check: "custom",
            fn: t,
            ...n
        })
    }

    function a7(e, t, r) {
        return new e({
            type: "custom",
            check: "custom",
            fn: t,
            ...M(r)
        })
    }

    function a9(e, t) {
        let r = ie(t => (t.addIssue = e => {
            "string" == typeof e ? t.issues.push(V(e, t.value, r._zod.def)) : (e.fatal && (e.continue = !1), e.code ? ? (e.code = "custom"), e.input ? ? (e.input = t.value), e.inst ? ? (e.inst = r), e.continue ? ? (e.continue = !r._zod.def.abort), t.issues.push(V(e)))
        }, e(t.value, t)), t);
        return r
    }

    function ie(e, t) {
        let r = new tp({
            check: "custom",
            ...M(t)
        });
        return r._zod.check = e, r
    }

    function it(e) {
        let t = new tp({
            check: "describe"
        });
        return t._zod.onattach = [t => {
            let r = ng.get(t) ? ? {};
            ng.add(t, { ...r,
                description: e
            })
        }], t._zod.check = () => {}, t
    }

    function ir(e) {
        let t = new tp({
            check: "meta"
        });
        return t._zod.onattach = [t => {
            let r = ng.get(t) ? ? {};
            ng.add(t, { ...r,
                ...e
            })
        }], t._zod.check = () => {}, t
    }

    function ia(e, t) {
        let r = M(t),
            n = r.truthy ? ? ["true", "1", "yes", "on", "y", "enabled"],
            a = r.falsy ? ? ["false", "0", "no", "off", "n", "disabled"];
        "sensitive" !== r.case && (n = n.map(e => "string" == typeof e ? e.toLowerCase() : e), a = a.map(e => "string" == typeof e ? e.toLowerCase() : e));
        let i = new Set(n),
            o = new Set(a),
            s = e.Codec ? ? r4,
            l = e.Boolean ? ? rl,
            c = new s({
                type: "pipe",
                in: new(e.String ? ? t$)({
                    type: "string",
                    error: r.error
                }),
                out: new l({
                    type: "boolean",
                    error: r.error
                }),
                transform: (e, t) => {
                    let n = e;
                    return "sensitive" !== r.case && (n = n.toLowerCase()), !!i.has(n) || !o.has(n) && (t.issues.push({
                        code: "invalid_value",
                        expected: "stringbool",
                        values: [...i, ...o],
                        input: t.value,
                        inst: c,
                        continue: !1
                    }), {})
                },
                reverseTransform: (e, t) => !0 === e ? n[0] || "true" : a[0] || "false",
                error: r.error
            });
        return c
    }

    function ii(e, t, r, n = {}) {
        let a = M(n),
            i = { ...M(n),
                check: "string_format",
                type: "string",
                format: t,
                fn: "function" == typeof r ? r : e => r.test(e),
                ...a
            };
        return r instanceof RegExp && (i.pattern = r), new e(i)
    }

    function io(e) {
        let t = e ? .target ? ? "draft-2020-12";
        return "draft-4" === t && (t = "draft-04"), "draft-7" === t && (t = "draft-07"), {
            processors: e.processors ? ? {},
            metadataRegistry: e ? .metadata ? ? ng,
            target: t,
            unrepresentable: e ? .unrepresentable ? ? "throw",
            override: e ? .override ? ? (() => {}),
            io: e ? .io ? ? "output",
            counter: 0,
            seen: new Map,
            cycles: e ? .cycles ? ? "ref",
            reused: e ? .reused ? ? "inline",
            external: e ? .external ? ? void 0
        }
    }

    function is(e, t, r = {
        path: [],
        schemaPath: []
    }) {
        var n;
        let a = e._zod.def,
            i = t.seen.get(e);
        if (i) return i.count++, r.schemaPath.includes(e) && (i.cycle = r.path), i.schema;
        let o = {
            schema: {},
            count: 1,
            cycle: void 0,
            path: r.path
        };
        t.seen.set(e, o);
        let s = e._zod.toJSONSchema ? .();
        if (s) o.schema = s;
        else {
            let n = { ...r,
                schemaPath: [...r.schemaPath, e],
                path: r.path
            };
            if (e._zod.processJSONSchema) e._zod.processJSONSchema(t, o.schema, n);
            else {
                let r = o.schema,
                    i = t.processors[a.type];
                if (!i) throw Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);
                i(e, t, r, n)
            }
            let i = e._zod.parent;
            i && (o.ref || (o.ref = i), is(i, t, n), t.seen.get(i).isParent = !0)
        }
        let l = t.metadataRegistry.get(e);
        return l && Object.assign(o.schema, l), "input" === t.io && function e(t, r) {
            let n = r ? ? {
                seen: new Set
            };
            if (n.seen.has(t)) return !1;
            n.seen.add(t);
            let a = t._zod.def;
            if ("transform" === a.type) return !0;
            if ("array" === a.type) return e(a.element, n);
            if ("set" === a.type) return e(a.valueType, n);
            if ("lazy" === a.type) return e(a.getter(), n);
            if ("promise" === a.type || "optional" === a.type || "nonoptional" === a.type || "nullable" === a.type || "readonly" === a.type || "default" === a.type || "prefault" === a.type) return e(a.innerType, n);
            if ("intersection" === a.type) return e(a.left, n) || e(a.right, n);
            if ("record" === a.type || "map" === a.type) return e(a.keyType, n) || e(a.valueType, n);
            if ("pipe" === a.type) return !!t._zod.traits.has("$ZodCodec") || e(a.in, n) || e(a.out, n);
            if ("object" === a.type) {
                for (let t in a.shape)
                    if (e(a.shape[t], n)) return !0;
                return !1
            }
            if ("union" === a.type) {
                for (let t of a.options)
                    if (e(t, n)) return !0;
                return !1
            }
            if ("tuple" === a.type) {
                for (let t of a.items)
                    if (e(t, n)) return !0;
                if (a.rest && e(a.rest, n)) return !0
            }
            return !1
        }(e) && (delete o.schema.examples, delete o.schema.default), "input" === t.io && "_prefault" in o.schema && ((n = o.schema).default ? ? (n.default = o.schema._prefault)), delete o.schema._prefault, t.seen.get(e).schema
    }

    function il(e, t) {
        let r = e.seen.get(t);
        if (!r) throw Error("Unprocessed schema. This is a bug in Zod.");
        let n = new Map;
        for (let t of e.seen.entries()) {
            let r = e.metadataRegistry.get(t[0]) ? .id;
            if (r) {
                let e = n.get(r);
                if (e && e !== t[0]) throw Error(`Duplicate schema id "${r}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
                n.set(r, t[0])
            }
        }
        let a = t => {
            if (t[1].schema.$ref) return;
            let n = t[1],
                {
                    ref: a,
                    defId: i
                } = (t => {
                    let n = "draft-2020-12" === e.target ? "$defs" : "definitions";
                    if (e.external) {
                        let r = e.external.registry.get(t[0]) ? .id,
                            a = e.external.uri ? ? (e => e);
                        if (r) return {
                            ref: a(r)
                        };
                        let i = t[1].defId ? ? t[1].schema.id ? ? `schema${e.counter++}`;
                        return t[1].defId = i, {
                            defId: i,
                            ref: `${a("__shared")}#/${n}/${i}`
                        }
                    }
                    if (t[1] === r) return {
                        ref: "#"
                    };
                    let a = `#/${n}/`,
                        i = t[1].schema.id ? ? `__schema${e.counter++}`;
                    return {
                        defId: i,
                        ref: a + i
                    }
                })(t);
            n.def = { ...n.schema
            }, i && (n.defId = i);
            let o = n.schema;
            for (let e in o) delete o[e];
            o.$ref = a
        };
        if ("throw" === e.cycles)
            for (let t of e.seen.entries()) {
                let e = t[1];
                if (e.cycle) throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>

Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)
            }
        for (let r of e.seen.entries()) {
            let n = r[1];
            if (t === r[0]) {
                a(r);
                continue
            }
            if (e.external) {
                let n = e.external.registry.get(r[0]) ? .id;
                if (t !== r[0] && n) {
                    a(r);
                    continue
                }
            }
            if (e.metadataRegistry.get(r[0]) ? .id || n.cycle || n.count > 1 && "ref" === e.reused) {
                a(r);
                continue
            }
        }
    }

    function ic(e, t) {
        let r = e.seen.get(t);
        if (!r) throw Error("Unprocessed schema. This is a bug in Zod.");
        let n = t => {
            let r = e.seen.get(t);
            if (null === r.ref) return;
            let a = r.def ? ? r.schema,
                i = { ...a
                },
                o = r.ref;
            if (r.ref = null, o) {
                n(o);
                let r = e.seen.get(o),
                    s = r.schema;
                if (s.$ref && ("draft-07" === e.target || "draft-04" === e.target || "openapi-3.0" === e.target) ? (a.allOf = a.allOf ? ? [], a.allOf.push(s)) : Object.assign(a, s), Object.assign(a, i), t._zod.parent === o)
                    for (let e in a) "$ref" !== e && "allOf" !== e && (e in i || delete a[e]);
                if (s.$ref && r.def)
                    for (let e in a) "$ref" !== e && "allOf" !== e && e in r.def && JSON.stringify(a[e]) === JSON.stringify(r.def[e]) && delete a[e]
            }
            let s = t._zod.parent;
            if (s && s !== o) {
                n(s);
                let t = e.seen.get(s);
                if (t ? .schema.$ref && (a.$ref = t.schema.$ref, t.def))
                    for (let e in a) "$ref" !== e && "allOf" !== e && e in t.def && JSON.stringify(a[e]) === JSON.stringify(t.def[e]) && delete a[e]
            }
            e.override({
                zodSchema: t,
                jsonSchema: a,
                path: r.path ? ? []
            })
        };
        for (let t of [...e.seen.entries()].reverse()) n(t[0]);
        let a = {};
        if ("draft-2020-12" === e.target ? a.$schema = "https://json-schema.org/draft/2020-12/schema" : "draft-07" === e.target ? a.$schema = "http://json-schema.org/draft-07/schema#" : "draft-04" === e.target ? a.$schema = "http://json-schema.org/draft-04/schema#" : e.target, e.external ? .uri) {
            let r = e.external.registry.get(t) ? .id;
            if (!r) throw Error("Schema is missing an `id` property");
            a.$id = e.external.uri(r)
        }
        Object.assign(a, r.def ? ? r.schema);
        let i = e.metadataRegistry.get(t) ? .id;
        void 0 !== i && a.id === i && delete a.id;
        let o = e.external ? .defs ? ? {};
        for (let t of e.seen.entries()) {
            let e = t[1];
            e.def && e.defId && (e.def.id === e.defId && delete e.def.id, o[e.defId] = e.def)
        }
        e.external || Object.keys(o).length > 0 && ("draft-2020-12" === e.target ? a.$defs = o : a.definitions = o);
        try {
            let r = JSON.parse(JSON.stringify(a));
            return Object.defineProperty(r, "~standard", {
                value: { ...t["~standard"],
                    jsonSchema: {
                        input: id(t, "input", e.processors),
                        output: id(t, "output", e.processors)
                    }
                },
                enumerable: !1,
                writable: !1
            }), r
        } catch (e) {
            throw Error("Error converting schema to JSON.")
        }
    }
    e.s(["TimePrecision", 0, nq, "_any", 0, ae, "_array", 0, aj, "_base64", 0, nU, "_base64url", 0, n$, "_bigint", 0, n6, "_boolean", 0, n1, "_catch", 0, a1, "_check", 0, ie, "_cidrv4", 0, nL, "_cidrv6", 0, nF, "_coercedBigint", 0, n5, "_coercedBoolean", 0, n2, "_coercedDate", 0, ai, "_coercedNumber", 0, nG, "_coercedString", 0, nv, "_cuid", 0, nk, "_cuid2", 0, nO, "_custom", 0, a8, "_date", 0, aa, "_default", 0, aY, "_discriminatedUnion", 0, aU, "_e164", 0, nz, "_email", 0, nx, "_emoji", 0, nI, "_endsWith", 0, aI, "_enum", 0, aZ, "_file", 0, aH, "_float32", 0, nJ, "_float64", 0, nY, "_gt", 0, ac, "_gte", 0, au, "_guid", 0, nw, "_includes", 0, aS, "_int", 0, nQ, "_int32", 0, nX, "_int64", 0, n3, "_intersection", 0, a$, "_ipv4", 0, nP, "_ipv6", 0, nD, "_isoDate", 0, nZ, "_isoDateTime", 0, nW, "_isoDuration", 0, nK, "_isoTime", 0, nV, "_jwt", 0, nB, "_ksuid", 0, nM, "_lazy", 0, a3, "_length", 0, aw, "_literal", 0, aK, "_lowercase", 0, aC, "_lt", 0, as, "_lte", 0, al, "_mac", 0, nj, "_map", 0, aq, "_max", 0, al, "_maxLength", 0, av, "_maxSize", 0, ay, "_mime", 0, ak, "_min", 0, au, "_minLength", 0, ax, "_minSize", 0, ag, "_multipleOf", 0, am, "_nan", 0, ao, "_nanoid", 0, nT, "_nativeEnum", 0, aV, "_negative", 0, af, "_never", 0, ar, "_nonnegative", 0, ah, "_nonoptional", 0, aX, "_nonpositive", 0, ap, "_normalize", 0, aR, "_null", 0, n9, "_nullable", 0, aJ, "_number", 0, nH, "_optional", 0, aQ, "_overwrite", 0, aO, "_pipe", 0, a2, "_positive", 0, ad, "_promise", 0, a4, "_property", 0, aT, "_readonly", 0, a6, "_record", 0, aB, "_refine", 0, a7, "_regex", 0, a_, "_set", 0, aW, "_size", 0, ab, "_slugify", 0, aD, "_startsWith", 0, aA, "_string", 0, nb, "_stringFormat", 0, ii, "_stringbool", 0, ia, "_success", 0, a0, "_superRefine", 0, a9, "_symbol", 0, n8, "_templateLiteral", 0, a5, "_toLowerCase", 0, aM, "_toUpperCase", 0, aP, "_transform", 0, aG, "_trim", 0, aN, "_tuple", 0, az, "_uint32", 0, n0, "_uint64", 0, n4, "_ulid", 0, nR, "_undefined", 0, n7, "_union", 0, aL, "_unknown", 0, at, "_uppercase", 0, aE, "_url", 0, nA, "_uuid", 0, n_, "_uuidv4", 0, nC, "_uuidv6", 0, nE, "_uuidv7", 0, nS, "_void", 0, an, "_xid", 0, nN, "_xor", 0, aF, "describe", 0, it, "meta", 0, ir], 831073), e.i(831073);
    let iu = (e, t = {}) => r => {
            let n = io({ ...r,
                processors: t
            });
            return is(e, n), il(n, e), ic(n, e)
        },
        id = (e, t, r = {}) => n => {
            let {
                libraryOptions: a,
                target: i
            } = n ? ? {}, o = io({ ...a ? ? {},
                target : i,
                io : t,
                processors: r
            });
            return is(e, o), il(o, e), ic(o, e)
        };
    e.s(["createStandardJSONSchemaMethod", 0, id, "createToJSONSchemaMethod", 0, iu, "extractDefs", 0, il, "finalize", 0, ic, "initializeContext", 0, io, "process", 0, is], 411322), e.i(411322);
    let ip = {
            guid: "uuid",
            url: "uri",
            datetime: "date-time",
            json_string: "json-string",
            regex: ""
        },
        ih = (e, t, r, n) => {
            r.type = "string";
            let {
                minimum: a,
                maximum: i,
                format: o,
                patterns: s,
                contentEncoding: l
            } = e._zod.bag;
            if ("number" == typeof a && (r.minLength = a), "number" == typeof i && (r.maxLength = i), o && (r.format = ip[o] ? ? o, "" === r.format && delete r.format, "time" === o && delete r.format), l && (r.contentEncoding = l), s && s.size > 0) {
                let e = [...s];
                1 === e.length ? r.pattern = e[0].source : e.length > 1 && (r.allOf = [...e.map(e => ({ ..."draft-07" === t.target || "draft-04" === t.target || "openapi-3.0" === t.target ? {
                        type: "string"
                    } : {},
                    pattern: e.source
                }))])
            }
        },
        im = (e, t, r, n) => {
            let {
                minimum: a,
                maximum: i,
                format: o,
                multipleOf: s,
                exclusiveMaximum: l,
                exclusiveMinimum: c
            } = e._zod.bag;
            "string" == typeof o && o.includes("int") ? r.type = "integer" : r.type = "number";
            let u = "number" == typeof c && c >= (a ? ? -1 / 0),
                d = "number" == typeof l && l <= (i ? ? 1 / 0),
                f = "draft-04" === t.target || "openapi-3.0" === t.target;
            u ? f ? (r.minimum = c, r.exclusiveMinimum = !0) : r.exclusiveMinimum = c : "number" == typeof a && (r.minimum = a), d ? f ? (r.maximum = l, r.exclusiveMaximum = !0) : r.exclusiveMaximum = l : "number" == typeof i && (r.maximum = i), "number" == typeof s && (r.multipleOf = s)
        },
        iy = (e, t, r, n) => {
            r.type = "boolean"
        },
        ig = (e, t, r, n) => {
            if ("throw" === t.unrepresentable) throw Error("BigInt cannot be represented in JSON Schema")
        },
        ib = (e, t, r, n) => {
            if ("throw" === t.unrepresentable) throw Error("Symbols cannot be represented in JSON Schema")
        },
        iv = (e, t, r, n) => {
            "openapi-3.0" === t.target ? (r.type = "string", r.nullable = !0, r.enum = [null]) : r.type = "null"
        },
        ix = (e, t, r, n) => {
            if ("throw" === t.unrepresentable) throw Error("Undefined cannot be represented in JSON Schema")
        },
        iw = (e, t, r, n) => {
            if ("throw" === t.unrepresentable) throw Error("Void cannot be represented in JSON Schema")
        },
        i_ = (e, t, r, n) => {
            r.not = {}
        },
        iC = (e, t, r, n) => {},
        iE = (e, t, r, n) => {},
        iS = (e, t, r, n) => {
            if ("throw" === t.unrepresentable) throw Error("Date cannot be represented in JSON Schema")
        },
        iA = (e, t, r, n) => {
            let a = d(e._zod.def.entries);
            a.every(e => "number" == typeof e) && (r.type = "number"), a.every(e => "string" == typeof e) && (r.type = "string"), r.enum = a
        },
        iI = (e, t, r, n) => {
            let a = e._zod.def,
                i = [];
            for (let e of a.values)
                if (void 0 === e) {
                    if ("throw" === t.unrepresentable) throw Error("Literal `undefined` cannot be represented in JSON Schema")
                } else if ("bigint" == typeof e)
                if ("throw" === t.unrepresentable) throw Error("BigInt literals cannot be represented in JSON Schema");
                else i.push(Number(e));
            else i.push(e);
            if (0 === i.length);
            else if (1 === i.length) {
                let e = i[0];
                r.type = null === e ? "null" : typeof e, "draft-04" === t.target || "openapi-3.0" === t.target ? r.enum = [e] : r.const = e
            } else i.every(e => "number" == typeof e) && (r.type = "number"), i.every(e => "string" == typeof e) && (r.type = "string"), i.every(e => "boolean" == typeof e) && (r.type = "boolean"), i.every(e => null === e) && (r.type = "null"), r.enum = i
        },
        iT = (e, t, r, n) => {
            if ("throw" === t.unrepresentable) throw Error("NaN cannot be represented in JSON Schema")
        },
        ik = (e, t, r, n) => {
            let a = e._zod.pattern;
            if (!a) throw Error("Pattern not found in template literal");
            r.type = "string", r.pattern = a.source
        },
        iO = (e, t, r, n) => {
            let a = {
                    type: "string",
                    format: "binary",
                    contentEncoding: "binary"
                },
                {
                    minimum: i,
                    maximum: o,
                    mime: s
                } = e._zod.bag;
            void 0 !== i && (a.minLength = i), void 0 !== o && (a.maxLength = o), s ? 1 === s.length ? (a.contentMediaType = s[0], Object.assign(r, a)) : (Object.assign(r, a), r.anyOf = s.map(e => ({
                contentMediaType: e
            }))) : Object.assign(r, a)
        },
        iR = (e, t, r, n) => {
            r.type = "boolean"
        },
        iN = (e, t, r, n) => {
            if ("throw" === t.unrepresentable) throw Error("Custom types cannot be represented in JSON Schema")
        },
        iM = (e, t, r, n) => {
            if ("throw" === t.unrepresentable) throw Error("Function types cannot be represented in JSON Schema")
        },
        iP = (e, t, r, n) => {
            if ("throw" === t.unrepresentable) throw Error("Transforms cannot be represented in JSON Schema")
        },
        iD = (e, t, r, n) => {
            if ("throw" === t.unrepresentable) throw Error("Map cannot be represented in JSON Schema")
        },
        ij = (e, t, r, n) => {
            if ("throw" === t.unrepresentable) throw Error("Set cannot be represented in JSON Schema")
        },
        iL = (e, t, r, n) => {
            let a = e._zod.def,
                {
                    minimum: i,
                    maximum: o
                } = e._zod.bag;
            "number" == typeof i && (r.minItems = i), "number" == typeof o && (r.maxItems = o), r.type = "array", r.items = is(a.element, t, { ...n,
                path: [...n.path, "items"]
            })
        },
        iF = (e, t, r, n) => {
            let a = e._zod.def;
            r.type = "object", r.properties = {};
            let i = a.shape;
            for (let e in i) r.properties[e] = is(i[e], t, { ...n,
                path: [...n.path, "properties", e]
            });
            let o = new Set([...new Set(Object.keys(i))].filter(e => {
                let r = a.shape[e]._zod;
                return "input" === t.io ? void 0 === r.optin : void 0 === r.optout
            }));
            o.size > 0 && (r.required = Array.from(o)), a.catchall ? ._zod.def.type === "never" ? r.additionalProperties = !1 : a.catchall ? a.catchall && (r.additionalProperties = is(a.catchall, t, { ...n,
                path: [...n.path, "additionalProperties"]
            })) : "output" === t.io && (r.additionalProperties = !1)
        },
        iU = (e, t, r, n) => {
            let a = e._zod.def,
                i = !1 === a.inclusive,
                o = a.options.map((e, r) => is(e, t, { ...n,
                    path: [...n.path, i ? "oneOf" : "anyOf", r]
                }));
            i ? r.oneOf = o : r.anyOf = o
        },
        i$ = (e, t, r, n) => {
            let a = e._zod.def,
                i = is(a.left, t, { ...n,
                    path: [...n.path, "allOf", 0]
                }),
                o = is(a.right, t, { ...n,
                    path: [...n.path, "allOf", 1]
                }),
                s = e => "allOf" in e && 1 === Object.keys(e).length;
            r.allOf = [...s(i) ? i.allOf : [i], ...s(o) ? o.allOf : [o]]
        },
        iz = (e, t, r, n) => {
            let a = e._zod.def;
            r.type = "array";
            let i = "draft-2020-12" === t.target ? "prefixItems" : "items",
                o = "draft-2020-12" === t.target || "openapi-3.0" === t.target ? "items" : "additionalItems",
                s = a.items.map((e, r) => is(e, t, { ...n,
                    path: [...n.path, i, r]
                })),
                l = a.rest ? is(a.rest, t, { ...n,
                    path: [...n.path, o, ..."openapi-3.0" === t.target ? [a.items.length] : []]
                }) : null;
            "draft-2020-12" === t.target ? (r.prefixItems = s, l && (r.items = l)) : "openapi-3.0" === t.target ? (r.items = {
                anyOf: s
            }, l && r.items.anyOf.push(l), r.minItems = s.length, l || (r.maxItems = s.length)) : (r.items = s, l && (r.additionalItems = l));
            let {
                minimum: c,
                maximum: u
            } = e._zod.bag;
            "number" == typeof c && (r.minItems = c), "number" == typeof u && (r.maxItems = u)
        },
        iB = (e, t, r, n) => {
            let a = e._zod.def;
            r.type = "object";
            let i = a.keyType,
                o = i._zod.bag,
                s = o ? .patterns;
            if ("loose" === a.mode && s && s.size > 0) {
                let e = is(a.valueType, t, { ...n,
                    path: [...n.path, "patternProperties", "*"]
                });
                for (let t of (r.patternProperties = {}, s)) r.patternProperties[t.source] = e
            } else("draft-07" === t.target || "draft-2020-12" === t.target) && (r.propertyNames = is(a.keyType, t, { ...n,
                path: [...n.path, "propertyNames"]
            })), r.additionalProperties = is(a.valueType, t, { ...n,
                path: [...n.path, "additionalProperties"]
            });
            let l = i._zod.values;
            if (l) {
                let e = [...l].filter(e => "string" == typeof e || "number" == typeof e);
                e.length > 0 && (r.required = e)
            }
        },
        iq = (e, t, r, n) => {
            let a = e._zod.def,
                i = is(a.innerType, t, n),
                o = t.seen.get(e);
            "openapi-3.0" === t.target ? (o.ref = a.innerType, r.nullable = !0) : r.anyOf = [i, {
                type: "null"
            }]
        },
        iW = (e, t, r, n) => {
            let a = e._zod.def;
            is(a.innerType, t, n), t.seen.get(e).ref = a.innerType
        },
        iZ = (e, t, r, n) => {
            let a = e._zod.def;
            is(a.innerType, t, n), t.seen.get(e).ref = a.innerType, r.default = JSON.parse(JSON.stringify(a.defaultValue))
        },
        iV = (e, t, r, n) => {
            let a = e._zod.def;
            is(a.innerType, t, n), t.seen.get(e).ref = a.innerType, "input" === t.io && (r._prefault = JSON.parse(JSON.stringify(a.defaultValue)))
        },
        iK = (e, t, r, n) => {
            let a, i = e._zod.def;
            is(i.innerType, t, n), t.seen.get(e).ref = i.innerType;
            try {
                a = i.catchValue(void 0)
            } catch {
                throw Error("Dynamic catch values are not supported in JSON Schema")
            }
            r.default = a
        },
        iH = (e, t, r, n) => {
            let a = e._zod.def,
                i = a.in._zod.traits.has("$ZodTransform"),
                o = "input" === t.io ? i ? a.out : a.in : a.out;
            is(o, t, n), t.seen.get(e).ref = o
        },
        iG = (e, t, r, n) => {
            let a = e._zod.def;
            is(a.innerType, t, n), t.seen.get(e).ref = a.innerType, r.readOnly = !0
        },
        iQ = (e, t, r, n) => {
            let a = e._zod.def;
            is(a.innerType, t, n), t.seen.get(e).ref = a.innerType
        },
        iJ = (e, t, r, n) => {
            let a = e._zod.def;
            is(a.innerType, t, n), t.seen.get(e).ref = a.innerType
        },
        iY = (e, t, r, n) => {
            let a = e._zod.innerType;
            is(a, t, n), t.seen.get(e).ref = a
        },
        iX = {
            string: ih,
            number: im,
            boolean: iy,
            bigint: ig,
            symbol: ib,
            null: iv,
            undefined: ix,
            void: iw,
            never: i_,
            any: iC,
            unknown: iE,
            date: iS,
            enum: iA,
            literal: iI,
            nan: iT,
            template_literal: ik,
            file: iO,
            success: iR,
            custom: iN,
            function: iM,
            transform: iP,
            map: iD,
            set: ij,
            array: iL,
            object: iF,
            union: iU,
            intersection: i$,
            tuple: iz,
            record: iB,
            nullable: iq,
            nonoptional: iW,
            default: iZ,
            prefault: iV,
            catch: iK,
            pipe: iH,
            readonly: iG,
            promise: iQ,
            optional: iJ,
            lazy: iY
        };

    function i0(e, t) {
        if ("_idmap" in e) {
            let r = io({ ...t,
                    processors: iX
                }),
                n = {};
            for (let t of e._idmap.entries()) {
                let [e, n] = t;
                is(n, r)
            }
            let a = {};
            for (let i of (r.external = {
                    registry: e,
                    uri: t ? .uri,
                    defs: n
                }, e._idmap.entries())) {
                let [e, t] = i;
                il(r, t), a[e] = ic(r, t)
            }
            return Object.keys(n).length > 0 && (a.__shared = {
                ["draft-2020-12" === r.target ? "$defs" : "definitions"]: n
            }), {
                schemas: a
            }
        }
        let r = io({ ...t,
            processors: iX
        });
        return is(e, r), il(r, e), ic(r, e)
    }
    e.s(["allProcessors", 0, iX, "anyProcessor", 0, iC, "arrayProcessor", 0, iL, "bigintProcessor", 0, ig, "booleanProcessor", 0, iy, "catchProcessor", 0, iK, "customProcessor", 0, iN, "dateProcessor", 0, iS, "defaultProcessor", 0, iZ, "enumProcessor", 0, iA, "fileProcessor", 0, iO, "functionProcessor", 0, iM, "intersectionProcessor", 0, i$, "lazyProcessor", 0, iY, "literalProcessor", 0, iI, "mapProcessor", 0, iD, "nanProcessor", 0, iT, "neverProcessor", 0, i_, "nonoptionalProcessor", 0, iW, "nullProcessor", 0, iv, "nullableProcessor", 0, iq, "numberProcessor", 0, im, "objectProcessor", 0, iF, "optionalProcessor", 0, iJ, "pipeProcessor", 0, iH, "prefaultProcessor", 0, iV, "promiseProcessor", 0, iQ, "readonlyProcessor", 0, iG, "recordProcessor", 0, iB, "setProcessor", 0, ij, "stringProcessor", 0, ih, "successProcessor", 0, iR, "symbolProcessor", 0, ib, "templateLiteralProcessor", 0, ik, "toJSONSchema", 0, i0, "transformProcessor", 0, iP, "tupleProcessor", 0, iz, "undefinedProcessor", 0, ix, "unionProcessor", 0, iU, "unknownProcessor", 0, iE, "voidProcessor", 0, iw], 459434), e.s([], 324233);
    var i1 = e.i(324233);
    e.s(["$ZodAny", 0, rh, "$ZodArray", 0, rx, "$ZodAsyncError", 0, s, "$ZodBase64", 0, t9, "$ZodBase64URL", 0, rt, "$ZodBigInt", 0, rc, "$ZodBigIntFormat", 0, ru, "$ZodBoolean", 0, rl, "$ZodCIDRv4", 0, t4, "$ZodCIDRv6", 0, t8, "$ZodCUID", 0, tH, "$ZodCUID2", 0, tG, "$ZodCatch", 0, r2, "$ZodCheck", 0, tp, "$ZodCheckBigIntFormat", 0, tv, "$ZodCheckEndsWith", 0, tN, "$ZodCheckGreaterThan", 0, ty, "$ZodCheckIncludes", 0, tO, "$ZodCheckLengthEquals", 0, tS, "$ZodCheckLessThan", 0, tm, "$ZodCheckLowerCase", 0, tT, "$ZodCheckMaxLength", 0, tC, "$ZodCheckMaxSize", 0, tx, "$ZodCheckMimeType", 0, tD, "$ZodCheckMinLength", 0, tE, "$ZodCheckMinSize", 0, tw, "$ZodCheckMultipleOf", 0, tg, "$ZodCheckNumberFormat", 0, tb, "$ZodCheckOverwrite", 0, tj, "$ZodCheckProperty", 0, tP, "$ZodCheckRegex", 0, tI, "$ZodCheckSizeEquals", 0, t_, "$ZodCheckStartsWith", 0, tR, "$ZodCheckStringFormat", 0, tA, "$ZodCheckUpperCase", 0, tk, "$ZodCodec", 0, r4, "$ZodCustom", 0, no, "$ZodCustomStringFormat", 0, ri, "$ZodDate", 0, rb, "$ZodDefault", 0, rQ, "$ZodDiscriminatedUnion", 0, rO, "$ZodE164", 0, rr, "$ZodEmail", 0, tW, "$ZodEmoji", 0, tV, "$ZodEncodeError", 0, l, "$ZodEnum", 0, rB, "$ZodError", 0, Q, "$ZodExactOptional", 0, rH, "$ZodFile", 0, rW, "$ZodFunction", 0, nn, "$ZodGUID", 0, tB, "$ZodIPv4", 0, t6, "$ZodIPv6", 0, t5, "$ZodISODate", 0, t0, "$ZodISODateTime", 0, tX, "$ZodISODuration", 0, t2, "$ZodISOTime", 0, t1, "$ZodIntersection", 0, rR, "$ZodJWT", 0, ra, "$ZodKSUID", 0, tY, "$ZodLazy", 0, ni, "$ZodLiteral", 0, rq, "$ZodMAC", 0, t3, "$ZodMap", 0, rF, "$ZodNaN", 0, r6, "$ZodNanoID", 0, tK, "$ZodNever", 0, ry, "$ZodNonOptional", 0, rX, "$ZodNull", 0, rp, "$ZodNullable", 0, rG, "$ZodNumber", 0, ro, "$ZodNumberFormat", 0, rs, "$ZodObject", 0, rE, "$ZodObjectJIT", 0, rS, "$ZodOptional", 0, rK, "$ZodPipe", 0, r5, "$ZodPrefault", 0, rY, "$ZodPreprocess", 0, r9, "$ZodPromise", 0, na, "$ZodReadonly", 0, ne, "$ZodRealError", 0, J, "$ZodRecord", 0, rL, "$ZodRegistry", 0, nm, "$ZodSet", 0, r$, "$ZodString", 0, t$, "$ZodStringFormat", 0, tz, "$ZodSuccess", 0, r1, "$ZodSymbol", 0, rd, "$ZodTemplateLiteral", 0, nr, "$ZodTransform", 0, rZ, "$ZodTuple", 0, rM, "$ZodType", 0, tU, "$ZodULID", 0, tQ, "$ZodURL", 0, tZ, "$ZodUUID", 0, tq, "$ZodUndefined", 0, rf, "$ZodUnion", 0, rI, "$ZodUnknown", 0, rm, "$ZodVoid", 0, rg, "$ZodXID", 0, tJ, "$ZodXor", 0, rk, "$brand", 0, o, "$constructor", 0, i, "$input", 0, nh, "$output", 0, np, "Doc", 0, tL, "JSONSchema", 0, i1, "JSONSchemaGenerator", 0, class {
        get metadataRegistry() {
            return this.ctx.metadataRegistry
        }
        get target() {
            return this.ctx.target
        }
        get unrepresentable() {
            return this.ctx.unrepresentable
        }
        get override() {
            return this.ctx.override
        }
        get io() {
            return this.ctx.io
        }
        get counter() {
            return this.ctx.counter
        }
        set counter(e) {
            this.ctx.counter = e
        }
        get seen() {
            return this.ctx.seen
        }
        constructor(e) {
            let t = e ? .target ? ? "draft-2020-12";
            "draft-4" === t && (t = "draft-04"), "draft-7" === t && (t = "draft-07"), this.ctx = io({
                processors: iX,
                target: t,
                ...e ? .metadata && {
                    metadata: e.metadata
                },
                ...e ? .unrepresentable && {
                    unrepresentable: e.unrepresentable
                },
                ...e ? .override && {
                    override: e.override
                },
                ...e ? .io && {
                    io: e.io
                }
            })
        }
        process(e, t = {
            path: [],
            schemaPath: []
        }) {
            return is(e, this.ctx, t)
        }
        emit(e, t) {
            t && (t.cycles && (this.ctx.cycles = t.cycles), t.reused && (this.ctx.reused = t.reused), t.external && (this.ctx.external = t.external)), il(this.ctx, e);
            let {
                "~standard": r,
                ...n
            } = ic(this.ctx, e);
            return n
        }
    }, "NEVER", 0, a, "TimePrecision", 0, nq, "_any", 0, ae, "_array", 0, aj, "_base64", 0, nU, "_base64url", 0, n$, "_bigint", 0, n6, "_boolean", 0, n1, "_catch", 0, a1, "_check", 0, ie, "_cidrv4", 0, nL, "_cidrv6", 0, nF, "_coercedBigint", 0, n5, "_coercedBoolean", 0, n2, "_coercedDate", 0, ai, "_coercedNumber", 0, nG, "_coercedString", 0, nv, "_cuid", 0, nk, "_cuid2", 0, nO, "_custom", 0, a8, "_date", 0, aa, "_decode", 0, ep, "_decodeAsync", 0, eg, "_default", 0, aY, "_discriminatedUnion", 0, aU, "_e164", 0, nz, "_email", 0, nx, "_emoji", 0, nI, "_encode", 0, ed, "_encodeAsync", 0, em, "_endsWith", 0, aI, "_enum", 0, aZ, "_file", 0, aH, "_float32", 0, nJ, "_float64", 0, nY, "_gt", 0, ac, "_gte", 0, au, "_guid", 0, nw, "_includes", 0, aS, "_int", 0, nQ, "_int32", 0, nX, "_int64", 0, n3, "_intersection", 0, a$, "_ipv4", 0, nP, "_ipv6", 0, nD, "_isoDate", 0, nZ, "_isoDateTime", 0, nW, "_isoDuration", 0, nK, "_isoTime", 0, nV, "_jwt", 0, nB, "_ksuid", 0, nM, "_lazy", 0, a3, "_length", 0, aw, "_literal", 0, aK, "_lowercase", 0, aC, "_lt", 0, as, "_lte", 0, al, "_mac", 0, nj, "_map", 0, aq, "_max", 0, al, "_maxLength", 0, av, "_maxSize", 0, ay, "_mime", 0, ak, "_min", 0, au, "_minLength", 0, ax, "_minSize", 0, ag, "_multipleOf", 0, am, "_nan", 0, ao, "_nanoid", 0, nT, "_nativeEnum", 0, aV, "_negative", 0, af, "_never", 0, ar, "_nonnegative", 0, ah, "_nonoptional", 0, aX, "_nonpositive", 0, ap, "_normalize", 0, aR, "_null", 0, n9, "_nullable", 0, aJ, "_number", 0, nH, "_optional", 0, aQ, "_overwrite", 0, aO, "_parse", 0, en, "_parseAsync", 0, ei, "_pipe", 0, a2, "_positive", 0, ad, "_promise", 0, a4, "_property", 0, aT, "_readonly", 0, a6, "_record", 0, aB, "_refine", 0, a7, "_regex", 0, a_, "_safeDecode", 0, ew, "_safeDecodeAsync", 0, eS, "_safeEncode", 0, ev, "_safeEncodeAsync", 0, eC, "_safeParse", 0, es, "_safeParseAsync", 0, ec, "_set", 0, aW, "_size", 0, ab, "_slugify", 0, aD, "_startsWith", 0, aA, "_string", 0, nb, "_stringFormat", 0, ii, "_stringbool", 0, ia, "_success", 0, a0, "_superRefine", 0, a9, "_symbol", 0, n8, "_templateLiteral", 0, a5, "_toLowerCase", 0, aM, "_toUpperCase", 0, aP, "_transform", 0, aG, "_trim", 0, aN, "_tuple", 0, az, "_uint32", 0, n0, "_uint64", 0, n4, "_ulid", 0, nR, "_undefined", 0, n7, "_union", 0, aL, "_unknown", 0, at, "_uppercase", 0, aE, "_url", 0, nA, "_uuid", 0, n_, "_uuidv4", 0, nC, "_uuidv6", 0, nE, "_uuidv7", 0, nS, "_void", 0, an, "_xid", 0, nN, "_xor", 0, aF, "clone", 0, N, "config", 0, u, "createStandardJSONSchemaMethod", 0, id, "createToJSONSchemaMethod", 0, iu, "decode", 0, eh, "decodeAsync", 0, eb, "describe", 0, it, "encode", 0, ef, "encodeAsync", 0, ey, "extractDefs", 0, il, "finalize", 0, ic, "flattenError", 0, Y, "formatError", 0, X, "globalConfig", 0, c, "globalRegistry", 0, ng, "initializeContext", 0, io, "isValidBase64", 0, t7, "isValidBase64URL", 0, re, "isValidJWT", 0, rn, "meta", 0, ir, "parse", 0, ea, "parseAsync", 0, eo, "prettifyError", 0, er, "process", 0, is, "regexes", 0, nf, "registry", 0, ny, "safeDecode", 0, e_, "safeDecodeAsync", 0, eA, "safeEncode", 0, ex, "safeEncodeAsync", 0, eE, "safeParse", 0, el, "safeParseAsync", 0, eu, "toDotPath", 0, et, "toJSONSchema", 0, i0, "treeifyError", 0, ee, "util", 0, nd, "version", 0, tF], 283723);
    var i2 = e.i(283723);
    e.s(["ZodAny", () => sR, "ZodArray", () => sz, "ZodBase64", () => o8, "ZodBase64URL", () => o9, "ZodBigInt", () => sx, "ZodBigIntFormat", () => s_, "ZodBoolean", () => sb, "ZodCIDRv4", () => o6, "ZodCIDRv6", () => o3, "ZodCUID", () => oz, "ZodCUID2", () => oq, "ZodCatch", () => lA, "ZodCodec", () => lN, "ZodCustom", () => lV, "ZodCustomStringFormat", () => si, "ZodDate", () => sU, "ZodDefault", () => lb, "ZodDiscriminatedUnion", () => sY, "ZodE164", () => st, "ZodEmail", () => oS, "ZodEmoji", () => oL, "ZodEnum", () => lr, "ZodExactOptional", () => lp, "ZodFile", () => ls, "ZodFunction", () => lW, "ZodGUID", () => oI, "ZodIPv4", () => oJ, "ZodIPv6", () => o1, "ZodIntersection", () => s0, "ZodJWT", () => sn, "ZodKSUID", () => oG, "ZodLazy", () => l$, "ZodLiteral", () => li, "ZodMAC", () => oX, "ZodMap", () => s7, "ZodNaN", () => lT, "ZodNanoID", () => oU, "ZodNever", () => sD, "ZodNonOptional", () => l_, "ZodNull", () => sk, "ZodNullable", () => lm, "ZodNumber", () => su, "ZodNumberFormat", () => sf, "ZodObject", () => sW, "ZodOptional", () => ld, "ZodPipe", () => lO, "ZodPrefault", () => lx, "ZodPreprocess", () => lD, "ZodPromise", () => lB, "ZodReadonly", () => lj, "ZodRecord", () => s5, "ZodSet", () => le, "ZodString", () => o_, "ZodStringFormat", () => oE, "ZodSuccess", () => lE, "ZodSymbol", () => sS, "ZodTemplateLiteral", () => lF, "ZodTransform", () => lc, "ZodTuple", () => s2, "ZodType", () => ox, "ZodULID", () => oZ, "ZodURL", () => oP, "ZodUUID", () => ok, "ZodUndefined", () => sI, "ZodUnion", () => sH, "ZodUnknown", () => sM, "ZodVoid", () => sL, "ZodXID", () => oK, "ZodXor", () => sQ, "_ZodString", () => ow, "_default", () => lv, "_function", () => lZ, "any", () => sN, "array", () => sB, "base64", () => o7, "base64url", () => se, "bigint", () => sw, "boolean", () => sv, "catch", () => lI, "check", () => lK, "cidrv4", () => o5, "cidrv6", () => o4, "codec", () => lM, "cuid", () => oB, "cuid2", () => oW, "custom", () => lH, "date", () => s$, "describe", () => lJ, "discriminatedUnion", () => sX, "e164", () => sr, "email", () => oA, "emoji", () => oF, "enum", () => ln, "exactOptional", () => lh, "file", () => ll, "float32", () => sh, "float64", () => sm, "function", () => lZ, "guid", () => oT, "hash", () => sc, "hex", () => sl, "hostname", () => ss, "httpUrl", () => oj, "instanceof", () => lX, "int", () => sp, "int32", () => sy, "int64", () => sC, "intersection", () => s1, "invertCodec", () => lP, "ipv4", () => oY, "ipv6", () => o2, "json", () => l1, "jwt", () => sa, "keyof", () => sq, "ksuid", () => oQ, "lazy", () => lz, "literal", () => lo, "looseObject", () => sK, "looseRecord", () => s8, "mac", () => o0, "map", () => s9, "meta", () => lY, "nan", () => lk, "nanoid", () => o$, "nativeEnum", () => la, "never", () => sj, "nonoptional", () => lC, "null", () => sO, "nullable", () => ly, "nullish", () => lg, "number", () => sd, "object", () => sZ, "optional", () => lf, "partialRecord", () => s4, "pipe", () => lR, "prefault", () => lw, "preprocess", () => l2, "promise", () => lq, "readonly", () => lL, "record", () => s3, "refine", () => lG, "set", () => lt, "strictObject", () => sV, "string", () => oC, "stringFormat", () => so, "stringbool", () => l0, "success", () => lS, "superRefine", () => lQ, "symbol", () => sA, "templateLiteral", () => lU, "transform", () => lu, "tuple", () => s6, "uint32", () => sg, "uint64", () => sE, "ulid", () => oV, "undefined", () => sT, "union", () => sG, "unknown", () => sP, "url", () => oD, "uuid", () => oO, "uuidv4", () => oR, "uuidv6", () => oN, "uuidv7", () => oM, "void", () => sF, "xid", () => oH, "xor", () => sJ], 553884);
    var i6 = nf,
        i5 = nd;
    e.s(["ZodISODate", () => i8, "ZodISODateTime", () => i3, "ZodISODuration", () => ot, "ZodISOTime", () => i9, "date", () => i7, "datetime", () => i4, "duration", () => or, "time", () => oe], 339084);
    let i3 = i("ZodISODateTime", (e, t) => {
        tX.init(e, t), oE.init(e, t)
    });

    function i4(e) {
        return nW(i3, e)
    }
    let i8 = i("ZodISODate", (e, t) => {
        t0.init(e, t), oE.init(e, t)
    });

    function i7(e) {
        return nZ(i8, e)
    }
    let i9 = i("ZodISOTime", (e, t) => {
        t1.init(e, t), oE.init(e, t)
    });

    function oe(e) {
        return nV(i9, e)
    }
    let ot = i("ZodISODuration", (e, t) => {
        t2.init(e, t), oE.init(e, t)
    });

    function or(e) {
        return nK(ot, e)
    }
    let on = (e, t) => {
            Q.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
                format: {
                    value: t => X(e, t)
                },
                flatten: {
                    value: t => Y(e, t)
                },
                addIssue: {
                    value: t => {
                        e.issues.push(t), e.message = JSON.stringify(e.issues, p, 2)
                    }
                },
                addIssues: {
                    value: t => {
                        e.issues.push(...t), e.message = JSON.stringify(e.issues, p, 2)
                    }
                },
                isEmpty: {
                    get: () => 0 === e.issues.length
                }
            })
        },
        oa = i("ZodError", on),
        oi = i("ZodError", on, {
            Parent: Error
        });
    e.s(["ZodError", 0, oa, "ZodRealError", 0, oi], 584746);
    let oo = en(oi),
        os = ei(oi),
        ol = es(oi),
        oc = ec(oi),
        ou = ed(oi),
        od = ep(oi),
        of = em(oi),
        op = eg(oi),
        oh = ev(oi),
        om = ew(oi),
        oy = eC(oi),
        og = eS(oi);
    e.s(["decode", 0, od, "decodeAsync", 0, op, "encode", 0, ou, "encodeAsync", 0, of , "parse", 0, oo, "parseAsync", 0, os, "safeDecode", 0, om, "safeDecodeAsync", 0, og, "safeEncode", 0, oh, "safeEncodeAsync", 0, oy, "safeParse", 0, ol, "safeParseAsync", 0, oc], 263749);
    let ob = new WeakMap;

    function ov(e, t, r) {
        let n = Object.getPrototypeOf(e),
            a = ob.get(n);
        if (a || (a = new Set, ob.set(n, a)), !a.has(t))
            for (let e in a.add(t), r) {
                let t = r[e];
                Object.defineProperty(n, e, {
                    configurable: !0,
                    enumerable: !1,
                    get() {
                        let r = t.bind(this);
                        return Object.defineProperty(this, e, {
                            configurable: !0,
                            writable: !0,
                            enumerable: !0,
                            value: r
                        }), r
                    },
                    set(t) {
                        Object.defineProperty(this, e, {
                            configurable: !0,
                            writable: !0,
                            enumerable: !0,
                            value: t
                        })
                    }
                })
            }
    }
    let ox = i("ZodType", (e, t) => (tU.init(e, t), Object.assign(e["~standard"], {
            jsonSchema: {
                input: id(e, "input"),
                output: id(e, "output")
            }
        }), e.toJSONSchema = iu(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", {
            value: t
        }), e.parse = (t, r) => oo(e, t, r, {
            callee: e.parse
        }), e.safeParse = (t, r) => ol(e, t, r), e.parseAsync = async (t, r) => os(e, t, r, {
            callee: e.parseAsync
        }), e.safeParseAsync = async (t, r) => oc(e, t, r), e.spa = e.safeParseAsync, e.encode = (t, r) => ou(e, t, r), e.decode = (t, r) => od(e, t, r), e.encodeAsync = async (t, r) => of (e, t, r), e.decodeAsync = async (t, r) => op(e, t, r), e.safeEncode = (t, r) => oh(e, t, r), e.safeDecode = (t, r) => om(e, t, r), e.safeEncodeAsync = async (t, r) => oy(e, t, r), e.safeDecodeAsync = async (t, r) => og(e, t, r), ov(e, "ZodType", {
            check(...e) {
                let t = this.def;
                return this.clone(i5.mergeDefs(t, {
                    checks: [...t.checks ? ? [], ...e.map(e => "function" == typeof e ? {
                        _zod: {
                            check: e,
                            def: {
                                check: "custom"
                            },
                            onattach: []
                        }
                    } : e)]
                }), {
                    parent: !0
                })
            },
            with(...e) {
                return this.check(...e)
            },
            clone(e, t) {
                return N(this, e, t)
            },
            brand() {
                return this
            },
            register(e, t) {
                return e.add(this, t), this
            },
            refine(e, t) {
                return this.check(lG(e, t))
            },
            superRefine(e, t) {
                return this.check(lQ(e, t))
            },
            overwrite(e) {
                return this.check(aO(e))
            },
            optional() {
                return lf(this)
            },
            exactOptional() {
                return lh(this)
            },
            nullable() {
                return ly(this)
            },
            nullish() {
                return lf(ly(this))
            },
            nonoptional(e) {
                return lC(this, e)
            },
            array() {
                return sB(this)
            },
            or(e) {
                return sG([this, e])
            },
            and(e) {
                return s1(this, e)
            },
            transform(e) {
                return lR(this, lu(e))
            },
            default (e) {
                return lv(this, e)
            },
            prefault(e) {
                return lw(this, e)
            },
            catch (e) {
                return lI(this, e)
            },
            pipe(e) {
                return lR(this, e)
            },
            readonly() {
                return lL(this)
            },
            describe(e) {
                let t = this.clone();
                return ng.add(t, {
                    description: e
                }), t
            },
            meta(...e) {
                if (0 === e.length) return ng.get(this);
                let t = this.clone();
                return ng.add(t, e[0]), t
            },
            isOptional() {
                return this.safeParse(void 0).success
            },
            isNullable() {
                return this.safeParse(null).success
            },
            apply(e) {
                return e(this)
            }
        }), Object.defineProperty(e, "description", {
            get: () => ng.get(e) ? .description,
            configurable: !0
        }), e)),
        ow = i("_ZodString", (e, t) => {
            t$.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => ih(e, t, r, n);
            let r = e._zod.bag;
            e.format = r.format ? ? null, e.minLength = r.minimum ? ? null, e.maxLength = r.maximum ? ? null, ov(e, "_ZodString", {
                regex(...e) {
                    return this.check(a_(...e))
                },
                includes(...e) {
                    return this.check(aS(...e))
                },
                startsWith(...e) {
                    return this.check(aA(...e))
                },
                endsWith(...e) {
                    return this.check(aI(...e))
                },
                min(...e) {
                    return this.check(ax(...e))
                },
                max(...e) {
                    return this.check(av(...e))
                },
                length(...e) {
                    return this.check(aw(...e))
                },
                nonempty(...e) {
                    return this.check(ax(1, ...e))
                },
                lowercase(e) {
                    return this.check(aC(e))
                },
                uppercase(e) {
                    return this.check(aE(e))
                },
                trim() {
                    return this.check(aN())
                },
                normalize(...e) {
                    return this.check(aR(...e))
                },
                toLowerCase() {
                    return this.check(aM())
                },
                toUpperCase() {
                    return this.check(aP())
                },
                slugify() {
                    return this.check(aD())
                }
            })
        }),
        o_ = i("ZodString", (e, t) => {
            t$.init(e, t), ow.init(e, t), e.email = t => e.check(nx(oS, t)), e.url = t => e.check(nA(oP, t)), e.jwt = t => e.check(nB(sn, t)), e.emoji = t => e.check(nI(oL, t)), e.guid = t => e.check(nw(oI, t)), e.uuid = t => e.check(n_(ok, t)), e.uuidv4 = t => e.check(nC(ok, t)), e.uuidv6 = t => e.check(nE(ok, t)), e.uuidv7 = t => e.check(nS(ok, t)), e.nanoid = t => e.check(nT(oU, t)), e.guid = t => e.check(nw(oI, t)), e.cuid = t => e.check(nk(oz, t)), e.cuid2 = t => e.check(nO(oq, t)), e.ulid = t => e.check(nR(oZ, t)), e.base64 = t => e.check(nU(o8, t)), e.base64url = t => e.check(n$(o9, t)), e.xid = t => e.check(nN(oK, t)), e.ksuid = t => e.check(nM(oG, t)), e.ipv4 = t => e.check(nP(oJ, t)), e.ipv6 = t => e.check(nD(o1, t)), e.cidrv4 = t => e.check(nL(o6, t)), e.cidrv6 = t => e.check(nF(o3, t)), e.e164 = t => e.check(nz(st, t)), e.datetime = t => e.check(i4(t)), e.date = t => e.check(i7(t)), e.time = t => e.check(oe(t)), e.duration = t => e.check(or(t))
        });

    function oC(e) {
        return nb(o_, e)
    }
    let oE = i("ZodStringFormat", (e, t) => {
            tz.init(e, t), ow.init(e, t)
        }),
        oS = i("ZodEmail", (e, t) => {
            tW.init(e, t), oE.init(e, t)
        });

    function oA(e) {
        return nx(oS, e)
    }
    let oI = i("ZodGUID", (e, t) => {
        tB.init(e, t), oE.init(e, t)
    });

    function oT(e) {
        return nw(oI, e)
    }
    let ok = i("ZodUUID", (e, t) => {
        tq.init(e, t), oE.init(e, t)
    });

    function oO(e) {
        return n_(ok, e)
    }

    function oR(e) {
        return nC(ok, e)
    }

    function oN(e) {
        return nE(ok, e)
    }

    function oM(e) {
        return nS(ok, e)
    }
    let oP = i("ZodURL", (e, t) => {
        tZ.init(e, t), oE.init(e, t)
    });

    function oD(e) {
        return nA(oP, e)
    }

    function oj(e) {
        return nA(oP, {
            protocol: i6.httpProtocol,
            hostname: i6.domain,
            ...i5.normalizeParams(e)
        })
    }
    let oL = i("ZodEmoji", (e, t) => {
        tV.init(e, t), oE.init(e, t)
    });

    function oF(e) {
        return nI(oL, e)
    }
    let oU = i("ZodNanoID", (e, t) => {
        tK.init(e, t), oE.init(e, t)
    });

    function o$(e) {
        return nT(oU, e)
    }
    let oz = i("ZodCUID", (e, t) => {
        tH.init(e, t), oE.init(e, t)
    });

    function oB(e) {
        return nk(oz, e)
    }
    let oq = i("ZodCUID2", (e, t) => {
        tG.init(e, t), oE.init(e, t)
    });

    function oW(e) {
        return nO(oq, e)
    }
    let oZ = i("ZodULID", (e, t) => {
        tQ.init(e, t), oE.init(e, t)
    });

    function oV(e) {
        return nR(oZ, e)
    }
    let oK = i("ZodXID", (e, t) => {
        tJ.init(e, t), oE.init(e, t)
    });

    function oH(e) {
        return nN(oK, e)
    }
    let oG = i("ZodKSUID", (e, t) => {
        tY.init(e, t), oE.init(e, t)
    });

    function oQ(e) {
        return nM(oG, e)
    }
    let oJ = i("ZodIPv4", (e, t) => {
        t6.init(e, t), oE.init(e, t)
    });

    function oY(e) {
        return nP(oJ, e)
    }
    let oX = i("ZodMAC", (e, t) => {
        t3.init(e, t), oE.init(e, t)
    });

    function o0(e) {
        return nj(oX, e)
    }
    let o1 = i("ZodIPv6", (e, t) => {
        t5.init(e, t), oE.init(e, t)
    });

    function o2(e) {
        return nD(o1, e)
    }
    let o6 = i("ZodCIDRv4", (e, t) => {
        t4.init(e, t), oE.init(e, t)
    });

    function o5(e) {
        return nL(o6, e)
    }
    let o3 = i("ZodCIDRv6", (e, t) => {
        t8.init(e, t), oE.init(e, t)
    });

    function o4(e) {
        return nF(o3, e)
    }
    let o8 = i("ZodBase64", (e, t) => {
        t9.init(e, t), oE.init(e, t)
    });

    function o7(e) {
        return nU(o8, e)
    }
    let o9 = i("ZodBase64URL", (e, t) => {
        rt.init(e, t), oE.init(e, t)
    });

    function se(e) {
        return n$(o9, e)
    }
    let st = i("ZodE164", (e, t) => {
        rr.init(e, t), oE.init(e, t)
    });

    function sr(e) {
        return nz(st, e)
    }
    let sn = i("ZodJWT", (e, t) => {
        ra.init(e, t), oE.init(e, t)
    });

    function sa(e) {
        return nB(sn, e)
    }
    let si = i("ZodCustomStringFormat", (e, t) => {
        ri.init(e, t), oE.init(e, t)
    });

    function so(e, t, r = {}) {
        return ii(si, e, t, r)
    }

    function ss(e) {
        return ii(si, "hostname", i6.hostname, e)
    }

    function sl(e) {
        return ii(si, "hex", i6.hex, e)
    }

    function sc(e, t) {
        let r = t ? .enc ? ? "hex",
            n = `${e}_${r}`,
            a = i6[n];
        if (!a) throw Error(`Unrecognized hash format: ${n}`);
        return ii(si, n, a, t)
    }
    let su = i("ZodNumber", (e, t) => {
        ro.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => im(e, t, r, n), ov(e, "ZodNumber", {
            gt(e, t) {
                return this.check(ac(e, t))
            },
            gte(e, t) {
                return this.check(au(e, t))
            },
            min(e, t) {
                return this.check(au(e, t))
            },
            lt(e, t) {
                return this.check(as(e, t))
            },
            lte(e, t) {
                return this.check(al(e, t))
            },
            max(e, t) {
                return this.check(al(e, t))
            },
            int(e) {
                return this.check(sp(e))
            },
            safe(e) {
                return this.check(sp(e))
            },
            positive(e) {
                return this.check(ac(0, e))
            },
            nonnegative(e) {
                return this.check(au(0, e))
            },
            negative(e) {
                return this.check(as(0, e))
            },
            nonpositive(e) {
                return this.check(al(0, e))
            },
            multipleOf(e, t) {
                return this.check(am(e, t))
            },
            step(e, t) {
                return this.check(am(e, t))
            },
            finite() {
                return this
            }
        });
        let r = e._zod.bag;
        e.minValue = Math.max(r.minimum ? ? -1 / 0, r.exclusiveMinimum ? ? -1 / 0) ? ? null, e.maxValue = Math.min(r.maximum ? ? 1 / 0, r.exclusiveMaximum ? ? 1 / 0) ? ? null, e.isInt = (r.format ? ? "").includes("int") || Number.isSafeInteger(r.multipleOf ? ? .5), e.isFinite = !0, e.format = r.format ? ? null
    });

    function sd(e) {
        return nH(su, e)
    }
    let sf = i("ZodNumberFormat", (e, t) => {
        rs.init(e, t), su.init(e, t)
    });

    function sp(e) {
        return nQ(sf, e)
    }

    function sh(e) {
        return nJ(sf, e)
    }

    function sm(e) {
        return nY(sf, e)
    }

    function sy(e) {
        return nX(sf, e)
    }

    function sg(e) {
        return n0(sf, e)
    }
    let sb = i("ZodBoolean", (e, t) => {
        rl.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iy(e, t, r, n)
    });

    function sv(e) {
        return n1(sb, e)
    }
    let sx = i("ZodBigInt", (e, t) => {
        rc.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => ig(e, t, r, n), e.gte = (t, r) => e.check(au(t, r)), e.min = (t, r) => e.check(au(t, r)), e.gt = (t, r) => e.check(ac(t, r)), e.gte = (t, r) => e.check(au(t, r)), e.min = (t, r) => e.check(au(t, r)), e.lt = (t, r) => e.check(as(t, r)), e.lte = (t, r) => e.check(al(t, r)), e.max = (t, r) => e.check(al(t, r)), e.positive = t => e.check(ac(BigInt(0), t)), e.negative = t => e.check(as(BigInt(0), t)), e.nonpositive = t => e.check(al(BigInt(0), t)), e.nonnegative = t => e.check(au(BigInt(0), t)), e.multipleOf = (t, r) => e.check(am(t, r));
        let r = e._zod.bag;
        e.minValue = r.minimum ? ? null, e.maxValue = r.maximum ? ? null, e.format = r.format ? ? null
    });

    function sw(e) {
        return n6(sx, e)
    }
    let s_ = i("ZodBigIntFormat", (e, t) => {
        ru.init(e, t), sx.init(e, t)
    });

    function sC(e) {
        return n3(s_, e)
    }

    function sE(e) {
        return n4(s_, e)
    }
    let sS = i("ZodSymbol", (e, t) => {
        rd.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => ib(e, t, r, n)
    });

    function sA(e) {
        return n8(sS, e)
    }
    let sI = i("ZodUndefined", (e, t) => {
        rf.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => ix(e, t, r, n)
    });

    function sT(e) {
        return n7(sI, e)
    }
    let sk = i("ZodNull", (e, t) => {
        rp.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iv(e, t, r, n)
    });

    function sO(e) {
        return n9(sk, e)
    }
    let sR = i("ZodAny", (e, t) => {
        rh.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iC(e, t, r, n)
    });

    function sN() {
        return ae(sR)
    }
    let sM = i("ZodUnknown", (e, t) => {
        rm.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iE(e, t, r, n)
    });

    function sP() {
        return at(sM)
    }
    let sD = i("ZodNever", (e, t) => {
        ry.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => i_(e, t, r, n)
    });

    function sj(e) {
        return ar(sD, e)
    }
    let sL = i("ZodVoid", (e, t) => {
        rg.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iw(e, t, r, n)
    });

    function sF(e) {
        return an(sL, e)
    }
    let sU = i("ZodDate", (e, t) => {
        rb.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iS(e, t, r, n), e.min = (t, r) => e.check(au(t, r)), e.max = (t, r) => e.check(al(t, r));
        let r = e._zod.bag;
        e.minDate = r.minimum ? new Date(r.minimum) : null, e.maxDate = r.maximum ? new Date(r.maximum) : null
    });

    function s$(e) {
        return aa(sU, e)
    }
    let sz = i("ZodArray", (e, t) => {
        rx.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iL(e, t, r, n), e.element = t.element, ov(e, "ZodArray", {
            min(e, t) {
                return this.check(ax(e, t))
            },
            nonempty(e) {
                return this.check(ax(1, e))
            },
            max(e, t) {
                return this.check(av(e, t))
            },
            length(e, t) {
                return this.check(aw(e, t))
            },
            unwrap() {
                return this.element
            }
        })
    });

    function sB(e, t) {
        return aj(sz, e, t)
    }

    function sq(e) {
        return ln(Object.keys(e._zod.def.shape))
    }
    let sW = i("ZodObject", (e, t) => {
        rS.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iF(e, t, r, n), i5.defineLazy(e, "shape", () => t.shape), ov(e, "ZodObject", {
            keyof() {
                return ln(Object.keys(this._zod.def.shape))
            },
            catchall(e) {
                return this.clone({ ...this._zod.def,
                    catchall: e
                })
            },
            passthrough() {
                return this.clone({ ...this._zod.def,
                    catchall: sP()
                })
            },
            loose() {
                return this.clone({ ...this._zod.def,
                    catchall: sP()
                })
            },
            strict() {
                return this.clone({ ...this._zod.def,
                    catchall: sj()
                })
            },
            strip() {
                return this.clone({ ...this._zod.def,
                    catchall: void 0
                })
            },
            extend(e) {
                return i5.extend(this, e)
            },
            safeExtend(e) {
                return i5.safeExtend(this, e)
            },
            merge(e) {
                return i5.merge(this, e)
            },
            pick(e) {
                return i5.pick(this, e)
            },
            omit(e) {
                return i5.omit(this, e)
            },
            partial(...e) {
                return i5.partial(ld, this, e[0])
            },
            required(...e) {
                return i5.required(l_, this, e[0])
            }
        })
    });

    function sZ(e, t) {
        return new sW({
            type: "object",
            shape: e ? ? {},
            ...i5.normalizeParams(t)
        })
    }

    function sV(e, t) {
        return new sW({
            type: "object",
            shape: e,
            catchall: sj(),
            ...i5.normalizeParams(t)
        })
    }

    function sK(e, t) {
        return new sW({
            type: "object",
            shape: e,
            catchall: sP(),
            ...i5.normalizeParams(t)
        })
    }
    let sH = i("ZodUnion", (e, t) => {
        rI.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iU(e, t, r, n), e.options = t.options
    });

    function sG(e, t) {
        return new sH({
            type: "union",
            options: e,
            ...i5.normalizeParams(t)
        })
    }
    let sQ = i("ZodXor", (e, t) => {
        sH.init(e, t), rk.init(e, t), e._zod.processJSONSchema = (t, r, n) => iU(e, t, r, n), e.options = t.options
    });

    function sJ(e, t) {
        return new sQ({
            type: "union",
            options: e,
            inclusive: !1,
            ...i5.normalizeParams(t)
        })
    }
    let sY = i("ZodDiscriminatedUnion", (e, t) => {
        sH.init(e, t), rO.init(e, t)
    });

    function sX(e, t, r) {
        return new sY({
            type: "union",
            options: t,
            discriminator: e,
            ...i5.normalizeParams(r)
        })
    }
    let s0 = i("ZodIntersection", (e, t) => {
        rR.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => i$(e, t, r, n)
    });

    function s1(e, t) {
        return new s0({
            type: "intersection",
            left: e,
            right: t
        })
    }
    let s2 = i("ZodTuple", (e, t) => {
        rM.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iz(e, t, r, n), e.rest = t => e.clone({ ...e._zod.def,
            rest: t
        })
    });

    function s6(e, t, r) {
        let n = t instanceof tU,
            a = n ? r : t;
        return new s2({
            type: "tuple",
            items: e,
            rest: n ? t : null,
            ...i5.normalizeParams(a)
        })
    }
    let s5 = i("ZodRecord", (e, t) => {
        rL.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iB(e, t, r, n), e.keyType = t.keyType, e.valueType = t.valueType
    });

    function s3(e, t, r) {
        return new s5(t && t._zod ? {
            type: "record",
            keyType: e,
            valueType: t,
            ...i5.normalizeParams(r)
        } : {
            type: "record",
            keyType: oC(),
            valueType: e,
            ...i5.normalizeParams(t)
        })
    }

    function s4(e, t, r) {
        let n = N(e);
        return n._zod.values = void 0, new s5({
            type: "record",
            keyType: n,
            valueType: t,
            ...i5.normalizeParams(r)
        })
    }

    function s8(e, t, r) {
        return new s5({
            type: "record",
            keyType: e,
            valueType: t,
            mode: "loose",
            ...i5.normalizeParams(r)
        })
    }
    let s7 = i("ZodMap", (e, t) => {
        rF.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iD(e, t, r, n), e.keyType = t.keyType, e.valueType = t.valueType, e.min = (...t) => e.check(ag(...t)), e.nonempty = t => e.check(ag(1, t)), e.max = (...t) => e.check(ay(...t)), e.size = (...t) => e.check(ab(...t))
    });

    function s9(e, t, r) {
        return new s7({
            type: "map",
            keyType: e,
            valueType: t,
            ...i5.normalizeParams(r)
        })
    }
    let le = i("ZodSet", (e, t) => {
        r$.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => ij(e, t, r, n), e.min = (...t) => e.check(ag(...t)), e.nonempty = t => e.check(ag(1, t)), e.max = (...t) => e.check(ay(...t)), e.size = (...t) => e.check(ab(...t))
    });

    function lt(e, t) {
        return new le({
            type: "set",
            valueType: e,
            ...i5.normalizeParams(t)
        })
    }
    let lr = i("ZodEnum", (e, t) => {
        rB.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iA(e, t, r, n), e.enum = t.entries, e.options = Object.values(t.entries);
        let r = new Set(Object.keys(t.entries));
        e.extract = (e, n) => {
            let a = {};
            for (let n of e)
                if (r.has(n)) a[n] = t.entries[n];
                else throw Error(`Key ${n} not found in enum`);
            return new lr({ ...t,
                checks: [],
                ...i5.normalizeParams(n),
                entries: a
            })
        }, e.exclude = (e, n) => {
            let a = { ...t.entries
            };
            for (let t of e)
                if (r.has(t)) delete a[t];
                else throw Error(`Key ${t} not found in enum`);
            return new lr({ ...t,
                checks: [],
                ...i5.normalizeParams(n),
                entries: a
            })
        }
    });

    function ln(e, t) {
        return new lr({
            type: "enum",
            entries: Array.isArray(e) ? Object.fromEntries(e.map(e => [e, e])) : e,
            ...i5.normalizeParams(t)
        })
    }

    function la(e, t) {
        return new lr({
            type: "enum",
            entries: e,
            ...i5.normalizeParams(t)
        })
    }
    let li = i("ZodLiteral", (e, t) => {
        rq.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iI(e, t, r, n), e.values = new Set(t.values), Object.defineProperty(e, "value", {
            get() {
                if (t.values.length > 1) throw Error("This schema contains multiple valid literal values. Use `.values` instead.");
                return t.values[0]
            }
        })
    });

    function lo(e, t) {
        return new li({
            type: "literal",
            values: Array.isArray(e) ? e : [e],
            ...i5.normalizeParams(t)
        })
    }
    let ls = i("ZodFile", (e, t) => {
        rW.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iO(e, t, r, n), e.min = (t, r) => e.check(ag(t, r)), e.max = (t, r) => e.check(ay(t, r)), e.mime = (t, r) => e.check(ak(Array.isArray(t) ? t : [t], r))
    });

    function ll(e) {
        return aH(ls, e)
    }
    let lc = i("ZodTransform", (e, t) => {
        rZ.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iP(e, t, r, n), e._zod.parse = (r, n) => {
            if ("backward" === n.direction) throw new l(e.constructor.name);
            r.addIssue = n => {
                "string" == typeof n ? r.issues.push(i5.issue(n, r.value, t)) : (n.fatal && (n.continue = !1), n.code ? ? (n.code = "custom"), n.input ? ? (n.input = r.value), n.inst ? ? (n.inst = e), r.issues.push(i5.issue(n)))
            };
            let a = t.transform(r.value, r);
            return a instanceof Promise ? a.then(e => (r.value = e, r.fallback = !0, r)) : (r.value = a, r.fallback = !0, r)
        }
    });

    function lu(e) {
        return new lc({
            type: "transform",
            transform: e
        })
    }
    let ld = i("ZodOptional", (e, t) => {
        rK.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iJ(e, t, r, n), e.unwrap = () => e._zod.def.innerType
    });

    function lf(e) {
        return new ld({
            type: "optional",
            innerType: e
        })
    }
    let lp = i("ZodExactOptional", (e, t) => {
        rH.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iJ(e, t, r, n), e.unwrap = () => e._zod.def.innerType
    });

    function lh(e) {
        return new lp({
            type: "optional",
            innerType: e
        })
    }
    let lm = i("ZodNullable", (e, t) => {
        rG.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iq(e, t, r, n), e.unwrap = () => e._zod.def.innerType
    });

    function ly(e) {
        return new lm({
            type: "nullable",
            innerType: e
        })
    }

    function lg(e) {
        return lf(ly(e))
    }
    let lb = i("ZodDefault", (e, t) => {
        rQ.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iZ(e, t, r, n), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap
    });

    function lv(e, t) {
        return new lb({
            type: "default",
            innerType: e,
            get defaultValue() {
                return "function" == typeof t ? t() : i5.shallowClone(t)
            }
        })
    }
    let lx = i("ZodPrefault", (e, t) => {
        rY.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iV(e, t, r, n), e.unwrap = () => e._zod.def.innerType
    });

    function lw(e, t) {
        return new lx({
            type: "prefault",
            innerType: e,
            get defaultValue() {
                return "function" == typeof t ? t() : i5.shallowClone(t)
            }
        })
    }
    let l_ = i("ZodNonOptional", (e, t) => {
        rX.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iW(e, t, r, n), e.unwrap = () => e._zod.def.innerType
    });

    function lC(e, t) {
        return new l_({
            type: "nonoptional",
            innerType: e,
            ...i5.normalizeParams(t)
        })
    }
    let lE = i("ZodSuccess", (e, t) => {
        r1.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iR(e, t, r, n), e.unwrap = () => e._zod.def.innerType
    });

    function lS(e) {
        return new lE({
            type: "success",
            innerType: e
        })
    }
    let lA = i("ZodCatch", (e, t) => {
        r2.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iK(e, t, r, n), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap
    });

    function lI(e, t) {
        return new lA({
            type: "catch",
            innerType: e,
            catchValue: "function" == typeof t ? t : () => t
        })
    }
    let lT = i("ZodNaN", (e, t) => {
        r6.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iT(e, t, r, n)
    });

    function lk(e) {
        return ao(lT, e)
    }
    let lO = i("ZodPipe", (e, t) => {
        r5.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iH(e, t, r, n), e.in = t.in, e.out = t.out
    });

    function lR(e, t) {
        return new lO({
            type: "pipe",
            in: e,
            out: t
        })
    }
    let lN = i("ZodCodec", (e, t) => {
        lO.init(e, t), r4.init(e, t)
    });

    function lM(e, t, r) {
        return new lN({
            type: "pipe",
            in: e,
            out: t,
            transform: r.decode,
            reverseTransform: r.encode
        })
    }

    function lP(e) {
        let t = e._zod.def;
        return new lN({
            type: "pipe",
            in: t.out,
            out: t.in,
            transform: t.reverseTransform,
            reverseTransform: t.transform
        })
    }
    let lD = i("ZodPreprocess", (e, t) => {
            lO.init(e, t), r9.init(e, t)
        }),
        lj = i("ZodReadonly", (e, t) => {
            ne.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iG(e, t, r, n), e.unwrap = () => e._zod.def.innerType
        });

    function lL(e) {
        return new lj({
            type: "readonly",
            innerType: e
        })
    }
    let lF = i("ZodTemplateLiteral", (e, t) => {
        nr.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => ik(e, t, r, n)
    });

    function lU(e, t) {
        return new lF({
            type: "template_literal",
            parts: e,
            ...i5.normalizeParams(t)
        })
    }
    let l$ = i("ZodLazy", (e, t) => {
        ni.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iY(e, t, r, n), e.unwrap = () => e._zod.def.getter()
    });

    function lz(e) {
        return new l$({
            type: "lazy",
            getter: e
        })
    }
    let lB = i("ZodPromise", (e, t) => {
        na.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iQ(e, t, r, n), e.unwrap = () => e._zod.def.innerType
    });

    function lq(e) {
        return new lB({
            type: "promise",
            innerType: e
        })
    }
    let lW = i("ZodFunction", (e, t) => {
        nn.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iM(e, t, r, n)
    });

    function lZ(e) {
        return new lW({
            type: "function",
            input: Array.isArray(e ? .input) ? s6(e ? .input) : e ? .input ? ? sB(sP()),
            output: e ? .output ? ? sP()
        })
    }
    let lV = i("ZodCustom", (e, t) => {
        no.init(e, t), ox.init(e, t), e._zod.processJSONSchema = (t, r, n) => iN(e, t, r, n)
    });

    function lK(e) {
        let t = new tp({
            check: "custom"
        });
        return t._zod.check = e, t
    }

    function lH(e, t) {
        return a8(lV, e ? ? (() => !0), t)
    }

    function lG(e, t = {}) {
        return a7(lV, e, t)
    }

    function lQ(e, t) {
        return a9(e, t)
    }
    let lJ = it,
        lY = ir;

    function lX(e, t = {}) {
        let r = new lV({
            type: "custom",
            check: "custom",
            fn: t => t instanceof e,
            abort: !0,
            ...i5.normalizeParams(t)
        });
        return r._zod.bag.Class = e, r._zod.check = t => {
            t.value instanceof e || t.issues.push({
                code: "invalid_type",
                expected: e.name,
                input: t.value,
                inst: r,
                path: [...r._zod.def.path ? ? []]
            })
        }, r
    }
    let l0 = (...e) => ia({
        Codec: lN,
        Boolean: sb,
        String: o_
    }, ...e);

    function l1(e) {
        let t = lz(() => sG([oC(e), sd(), sv(), sO(), sB(t), s3(oC(), t)]));
        return t
    }

    function l2(e, t) {
        return new lD({
            type: "pipe",
            in: lu(e),
            out: t
        })
    }
    var l6 = e.i(553884);
    e.s([], 902139), e.i(902139), e.s(["endsWith", 0, aI, "gt", 0, ac, "gte", 0, au, "includes", 0, aS, "length", 0, aw, "lowercase", 0, aC, "lt", 0, as, "lte", 0, al, "maxLength", 0, av, "maxSize", 0, ay, "mime", 0, ak, "minLength", 0, ax, "minSize", 0, ag, "multipleOf", 0, am, "negative", 0, af, "nonnegative", 0, ah, "nonpositive", 0, ap, "normalize", 0, aR, "overwrite", 0, aO, "positive", 0, ad, "property", 0, aT, "regex", 0, a_, "size", 0, ab, "slugify", 0, aD, "startsWith", 0, aA, "toLowerCase", 0, aM, "toUpperCase", 0, aP, "trim", 0, aN, "uppercase", 0, aE], 986773);
    var l5 = e.i(986773);
    e.i(584746), e.i(263749);
    let l3 = {
        invalid_type: "invalid_type",
        too_big: "too_big",
        too_small: "too_small",
        invalid_format: "invalid_format",
        not_multiple_of: "not_multiple_of",
        unrecognized_keys: "unrecognized_keys",
        invalid_union: "invalid_union",
        invalid_key: "invalid_key",
        invalid_element: "invalid_element",
        invalid_value: "invalid_value",
        custom: "custom"
    };

    function l4(e) {
        u({
            customError: e
        })
    }

    function l8() {
        return u().customError
    }
    nu || (nu = {}), e.s(["ZodFirstPartyTypeKind", 0, nu, "ZodIssueCode", 0, l3, "getErrorMap", 0, l8, "setErrorMap", 0, l4], 338686), e.i(338686), e.s(["$brand", 0, o, "ZodFirstPartyTypeKind", 0, nu, "ZodIssueCode", 0, l3, "config", 0, u, "getErrorMap", 0, l8, "setErrorMap", 0, l4], 765895), e.i(765895);
    var i6 = nf,
        i5 = nd,
        l7 = e.i(339084);
    let l9 = { ...l6,
            ...l5,
            iso: l7
        },
        ce = new Set(["$schema", "$ref", "$defs", "definitions", "$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor", "type", "enum", "const", "anyOf", "oneOf", "allOf", "not", "properties", "required", "additionalProperties", "patternProperties", "propertyNames", "minProperties", "maxProperties", "items", "prefixItems", "additionalItems", "minItems", "maxItems", "uniqueItems", "contains", "minContains", "maxContains", "minLength", "maxLength", "pattern", "format", "minimum", "maximum", "exclusiveMinimum", "exclusiveMaximum", "multipleOf", "description", "default", "contentEncoding", "contentMediaType", "contentSchema", "unevaluatedItems", "unevaluatedProperties", "if", "then", "else", "dependentSchemas", "dependentRequired", "nullable", "readOnly"]);
    e.s(["bigint", 0, function(e) {
        return n5(sx, e)
    }, "boolean", 0, function(e) {
        return n2(sb, e)
    }, "date", 0, function(e) {
        return ai(sU, e)
    }, "number", 0, function(e) {
        return nG(su, e)
    }, "string", 0, function(e) {
        return nv(o_, e)
    }], 815373);
    var ct = e.i(815373);
    e.s(["$brand", 0, o, "$input", 0, nh, "$output", 0, np, "NEVER", 0, a, "TimePrecision", 0, nq, "ZodAny", 0, sR, "ZodArray", 0, sz, "ZodBase64", 0, o8, "ZodBase64URL", 0, o9, "ZodBigInt", 0, sx, "ZodBigIntFormat", 0, s_, "ZodBoolean", 0, sb, "ZodCIDRv4", 0, o6, "ZodCIDRv6", 0, o3, "ZodCUID", 0, oz, "ZodCUID2", 0, oq, "ZodCatch", 0, lA, "ZodCodec", 0, lN, "ZodCustom", 0, lV, "ZodCustomStringFormat", 0, si, "ZodDate", 0, sU, "ZodDefault", 0, lb, "ZodDiscriminatedUnion", 0, sY, "ZodE164", 0, st, "ZodEmail", 0, oS, "ZodEmoji", 0, oL, "ZodEnum", 0, lr, "ZodError", 0, oa, "ZodExactOptional", 0, lp, "ZodFile", 0, ls, "ZodFirstPartyTypeKind", 0, nu, "ZodFunction", 0, lW, "ZodGUID", 0, oI, "ZodIPv4", 0, oJ, "ZodIPv6", 0, o1, "ZodISODate", 0, i8, "ZodISODateTime", 0, i3, "ZodISODuration", 0, ot, "ZodISOTime", 0, i9, "ZodIntersection", 0, s0, "ZodIssueCode", 0, l3, "ZodJWT", 0, sn, "ZodKSUID", 0, oG, "ZodLazy", 0, l$, "ZodLiteral", 0, li, "ZodMAC", 0, oX, "ZodMap", 0, s7, "ZodNaN", 0, lT, "ZodNanoID", 0, oU, "ZodNever", 0, sD, "ZodNonOptional", 0, l_, "ZodNull", 0, sk, "ZodNullable", 0, lm, "ZodNumber", 0, su, "ZodNumberFormat", 0, sf, "ZodObject", 0, sW, "ZodOptional", 0, ld, "ZodPipe", 0, lO, "ZodPrefault", 0, lx, "ZodPreprocess", 0, lD, "ZodPromise", 0, lB, "ZodReadonly", 0, lj, "ZodRealError", 0, oi, "ZodRecord", 0, s5, "ZodSet", 0, le, "ZodString", 0, o_, "ZodStringFormat", 0, oE, "ZodSuccess", 0, lE, "ZodSymbol", 0, sS, "ZodTemplateLiteral", 0, lF, "ZodTransform", 0, lc, "ZodTuple", 0, s2, "ZodType", 0, ox, "ZodULID", 0, oZ, "ZodURL", 0, oP, "ZodUUID", 0, ok, "ZodUndefined", 0, sI, "ZodUnion", 0, sH, "ZodUnknown", 0, sM, "ZodVoid", 0, sL, "ZodXID", 0, oK, "ZodXor", 0, sQ, "_ZodString", 0, ow, "_default", 0, lv, "_function", 0, lZ, "any", 0, sN, "array", 0, sB, "base64", 0, o7, "base64url", 0, se, "bigint", 0, sw, "boolean", 0, sv, "catch", 0, lI, "check", 0, lK, "cidrv4", 0, o5, "cidrv6", 0, o4, "clone", 0, N, "codec", 0, lM, "coerce", 0, ct, "config", 0, u, "core", 0, i2, "cuid", 0, oB, "cuid2", 0, oW, "custom", 0, lH, "date", 0, s$, "decode", 0, od, "decodeAsync", 0, op, "describe", 0, lJ, "discriminatedUnion", 0, sX, "e164", 0, sr, "email", 0, oA, "emoji", 0, oF, "encode", 0, ou, "encodeAsync", 0, of , "endsWith", 0, aI, "enum", 0, ln, "exactOptional", 0, lh, "file", 0, ll, "flattenError", 0, Y, "float32", 0, sh, "float64", 0, sm, "formatError", 0, X, "fromJSONSchema", 0, function(e, t) {
        var r, n;
        let a, i;
        if ("boolean" == typeof e) return e ? l9.any() : l9.never();
        try {
            a = JSON.parse(JSON.stringify(e))
        } catch {
            throw Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")
        }
        let o = {
            version: (r = a, n = t ? .defaultTarget, "https://json-schema.org/draft/2020-12/schema" === (i = r.$schema) ? "draft-2020-12" : "http://json-schema.org/draft-07/schema#" === i ? "draft-7" : "http://json-schema.org/draft-04/schema#" === i ? "draft-4" : n ? ? "draft-2020-12"),
            defs: a.$defs || a.definitions || {},
            refs: new Map,
            processing: new Set,
            rootSchema: a,
            registry: t ? .registry ? ? ng
        };
        return function e(t, r) {
            if ("boolean" == typeof t) return t ? l9.any() : l9.never();
            let n = function t(r, n) {
                    let a;
                    if (void 0 !== r.not) {
                        if ("object" == typeof r.not && 0 === Object.keys(r.not).length) return l9.never();
                        throw Error("not is not supported in Zod (except { not: {} } for never)")
                    }
                    if (void 0 !== r.unevaluatedItems) throw Error("unevaluatedItems is not supported");
                    if (void 0 !== r.unevaluatedProperties) throw Error("unevaluatedProperties is not supported");
                    if (void 0 !== r.if || void 0 !== r.then || void 0 !== r.else) throw Error("Conditional schemas (if/then/else) are not supported");
                    if (void 0 !== r.dependentSchemas || void 0 !== r.dependentRequired) throw Error("dependentSchemas and dependentRequired are not supported");
                    if (r.$ref) {
                        let t = r.$ref;
                        if (n.refs.has(t)) return n.refs.get(t);
                        if (n.processing.has(t)) return l9.lazy(() => {
                            if (!n.refs.has(t)) throw Error(`Circular reference not resolved: ${t}`);
                            return n.refs.get(t)
                        });
                        n.processing.add(t);
                        let a = e(function(e, t) {
                            if (!e.startsWith("#")) throw Error("External $ref is not supported, only local refs (#/...) are allowed");
                            let r = e.slice(1).split("/").filter(Boolean);
                            if (0 === r.length) return t.rootSchema;
                            let n = "draft-2020-12" === t.version ? "$defs" : "definitions";
                            if (r[0] === n) {
                                let n = r[1];
                                if (!n || !t.defs[n]) throw Error(`Reference not found: ${e}`);
                                return t.defs[n]
                            }
                            throw Error(`Reference not found: ${e}`)
                        }(t, n), n);
                        return n.refs.set(t, a), n.processing.delete(t), a
                    }
                    if (void 0 !== r.enum) {
                        let e = r.enum;
                        if ("openapi-3.0" === n.version && !0 === r.nullable && 1 === e.length && null === e[0]) return l9.null();
                        if (0 === e.length) return l9.never();
                        if (1 === e.length) return l9.literal(e[0]);
                        if (e.every(e => "string" == typeof e)) return l9.enum(e);
                        let t = e.map(e => l9.literal(e));
                        return t.length < 2 ? t[0] : l9.union([t[0], t[1], ...t.slice(2)])
                    }
                    if (void 0 !== r.const) return l9.literal(r.const);
                    let i = r.type;
                    if (Array.isArray(i)) {
                        let e = i.map(e => t({ ...r,
                            type: e
                        }, n));
                        return 0 === e.length ? l9.never() : 1 === e.length ? e[0] : l9.union(e)
                    }
                    if (!i) return l9.any();
                    switch (i) {
                        case "string":
                            {
                                let e = l9.string();
                                if (r.format) {
                                    let t = r.format;
                                    "email" === t ? e = e.check(l9.email()) : "uri" === t || "uri-reference" === t ? e = e.check(l9.url()) : "uuid" === t || "guid" === t ? e = e.check(l9.uuid()) : "date-time" === t ? e = e.check(l9.iso.datetime()) : "date" === t ? e = e.check(l9.iso.date()) : "time" === t ? e = e.check(l9.iso.time()) : "duration" === t ? e = e.check(l9.iso.duration()) : "ipv4" === t ? e = e.check(l9.ipv4()) : "ipv6" === t ? e = e.check(l9.ipv6()) : "mac" === t ? e = e.check(l9.mac()) : "cidr" === t ? e = e.check(l9.cidrv4()) : "cidr-v6" === t ? e = e.check(l9.cidrv6()) : "base64" === t ? e = e.check(l9.base64()) : "base64url" === t ? e = e.check(l9.base64url()) : "e164" === t ? e = e.check(l9.e164()) : "jwt" === t ? e = e.check(l9.jwt()) : "emoji" === t ? e = e.check(l9.emoji()) : "nanoid" === t ? e = e.check(l9.nanoid()) : "cuid" === t ? e = e.check(l9.cuid()) : "cuid2" === t ? e = e.check(l9.cuid2()) : "ulid" === t ? e = e.check(l9.ulid()) : "xid" === t ? e = e.check(l9.xid()) : "ksuid" === t && (e = e.check(l9.ksuid()))
                                }
                                "number" == typeof r.minLength && (e = e.min(r.minLength)),
                                "number" == typeof r.maxLength && (e = e.max(r.maxLength)),
                                r.pattern && (e = e.regex(new RegExp(r.pattern))),
                                a = e;
                                break
                            }
                        case "number":
                        case "integer":
                            {
                                let e = "integer" === i ? l9.number().int() : l9.number();
                                "number" == typeof r.minimum && (e = e.min(r.minimum)),
                                "number" == typeof r.maximum && (e = e.max(r.maximum)),
                                "number" == typeof r.exclusiveMinimum ? e = e.gt(r.exclusiveMinimum) : !0 === r.exclusiveMinimum && "number" == typeof r.minimum && (e = e.gt(r.minimum)),
                                "number" == typeof r.exclusiveMaximum ? e = e.lt(r.exclusiveMaximum) : !0 === r.exclusiveMaximum && "number" == typeof r.maximum && (e = e.lt(r.maximum)),
                                "number" == typeof r.multipleOf && (e = e.multipleOf(r.multipleOf)),
                                a = e;
                                break
                            }
                        case "boolean":
                            a = l9.boolean();
                            break;
                        case "null":
                            a = l9.null();
                            break;
                        case "object":
                            {
                                let t = {},
                                    i = r.properties || {},
                                    o = new Set(r.required || []);
                                for (let [r, a] of Object.entries(i)) {
                                    let i = e(a, n);
                                    t[r] = o.has(r) ? i : i.optional()
                                }
                                if (r.propertyNames) {
                                    let i = e(r.propertyNames, n),
                                        o = r.additionalProperties && "object" == typeof r.additionalProperties ? e(r.additionalProperties, n) : l9.any();
                                    if (0 === Object.keys(t).length) {
                                        a = l9.record(i, o);
                                        break
                                    }
                                    let s = l9.object(t).passthrough(),
                                        l = l9.looseRecord(i, o);
                                    a = l9.intersection(s, l);
                                    break
                                }
                                if (r.patternProperties) {
                                    let i = r.patternProperties,
                                        o = Object.keys(i),
                                        s = [];
                                    for (let t of o) {
                                        let r = e(i[t], n),
                                            a = l9.string().regex(new RegExp(t));
                                        s.push(l9.looseRecord(a, r))
                                    }
                                    let l = [];
                                    if (Object.keys(t).length > 0 && l.push(l9.object(t).passthrough()), l.push(...s), 0 === l.length) a = l9.object({}).passthrough();
                                    else if (1 === l.length) a = l[0];
                                    else {
                                        let e = l9.intersection(l[0], l[1]);
                                        for (let t = 2; t < l.length; t++) e = l9.intersection(e, l[t]);
                                        a = e
                                    }
                                    break
                                }
                                let s = l9.object(t);a = !1 === r.additionalProperties ? s.strict() : "object" == typeof r.additionalProperties ? s.catchall(e(r.additionalProperties, n)) : s.passthrough();
                                break
                            }
                        case "array":
                            {
                                let t = r.prefixItems,
                                    i = r.items;
                                if (t && Array.isArray(t)) {
                                    let o = t.map(t => e(t, n)),
                                        s = i && "object" == typeof i && !Array.isArray(i) ? e(i, n) : void 0;
                                    a = s ? l9.tuple(o).rest(s) : l9.tuple(o), "number" == typeof r.minItems && (a = a.check(l9.minLength(r.minItems))), "number" == typeof r.maxItems && (a = a.check(l9.maxLength(r.maxItems)))
                                } else if (Array.isArray(i)) {
                                    let t = i.map(t => e(t, n)),
                                        o = r.additionalItems && "object" == typeof r.additionalItems ? e(r.additionalItems, n) : void 0;
                                    a = o ? l9.tuple(t).rest(o) : l9.tuple(t), "number" == typeof r.minItems && (a = a.check(l9.minLength(r.minItems))), "number" == typeof r.maxItems && (a = a.check(l9.maxLength(r.maxItems)))
                                } else if (void 0 !== i) {
                                    let t = e(i, n),
                                        o = l9.array(t);
                                    "number" == typeof r.minItems && (o = o.min(r.minItems)), "number" == typeof r.maxItems && (o = o.max(r.maxItems)), a = o
                                } else a = l9.array(l9.any());
                                break
                            }
                        default:
                            throw Error(`Unsupported type: ${i}`)
                    }
                    return a
                }(t, r),
                a = t.type || void 0 !== t.enum || void 0 !== t.const;
            if (t.anyOf && Array.isArray(t.anyOf)) {
                let i = t.anyOf.map(t => e(t, r)),
                    o = l9.union(i);
                n = a ? l9.intersection(n, o) : o
            }
            if (t.oneOf && Array.isArray(t.oneOf)) {
                let i = t.oneOf.map(t => e(t, r)),
                    o = l9.xor(i);
                n = a ? l9.intersection(n, o) : o
            }
            if (t.allOf && Array.isArray(t.allOf))
                if (0 === t.allOf.length) n = a ? n : l9.any();
                else {
                    let i = a ? n : e(t.allOf[0], r),
                        o = +!a;
                    for (let n = o; n < t.allOf.length; n++) i = l9.intersection(i, e(t.allOf[n], r));
                    n = i
                }!0 === t.nullable && "openapi-3.0" === r.version && (n = l9.nullable(n)), !0 === t.readOnly && (n = l9.readonly(n)), void 0 !== t.default && (n = n.default(t.default));
            let i = {};
            for (let e of ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"]) e in t && (i[e] = t[e]);
            for (let e of ["contentEncoding", "contentMediaType", "contentSchema"]) e in t && (i[e] = t[e]);
            for (let e of Object.keys(t)) ce.has(e) || (i[e] = t[e]);
            return Object.keys(i).length > 0 && r.registry.add(n, i), t.description && (n = n.describe(t.description)), n
        }(a, o)
    }, "function", 0, lZ, "getErrorMap", 0, l8, "globalRegistry", 0, ng, "gt", 0, ac, "gte", 0, au, "guid", 0, oT, "hash", 0, sc, "hex", 0, sl, "hostname", 0, ss, "httpUrl", 0, oj, "includes", 0, aS, "instanceof", 0, lX, "int", 0, sp, "int32", 0, sy, "int64", 0, sC, "intersection", 0, s1, "invertCodec", 0, lP, "ipv4", 0, oY, "ipv6", 0, o2, "iso", 0, l7, "json", 0, l1, "jwt", 0, sa, "keyof", 0, sq, "ksuid", 0, oQ, "lazy", 0, lz, "length", 0, aw, "literal", 0, lo, "looseObject", 0, sK, "looseRecord", 0, s8, "lowercase", 0, aC, "lt", 0, as, "lte", 0, al, "mac", 0, o0, "map", 0, s9, "maxLength", 0, av, "maxSize", 0, ay, "meta", 0, lY, "mime", 0, ak, "minLength", 0, ax, "minSize", 0, ag, "multipleOf", 0, am, "nan", 0, lk, "nanoid", 0, o$, "nativeEnum", 0, la, "negative", 0, af, "never", 0, sj, "nonnegative", 0, ah, "nonoptional", 0, lC, "nonpositive", 0, ap, "normalize", 0, aR, "null", 0, sO, "nullable", 0, ly, "nullish", 0, lg, "number", 0, sd, "object", 0, sZ, "optional", 0, lf, "overwrite", 0, aO, "parse", 0, oo, "parseAsync", 0, os, "partialRecord", 0, s4, "pipe", 0, lR, "positive", 0, ad, "prefault", 0, lw, "preprocess", 0, l2, "prettifyError", 0, er, "promise", 0, lq, "property", 0, aT, "readonly", 0, lL, "record", 0, s3, "refine", 0, lG, "regex", 0, a_, "regexes", () => i6, "registry", 0, ny, "safeDecode", 0, om, "safeDecodeAsync", 0, og, "safeEncode", 0, oh, "safeEncodeAsync", 0, oy, "safeParse", 0, ol, "safeParseAsync", 0, oc, "set", 0, lt, "setErrorMap", 0, l4, "size", 0, ab, "slugify", 0, aD, "startsWith", 0, aA, "strictObject", 0, sV, "string", 0, oC, "stringFormat", 0, so, "stringbool", 0, l0, "success", 0, lS, "superRefine", 0, lQ, "symbol", 0, sA, "templateLiteral", 0, lU, "toJSONSchema", 0, i0, "toLowerCase", 0, aM, "toUpperCase", 0, aP, "transform", 0, lu, "treeifyError", 0, ee, "trim", 0, aN, "tuple", 0, s6, "uint32", 0, sg, "uint64", 0, sE, "ulid", 0, oV, "undefined", 0, sT, "union", 0, sG, "unknown", 0, sP, "uppercase", 0, aE, "url", 0, oD, "util", () => i5, "uuid", 0, oO, "uuidv4", 0, oR, "uuidv6", 0, oN, "uuidv7", 0, oM, "void", 0, sF, "xid", 0, oH, "xor", 0, sJ], 227768);
    var cr = e.i(227768);
    e.s(["z", 0, cr], 573337);
    var cr = cr;
    let cn = "pm__oauth_",
        ca = cr.enum(["google", "steam", "telegram"]);
    e.s(["MagicOauthTypesEnum", 0, ca, "OAUTH_EMAIL_PREFIX", 0, cn], 693116);
    let ci = "pm__perps_early_access",
        co = "pm__perps_early_access_auth_intent",
        cs = "pm__perps_early_access_result",
        cl = "pm:perps-early-access",
        cc = new Map;

    function cu(e) {
        return e ? .trim().toLowerCase() || void 0
    }

    function cd(e, t) {
        if (!e) return t;
        try {
            return JSON.parse(e)
        } catch {
            return t
        }
    }

    function cf() {
        let e = cd(window.localStorage.getItem(ci), {});
        return {
            emails: Array.isArray(e.emails) ? e.emails : [],
            userIds: Array.isArray(e.userIds) ? e.userIds : [],
            waitlistNumber: "number" == typeof e.waitlistNumber ? e.waitlistNumber : void 0
        }
    }

    function cp(e, t = cf()) {
        let r = cu(e.userId),
            n = cu(e.email);
        return !!(r && t.userIds.includes(r) || n && t.emails.includes(n))
    }

    function ch(e) {
        window.sessionStorage.setItem(cs, JSON.stringify(e)), window.dispatchEvent(new Event(cl))
    }
    async function cm(e) {
        if (!e.email) throw Error("A valid email is required");
        let t = await fetch("/api/perps-subscribe", {
                method: "POST",
                headers: {
                    "Content-Type": "application/json"
                },
                body: JSON.stringify(e)
            }),
            r = await t.json().catch(() => null);
        if (!t.ok) throw Error(r ? .error ? ? "Failed to sign up for early access");
        if ("number" != typeof r ? .waitlistNumber) throw Error("Something went wrong. Please try again.");
        return { ...e,
            waitlistNumber: r.waitlistNumber
        }
    }

    function cy(e) {
        let t, r, n, a;
        t = cf(), r = cu(e.userId), n = cu(e.email), a = {
            userIds: r ? Array.from(new Set([...t.userIds, r])) : t.userIds,
            emails: n ? Array.from(new Set([...t.emails, n])) : t.emails,
            waitlistNumber: "number" == typeof e.waitlistNumber ? e.waitlistNumber : t.waitlistNumber
        }, window.localStorage.setItem(ci, JSON.stringify(a)), ch({
            status: "success",
            email: e.email,
            userId: e.userId,
            waitlistNumber: e.waitlistNumber
        })
    }

    function cg(e, t = {}) {
        ch({
            status: "error",
            error: e,
            email: t.email,
            userId: t.userId
        })
    }
    async function cb(e) {
        let t;
        if (t = "true" === window.sessionStorage.getItem(co), window.sessionStorage.removeItem(co), !t) return !1;
        let r = {
            email: e.email,
            userId: e.userId
        };
        if (cp(r)) return cy(r), !0;
        try {
            let t = await cm(e);
            return cy(t), !0
        } catch (e) {
            return cg(e instanceof Error ? e.message : "Failed to sign up for early access", r), !1
        }
    }
    e.s(["clearPerpsEarlyAccessResult", 0, function() {
        ch({
            status: "idle"
        })
    }, "getPerpsEarlyAccessSnapshot", 0, function(e) {
        let t, r, n, a, i = cd(window.sessionStorage.getItem(cs), {
                status: "idle"
            }),
            o = cf(),
            s = cp(e, o),
            l = "success" === i.status || s,
            c = "error" === i.status && (t = cu(i.userId), r = cu(i.email), n = cu(e.userId), a = cu(e.email), t && n && t === n || r && a && r === a) ? i.error : "",
            u = "success" === i.status ? i.waitlistNumber ? ? (s ? o.waitlistNumber : void 0) : s ? o.waitlistNumber : void 0,
            d = `${l}:${c}:${u??""}`,
            f = cc.get(d);
        if (f) return f;
        let p = {
            error: c,
            isSignedUp: l,
            waitlistNumber: u
        };
        return cc.set(d, p), p
    }, "handlePerpsEarlyAccessAuthSuccess", 0, cb, "normalizePerpsEmail", 0, function(e) {
        if (e) return e.startsWith(cn) ? e.slice(cn.length) : e
    }, "persistPerpsEarlyAccessSignup", 0, cy, "reportPerpsEarlyAccessError", 0, cg, "subscribePerpsEarlyAccessStore", 0, function(e) {
        let t = () => e();
        return window.addEventListener(cl, t), window.addEventListener("storage", t), () => {
            window.removeEventListener(cl, t), window.removeEventListener("storage", t)
        }
    }, "subscribeToPerpsEarlyAccess", 0, cm], 923095)
}, 306396, 469010, e => {
    "use strict";
    var t = e.i(416340);
    let r = !1;
    async function n(e, t = {}) {
        let a;
        if (r) return [];
        r = !0, e.setState(e => ({ ...e,
            status: e.current ? "reconnecting" : "connecting"
        }));
        let i = [];
        if (t.connectors ? .length)
            for (let r of t.connectors) {
                let t;
                t = "function" == typeof r ? e._internal.connectors.setup(r) : r, i.push(t)
            } else i.push(...e.connectors);
        try {
            a = await e.storage ? .getItem("recentConnectorId")
        } catch {}
        let o = {};
        for (let [, t] of e.state.connections) o[t.connector.id] = 1;
        a && (o[a] = 0);
        let s = Object.keys(o).length > 0 ? [...i].sort((e, t) => (o[e.id] ? ? 10) - (o[t.id] ? ? 10)) : i,
            l = !1,
            c = [],
            u = [];
        for (let t of s) {
            let r = await t.getProvider().catch(() => void 0);
            if (!r || u.some(e => e === r) || !await t.isAuthorized()) continue;
            let n = await t.connect({
                isReconnecting: !0
            }).catch(() => null);
            n && (t.emitter.off("connect", e._internal.events.connect), t.emitter.on("change", e._internal.events.change), t.emitter.on("disconnect", e._internal.events.disconnect), e.setState(e => {
                let r = new Map(l ? e.connections : new Map).set(t.uid, {
                    accounts: n.accounts,
                    chainId: n.chainId,
                    connector: t
                });
                return { ...e,
                    current: l ? e.current : t.uid,
                    connections: r
                }
            }), c.push({
                accounts: n.accounts,
                chainId: n.chainId,
                connector: t
            }), u.push(r), l = !0)
        }
        return ("reconnecting" === e.state.status || "connecting" === e.state.status) && (l ? e.setState(e => ({ ...e,
            status: "connected"
        })) : e.setState(e => ({ ...e,
            connections: new Map,
            current: null,
            status: "disconnected"
        }))), r = !1, c
    }

    function a(e) {
        let {
            children: r,
            config: a,
            initialState: i,
            reconnectOnMount: o = !0
        } = e, {
            onMount: s
        } = function(e, t) {
            let {
                initialState: r,
                reconnectOnMount: a
            } = t;
            return r && !e._internal.store.persist.hasHydrated() && e.setState({ ...r,
                chainId: e.chains.some(e => e.id === r.chainId) ? r.chainId : e.chains[0].id,
                connections: a ? r.connections : new Map,
                status: a ? "reconnecting" : "disconnected"
            }), {
                async onMount() {
                    e._internal.ssr && (await e._internal.store.persist.rehydrate(), e._internal.mipd && e._internal.connectors.setState(t => {
                        let r = new Set;
                        for (let e of t ? ? [])
                            if (e.rdns)
                                for (let t of Array.isArray(e.rdns) ? e.rdns : [e.rdns]) r.add(t);
                        let n = [];
                        for (let t of e._internal.mipd ? .getProviders() ? ? []) {
                            if (r.has(t.info.rdns)) continue;
                            let a = e._internal.connectors.providerDetailToConnector(t),
                                i = e._internal.connectors.setup(a);
                            n.push(i)
                        }
                        return [...t, ...n]
                    })), a ? n(e) : e.storage && e.setState(e => ({ ...e,
                        connections: new Map
                    }))
                }
            }
        }(a, {
            initialState: i,
            reconnectOnMount: o
        });
        a._internal.ssr || s();
        let l = (0, t.useRef)(!0);
        return (0, t.useEffect)(() => {
            if (l.current && a._internal.ssr) return s(), () => {
                l.current = !1
            }
        }, []), r
    }
    e.s(["reconnect", 0, n], 469010);
    let i = (0, t.createContext)(void 0);
    e.s(["WagmiContext", 0, i, "WagmiProvider", 0, function(e) {
        let {
            children: r,
            config: n
        } = e;
        return (0, t.createElement)(a, e, (0, t.createElement)(i.Provider, {
            value: n
        }, r))
    }], 306396)
}, 912504, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(306396),
        n = e.i(915341);
    class a extends n.BaseError {
        constructor() {
            super(...arguments), Object.defineProperty(this, "name", {
                enumerable: !0,
                configurable: !0,
                writable: !0,
                value: "WagmiError"
            })
        }
        get docsBaseUrl() {
            return "https://wagmi.sh/react"
        }
        get version() {
            return "wagmi@3.6.14"
        }
    }
    class i extends a {
        constructor() {
            super("`useConfig` must be used within `WagmiProvider`.", {
                docsPath: "/api/WagmiProvider"
            }), Object.defineProperty(this, "name", {
                enumerable: !0,
                configurable: !0,
                writable: !0,
                value: "WagmiProviderNotFoundError"
            })
        }
    }
    e.s(["useConfig", 0, function(e = {}) {
        let n = e.config ? ? (0, t.useContext)(r.WagmiContext);
        if (!n) throw new i;
        return n
    }], 912504)
}, 715669, e => {
    "use strict";
    e.s(["getConnection", 0, function(e) {
        let t = e.state.current,
            r = e.state.connections.get(t),
            n = r ? .accounts,
            a = n ? .[0],
            i = e.chains.find(e => e.id === r ? .chainId),
            o = e.state.status;
        switch (o) {
            case "connected":
                return {
                    address: a,
                    addresses: n,
                    chain: i,
                    chainId: r ? .chainId,
                    connector: r ? .connector,
                    isConnected: !0,
                    isConnecting: !1,
                    isDisconnected: !1,
                    isReconnecting: !1,
                    status: o
                };
            case "reconnecting":
                return {
                    address: a,
                    addresses: n,
                    chain: i,
                    chainId: r ? .chainId,
                    connector: r ? .connector,
                    isConnected: !!a,
                    isConnecting: !1,
                    isDisconnected: !1,
                    isReconnecting: !0,
                    status: o
                };
            case "connecting":
                return {
                    address: a,
                    addresses: n,
                    chain: i,
                    chainId: r ? .chainId,
                    connector: r ? .connector,
                    isConnected: !1,
                    isConnecting: !0,
                    isDisconnected: !1,
                    isReconnecting: !1,
                    status: o
                };
            case "disconnected":
                return {
                    address: void 0,
                    addresses: void 0,
                    chain: void 0,
                    chainId: void 0,
                    connector: void 0,
                    isConnected: !1,
                    isConnecting: !1,
                    isDisconnected: !0,
                    isReconnecting: !1,
                    status: o
                }
        }
    }])
}, 112130, e => {
    "use strict";
    e.s(["deepEqual", 0, function e(t, r) {
        if (t === r) return !0;
        if (t && r && "object" == typeof t && "object" == typeof r) {
            let n, a;
            if (t.constructor !== r.constructor) return !1;
            if (Array.isArray(t) && Array.isArray(r)) {
                if ((n = t.length) !== r.length) return !1;
                for (a = n; 0 != a--;)
                    if (!e(t[a], r[a])) return !1;
                return !0
            }
            if ("function" == typeof t.valueOf && t.valueOf !== Object.prototype.valueOf) return t.valueOf() === r.valueOf();
            if ("function" == typeof t.toString && t.toString !== Object.prototype.toString) return t.toString() === r.toString();
            let i = Object.keys(t);
            if ((n = i.length) !== Object.keys(r).length) return !1;
            for (a = n; 0 != a--;)
                if (!Object.hasOwn(r, i[a])) return !1;
            for (a = n; 0 != a--;) {
                let n = i[a];
                if (n && !e(t[n], r[n])) return !1
            }
            return !0
        }
        return t != t && r != r
    }])
}, 681727, e => {
    "use strict";
    var t = e.i(112130),
        r = e.i(715669);
    e.s(["watchConnection", 0, function(e, n) {
        let {
            onChange: a
        } = n;
        return e.subscribe(() => (0, r.getConnection)(e), a, {
            equalityFn(e, r) {
                let {
                    connector: n,
                    ...a
                } = e, {
                    connector: i,
                    ...o
                } = r;
                return (0, t.deepEqual)(a, o) && n ? .id === i ? .id && n ? .uid === i ? .uid
            }
        })
    }])
}, 428145, (e, t, r) => {
    "use strict";
    var n = e.r(416340),
        a = "function" == typeof Object.is ? Object.is : function(e, t) {
            return e === t && (0 !== e || 1 / e == 1 / t) || e != e && t != t
        },
        i = n.useState,
        o = n.useEffect,
        s = n.useLayoutEffect,
        l = n.useDebugValue;

    function c(e) {
        var t = e.getSnapshot;
        e = e.value;
        try {
            var r = t();
            return !a(e, r)
        } catch (e) {
            return !0
        }
    }
    var u = "u" < typeof window || void 0 === window.document || void 0 === window.document.createElement ? function(e, t) {
        return t()
    } : function(e, t) {
        var r = t(),
            n = i({
                inst: {
                    value: r,
                    getSnapshot: t
                }
            }),
            a = n[0].inst,
            u = n[1];
        return s(function() {
            a.value = r, a.getSnapshot = t, c(a) && u({
                inst: a
            })
        }, [e, r, t]), o(function() {
            return c(a) && u({
                inst: a
            }), e(function() {
                c(a) && u({
                    inst: a
                })
            })
        }, [e]), l(r), r
    };
    r.useSyncExternalStore = void 0 !== n.useSyncExternalStore ? n.useSyncExternalStore : u
}, 260054, (e, t, r) => {
    "use strict";
    t.exports = e.r(428145)
}, 856830, (e, t, r) => {
    "use strict";
    var n = e.r(416340),
        a = e.r(260054),
        i = "function" == typeof Object.is ? Object.is : function(e, t) {
            return e === t && (0 !== e || 1 / e == 1 / t) || e != e && t != t
        },
        o = a.useSyncExternalStore,
        s = n.useRef,
        l = n.useEffect,
        c = n.useMemo,
        u = n.useDebugValue;
    r.useSyncExternalStoreWithSelector = function(e, t, r, n, a) {
        var d = s(null);
        if (null === d.current) {
            var f = {
                hasValue: !1,
                value: null
            };
            d.current = f
        } else f = d.current;
        var p = o(e, (d = c(function() {
            function e(e) {
                if (!l) {
                    if (l = !0, o = e, e = n(e), void 0 !== a && f.hasValue) {
                        var t = f.value;
                        if (a(t, e)) return s = t
                    }
                    return s = e
                }
                if (t = s, i(o, e)) return t;
                var r = n(e);
                return void 0 !== a && a(t, r) ? (o = e, t) : (o = e, s = r)
            }
            var o, s, l = !1,
                c = void 0 === r ? null : r;
            return [function() {
                return e(t())
            }, null === c ? void 0 : function() {
                return e(c())
            }]
        }, [t, r, n, a]))[0], d[1]);
        return l(function() {
            f.hasValue = !0, f.value = p
        }, [p]), u(p), p
    }
}, 337439, (e, t, r) => {
    "use strict";
    t.exports = e.r(856830)
}, 805949, e => {
    "use strict";
    var t = e.i(715669),
        r = e.i(681727),
        n = e.i(912504),
        a = e.i(112130),
        i = e.i(416340),
        o = e.i(337439);
    let s = e => "object" == typeof e && !Array.isArray(e);
    e.s(["useConnection", 0, function(e = {}) {
        let l = (0, n.useConfig)(e);
        return function(e, t, r = t, n = a.deepEqual) {
            let l = (0, i.useRef)([]),
                c = (0, o.useSyncExternalStoreWithSelector)(e, t, r, e => e, (e, t) => {
                    if (s(e) && s(t) && l.current.length) {
                        for (let r of l.current)
                            if (!n(e[r], t[r])) return !1;
                        return !0
                    }
                    return n(e, t)
                });
            return (0, i.useMemo)(() => {
                if (s(c)) {
                    let e = { ...c
                        },
                        t = {};
                    for (let [r, n] of Object.entries(e)) t = { ...t,
                        [r]: {
                            configurable: !1,
                            enumerable: !0,
                            get: () => (l.current.includes(r) || l.current.push(r), n)
                        }
                    };
                    return Object.defineProperties(e, t), e
                }
                return c
            }, [c])
        }(e => (0, r.watchConnection)(l, {
            onChange: e
        }), () => (0, t.getConnection)(l))
    }], 805949)
}, 945930, 79075, 748852, 618931, e => {
    "use strict";
    var t = e.i(399482);
    let r = null,
        n = null;
    e.s(["consumeLogoutTrigger", 0, function(e = Date.now()) {
        if (!r) return null;
        let t = e - r.at;
        if (t < 0 || t > 15e3) return r = null, null;
        let n = r;
        return r = null, n
    }, "getLastTradeContext", 0, function() {
        return n
    }, "setLastTradeContext", 0, function(e) {
        n = { ...e,
            at: "number" == typeof e.at ? e.at : Date.now()
        }
    }, "setLogoutTrigger", 0, function(e, n = {}) {
        let a = "number" == typeof e.at ? e.at : Date.now();
        if ("if_unset" === (n.mode ? ? "overwrite") && r && a - r.at <= 15e3) return;
        let i = e.extra ? .id ? ? e.extra ? .auth_type;
        if (void 0 === i) try {
            {
                let e = (0, t.createWalletCache)();
                i = e.state.value ? .connectorId
            }
        } catch {
            i = void 0
        }
        let o = void 0 !== i ? { ...e.extra,
            id: i
        } : e.extra;
        r = { ...e,
            at: a,
            proxyAddress: e.proxyAddress ? ? function() {
                try {
                    let e = window.localStorage.getItem("polymarket.auth.proxyWallet");
                    return "string" == typeof e && e.length > 0 ? e : void 0
                } catch {
                    return
                }
            }(),
            extra: o
        }
    }], 945930);
    let a = "polymarket.signupPrompt.v1",
        i = "polymarket.signupPromptAttribution.v1",
        o = {
            qualifiedViewsBySlug: {}
        };

    function s() {
        try {
            if (!window.localStorage) return;
            return window.localStorage
        } catch {
            return
        }
    }

    function l(e) {
        if (e) try {
            return JSON.parse(e)
        } catch {
            return
        }
    }

    function c(e) {
        try {
            return JSON.stringify(e)
        } catch {
            return
        }
    }

    function u(e) {
        var t;
        let r, n = s();
        if (n) try {
            r = n.getItem(a)
        } catch {
            r = void 0
        }
        let i = (t = l(r) ? ? o, {
            qualifiedViewsBySlug: Object.fromEntries(Object.entries(t.qualifiedViewsBySlug && "object" == typeof t.qualifiedViewsBySlug ? t.qualifiedViewsBySlug : {}).filter(([, t]) => Number.isFinite(t) && e - t < 6048e5)),
            lastShownAt: "number" == typeof t.lastShownAt && Number.isFinite(t.lastShownAt) ? t.lastShownAt : void 0
        });
        if (n) {
            let e = c(i);
            if (e) try {
                n.setItem(a, e)
            } catch {}
        }
        return i
    }

    function d(e) {
        let t = s(),
            r = c(e);
        if (t && r) try {
            t.setItem(a, r)
        } catch {}
    }

    function f() {
        let e = s();
        if (e) try {
            e.removeItem(i)
        } catch {}
    }
    e.s(["SIGNUP_PROMPT_MIN_EVENT_VIEW_MS", 0, 1e4, "clearSignupPromptAttribution", 0, f, "getNextLoggedOutVisibleEventCount", 0, function({
        currentVisibleCount: e,
        pageSize: t
    }) {
        return e + t
    }, "getSignupPromptDecision", 0, function({
        authenticated: e,
        modalOpen: t,
        now: r = Date.now()
    }) {
        let n = u(r),
            a = Object.keys(n.qualifiedViewsBySlug).length,
            i = [];
        return e && i.push("authenticated"), t && i.push("modal_open"), n.lastShownAt && r - n.lastShownAt < 864e5 && i.push("cooldown"), a < 3 && i.push("below_threshold"), {
            shouldOpen: 0 === i.length,
            reason: 0 === i.length ? "qualified_event_views" : null,
            qualifiedViewCount: a,
            blockers: i
        }
    }, "getSignupPromptOpenedEventProperties", 0, function({
        source: e,
        route: t
    }) {
        return {
            signupPromptSource: e,
            signupPromptRoute: t
        }
    }, "getSignupPromptTrackingProperties", 0, function(e = Date.now()) {
        let t = function(e = Date.now()) {
            let t, r = s();
            if (r) try {
                t = r.getItem(i)
            } catch {
                t = void 0
            }
            let n = l(t),
                a = n ? .source,
                o = n ? .route,
                c = n ? .openedAt;
            return "comments" !== a && "deposit" !== a && "event_page_visit" !== a && "favorite" !== a && "how_it_works" !== a && "load_more" !== a && "mobile_navbar" !== a && "modal_query" !== a && "navbar" !== a && "portfolio_page" !== a && "profile" !== a && "rewards" !== a && "settings_page" !== a && "trade" !== a || void 0 !== o && "login" !== o && "signup" !== o || "number" != typeof c || !Number.isFinite(c) || e - c > 18e5 ? void f() : {
                source: a,
                route: o ? ? "signup",
                openedAt: c
            }
        }(e);
        return t ? {
            signupPromptSource: t.source,
            signupPromptRoute: t.route
        } : {}
    }, "markSignupPromptOpened", 0, function(e, t = {}) {
        let r = s(),
            n = "number" == typeof t ? t : t.now ? ? Date.now(),
            a = c({
                source: e,
                route: "number" == typeof t ? "signup" : t.route ? ? "signup",
                openedAt: n
            });
        if (r && a) try {
            r.setItem(i, a)
        } catch {}
    }, "markSignupPromptShown", 0, function(e = Date.now()) {
        let t = { ...u(e),
            lastShownAt: e
        };
        return d(t), t
    }, "recordQualifiedEventView", 0, function(e, t = Date.now()) {
        let r = e.trim();
        if (!r) return u(t);
        let n = u(t),
            a = { ...n,
                qualifiedViewsBySlug: { ...n.qualifiedViewsBySlug,
                    [r]: t
                }
            };
        return d(a), a
    }], 79075);
    var p = e.i(284553),
        h = e.i(668122),
        m = e.i(655740),
        y = e.i(660006),
        g = e.i(53950);
    let b = (e, t) => {
        if (t || "function" != typeof e || (t = e, e = void 0), !t || "function" != typeof t) throw Error("Invalid arguments");
        let {
            tries: r,
            startMs: n,
            pow: a,
            maxMs: i,
            jitter: o
        } = {
            tries: 6,
            startMs: 250,
            pow: 3,
            maxMs: 3e5,
            jitter: .25,
            ...e
        };
        return async (...e) => {
            let s = 0;
            for (;;) try {
                return await t(...e)
            } catch (e) {
                if (++s === r) throw e; {
                    let t = Math.min(i, n * s ** a);
                    t -= Math.random() * t * o, console.error(e), await new Promise(e => setTimeout(e, t))
                }
            }
        }
    };
    e.s(["retryWithBackoff", 0, b], 748852);
    let v = "polymarket_mobile_auth_mode",
        x = (p.default.env.NEXT_PUBLIC_MOBILE_AUTH_ENABLED, "polymarket://mobile-auth/"),
        w = b(async e => {
            if (!e) throw Error("Bearer token is required for mobile authentication");
            try {
                return (await m.axios.get("https://gamma-api.polymarket.com/mobile/login", {
                    headers: {
                        Authorization: `Bearer ${e}`,
                        "Content-Type": "application/json",
                        Accept: "application/json"
                    },
                    timeout: 3e4
                })).data
            } catch (e) {
                throw (0, y.handleError)(e, "mobile_auth_api_error", "mobile_auth_user", "high", {
                    endpoint: "/mobile/login"
                }), e
            }
        }),
        _ = (e, t) => {
            try {
                let r;
                e ? (r = `${x}success?token=${encodeURIComponent(e)}`, g.logger.debug("[redirectToiOS] Redirecting to success URL")) : (r = `${x}error?error=${encodeURIComponent(t||"Unknown mobile auth error")}`, g.logger.debug("[redirectToiOS] Redirecting to error URL")), window.location.href = r
            } catch (e) {
                (0, y.handleError)(e, "mobile_auth_callback_error", "mobile_auth_user", "medium", {})
            }
        },
        C = async (e, t, r) => {
            g.logger.debug("[handleMobileAuthFlow] Mobile auth flow initiated");
            try {
                if (!e) throw Error("No token available for mobile authentication");
                let t = await w(e);
                r.trackEvent(h.Events.MobileAuthSuccess, {
                    expiration: t.expiration
                }), localStorage.removeItem(v), g.logger.debug("[handleMobileAuthFlow] Mobile auth completed successfully"), _(t.exchangeToken)
            } catch (n) {
                let e = n instanceof Error ? n.message : String(n);
                r.trackEvent(h.Events.MobileAuthFailed, {
                    error: e,
                    connectorId: t
                }), localStorage.removeItem(v), _(void 0, e)
            }
        };
    e.s(["getMobileAuthMode", 0, () => "true" === localStorage.getItem(v), "handleMobileAuthFlow", 0, C, "setMobileAuthMode", 0, e => {
        e ? localStorage.setItem(v, "true") : localStorage.removeItem(v)
    }], 618931)
}, 344558, e => {
    "use strict";
    let t = new Set(["0xa5ef39c3d3e10d0b270233af41cac69796b12966"]);
    e.s(["EXCLUDED_WALLETS", 0, t, "filterExcludedWallets", 0, e => Array.isArray(e) ? e.filter(e => !t.has(e.proxyWallet)) : []])
}, 778983, e => {
    "use strict";
    var t = e.i(63238),
        r = e.i(344558),
        n = e.i(655740),
        a = e.i(660006),
        i = e.i(631222);
    let o = async e => {
            if (r.EXCLUDED_WALLETS.has(e)) return 0;
            let t = new URLSearchParams({
                user: e
            });
            try {
                let {
                    data: e
                } = await n.axios.get(`${i.DATA_API}/value?${t.toString()}`);
                return e[0].value
            } catch (t) {
                (0, a.handleError)(t, "[positionsValueFetcher]", e);
                return
            }
        },
        s = async (e, t, o = "CURRENT", s = "DESC", l, c, u) => {
            if (r.EXCLUDED_WALLETS.has(e)) return [];
            let d = new URLSearchParams({
                user: e,
                sortBy: o,
                sortDirection: s,
                sizeThreshold: ".1",
                ...void 0 !== c && {
                    redeemable: c
                }
            });
            l && d.set("title", l), t && (d.set("limit", t.limit.toString()), d.set("offset", t.offset.toString())), u && "en" !== u && d.set("locale", u);
            try {
                let {
                    data: e
                } = await n.axios.get(`${i.DATA_API}/positions?${d.toString()}`);
                return Array.isArray(e) ? e : []
            } catch (t) {
                return (0, a.handleError)(t, "profilePositionsFetcher", e), []
            }
        },
        l = async (e, t, o = "realizedpnl", s = "DESC", l, c) => {
            if (r.EXCLUDED_WALLETS.has(e)) return [];
            let u = new URLSearchParams({
                user: e,
                sortBy: o,
                sortDirection: s
            });
            l && u.set("title", l), t && (u.set("limit", t.limit.toString()), u.set("offset", t.offset.toString())), c && "en" !== c && u.set("locale", c);
            try {
                let {
                    data: e
                } = await n.axios.get(`${i.DATA_API}/closed-positions?${u.toString()}`);
                return (Array.isArray(e) ? e : []).map(e => {
                    let t = parseFloat(String(e.totalBought || 0)),
                        r = parseFloat(String(e.avgPrice || 0)),
                        n = parseFloat(String(e.realizedPnl || 0)),
                        a = t * r,
                        i = Math.round(1e6 * (a + n)) / 1e6,
                        o = .01 > Math.abs(i) ? 0 : i,
                        s = a > 0 ? n / a * 100 : 0;
                    return { ...e,
                        currentValue: isFinite(o) ? Math.max(0, o) : 0,
                        cashPnl: isFinite(n) ? n : 0,
                        percentPnl: isFinite(s) ? s : 0,
                        initialValue: isFinite(a) ? a : 0,
                        percentRealizedPnl: isFinite(s) ? s : 0,
                        size: isFinite(t) ? t : 0,
                        negativeRisk: !1,
                        redeemable: !0
                    }
                })
            } catch (t) {
                return (0, a.handleError)(t, "profileClosedPositionsFetcher", e), []
            }
        },
        c = e => {
            let r = e.curPrice,
                n = 1 - r,
                a = Number.isFinite(e.size) ? e.size : 0,
                i = Number.isFinite(e.totalBought) ? e.totalBought : 0,
                o = Number.isFinite(e.avgPrice) ? e.avgPrice : 0,
                s = Number.isFinite(e.realizedPnl) ? e.realizedPnl : 0,
                l = (0, t.parseUnits)(a.toFixed(6), 6),
                c = (0, t.parseUnits)(i.toFixed(6), 6),
                u = (0, t.parseUnits)(o.toFixed(6), 6),
                d = (0, t.parseUnits)(s.toFixed(6), 6),
                f = 10 n ** 6 n;
            return {
                market: {
                    id: e.conditionId,
                    outcomeTokenPrices: [0 === e.outcomeIndex ? r.toString() : n.toString(), 1 === e.outcomeIndex ? r.toString() : n.toString()],
                    conditions: [{
                        payouts: null
                    }],
                    negRisk: e.negativeRisk,
                    closed: e.redeemable
                },
                outcomeIndex: e.outcomeIndex.toString(),
                realizedPnl: e.realizedPnl,
                quantityBought: l.toString(),
                realizedProfit: d.toString(),
                totalQuantityBought: c.toString(),
                totalValueBought: (c * u / f).toString(),
                netQuantity: l.toString(),
                valueBought: (l * u / f).toString(),
                netValue: (l * u / f).toString(),
                isPending: !1
            }
        },
        u = e => {
            let t = e.curPrice,
                r = 1 - t;
            return {
                question: e.title,
                image: e.icon,
                slug: e.slug,
                closed: e.redeemable,
                marketMakerAddress: e.conditionId,
                conditionId: e.conditionId,
                clobTokenIds: [0 === e.outcomeIndex ? e.asset : e.oppositeAsset, 1 === e.outcomeIndex ? e.asset : e.oppositeAsset],
                active: !0,
                outcomes: [0 === e.outcomeIndex ? e.outcome : e.oppositeOutcome, 1 === e.outcomeIndex ? e.outcome : e.oppositeOutcome],
                outcomePrices: [0 === e.outcomeIndex ? t.toString() : r.toString(), 1 === e.outcomeIndex ? t.toString() : r.toString()],
                endDate: e.endDate,
                imageOptimized: e.icon,
                iconOptimized: e.icon,
                events: [{
                    slug: e.eventSlug
                }],
                end_date: e.endDate,
                icon: e.icon,
                negRisk: e.negativeRisk,
                groupItemTitle: null
            }
        };
    e.s(["formatPartialPositionMarket", 0, u, "formatTrackedMarketPosition", 0, c, "fromDbToMarketPosition", 0, e => {
        if (Array.isArray(e)) return e.map(e => c(e))
    }, "fromDbToPositionMarket", 0, e => {
        if (Array.isArray(e)) return e.map(e => u(e))
    }, "positionsValueFetcher", 0, o, "profileClosedPositionsFetcher", 0, l, "profilePositionsFetcher", 0, s])
}, 680529, 83254, 434427, 271191, 541602, 746918, 186921, 435685, 167996, 289241, 688674, 59147, e => {
    "use strict";
    var t = e.i(970413),
        r = e.i(637608),
        n = e.i(318877),
        a = e.i(186897),
        i = e.i(130178),
        o = e.i(743141),
        s = e.i(536760),
        l = e.i(900042),
        c = e.i(249618);
    let u = 32 n * e.i(306243).maxUint16,
        d = {
            block: (0, i.defineBlock)({
                format(e) {
                    let t = e.transactions ? .map(e => {
                        if ("string" == typeof e) return e;
                        let t = d.transaction ? .format(e);
                        return "0x71" === t.typeHex ? t.type = "eip712" : "0xff" === t.typeHex && (t.type = "priority"), t
                    });
                    return {
                        l1BatchNumber: e.l1BatchNumber ? (0, r.hexToBigInt)(e.l1BatchNumber) : null,
                        l1BatchTimestamp: e.l1BatchTimestamp ? (0, r.hexToBigInt)(e.l1BatchTimestamp) : null,
                        transactions: t
                    }
                }
            }),
            transaction: (0, s.defineTransaction)({
                format(e) {
                    let t = {};
                    return "0x71" === e.type ? t.type = "eip712" : "0xff" === e.type && (t.type = "priority"), { ...t,
                        l1BatchNumber: e.l1BatchNumber ? (0, r.hexToBigInt)(e.l1BatchNumber) : null,
                        l1BatchTxIndex: e.l1BatchTxIndex ? (0, r.hexToBigInt)(e.l1BatchTxIndex) : null
                    }
                }
            }),
            transactionReceipt: (0, l.defineTransactionReceipt)({
                format: e => ({
                    l1BatchNumber: e.l1BatchNumber ? (0, r.hexToBigInt)(e.l1BatchNumber) : null,
                    l1BatchTxIndex: e.l1BatchTxIndex ? (0, r.hexToBigInt)(e.l1BatchTxIndex) : null,
                    logs: e.logs.map(e => ({ ...(0, o.formatLog)(e),
                        l1BatchNumber: e.l1BatchNumber ? (0, r.hexToBigInt)(e.l1BatchNumber) : null,
                        transactionLogIndex: (0, r.hexToNumber)(e.transactionLogIndex),
                        logType: e.logType
                    })),
                    l2ToL1Logs: e.l2ToL1Logs.map(e => ({
                        blockNumber: (0, r.hexToBigInt)(e.blockHash),
                        blockHash: e.blockHash,
                        l1BatchNumber: e.l1BatchNumber ? (0, r.hexToBigInt)(e.l1BatchNumber) : null,
                        transactionIndex: (0, r.hexToBigInt)(e.transactionIndex),
                        shardId: (0, r.hexToBigInt)(e.shardId),
                        isService: e.isService,
                        sender: e.sender,
                        key: e.key,
                        value: e.value,
                        transactionHash: e.transactionHash,
                        logIndex: (0, r.hexToBigInt)(e.logIndex)
                    }))
                })
            }),
            transactionRequest: (0, c.defineTransactionRequest)({
                exclude: ["customSignature", "factoryDeps", "gasPerPubdata", "paymaster", "paymasterInput"],
                format: e => e.gasPerPubdata || e.paymaster && e.paymasterInput || e.factoryDeps || e.customSignature ? {
                    eip712Meta: { ...e.gasPerPubdata ? {
                            gasPerPubdata: (0, a.toHex)(e.gasPerPubdata)
                        } : {
                            gasPerPubdata: (0, a.toHex)(50000 n)
                        },
                        ...e.paymaster && e.paymasterInput ? {
                            paymasterParams: {
                                paymaster: e.paymaster,
                                paymasterInput: Array.from((0, n.hexToBytes)(e.paymasterInput))
                            }
                        } : {},
                        ...e.factoryDeps ? {
                            factoryDeps: e.factoryDeps.map(e => Array.from((0, n.hexToBytes)(e)))
                        } : {},
                        ...e.customSignature ? {
                            customSignature: Array.from((0, n.hexToBytes)(e.customSignature))
                        } : {}
                    },
                    type: "0x71"
                } : {}
            })
        };
    var f = e.i(844268),
        p = e.i(632768),
        h = e.i(683469),
        m = e.i(108157),
        y = e.i(621030),
        g = e.i(603641),
        b = e.i(571333),
        v = y;
    class x extends v.BaseError {
        constructor() {
            super('Transaction is not an EIP712 transaction.\n\nTransaction must:\n  - include `type: "eip712"`\n  - include one of the following: `customSignature`, `paymaster`, `paymasterInput`, `gasPerPubdata`, `factoryDeps`', {
                name: "InvalidEip712TransactionError"
            })
        }
    }

    function w(e) {
        return "eip712" === e.type || "customSignature" in e && !!e.customSignature || "paymaster" in e && !!e.paymaster || "paymasterInput" in e && !!e.paymasterInput || "gasPerPubdata" in e && "bigint" == typeof e.gasPerPubdata || "factoryDeps" in e && !!e.factoryDeps || !1
    }

    function _(e) {
        let {
            chainId: t,
            to: r,
            from: n,
            paymaster: a,
            paymasterInput: i
        } = e;
        if (!w(e)) throw new x;
        if (!t || t <= 0) throw new g.InvalidChainIdError({
            chainId: t
        });
        if (r && !(0, b.isAddress)(r)) throw new m.InvalidAddressError({
            address: r
        });
        if (n && !(0, b.isAddress)(n)) throw new m.InvalidAddressError({
            address: n
        });
        if (a && !(0, b.isAddress)(a)) throw new m.InvalidAddressError({
            address: a
        });
        if (a && !i) throw new y.BaseError("`paymasterInput` must be provided when `paymaster` is defined");
        if (!a && i) throw new y.BaseError("`paymaster` must be provided when `paymasterInput` is defined")
    }
    var C = e.i(605381),
        E = e.i(225120),
        S = y;
    class A extends S.BaseError {
        constructor({
            givenLength: e,
            maxBytecodeSize: t
        }) {
            super(`Bytecode cannot be longer than ${t} bytes. Given length: ${e}`, {
                name: "BytecodeLengthExceedsMaxSizeError"
            })
        }
    }
    class I extends S.BaseError {
        constructor({
            givenLengthInWords: e
        }) {
            super(`Bytecode length in 32-byte words must be odd. Given length in words: ${e}`, {
                name: "BytecodeLengthInWordsMustBeOddError"
            })
        }
    }
    class T extends S.BaseError {
        constructor({
            givenLength: e
        }) {
            super(`The bytecode length in bytes must be divisible by 32. Given length: ${e}`, {
                name: "BytecodeLengthMustBeDivisibleBy32Error"
            })
        }
    }
    let k = {
            blockTime: 1e3,
            formatters: d,
            serializers: {
                transaction: function(e, t) {
                    return w(e) ? function(e) {
                        let {
                            chainId: t,
                            gas: r,
                            nonce: n,
                            to: i,
                            from: o,
                            value: s,
                            maxFeePerGas: l,
                            maxPriorityFeePerGas: c,
                            customSignature: u,
                            factoryDeps: d,
                            paymaster: h,
                            paymasterInput: m,
                            gasPerPubdata: y,
                            data: g
                        } = e;
                        _(e);
                        let b = [n ? (0, a.toHex)(n) : "0x", c ? (0, a.toHex)(c) : "0x", l ? (0, a.toHex)(l) : "0x", r ? (0, a.toHex)(r) : "0x", i ? ? "0x", s ? (0, a.toHex)(s) : "0x", g ? ? "0x", (0, a.toHex)(t), (0, a.toHex)(""), (0, a.toHex)(""), (0, a.toHex)(t), o ? ? "0x", y ? (0, a.toHex)(y) : (0, a.toHex)(50000 n), d ? ? [], u ? ? "0x", h && m ? [h, m] : []];
                        return (0, f.concatHex)(["0x71", (0, p.toRlp)(b)])
                    }(e) : (0, h.serializeTransaction)(e, t)
                }
            },
            custom: {
                getEip712Domain: e => {
                    _(e);
                    let t = function(e) {
                        let {
                            gas: t,
                            nonce: r,
                            to: i,
                            from: o,
                            value: s,
                            maxFeePerGas: l,
                            maxPriorityFeePerGas: c,
                            factoryDeps: d,
                            paymaster: f,
                            paymasterInput: p,
                            gasPerPubdata: h,
                            data: m
                        } = e;
                        return {
                            txType: 113 n,
                            from: BigInt(o),
                            to: i ? BigInt(i) : 0 n,
                            gasLimit: t ? ? 0 n,
                            gasPerPubdataByteLimit: h ? ? 50000 n,
                            maxFeePerGas: l ? ? 0 n,
                            maxPriorityFeePerGas: c ? ? 0 n,
                            paymaster: f ? BigInt(f) : 0 n,
                            nonce: r ? BigInt(r) : 0 n,
                            value: s ? ? 0 n,
                            data: m ? ? "0x",
                            factoryDeps: d ? .map(e => (0, a.toHex)(function(e) {
                                let t = (0, n.toBytes)(e);
                                if (t.length % 32 != 0) throw new T({
                                    givenLength: t.length
                                });
                                if (t.length > u) throw new A({
                                    givenLength: t.length,
                                    maxBytecodeSize: u
                                });
                                let r = (0, E.sha256)(t),
                                    a = (0, n.toBytes)(r),
                                    i = t.length / 32;
                                if (i % 2 == 0) throw new I({
                                    givenLengthInWords: i
                                });
                                let o = (0, n.toBytes)(i),
                                    s = (0, C.pad)(o, {
                                        size: 2
                                    }),
                                    l = new Uint8Array([1, 0]);
                                return a.set(l, 0), a.set(s, 2), a
                            }(e))) ? ? [],
                            paymasterInput: p || "0x"
                        }
                    }(e);
                    return {
                        domain: {
                            name: "zkSync",
                            version: "2",
                            chainId: e.chainId
                        },
                        types: {
                            Transaction: [{
                                name: "txType",
                                type: "uint256"
                            }, {
                                name: "from",
                                type: "uint256"
                            }, {
                                name: "to",
                                type: "uint256"
                            }, {
                                name: "gasLimit",
                                type: "uint256"
                            }, {
                                name: "gasPerPubdataByteLimit",
                                type: "uint256"
                            }, {
                                name: "maxFeePerGas",
                                type: "uint256"
                            }, {
                                name: "maxPriorityFeePerGas",
                                type: "uint256"
                            }, {
                                name: "paymaster",
                                type: "uint256"
                            }, {
                                name: "nonce",
                                type: "uint256"
                            }, {
                                name: "value",
                                type: "uint256"
                            }, {
                                name: "data",
                                type: "bytes"
                            }, {
                                name: "factoryDeps",
                                type: "bytes32[]"
                            }, {
                                name: "paymasterInput",
                                type: "bytes"
                            }]
                        },
                        primaryType: "Transaction",
                        message: t
                    }
                }
            }
        },
        O = (0, t.defineChain)({ ...k,
            blockTime: 200,
            id: 2741,
            name: "Abstract",
            nativeCurrency: {
                decimals: 18,
                name: "ETH",
                symbol: "ETH"
            },
            rpcUrls: {
                default: {
                    http: ["https://api.mainnet.abs.xyz"],
                    webSocket: ["wss://api.mainnet.abs.xyz/ws"]
                }
            },
            blockExplorers: {
                default: {
                    name: "Etherscan",
                    url: "https://abscan.org"
                },
                native: {
                    name: "Abstract Explorer",
                    url: "https://explorer.mainnet.abs.xyz"
                }
            },
            contracts: {
                multicall3: {
                    address: "0xAa4De41dba0Ca5dCBb288b7cC6b708F3aaC759E7",
                    blockCreated: 5288
                },
                erc6492Verifier: {
                    address: "0xfB688330379976DA81eB64Fe4BF50d7401763B9C",
                    blockCreated: 5263
                }
            }
        });
    e.s(["abstract", 0, O], 680529);
    let R = (0, t.defineChain)({
        id: 42161,
        name: "Arbitrum One",
        nativeCurrency: {
            name: "Ether",
            symbol: "ETH",
            decimals: 18
        },
        blockTime: 250,
        rpcUrls: {
            default: {
                http: ["https://arb1.arbitrum.io/rpc"]
            }
        },
        blockExplorers: {
            default: {
                name: "Arbiscan",
                url: "https://arbiscan.io",
                apiUrl: "https://api.arbiscan.io/api"
            }
        },
        contracts: {
            multicall3: {
                address: "0xca11bde05977b3631167028862be2a173976ca11",
                blockCreated: 7654707
            }
        }
    });
    e.s(["arbitrum", 0, R], 83254);
    let N = (0, t.defineChain)({
        id: 421614,
        name: "Arbitrum Sepolia",
        blockTime: 250,
        nativeCurrency: {
            name: "Arbitrum Sepolia Ether",
            symbol: "ETH",
            decimals: 18
        },
        rpcUrls: {
            default: {
                http: ["https://sepolia-rollup.arbitrum.io/rpc"]
            }
        },
        blockExplorers: {
            default: {
                name: "Arbiscan",
                url: "https://sepolia.arbiscan.io",
                apiUrl: "https://api-sepolia.arbiscan.io/api"
            }
        },
        contracts: {
            multicall3: {
                address: "0xca11bde05977b3631167028862be2a173976ca11",
                blockCreated: 81930
            }
        },
        testnet: !0
    });
    e.s(["arbitrumSepolia", 0, N], 434427);
    let M = {
            blockTime: 2e3,
            contracts: {
                gasPriceOracle: {
                    address: "0x420000000000000000000000000000000000000F"
                },
                l1Block: {
                    address: "0x4200000000000000000000000000000000000015"
                },
                l2CrossDomainMessenger: {
                    address: "0x4200000000000000000000000000000000000007"
                },
                l2Erc721Bridge: {
                    address: "0x4200000000000000000000000000000000000014"
                },
                l2StandardBridge: {
                    address: "0x4200000000000000000000000000000000000010"
                },
                l2ToL1MessagePasser: {
                    address: "0x4200000000000000000000000000000000000016"
                }
            },
            formatters: {
                block: (0, i.defineBlock)({
                    format: e => ({
                        transactions: e.transactions ? .map(e => {
                            if ("string" == typeof e) return e;
                            let t = (0, s.formatTransaction)(e);
                            return "0x7e" === t.typeHex && (t.isSystemTx = e.isSystemTx, t.mint = e.mint ? (0, r.hexToBigInt)(e.mint) : void 0, t.sourceHash = e.sourceHash, t.type = "deposit"), t
                        }),
                        stateRoot: e.stateRoot
                    })
                }),
                transaction: (0, s.defineTransaction)({
                    format(e) {
                        let t = {};
                        return "0x7e" === e.type && (t.isSystemTx = e.isSystemTx, t.mint = e.mint ? (0, r.hexToBigInt)(e.mint) : void 0, t.sourceHash = e.sourceHash, t.type = "deposit"), t
                    }
                }),
                transactionReceipt: (0, l.defineTransactionReceipt)({
                    format: e => ({
                        l1GasPrice: e.l1GasPrice ? (0, r.hexToBigInt)(e.l1GasPrice) : null,
                        l1GasUsed: e.l1GasUsed ? (0, r.hexToBigInt)(e.l1GasUsed) : null,
                        l1Fee: e.l1Fee ? (0, r.hexToBigInt)(e.l1Fee) : null,
                        l1FeeScalar: e.l1FeeScalar ? Number(e.l1FeeScalar) : null
                    })
                })
            },
            serializers: {
                transaction: function(e, t) {
                    var r;
                    return "deposit" === (r = e).type || void 0 !== r.sourceHash ? function(e) {
                        ! function(e) {
                            let {
                                from: t,
                                to: r
                            } = e;
                            if (t && !(0, b.isAddress)(t)) throw new m.InvalidAddressError({
                                address: t
                            });
                            if (r && !(0, b.isAddress)(r)) throw new m.InvalidAddressError({
                                address: r
                            })
                        }(e);
                        let {
                            sourceHash: t,
                            data: r,
                            from: n,
                            gas: i,
                            isSystemTx: o,
                            mint: s,
                            to: l,
                            value: c
                        } = e, u = [t, n, l ? ? "0x", s ? (0, a.toHex)(s) : "0x", c ? (0, a.toHex)(c) : "0x", i ? (0, a.toHex)(i) : "0x", o ? "0x1" : "0x", r ? ? "0x"];
                        return (0, f.concatHex)(["0x7e", (0, p.toRlp)(u)])
                    }(e) : (0, h.serializeTransaction)(e, t)
                }
            }
        },
        P = (0, t.defineChain)({ ...M,
            id: 8453,
            name: "Base",
            nativeCurrency: {
                name: "Ether",
                symbol: "ETH",
                decimals: 18
            },
            rpcUrls: {
                default: {
                    http: ["https://mainnet.base.org"]
                }
            },
            blockExplorers: {
                default: {
                    name: "Basescan",
                    url: "https://basescan.org",
                    apiUrl: "https://api.basescan.org/api"
                }
            },
            contracts: { ...M.contracts,
                disputeGameFactory: {
                    1: {
                        address: "0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"
                    }
                },
                l2OutputOracle: {
                    1: {
                        address: "0x56315b90c40730925ec5485cf004d835058518A0"
                    }
                },
                multicall3: {
                    address: "0xca11bde05977b3631167028862be2a173976ca11",
                    blockCreated: 5022
                },
                portal: {
                    1: {
                        address: "0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",
                        blockCreated: 0x10ac19f
                    }
                },
                l1StandardBridge: {
                    1: {
                        address: "0x3154Cf16ccdb4C6d922629664174b904d80F2C35",
                        blockCreated: 0x10ac19f
                    }
                }
            },
            sourceId: 1
        });
    e.s(["base", 0, P], 271191);
    let D = (0, t.defineChain)({
        id: 56,
        name: "BNB Smart Chain",
        blockTime: 750,
        nativeCurrency: {
            decimals: 18,
            name: "BNB",
            symbol: "BNB"
        },
        rpcUrls: {
            default: {
                http: ["https://56.rpc.thirdweb.com"]
            }
        },
        blockExplorers: {
            default: {
                name: "BscScan",
                url: "https://bscscan.com",
                apiUrl: "https://api.bscscan.com/api"
            }
        },
        contracts: {
            multicall3: {
                address: "0xca11bde05977b3631167028862be2a173976ca11",
                blockCreated: 0xf2f12c
            }
        }
    });
    e.s(["bsc", 0, D], 541602);
    let j = (0, t.defineChain)({
        id: 5,
        name: "Goerli",
        nativeCurrency: {
            name: "Goerli Ether",
            symbol: "ETH",
            decimals: 18
        },
        rpcUrls: {
            default: {
                http: ["https://5.rpc.thirdweb.com"]
            }
        },
        blockExplorers: {
            default: {
                name: "Etherscan",
                url: "https://goerli.etherscan.io",
                apiUrl: "https://api-goerli.etherscan.io/api"
            }
        },
        contracts: {
            ensRegistry: {
                address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"
            },
            ensUniversalResolver: {
                address: "0xfc4AC75C46C914aF5892d6d3eFFcebD7917293F1",
                blockCreated: 0x9dc386
            },
            multicall3: {
                address: "0xca11bde05977b3631167028862be2a173976ca11",
                blockCreated: 6507670
            }
        },
        testnet: !0
    });
    e.s(["goerli", 0, j], 746918);
    let L = (0, t.defineChain)({
        id: 1,
        name: "Ethereum",
        nativeCurrency: {
            name: "Ether",
            symbol: "ETH",
            decimals: 18
        },
        blockTime: 12e3,
        rpcUrls: {
            default: {
                http: ["https://eth.merkle.io"]
            }
        },
        blockExplorers: {
            default: {
                name: "Etherscan",
                url: "https://etherscan.io",
                apiUrl: "https://api.etherscan.io/api"
            }
        },
        contracts: {
            ensUniversalResolver: {
                address: "0xeeeeeeee14d718c2b47d9923deab1335e144eeee",
                blockCreated: 0x16041f6
            },
            multicall3: {
                address: "0xca11bde05977b3631167028862be2a173976ca11",
                blockCreated: 0xdb04c1
            }
        }
    });
    e.s(["mainnet", 0, L], 186921);
    let F = (0, t.defineChain)({
        id: 5e3,
        name: "Mantle",
        nativeCurrency: {
            decimals: 18,
            name: "MNT",
            symbol: "MNT"
        },
        rpcUrls: {
            default: {
                http: ["https://rpc.mantle.xyz"]
            }
        },
        blockExplorers: {
            default: {
                name: "Mantle Explorer",
                url: "https://mantlescan.xyz/",
                apiUrl: "https://api.mantlescan.xyz/api"
            }
        },
        contracts: {
            multicall3: {
                address: "0xcA11bde05977b3631167028862bE2a173976CA11",
                blockCreated: 304717
            }
        }
    });
    e.s(["mantle", 0, F], 435685);
    let U = (0, t.defineChain)({ ...M,
        id: 10,
        name: "OP Mainnet",
        nativeCurrency: {
            name: "Ether",
            symbol: "ETH",
            decimals: 18
        },
        rpcUrls: {
            default: {
                http: ["https://mainnet.optimism.io"]
            }
        },
        blockExplorers: {
            default: {
                name: "Optimism Explorer",
                url: "https://optimistic.etherscan.io",
                apiUrl: "https://api-optimistic.etherscan.io/api"
            }
        },
        contracts: { ...M.contracts,
            disputeGameFactory: {
                1: {
                    address: "0xe5965Ab5962eDc7477C8520243A95517CD252fA9"
                }
            },
            l2OutputOracle: {
                1: {
                    address: "0xdfe97868233d1aa22e815a266982f2cf17685a27"
                }
            },
            multicall3: {
                address: "0xca11bde05977b3631167028862be2a173976ca11",
                blockCreated: 4286263
            },
            portal: {
                1: {
                    address: "0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"
                }
            },
            l1StandardBridge: {
                1: {
                    address: "0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"
                }
            }
        },
        sourceId: 1
    });
    e.s(["optimism", 0, U], 167996);
    let $ = (0, t.defineChain)({
        id: 137,
        name: "Polygon",
        blockTime: 2e3,
        nativeCurrency: {
            name: "POL",
            symbol: "POL",
            decimals: 18
        },
        rpcUrls: {
            default: {
                http: ["https://polygon.drpc.org"]
            }
        },
        blockExplorers: {
            default: {
                name: "PolygonScan",
                url: "https://polygonscan.com",
                apiUrl: "https://api.etherscan.io/v2/api"
            }
        },
        contracts: {
            multicall3: {
                address: "0xca11bde05977b3631167028862be2a173976ca11",
                blockCreated: 0x18938b0
            }
        }
    });
    e.s(["polygon", 0, $], 289241);
    let z = (0, t.defineChain)({
        id: 534352,
        name: "Scroll",
        blockTime: 3e3,
        nativeCurrency: {
            name: "Ether",
            symbol: "ETH",
            decimals: 18
        },
        rpcUrls: {
            default: {
                http: ["https://rpc.scroll.io"],
                webSocket: ["wss://wss-rpc.scroll.io/ws"]
            }
        },
        blockExplorers: {
            default: {
                name: "Scrollscan",
                url: "https://scrollscan.com",
                apiUrl: "https://api.scrollscan.com/api"
            }
        },
        contracts: {
            multicall3: {
                address: "0xca11bde05977b3631167028862be2a173976ca11",
                blockCreated: 14
            }
        },
        testnet: !1
    });
    e.s(["scroll", 0, z], 688674);
    let B = (0, t.defineChain)({ ...k,
        blockTime: 200,
        id: 324,
        name: "ZKsync Era",
        network: "zksync-era",
        nativeCurrency: {
            decimals: 18,
            name: "Ether",
            symbol: "ETH"
        },
        rpcUrls: {
            default: {
                http: ["https://mainnet.era.zksync.io"],
                webSocket: ["wss://mainnet.era.zksync.io/ws"]
            }
        },
        blockExplorers: {
            default: {
                name: "ZKsync Explorer",
                url: "https://explorer.zksync.io/",
                apiUrl: "https://block-explorer-api.mainnet.zksync.io/api"
            }
        },
        contracts: {
            multicall3: {
                address: "0xF9cda624FBC7e059355ce98a31693d299FACd963",
                blockCreated: 3908235
            },
            erc6492Verifier: {
                address: "0xfB688330379976DA81eB64Fe4BF50d7401763B9C",
                blockCreated: 0x2b8b4fc
            }
        }
    });
    e.s(["zksync", 0, B], 59147)
}, 493164, 510700, 829128, 498561, 200036, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(882860),
        n = e.i(964974),
        a = e.i(318594),
        i = e.i(866674),
        o = e.i(284553),
        s = e.i(680529),
        l = e.i(83254),
        c = e.i(434427),
        u = e.i(271191),
        d = e.i(541602),
        f = e.i(746918),
        p = e.i(186921),
        h = e.i(435685),
        m = e.i(167996),
        y = e.i(289241),
        g = e.i(688674),
        b = e.i(59147),
        v = {
            iconBackground: "#96bedc",
            iconUrl: "https://sdk-cdn.fun.xyz/images/arbitrum.svg"
        },
        x = {
            iconBackground: "#e84141",
            iconUrl: "https://sdk-cdn.fun.xyz/images/avalanche.svg"
        },
        w = {
            iconBackground: "#0052ff",
            iconUrl: "https://sdk-cdn.fun.xyz/images/base.svg"
        },
        _ = {
            iconBackground: "#000000",
            iconUrl: "https://sdk-cdn.fun.xyz/images/blast.svg"
        },
        C = {
            iconBackground: "#ebac0e",
            iconUrl: "https://sdk-cdn.fun.xyz/images/bsc.svg"
        },
        E = {
            iconBackground: "#002D74",
            iconUrl: "https://sdk-cdn.fun.xyz/images/cronos.svg"
        },
        S = {
            iconBackground: "#484c50",
            iconUrl: "https://sdk-cdn.fun.xyz/images/ethereum.svg"
        },
        A = {
            iconBackground: "transparent",
            iconUrl: "https://sdk-cdn.fun.xyz/images/klaytn.svg"
        },
        I = {
            iconBackground: "#ff5a57",
            iconUrl: "https://sdk-cdn.fun.xyz/images/optimism.svg"
        },
        T = {
            iconBackground: "#ffffff",
            iconUrl: "https://sdk-cdn.fun.xyz/images/manta.svg"
        },
        k = {
            iconBackground: "#000000",
            iconUrl: "https://sdk-cdn.fun.xyz/images/mantle.svg"
        },
        O = {
            iconBackground: "#9f71ec",
            iconUrl: "https://sdk-cdn.fun.xyz/images/polygon.svg"
        },
        R = {
            iconBackground: "#f9f7ec",
            iconUrl: "https://sdk-cdn.fun.xyz/images/xdc.svg"
        },
        N = {
            iconBackground: "#000000",
            iconUrl: "https://sdk-cdn.fun.xyz/images/zetachain.svg"
        },
        M = {
            iconBackground: "#f9f7ec",
            iconUrl: "https://sdk-cdn.fun.xyz/images/zkSync.svg"
        },
        P = {
            iconBackground: "#000000",
            iconUrl: "https://sdk-cdn.fun.xyz/images/zora.svg"
        };
    Object.fromEntries(Object.values({
        abstract: {
            chainId: 2741,
            name: "Abstract",
            iconBackground: "#96bedc",
            iconUrl: "https://sdk-cdn.fun.xyz/images/abstract.svg"
        },
        arbitrum: {
            chainId: 42161,
            name: "Arbitrum",
            ...v
        },
        arbitrumGoerli: {
            chainId: 421613,
            name: "Arbitrum Goerli",
            ...v
        },
        arbitrumSepolia: {
            chainId: 421614,
            name: "Arbitrum Sepolia",
            ...v
        },
        avalanche: {
            chainId: 43114,
            name: "Avalanche",
            ...x
        },
        avalancheFuji: {
            chainId: 43113,
            name: "Avalanche Fuji",
            ...x
        },
        base: {
            chainId: 8453,
            name: "Base",
            ...w
        },
        baseGoerli: {
            chainId: 84531,
            name: "Base Goerli",
            ...w
        },
        baseSepolia: {
            chainId: 84532,
            name: "Base Sepolia",
            ...w
        },
        blast: {
            chainId: 81457,
            name: "Blast",
            ..._
        },
        blastSepolia: {
            chainId: 0xa0c71fd,
            name: "Blast Sepolia",
            ..._
        },
        bsc: {
            chainId: 56,
            name: "BSC",
            ...C
        },
        bscTestnet: {
            chainId: 97,
            name: "BSC Testnet",
            ...C
        },
        cronos: {
            chainId: 25,
            name: "Cronos",
            ...E
        },
        cronosTestnet: {
            chainId: 338,
            name: "Cronos Testnet",
            ...E
        },
        ethereal: {
            chainId: 5064014,
            name: "Ethereal",
            iconBackground: "#000000",
            iconUrl: "https://sdk-cdn.fun.xyz/images/ethereal.svg"
        },
        goerli: {
            chainId: 5,
            name: "Goerli",
            ...S
        },
        hardhat: {
            chainId: 31337,
            name: "Hardhat",
            iconBackground: "#f9f7ec",
            iconUrl: "https://sdk-cdn.fun.xyz/images/hardhat.svg"
        },
        holesky: {
            chainId: 17e3,
            name: "Holesky",
            ...S
        },
        hyperEvm: {
            chainId: 999,
            name: "HyperEVM",
            iconBackground: "#000000",
            iconUrl: "https://sdk-cdn.fun.xyz/images/hyperevm.svg"
        },
        kovan: {
            chainId: 42,
            name: "Kovan",
            ...S
        },
        klaytn: {
            chainId: 8217,
            name: "Klaytn",
            ...A
        },
        klaytnBaobab: {
            chainId: 1001,
            name: "Klaytn Baobab",
            ...A
        },
        lighter: {
            chainId: 3586256,
            name: "Lighter",
            iconBackground: "#000000",
            iconUrl: "https://sdk-cdn.fun.xyz/images/lighter.svg"
        },
        mainnet: {
            chainId: 1,
            name: "Ethereum",
            ...S
        },
        manta: {
            chainId: 169,
            name: "Manta",
            ...T
        },
        mantaSepolia: {
            chainId: 3441006,
            name: "Manta Sepolia",
            ...T
        },
        mantaTestnet: {
            chainId: 3441005,
            name: "Manta Testnet",
            ...T
        },
        mantle: {
            chainId: 5e3,
            name: "Mantle",
            ...k
        },
        mantleTestnet: {
            chainId: 5001,
            name: "Mantle Testnet",
            ...k
        },
        monad: {
            chainId: 143,
            name: "Monad",
            iconBackground: "#ffffff",
            iconUrl: "https://sdk-cdn.fun.xyz/images/monad.svg"
        },
        optimism: {
            chainId: 10,
            name: "Optimism",
            ...I
        },
        optimismGoerli: {
            chainId: 420,
            name: "Optimism Goerli",
            ...I
        },
        optimismKovan: {
            chainId: 69,
            name: "Optimism Kovan",
            ...I
        },
        optimismSepolia: {
            chainId: 0xaa37dc,
            name: "Optimism Sepolia",
            ...I
        },
        polygon: {
            chainId: 137,
            name: "Polygon",
            ...O
        },
        polygonMumbai: {
            chainId: 80001,
            name: "Polygon Mumbai",
            ...O
        },
        rinkeby: {
            chainId: 4,
            name: "Rinkeby",
            ...S
        },
        ropsten: {
            chainId: 3,
            name: "Ropsten",
            ...S
        },
        ronin: {
            chainId: 2020,
            name: "Ronin",
            iconBackground: "#1273EA",
            iconUrl: "https://sdk-cdn.fun.xyz/images/ronin.svg"
        },
        scroll: {
            chainId: 534352,
            name: "Scroll",
            iconBackground: "#000000",
            iconUrl: "https://sdk-cdn.fun.xyz/images/scroll.svg"
        },
        sepolia: {
            chainId: 0xaa36a7,
            name: "Sepolia",
            ...S
        },
        solanaMainnet: {
            chainId: 0x416edef1601be,
            name: "Solana",
            iconBackground: "#2C2C3D",
            iconUrl: "https://sdk-cdn.fun.xyz/images/solana.svg"
        },
        tron: {
            chainId: Number(0x2b6653dc),
            name: "Tron",
            ...{
                iconBackground: "#FF080B",
                iconUrl: "https://sdk-cdn.fun.xyz/images/tron.svg"
            }
        },
        hyperCore: {
            chainId: 1337,
            name: "HyperCore",
            iconBackground: "#000000",
            iconUrl: "https://sdk-cdn.fun.xyz/images/hyperevm.svg"
        },
        bitcoin: {
            chainId: 8253038,
            name: "Bitcoin",
            iconBackground: "#000000",
            iconUrl: "https://sdk-cdn.fun.xyz/images/bitcoin.svg"
        },
        xdc: {
            chainId: 50,
            name: "XinFin",
            ...R
        },
        xdcTestnet: {
            chainId: 51,
            name: "XinFin Testnet",
            ...R
        },
        zetachain: {
            chainId: 7e3,
            name: "ZetaChain",
            ...N
        },
        zetachainAthensTestnet: {
            chainId: 7001,
            name: "Zeta Athens",
            ...N
        },
        zkSync: {
            chainId: 324,
            name: "zkSync",
            ...M
        },
        zkSyncTestnet: {
            chainId: 280,
            name: "zkSync Testnet",
            ...M
        },
        zora: {
            chainId: 7777777,
            name: "Zora",
            ...P
        },
        zoraSepolia: {
            chainId: 0x3b9ac9ff,
            name: "Zora Sepolia",
            ...P
        }
    }).filter(function(e) {
        return null != e
    }).map(({
        chainId: e,
        ...t
    }) => [e, t]));
    var D = {
            id: 999,
            name: "HyperEVM",
            nativeCurrency: {
                name: "HYPE",
                symbol: "HYPE",
                decimals: 18
            },
            rpcUrls: {
                default: {
                    http: ["https://rpc.hyperliquid.xyz/evm", "https://rpc.hypurrscan.io", "https://hyperliquid-json-rpc.stakely.io", "https://hyperliquid.drpc.org", "https://rpc.hyperlend.finance"],
                    wss: ["wss://hyperliquid.drpc.org"]
                }
            },
            blockExplorers: {
                default: {
                    name: "HyperEVMScan",
                    url: "https://hyperevmscan.io",
                    apiUrl: ""
                }
            },
            contracts: {
                ensRegistry: {
                    address: "0x"
                },
                ensUniversalResolver: {
                    address: "0x",
                    blockCreated: -1
                },
                multicall3: {
                    address: "0xcA11bde05977b3631167028862bE2a173976CA11",
                    blockCreated: -1
                }
            }
        },
        j = {
            id: 5064014,
            name: "Ethereal",
            nativeCurrency: {
                name: "USDe",
                symbol: "USDe",
                decimals: 18
            },
            rpcUrls: {
                default: {
                    http: ["https://rpc.ethereal.trade"]
                }
            },
            blockExplorers: {
                default: {
                    name: "Ethereal Explorer",
                    url: "https://explorer.ethereal.trade"
                }
            },
            contracts: {
                ensRegistry: {
                    address: "0x"
                },
                ensUniversalResolver: {
                    address: "0x",
                    blockCreated: -1
                },
                multicall3: {
                    address: "0xcA11bde05977b3631167028862bE2a173976CA11",
                    blockCreated: 36197
                }
            }
        },
        L = {
            id: 3586256,
            name: "Lighter",
            nativeCurrency: {
                name: "USDC",
                symbol: "USDC",
                decimals: 6
            },
            rpcUrls: {
                default: {
                    http: ["https://mainnet.zklighter.elliot.ai"]
                }
            },
            blockExplorers: {
                default: {
                    name: "Lighter Explorer",
                    url: "https://app.lighter.xyz/explorer",
                    path: {
                        tx: "logs",
                        address: "accounts",
                        block: "blocks",
                        transfer: ""
                    }
                }
            },
            contracts: {
                ensRegistry: {
                    address: "0x"
                },
                ensUniversalResolver: {
                    address: "0x",
                    blockCreated: -1
                },
                multicall3: {
                    address: "0x",
                    blockCreated: -1
                }
            }
        },
        F = {
            id: 143,
            name: "Monad",
            nativeCurrency: {
                name: "MON",
                symbol: "MON",
                decimals: 18
            },
            rpcUrls: {
                default: {
                    http: ["https://rpc.monad.xyz", "https://rpc1.monad.xyz", "https://rpc2.monad.xyz", "https://rpc3.monad.xyz"]
                }
            },
            blockExplorers: {
                default: {
                    name: "Monad Explorer",
                    url: "https://monadscan.com"
                }
            },
            contracts: {
                ensRegistry: {
                    address: "0x"
                },
                ensUniversalResolver: {
                    address: "0x",
                    blockCreated: -1
                },
                multicall3: {
                    address: "0xcA11bde05977b3631167028862bE2a173976CA11",
                    blockCreated: -1
                }
            }
        },
        U = {
            id: 0x416edef1601be,
            name: "Solana",
            nativeCurrency: {
                symbol: "SOL",
                decimals: 9,
                name: "Solana"
            },
            rpcUrls: {
                default: {
                    http: ["https://api.mainnet-beta.solana.com"]
                }
            },
            blockExplorers: {
                default: {
                    name: "Orb",
                    url: "https://orbmarkets.io",
                    apiUrl: ""
                }
            },
            contracts: {
                ensRegistry: {
                    address: "0x"
                },
                ensUniversalResolver: {
                    address: "0x",
                    blockCreated: -1
                },
                multicall3: {
                    address: "0x",
                    blockCreated: -1
                }
            }
        },
        $ = {
            id: 1337,
            name: "Hyperliquid",
            nativeCurrency: {
                symbol: "USDC",
                decimals: 8,
                name: "USDC"
            },
            rpcUrls: {
                default: {
                    http: ["https://rpc.hyperliquid.xyz"]
                }
            },
            blockExplorers: {
                default: {
                    name: "HypurrScan",
                    url: "https://hypurrscan.io"
                }
            },
            contracts: {
                ensRegistry: {
                    address: "0x"
                },
                ensUniversalResolver: {
                    address: "0x",
                    blockCreated: -1
                },
                multicall3: {
                    address: "0x",
                    blockCreated: -1
                }
            }
        },
        z = {
            id: Number(8253038),
            name: "Bitcoin",
            nativeCurrency: {
                symbol: "BTC",
                decimals: 8,
                name: "Bitcoin"
            },
            rpcUrls: {
                default: {
                    http: ["https://blockstream.info/api"]
                }
            },
            blockExplorers: {
                default: {
                    name: "Mempool",
                    url: "https://mempool.space"
                }
            },
            contracts: {}
        },
        B = {
            id: Number(0x2b6653dc),
            name: "Tron",
            nativeCurrency: {
                symbol: "TRX",
                decimals: 6,
                name: "Tron"
            },
            rpcUrls: {
                default: {
                    http: ["https://api.trongrid.io/jsonrpc"]
                }
            },
            blockExplorers: {
                default: {
                    name: "TronScan",
                    url: "https://tronscan.org/#",
                    path: {
                        tx: "transaction",
                        transfer: "/transfers"
                    }
                }
            },
            contracts: {}
        };
    p.mainnet.id, u.base.id, y.polygon.id, l.arbitrum.id, m.optimism.id, d.bsc.id, b.zksync.id, h.mantle.id, U.id, g.scroll.id, D.id, $.id, s.abstract.id, z.id, j.id, F.id, L.id, B.id, f.goerli.id, c.arbitrumSepolia.id;
    var q = {
            [p.mainnet.id]: {
                name: p.mainnet.name,
                nativeCurrency: {
                    symbol: p.mainnet.nativeCurrency.symbol,
                    decimals: p.mainnet.nativeCurrency.decimals,
                    name: p.mainnet.nativeCurrency.name
                },
                chainInfo: p.mainnet,
                explorerInfo: p.mainnet.blockExplorers.default,
                isCheckoutSupported: !0,
                isFunWalletSupported: !0,
                isMainnet: !0,
                pickPriority: 4,
                fallbackRpcUrls: ["https://eth.llamarpc.com", "https://eth.drpc.org", "https://1rpc.io/eth", "https://mainnet.gateway.tenderly.co", "https://ethereum-rpc.publicnode.com", "https://eth.merkle.io"]
            },
            [u.base.id]: {
                name: u.base.name,
                nativeCurrency: {
                    symbol: u.base.nativeCurrency.symbol,
                    decimals: u.base.nativeCurrency.decimals,
                    name: u.base.nativeCurrency.name
                },
                chainInfo: u.base,
                explorerInfo: u.base.blockExplorers.default,
                isCheckoutSupported: !0,
                isFunWalletSupported: !0,
                isMainnet: !0,
                pickPriority: 2,
                fallbackRpcUrls: ["https://base.llamarpc.com", "https://1rpc.io/base", "https://base.gateway.tenderly.co", "https://base-rpc.publicnode.com", "https://base.meowrpc.com"]
            },
            [y.polygon.id]: {
                name: y.polygon.name,
                nativeCurrency: {
                    symbol: y.polygon.nativeCurrency.symbol,
                    decimals: y.polygon.nativeCurrency.decimals,
                    name: y.polygon.nativeCurrency.name
                },
                coreToken: {
                    symbol: "MATIC",
                    decimals: 18,
                    name: "MATIC"
                },
                chainInfo: y.polygon,
                explorerInfo: y.polygon.blockExplorers.default,
                isCheckoutSupported: !0,
                isFunWalletSupported: !0,
                isMainnet: !0,
                pickPriority: 1,
                fallbackRpcUrls: ["https://polygon.drpc.org", "https://1rpc.io/matic", "https://polygon.gateway.tenderly.co", "https://polygon-bor-rpc.publicnode.com", "https://api.zan.top/polygon-mainnet"]
            },
            [l.arbitrum.id]: {
                name: "Arbitrum",
                nativeCurrency: {
                    symbol: l.arbitrum.nativeCurrency.symbol,
                    decimals: l.arbitrum.nativeCurrency.decimals,
                    name: l.arbitrum.nativeCurrency.name
                },
                coreToken: {
                    symbol: "ARB",
                    decimals: 18,
                    name: "Arbitrium"
                },
                chainInfo: l.arbitrum,
                explorerInfo: l.arbitrum.blockExplorers.default,
                isCheckoutSupported: !0,
                isFunWalletSupported: !0,
                isMainnet: !0,
                pickPriority: 3,
                fallbackRpcUrls: ["https://arbitrum.drpc.org", "https://arbitrum.gateway.tenderly.co", "https://1rpc.io/arb", "https://arbitrum-one-rpc.publicnode.com", "https://arbitrum.meowrpc.com"]
            },
            [m.optimism.id]: {
                name: m.optimism.name,
                nativeCurrency: {
                    symbol: m.optimism.nativeCurrency.symbol,
                    decimals: m.optimism.nativeCurrency.decimals,
                    name: m.optimism.nativeCurrency.name
                },
                coreToken: {
                    symbol: "OP",
                    decimals: 18,
                    name: "Optimism"
                },
                chainInfo: m.optimism,
                explorerInfo: m.optimism.blockExplorers.default,
                isCheckoutSupported: !0,
                isFunWalletSupported: !0,
                isMainnet: !0,
                pickPriority: Number.MAX_SAFE_INTEGER,
                fallbackRpcUrls: ["https://0xrpc.io/op", "https://optimism.drpc.org", "https://optimism.gateway.tenderly.co", "https://1rpc.io/op", "https://optimism-rpc.publicnode.com"]
            },
            [d.bsc.id]: {
                name: d.bsc.name,
                nativeCurrency: {
                    symbol: d.bsc.nativeCurrency.symbol,
                    decimals: d.bsc.nativeCurrency.decimals,
                    name: d.bsc.nativeCurrency.name
                },
                chainInfo: d.bsc,
                explorerInfo: d.bsc.blockExplorers.default,
                isCheckoutSupported: !0,
                isFunWalletSupported: !1,
                isMainnet: !0,
                pickPriority: Number.MAX_SAFE_INTEGER,
                fallbackRpcUrls: ["https://binance.llamarpc.com", "https://1rpc.io/bnb", "https://bsc.drpc.org", "https://bsc-rpc.publicnode.com", "https://bsc.blockrazor.xyz", "https://bsc.meowrpc.com"]
            },
            [b.zksync.id]: {
                name: "zkSync",
                nativeCurrency: {
                    symbol: b.zksync.nativeCurrency.symbol,
                    decimals: b.zksync.nativeCurrency.decimals,
                    name: b.zksync.nativeCurrency.name
                },
                coreToken: {
                    symbol: "ZK",
                    decimals: 18,
                    name: "zkSync"
                },
                chainInfo: b.zksync,
                explorerInfo: b.zksync.blockExplorers.default,
                isCheckoutSupported: !1,
                isFunWalletSupported: !1,
                isMainnet: !0,
                pickPriority: 5,
                fallbackRpcUrls: ["https://1rpc.io/zksync2-era", "https://zksync.meowrpc.com"]
            },
            [h.mantle.id]: {
                name: h.mantle.name,
                nativeCurrency: {
                    symbol: h.mantle.nativeCurrency.symbol,
                    decimals: h.mantle.nativeCurrency.decimals,
                    name: h.mantle.nativeCurrency.name
                },
                coreToken: {
                    symbol: "MNT",
                    decimals: 18,
                    name: "Mantle"
                },
                chainInfo: h.mantle,
                explorerInfo: h.mantle.blockExplorers.default,
                isCheckoutSupported: !1,
                isFunWalletSupported: !0,
                isMainnet: !0,
                pickPriority: 6,
                fallbackRpcUrls: ["https://mantle.drpc.org", "https://mantle-rpc.publicnode.com"]
            },
            [U.id]: {
                name: U.name,
                nativeCurrency: {
                    symbol: U.nativeCurrency.symbol,
                    decimals: U.nativeCurrency.decimals,
                    name: U.nativeCurrency.name
                },
                chainInfo: U,
                explorerInfo: U.blockExplorers.default,
                isCheckoutSupported: !1,
                isFunWalletSupported: !1,
                isMainnet: !0,
                pickPriority: Number.MAX_SAFE_INTEGER,
                fallbackRpcUrls: []
            },
            [g.scroll.id]: {
                name: g.scroll.name,
                nativeCurrency: {
                    symbol: g.scroll.nativeCurrency.symbol,
                    decimals: g.scroll.nativeCurrency.decimals,
                    name: g.scroll.nativeCurrency.name
                },
                chainInfo: g.scroll,
                explorerInfo: g.scroll.blockExplorers.default,
                isCheckoutSupported: !1,
                isFunWalletSupported: !0,
                isMainnet: !0,
                pickPriority: 7,
                fallbackRpcUrls: ["https://scroll-rpc.publicnode.com", "https://scroll-mainnet.public.blastapi.io"]
            },
            [s.abstract.id]: {
                name: s.abstract.name,
                nativeCurrency: {
                    symbol: s.abstract.nativeCurrency.symbol,
                    decimals: s.abstract.nativeCurrency.decimals,
                    name: s.abstract.nativeCurrency.name
                },
                chainInfo: s.abstract,
                explorerInfo: s.abstract.blockExplorers.default,
                isCheckoutSupported: !0,
                isFunWalletSupported: !1,
                isMainnet: !0,
                pickPriority: Number.MAX_SAFE_INTEGER,
                fallbackRpcUrls: []
            },
            [D.id]: {
                name: D.name,
                nativeCurrency: {
                    symbol: D.nativeCurrency.symbol,
                    decimals: D.nativeCurrency.decimals,
                    name: D.nativeCurrency.name
                },
                chainInfo: D,
                explorerInfo: D.blockExplorers.default,
                isCheckoutSupported: !0,
                isFunWalletSupported: !1,
                isMainnet: !0,
                pickPriority: Number.MAX_SAFE_INTEGER,
                fallbackRpcUrls: ["https://hyperliquid.drpc.org", "https://rpc.hypurrscan.io", "https://hyperliquid-json-rpc.stakely.io", "https://hyperliquid.rpc.blxrbdn.com"]
            },
            [j.id]: {
                name: j.name,
                nativeCurrency: {
                    symbol: j.nativeCurrency.symbol,
                    decimals: j.nativeCurrency.decimals,
                    name: j.nativeCurrency.name
                },
                chainInfo: j,
                explorerInfo: j.blockExplorers.default,
                isCheckoutSupported: !0,
                isFunWalletSupported: !1,
                isMainnet: !0,
                pickPriority: Number.MAX_SAFE_INTEGER,
                fallbackRpcUrls: []
            },
            [F.id]: {
                name: F.name,
                nativeCurrency: {
                    symbol: F.nativeCurrency.symbol,
                    decimals: F.nativeCurrency.decimals,
                    name: F.nativeCurrency.name
                },
                chainInfo: F,
                explorerInfo: F.blockExplorers.default,
                isCheckoutSupported: !0,
                isFunWalletSupported: !1,
                isMainnet: !0,
                pickPriority: Number.MAX_SAFE_INTEGER,
                fallbackRpcUrls: []
            },
            [$.id]: {
                name: $.name,
                nativeCurrency: {
                    symbol: $.nativeCurrency.symbol,
                    decimals: $.nativeCurrency.decimals,
                    name: $.nativeCurrency.name
                },
                chainInfo: $,
                explorerInfo: $.blockExplorers.default,
                isCheckoutSupported: !1,
                isFunWalletSupported: !1,
                isMainnet: !0,
                pickPriority: Number.MAX_SAFE_INTEGER,
                fallbackRpcUrls: ["https://rpc.hypurrscan.io"]
            },
            [L.id]: {
                name: L.name,
                nativeCurrency: {
                    symbol: L.nativeCurrency.symbol,
                    decimals: L.nativeCurrency.decimals,
                    name: L.nativeCurrency.name
                },
                chainInfo: L,
                explorerInfo: L.blockExplorers.default,
                isCheckoutSupported: !1,
                isFunWalletSupported: !1,
                isMainnet: !0,
                pickPriority: Number.MAX_SAFE_INTEGER,
                fallbackRpcUrls: []
            },
            [z.id]: {
                name: z.name,
                nativeCurrency: {
                    symbol: z.nativeCurrency.symbol,
                    decimals: z.nativeCurrency.decimals,
                    name: z.nativeCurrency.name
                },
                chainInfo: z,
                explorerInfo: z.blockExplorers.default,
                isCheckoutSupported: !1,
                isFunWalletSupported: !1,
                isMainnet: !0,
                pickPriority: Number.MAX_SAFE_INTEGER,
                fallbackRpcUrls: []
            },
            [B.id]: {
                name: B.name,
                nativeCurrency: {
                    symbol: B.nativeCurrency.symbol,
                    decimals: B.nativeCurrency.decimals,
                    name: B.nativeCurrency.name
                },
                chainInfo: B,
                explorerInfo: B.blockExplorers.default,
                isCheckoutSupported: !1,
                isFunWalletSupported: !1,
                isMainnet: !0,
                pickPriority: Number.MAX_SAFE_INTEGER,
                fallbackRpcUrls: []
            },
            [f.goerli.id]: {
                name: f.goerli.name,
                nativeCurrency: {
                    symbol: f.goerli.nativeCurrency.symbol,
                    decimals: f.goerli.nativeCurrency.decimals,
                    name: f.goerli.nativeCurrency.name
                },
                chainInfo: f.goerli,
                explorerInfo: f.goerli.blockExplorers.default,
                isCheckoutSupported: !0,
                isFunWalletSupported: !0,
                isMainnet: !1,
                pickPriority: Number.MAX_SAFE_INTEGER,
                fallbackRpcUrls: []
            },
            [c.arbitrumSepolia.id]: {
                name: c.arbitrumSepolia.name,
                nativeCurrency: {
                    symbol: c.arbitrumSepolia.nativeCurrency.symbol,
                    decimals: c.arbitrumSepolia.nativeCurrency.decimals,
                    name: c.arbitrumSepolia.nativeCurrency.name
                },
                chainInfo: c.arbitrumSepolia,
                explorerInfo: {
                    name: "Arbiscan",
                    url: "https://sepolia.arbiscan.io"
                },
                isCheckoutSupported: !0,
                isFunWalletSupported: !0,
                isMainnet: !1,
                pickPriority: Number.MAX_SAFE_INTEGER,
                fallbackRpcUrls: []
            }
        },
        W = Object.values(q).flatMap(e => e ? [e.chainInfo] : []).filter(e => {
            let t = e.id;
            return !!(t && q[t] ? .isCheckoutSupported && q[t] ? .isMainnet)
        });
    let Z = (0, e.i(970413).defineChain)({
            id: 80001,
            name: "Polygon Mumbai",
            nativeCurrency: {
                name: "MATIC",
                symbol: "MATIC",
                decimals: 18
            },
            rpcUrls: {
                default: {
                    http: ["https://80001.rpc.thirdweb.com"]
                }
            },
            blockExplorers: {
                default: {
                    name: "PolygonScan",
                    url: "https://mumbai.polygonscan.com",
                    apiUrl: "https://api-testnet.polygonscan.com/api"
                }
            },
            contracts: {
                multicall3: {
                    address: "0xca11bde05977b3631167028862be2a173976ca11",
                    blockCreated: 0x18938b0
                }
            },
            testnet: !0
        }),
        V = {
            1: {
                id: 1,
                name: "Ethereum",
                rpcUrls: {
                    alchemy: {
                        http: ["https://eth-mainnet.g.alchemy.com/v2"],
                        webSocket: ["wss://eth-mainnet.g.alchemy.com/v2"],
                        key: o.default.env.NEXT_PUBLIC_ALCHEMY_DEV_KEY_MAINNET || "Fx-tyEc-ohdAgG2CJU0IciP-xuoyTgFS"
                    },
                    infura: {
                        http: [],
                        webSocket: [],
                        key: ""
                    }
                }
            },
            137: {
                id: 137,
                name: "Polygon",
                rpcUrls: {
                    alchemy: {
                        http: ["https://polygon-mainnet.g.alchemy.com/v2"],
                        webSocket: ["wss://polygon-mainnet.g.alchemy.com/v2/"],
                        key: o.default.env.NEXT_PUBLIC_ALCHEMY_DEV_KEY_POLYGON || "mewmTuTYExTSI0lZisD2szwmi35fZY-r"
                    },
                    infura: {
                        http: [],
                        webSocket: [],
                        key: ""
                    }
                }
            },
            80001: {
                id: 80001,
                name: "Polygon Mumbai",
                rpcUrls: {
                    alchemy: {
                        http: ["https://polygon-mumbai.g.alchemy.com/v2/"],
                        webSocket: ["wss://polygon-mumbai.g.alchemy.com/v2/"],
                        key: o.default.env.NEXT_PUBLIC_ALCHEMY_DEV_KEY_MUMBAI || "qFjwevjHdU3YpIIpo9AwsZkffmVRq70N"
                    },
                    infura: {
                        http: [],
                        webSocket: [],
                        key: ""
                    }
                }
            }
        };
    e.s(["chainConfigs", 0, V, "getChains", 0, ({
        chainId: e
    }) => 80001 === e ? [Z] : [y.polygon, p.mainnet, ...W]], 510700);
    var K = e.i(765464),
        H = e.i(205780),
        G = e.i(70156);
    let Q = ({
        chainId: e,
        provider: t = "alchemy",
        apiKey: r
    }) => {
        let n = V[e];
        return "alchemy" === t ? {
            key: n.rpcUrls.alchemy.key,
            baseHttp: `${n.rpcUrls.alchemy.http[0]}/`,
            http: `${n.rpcUrls.alchemy.http[0]}/${r}`,
            websocket: `${n.rpcUrls.alchemy.webSocket[0]}/${r}`
        } : {
            baseHttp: "",
            http: "",
            websocket: "",
            key: r
        }
    };
    e.s(["createRpc", 0, Q], 829128);
    let J = ({
        chainId: e,
        provider: t = "alchemy",
        apiKey: r,
        authentication: n = "default",
        type: a = "http"
    }) => {
        if (!V[e]) return (0, H.http)();
        let i = r;
        if (i || "alchemy" !== t || (i = V[e].rpcUrls.alchemy.key), i && "alchemy" === t) {
            let r = Q({
                chainId: e,
                provider: t,
                apiKey: i
            });
            if ("websocket" === a) return (0, G.webSocket)(r.websocket);
            if ("http" === a) {
                let e = "default" === n ? r.http : r.baseHttp;
                return (0, H.http)(e, {
                    batch: {
                        batchSize: 1e3,
                        wait: 1e3
                    },
                    ..."bearer" === n && {
                        fetchOptions: {
                            headers: {
                                Authorization: `Bearer ${r.key}`
                            }
                        }
                    }
                })
            }
        }
        return (0, H.http)()
    };
    e.s(["createTransport", 0, J, "createTransports", 0, ({
        chains: e
    }) => e.reduce((e, t) => {
        var r;
        let n = (r = [J({
            chainId: t.id,
            provider: "alchemy",
            authentication: "bearer"
        }), (0, H.http)()], (0, K.fallback)(r, void 0));
        return e ? (e[t.id] = n, e) : {
            [t.id]: n
        }
    }, {})], 498561);
    var Y = e.i(26128),
        X = e.i(631222);
    let ee = [p.mainnet, y.polygon, Z],
        et = ({
            chainId: e = X.MATIC_CONFIG.chainId
        } = {}) => {
            let t = ee.find(t => t.id === e) ? ? y.polygon;
            return (0, Y.createPublicClient)({
                chain: t,
                transport: J({
                    chainId: t.id,
                    provider: "alchemy",
                    apiKey: V[t.id].rpcUrls.alchemy.key,
                    authentication: "bearer",
                    type: "http"
                })
            })
        };
    e.s(["createChainAwarePublicClient", 0, et], 200036);
    var er = e.i(510954),
        en = e.i(57096);
    let ea = async (e, t, n) => {
        let a = et(),
            o = await a.readContract({
                address: t,
                abi: i.erc20Abi,
                functionName: "balanceOf",
                args: [e]
            });
        return {
            current: parseFloat(parseFloat((0, r.formatUnits)(o || 0 n, n)).toFixed(6)),
            pending: 0
        }
    };
    e.s(["default", 0, (e, r, i, o, s) => {
        let l, c, u, d, f, p, h, m, y, g, b = (0, t.c)(31),
            v = (0, a.useQueryClient)(),
            x = i ? ? X.MATIC_CONFIG.chainId,
            w = o ? ? 6;
        b[0] !== e || b[1] !== x || b[2] !== r ? (l = er.queryKeys[en.QueryKey.TokenBalance].token(e, r, x), b[0] = e, b[1] = x, b[2] = r, b[3] = l) : l = b[3];
        let _ = l.queryKey;
        b[4] !== s ? (c = s ? ? {}, b[4] = s, b[5] = c) : c = b[5], b[6] !== c ? ({
            pendingTxnCount: u,
            ...d
        } = c, b[6] = c, b[7] = u, b[8] = d) : (u = b[7], d = b[8]), b[9] !== e || b[10] !== w || b[11] !== u || b[12] !== v || b[13] !== _ || b[14] !== r ? (f = async () => {
            let t = await ea(e, r, w),
                n = v.getQueryData(_);
            return (({
                current: e,
                cachedBalance: t,
                preservePendingOverlay: r
            }) => ({
                current: e,
                pending: r ? t ? .pending ? ? 0 : 0
            }))({
                current: t.current,
                cachedBalance: n,
                preservePendingOverlay: (u ? ? 0) > 0
            })
        }, b[9] = e, b[10] = w, b[11] = u, b[12] = v, b[13] = _, b[14] = r, b[15] = f) : f = b[15], b[16] === Symbol.for("react.memo_cache_sentinel") ? (p = {
            persist: !0
        }, b[16] = p) : p = b[16];
        let C = d ? .enabled ? ? !0;
        b[17] === Symbol.for("react.memo_cache_sentinel") ? (h = {
            current: 0,
            pending: 0
        }, b[17] = h) : h = b[17], b[18] !== d || b[19] !== _ || b[20] !== f || b[21] !== C ? (m = {
            queryKey: _,
            queryFn: f,
            refetchOnMount: !1,
            refetchOnReconnect: !0,
            refetchOnWindowFocus: !0,
            refetchInterval: 1e4,
            gcTime: 864e5,
            staleTime: 15e3,
            meta: p,
            ...d,
            enabled: C,
            placeholderData: h
        }, b[18] = d, b[19] = _, b[20] = f, b[21] = C, b[22] = m) : m = b[22];
        let {
            data: E,
            isLoading: S,
            isPending: A,
            isFetching: I,
            isFetched: T
        } = (0, n.useQuery)(m);
        b[23] !== E ? (y = E ? ? {
            current: 0,
            pending: 0
        }, b[23] = E, b[24] = y) : y = b[24];
        let k = y;
        return b[25] !== T || b[26] !== I || b[27] !== S || b[28] !== A || b[29] !== k ? (g = {
            data: k,
            isLoading: S,
            isPending: A,
            isFetching: I,
            isFetched: T
        }, b[25] = T, b[26] = I, b[27] = S, b[28] = A, b[29] = k, b[30] = g) : g = b[30], g
    }, "tokenBalanceFetcher", 0, ea], 493164)
}, 134709, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(416340);
    e.s(["default", 0, () => {
        let e, n, a = (0, t.c)(2),
            [i, o] = (0, r.useState)(!1);
        return a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = () => {
            o(!0)
        }, n = [], a[0] = e, a[1] = n) : (e = a[0], n = a[1]), (0, r.useEffect)(e, n), i
    }])
}, 213333, e => {
    "use strict";
    var t = e.i(416340),
        r = function(e, t) {
            return !Object.is(e, t)
        };
    e.s(["usePrevious", 0, function(e, n) {
        void 0 === n && (n = r);
        var a = (0, t.useRef)(void 0),
            i = (0, t.useRef)(void 0);
        return n(i.current, e) && (a.current = i.current, i.current = e), a.current
    }], 213333)
}, 846170, e => {
    "use strict";
    e.s(["LAST_CONNECTOR_COOKIE_KEY", () => a, "useLastConnector", () => o, "useSingletonLastConnector", () => i]);
    var t = e.i(999061),
        r = e.i(518321),
        n = e.i(603580);
    let a = "polymarket.auth.lastConnectorId",
        i = () => {
            let e, n, i = (0, t.c)(4);
            i[0] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                defaultValue: void 0
            }, i[0] = e) : e = i[0];
            let [o, s] = (0, r.useCookieState)(a, e);
            return i[1] !== o || i[2] !== s ? (n = {
                lastConnectorId: o,
                updateLastConnectorId: s
            }, i[1] = o, i[2] = s, i[3] = n) : n = i[3], n
        },
        o = () => {
            let e, r = (0, t.c)(3),
                {
                    lastConnectorId: a,
                    updateLastConnectorId: i
                } = (0, n.useSiwxContext)();
            return r[0] !== a || r[1] !== i ? (e = {
                lastConnectorId: a,
                updateLastConnectorId: i
            }, r[0] = a, r[1] = i, r[2] = e) : e = r[2], e
        }
}, 625377, e => {
    "use strict";
    var t = e.i(601550),
        r = e.i(469010),
        n = e.i(912504);
    e.s(["useReconnect", 0, function(e = {}) {
        let a = (0, n.useConfig)(e),
            i = function(e, t = {}) {
                return { ...t.mutation,
                    mutationFn: t => (0, r.reconnect)(e, t),
                    mutationKey: ["reconnect"]
                }
            }(a, e),
            o = (0, t.useMutation)(i);
        return { ...o,
            connectors: a.connectors,
            reconnect: o.mutate,
            reconnectAsync: o.mutateAsync
        }
    }], 625377)
}, 618519, 531299, e => {
    "use strict";
    var t = e.i(601550),
        r = e.i(788494);
    async function n(e, t) {
        let n;
        if ((n = "function" == typeof t.connector ? e._internal.connectors.setup(t.connector) : t.connector).uid === e.state.current) throw new r.ConnectorAlreadyConnectedError;
        try {
            e.setState(e => ({ ...e,
                status: "connecting"
            })), n.emitter.emit("message", {
                type: "connecting"
            });
            let {
                connector: r,
                ...a
            } = t, i = await n.connect(a);
            return n.emitter.off("connect", e._internal.events.connect), n.emitter.on("change", e._internal.events.change), n.emitter.on("disconnect", e._internal.events.disconnect), await e.storage ? .setItem("recentConnectorId", n.id), e.setState(e => ({ ...e,
                connections: new Map(e.connections).set(n.uid, {
                    accounts: a.withCapabilities ? i.accounts.map(e => "object" == typeof e ? e.address : e) : i.accounts,
                    chainId: i.chainId,
                    connector: n
                }),
                current: n.uid,
                status: "connected"
            })), {
                accounts: a.withCapabilities ? i.accounts.map(e => "object" == typeof e ? e : {
                    address: e,
                    capabilities: {}
                }) : i.accounts,
                chainId: i.chainId
            }
        } catch (t) {
            throw e.setState(e => ({ ...e,
                status: e.current ? "connected" : "disconnected"
            })), t
        }
    }
    var a = e.i(416340),
        i = e.i(912504);
    let o = [];

    function s(e) {
        let t = e.connectors;
        return o.length === t.length && o.every((e, r) => e === t[r]) ? o : (o = t, t)
    }

    function l(e = {}) {
        let t = (0, i.useConfig)(e);
        return (0, a.useSyncExternalStore)(e => (function(e, t) {
            let {
                onChange: r
            } = t;
            return e._internal.connectors.subscribe((e, t) => {
                r(Object.values(e), t)
            })
        })(t, {
            onChange: e
        }), () => s(t), () => s(t))
    }
    e.s(["useConnectors", 0, l], 531299), e.s(["useConnect", 0, function(e = {}) {
        let r = (0, i.useConfig)(e),
            o = function(e, t = {}) {
                return { ...t.mutation,
                    mutationFn: async t => n(e, t),
                    mutationKey: ["connect"]
                }
            }(r, e),
            s = (0, t.useMutation)(o);
        return (0, a.useEffect)(() => r.subscribe(({
            status: e
        }) => e, (e, t) => {
            "connected" === t && "disconnected" === e && s.reset()
        }), [r, s.reset]), { ...s,
            connect: s.mutate,
            connectAsync: s.mutateAsync,
            connectors: l({
                config: r
            })
        }
    }], 618519)
}, 306941, e => {
    "use strict";
    let t = ["user denied", "user rejected the request", "metamask message signature: user denied message signature"],
        r = new Set([4001, "ACTION_REJECTED"]);
    e.s(["EXECUTION_REVERTED", 0, "execution reverted", "REJECTED_SIGNATURE", 0, "user denied", "UNAUTHENTICATED", 0, "user is not authenticated", "isUserRejection", 0, function(e) {
        if (!e || "object" != typeof e) return !1;
        if (void 0 !== e.code && r.has(e.code) || "UserRejectedRequestError" === e.name) return !0;
        let n = e.message ? .toLowerCase() ? ? "";
        return t.some(e => n.includes(e))
    }])
}, 844779, 913739, e => {
    "use strict";
    var t = e.i(844268),
        r = e.i(198905),
        n = e.i(966727),
        a = e.i(777038),
        i = e.i(415013),
        o = e.i(605381),
        s = e.i(186897);
    let l = "0xd21df8dc65880a8606f09fe0ce3df9b8869287ab0b058be05aa9e8af6330a00b",
        c = "0x2bce2127ff07fb632d16c8347c4ebf501f4841168bed00d9e6ef715ddb6fcecf";
    e.s(["DEPOSIT_WALLET_DOMAIN_NAME", 0, "DepositWallet", "DEPOSIT_WALLET_DOMAIN_VERSION", 0, "1", "PROXY_INIT_CODE_HASH", 0, l, "SAFE_FACTORY_NAME", 0, "Polymarket Contract Proxy Factory", "SAFE_INIT_CODE_HASH", 0, c], 913739), e.s(["deriveDepositWallet", 0, (e, n, l) => {
        let c, u = (0, o.pad)(e, {
                dir: "left",
                size: 32
            }),
            d = (0, r.encodeAbiParameters)([{
                type: "address"
            }, {
                type: "bytes32"
            }], [n, u]),
            f = (0, i.keccak256)(d),
            p = (c = BigInt((d.length - 2) / 2), (0, i.keccak256)((0, t.concat)([(0, s.toHex)(0x61003d3d8160233d3973 n + (c << 56 n), {
                size: 10
            }), l, "0x6009", "0x5155f3363d3d373d3d363d7f360894a13ba1a3210667c828492db98dca3e2076", "0xcc3735a920a3ca505d382bbc545af43d6000803e6038573d6000fd5b3d6000f3", d])));
        return (0, a.getCreate2Address)({
            from: n,
            salt: f,
            bytecodeHash: p
        })
    }, "deriveProxyWallet", 0, (e, t) => (0, a.getCreate2Address)({
        bytecodeHash: l,
        from: t,
        salt: (0, i.keccak256)((0, n.encodePacked)(["address"], [e]))
    }), "deriveSafe", 0, (e, t) => (0, a.getCreate2Address)({
        bytecodeHash: c,
        from: t,
        salt: (0, i.keccak256)((0, r.encodeAbiParameters)([{
            name: "address",
            type: "address"
        }], [e]))
    })], 844779)
}, 813846, e => {
    "use strict";
    let t = {
        masterCopyAddressVersions: [{
            version: "1.3.0",
            address: "0xE51abdf814f8854941b9Fe8e3A4F65CAB4e7A4a8"
        }],
        proxyFactoryAddress: "0xaacFeEa03eb1561C4e67d661e40682Bd20E3541b",
        multiSendAddress: "0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761",
        fallbackHandlerAddress: "0xe16bA5bF81E5BB113e4752E4fdC20351d796fB24"
    };
    var r, n = ((r = {})[r.Call = 0] = "Call", r[r.DelegateCall = 1] = "DelegateCall", r);
    e.s(["OperationType", () => n, "defaultNetworks", 0, {
        1: t,
        5: t,
        137: t,
        80001: t
    }])
}, 369761, 885370, 715037, 671363, e => {
    "use strict";
    var t, r, n = e.i(56339);
    e.i(973518), (t = r || (r = {})).Invalid = "0", t.Call = "1", t.DelegateCall = "2", e.s(["CallType", 0, r], 885370);
    var a = e.i(504154);
    let i = [{
        constant: !0,
        inputs: [],
        name: "name",
        outputs: [{
            name: "",
            type: "string"
        }],
        payable: !1,
        stateMutability: "view",
        type: "function"
    }, {
        constant: !1,
        inputs: [{
            name: "_spender",
            type: "address"
        }, {
            name: "_value",
            type: "uint256"
        }],
        name: "approve",
        outputs: [{
            name: "",
            type: "bool"
        }],
        payable: !1,
        stateMutability: "nonpayable",
        type: "function"
    }, {
        constant: !0,
        inputs: [],
        name: "totalSupply",
        outputs: [{
            name: "",
            type: "uint256"
        }],
        payable: !1,
        stateMutability: "view",
        type: "function"
    }, {
        constant: !1,
        inputs: [{
            name: "_from",
            type: "address"
        }, {
            name: "_to",
            type: "address"
        }, {
            name: "_value",
            type: "uint256"
        }],
        name: "transferFrom",
        outputs: [{
            name: "",
            type: "bool"
        }],
        payable: !1,
        stateMutability: "nonpayable",
        type: "function"
    }, {
        constant: !0,
        inputs: [],
        name: "decimals",
        outputs: [{
            name: "",
            type: "uint8"
        }],
        payable: !1,
        stateMutability: "view",
        type: "function"
    }, {
        constant: !0,
        inputs: [{
            name: "_owner",
            type: "address"
        }],
        name: "balanceOf",
        outputs: [{
            name: "balance",
            type: "uint256"
        }],
        payable: !1,
        stateMutability: "view",
        type: "function"
    }, {
        constant: !0,
        inputs: [],
        name: "symbol",
        outputs: [{
            name: "",
            type: "string"
        }],
        payable: !1,
        stateMutability: "view",
        type: "function"
    }, {
        constant: !1,
        inputs: [{
            name: "_to",
            type: "address"
        }, {
            name: "_value",
            type: "uint256"
        }],
        name: "transfer",
        outputs: [{
            name: "",
            type: "bool"
        }],
        payable: !1,
        stateMutability: "nonpayable",
        type: "function"
    }, {
        constant: !0,
        inputs: [{
            name: "_owner",
            type: "address"
        }, {
            name: "_spender",
            type: "address"
        }],
        name: "allowance",
        outputs: [{
            name: "",
            type: "uint256"
        }],
        payable: !1,
        stateMutability: "view",
        type: "function"
    }, {
        payable: !0,
        stateMutability: "payable",
        type: "fallback"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !0,
            name: "owner",
            type: "address"
        }, {
            indexed: !0,
            name: "spender",
            type: "address"
        }, {
            indexed: !1,
            name: "value",
            type: "uint256"
        }],
        name: "Approval",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !0,
            name: "from",
            type: "address"
        }, {
            indexed: !0,
            name: "to",
            type: "address"
        }, {
            indexed: !1,
            name: "value",
            type: "uint256"
        }],
        name: "Transfer",
        type: "event"
    }];
    e.s(["erc20TransferTransaction", 0, (e, t, a) => ({
        to: e,
        typeCode: r.Call,
        data: (0, n.encodeFunctionData)({
            abi: i,
            functionName: "transfer",
            args: [t, a]
        }),
        value: "0"
    })], 715037), (0, a.parseAbi)(["function payDebt(uint256)"]), (0, a.parseAbi)(["function takeOnDebt(uint256,bytes32)"]), (0, a.parseAbi)(["function addFunding(address,uint256,uint256[],uint256[],uint256[],uint256[])"]), (0, a.parseAbi)(["function withdraw(uint256)"]), JSON.parse('[{"inputs":[{"internalType":"address","name":"_ctf","type":"address"},{"internalType":"address","name":"_collateral","type":"address"},{"internalType":"address","name":"_vault","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"DeterminedFlagAlreadySet","type":"error"},{"inputs":[],"name":"FeeBipsOutOfBounds","type":"error"},{"inputs":[],"name":"IndexOutOfBounds","type":"error"},{"inputs":[],"name":"InvalidIndexSet","type":"error"},{"inputs":[],"name":"LengthMismatch","type":"error"},{"inputs":[],"name":"MarketAlreadyDetermined","type":"error"},{"inputs":[],"name":"MarketAlreadyPrepared","type":"error"},{"inputs":[],"name":"MarketNotPrepared","type":"error"},{"inputs":[],"name":"NoConvertiblePositions","type":"error"},{"inputs":[],"name":"NotApprovedForAll","type":"error"},{"inputs":[],"name":"OnlyOracle","type":"error"},{"inputs":[],"name":"UnexpectedCollateralToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"marketId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"oracle","type":"address"},{"indexed":false,"internalType":"uint256","name":"feeBips","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"MarketPrepared","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"marketId","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"questionId","type":"bytes32"},{"indexed":false,"internalType":"bool","name":"outcome","type":"bool"}],"name":"OutcomeReported","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"redeemer","type":"address"},{"indexed":true,"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"}],"name":"PayoutRedemption","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"stakeholder","type":"address"},{"indexed":true,"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PositionSplit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"stakeholder","type":"address"},{"indexed":true,"internalType":"bytes32","name":"marketId","type":"bytes32"},{"indexed":true,"internalType":"uint256","name":"indexSet","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PositionsConverted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"stakeholder","type":"address"},{"indexed":true,"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PositionsMerge","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"marketId","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"questionId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"QuestionPrepared","type":"event"},{"inputs":[],"name":"FEE_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NO_TOKEN_BURN_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_owners","type":"address[]"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"col","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_marketId","type":"bytes32"},{"internalType":"uint256","name":"_indexSet","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"convertPositions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ctf","outputs":[{"internalType":"contract IConditionalTokens","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_questionId","type":"bytes32"}],"name":"getConditionId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_marketId","type":"bytes32"}],"name":"getDetermined","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_marketId","type":"bytes32"}],"name":"getFeeBips","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_marketId","type":"bytes32"}],"name":"getMarketData","outputs":[{"internalType":"MarketData","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_marketId","type":"bytes32"}],"name":"getOracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_questionId","type":"bytes32"},{"internalType":"bool","name":"_outcome","type":"bool"}],"name":"getPositionId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_marketId","type":"bytes32"}],"name":"getQuestionCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_marketId","type":"bytes32"}],"name":"getResult","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_collateralToken","type":"address"},{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"bytes32","name":"_conditionId","type":"bytes32"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mergePositions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_conditionId","type":"bytes32"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mergePositions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feeBips","type":"uint256"},{"internalType":"bytes","name":"_metadata","type":"bytes"}],"name":"prepareMarket","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_marketId","type":"bytes32"},{"internalType":"bytes","name":"_metadata","type":"bytes"}],"name":"prepareQuestion","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_conditionId","type":"bytes32"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"redeemPositions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_questionId","type":"bytes32"},{"internalType":"bool","name":"_outcome","type":"bool"}],"name":"reportOutcome","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"uint256[]","name":"_values","type":"uint256[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collateralToken","type":"address"},{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"bytes32","name":"_conditionId","type":"bytes32"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"splitPosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_conditionId","type":"bytes32"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"splitPosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wcol","outputs":[{"internalType":"contract WrappedCollateral","name":"","type":"address"}],"stateMutability":"view","type":"function"}]');
    var o = e.i(198905),
        s = e.i(966727),
        l = e.i(777038),
        c = e.i(415013);
    let u = (0, c.keccak256)((0, s.encodePacked)(["string"], ["polymarket-wallet-factory"])),
        d = (0, c.keccak256)(" ");
    e.s(["getProxyWalletAddress", 0, (e, t) => {
        let r;
        return (0, l.getCreate2Address)({
            from: e,
            salt: (0, c.keccak256)((0, s.encodePacked)(["address"], [t])),
            bytecodeHash: (0, c.keccak256)((r = (0, o.encodeAbiParameters)([{
                type: "bytes"
            }], ["0x"]).slice(2), `0x3d3d606380380380913d393d73${e.slice(2).toLowerCase()}5af4602a57600080fd5b602d8060366000396000f3363d3d373d3d3d363d73${(0,l.getCreate2Address)({from:e,salt:u,bytecodeHash:d}).slice(2).toLowerCase()}5af43d82803e903d91602b57fd5bf352e831dd${r}`))
        })
    }], 671363), e.s([], 369761)
}, 544572, e => {
    "use strict";
    var t = e.i(284553);
    e.i(369761);
    var r = e.i(671363),
        n = e.i(198905),
        a = e.i(777038),
        i = e.i(415013),
        o = e.i(173102),
        s = e.i(813846);
    let l = t.default.env.NEXT_PUBLIC_PROXY_WALLET_FACTORY_ADDRESS || "0xaB45c5A4B0c941a2F231C04C3f49182e1A254052",
        c = t.default.env.NEXT_PUBLIC_EOA_PROXY_WALLET_INIT_CODE_HASH || "0x2bce2127ff07fb632d16c8347c4ebf501f4841168bed00d9e6ef715ddb6fcecf",
        u = {
            chainId: 137,
            magic: {
                factoryAddress: l
            },
            eoa: {
                factoryAddress: t.default.env.NEXT_PUBLIC_EOA_PROXY_WALLET_FACTORY_ADDRESS || s.defaultNetworks[137].proxyFactoryAddress,
                initCodeHash: c
            }
        };
    e.s(["deriveProxyAddress", 0, (e, t, s = u) => {
        if ("magic" === t) return (0, r.getProxyWalletAddress)(s.magic.factoryAddress, e);
        return (0, a.getCreate2Address)({
            from: s.eoa.factoryAddress,
            salt: (0, i.keccak256)((0, n.encodeAbiParameters)((0, o.parseAbiParameters)("address"), [e])),
            bytecodeHash: s.eoa.initCodeHash
        })
    }])
}, 721270, e => {
    "use strict";
    var t = e.i(284553),
        r = e.i(844779),
        n = e.i(813846),
        a = e.i(544572),
        i = e.i(631222),
        o = e.i(200036),
        s = e.i(53950);
    let l = t.default.env.NEXT_PUBLIC_DEPOSIT_WALLET_FACTORY || "0x00000000000Fb5C9ADea0298D729A0CB3823Cc07",
        c = t.default.env.NEXT_PUBLIC_DEPOSIT_WALLET_IMPLEMENTATION || "0x58CA52ebe0DadfdF531Cde7062e76746de4Db1eB",
        u = async e => {
            let t = (0, o.createChainAwarePublicClient)({
                chainId: i.MATIC_CONFIG.chainId
            });
            if (!t) {
                let t = Error("No public client available for chain");
                throw s.logger.warn("[isSafeDeployedOnChain] no public client available", {
                    chainId: i.MATIC_CONFIG.chainId,
                    safeAddress: e
                }), t
            }
            try {
                let r = await t.getCode({
                    address: e
                });
                return !!r && "0x" !== r
            } catch (t) {
                throw s.logger.warn("[isSafeDeployedOnChain] getCode failed", {
                    chainId: i.MATIC_CONFIG.chainId,
                    safeAddress: e,
                    error: t instanceof Error ? t.message : String(t)
                }), t
            }
        };
    e.s(["getProxyAddress", 0, (e, t) => "depositWallet" === t ? (0, r.deriveDepositWallet)(e, l, c) : (0, a.deriveProxyAddress)(e, "magic" === t ? "magic" : "eoa", {
        chainId: 137,
        magic: {
            factoryAddress: i.PROXY_WALLET_FACTORY_ADDRESS
        },
        eoa: {
            factoryAddress: n.defaultNetworks[i.MATIC_CONFIG.chainId].proxyFactoryAddress,
            initCodeHash: i.SAFE_INIT_CODE_HASH
        }
    }), "isSafeDeployedOnChain", 0, u])
}, 285650, 933850, 938216, e => {
    "use strict";
    var t = e.i(399482),
        r = e.i(905333),
        n = e.i(53950),
        a = e.i(721270);
    let i = e => {
            if (e) return e.slice(0, 500)
        },
        o = e => {
            if (null != e) {
                if ("string" == typeof e) return e;
                try {
                    let t = new WeakSet;
                    return JSON.stringify(e, (e, r) => {
                        if ("bigint" == typeof r) return r.toString();
                        if ("object" == typeof r && null !== r) {
                            if (t.has(r)) return "[Circular Reference]";
                            t.add(r)
                        }
                        return r
                    })
                } catch {
                    return String(e)
                }
            }
        },
        s = e => {
            if ("number" == typeof e && Number.isFinite(e)) return e;
            if ("string" == typeof e) {
                let t = Number(e);
                if (Number.isFinite(t)) return t
            }
        },
        l = e => {
            let n = (0, t.createWalletCache)().state.value;
            return "magic" === e ? n ? .type === "magic" && "email" === n.magicAuthType ? "magic-email" : n ? .type === "magic" && "oauth" === n.magicAuthType && "google" === n.oauthProvider ? "magic-google" : "magic-oauth" : "unknown" === e ? "unknown" : (0, r.isWalletConnectConnector)(e) ? "eoa-qr" : "eoa-injector"
        },
        c = ({
            connectorId: e,
            walletAddress: t
        }) => {
            if (t && "unknown" !== e) try {
                return (0, a.getProxyAddress)(t, e)
            } catch {
                return
            }
        },
        u = () => ({
            pathname: window.location.pathname,
            hasSearch: window.location.search.length > 0,
            visibilityState: document.visibilityState
        }),
        d = () => {
            let e = (0, t.createWalletCache)().state.value;
            return e ? "magic" === e.type ? {
                cachedAuthType: e.type,
                cachedConnectorId: e.connectorId,
                cachedConnectionState: e.connectionState,
                cachedMagicAuthType: e.magicAuthType,
                cachedOauthProvider: e.oauthProvider,
                hasCachedAddress: !!e.address,
                hasCachedEmail: !!e.email
            } : {
                cachedAuthType: e.type,
                cachedConnectorId: e.connectorId,
                hasCachedAddress: !!e.address
            } : {}
        };
    e.s(["logAuthFlowError", 0, ({
        authStatus: e,
        authType: r,
        connectorId: a,
        error: f,
        errorCode: p,
        errorMessage: h,
        errorName: m,
        errorResponse: y,
        trigger: g,
        walletAddress: b
    }) => {
        let v = (0, t.createWalletCache)().state.value,
            x = a ? ? v ? .connectorId ? ? "unknown",
            w = b ? ? v ? .address,
            _ = (e => {
                if (e instanceof Error) {
                    let t = "object" == typeof e.response && null !== e.response && "data" in e.response ? e.response.data : e.response;
                    return {
                        errorName: e.name || "Error",
                        errorMessage: e.message || "Unknown error",
                        errorCode: s(e.code),
                        errorResponse: i(o(t))
                    }
                }
                if ("object" == typeof e && null !== e) {
                    let t = "object" == typeof e.response && null !== e.response && "data" in e.response ? e.response.data : e.response;
                    return {
                        errorName: "string" == typeof e.name ? e.name : "UnknownError",
                        errorMessage: "string" == typeof e.message ? e.message : o(e) || "Unknown error",
                        errorCode: s(e.code),
                        errorResponse: i(o(t))
                    }
                }
                return {
                    errorName: "UnknownError",
                    errorMessage: "string" == typeof e ? e : "Unknown error",
                    errorCode: void 0,
                    errorResponse: void 0
                }
            })(f);
        n.logger.error("auth.flow.error", { ...u(),
            ...d(),
            authStatus: e,
            authType: r ? ? l(x),
            connectorId: x,
            errorName: m ? ? _.errorName,
            errorMessage: h ? ? _.errorMessage,
            errorCode: p ? ? _.errorCode,
            errorResponse: i(y ? ? _.errorResponse),
            proxyAddress: c({
                connectorId: x,
                walletAddress: w
            }),
            walletAddress: w,
            trigger: g,
            timestamp: Date.now()
        })
    }, "logAuthFlowStep", 0, ({
        authType: e,
        connectorId: r,
        data: a,
        step: i,
        walletAddress: o
    }) => {
        let s = (0, t.createWalletCache)().state.value,
            f = r ? ? s ? .connectorId ? ? "unknown",
            p = o ? ? s ? .address;
        n.logger.info("auth.flow.step", { ...u(),
            ...d(),
            ...a,
            authType: e ? ? l(f),
            connectorId: f,
            proxyAddress: c({
                connectorId: f,
                walletAddress: p
            }),
            step: i,
            timestamp: Date.now(),
            walletAddress: p
        })
    }], 285650), e.s(["getLogoutGuardDecision", 0, ({
        authenticatedUserType: e,
        cacheConnectorId: t,
        connectorIds: n
    }) => {
        let a = n.filter(e => "string" == typeof e && e.length > 0),
            i = a.length > 0,
            o = !!t && a.some(e => e === t),
            s = a.some(e => (0, r.isMagicConnector)(e));
        return i && t && !o ? {
            shouldLogout: !1,
            reason: "non_active_connector",
            cacheConnectorId: t
        } : i && "magic" === e && !s ? {
            shouldLogout: !1,
            reason: "magic_non_magic_connector",
            cacheConnectorId: t
        } : {
            shouldLogout: !0,
            cacheConnectorId: t
        }
    }], 933850);
    var f = e.i(999061);
    e.i(416340);
    var p = e.i(668122),
        h = e.i(305457);
    e.s(["useWalletAnalytics", 0, () => {
        let e, r, n = (0, f.c)(4),
            a = (0, h.useAmplitudeAnalytics)();
        n[0] !== a ? (e = e => {
            let {
                address: r,
                connector: n
            } = e;
            if (n) {
                if ("magic" === n.id) {
                    let e = (0, t.createWalletCache)().state.magic;
                    a.trackEvent(p.Events.WalletConnected, {
                        address: r,
                        id: n ? .id,
                        name: n ? .name,
                        magicAuthType: e ? .magicAuthType
                    });
                    return
                }
                a.trackEvent(p.Events.WalletConnected, {
                    address: r,
                    id: n.id,
                    name: n.name
                })
            }
        }, n[0] = a, n[1] = e) : e = n[1];
        let i = e;
        return n[2] !== i ? (r = {
            emitConnectAnalytics: i
        }, n[2] = i, n[3] = r) : r = n[3], r
    }], 938216)
}, 532975, e => {
    "use strict";
    var t = e.i(112130);
    let r = [];

    function n(e) {
        let n = [...e.state.connections.values()];
        return "reconnecting" === e.state.status || (0, t.deepEqual)(r, n) ? r : (r = n, n)
    }
    var a = e.i(416340),
        i = e.i(912504);
    e.s(["useConnections", 0, function(e = {}) {
        let r = (0, i.useConfig)(e);
        return (0, a.useSyncExternalStore)(e => (function(e, r) {
            let {
                onChange: a
            } = r;
            return e.subscribe(() => n(e), a, {
                equalityFn: t.deepEqual
            })
        })(r, {
            onChange: e
        }), () => n(r), () => n(r))
    }], 532975)
}, 57033, e => {
    "use strict";
    async function t(e, r = {}) {
        let n;
        if (r.connector) n = r.connector;
        else {
            let {
                connections: t,
                current: r
            } = e.state, a = t.get(r);
            n = a ? .connector
        }
        let a = e.state.connections;
        n && (await n.disconnect(), n.emitter.off("change", e._internal.events.change), n.emitter.off("disconnect", e._internal.events.disconnect), n.emitter.on("connect", e._internal.events.connect), a.delete(n.uid)), e.setState(e => {
            if (0 === a.size) return { ...e,
                connections: new Map,
                current: null,
                status: "disconnected"
            };
            let t = a.values().next().value;
            return { ...e,
                connections: new Map(a),
                current: t.connector.uid
            }
        }); {
            let t = e.state.current;
            if (!t) return;
            let r = e.state.connections.get(t) ? .connector;
            if (!r) return;
            await e.storage ? .setItem("recentConnectorId", r.id)
        }
    }
    e.s(["disconnectMutationOptions", 0, function(e, r = {}) {
        return { ...r.mutation,
            mutationFn: async r => t(e, r),
            mutationKey: ["disconnect"]
        }
    }], 57033)
}, 9291, e => {
    "use strict";
    var t = e.i(601550),
        r = e.i(57033),
        n = e.i(912504),
        a = e.i(532975);
    e.s(["useDisconnect", 0, function(e = {}) {
        let i = (0, n.useConfig)(e),
            o = (0, r.disconnectMutationOptions)(i, e),
            s = (0, t.useMutation)(o);
        return { ...s,
            connectors: (0, a.useConnections)({
                config: i
            }).map(e => e.connector),
            disconnect: s.mutate,
            disconnectAsync: s.mutateAsync
        }
    }])
}, 276990, 789608, 839968, 449907, 155963, 290725, e => {
    "use strict";
    e.s(["useWalletConnectUri", () => F], 276990);
    var t = e.i(999061),
        r = e.i(416340),
        n = e.i(805949),
        a = e.i(53950),
        i = e.i(631222),
        o = e.i(603580);
    e.s(["useConnect", () => P], 449907);
    var s = e.i(399482),
        l = e.i(905333),
        c = e.i(625377),
        u = e.i(618519),
        d = e.i(945930),
        f = e.i(306941),
        p = e.i(827681),
        h = e.i(566515),
        m = e.i(285650),
        y = e.i(933850),
        g = e.i(846170);
    e.s(["useOnConnect", () => M], 839968);
    var b = e.i(601550),
        v = e.i(867487),
        x = e.i(938216);
    e.s(["useDisconnect", () => N], 789608);
    var w = e.i(318594),
        _ = e.i(532975),
        C = e.i(9291),
        E = e.i(510954),
        S = e.i(57096);

    function A(e) {
        try {
            e.connector.disconnect()
        } catch {}
    }

    function I(e) {
        return e.id
    }

    function T(e) {
        return e.id
    }

    function k(e) {
        return e.id
    }

    function O(e) {
        return e.connector
    }
    let R = (e, t) => [...e].sort((e, r) => t ? e.connector.id === t.id ? -1 : +(r.connector.id === t.id) : 0);

    function N({
        mutation: e = {},
        ...i
    } = {}) {
        let l = (0, w.useQueryClient)(),
            c = (0, _.useConnections)(),
            {
                connector: u
            } = (0, n.useConnection)(),
            {
                mutateAsync: f
            } = (0, C.useDisconnect)(),
            {
                onDisconnectAsync: m
            } = function() {
                let e, r, n = (0, t.c)(10),
                    {
                        options: i,
                        setConnector: l,
                        setAuthenticationStatus: c,
                        setConnectorStatus: u
                    } = (0, o.useSiwxContext)(),
                    {
                        signOut: f,
                        authenticatedUser: m
                    } = (0, h.useAuthenticationContext)(),
                    g = (0, _.useConnections)();
                n[0] !== m ? .type || n[1] !== g || n[2] !== i || n[3] !== c || n[4] !== l || n[5] !== u || n[6] !== f ? (e = {
                    mutationFn: async e => {
                        let {
                            signOutOnDisconnect: t,
                            connectors: r
                        } = e ? ? {}, n = void 0 === t || t, o = r ? .length ? r : g.map(O), h = (0, s.createWalletCache)().state.value ? .connectorId, b = (0, y.getLogoutGuardDecision)({
                            authenticatedUserType: m ? .type,
                            cacheConnectorId: h,
                            connectorIds: o.map(k)
                        }), v = "magic_non_magic_connector" === b.reason ? "magic_non_magic_disconnect" : b.reason, x = b.shouldLogout;
                        i.signOutOnDisconnect && n && !x && a.logger.info("[useOnDisconnect] Skipping signOut for disconnect guard", {
                            authType: m ? .type,
                            connectorIds: o.map(T),
                            cacheConnectorId: b.cacheConnectorId,
                            skipReason: v
                        }), i.signOutOnDisconnect && n && x && (a.logger.info("[useOnDisconnect] Signing out due to disconnect", {
                            authType: m ? .type,
                            connectorIds: o.map(I),
                            cacheConnectorId: b.cacheConnectorId,
                            signOutOnDisconnect: n
                        }), (0, d.setLogoutTrigger)({
                            reason: "wallet_disconnect",
                            initiator: "system",
                            trigger: "wallet_disconnect"
                        }, {
                            mode: "if_unset"
                        }), f()), l({
                            id: "",
                            name: void 0
                        }), u(p.ConnectorStates.DISCONNECTED), c(p.AuthenticationStatusStates.IDLE), g.forEach(A)
                    }
                }, n[0] = m ? .type, n[1] = g, n[2] = i, n[3] = c, n[4] = l, n[5] = u, n[6] = f, n[7] = e) : e = n[7];
                let v = (0, b.useMutation)(e);
                if (n[8] !== v) {
                    let {
                        mutate: e,
                        mutateAsync: t,
                        ...a
                    } = v;
                    r = {
                        onDisconnect: t => {
                            let r = void 0 === t ? {} : t,
                                {
                                    signOutOnDisconnect: n,
                                    mutation: a
                                } = r;
                            return e({
                                signOutOnDisconnect: void 0 === n || n,
                                connectors: r.connectors
                            }, { ...a
                            })
                        },
                        onDisconnectAsync: async e => {
                            let r = void 0 === e ? {} : e,
                                {
                                    signOutOnDisconnect: n,
                                    mutation: a
                                } = r;
                            return t({
                                signOutOnDisconnect: void 0 === n || n,
                                connectors: r.connectors
                            }, { ...a
                            })
                        },
                        ...a
                    }, n[8] = v, n[9] = r
                } else r = n[9];
                return r
            }(),
            g = r.default.useCallback(() => {
                l.removeQueries({
                    queryKey: E.queryKeys[S.QueryKey.Account].favoriteEvents().queryKey,
                    exact: !0
                }), l.removeQueries({
                    queryKey: E.queryKeys[S.QueryKey.Account].preferences().queryKey,
                    exact: !0
                }), l.removeQueries({
                    queryKey: E.queryKeys[S.QueryKey.Account].profile().queryKey,
                    exact: !0
                })
            }, [l]),
            v = r.default.useCallback(() => {
                l.setQueryData(E.queryKeys[S.QueryKey.Notifications].cachedClob().queryKey, []), l.removeQueries({
                    queryKey: E.queryKeys[S.QueryKey.Notifications].clob().queryKey,
                    exact: !0
                }), l.setQueryData(E.queryKeys[S.QueryKey.Notifications].watermark().queryKey, Date.now())
            }, [l]),
            x = r.default.useCallback(() => {
                l.removeQueries({
                    queryKey: E.queryKeys[S.QueryKey.OpenOrders]._def,
                    exact: !0
                }), l.removeQueries({
                    queryKey: E.queryKeys[S.QueryKey.Positions]._def,
                    exact: !0
                })
            }, [l]),
            M = r.default.useCallback(() => {
                l.removeQueries({
                    queryKey: E.queryKeys[S.QueryKey.Deposit].transactions().queryKey,
                    exact: !0
                }), l.removeQueries({
                    queryKey: E.queryKeys[S.QueryKey.Deposit].quotes().queryKey,
                    exact: !0
                }), l.removeQueries({
                    queryKey: E.queryKeys[S.QueryKey.Deposit].copied().queryKey,
                    exact: !0
                }), l.removeQueries({
                    queryKey: E.queryKeys[S.QueryKey.Deposit].chains().queryKey,
                    exact: !0
                }), l.removeQueries({
                    queryKey: E.queryKeys[S.QueryKey.Deposit].lastSeenT2bSourceBlock().queryKey,
                    exact: !0
                })
            }, [l]),
            {
                mutate: P,
                mutateAsync: D,
                ...j
            } = (0, b.useMutation)({
                mutationFn: async ({
                    connector: e = u
                } = {}) => {
                    let t = R(c, e);
                    for await (let e of t) await f({
                        connector: e.connector
                    });
                    return t.map(e => e.connector)
                },
                onMutate: async ({
                    signOutOnDisconnect: e = !0,
                    connector: t = u
                } = {}) => {
                    let r = R(c, t);
                    a.logger.info("[useDisconnect > onMutate] Starting disconnect mutation", {
                        signOutOnDisconnect: e,
                        requestedConnectorId: t ? .id,
                        disconnectingConnectorIds: r.map(e => e.connector.id)
                    }), await m({
                        signOutOnDisconnect: e,
                        connectors: r.map(e => e.connector)
                    });
                    let n = (0, s.createWalletCache)();
                    e ? (n.state.clear(), n.wallets.clear(), a.logger.info("[useDisconnect > onMutate] Cleared wallet cache for signout disconnect", {
                        requestedConnectorId: t ? .id
                    })) : a.logger.info("[useDisconnect > onMutate] Preserving wallet cache for non-signout disconnect", {
                        requestedConnectorId: t ? .id,
                        hasCachedState: n.state.exists
                    }), await l.cancelQueries({
                        predicate: e => e.queryKey[0] === S.QueryKey.Account || e.queryKey[0] === S.QueryKey.Notifications || e.queryKey[0] === S.QueryKey.Deposit
                    }), g(), v(), M(), x()
                },
                onError(e) {
                    a.logger.error("[useDisconnect > onError]", {
                        error: e
                    })
                },
                ...e,
                ...i
            });
        return {
            disconnect: (e = {}) => {
                let {
                    signOutOnDisconnect: t = !0,
                    mutation: r
                } = e;
                return P({
                    signOutOnDisconnect: t
                }, r)
            },
            disconnectAsync: async (e = {}) => {
                let {
                    signOutOnDisconnect: t = !0,
                    mutation: r
                } = e;
                return D({
                    signOutOnDisconnect: t
                }, r)
            },
            connectors: c.map(e => e.connector),
            ...j
        }
    }

    function M() {
        let e, r, n, a, i, c = (0, t.c)(18),
            {
                setRoute: u,
                setConnector: f,
                setAuthenticationStatus: m,
                setConnectorStatus: y
            } = (0, o.useSiwxContext)(),
            {
                signIn: w,
                authenticatedUser: _
            } = (0, h.useAuthenticationContext)(),
            {
                emitConnectAnalytics: C
            } = (0, x.useWalletAnalytics)(),
            {
                disconnect: E
            } = N(),
            {
                updateLastConnectorId: S
            } = (0, g.useLastConnector)();
        c[0] !== _ || c[1] !== E || c[2] !== C || c[3] !== m || c[4] !== f || c[5] !== y || c[6] !== u || c[7] !== w || c[8] !== S ? (e = {
            mutationFn: async e => {
                let {
                    address: t,
                    chainId: r,
                    connector: n,
                    isReconnected: a
                } = e, i = (0, s.createWalletCache)();
                if (a && !i.state.exists && (0, l.isMagicConnector)(n.id)) {
                    (0, d.setLogoutTrigger)({
                        reason: "session_invalidated",
                        initiator: "system",
                        trigger: "on_connect_reconnect_missing_auth_cache"
                    }), E();
                    return
                }
                if (C({
                        address: t,
                        connector: n
                    }), !a) {
                    let e = n.id;
                    (0, l.isWalletConnectConnector)(n.id) && (f(t => {
                        let r;
                        return (0, l.isWalletConnectConnector)(t.id) || (e = (r = {
                            id: t.id,
                            name: t.name
                        }).id), {
                            id: n.id,
                            name: n.name,
                            coercedConnector: r
                        }
                    }), u(p.AuthRoute.CONNECT)), S(e)
                }
                if (i.state.oauthRedirected || !a) {
                    f({
                        id: n.id,
                        name: n.name
                    });
                    let e = _ ? .address.toLowerCase() === t.toLowerCase() ? _ : void 0;
                    w({
                        account: t,
                        connector: n,
                        chainId: r,
                        authenticatedUser: e
                    }), a || (0, v.trackEvent)("wallet_connected")
                }
                y(p.ConnectorStates.CONNECTED), a && !i.state.oauthRedirected && m(p.AuthenticationStatusStates.SUCCESS)
            }
        }, c[0] = _, c[1] = E, c[2] = C, c[3] = m, c[4] = f, c[5] = y, c[6] = u, c[7] = w, c[8] = S, c[9] = e) : e = c[9];
        let A = (0, b.useMutation)(e);
        return c[10] !== A ? ({
            mutate: r,
            mutateAsync: n,
            ...a
        } = A, c[10] = A, c[11] = r, c[12] = n, c[13] = a) : (r = c[11], n = c[12], a = c[13]), c[14] !== r || c[15] !== n || c[16] !== a ? (i = {
            onConnect: r,
            onConnectAsync: n,
            ...a
        }, c[14] = r, c[15] = n, c[16] = a, c[17] = i) : i = c[17], i
    }
    let P = e => {
        let r, n, i, b, v, x, w, _, C, E, S, A, I, T, k, O, R, N, P = (0, t.c)(48);
        P[0] !== e ? (r = void 0 === e ? {} : e, P[0] = e, P[1] = r) : r = P[1], P[2] !== r ? ({
            mutation: n,
            reconnectOnAlreadyConnected: b,
            ...i
        } = r, P[2] = r, P[3] = n, P[4] = i, P[5] = b) : (n = P[3], i = P[4], b = P[5]);
        let D = void 0 === b || b,
            {
                options: j,
                setConnectorStatus: L,
                setRoute: F
            } = (0, o.useSiwxContext)(),
            {
                authenticatedUser: U,
                signOut: $,
                signIn: z
            } = (0, h.useAuthenticationContext)(),
            {
                updateLastConnectorId: B
            } = (0, g.useLastConnector)(),
            {
                onConnect: q
            } = M();
        P[6] !== z ? (v = e => {
            if (e.length) {
                let t = e[0];
                z({
                    account: t.accounts[0],
                    connector: t.connector,
                    chainId: t.chainId
                })
            }
        }, P[6] = z, P[7] = v) : v = P[7], P[8] !== U || P[9] !== L || P[10] !== $ ? (x = (e, t) => {
            if ((0, f.isUserRejection)(e)) return void L(p.ConnectorStates.REJECTED);
            if (!U) return;
            let r = t ? .connectors ? .[0] ? t.connectors[0].id : void 0,
                n = (0, s.createWalletCache)().state.value ? .connectorId,
                i = (0, y.getLogoutGuardDecision)({
                    authenticatedUserType: U.type,
                    cacheConnectorId: n,
                    connectorIds: [r]
                }),
                o = "magic_non_magic_connector" === i.reason ? "magic_non_magic_reconnect" : i.reason;
            i.shouldLogout ? ((0, d.setLogoutTrigger)({
                reason: "reconnect_error",
                initiator: "system",
                trigger: "connect_reconnect_error"
            }), $()) : a.logger.info("[useConnect > reconnect] Skipping signOut for reconnect guard", {
                authType: U.type,
                attemptedConnectorId: r,
                cacheConnectorId: i.cacheConnectorId,
                skipReason: o
            })
        }, P[8] = U, P[9] = L, P[10] = $, P[11] = x) : x = P[11], P[12] !== v || P[13] !== x ? (w = {
            mutation: {
                onSuccess: v,
                onError: x
            }
        }, P[12] = v, P[13] = x, P[14] = w) : w = P[14];
        let {
            mutate: W
        } = (0, c.useReconnect)(w);
        P[15] !== W || P[16] !== D || P[17] !== L || P[18] !== F ? (_ = (e, t) => {
            if (D && "ConnectorAlreadyConnectedError" === e.name) return void W({
                connectors: [t.connector]
            });
            let r = (0, s.createWalletCache)();
            if ((0, l.isMagicConnector)(t.connector.id)) {
                if (-10005 === e.code) {
                    F(p.AuthRoute.CONNECTORS), L(p.ConnectorStates.DISCONNECTED), r.state.clear(), r.wallets.clear();
                    return
                }
                if (-32603 === e.code || 4001 === e.code) {
                    r.state.update({
                        connectionState: "requesting"
                    }), L(p.ConnectorStates.REJECTED);
                    return
                }
                if (r.state.getMagicState({
                        connectionStates: ["redirect"]
                    })) return;
                (0, m.logAuthFlowError)({
                    authStatus: "error",
                    connectorId: t.connector.id,
                    error: e,
                    trigger: "connect"
                })
            }(0, f.isUserRejection)(e) ? L(p.ConnectorStates.REJECTED): (L(p.ConnectorStates.FAILED), a.logger.error("[useConnect > onError]", {
                error: e
            }))
        }, P[15] = W, P[16] = D, P[17] = L, P[18] = F, P[19] = _) : _ = P[19], P[20] !== q || P[21] !== L || P[22] !== B ? (C = (e, t) => {
            B(t.connector.id), L(p.ConnectorStates.CONNECTED), q({
                address: e.accounts[0],
                connector: t.connector,
                chainId: e.chainId,
                isReconnected: !1
            })
        }, P[20] = q, P[21] = L, P[22] = B, P[23] = C) : C = P[23], P[24] !== L ? (E = e => {
            let t = e.connector;
            (0, l.isWalletConnectConnector)(t.id) || (e.connector ? L(p.ConnectorStates.CONNECTING) : L(p.ConnectorStates.UNAVAILABLE))
        }, P[24] = L, P[25] = E) : E = P[25], P[26] !== n || P[27] !== _ || P[28] !== C || P[29] !== E ? (S = {
            onError: _,
            onSuccess: C,
            onMutate: E,
            ...n
        }, P[26] = n, P[27] = _, P[28] = C, P[29] = E, P[30] = S) : S = P[30], P[31] !== i || P[32] !== S ? (A = {
            mutation: S,
            ...i
        }, P[31] = i, P[32] = S, P[33] = A) : A = P[33];
        let Z = (0, u.useConnect)(A);
        if (P[34] !== Z) {
            let {
                mutate: e,
                mutateAsync: t,
                connect: r,
                connectAsync: n,
                connectors: a,
                ...i
            } = Z;
            I = e, T = t, k = i, P[34] = Z, P[35] = I, P[36] = T, P[37] = k
        } else I = P[35], T = P[36], k = P[37];
        return P[38] !== I || P[39] !== j ? .initialChainId ? (O = e => {
            let {
                connector: t,
                chainId: r,
                mutation: n
            } = e;
            return I({
                connector: t,
                chainId: r ? ? j ? .initialChainId
            }, n)
        }, P[38] = I, P[39] = j ? .initialChainId, P[40] = O) : O = P[40], P[41] !== T || P[42] !== j ? .initialChainId ? (R = async e => {
            let {
                connector: t,
                chainId: r,
                mutation: n
            } = e;
            return T({
                connector: t,
                chainId: r ? ? j ? .initialChainId
            }, n)
        }, P[41] = T, P[42] = j ? .initialChainId, P[43] = R) : R = P[43], P[44] !== k || P[45] !== O || P[46] !== R ? (N = {
            connect: O,
            connectAsync: R,
            ...k
        }, P[44] = k, P[45] = O, P[46] = R, P[47] = N) : N = P[47], N
    };
    var D = e.i(531299);
    let j = () => {
            let e, r = (0, t.c)(2),
                n = (0, D.useConnectors)();
            return r[0] !== n ? (e = n ? ? [], r[0] = n, r[1] = e) : e = r[1], e
        },
        L = () => ((e, r) => {
            let n, a = (0, t.c)(17),
                i = j();
            if ("injected" === e && r) {
                let t;
                if (a[0] !== i || a[1] !== e || a[2] !== r) {
                    let n;
                    a[4] !== e || a[5] !== r ? (n = t => t.id === e && t.name === r, a[4] = e, a[5] = r, a[6] = n) : n = a[6], t = i.find(n), a[0] = i, a[1] = e, a[2] = r, a[3] = t
                } else t = a[3];
                return t
            }
            if ("injected" === e) {
                let t;
                if (a[7] !== i || a[8] !== e) {
                    let r;
                    a[10] !== e ? (r = t => t.id === e && t.name.includes("Injected"), a[10] = e, a[11] = r) : r = a[11], t = i.find(r), a[7] = i, a[8] = e, a[9] = t
                } else t = a[9];
                return t
            }
            if (a[12] !== i || a[13] !== e) {
                let t;
                a[15] !== e ? (t = t => t.id === e, a[15] = e, a[16] = t) : t = a[16], n = i.find(t), a[12] = i, a[13] = e, a[14] = n
            } else n = a[14];
            return n
        })("walletConnect");

    function F(e) {
        let s, l, c, u, d = (0, t.c)(12);
        d[0] !== e ? (s = e ? ? {}, d[0] = e, d[1] = s) : s = d[1];
        let {
            enabled: f
        } = s, p = void 0 === f || f, [h, m] = r.default.useState(void 0), y = r.default.useRef(void 0), g = L(), {
            status: b
        } = (0, n.useConnection)(), v = "disconnected" === b, x = "connected" === b, {
            connectAsync: w
        } = P(), {
            options: _
        } = (0, o.useSiwxContext)();
        return d[2] !== w || d[3] !== p || d[4] !== x || d[5] !== v || d[6] !== _.initialChainId || d[7] !== g ? (l = () => {
            if (!p) return;
            let e = async function(e) {
                    let {
                        type: t,
                        data: r
                    } = e;
                    a.logger.debug("[useWalletConnectUri > WC Message]", {
                        type: t,
                        data: r
                    }), "display_uri" === t && (m(r), y.current = r)
                },
                t = async function(e) {
                    a.logger.debug("[useWalletConnectUri > connectWallet]");
                    let t = await w({
                        connector: e,
                        chainId: _.initialChainId ? ? i.MATIC_CONFIG.chainId
                    });
                    return !!t && t
                },
                r = function() {
                    a.logger.info("[useWalletConnectUri > handleDisconnect] WalletConnect disconnected", {
                        connectorId: g ? .id,
                        isConnected: x,
                        isDisconnected: v,
                        hadUri: !!y.current,
                        autoReconnect: !1
                    }), m(void 0), y.current = void 0
                };
            async function n(e) {
                a.logger.debug("[useWalletConnectUri > connectWalletConnect]");
                try {
                    await t(e)
                } catch (t) {
                    a.logger.error("[useWalletConnectUri > connectWalletConnect]", {
                        error: t
                    }), t.code && 4001 === t.code && n(e)
                }
            }
            if (x) {
                m(void 0), y.current = void 0;
                return
            }
            if (g) return v && !y.current && (a.logger.info("[useWalletConnectUri > connectWalletConnect] Starting URI generation", {
                connectorId: g.id,
                isConnected: x,
                isDisconnected: v
            }), n(g)), a.logger.debug("[useWalletConnectUri > add wc listeners]"), g.emitter.on("message", e), g.emitter.on("disconnect", r), () => {
                a.logger.debug("[useWalletConnectUri > remove wc listeners]"), g.emitter.off("message", e), g.emitter.off("disconnect", r)
            }
        }, c = [p, g, v, x, w, _.initialChainId], d[2] = w, d[3] = p, d[4] = x, d[5] = v, d[6] = _.initialChainId, d[7] = g, d[8] = l, d[9] = c) : (l = d[8], c = d[9]), r.default.useEffect(l, c), d[10] !== h ? (u = {
            uri: h
        }, d[10] = h, d[11] = u) : u = d[11], u
    }
    e.s(["useConnectors", 0, j, "useWalletConnectConnector", 0, L], 155963), e.s(["useLongPendingOauth", () => U], 290725);
    let U = () => {
        let {
            setConnectorStatus: e,
            magicOauthRedirectTimeout: t,
            magicOauthPendingTimeout: n,
            setAuthenticationStatus: i
        } = (0, o.useSiwxContext)(), {
            disconnect: l
        } = N(), c = r.default.useCallback((t, r) => {
            try {
                a.logger.error(`[useLongPendingOauth > handleResetConnectionStates] Magic oauth ${t} timeout`, {
                    address: r
                }), (0, d.setLogoutTrigger)({
                    reason: "magic_oauth_timeout",
                    initiator: "system",
                    trigger: `magic_oauth_${t}_timeout`
                }), e(p.ConnectorStates.DISCONNECTED), i(p.AuthenticationStatusStates.IDLE), l ? .()
            } catch (e) {
                a.logger.error(`[useLongPendingOauth > handleResetConnectionStates] error disconnecting after Magic oauth ${t} timeout`, {
                    e
                })
            }
        }, [e, l, i]);
        r.default.useEffect(() => {
            let e = (0, s.createWalletCache)();
            return e.state.oauthReconnecting && (t.current = setTimeout(() => {
                let t = e.state.getMagicState({
                    type: "oauth",
                    connectionStates: ["redirect"]
                });
                t && c("redirect", t.address)
            }, 3e4), n.current = setTimeout(() => {
                let t = e.state.getMagicState({
                    type: "oauth",
                    connectionStates: ["after-redirect-result", "pending"]
                });
                t && c("pending", t.address)
            }, 4e4)), () => {
                t.current && clearTimeout(t.current), n.current && clearTimeout(n.current)
            }
        }, [])
    }
}, 328113, e => {
    "use strict";
    var t = e.i(262614);
    e.s(["useLatest", () => t.default])
}, 563478, (e, t, r) => {
    var n;
    e.e, t.exports = n = n || function(t, r) {
        if ("u" > typeof window && window.crypto && (n = window.crypto), "u" > typeof self && self.crypto && (n = self.crypto), "u" > typeof globalThis && globalThis.crypto && (n = globalThis.crypto), !n && "u" > typeof window && window.msCrypto && (n = window.msCrypto), !n && e.g.crypto && (n = e.g.crypto), !n) try {
            n = {}
        } catch (e) {}
        var n, a = function() {
                if (n) {
                    if ("function" == typeof n.getRandomValues) try {
                        return n.getRandomValues(new Uint32Array(1))[0]
                    } catch (e) {}
                    if ("function" == typeof n.randomBytes) try {
                        return n.randomBytes(4).readInt32LE()
                    } catch (e) {}
                }
                throw Error("Native crypto module could not be used to get secure random number.")
            },
            i = Object.create || function() {
                function e() {}
                return function(t) {
                    var r;
                    return e.prototype = t, r = new e, e.prototype = null, r
                }
            }(),
            o = {},
            s = o.lib = {},
            l = s.Base = {
                extend: function(e) {
                    var t = i(this);
                    return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function() {
                        t.$super.init.apply(this, arguments)
                    }), t.init.prototype = t, t.$super = this, t
                },
                create: function() {
                    var e = this.extend();
                    return e.init.apply(e, arguments), e
                },
                init: function() {},
                mixIn: function(e) {
                    for (var t in e) e.hasOwnProperty(t) && (this[t] = e[t]);
                    e.hasOwnProperty("toString") && (this.toString = e.toString)
                },
                clone: function() {
                    return this.init.prototype.extend(this)
                }
            },
            c = s.WordArray = l.extend({
                init: function(e, t) {
                    e = this.words = e || [], r != t ? this.sigBytes = t : this.sigBytes = 4 * e.length
                },
                toString: function(e) {
                    return (e || d).stringify(this)
                },
                concat: function(e) {
                    var t = this.words,
                        r = e.words,
                        n = this.sigBytes,
                        a = e.sigBytes;
                    if (this.clamp(), n % 4)
                        for (var i = 0; i < a; i++) {
                            var o = r[i >>> 2] >>> 24 - i % 4 * 8 & 255;
                            t[n + i >>> 2] |= o << 24 - (n + i) % 4 * 8
                        } else
                            for (var s = 0; s < a; s += 4) t[n + s >>> 2] = r[s >>> 2];
                    return this.sigBytes += a, this
                },
                clamp: function() {
                    var e = this.words,
                        r = this.sigBytes;
                    e[r >>> 2] &= 0xffffffff << 32 - r % 4 * 8, e.length = t.ceil(r / 4)
                },
                clone: function() {
                    var e = l.clone.call(this);
                    return e.words = this.words.slice(0), e
                },
                random: function(e) {
                    for (var t = [], r = 0; r < e; r += 4) t.push(a());
                    return new c.init(t, e)
                }
            }),
            u = o.enc = {},
            d = u.Hex = {
                stringify: function(e) {
                    for (var t = e.words, r = e.sigBytes, n = [], a = 0; a < r; a++) {
                        var i = t[a >>> 2] >>> 24 - a % 4 * 8 & 255;
                        n.push((i >>> 4).toString(16)), n.push((15 & i).toString(16))
                    }
                    return n.join("")
                },
                parse: function(e) {
                    for (var t = e.length, r = [], n = 0; n < t; n += 2) r[n >>> 3] |= parseInt(e.substr(n, 2), 16) << 24 - n % 8 * 4;
                    return new c.init(r, t / 2)
                }
            },
            f = u.Latin1 = {
                stringify: function(e) {
                    for (var t = e.words, r = e.sigBytes, n = [], a = 0; a < r; a++) {
                        var i = t[a >>> 2] >>> 24 - a % 4 * 8 & 255;
                        n.push(String.fromCharCode(i))
                    }
                    return n.join("")
                },
                parse: function(e) {
                    for (var t = e.length, r = [], n = 0; n < t; n++) r[n >>> 2] |= (255 & e.charCodeAt(n)) << 24 - n % 4 * 8;
                    return new c.init(r, t)
                }
            },
            p = u.Utf8 = {
                stringify: function(e) {
                    try {
                        return decodeURIComponent(escape(f.stringify(e)))
                    } catch (e) {
                        throw Error("Malformed UTF-8 data")
                    }
                },
                parse: function(e) {
                    return f.parse(unescape(encodeURIComponent(e)))
                }
            },
            h = s.BufferedBlockAlgorithm = l.extend({
                reset: function() {
                    this._data = new c.init, this._nDataBytes = 0
                },
                _append: function(e) {
                    "string" == typeof e && (e = p.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes
                },
                _process: function(e) {
                    var r, n = this._data,
                        a = n.words,
                        i = n.sigBytes,
                        o = this.blockSize,
                        s = i / (4 * o),
                        l = (s = e ? t.ceil(s) : t.max((0 | s) - this._minBufferSize, 0)) * o,
                        u = t.min(4 * l, i);
                    if (l) {
                        for (var d = 0; d < l; d += o) this._doProcessBlock(a, d);
                        r = a.splice(0, l), n.sigBytes -= u
                    }
                    return new c.init(r, u)
                },
                clone: function() {
                    var e = l.clone.call(this);
                    return e._data = this._data.clone(), e
                },
                _minBufferSize: 0
            });
        s.Hasher = h.extend({
            cfg: l.extend(),
            init: function(e) {
                this.cfg = this.cfg.extend(e), this.reset()
            },
            reset: function() {
                h.reset.call(this), this._doReset()
            },
            update: function(e) {
                return this._append(e), this._process(), this
            },
            finalize: function(e) {
                return e && this._append(e), this._doFinalize()
            },
            blockSize: 16,
            _createHelper: function(e) {
                return function(t, r) {
                    return new e.init(r).finalize(t)
                }
            },
            _createHmacHelper: function(e) {
                return function(t, r) {
                    return new m.HMAC.init(e, r).finalize(t)
                }
            }
        });
        var m = o.algo = {};
        return o
    }(Math)
}, 601601, (e, t, r) => {
    var n, a, i, o, s;
    e.e, i = (a = (n = e.r(563478)).lib).Base, o = a.WordArray, (s = n.x64 = {}).Word = i.extend({
        init: function(e, t) {
            this.high = e, this.low = t
        }
    }), s.WordArray = i.extend({
        init: function(e, t) {
            e = this.words = e || [], void 0 != t ? this.sigBytes = t : this.sigBytes = 8 * e.length
        },
        toX32: function() {
            for (var e = this.words, t = e.length, r = [], n = 0; n < t; n++) {
                var a = e[n];
                r.push(a.high), r.push(a.low)
            }
            return o.create(r, this.sigBytes)
        },
        clone: function() {
            for (var e = i.clone.call(this), t = e.words = this.words.slice(0), r = t.length, n = 0; n < r; n++) t[n] = t[n].clone();
            return e
        }
    }), t.exports = n
}, 666327, (e, t, r) => {
    e.e, t.exports = function(e) {
        if ("function" == typeof ArrayBuffer) {
            var t = e.lib.WordArray,
                r = t.init;
            (t.init = function(e) {
                if (e instanceof ArrayBuffer && (e = new Uint8Array(e)), (e instanceof Int8Array || "u" > typeof Uint8ClampedArray && e instanceof Uint8ClampedArray || e instanceof Int16Array || e instanceof Uint16Array || e instanceof Int32Array || e instanceof Uint32Array || e instanceof Float32Array || e instanceof Float64Array) && (e = new Uint8Array(e.buffer, e.byteOffset, e.byteLength)), e instanceof Uint8Array) {
                    for (var t = e.byteLength, n = [], a = 0; a < t; a++) n[a >>> 2] |= e[a] << 24 - a % 4 * 8;
                    r.call(this, n, t)
                } else r.apply(this, arguments)
            }).prototype = t
        }
        return e.lib.WordArray
    }(e.r(563478))
}, 160654, (e, t, r) => {
    e.e, t.exports = function(e) {
        var t = e.lib.WordArray,
            r = e.enc;

        function n(e) {
            return e << 8 & 0xff00ff00 | e >>> 8 & 0xff00ff
        }
        return r.Utf16 = r.Utf16BE = {
            stringify: function(e) {
                for (var t = e.words, r = e.sigBytes, n = [], a = 0; a < r; a += 2) {
                    var i = t[a >>> 2] >>> 16 - a % 4 * 8 & 65535;
                    n.push(String.fromCharCode(i))
                }
                return n.join("")
            },
            parse: function(e) {
                for (var r = e.length, n = [], a = 0; a < r; a++) n[a >>> 1] |= e.charCodeAt(a) << 16 - a % 2 * 16;
                return t.create(n, 2 * r)
            }
        }, r.Utf16LE = {
            stringify: function(e) {
                for (var t = e.words, r = e.sigBytes, a = [], i = 0; i < r; i += 2) {
                    var o = n(t[i >>> 2] >>> 16 - i % 4 * 8 & 65535);
                    a.push(String.fromCharCode(o))
                }
                return a.join("")
            },
            parse: function(e) {
                for (var r = e.length, a = [], i = 0; i < r; i++) a[i >>> 1] |= n(e.charCodeAt(i) << 16 - i % 2 * 16);
                return t.create(a, 2 * r)
            }
        }, e.enc.Utf16
    }(e.r(563478))
}, 499512, (e, t, r) => {
    var n, a;
    e.e, a = (n = e.r(563478)).lib.WordArray, n.enc.Base64 = {
        stringify: function(e) {
            var t = e.words,
                r = e.sigBytes,
                n = this._map;
            e.clamp();
            for (var a = [], i = 0; i < r; i += 3)
                for (var o = (t[i >>> 2] >>> 24 - i % 4 * 8 & 255) << 16 | (t[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 255) << 8 | t[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 255, s = 0; s < 4 && i + .75 * s < r; s++) a.push(n.charAt(o >>> 6 * (3 - s) & 63));
            var l = n.charAt(64);
            if (l)
                for (; a.length % 4;) a.push(l);
            return a.join("")
        },
        parse: function(e) {
            var t = e.length,
                r = this._map,
                n = this._reverseMap;
            if (!n) {
                n = this._reverseMap = [];
                for (var i = 0; i < r.length; i++) n[r.charCodeAt(i)] = i
            }
            var o = r.charAt(64);
            if (o) {
                var s = e.indexOf(o); - 1 !== s && (t = s)
            }
            for (var l = e, c = t, u = n, d = [], f = 0, p = 0; p < c; p++)
                if (p % 4) {
                    var h = u[l.charCodeAt(p - 1)] << p % 4 * 2 | u[l.charCodeAt(p)] >>> 6 - p % 4 * 2;
                    d[f >>> 2] |= h << 24 - f % 4 * 8, f++
                }
            return a.create(d, f)
        },
        _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
    }, t.exports = n.enc.Base64
}, 238434, (e, t, r) => {
    var n, a;
    e.e, a = (n = e.r(563478)).lib.WordArray, n.enc.Base64url = {
        stringify: function(e, t) {
            void 0 === t && (t = !0);
            var r = e.words,
                n = e.sigBytes,
                a = t ? this._safe_map : this._map;
            e.clamp();
            for (var i = [], o = 0; o < n; o += 3)
                for (var s = (r[o >>> 2] >>> 24 - o % 4 * 8 & 255) << 16 | (r[o + 1 >>> 2] >>> 24 - (o + 1) % 4 * 8 & 255) << 8 | r[o + 2 >>> 2] >>> 24 - (o + 2) % 4 * 8 & 255, l = 0; l < 4 && o + .75 * l < n; l++) i.push(a.charAt(s >>> 6 * (3 - l) & 63));
            var c = a.charAt(64);
            if (c)
                for (; i.length % 4;) i.push(c);
            return i.join("")
        },
        parse: function(e, t) {
            void 0 === t && (t = !0);
            var r = e.length,
                n = t ? this._safe_map : this._map,
                i = this._reverseMap;
            if (!i) {
                i = this._reverseMap = [];
                for (var o = 0; o < n.length; o++) i[n.charCodeAt(o)] = o
            }
            var s = n.charAt(64);
            if (s) {
                var l = e.indexOf(s); - 1 !== l && (r = l)
            }
            for (var c = e, u = r, d = i, f = [], p = 0, h = 0; h < u; h++)
                if (h % 4) {
                    var m = d[c.charCodeAt(h - 1)] << h % 4 * 2 | d[c.charCodeAt(h)] >>> 6 - h % 4 * 2;
                    f[p >>> 2] |= m << 24 - p % 4 * 8, p++
                }
            return a.create(f, p)
        },
        _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
        _safe_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
    }, t.exports = n.enc.Base64url
}, 506626, (e, t, r) => {
    var n;
    e.e, n = e.r(563478),
        function(e) {
            for (var t = n.lib, r = t.WordArray, a = t.Hasher, i = n.algo, o = [], s = 0; s < 64; s++) o[s] = 0x100000000 * e.abs(e.sin(s + 1)) | 0;
            var l = i.MD5 = a.extend({
                _doReset: function() {
                    this._hash = new r.init([0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476])
                },
                _doProcessBlock: function(e, t) {
                    for (var r = 0; r < 16; r++) {
                        var n = t + r,
                            a = e[n];
                        e[n] = (a << 8 | a >>> 24) & 0xff00ff | (a << 24 | a >>> 8) & 0xff00ff00
                    }
                    var i = this._hash.words,
                        s = e[t + 0],
                        l = e[t + 1],
                        p = e[t + 2],
                        h = e[t + 3],
                        m = e[t + 4],
                        y = e[t + 5],
                        g = e[t + 6],
                        b = e[t + 7],
                        v = e[t + 8],
                        x = e[t + 9],
                        w = e[t + 10],
                        _ = e[t + 11],
                        C = e[t + 12],
                        E = e[t + 13],
                        S = e[t + 14],
                        A = e[t + 15],
                        I = i[0],
                        T = i[1],
                        k = i[2],
                        O = i[3];
                    I = c(I, T, k, O, s, 7, o[0]), O = c(O, I, T, k, l, 12, o[1]), k = c(k, O, I, T, p, 17, o[2]), T = c(T, k, O, I, h, 22, o[3]), I = c(I, T, k, O, m, 7, o[4]), O = c(O, I, T, k, y, 12, o[5]), k = c(k, O, I, T, g, 17, o[6]), T = c(T, k, O, I, b, 22, o[7]), I = c(I, T, k, O, v, 7, o[8]), O = c(O, I, T, k, x, 12, o[9]), k = c(k, O, I, T, w, 17, o[10]), T = c(T, k, O, I, _, 22, o[11]), I = c(I, T, k, O, C, 7, o[12]), O = c(O, I, T, k, E, 12, o[13]), k = c(k, O, I, T, S, 17, o[14]), T = c(T, k, O, I, A, 22, o[15]), I = u(I, T, k, O, l, 5, o[16]), O = u(O, I, T, k, g, 9, o[17]), k = u(k, O, I, T, _, 14, o[18]), T = u(T, k, O, I, s, 20, o[19]), I = u(I, T, k, O, y, 5, o[20]), O = u(O, I, T, k, w, 9, o[21]), k = u(k, O, I, T, A, 14, o[22]), T = u(T, k, O, I, m, 20, o[23]), I = u(I, T, k, O, x, 5, o[24]), O = u(O, I, T, k, S, 9, o[25]), k = u(k, O, I, T, h, 14, o[26]), T = u(T, k, O, I, v, 20, o[27]), I = u(I, T, k, O, E, 5, o[28]), O = u(O, I, T, k, p, 9, o[29]), k = u(k, O, I, T, b, 14, o[30]), T = u(T, k, O, I, C, 20, o[31]), I = d(I, T, k, O, y, 4, o[32]), O = d(O, I, T, k, v, 11, o[33]), k = d(k, O, I, T, _, 16, o[34]), T = d(T, k, O, I, S, 23, o[35]), I = d(I, T, k, O, l, 4, o[36]), O = d(O, I, T, k, m, 11, o[37]), k = d(k, O, I, T, b, 16, o[38]), T = d(T, k, O, I, w, 23, o[39]), I = d(I, T, k, O, E, 4, o[40]), O = d(O, I, T, k, s, 11, o[41]), k = d(k, O, I, T, h, 16, o[42]), T = d(T, k, O, I, g, 23, o[43]), I = d(I, T, k, O, x, 4, o[44]), O = d(O, I, T, k, C, 11, o[45]), k = d(k, O, I, T, A, 16, o[46]), T = d(T, k, O, I, p, 23, o[47]), I = f(I, T, k, O, s, 6, o[48]), O = f(O, I, T, k, b, 10, o[49]), k = f(k, O, I, T, S, 15, o[50]), T = f(T, k, O, I, y, 21, o[51]), I = f(I, T, k, O, C, 6, o[52]), O = f(O, I, T, k, h, 10, o[53]), k = f(k, O, I, T, w, 15, o[54]), T = f(T, k, O, I, l, 21, o[55]), I = f(I, T, k, O, v, 6, o[56]), O = f(O, I, T, k, A, 10, o[57]), k = f(k, O, I, T, g, 15, o[58]), T = f(T, k, O, I, E, 21, o[59]), I = f(I, T, k, O, m, 6, o[60]), O = f(O, I, T, k, _, 10, o[61]), k = f(k, O, I, T, p, 15, o[62]), T = f(T, k, O, I, x, 21, o[63]), i[0] = i[0] + I | 0, i[1] = i[1] + T | 0, i[2] = i[2] + k | 0, i[3] = i[3] + O | 0
                },
                _doFinalize: function() {
                    var t = this._data,
                        r = t.words,
                        n = 8 * this._nDataBytes,
                        a = 8 * t.sigBytes;
                    r[a >>> 5] |= 128 << 24 - a % 32;
                    var i = e.floor(n / 0x100000000);
                    r[(a + 64 >>> 9 << 4) + 15] = (i << 8 | i >>> 24) & 0xff00ff | (i << 24 | i >>> 8) & 0xff00ff00, r[(a + 64 >>> 9 << 4) + 14] = (n << 8 | n >>> 24) & 0xff00ff | (n << 24 | n >>> 8) & 0xff00ff00, t.sigBytes = (r.length + 1) * 4, this._process();
                    for (var o = this._hash, s = o.words, l = 0; l < 4; l++) {
                        var c = s[l];
                        s[l] = (c << 8 | c >>> 24) & 0xff00ff | (c << 24 | c >>> 8) & 0xff00ff00
                    }
                    return o
                },
                clone: function() {
                    var e = a.clone.call(this);
                    return e._hash = this._hash.clone(), e
                }
            });

            function c(e, t, r, n, a, i, o) {
                var s = e + (t & r | ~t & n) + a + o;
                return (s << i | s >>> 32 - i) + t
            }

            function u(e, t, r, n, a, i, o) {
                var s = e + (t & n | r & ~n) + a + o;
                return (s << i | s >>> 32 - i) + t
            }

            function d(e, t, r, n, a, i, o) {
                var s = e + (t ^ r ^ n) + a + o;
                return (s << i | s >>> 32 - i) + t
            }

            function f(e, t, r, n, a, i, o) {
                var s = e + (r ^ (t | ~n)) + a + o;
                return (s << i | s >>> 32 - i) + t
            }
            n.MD5 = a._createHelper(l), n.HmacMD5 = a._createHmacHelper(l)
        }(Math), t.exports = n.MD5
}, 310698, (e, t, r) => {
    var n, a, i, o, s, l, c;
    e.e, i = (a = (n = e.r(563478)).lib).WordArray, o = a.Hasher, s = n.algo, l = [], c = s.SHA1 = o.extend({
        _doReset: function() {
            this._hash = new i.init([0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0])
        },
        _doProcessBlock: function(e, t) {
            for (var r = this._hash.words, n = r[0], a = r[1], i = r[2], o = r[3], s = r[4], c = 0; c < 80; c++) {
                if (c < 16) l[c] = 0 | e[t + c];
                else {
                    var u = l[c - 3] ^ l[c - 8] ^ l[c - 14] ^ l[c - 16];
                    l[c] = u << 1 | u >>> 31
                }
                var d = (n << 5 | n >>> 27) + s + l[c];
                c < 20 ? d += (a & i | ~a & o) + 0x5a827999 : c < 40 ? d += (a ^ i ^ o) + 0x6ed9eba1 : c < 60 ? d += (a & i | a & o | i & o) - 0x70e44324 : d += (a ^ i ^ o) - 0x359d3e2a, s = o, o = i, i = a << 30 | a >>> 2, a = n, n = d
            }
            r[0] = r[0] + n | 0, r[1] = r[1] + a | 0, r[2] = r[2] + i | 0, r[3] = r[3] + o | 0, r[4] = r[4] + s | 0
        },
        _doFinalize: function() {
            var e = this._data,
                t = e.words,
                r = 8 * this._nDataBytes,
                n = 8 * e.sigBytes;
            return t[n >>> 5] |= 128 << 24 - n % 32, t[(n + 64 >>> 9 << 4) + 14] = Math.floor(r / 0x100000000), t[(n + 64 >>> 9 << 4) + 15] = r, e.sigBytes = 4 * t.length, this._process(), this._hash
        },
        clone: function() {
            var e = o.clone.call(this);
            return e._hash = this._hash.clone(), e
        }
    }), n.SHA1 = o._createHelper(c), n.HmacSHA1 = o._createHmacHelper(c), t.exports = n.SHA1
}, 630377, (e, t, r) => {
    var n;
    e.e, n = e.r(563478),
        function(e) {
            var t = n.lib,
                r = t.WordArray,
                a = t.Hasher,
                i = n.algo,
                o = [],
                s = [];

            function l(e) {
                return (e - (0 | e)) * 0x100000000 | 0
            }
            for (var c = 2, u = 0; u < 64;)(function(t) {
                for (var r = e.sqrt(t), n = 2; n <= r; n++)
                    if (!(t % n)) return !1;
                return !0
            })(c) && (u < 8 && (o[u] = l(e.pow(c, .5))), s[u] = l(e.pow(c, 1 / 3)), u++), c++;
            var d = [],
                f = i.SHA256 = a.extend({
                    _doReset: function() {
                        this._hash = new r.init(o.slice(0))
                    },
                    _doProcessBlock: function(e, t) {
                        for (var r = this._hash.words, n = r[0], a = r[1], i = r[2], o = r[3], l = r[4], c = r[5], u = r[6], f = r[7], p = 0; p < 64; p++) {
                            if (p < 16) d[p] = 0 | e[t + p];
                            else {
                                var h = d[p - 15],
                                    m = (h << 25 | h >>> 7) ^ (h << 14 | h >>> 18) ^ h >>> 3,
                                    y = d[p - 2],
                                    g = (y << 15 | y >>> 17) ^ (y << 13 | y >>> 19) ^ y >>> 10;
                                d[p] = m + d[p - 7] + g + d[p - 16]
                            }
                            var b = l & c ^ ~l & u,
                                v = n & a ^ n & i ^ a & i,
                                x = (n << 30 | n >>> 2) ^ (n << 19 | n >>> 13) ^ (n << 10 | n >>> 22),
                                w = f + ((l << 26 | l >>> 6) ^ (l << 21 | l >>> 11) ^ (l << 7 | l >>> 25)) + b + s[p] + d[p],
                                _ = x + v;
                            f = u, u = c, c = l, l = o + w | 0, o = i, i = a, a = n, n = w + _ | 0
                        }
                        r[0] = r[0] + n | 0, r[1] = r[1] + a | 0, r[2] = r[2] + i | 0, r[3] = r[3] + o | 0, r[4] = r[4] + l | 0, r[5] = r[5] + c | 0, r[6] = r[6] + u | 0, r[7] = r[7] + f | 0
                    },
                    _doFinalize: function() {
                        var t = this._data,
                            r = t.words,
                            n = 8 * this._nDataBytes,
                            a = 8 * t.sigBytes;
                        return r[a >>> 5] |= 128 << 24 - a % 32, r[(a + 64 >>> 9 << 4) + 14] = e.floor(n / 0x100000000), r[(a + 64 >>> 9 << 4) + 15] = n, t.sigBytes = 4 * r.length, this._process(), this._hash
                    },
                    clone: function() {
                        var e = a.clone.call(this);
                        return e._hash = this._hash.clone(), e
                    }
                });
            n.SHA256 = a._createHelper(f), n.HmacSHA256 = a._createHmacHelper(f)
        }(Math), t.exports = n.SHA256
}, 410021, (e, t, r) => {
    var n, a, i, o, s;
    e.e, n = e.r(563478), e.r(630377), a = n.lib.WordArray, o = (i = n.algo).SHA256, s = i.SHA224 = o.extend({
        _doReset: function() {
            this._hash = new a.init([0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4])
        },
        _doFinalize: function() {
            var e = o._doFinalize.call(this);
            return e.sigBytes -= 4, e
        }
    }), n.SHA224 = o._createHelper(s), n.HmacSHA224 = o._createHmacHelper(s), t.exports = n.SHA224
}, 465836, (e, t, r) => {
    var n;
    e.e, n = e.r(563478), e.r(601601),
        function() {
            var e = n.lib.Hasher,
                t = n.x64,
                r = t.Word,
                a = t.WordArray,
                i = n.algo;

            function o() {
                return r.create.apply(r, arguments)
            }
            for (var s = [o(0x428a2f98, 0xd728ae22), o(0x71374491, 0x23ef65cd), o(0xb5c0fbcf, 0xec4d3b2f), o(0xe9b5dba5, 0x8189dbbc), o(0x3956c25b, 0xf348b538), o(0x59f111f1, 0xb605d019), o(0x923f82a4, 0xaf194f9b), o(0xab1c5ed5, 0xda6d8118), o(0xd807aa98, 0xa3030242), o(0x12835b01, 0x45706fbe), o(0x243185be, 0x4ee4b28c), o(0x550c7dc3, 0xd5ffb4e2), o(0x72be5d74, 0xf27b896f), o(0x80deb1fe, 0x3b1696b1), o(0x9bdc06a7, 0x25c71235), o(0xc19bf174, 0xcf692694), o(0xe49b69c1, 0x9ef14ad2), o(0xefbe4786, 0x384f25e3), o(0xfc19dc6, 0x8b8cd5b5), o(0x240ca1cc, 0x77ac9c65), o(0x2de92c6f, 0x592b0275), o(0x4a7484aa, 0x6ea6e483), o(0x5cb0a9dc, 0xbd41fbd4), o(0x76f988da, 0x831153b5), o(0x983e5152, 0xee66dfab), o(0xa831c66d, 0x2db43210), o(0xb00327c8, 0x98fb213f), o(0xbf597fc7, 0xbeef0ee4), o(0xc6e00bf3, 0x3da88fc2), o(0xd5a79147, 0x930aa725), o(0x6ca6351, 0xe003826f), o(0x14292967, 0xa0e6e70), o(0x27b70a85, 0x46d22ffc), o(0x2e1b2138, 0x5c26c926), o(0x4d2c6dfc, 0x5ac42aed), o(0x53380d13, 0x9d95b3df), o(0x650a7354, 0x8baf63de), o(0x766a0abb, 0x3c77b2a8), o(0x81c2c92e, 0x47edaee6), o(0x92722c85, 0x1482353b), o(0xa2bfe8a1, 0x4cf10364), o(0xa81a664b, 0xbc423001), o(0xc24b8b70, 0xd0f89791), o(0xc76c51a3, 0x654be30), o(0xd192e819, 0xd6ef5218), o(0xd6990624, 0x5565a910), o(0xf40e3585, 0x5771202a), o(0x106aa070, 0x32bbd1b8), o(0x19a4c116, 0xb8d2d0c8), o(0x1e376c08, 0x5141ab53), o(0x2748774c, 0xdf8eeb99), o(0x34b0bcb5, 0xe19b48a8), o(0x391c0cb3, 0xc5c95a63), o(0x4ed8aa4a, 0xe3418acb), o(0x5b9cca4f, 0x7763e373), o(0x682e6ff3, 0xd6b2b8a3), o(0x748f82ee, 0x5defb2fc), o(0x78a5636f, 0x43172f60), o(0x84c87814, 0xa1f0ab72), o(0x8cc70208, 0x1a6439ec), o(0x90befffa, 0x23631e28), o(0xa4506ceb, 0xde82bde9), o(0xbef9a3f7, 0xb2c67915), o(0xc67178f2, 0xe372532b), o(0xca273ece, 0xea26619c), o(0xd186b8c7, 0x21c0c207), o(0xeada7dd6, 0xcde0eb1e), o(0xf57d4f7f, 0xee6ed178), o(0x6f067aa, 0x72176fba), o(0xa637dc5, 0xa2c898a6), o(0x113f9804, 0xbef90dae), o(0x1b710b35, 0x131c471b), o(0x28db77f5, 0x23047d84), o(0x32caab7b, 0x40c72493), o(0x3c9ebe0a, 0x15c9bebc), o(0x431d67c4, 0x9c100d4c), o(0x4cc5d4be, 0xcb3e42b6), o(0x597f299c, 0xfc657e2a), o(0x5fcb6fab, 0x3ad6faec), o(0x6c44198c, 0x4a475817)], l = [], c = 0; c < 80; c++) l[c] = o();
            var u = i.SHA512 = e.extend({
                _doReset: function() {
                    this._hash = new a.init([new r.init(0x6a09e667, 0xf3bcc908), new r.init(0xbb67ae85, 0x84caa73b), new r.init(0x3c6ef372, 0xfe94f82b), new r.init(0xa54ff53a, 0x5f1d36f1), new r.init(0x510e527f, 0xade682d1), new r.init(0x9b05688c, 0x2b3e6c1f), new r.init(0x1f83d9ab, 0xfb41bd6b), new r.init(0x5be0cd19, 0x137e2179)])
                },
                _doProcessBlock: function(e, t) {
                    for (var r = this._hash.words, n = r[0], a = r[1], i = r[2], o = r[3], c = r[4], u = r[5], d = r[6], f = r[7], p = n.high, h = n.low, m = a.high, y = a.low, g = i.high, b = i.low, v = o.high, x = o.low, w = c.high, _ = c.low, C = u.high, E = u.low, S = d.high, A = d.low, I = f.high, T = f.low, k = p, O = h, R = m, N = y, M = g, P = b, D = v, j = x, L = w, F = _, U = C, $ = E, z = S, B = A, q = I, W = T, Z = 0; Z < 80; Z++) {
                        var V, K, H = l[Z];
                        if (Z < 16) K = H.high = 0 | e[t + 2 * Z], V = H.low = 0 | e[t + 2 * Z + 1];
                        else {
                            var G = l[Z - 15],
                                Q = G.high,
                                J = G.low,
                                Y = (Q >>> 1 | J << 31) ^ (Q >>> 8 | J << 24) ^ Q >>> 7,
                                X = (J >>> 1 | Q << 31) ^ (J >>> 8 | Q << 24) ^ (J >>> 7 | Q << 25),
                                ee = l[Z - 2],
                                et = ee.high,
                                er = ee.low,
                                en = (et >>> 19 | er << 13) ^ (et << 3 | er >>> 29) ^ et >>> 6,
                                ea = (er >>> 19 | et << 13) ^ (er << 3 | et >>> 29) ^ (er >>> 6 | et << 26),
                                ei = l[Z - 7],
                                eo = ei.high,
                                es = ei.low,
                                el = l[Z - 16],
                                ec = el.high,
                                eu = el.low;
                            K = Y + eo + +((V = X + es) >>> 0 < X >>> 0), V += ea, K = K + en + +(V >>> 0 < ea >>> 0), V += eu, H.high = K = K + ec + +(V >>> 0 < eu >>> 0), H.low = V
                        }
                        var ed = L & U ^ ~L & z,
                            ef = F & $ ^ ~F & B,
                            ep = k & R ^ k & M ^ R & M,
                            eh = O & N ^ O & P ^ N & P,
                            em = (k >>> 28 | O << 4) ^ (k << 30 | O >>> 2) ^ (k << 25 | O >>> 7),
                            ey = (O >>> 28 | k << 4) ^ (O << 30 | k >>> 2) ^ (O << 25 | k >>> 7),
                            eg = (L >>> 14 | F << 18) ^ (L >>> 18 | F << 14) ^ (L << 23 | F >>> 9),
                            eb = (F >>> 14 | L << 18) ^ (F >>> 18 | L << 14) ^ (F << 23 | L >>> 9),
                            ev = s[Z],
                            ex = ev.high,
                            ew = ev.low,
                            e_ = W + eb,
                            eC = q + eg + +(e_ >>> 0 < W >>> 0),
                            e_ = e_ + ef,
                            eC = eC + ed + +(e_ >>> 0 < ef >>> 0),
                            e_ = e_ + ew,
                            eC = eC + ex + +(e_ >>> 0 < ew >>> 0),
                            e_ = e_ + V,
                            eC = eC + K + +(e_ >>> 0 < V >>> 0),
                            eE = ey + eh,
                            eS = em + ep + +(eE >>> 0 < ey >>> 0);
                        q = z, W = B, z = U, B = $, U = L, $ = F, L = D + eC + +((F = j + e_ | 0) >>> 0 < j >>> 0) | 0, D = M, j = P, M = R, P = N, R = k, N = O, k = eC + eS + +((O = e_ + eE | 0) >>> 0 < e_ >>> 0) | 0
                    }
                    h = n.low = h + O, n.high = p + k + +(h >>> 0 < O >>> 0), y = a.low = y + N, a.high = m + R + +(y >>> 0 < N >>> 0), b = i.low = b + P, i.high = g + M + +(b >>> 0 < P >>> 0), x = o.low = x + j, o.high = v + D + +(x >>> 0 < j >>> 0), _ = c.low = _ + F, c.high = w + L + +(_ >>> 0 < F >>> 0), E = u.low = E + $, u.high = C + U + +(E >>> 0 < $ >>> 0), A = d.low = A + B, d.high = S + z + +(A >>> 0 < B >>> 0), T = f.low = T + W, f.high = I + q + +(T >>> 0 < W >>> 0)
                },
                _doFinalize: function() {
                    var e = this._data,
                        t = e.words,
                        r = 8 * this._nDataBytes,
                        n = 8 * e.sigBytes;
                    return t[n >>> 5] |= 128 << 24 - n % 32, t[(n + 128 >>> 10 << 5) + 30] = Math.floor(r / 0x100000000), t[(n + 128 >>> 10 << 5) + 31] = r, e.sigBytes = 4 * t.length, this._process(), this._hash.toX32()
                },
                clone: function() {
                    var t = e.clone.call(this);
                    return t._hash = this._hash.clone(), t
                },
                blockSize: 32
            });
            n.SHA512 = e._createHelper(u), n.HmacSHA512 = e._createHmacHelper(u)
        }(), t.exports = n.SHA512
}, 181270, (e, t, r) => {
    var n, a, i, o, s, l, c;
    e.e, n = e.r(563478), e.r(601601), e.r(465836), i = (a = n.x64).Word, o = a.WordArray, l = (s = n.algo).SHA512, c = s.SHA384 = l.extend({
        _doReset: function() {
            this._hash = new o.init([new i.init(0xcbbb9d5d, 0xc1059ed8), new i.init(0x629a292a, 0x367cd507), new i.init(0x9159015a, 0x3070dd17), new i.init(0x152fecd8, 0xf70e5939), new i.init(0x67332667, 0xffc00b31), new i.init(0x8eb44a87, 0x68581511), new i.init(0xdb0c2e0d, 0x64f98fa7), new i.init(0x47b5481d, 0xbefa4fa4)])
        },
        _doFinalize: function() {
            var e = l._doFinalize.call(this);
            return e.sigBytes -= 16, e
        }
    }), n.SHA384 = l._createHelper(c), n.HmacSHA384 = l._createHmacHelper(c), t.exports = n.SHA384
}, 334125, (e, t, r) => {
    var n;
    e.e, n = e.r(563478), e.r(601601),
        function(e) {
            var t = n.lib,
                r = t.WordArray,
                a = t.Hasher,
                i = n.x64.Word,
                o = n.algo,
                s = [],
                l = [],
                c = [];
            ! function() {
                for (var e = 1, t = 0, r = 0; r < 24; r++) {
                    s[e + 5 * t] = (r + 1) * (r + 2) / 2 % 64;
                    var n = t % 5,
                        a = (2 * e + 3 * t) % 5;
                    e = n, t = a
                }
                for (var e = 0; e < 5; e++)
                    for (var t = 0; t < 5; t++) l[e + 5 * t] = t + (2 * e + 3 * t) % 5 * 5;
                for (var o = 1, u = 0; u < 24; u++) {
                    for (var d = 0, f = 0, p = 0; p < 7; p++) {
                        if (1 & o) {
                            var h = (1 << p) - 1;
                            h < 32 ? f ^= 1 << h : d ^= 1 << h - 32
                        }
                        128 & o ? o = o << 1 ^ 113 : o <<= 1
                    }
                    c[u] = i.create(d, f)
                }
            }();
            for (var u = [], d = 0; d < 25; d++) u[d] = i.create();
            var f = o.SHA3 = a.extend({
                cfg: a.cfg.extend({
                    outputLength: 512
                }),
                _doReset: function() {
                    for (var e = this._state = [], t = 0; t < 25; t++) e[t] = new i.init;
                    this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32
                },
                _doProcessBlock: function(e, t) {
                    for (var r = this._state, n = this.blockSize / 2, a = 0; a < n; a++) {
                        var i = e[t + 2 * a],
                            o = e[t + 2 * a + 1];
                        i = (i << 8 | i >>> 24) & 0xff00ff | (i << 24 | i >>> 8) & 0xff00ff00, o = (o << 8 | o >>> 24) & 0xff00ff | (o << 24 | o >>> 8) & 0xff00ff00;
                        var d = r[a];
                        d.high ^= o, d.low ^= i
                    }
                    for (var f = 0; f < 24; f++) {
                        for (var p = 0; p < 5; p++) {
                            for (var h = 0, m = 0, y = 0; y < 5; y++) {
                                var d = r[p + 5 * y];
                                h ^= d.high, m ^= d.low
                            }
                            var g = u[p];
                            g.high = h, g.low = m
                        }
                        for (var p = 0; p < 5; p++)
                            for (var b = u[(p + 4) % 5], v = u[(p + 1) % 5], x = v.high, w = v.low, h = b.high ^ (x << 1 | w >>> 31), m = b.low ^ (w << 1 | x >>> 31), y = 0; y < 5; y++) {
                                var d = r[p + 5 * y];
                                d.high ^= h, d.low ^= m
                            }
                        for (var _ = 1; _ < 25; _++) {
                            var h, m, d = r[_],
                                C = d.high,
                                E = d.low,
                                S = s[_];
                            S < 32 ? (h = C << S | E >>> 32 - S, m = E << S | C >>> 32 - S) : (h = E << S - 32 | C >>> 64 - S, m = C << S - 32 | E >>> 64 - S);
                            var A = u[l[_]];
                            A.high = h, A.low = m
                        }
                        var I = u[0],
                            T = r[0];
                        I.high = T.high, I.low = T.low;
                        for (var p = 0; p < 5; p++)
                            for (var y = 0; y < 5; y++) {
                                var _ = p + 5 * y,
                                    d = r[_],
                                    k = u[_],
                                    O = u[(p + 1) % 5 + 5 * y],
                                    R = u[(p + 2) % 5 + 5 * y];
                                d.high = k.high ^ ~O.high & R.high, d.low = k.low ^ ~O.low & R.low
                            }
                        var d = r[0],
                            N = c[f];
                        d.high ^= N.high, d.low ^= N.low
                    }
                },
                _doFinalize: function() {
                    var t = this._data,
                        n = t.words;
                    this._nDataBytes;
                    var a = 8 * t.sigBytes,
                        i = 32 * this.blockSize;
                    n[a >>> 5] |= 1 << 24 - a % 32, n[(e.ceil((a + 1) / i) * i >>> 5) - 1] |= 128, t.sigBytes = 4 * n.length, this._process();
                    for (var o = this._state, s = this.cfg.outputLength / 8, l = s / 8, c = [], u = 0; u < l; u++) {
                        var d = o[u],
                            f = d.high,
                            p = d.low;
                        f = (f << 8 | f >>> 24) & 0xff00ff | (f << 24 | f >>> 8) & 0xff00ff00, p = (p << 8 | p >>> 24) & 0xff00ff | (p << 24 | p >>> 8) & 0xff00ff00, c.push(p), c.push(f)
                    }
                    return new r.init(c, s)
                },
                clone: function() {
                    for (var e = a.clone.call(this), t = e._state = this._state.slice(0), r = 0; r < 25; r++) t[r] = t[r].clone();
                    return e
                }
            });
            n.SHA3 = a._createHelper(f), n.HmacSHA3 = a._createHmacHelper(f)
        }(Math), t.exports = n.SHA3
}, 566273, (e, t, r) => {
    var n;
    e.e, n = e.r(563478),
        function(e) {
            var t = n.lib,
                r = t.WordArray,
                a = t.Hasher,
                i = n.algo,
                o = r.create([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]),
                s = r.create([5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]),
                l = r.create([11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]),
                c = r.create([8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]),
                u = r.create([0, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e]),
                d = r.create([0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0]),
                f = i.RIPEMD160 = a.extend({
                    _doReset: function() {
                        this._hash = r.create([0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0])
                    },
                    _doProcessBlock: function(e, t) {
                        for (var r, n, a, i, f, h, m, y, g, b, v, x, w, _, C, E, S, A, I, T = 0; T < 16; T++) {
                            var k = t + T,
                                O = e[k];
                            e[k] = (O << 8 | O >>> 24) & 0xff00ff | (O << 24 | O >>> 8) & 0xff00ff00
                        }
                        var R = this._hash.words,
                            N = u.words,
                            M = d.words,
                            P = o.words,
                            D = s.words,
                            j = l.words,
                            L = c.words;
                        _ = g = R[0], C = b = R[1], E = v = R[2], S = x = R[3], A = w = R[4];
                        for (var T = 0; T < 80; T += 1) {
                            I = g + e[t + P[T]] | 0, T < 16 ? I += (b ^ v ^ x) + N[0] : T < 32 ? I += ((r = b) & v | ~r & x) + N[1] : T < 48 ? I += ((b | ~v) ^ x) + N[2] : T < 64 ? I += (n = b, a = v, (n & (i = x) | a & ~i) + N[3]) : I += (b ^ (v | ~x)) + N[4], I |= 0, I = (I = p(I, j[T])) + w | 0, g = w, w = x, x = p(v, 10), v = b, b = I, I = _ + e[t + D[T]] | 0, T < 16 ? I += (C ^ (E | ~S)) + M[0] : T < 32 ? I += (f = C, h = E, (f & (m = S) | h & ~m) + M[1]) : T < 48 ? I += ((C | ~E) ^ S) + M[2] : T < 64 ? I += ((y = C) & E | ~y & S) + M[3] : I += (C ^ E ^ S) + M[4], I |= 0, I = (I = p(I, L[T])) + A | 0, _ = A, A = S, S = p(E, 10), E = C, C = I
                        }
                        I = R[1] + v + S | 0, R[1] = R[2] + x + A | 0, R[2] = R[3] + w + _ | 0, R[3] = R[4] + g + C | 0, R[4] = R[0] + b + E | 0, R[0] = I
                    },
                    _doFinalize: function() {
                        var e = this._data,
                            t = e.words,
                            r = 8 * this._nDataBytes,
                            n = 8 * e.sigBytes;
                        t[n >>> 5] |= 128 << 24 - n % 32, t[(n + 64 >>> 9 << 4) + 14] = (r << 8 | r >>> 24) & 0xff00ff | (r << 24 | r >>> 8) & 0xff00ff00, e.sigBytes = (t.length + 1) * 4, this._process();
                        for (var a = this._hash, i = a.words, o = 0; o < 5; o++) {
                            var s = i[o];
                            i[o] = (s << 8 | s >>> 24) & 0xff00ff | (s << 24 | s >>> 8) & 0xff00ff00
                        }
                        return a
                    },
                    clone: function() {
                        var e = a.clone.call(this);
                        return e._hash = this._hash.clone(), e
                    }
                });

            function p(e, t) {
                return e << t | e >>> 32 - t
            }
            n.RIPEMD160 = a._createHelper(f), n.HmacRIPEMD160 = a._createHmacHelper(f)
        }(Math), t.exports = n.RIPEMD160
}, 278001, (e, t, r) => {
    var n, a, i;
    e.e, t.exports = void(a = (n = e.r(563478)).lib.Base, i = n.enc.Utf8, n.algo.HMAC = a.extend({
        init: function(e, t) {
            e = this._hasher = new e.init, "string" == typeof t && (t = i.parse(t));
            var r = e.blockSize,
                n = 4 * r;
            t.sigBytes > n && (t = e.finalize(t)), t.clamp();
            for (var a = this._oKey = t.clone(), o = this._iKey = t.clone(), s = a.words, l = o.words, c = 0; c < r; c++) s[c] ^= 0x5c5c5c5c, l[c] ^= 0x36363636;
            a.sigBytes = o.sigBytes = n, this.reset()
        },
        reset: function() {
            var e = this._hasher;
            e.reset(), e.update(this._iKey)
        },
        update: function(e) {
            return this._hasher.update(e), this
        },
        finalize: function(e) {
            var t = this._hasher,
                r = t.finalize(e);
            return t.reset(), t.finalize(this._oKey.clone().concat(r))
        }
    }))
}, 373594, (e, t, r) => {
    var n, a, i, o, s, l, c, u;
    e.e, n = e.r(563478), e.r(630377), e.r(278001), i = (a = n.lib).Base, o = a.WordArray, l = (s = n.algo).SHA256, c = s.HMAC, u = s.PBKDF2 = i.extend({
        cfg: i.extend({
            keySize: 4,
            hasher: l,
            iterations: 25e4
        }),
        init: function(e) {
            this.cfg = this.cfg.extend(e)
        },
        compute: function(e, t) {
            for (var r = this.cfg, n = c.create(r.hasher, e), a = o.create(), i = o.create([1]), s = a.words, l = i.words, u = r.keySize, d = r.iterations; s.length < u;) {
                var f = n.update(t).finalize(i);
                n.reset();
                for (var p = f.words, h = p.length, m = f, y = 1; y < d; y++) {
                    m = n.finalize(m), n.reset();
                    for (var g = m.words, b = 0; b < h; b++) p[b] ^= g[b]
                }
                a.concat(f), l[0]++
            }
            return a.sigBytes = 4 * u, a
        }
    }), n.PBKDF2 = function(e, t, r) {
        return u.create(r).compute(e, t)
    }, t.exports = n.PBKDF2
}, 903112, (e, t, r) => {
    var n, a, i, o, s, l, c;
    e.e, n = e.r(563478), e.r(310698), e.r(278001), i = (a = n.lib).Base, o = a.WordArray, l = (s = n.algo).MD5, c = s.EvpKDF = i.extend({
        cfg: i.extend({
            keySize: 4,
            hasher: l,
            iterations: 1
        }),
        init: function(e) {
            this.cfg = this.cfg.extend(e)
        },
        compute: function(e, t) {
            for (var r, n = this.cfg, a = n.hasher.create(), i = o.create(), s = i.words, l = n.keySize, c = n.iterations; s.length < l;) {
                r && a.update(r), r = a.update(e).finalize(t), a.reset();
                for (var u = 1; u < c; u++) r = a.finalize(r), a.reset();
                i.concat(r)
            }
            return i.sigBytes = 4 * l, i
        }
    }), n.EvpKDF = function(e, t, r) {
        return c.create(r).compute(e, t)
    }, t.exports = n.EvpKDF
}, 433255, (e, t, r) => {
    var n, a, i, o, s, l, c, u, d, f, p, h, m, y, g, b, v, x;
    e.e, n = e.r(563478), e.r(903112), t.exports = void(n.lib.Cipher || (i = (a = n.lib).Base, o = a.WordArray, s = a.BufferedBlockAlgorithm, (l = n.enc).Utf8, c = l.Base64, u = n.algo.EvpKDF, d = a.Cipher = s.extend({
        cfg: i.extend(),
        createEncryptor: function(e, t) {
            return this.create(this._ENC_XFORM_MODE, e, t)
        },
        createDecryptor: function(e, t) {
            return this.create(this._DEC_XFORM_MODE, e, t)
        },
        init: function(e, t, r) {
            this.cfg = this.cfg.extend(r), this._xformMode = e, this._key = t, this.reset()
        },
        reset: function() {
            s.reset.call(this), this._doReset()
        },
        process: function(e) {
            return this._append(e), this._process()
        },
        finalize: function(e) {
            return e && this._append(e), this._doFinalize()
        },
        keySize: 4,
        ivSize: 4,
        _ENC_XFORM_MODE: 1,
        _DEC_XFORM_MODE: 2,
        _createHelper: function() {
            function e(e) {
                return "string" == typeof e ? x : b
            }
            return function(t) {
                return {
                    encrypt: function(r, n, a) {
                        return e(n).encrypt(t, r, n, a)
                    },
                    decrypt: function(r, n, a) {
                        return e(n).decrypt(t, r, n, a)
                    }
                }
            }
        }()
    }), a.StreamCipher = d.extend({
        _doFinalize: function() {
            return this._process(!0)
        },
        blockSize: 1
    }), f = n.mode = {}, p = a.BlockCipherMode = i.extend({
        createEncryptor: function(e, t) {
            return this.Encryptor.create(e, t)
        },
        createDecryptor: function(e, t) {
            return this.Decryptor.create(e, t)
        },
        init: function(e, t) {
            this._cipher = e, this._iv = t
        }
    }), h = f.CBC = function() {
        var e = p.extend();

        function t(e, t, r) {
            var n, a = this._iv;
            a ? (n = a, this._iv = void 0) : n = this._prevBlock;
            for (var i = 0; i < r; i++) e[t + i] ^= n[i]
        }
        return e.Encryptor = e.extend({
            processBlock: function(e, r) {
                var n = this._cipher,
                    a = n.blockSize;
                t.call(this, e, r, a), n.encryptBlock(e, r), this._prevBlock = e.slice(r, r + a)
            }
        }), e.Decryptor = e.extend({
            processBlock: function(e, r) {
                var n = this._cipher,
                    a = n.blockSize,
                    i = e.slice(r, r + a);
                n.decryptBlock(e, r), t.call(this, e, r, a), this._prevBlock = i
            }
        }), e
    }(), m = (n.pad = {}).Pkcs7 = {
        pad: function(e, t) {
            for (var r = 4 * t, n = r - e.sigBytes % r, a = n << 24 | n << 16 | n << 8 | n, i = [], s = 0; s < n; s += 4) i.push(a);
            var l = o.create(i, n);
            e.concat(l)
        },
        unpad: function(e) {
            var t = 255 & e.words[e.sigBytes - 1 >>> 2];
            e.sigBytes -= t
        }
    }, a.BlockCipher = d.extend({
        cfg: d.cfg.extend({
            mode: h,
            padding: m
        }),
        reset: function() {
            d.reset.call(this);
            var e, t = this.cfg,
                r = t.iv,
                n = t.mode;
            this._xformMode == this._ENC_XFORM_MODE ? e = n.createEncryptor : (e = n.createDecryptor, this._minBufferSize = 1), this._mode && this._mode.__creator == e ? this._mode.init(this, r && r.words) : (this._mode = e.call(n, this, r && r.words), this._mode.__creator = e)
        },
        _doProcessBlock: function(e, t) {
            this._mode.processBlock(e, t)
        },
        _doFinalize: function() {
            var e, t = this.cfg.padding;
            return this._xformMode == this._ENC_XFORM_MODE ? (t.pad(this._data, this.blockSize), e = this._process(!0)) : (e = this._process(!0), t.unpad(e)), e
        },
        blockSize: 4
    }), y = a.CipherParams = i.extend({
        init: function(e) {
            this.mixIn(e)
        },
        toString: function(e) {
            return (e || this.formatter).stringify(this)
        }
    }), g = (n.format = {}).OpenSSL = {
        stringify: function(e) {
            var t = e.ciphertext,
                r = e.salt;
            return (r ? o.create([0x53616c74, 0x65645f5f]).concat(r).concat(t) : t).toString(c)
        },
        parse: function(e) {
            var t, r = c.parse(e),
                n = r.words;
            return 0x53616c74 == n[0] && 0x65645f5f == n[1] && (t = o.create(n.slice(2, 4)), n.splice(0, 4), r.sigBytes -= 16), y.create({
                ciphertext: r,
                salt: t
            })
        }
    }, b = a.SerializableCipher = i.extend({
        cfg: i.extend({
            format: g
        }),
        encrypt: function(e, t, r, n) {
            n = this.cfg.extend(n);
            var a = e.createEncryptor(r, n),
                i = a.finalize(t),
                o = a.cfg;
            return y.create({
                ciphertext: i,
                key: r,
                iv: o.iv,
                algorithm: e,
                mode: o.mode,
                padding: o.padding,
                blockSize: e.blockSize,
                formatter: n.format
            })
        },
        decrypt: function(e, t, r, n) {
            return n = this.cfg.extend(n), t = this._parse(t, n.format), e.createDecryptor(r, n).finalize(t.ciphertext)
        },
        _parse: function(e, t) {
            return "string" == typeof e ? t.parse(e, this) : e
        }
    }), v = (n.kdf = {}).OpenSSL = {
        execute: function(e, t, r, n, a) {
            if (n || (n = o.random(8)), a) var i = u.create({
                keySize: t + r,
                hasher: a
            }).compute(e, n);
            else var i = u.create({
                keySize: t + r
            }).compute(e, n);
            var s = o.create(i.words.slice(t), 4 * r);
            return i.sigBytes = 4 * t, y.create({
                key: i,
                iv: s,
                salt: n
            })
        }
    }, x = a.PasswordBasedCipher = b.extend({
        cfg: b.cfg.extend({
            kdf: v
        }),
        encrypt: function(e, t, r, n) {
            var a = (n = this.cfg.extend(n)).kdf.execute(r, e.keySize, e.ivSize, n.salt, n.hasher);
            n.iv = a.iv;
            var i = b.encrypt.call(this, e, t, a.key, n);
            return i.mixIn(a), i
        },
        decrypt: function(e, t, r, n) {
            n = this.cfg.extend(n), t = this._parse(t, n.format);
            var a = n.kdf.execute(r, e.keySize, e.ivSize, t.salt, n.hasher);
            return n.iv = a.iv, b.decrypt.call(this, e, t, a.key, n)
        }
    })))
}, 502358, (e, t, r) => {
    var n;
    e.e, n = e.r(563478), e.r(433255), n.mode.CFB = function() {
        var e = n.lib.BlockCipherMode.extend();

        function t(e, t, r, n) {
            var a, i = this._iv;
            i ? (a = i.slice(0), this._iv = void 0) : a = this._prevBlock, n.encryptBlock(a, 0);
            for (var o = 0; o < r; o++) e[t + o] ^= a[o]
        }
        return e.Encryptor = e.extend({
            processBlock: function(e, r) {
                var n = this._cipher,
                    a = n.blockSize;
                t.call(this, e, r, a, n), this._prevBlock = e.slice(r, r + a)
            }
        }), e.Decryptor = e.extend({
            processBlock: function(e, r) {
                var n = this._cipher,
                    a = n.blockSize,
                    i = e.slice(r, r + a);
                t.call(this, e, r, a, n), this._prevBlock = i
            }
        }), e
    }(), t.exports = n.mode.CFB
}, 413257, (e, t, r) => {
    var n, a, i;
    e.e, n = e.r(563478), e.r(433255), n.mode.CTR = (i = (a = n.lib.BlockCipherMode.extend()).Encryptor = a.extend({
        processBlock: function(e, t) {
            var r = this._cipher,
                n = r.blockSize,
                a = this._iv,
                i = this._counter;
            a && (i = this._counter = a.slice(0), this._iv = void 0);
            var o = i.slice(0);
            r.encryptBlock(o, 0), i[n - 1] = i[n - 1] + 1 | 0;
            for (var s = 0; s < n; s++) e[t + s] ^= o[s]
        }
    }), a.Decryptor = i, a), t.exports = n.mode.CTR
}, 121961, (e, t, r) => {
    var n;
    e.e, n = e.r(563478), e.r(433255), n.mode.CTRGladman = function() {
        var e = n.lib.BlockCipherMode.extend();

        function t(e) {
            if ((e >> 24 & 255) == 255) {
                var t = e >> 16 & 255,
                    r = e >> 8 & 255,
                    n = 255 & e;
                255 === t ? (t = 0, 255 === r ? (r = 0, 255 === n ? n = 0 : ++n) : ++r) : ++t, e = 0 + (t << 16) + (r << 8) + n
            } else e += 0x1000000;
            return e
        }
        var r = e.Encryptor = e.extend({
            processBlock: function(e, r) {
                var n, a = this._cipher,
                    i = a.blockSize,
                    o = this._iv,
                    s = this._counter;
                o && (s = this._counter = o.slice(0), this._iv = void 0), 0 === ((n = s)[0] = t(n[0])) && (n[1] = t(n[1]));
                var l = s.slice(0);
                a.encryptBlock(l, 0);
                for (var c = 0; c < i; c++) e[r + c] ^= l[c]
            }
        });
        return e.Decryptor = r, e
    }(), t.exports = n.mode.CTRGladman
}, 925274, (e, t, r) => {
    var n, a, i;
    e.e, n = e.r(563478), e.r(433255), n.mode.OFB = (i = (a = n.lib.BlockCipherMode.extend()).Encryptor = a.extend({
        processBlock: function(e, t) {
            var r = this._cipher,
                n = r.blockSize,
                a = this._iv,
                i = this._keystream;
            a && (i = this._keystream = a.slice(0), this._iv = void 0), r.encryptBlock(i, 0);
            for (var o = 0; o < n; o++) e[t + o] ^= i[o]
        }
    }), a.Decryptor = i, a), t.exports = n.mode.OFB
}, 208896, (e, t, r) => {
    var n, a;
    e.e, n = e.r(563478), e.r(433255), n.mode.ECB = ((a = n.lib.BlockCipherMode.extend()).Encryptor = a.extend({
        processBlock: function(e, t) {
            this._cipher.encryptBlock(e, t)
        }
    }), a.Decryptor = a.extend({
        processBlock: function(e, t) {
            this._cipher.decryptBlock(e, t)
        }
    }), a), t.exports = n.mode.ECB
}, 203110, (e, t, r) => {
    var n;
    e.e, n = e.r(563478), e.r(433255), n.pad.AnsiX923 = {
        pad: function(e, t) {
            var r = e.sigBytes,
                n = 4 * t,
                a = n - r % n,
                i = r + a - 1;
            e.clamp(), e.words[i >>> 2] |= a << 24 - i % 4 * 8, e.sigBytes += a
        },
        unpad: function(e) {
            var t = 255 & e.words[e.sigBytes - 1 >>> 2];
            e.sigBytes -= t
        }
    }, t.exports = n.pad.Ansix923
}, 928542, (e, t, r) => {
    var n;
    e.e, n = e.r(563478), e.r(433255), n.pad.Iso10126 = {
        pad: function(e, t) {
            var r = 4 * t,
                a = r - e.sigBytes % r;
            e.concat(n.lib.WordArray.random(a - 1)).concat(n.lib.WordArray.create([a << 24], 1))
        },
        unpad: function(e) {
            var t = 255 & e.words[e.sigBytes - 1 >>> 2];
            e.sigBytes -= t
        }
    }, t.exports = n.pad.Iso10126
}, 594448, (e, t, r) => {
    var n;
    e.e, n = e.r(563478), e.r(433255), n.pad.Iso97971 = {
        pad: function(e, t) {
            e.concat(n.lib.WordArray.create([0x80000000], 1)), n.pad.ZeroPadding.pad(e, t)
        },
        unpad: function(e) {
            n.pad.ZeroPadding.unpad(e), e.sigBytes--
        }
    }, t.exports = n.pad.Iso97971
}, 825386, (e, t, r) => {
    var n;
    e.e, n = e.r(563478), e.r(433255), n.pad.ZeroPadding = {
        pad: function(e, t) {
            var r = 4 * t;
            e.clamp(), e.sigBytes += r - (e.sigBytes % r || r)
        },
        unpad: function(e) {
            for (var t = e.words, r = e.sigBytes - 1, r = e.sigBytes - 1; r >= 0; r--)
                if (t[r >>> 2] >>> 24 - r % 4 * 8 & 255) {
                    e.sigBytes = r + 1;
                    break
                }
        }
    }, t.exports = n.pad.ZeroPadding
}, 624786, (e, t, r) => {
    var n;
    e.e, n = e.r(563478), e.r(433255), n.pad.NoPadding = {
        pad: function() {},
        unpad: function() {}
    }, t.exports = n.pad.NoPadding
}, 57777, (e, t, r) => {
    var n, a, i;
    e.e, n = e.r(563478), e.r(433255), a = n.lib.CipherParams, i = n.enc.Hex, n.format.Hex = {
        stringify: function(e) {
            return e.ciphertext.toString(i)
        },
        parse: function(e) {
            var t = i.parse(e);
            return a.create({
                ciphertext: t
            })
        }
    }, t.exports = n.format.Hex
}, 735448, (e, t, r) => {
    var n, a, i, o, s, l, c, u, d, f, p, h, m, y, g;
    e.e, n = e.r(563478), e.r(499512), e.r(506626), e.r(903112), e.r(433255), a = n.lib.BlockCipher, i = n.algo, o = [], s = [], l = [], c = [], u = [], d = [], f = [], p = [], h = [], m = [],
        function() {
            for (var e = [], t = 0; t < 256; t++) t < 128 ? e[t] = t << 1 : e[t] = t << 1 ^ 283;
            for (var r = 0, n = 0, t = 0; t < 256; t++) {
                var a = n ^ n << 1 ^ n << 2 ^ n << 3 ^ n << 4;
                a = a >>> 8 ^ 255 & a ^ 99, o[r] = a, s[a] = r;
                var i = e[r],
                    y = e[i],
                    g = e[y],
                    b = 257 * e[a] ^ 0x1010100 * a;
                l[r] = b << 24 | b >>> 8, c[r] = b << 16 | b >>> 16, u[r] = b << 8 | b >>> 24, d[r] = b;
                var b = 0x1010101 * g ^ 65537 * y ^ 257 * i ^ 0x1010100 * r;
                f[a] = b << 24 | b >>> 8, p[a] = b << 16 | b >>> 16, h[a] = b << 8 | b >>> 24, m[a] = b, r ? (r = i ^ e[e[e[g ^ i]]], n ^= e[e[n]]) : r = n = 1
            }
        }(), y = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], g = i.AES = a.extend({
            _doReset: function() {
                if (!this._nRounds || this._keyPriorReset !== this._key) {
                    for (var e, t = this._keyPriorReset = this._key, r = t.words, n = t.sigBytes / 4, a = ((this._nRounds = n + 6) + 1) * 4, i = this._keySchedule = [], s = 0; s < a; s++) s < n ? i[s] = r[s] : (e = i[s - 1], s % n ? n > 6 && s % n == 4 && (e = o[e >>> 24] << 24 | o[e >>> 16 & 255] << 16 | o[e >>> 8 & 255] << 8 | o[255 & e]) : e = (o[(e = e << 8 | e >>> 24) >>> 24] << 24 | o[e >>> 16 & 255] << 16 | o[e >>> 8 & 255] << 8 | o[255 & e]) ^ y[s / n | 0] << 24, i[s] = i[s - n] ^ e);
                    for (var l = this._invKeySchedule = [], c = 0; c < a; c++) {
                        var s = a - c;
                        if (c % 4) var e = i[s];
                        else var e = i[s - 4];
                        c < 4 || s <= 4 ? l[c] = e : l[c] = f[o[e >>> 24]] ^ p[o[e >>> 16 & 255]] ^ h[o[e >>> 8 & 255]] ^ m[o[255 & e]]
                    }
                }
            },
            encryptBlock: function(e, t) {
                this._doCryptBlock(e, t, this._keySchedule, l, c, u, d, o)
            },
            decryptBlock: function(e, t) {
                var r = e[t + 1];
                e[t + 1] = e[t + 3], e[t + 3] = r, this._doCryptBlock(e, t, this._invKeySchedule, f, p, h, m, s);
                var r = e[t + 1];
                e[t + 1] = e[t + 3], e[t + 3] = r
            },
            _doCryptBlock: function(e, t, r, n, a, i, o, s) {
                for (var l = this._nRounds, c = e[t] ^ r[0], u = e[t + 1] ^ r[1], d = e[t + 2] ^ r[2], f = e[t + 3] ^ r[3], p = 4, h = 1; h < l; h++) {
                    var m = n[c >>> 24] ^ a[u >>> 16 & 255] ^ i[d >>> 8 & 255] ^ o[255 & f] ^ r[p++],
                        y = n[u >>> 24] ^ a[d >>> 16 & 255] ^ i[f >>> 8 & 255] ^ o[255 & c] ^ r[p++],
                        g = n[d >>> 24] ^ a[f >>> 16 & 255] ^ i[c >>> 8 & 255] ^ o[255 & u] ^ r[p++],
                        b = n[f >>> 24] ^ a[c >>> 16 & 255] ^ i[u >>> 8 & 255] ^ o[255 & d] ^ r[p++];
                    c = m, u = y, d = g, f = b
                }
                var m = (s[c >>> 24] << 24 | s[u >>> 16 & 255] << 16 | s[d >>> 8 & 255] << 8 | s[255 & f]) ^ r[p++],
                    y = (s[u >>> 24] << 24 | s[d >>> 16 & 255] << 16 | s[f >>> 8 & 255] << 8 | s[255 & c]) ^ r[p++],
                    g = (s[d >>> 24] << 24 | s[f >>> 16 & 255] << 16 | s[c >>> 8 & 255] << 8 | s[255 & u]) ^ r[p++],
                    b = (s[f >>> 24] << 24 | s[c >>> 16 & 255] << 16 | s[u >>> 8 & 255] << 8 | s[255 & d]) ^ r[p++];
                e[t] = m, e[t + 1] = y, e[t + 2] = g, e[t + 3] = b
            },
            keySize: 8
        }), n.AES = a._createHelper(g), t.exports = n.AES
}, 444863, (e, t, r) => {
    var n;
    e.e, n = e.r(563478), e.r(499512), e.r(506626), e.r(903112), e.r(433255),
        function() {
            var e = n.lib,
                t = e.WordArray,
                r = e.BlockCipher,
                a = n.algo,
                i = [57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4],
                o = [14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32],
                s = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28],
                l = [{
                    0: 8421888,
                    0x10000000: 32768,
                    0x20000000: 8421378,
                    0x30000000: 2,
                    0x40000000: 512,
                    0x50000000: 8421890,
                    0x60000000: 8389122,
                    0x70000000: 8388608,
                    0x80000000: 514,
                    0x90000000: 8389120,
                    0xa0000000: 33280,
                    0xb0000000: 8421376,
                    0xc0000000: 32770,
                    0xd0000000: 8388610,
                    0xe0000000: 0,
                    0xf0000000: 33282,
                    0x8000000: 0,
                    0x18000000: 8421890,
                    0x28000000: 33282,
                    0x38000000: 32768,
                    0x48000000: 8421888,
                    0x58000000: 512,
                    0x68000000: 8421378,
                    0x78000000: 2,
                    0x88000000: 8389120,
                    0x98000000: 33280,
                    0xa8000000: 8421376,
                    0xb8000000: 8389122,
                    0xc8000000: 8388610,
                    0xd8000000: 32770,
                    0xe8000000: 514,
                    0xf8000000: 8388608,
                    1: 32768,
                    0x10000001: 2,
                    0x20000001: 8421888,
                    0x30000001: 8388608,
                    0x40000001: 8421378,
                    0x50000001: 33280,
                    0x60000001: 512,
                    0x70000001: 8389122,
                    0x80000001: 8421890,
                    0x90000001: 8421376,
                    0xa0000001: 8388610,
                    0xb0000001: 33282,
                    0xc0000001: 514,
                    0xd0000001: 8389120,
                    0xe0000001: 32770,
                    0xf0000001: 0,
                    0x8000001: 8421890,
                    0x18000001: 8421376,
                    0x28000001: 8388608,
                    0x38000001: 512,
                    0x48000001: 32768,
                    0x58000001: 8388610,
                    0x68000001: 2,
                    0x78000001: 33282,
                    0x88000001: 32770,
                    0x98000001: 8389122,
                    0xa8000001: 514,
                    0xb8000001: 8421888,
                    0xc8000001: 8389120,
                    0xd8000001: 0,
                    0xe8000001: 33280,
                    0xf8000001: 8421378
                }, {
                    0: 0x40084010,
                    0x1000000: 16384,
                    0x2000000: 524288,
                    0x3000000: 0x40080010,
                    0x4000000: 0x40000010,
                    0x5000000: 0x40084000,
                    0x6000000: 0x40004000,
                    0x7000000: 16,
                    0x8000000: 540672,
                    0x9000000: 0x40004010,
                    0xa000000: 0x40000000,
                    0xb000000: 540688,
                    0xc000000: 524304,
                    0xd000000: 0,
                    0xe000000: 16400,
                    0xf000000: 0x40080000,
                    8388608: 0x40004000,
                    0x1800000: 540688,
                    0x2800000: 16,
                    0x3800000: 0x40004010,
                    0x4800000: 0x40084010,
                    0x5800000: 0x40000000,
                    0x6800000: 524288,
                    0x7800000: 0x40080010,
                    0x8800000: 524304,
                    0x9800000: 0,
                    0xa800000: 16384,
                    0xb800000: 0x40080000,
                    0xc800000: 0x40000010,
                    0xd800000: 540672,
                    0xe800000: 0x40084000,
                    0xf800000: 16400,
                    0x10000000: 0,
                    0x11000000: 0x40080010,
                    0x12000000: 0x40004010,
                    0x13000000: 0x40084000,
                    0x14000000: 0x40080000,
                    0x15000000: 16,
                    0x16000000: 540688,
                    0x17000000: 16384,
                    0x18000000: 16400,
                    0x19000000: 524288,
                    0x1a000000: 524304,
                    0x1b000000: 0x40000010,
                    0x1c000000: 540672,
                    0x1d000000: 0x40004000,
                    0x1e000000: 0x40000000,
                    0x1f000000: 0x40084010,
                    0x10800000: 540688,
                    0x11800000: 524288,
                    0x12800000: 0x40080000,
                    0x13800000: 16384,
                    0x14800000: 0x40004000,
                    0x15800000: 0x40084010,
                    0x16800000: 16,
                    0x17800000: 0x40000000,
                    0x18800000: 0x40084000,
                    0x19800000: 0x40000010,
                    0x1a800000: 0x40004010,
                    0x1b800000: 524304,
                    0x1c800000: 0,
                    0x1d800000: 16400,
                    0x1e800000: 0x40080010,
                    0x1f800000: 540672
                }, {
                    0: 260,
                    1048576: 0,
                    2097152: 0x4000100,
                    3145728: 65796,
                    4194304: 65540,
                    5242880: 0x4000004,
                    6291456: 0x4010104,
                    7340032: 0x4010000,
                    8388608: 0x4000000,
                    9437184: 0x4010100,
                    0xa00000: 65792,
                    0xb00000: 0x4010004,
                    0xc00000: 0x4000104,
                    0xd00000: 65536,
                    0xe00000: 4,
                    0xf00000: 256,
                    524288: 0x4010100,
                    1572864: 0x4010004,
                    2621440: 0,
                    3670016: 0x4000100,
                    4718592: 0x4000004,
                    5767168: 65536,
                    6815744: 65540,
                    7864320: 260,
                    8912896: 4,
                    9961472: 256,
                    0xa80000: 0x4010000,
                    0xb80000: 65796,
                    0xc80000: 65792,
                    0xd80000: 0x4000104,
                    0xe80000: 0x4010104,
                    0xf80000: 0x4000000,
                    0x1000000: 0x4010100,
                    0x1100000: 65540,
                    0x1200000: 65536,
                    0x1300000: 0x4000100,
                    0x1400000: 256,
                    0x1500000: 0x4010104,
                    0x1600000: 0x4000004,
                    0x1700000: 0,
                    0x1800000: 0x4000104,
                    0x1900000: 0x4000000,
                    0x1a00000: 4,
                    0x1b00000: 65792,
                    0x1c00000: 0x4010000,
                    0x1d00000: 260,
                    0x1e00000: 65796,
                    0x1f00000: 0x4010004,
                    0x1080000: 0x4000000,
                    0x1180000: 260,
                    0x1280000: 0x4010100,
                    0x1380000: 0,
                    0x1480000: 65540,
                    0x1580000: 0x4000100,
                    0x1680000: 256,
                    0x1780000: 0x4010004,
                    0x1880000: 65536,
                    0x1980000: 0x4010104,
                    0x1a80000: 65796,
                    0x1b80000: 0x4000004,
                    0x1c80000: 0x4000104,
                    0x1d80000: 0x4010000,
                    0x1e80000: 4,
                    0x1f80000: 65792
                }, {
                    0: 0x80401000,
                    65536: 0x80001040,
                    131072: 4198464,
                    196608: 0x80400000,
                    262144: 0,
                    327680: 4198400,
                    393216: 0x80000040,
                    458752: 4194368,
                    524288: 0x80000000,
                    589824: 4194304,
                    655360: 64,
                    720896: 0x80001000,
                    786432: 0x80400040,
                    851968: 4160,
                    917504: 4096,
                    983040: 0x80401040,
                    32768: 0x80001040,
                    98304: 64,
                    163840: 0x80400040,
                    229376: 0x80001000,
                    294912: 4198400,
                    360448: 0x80401040,
                    425984: 0,
                    491520: 0x80400000,
                    557056: 4096,
                    622592: 0x80401000,
                    688128: 4194304,
                    753664: 4160,
                    819200: 0x80000000,
                    884736: 4194368,
                    950272: 4198464,
                    1015808: 0x80000040,
                    1048576: 4194368,
                    1114112: 4198400,
                    1179648: 0x80000040,
                    1245184: 0,
                    1310720: 4160,
                    1376256: 0x80400040,
                    1441792: 0x80401000,
                    1507328: 0x80001040,
                    1572864: 0x80401040,
                    1638400: 0x80000000,
                    1703936: 0x80400000,
                    1769472: 4198464,
                    1835008: 0x80001000,
                    1900544: 4194304,
                    1966080: 64,
                    2031616: 4096,
                    1081344: 0x80400000,
                    1146880: 0x80401040,
                    1212416: 0,
                    1277952: 4198400,
                    1343488: 4194368,
                    1409024: 0x80000000,
                    1474560: 0x80001040,
                    1540096: 64,
                    1605632: 0x80000040,
                    1671168: 4096,
                    1736704: 0x80001000,
                    1802240: 0x80400040,
                    1867776: 4160,
                    1933312: 0x80401000,
                    1998848: 4194304,
                    2064384: 4198464
                }, {
                    0: 128,
                    4096: 0x1040000,
                    8192: 262144,
                    12288: 0x20000000,
                    16384: 0x20040080,
                    20480: 0x1000080,
                    24576: 0x21000080,
                    28672: 262272,
                    32768: 0x1000000,
                    36864: 0x20040000,
                    40960: 0x20000080,
                    45056: 0x21040080,
                    49152: 0x21040000,
                    53248: 0,
                    57344: 0x1040080,
                    61440: 0x21000000,
                    2048: 0x1040080,
                    6144: 0x21000080,
                    10240: 128,
                    14336: 0x1040000,
                    18432: 262144,
                    22528: 0x20040080,
                    26624: 0x21040000,
                    30720: 0x20000000,
                    34816: 0x20040000,
                    38912: 0,
                    43008: 0x21040080,
                    47104: 0x1000080,
                    51200: 0x20000080,
                    55296: 0x21000000,
                    59392: 0x1000000,
                    63488: 262272,
                    65536: 262144,
                    69632: 128,
                    73728: 0x20000000,
                    77824: 0x21000080,
                    81920: 0x1000080,
                    86016: 0x21040000,
                    90112: 0x20040080,
                    94208: 0x1000000,
                    98304: 0x21040080,
                    102400: 0x21000000,
                    106496: 0x1040000,
                    110592: 0x20040000,
                    114688: 262272,
                    118784: 0x20000080,
                    122880: 0,
                    126976: 0x1040080,
                    67584: 0x21000080,
                    71680: 0x1000000,
                    75776: 0x1040000,
                    79872: 0x20040080,
                    83968: 0x20000000,
                    88064: 0x1040080,
                    92160: 128,
                    96256: 0x21040000,
                    100352: 262272,
                    104448: 0x21040080,
                    108544: 0,
                    112640: 0x21000000,
                    116736: 0x1000080,
                    120832: 262144,
                    124928: 0x20040000,
                    129024: 0x20000080
                }, {
                    0: 0x10000008,
                    256: 8192,
                    512: 0x10200000,
                    768: 0x10202008,
                    1024: 0x10002000,
                    1280: 2097152,
                    1536: 2097160,
                    1792: 0x10000000,
                    2048: 0,
                    2304: 0x10002008,
                    2560: 2105344,
                    2816: 8,
                    3072: 0x10200008,
                    3328: 2105352,
                    3584: 8200,
                    3840: 0x10202000,
                    128: 0x10200000,
                    384: 0x10202008,
                    640: 8,
                    896: 2097152,
                    1152: 2105352,
                    1408: 0x10000008,
                    1664: 0x10002000,
                    1920: 8200,
                    2176: 2097160,
                    2432: 8192,
                    2688: 0x10002008,
                    2944: 0x10200008,
                    3200: 0,
                    3456: 0x10202000,
                    3712: 2105344,
                    3968: 0x10000000,
                    4096: 0x10002000,
                    4352: 0x10200008,
                    4608: 0x10202008,
                    4864: 8200,
                    5120: 2097152,
                    5376: 0x10000000,
                    5632: 0x10000008,
                    5888: 2105344,
                    6144: 2105352,
                    6400: 0,
                    6656: 8,
                    6912: 0x10200000,
                    7168: 8192,
                    7424: 0x10002008,
                    7680: 0x10202000,
                    7936: 2097160,
                    4224: 8,
                    4480: 2105344,
                    4736: 2097152,
                    4992: 0x10000008,
                    5248: 0x10002000,
                    5504: 8200,
                    5760: 0x10202008,
                    6016: 0x10200000,
                    6272: 0x10202000,
                    6528: 0x10200008,
                    6784: 8192,
                    7040: 2105352,
                    7296: 2097160,
                    7552: 0,
                    7808: 0x10000000,
                    8064: 0x10002008
                }, {
                    0: 1048576,
                    16: 0x2000401,
                    32: 1024,
                    48: 1049601,
                    64: 0x2100401,
                    80: 0,
                    96: 1,
                    112: 0x2100001,
                    128: 0x2000400,
                    144: 1048577,
                    160: 0x2000001,
                    176: 0x2100400,
                    192: 0x2100000,
                    208: 1025,
                    224: 1049600,
                    240: 0x2000000,
                    8: 0x2100001,
                    24: 0,
                    40: 0x2000401,
                    56: 0x2100400,
                    72: 1048576,
                    88: 0x2000001,
                    104: 0x2000000,
                    120: 1025,
                    136: 1049601,
                    152: 0x2000400,
                    168: 0x2100000,
                    184: 1048577,
                    200: 1024,
                    216: 0x2100401,
                    232: 1,
                    248: 1049600,
                    256: 0x2000000,
                    272: 1048576,
                    288: 0x2000401,
                    304: 0x2100001,
                    320: 1048577,
                    336: 0x2000400,
                    352: 0x2100400,
                    368: 1049601,
                    384: 1025,
                    400: 0x2100401,
                    416: 1049600,
                    432: 1,
                    448: 0,
                    464: 0x2100000,
                    480: 0x2000001,
                    496: 1024,
                    264: 1049600,
                    280: 0x2000401,
                    296: 0x2100001,
                    312: 1,
                    328: 0x2000000,
                    344: 1048576,
                    360: 1025,
                    376: 0x2100400,
                    392: 0x2000001,
                    408: 0x2100000,
                    424: 0,
                    440: 0x2100401,
                    456: 1049601,
                    472: 1024,
                    488: 0x2000400,
                    504: 1048577
                }, {
                    0: 0x8000820,
                    1: 131072,
                    2: 0x8000000,
                    3: 32,
                    4: 131104,
                    5: 0x8020820,
                    6: 0x8020800,
                    7: 2048,
                    8: 0x8020000,
                    9: 0x8000800,
                    10: 133120,
                    11: 0x8020020,
                    12: 2080,
                    13: 0,
                    14: 0x8000020,
                    15: 133152,
                    0x80000000: 2048,
                    0x80000001: 0x8020820,
                    0x80000002: 0x8000820,
                    0x80000003: 0x8000000,
                    0x80000004: 0x8020000,
                    0x80000005: 133120,
                    0x80000006: 133152,
                    0x80000007: 32,
                    0x80000008: 0x8000020,
                    0x80000009: 2080,
                    0x8000000a: 131104,
                    0x8000000b: 0x8020800,
                    0x8000000c: 0,
                    0x8000000d: 0x8020020,
                    0x8000000e: 0x8000800,
                    0x8000000f: 131072,
                    16: 133152,
                    17: 0x8020800,
                    18: 32,
                    19: 2048,
                    20: 0x8000800,
                    21: 0x8000020,
                    22: 0x8020020,
                    23: 131072,
                    24: 0,
                    25: 131104,
                    26: 0x8020000,
                    27: 0x8000820,
                    28: 0x8020820,
                    29: 133120,
                    30: 2080,
                    31: 0x8000000,
                    0x80000010: 131072,
                    0x80000011: 2048,
                    0x80000012: 0x8020020,
                    0x80000013: 133152,
                    0x80000014: 32,
                    0x80000015: 0x8020000,
                    0x80000016: 0x8000000,
                    0x80000017: 0x8000820,
                    0x80000018: 0x8020820,
                    0x80000019: 0x8000020,
                    0x8000001a: 0x8000800,
                    0x8000001b: 0,
                    0x8000001c: 133120,
                    0x8000001d: 2080,
                    0x8000001e: 131104,
                    0x8000001f: 0x8020800
                }],
                c = [0xf8000001, 0x1f800000, 0x1f80000, 2064384, 129024, 8064, 504, 0x8000001f],
                u = a.DES = r.extend({
                    _doReset: function() {
                        for (var e = this._key.words, t = [], r = 0; r < 56; r++) {
                            var n = i[r] - 1;
                            t[r] = e[n >>> 5] >>> 31 - n % 32 & 1
                        }
                        for (var a = this._subKeys = [], l = 0; l < 16; l++) {
                            for (var c = a[l] = [], u = s[l], r = 0; r < 24; r++) c[r / 6 | 0] |= t[(o[r] - 1 + u) % 28] << 31 - r % 6, c[4 + (r / 6 | 0)] |= t[28 + (o[r + 24] - 1 + u) % 28] << 31 - r % 6;
                            c[0] = c[0] << 1 | c[0] >>> 31;
                            for (var r = 1; r < 7; r++) c[r] = c[r] >>> (r - 1) * 4 + 3;
                            c[7] = c[7] << 5 | c[7] >>> 27
                        }
                        for (var d = this._invSubKeys = [], r = 0; r < 16; r++) d[r] = a[15 - r]
                    },
                    encryptBlock: function(e, t) {
                        this._doCryptBlock(e, t, this._subKeys)
                    },
                    decryptBlock: function(e, t) {
                        this._doCryptBlock(e, t, this._invSubKeys)
                    },
                    _doCryptBlock: function(e, t, r) {
                        this._lBlock = e[t], this._rBlock = e[t + 1], d.call(this, 4, 0xf0f0f0f), d.call(this, 16, 65535), f.call(this, 2, 0x33333333), f.call(this, 8, 0xff00ff), d.call(this, 1, 0x55555555);
                        for (var n = 0; n < 16; n++) {
                            for (var a = r[n], i = this._lBlock, o = this._rBlock, s = 0, u = 0; u < 8; u++) s |= l[u][((o ^ a[u]) & c[u]) >>> 0];
                            this._lBlock = o, this._rBlock = i ^ s
                        }
                        var p = this._lBlock;
                        this._lBlock = this._rBlock, this._rBlock = p, d.call(this, 1, 0x55555555), f.call(this, 8, 0xff00ff), f.call(this, 2, 0x33333333), d.call(this, 16, 65535), d.call(this, 4, 0xf0f0f0f), e[t] = this._lBlock, e[t + 1] = this._rBlock
                    },
                    keySize: 2,
                    ivSize: 2,
                    blockSize: 2
                });

            function d(e, t) {
                var r = (this._lBlock >>> e ^ this._rBlock) & t;
                this._rBlock ^= r, this._lBlock ^= r << e
            }

            function f(e, t) {
                var r = (this._rBlock >>> e ^ this._lBlock) & t;
                this._lBlock ^= r, this._rBlock ^= r << e
            }
            n.DES = r._createHelper(u);
            var p = a.TripleDES = r.extend({
                _doReset: function() {
                    var e = this._key.words;
                    if (2 !== e.length && 4 !== e.length && e.length < 6) throw Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");
                    var r = e.slice(0, 2),
                        n = e.length < 4 ? e.slice(0, 2) : e.slice(2, 4),
                        a = e.length < 6 ? e.slice(0, 2) : e.slice(4, 6);
                    this._des1 = u.createEncryptor(t.create(r)), this._des2 = u.createEncryptor(t.create(n)), this._des3 = u.createEncryptor(t.create(a))
                },
                encryptBlock: function(e, t) {
                    this._des1.encryptBlock(e, t), this._des2.decryptBlock(e, t), this._des3.encryptBlock(e, t)
                },
                decryptBlock: function(e, t) {
                    this._des3.decryptBlock(e, t), this._des2.encryptBlock(e, t), this._des1.decryptBlock(e, t)
                },
                keySize: 6,
                ivSize: 2,
                blockSize: 2
            });
            n.TripleDES = r._createHelper(p)
        }(), t.exports = n.TripleDES
}, 978467, (e, t, r) => {
    var n;
    e.e, n = e.r(563478), e.r(499512), e.r(506626), e.r(903112), e.r(433255),
        function() {
            var e = n.lib.StreamCipher,
                t = n.algo,
                r = t.RC4 = e.extend({
                    _doReset: function() {
                        for (var e = this._key, t = e.words, r = e.sigBytes, n = this._S = [], a = 0; a < 256; a++) n[a] = a;
                        for (var a = 0, i = 0; a < 256; a++) {
                            var o = a % r,
                                s = t[o >>> 2] >>> 24 - o % 4 * 8 & 255;
                            i = (i + n[a] + s) % 256;
                            var l = n[a];
                            n[a] = n[i], n[i] = l
                        }
                        this._i = this._j = 0
                    },
                    _doProcessBlock: function(e, t) {
                        e[t] ^= a.call(this)
                    },
                    keySize: 8,
                    ivSize: 0
                });

            function a() {
                for (var e = this._S, t = this._i, r = this._j, n = 0, a = 0; a < 4; a++) {
                    r = (r + e[t = (t + 1) % 256]) % 256;
                    var i = e[t];
                    e[t] = e[r], e[r] = i, n |= e[(e[t] + e[r]) % 256] << 24 - 8 * a
                }
                return this._i = t, this._j = r, n
            }
            n.RC4 = e._createHelper(r);
            var i = t.RC4Drop = r.extend({
                cfg: r.cfg.extend({
                    drop: 192
                }),
                _doReset: function() {
                    r._doReset.call(this);
                    for (var e = this.cfg.drop; e > 0; e--) a.call(this)
                }
            });
            n.RC4Drop = e._createHelper(i)
        }(), t.exports = n.RC4
}, 450802, (e, t, r) => {
    var n;
    e.e, n = e.r(563478), e.r(499512), e.r(506626), e.r(903112), e.r(433255),
        function() {
            var e = n.lib.StreamCipher,
                t = n.algo,
                r = [],
                a = [],
                i = [],
                o = t.Rabbit = e.extend({
                    _doReset: function() {
                        for (var e = this._key.words, t = this.cfg.iv, r = 0; r < 4; r++) e[r] = (e[r] << 8 | e[r] >>> 24) & 0xff00ff | (e[r] << 24 | e[r] >>> 8) & 0xff00ff00;
                        var n = this._X = [e[0], e[3] << 16 | e[2] >>> 16, e[1], e[0] << 16 | e[3] >>> 16, e[2], e[1] << 16 | e[0] >>> 16, e[3], e[2] << 16 | e[1] >>> 16],
                            a = this._C = [e[2] << 16 | e[2] >>> 16, 0xffff0000 & e[0] | 65535 & e[1], e[3] << 16 | e[3] >>> 16, 0xffff0000 & e[1] | 65535 & e[2], e[0] << 16 | e[0] >>> 16, 0xffff0000 & e[2] | 65535 & e[3], e[1] << 16 | e[1] >>> 16, 0xffff0000 & e[3] | 65535 & e[0]];
                        this._b = 0;
                        for (var r = 0; r < 4; r++) s.call(this);
                        for (var r = 0; r < 8; r++) a[r] ^= n[r + 4 & 7];
                        if (t) {
                            var i = t.words,
                                o = i[0],
                                l = i[1],
                                c = (o << 8 | o >>> 24) & 0xff00ff | (o << 24 | o >>> 8) & 0xff00ff00,
                                u = (l << 8 | l >>> 24) & 0xff00ff | (l << 24 | l >>> 8) & 0xff00ff00,
                                d = c >>> 16 | 0xffff0000 & u,
                                f = u << 16 | 65535 & c;
                            a[0] ^= c, a[1] ^= d, a[2] ^= u, a[3] ^= f, a[4] ^= c, a[5] ^= d, a[6] ^= u, a[7] ^= f;
                            for (var r = 0; r < 4; r++) s.call(this)
                        }
                    },
                    _doProcessBlock: function(e, t) {
                        var n = this._X;
                        s.call(this), r[0] = n[0] ^ n[5] >>> 16 ^ n[3] << 16, r[1] = n[2] ^ n[7] >>> 16 ^ n[5] << 16, r[2] = n[4] ^ n[1] >>> 16 ^ n[7] << 16, r[3] = n[6] ^ n[3] >>> 16 ^ n[1] << 16;
                        for (var a = 0; a < 4; a++) r[a] = (r[a] << 8 | r[a] >>> 24) & 0xff00ff | (r[a] << 24 | r[a] >>> 8) & 0xff00ff00, e[t + a] ^= r[a]
                    },
                    blockSize: 4,
                    ivSize: 2
                });

            function s() {
                for (var e = this._X, t = this._C, r = 0; r < 8; r++) a[r] = t[r];
                t[0] = t[0] + 0x4d34d34d + this._b | 0, t[1] = t[1] + 0xd34d34d3 + +(t[0] >>> 0 < a[0] >>> 0) | 0, t[2] = t[2] + 0x34d34d34 + +(t[1] >>> 0 < a[1] >>> 0) | 0, t[3] = t[3] + 0x4d34d34d + +(t[2] >>> 0 < a[2] >>> 0) | 0, t[4] = t[4] + 0xd34d34d3 + +(t[3] >>> 0 < a[3] >>> 0) | 0, t[5] = t[5] + 0x34d34d34 + +(t[4] >>> 0 < a[4] >>> 0) | 0, t[6] = t[6] + 0x4d34d34d + +(t[5] >>> 0 < a[5] >>> 0) | 0, t[7] = t[7] + 0xd34d34d3 + +(t[6] >>> 0 < a[6] >>> 0) | 0, this._b = +(t[7] >>> 0 < a[7] >>> 0);
                for (var r = 0; r < 8; r++) {
                    var n = e[r] + t[r],
                        o = 65535 & n,
                        s = n >>> 16,
                        l = ((o * o >>> 17) + o * s >>> 15) + s * s,
                        c = ((0xffff0000 & n) * n | 0) + ((65535 & n) * n | 0);
                    i[r] = l ^ c
                }
                e[0] = i[0] + (i[7] << 16 | i[7] >>> 16) + (i[6] << 16 | i[6] >>> 16) | 0, e[1] = i[1] + (i[0] << 8 | i[0] >>> 24) + i[7] | 0, e[2] = i[2] + (i[1] << 16 | i[1] >>> 16) + (i[0] << 16 | i[0] >>> 16) | 0, e[3] = i[3] + (i[2] << 8 | i[2] >>> 24) + i[1] | 0, e[4] = i[4] + (i[3] << 16 | i[3] >>> 16) + (i[2] << 16 | i[2] >>> 16) | 0, e[5] = i[5] + (i[4] << 8 | i[4] >>> 24) + i[3] | 0, e[6] = i[6] + (i[5] << 16 | i[5] >>> 16) + (i[4] << 16 | i[4] >>> 16) | 0, e[7] = i[7] + (i[6] << 8 | i[6] >>> 24) + i[5] | 0
            }
            n.Rabbit = e._createHelper(o)
        }(), t.exports = n.Rabbit
}, 835852, (e, t, r) => {
    var n;
    e.e, n = e.r(563478), e.r(499512), e.r(506626), e.r(903112), e.r(433255),
        function() {
            var e = n.lib.StreamCipher,
                t = n.algo,
                r = [],
                a = [],
                i = [],
                o = t.RabbitLegacy = e.extend({
                    _doReset: function() {
                        var e = this._key.words,
                            t = this.cfg.iv,
                            r = this._X = [e[0], e[3] << 16 | e[2] >>> 16, e[1], e[0] << 16 | e[3] >>> 16, e[2], e[1] << 16 | e[0] >>> 16, e[3], e[2] << 16 | e[1] >>> 16],
                            n = this._C = [e[2] << 16 | e[2] >>> 16, 0xffff0000 & e[0] | 65535 & e[1], e[3] << 16 | e[3] >>> 16, 0xffff0000 & e[1] | 65535 & e[2], e[0] << 16 | e[0] >>> 16, 0xffff0000 & e[2] | 65535 & e[3], e[1] << 16 | e[1] >>> 16, 0xffff0000 & e[3] | 65535 & e[0]];
                        this._b = 0;
                        for (var a = 0; a < 4; a++) s.call(this);
                        for (var a = 0; a < 8; a++) n[a] ^= r[a + 4 & 7];
                        if (t) {
                            var i = t.words,
                                o = i[0],
                                l = i[1],
                                c = (o << 8 | o >>> 24) & 0xff00ff | (o << 24 | o >>> 8) & 0xff00ff00,
                                u = (l << 8 | l >>> 24) & 0xff00ff | (l << 24 | l >>> 8) & 0xff00ff00,
                                d = c >>> 16 | 0xffff0000 & u,
                                f = u << 16 | 65535 & c;
                            n[0] ^= c, n[1] ^= d, n[2] ^= u, n[3] ^= f, n[4] ^= c, n[5] ^= d, n[6] ^= u, n[7] ^= f;
                            for (var a = 0; a < 4; a++) s.call(this)
                        }
                    },
                    _doProcessBlock: function(e, t) {
                        var n = this._X;
                        s.call(this), r[0] = n[0] ^ n[5] >>> 16 ^ n[3] << 16, r[1] = n[2] ^ n[7] >>> 16 ^ n[5] << 16, r[2] = n[4] ^ n[1] >>> 16 ^ n[7] << 16, r[3] = n[6] ^ n[3] >>> 16 ^ n[1] << 16;
                        for (var a = 0; a < 4; a++) r[a] = (r[a] << 8 | r[a] >>> 24) & 0xff00ff | (r[a] << 24 | r[a] >>> 8) & 0xff00ff00, e[t + a] ^= r[a]
                    },
                    blockSize: 4,
                    ivSize: 2
                });

            function s() {
                for (var e = this._X, t = this._C, r = 0; r < 8; r++) a[r] = t[r];
                t[0] = t[0] + 0x4d34d34d + this._b | 0, t[1] = t[1] + 0xd34d34d3 + +(t[0] >>> 0 < a[0] >>> 0) | 0, t[2] = t[2] + 0x34d34d34 + +(t[1] >>> 0 < a[1] >>> 0) | 0, t[3] = t[3] + 0x4d34d34d + +(t[2] >>> 0 < a[2] >>> 0) | 0, t[4] = t[4] + 0xd34d34d3 + +(t[3] >>> 0 < a[3] >>> 0) | 0, t[5] = t[5] + 0x34d34d34 + +(t[4] >>> 0 < a[4] >>> 0) | 0, t[6] = t[6] + 0x4d34d34d + +(t[5] >>> 0 < a[5] >>> 0) | 0, t[7] = t[7] + 0xd34d34d3 + +(t[6] >>> 0 < a[6] >>> 0) | 0, this._b = +(t[7] >>> 0 < a[7] >>> 0);
                for (var r = 0; r < 8; r++) {
                    var n = e[r] + t[r],
                        o = 65535 & n,
                        s = n >>> 16,
                        l = ((o * o >>> 17) + o * s >>> 15) + s * s,
                        c = ((0xffff0000 & n) * n | 0) + ((65535 & n) * n | 0);
                    i[r] = l ^ c
                }
                e[0] = i[0] + (i[7] << 16 | i[7] >>> 16) + (i[6] << 16 | i[6] >>> 16) | 0, e[1] = i[1] + (i[0] << 8 | i[0] >>> 24) + i[7] | 0, e[2] = i[2] + (i[1] << 16 | i[1] >>> 16) + (i[0] << 16 | i[0] >>> 16) | 0, e[3] = i[3] + (i[2] << 8 | i[2] >>> 24) + i[1] | 0, e[4] = i[4] + (i[3] << 16 | i[3] >>> 16) + (i[2] << 16 | i[2] >>> 16) | 0, e[5] = i[5] + (i[4] << 8 | i[4] >>> 24) + i[3] | 0, e[6] = i[6] + (i[5] << 16 | i[5] >>> 16) + (i[4] << 16 | i[4] >>> 16) | 0, e[7] = i[7] + (i[6] << 8 | i[6] >>> 24) + i[5] | 0
            }
            n.RabbitLegacy = e._createHelper(o)
        }(), t.exports = n.RabbitLegacy
}, 964459, (e, t, r) => {
    var n;
    e.e, n = e.r(563478), e.r(499512), e.r(506626), e.r(903112), e.r(433255),
        function() {
            var e = n.lib.BlockCipher,
                t = n.algo;
            let r = [0x243f6a88, 0x85a308d3, 0x13198a2e, 0x3707344, 0xa4093822, 0x299f31d0, 0x82efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b],
                a = [
                    [0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0xd95748f, 0x728eb658, 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0xf6d6ff3, 0x83f44239, 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, 0x75372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x4c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 2428461, 0x2071b35e, 0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x2e5b9c5, 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x8ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, 0x53b02d5d, 0xa99f8fa1, 0x8ba4799, 0x6e85076a],
                    [0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 290971e4, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x21ecc5e, 0x9686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x200b3ff, 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, 0xa9446146, 0xfd0030e, 0xecc8c73e, 0xa4751e41, 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, 0x43556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x18cff28, 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96, 0x334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, 0xe358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, 0x95bbf00, 0xad19489d, 0x1462b174, 0x23820e00, 0x58428d2a, 0xc55f5ea, 0x1dadf43e, 0x233f7061, 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, 0x9e447a2e, 0xc3453484, 0xfdd56705, 0xe1e9ec9, 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7],
                    [0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x3bd9785, 0x7fac6dd0, 0x31cb8504, 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4, 0xa2c86da, 0xe9b66dfb, 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, 0xfdf8e802, 0x4272f70, 0x80bb155c, 0x5282ce3, 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, 0x7f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, 0xe12b4c2, 0x2e1329e, 0xaf664fd1, 0xcad18115, 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, 0xa476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, 0x6a124237, 0xb79251e7, 0x6a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0xa121386, 0xd90cec6e, 0xd5abea2a, 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x9f0be8c, 0x4a99a025, 0x1d6efe10, 0x1ab93d1d, 0xba5a4df, 0xa186f20f, 0x2868f169, 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, 0xa002b5c4, 0xde6d027, 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0, 6314154, 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, 0xed545578, 0x8fca5b5, 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0],
                    [0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x22b8b51, 0x96d5ac3a, 0x17da67d, 0xd1cf3ed6, 0x7c7d2d28, 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba, 0x3a16125, 0x564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, 0x7533d928, 0xb155fdf5, 0x3563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x9072166, 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x115af84, 3786409e3, 0x95983a1d, 0x6b89fb4, 0xce6ea048, 0x6f3f3b82, 0x3520ab82, 0x11a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, 0x339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a, 0xf91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0xfe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x2fb8a8c, 0x1c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6]
                ];
            var i = {
                pbox: [],
                sbox: []
            };

            function o(e, t) {
                let r = e.sbox[0][t >> 24 & 255] + e.sbox[1][t >> 16 & 255];
                return r ^= e.sbox[2][t >> 8 & 255], r += e.sbox[3][255 & t]
            }

            function s(e, t, r) {
                let n, a = t,
                    i = r;
                for (let t = 0; t < 16; ++t) a ^= e.pbox[t], i = o(e, a) ^ i, n = a, a = i, i = n;
                return n = a, a = i, i = n ^ e.pbox[16], {
                    left: a ^= e.pbox[17],
                    right: i
                }
            }
            var l = t.Blowfish = e.extend({
                _doReset: function() {
                    if (this._keyPriorReset !== this._key) {
                        var e = this._keyPriorReset = this._key;
                        ! function(e, t, n) {
                            for (let t = 0; t < 4; t++) {
                                e.sbox[t] = [];
                                for (let r = 0; r < 256; r++) e.sbox[t][r] = a[t][r]
                            }
                            let i = 0;
                            for (let a = 0; a < 18; a++) e.pbox[a] = r[a] ^ t[i], ++i >= n && (i = 0);
                            let o = 0,
                                l = 0,
                                c = 0;
                            for (let t = 0; t < 18; t += 2) o = (c = s(e, o, l)).left, l = c.right, e.pbox[t] = o, e.pbox[t + 1] = l;
                            for (let t = 0; t < 4; t++)
                                for (let r = 0; r < 256; r += 2) o = (c = s(e, o, l)).left, l = c.right, e.sbox[t][r] = o, e.sbox[t][r + 1] = l
                        }(i, e.words, e.sigBytes / 4)
                    }
                },
                encryptBlock: function(e, t) {
                    var r = s(i, e[t], e[t + 1]);
                    e[t] = r.left, e[t + 1] = r.right
                },
                decryptBlock: function(e, t) {
                    var r = function(e, t, r) {
                        let n, a = t,
                            i = r;
                        for (let t = 17; t > 1; --t) a ^= e.pbox[t], i = o(e, a) ^ i, n = a, a = i, i = n;
                        return n = a, a = i, i = n ^ e.pbox[1], {
                            left: a ^= e.pbox[0],
                            right: i
                        }
                    }(i, e[t], e[t + 1]);
                    e[t] = r.left, e[t + 1] = r.right
                },
                blockSize: 2,
                keySize: 4,
                ivSize: 2
            });
            n.Blowfish = e._createHelper(l)
        }(), t.exports = n.Blowfish
}, 464965, (e, t, r) => {
    var n;
    e.e, n = e.r(563478), e.r(601601), e.r(666327), e.r(160654), e.r(499512), e.r(238434), e.r(506626), e.r(310698), e.r(630377), e.r(410021), e.r(465836), e.r(181270), e.r(334125), e.r(566273), e.r(278001), e.r(373594), e.r(903112), e.r(433255), e.r(502358), e.r(413257), e.r(121961), e.r(925274), e.r(208896), e.r(203110), e.r(928542), e.r(594448), e.r(825386), e.r(624786), e.r(57777), e.r(735448), e.r(444863), e.r(978467), e.r(450802), e.r(835852), e.r(964459), t.exports = n
}, 767158, 864912, 498419, e => {
    "use strict";
    let t, r, n, a, i, o, s, l, c, u, d, f, p, h, m, y, g, b, v, x, w, _, C, E, S, A, I, T, k, O, R, N, M, P, D, j, L, F, U, $, z, B, q, W, Z, V, K, H, G, Q, J, Y, X, ee, et, er, en, ea, ei, eo, es, el, ec, eu, ed, ef, ep, eh, em, ey, eg, eb, ev, ex, ew, e_, eC, eE, eS, eA, eI, eT, ek, eO, eR, eN, eM, eP, eD, ej;
    e.s(["useOptimisticMagicReconnect", () => eZ], 767158);
    var eL, eF = e.i(999061),
        eU = e.i(399482),
        e$ = e.i(328113),
        ez = e.i(416340),
        eB = e.i(827681),
        eq = e.i(566515),
        eW = e.i(603580);
    let eZ = () => {
        let e, t, r = (0, eF.c)(11),
            {
                authenticationStatus: n,
                setAuthenticationStatus: a,
                setConnectorStatus: i
            } = (0, eW.useSiwxContext)(),
            {
                isLoggedIn: o,
                isLoggedInPending: s,
                authenticatedUser: l
            } = (0, eq.useAuthenticationContext)(),
            c = (0, e$.useLatest)(n);
        r[0] !== l || r[1] !== o || r[2] !== s || r[3] !== c || r[4] !== a || r[5] !== i ? (e = () => {
            if (!s) {
                let e = (0, eU.createWalletCache)();
                c.current === eB.AuthenticationStatusStates.PERSISTING && o && l ? .type === "magic" && l.address && e.state.getMagicState({
                    connectionStates: ["ready"]
                }) && (a(eB.AuthenticationStatusStates.SUCCESS), i(eB.ConnectorStates.CONNECTED))
            }
        }, r[0] = l, r[1] = o, r[2] = s, r[3] = c, r[4] = a, r[5] = i, r[6] = e) : e = r[6], r[7] !== l || r[8] !== o || r[9] !== s ? (t = [o, s, l], r[7] = l, r[8] = o, r[9] = s, r[10] = t) : t = r[10], ez.default.useEffect(e, t)
    };
    var eV = e.i(284553),
        eK = ((t = eK || {}).MissingApiKey = "MISSING_API_KEY", t.ModalNotReady = "MODAL_NOT_READY", t.ConnectionLost = "CONNECTION_WAS_LOST", t.MalformedResponse = "MALFORMED_RESPONSE", t.InvalidArgument = "INVALID_ARGUMENT", t.ExtensionNotInitialized = "EXTENSION_NOT_INITIALIZED", t.IncompatibleExtensions = "INCOMPATIBLE_EXTENSIONS", t),
        eH = ((r = eH || {}).SyncWeb3Method = "SYNC_WEB3_METHOD", r.DuplicateIframe = "DUPLICATE_IFRAME", r.ReactNativeEndpointConfiguration = "REACT_NATIVE_ENDPOINT_CONFIGURATION", r.DeprecationNotice = "DEPRECATION_NOTICE", r.ProductAnnouncement = "ANNOUNCEMENT", r),
        eG = ((n = eG || {})[n.ParseError = -32700] = "ParseError", n[n.InvalidRequest = -32600] = "InvalidRequest", n[n.MethodNotFound = -32601] = "MethodNotFound", n[n.InvalidParams = -32602] = "InvalidParams", n[n.InternalError = -32603] = "InternalError", n[n.MagicLinkFailedVerification = -1e4] = "MagicLinkFailedVerification", n[n.MagicLinkExpired = -10001] = "MagicLinkExpired", n[n.MagicLinkRateLimited = -10002] = "MagicLinkRateLimited", n[n.MagicLinkInvalidRedirectURL = -10006] = "MagicLinkInvalidRedirectURL", n[n.UserAlreadyLoggedIn = -10003] = "UserAlreadyLoggedIn", n[n.UpdateEmailFailed = -10004] = "UpdateEmailFailed", n[n.UserRequestEditEmail = -10005] = "UserRequestEditEmail", n[n.InactiveRecipient = -10010] = "InactiveRecipient", n[n.AccessDeniedToUser = -10011] = "AccessDeniedToUser", n[n.RedirectLoginComplete = -10015] = "RedirectLoginComplete", n[n.DpopInvalidated = -10019] = "DpopInvalidated", n),
        eQ = ((a = eQ || {}).PROVIDER = "magic_3pw_provider", a.ADDRESS = "magic_3pw_address", a.CHAIN_ID = "magic_3pw_chainId", a),
        eJ = ((i = eJ || {}).WalletConnected = "wallet_connected", i.WalletRejected = "wallet_rejected", i.Web3ModalSelected = "web3modal_selected", i),
        eY = ((o = eY || {}).LoginWithSms = "magic_auth_login_with_sms", o.LoginWithEmailOTP = "magic_auth_login_with_email_otp", o.LoginWithMagicLink = "magic_auth_login_with_magic_link", o.LoginWithCredential = "magic_auth_login_with_credential", o.SetAuthorizationToken = "magic_auth_set_authorization_token", o.GetIdToken = "magic_auth_get_id_token", o.GenerateIdToken = "magic_auth_generate_id_token", o.GetMetadata = "magic_auth_get_metadata", o.IsLoggedIn = "magic_is_logged_in", o.Logout = "magic_auth_logout", o.UpdateEmail = "magic_auth_update_email", o.UserSettings = "magic_auth_settings", o.UserSettingsTestMode = "magic_auth_settings_testing_mode", o.LoginWithSmsTestMode = "magic_auth_login_with_sms_testing_mode", o.LoginWithEmailOTPTestMode = "magic_auth_login_with_email_otp_testing_mode", o.LoginWithMagicLinkTestMode = "magic_login_with_magic_link_testing_mode", o.LoginWithCredentialTestMode = "magic_auth_login_with_credential_testing_mode", o.GetIdTokenTestMode = "magic_auth_get_id_token_testing_mode", o.GenerateIdTokenTestMode = "magic_auth_generate_id_token_testing_mode", o.GetMetadataTestMode = "magic_auth_get_metadata_testing_mode", o.IsLoggedInTestMode = "magic_auth_is_logged_in_testing_mode", o.LogoutTestMode = "magic_auth_logout_testing_mode", o.UpdateEmailTestMode = "magic_auth_update_email_testing_mode", o.IntermediaryEvent = "magic_intermediary_event", o.RequestAccounts = "eth_requestAccounts", o.GetInfo = "magic_get_info", o.ShowUI = "magic_wallet", o.NFTPurchase = "magic_nft_purchase", o.NFTCheckout = "magic_nft_checkout", o.NFTTransfer = "magic_nft_transfer", o.RequestUserInfoWithUI = "mc_request_user_info", o.Disconnect = "mc_disconnect", o.RecoverAccount = "magic_auth_recover_account", o.RecoverAccountTestMode = "magic_auth_recover_account_testing_mode", o.MagicBoxHeartBeat = "magic_box_heart_beat", o.AutoConnect = "mc_auto_connect", o.Login = "mc_login", o.EncryptV1 = "magic_auth_encrypt_v1", o.DecryptV1 = "magic_auth_decrypt_v1", o.ShowNFTs = "magic_show_nfts", o.ShowOnRamp = "magic_show_fiat_onramp", o.ShowSendTokensUI = "magic_show_send_tokens_ui", o.ShowAddress = "magic_show_address", o.ShowBalances = "magic_show_balances", o.SendGaslessTransaction = "eth_sendGaslessTransaction", o.RevealPK = "magic_reveal_key", o.EnableMFA = "magic_auth_enable_mfa_flow", o.DisableMFA = "magic_auth_disable_mfa_flow", o.GetMultichainPublicAddress = "magic_get_multichain_public_address", o),
        eX = ["magic_intermediary_event", "magic_nft_checkout", "mc_login"],
        e0 = ((s = e0 || {}).MAGIC_HANDLE_RESPONSE = "MAGIC_HANDLE_RESPONSE", s.MAGIC_OVERLAY_READY = "MAGIC_OVERLAY_READY", s.MAGIC_SHOW_OVERLAY = "MAGIC_SHOW_OVERLAY", s.MAGIC_HIDE_OVERLAY = "MAGIC_HIDE_OVERLAY", s.MAGIC_HANDLE_EVENT = "MAGIC_HANDLE_EVENT", s.MAGIC_MG_BOX_SEND_RECEIPT = "MAGIC_MG_BOX_SEND_RECEIPT", s.MAGIC_SEND_PRODUCT_ANNOUNCEMENT = "MAGIC_SEND_PRODUCT_ANNOUNCEMENT", s.MAGIC_PONG = "MAGIC_PONG", s.MAGIC_POPUP_RESPONSE = "MAGIC_POPUP_RESPONSE", s.MAGIC_POPUP_OAUTH_VERIFY_RESPONSE = "MAGIC_POPUP_OAUTH_VERIFY_RESPONSE", s),
        e1 = ((l = e1 || {}).MAGIC_HANDLE_REQUEST = "MAGIC_HANDLE_REQUEST", l.MAGIC_PING = "MAGIC_PING", l),
        e2 = ((c = e2 || {}).UpdateEmail = "update-email", c.MFA = "mfa", c.Recovery = "recovery", c),
        e6 = ((u = e6 || {}).Retry = "retry", u),
        e5 = ((d = e5 || {}).EmailSent = "email-sent", d.EmailNotDeliverable = "email-not-deliverable", d),
        e3 = ((f = e3 || {}).VerifyEmailOtp = "verify-email-otp", f.VerifyMFACode = "verify-mfa-code", f.LostDevice = "lost-device", f.VerifyRecoveryCode = "verify-recovery-code", f.Cancel = "cancel", f),
        e4 = ((p = e4 || {}).VerifySmsOtp = "verify-sms-otp", p.Cancel = "cancel", p.Retry = "retry", p),
        e8 = ((h = e8 || {}).SmsOTPSent = "sms-otp-sent", h.InvalidSmsOtp = "invalid-sms-otp", h.ExpiredSmsOtp = "expired-sms-otp", h),
        e7 = ((m = e7 || {}).EmailOTPSent = "email-otp-sent", m.InvalidEmailOtp = "invalid-email-otp", m.InvalidMfaOtp = "invalid-mfa-otp", m.ExpiredEmailOtp = "expired-email-otp", m.MfaSentHandle = "mfa-sent-handle", m.RecoveryCodeSentHandle = "recovery-code-sent-handle", m.InvalidRecoveryCode = "invalid-recovery-code", m.RecoveryCodeSuccess = "recovery-code-success", m.LoginThrottled = "login-throttled", m),
        e9 = ((y = e9 || {}).Retry = "device-retry", y),
        te = ((g = te || {}).DeviceApproved = "device-approved", g.DeviceNeedsApproval = "device-needs-approval", g.DeviceVerificationLinkExpired = "device-verification-link-expired", g.DeviceVerificationEmailSent = "device-verification-email-sent", g),
        tt = ((b = tt || {}).Retry = "Recency/auth-factor-retry", b.Cancel = "Recency/auth-factor-verification-cancel", b.VerifyEmailOtp = "Recency/auth-factor-verify-email-otp", b.VerifyMFACode = "Recency/verify-mfa-code", b),
        tr = ((v = tr || {}).PrimaryAuthFactorNeedsVerification = "Recency/auth-factor-needs-verification", v.PrimaryAuthFactorVerified = "Recency/auth-factor-verified", v.InvalidEmailOtp = "Recency/auth-factor-invalid-email-otp", v.EmailExpired = "Recency/auth-factor-verification-email-expired", v.EmailSent = "Recency/auth-factor-verification-email-sent", v.EmailNotDeliverable = "Recency/auth-factor-verification-email-not-deliverable", v),
        tn = ((x = tn || {}).RetryWithNewEmail = "UpdateEmail/retry-with-new-email", x.Cancel = "UpdateEmail/new-email-verification-cancel", x.VerifyEmailOtp = "UpdateEmail/new-email-verify-otp", x),
        ta = ((w = ta || {}).NewAuthFactorNeedsVerification = "UpdateEmail/new-email-needs-verification", w.EmailUpdated = "UpdateEmail/email-updated", w.InvalidEmailOtp = "UpdateEmail/new-email-invalid-email-otp", w.EmailExpired = "UpdateEmail/new-email-verification-email-expired", w.EmailSent = "UpdateEmail/new-email-verification-email-sent", w.EmailNotDeliverable = "UpdateEmail/new-email-verification-email-not-deliverable", w.InvalidEmail = "UpdateEmail/new-email-invalid", w.EmailAlreadyExists = "UpdateEmail/new-email-already-exists", w),
        ti = ((_ = ti || {}).IDTokenCreated = "Auth/id-token-created", _),
        to = ((C = to || {}).Cancel = "Farcaster/cancel", C),
        ts = ((E = ts || {}).MFASecretGenerated = "mfa-secret-generated", E.InvalidMFAOtp = "invalid-mfa-otp", E.MFARecoveryCodes = "mfa-recovery-codes", E),
        tl = ((S = tl || {}).VerifyMFACode = "verify-mfa-code", S.Cancel = "cancel-mfa-setup", S),
        tc = ((A = tc || {}).MFACodeRequested = "mfa-code-requested", A.InvalidMFAOtp = "invalid-mfa-otp", A.InvalidRecoveryCode = "invalid-recovery-code", A),
        tu = ((I = tu || {}).VerifyMFACode = "verify-mfa-code", I.LostDevice = "lost-device", I.Cancel = "cancel-mfa-disable", I),
        td = ((T = td || {}).Harmony = "HARMONY", T),
        tf = ((k = tf || {}).ClosedByUser = "closed-by-user", k),
        tp = ((O = tp || {}).ClosedByUser = "closed-by-user-on-received", O),
        th = ((R = th || {}).EnterNewPhoneNumber = "enter-new-phone-number", R.EnterOtpCode = "enter-otp-code", R.RecoveryFactorAlreadyExists = "recovery-factor-already-exists", R.MalformedPhoneNumber = "malformed-phone-number", R.InvalidOtpCode = "invalid-otp-code", R.RecoveryFactorUpdated = "recovery-factor-updated", R.RecoveryFactorDeleted = "recovery-factor-deleted", R),
        tm = ((N = tm || {}).SendNewPhoneNumber = "send-new-phone-number", N.SendOtpCode = "send-otp-code", N.Cancel = "cancel", N.StartEditPhoneNumber = "start-edit-phone-number", N),
        ty = ((M = ty || {}).PhoneNumber = "phone_number", M),
        tg = ((P = tg || {}).SmsOtpSent = "sms-otp-sent", P.LoginThrottled = "login-throttled", P.InvalidSmsOtp = "invalid-sms-otp", P.SmsVerified = "sms-verified", P.AccountRecovered = "account-recovered", P.UpdateEmailRequired = "update-email-required", P),
        tb = ((D = tb || {}).Cancel = "cancel", D.VerifyOtp = "verify-otp-code", D.ResendSms = "resend-sms-otp", D.UpdateEmail = "update-email", D),
        tv = ((j = tv || {}).Success = "nft-checkout-success", j.Failure = "nft-checkout-failure", j.Initiated = "nft-checkout-initiated", j.Disconnect = "disconnect", j),
        tx = ((L = tx || {}).WalletInfoFetched = "Wallet/wallet-info-fetched", L),
        tw = ((F = tw || {}).CloseMagicWindow = "close-magic-window", F),
        t_ = ((U = t_ || {}).PopupUrl = "popup-url", U),
        tC = (($ = tC || {}).PopupEvent = "popup-event", $.Cancel = "cancel", $),
        tE = Object.create,
        tS = Object.defineProperty,
        tA = Object.getOwnPropertyDescriptor,
        tI = Object.getOwnPropertyNames,
        tT = Object.getPrototypeOf,
        tk = Object.prototype.hasOwnProperty,
        tO = (z = (e, t) => {
            var r = Object.prototype.hasOwnProperty,
                n = "~";

            function a() {}

            function i(e, t, r) {
                this.fn = e, this.context = t, this.once = r || !1
            }

            function o(e, t, r, a, o) {
                if ("function" != typeof r) throw TypeError("The listener must be a function");
                var s = new i(r, a || e, o),
                    l = n ? n + t : t;
                return e._events[l] ? e._events[l].fn ? e._events[l] = [e._events[l], s] : e._events[l].push(s) : (e._events[l] = s, e._eventsCount++), e
            }

            function s(e, t) {
                0 == --e._eventsCount ? e._events = new a : delete e._events[t]
            }

            function l() {
                this._events = new a, this._eventsCount = 0
            }
            Object.create && (a.prototype = Object.create(null), new a().__proto__ || (n = !1)), l.prototype.eventNames = function() {
                var e, t, a = [];
                if (0 === this._eventsCount) return a;
                for (t in e = this._events) r.call(e, t) && a.push(n ? t.slice(1) : t);
                return Object.getOwnPropertySymbols ? a.concat(Object.getOwnPropertySymbols(e)) : a
            }, l.prototype.listeners = function(e) {
                var t = n ? n + e : e,
                    r = this._events[t];
                if (!r) return [];
                if (r.fn) return [r.fn];
                for (var a = 0, i = r.length, o = Array(i); a < i; a++) o[a] = r[a].fn;
                return o
            }, l.prototype.listenerCount = function(e) {
                var t = n ? n + e : e,
                    r = this._events[t];
                return r ? r.fn ? 1 : r.length : 0
            }, l.prototype.emit = function(e, t, r, a, i, o) {
                var s = n ? n + e : e;
                if (!this._events[s]) return !1;
                var l, c, u = this._events[s],
                    d = arguments.length;
                if (u.fn) {
                    switch (u.once && this.removeListener(e, u.fn, void 0, !0), d) {
                        case 1:
                            return u.fn.call(u.context), !0;
                        case 2:
                            return u.fn.call(u.context, t), !0;
                        case 3:
                            return u.fn.call(u.context, t, r), !0;
                        case 4:
                            return u.fn.call(u.context, t, r, a), !0;
                        case 5:
                            return u.fn.call(u.context, t, r, a, i), !0;
                        case 6:
                            return u.fn.call(u.context, t, r, a, i, o), !0
                    }
                    for (c = 1, l = Array(d - 1); c < d; c++) l[c - 1] = arguments[c];
                    u.fn.apply(u.context, l)
                } else {
                    var f, p = u.length;
                    for (c = 0; c < p; c++) switch (u[c].once && this.removeListener(e, u[c].fn, void 0, !0), d) {
                        case 1:
                            u[c].fn.call(u[c].context);
                            break;
                        case 2:
                            u[c].fn.call(u[c].context, t);
                            break;
                        case 3:
                            u[c].fn.call(u[c].context, t, r);
                            break;
                        case 4:
                            u[c].fn.call(u[c].context, t, r, a);
                            break;
                        default:
                            if (!l)
                                for (f = 1, l = Array(d - 1); f < d; f++) l[f - 1] = arguments[f];
                            u[c].fn.apply(u[c].context, l)
                    }
                }
                return !0
            }, l.prototype.on = function(e, t, r) {
                return o(this, e, t, r, !1)
            }, l.prototype.once = function(e, t, r) {
                return o(this, e, t, r, !0)
            }, l.prototype.removeListener = function(e, t, r, a) {
                var i = n ? n + e : e;
                if (!this._events[i]) return this;
                if (!t) return s(this, i), this;
                var o = this._events[i];
                if (o.fn) o.fn !== t || a && !o.once || r && o.context !== r || s(this, i);
                else {
                    for (var l = 0, c = [], u = o.length; l < u; l++)(o[l].fn !== t || a && !o[l].once || r && o[l].context !== r) && c.push(o[l]);
                    c.length ? this._events[i] = 1 === c.length ? c[0] : c : s(this, i)
                }
                return this
            }, l.prototype.removeAllListeners = function(e) {
                var t;
                return e ? (t = n ? n + e : e, this._events[t] && s(this, t)) : (this._events = new a, this._eventsCount = 0), this
            }, l.prototype.off = l.prototype.removeListener, l.prototype.addListener = l.prototype.on, l.prefixed = n, l.EventEmitter = l, "u" > typeof t && (t.exports = l)
        }, () => (B || z((B = {
            exports: {}
        }).exports, B), B.exports)),
        tR = {
            SEMVER_SPEC_VERSION: "2.0.0",
            MAX_LENGTH: 256,
            MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER || 0x1fffffffffffff,
            MAX_SAFE_COMPONENT_LENGTH: 16
        },
        tN = "object" == typeof eV.default && eV.default.env && eV.default.env.NODE_DEBUG && /\bsemver\b/i.test(eV.default.env.NODE_DEBUG) ? (...e) => console.error("SEMVER", ...e) : () => {},
        tM = (function(e, t) {
            let {
                MAX_SAFE_COMPONENT_LENGTH: r
            } = tR, n = (t = e.exports = {}).re = [], a = t.src = [], i = t.t = {}, o = 0, s = (e, t, r) => {
                let s = o++;
                tN(s, t), i[e] = s, a[s] = t, n[s] = new RegExp(t, r ? "g" : void 0)
            };
            s("NUMERICIDENTIFIER", "0|[1-9]\\d*"), s("NUMERICIDENTIFIERLOOSE", "[0-9]+"), s("NONNUMERICIDENTIFIER", "\\d*[a-zA-Z-][a-zA-Z0-9-]*"), s("MAINVERSION", `(${a[i.NUMERICIDENTIFIER]})\\.(${a[i.NUMERICIDENTIFIER]})\\.(${a[i.NUMERICIDENTIFIER]})`), s("MAINVERSIONLOOSE", `(${a[i.NUMERICIDENTIFIERLOOSE]})\\.(${a[i.NUMERICIDENTIFIERLOOSE]})\\.(${a[i.NUMERICIDENTIFIERLOOSE]})`), s("PRERELEASEIDENTIFIER", `(?:${a[i.NUMERICIDENTIFIER]}|${a[i.NONNUMERICIDENTIFIER]})`), s("PRERELEASEIDENTIFIERLOOSE", `(?:${a[i.NUMERICIDENTIFIERLOOSE]}|${a[i.NONNUMERICIDENTIFIER]})`), s("PRERELEASE", `(?:-(${a[i.PRERELEASEIDENTIFIER]}(?:\\.${a[i.PRERELEASEIDENTIFIER]})*))`), s("PRERELEASELOOSE", `(?:-?(${a[i.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[i.PRERELEASEIDENTIFIERLOOSE]})*))`), s("BUILDIDENTIFIER", "[0-9A-Za-z-]+"), s("BUILD", `(?:\\+(${a[i.BUILDIDENTIFIER]}(?:\\.${a[i.BUILDIDENTIFIER]})*))`), s("FULLPLAIN", `v?${a[i.MAINVERSION]}${a[i.PRERELEASE]}?${a[i.BUILD]}?`), s("FULL", `^${a[i.FULLPLAIN]}$`), s("LOOSEPLAIN", `[v=\\s]*${a[i.MAINVERSIONLOOSE]}${a[i.PRERELEASELOOSE]}?${a[i.BUILD]}?`), s("LOOSE", `^${a[i.LOOSEPLAIN]}$`), s("GTLT", "((?:<|>)?=?)"), s("XRANGEIDENTIFIERLOOSE", `${a[i.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), s("XRANGEIDENTIFIER", `${a[i.NUMERICIDENTIFIER]}|x|X|\\*`), s("XRANGEPLAIN", `[v=\\s]*(${a[i.XRANGEIDENTIFIER]})(?:\\.(${a[i.XRANGEIDENTIFIER]})(?:\\.(${a[i.XRANGEIDENTIFIER]})(?:${a[i.PRERELEASE]})?${a[i.BUILD]}?)?)?`), s("XRANGEPLAINLOOSE", `[v=\\s]*(${a[i.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[i.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[i.XRANGEIDENTIFIERLOOSE]})(?:${a[i.PRERELEASELOOSE]})?${a[i.BUILD]}?)?)?`), s("XRANGE", `^${a[i.GTLT]}\\s*${a[i.XRANGEPLAIN]}$`), s("XRANGELOOSE", `^${a[i.GTLT]}\\s*${a[i.XRANGEPLAINLOOSE]}$`), s("COERCE", `(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`), s("COERCERTL", a[i.COERCE], !0), s("LONETILDE", "(?:~>?)"), s("TILDETRIM", `(\\s*)${a[i.LONETILDE]}\\s+`, !0), t.tildeTrimReplace = "$1~", s("TILDE", `^${a[i.LONETILDE]}${a[i.XRANGEPLAIN]}$`), s("TILDELOOSE", `^${a[i.LONETILDE]}${a[i.XRANGEPLAINLOOSE]}$`), s("LONECARET", "(?:\\^)"), s("CARETTRIM", `(\\s*)${a[i.LONECARET]}\\s+`, !0), t.caretTrimReplace = "$1^", s("CARET", `^${a[i.LONECARET]}${a[i.XRANGEPLAIN]}$`), s("CARETLOOSE", `^${a[i.LONECARET]}${a[i.XRANGEPLAINLOOSE]}$`), s("COMPARATORLOOSE", `^${a[i.GTLT]}\\s*(${a[i.LOOSEPLAIN]})$|^$`), s("COMPARATOR", `^${a[i.GTLT]}\\s*(${a[i.FULLPLAIN]})$|^$`), s("COMPARATORTRIM", `(\\s*)${a[i.GTLT]}\\s*(${a[i.LOOSEPLAIN]}|${a[i.XRANGEPLAIN]})`, !0), t.comparatorTrimReplace = "$1$2$3", s("HYPHENRANGE", `^\\s*(${a[i.XRANGEPLAIN]})\\s+-\\s+(${a[i.XRANGEPLAIN]})\\s*$`), s("HYPHENRANGELOOSE", `^\\s*(${a[i.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[i.XRANGEPLAINLOOSE]})\\s*$`), s("STAR", "(<|>)?=?\\s*\\*"), s("GTE0", "^\\s*>=\\s*0.0.0\\s*$"), s("GTE0PRE", "^\\s*>=\\s*0.0.0-0\\s*$")
        }(q = {
            exports: {}
        }, q.exports), q.exports),
        tP = /^[0-9]+$/,
        tD = (e, t) => {
            let r = tP.test(e),
                n = tP.test(t);
            return r && n && (e *= 1, t *= 1), e === t ? 0 : r && !n ? -1 : n && !r ? 1 : e < t ? -1 : 1
        },
        {
            MAX_LENGTH: tj,
            MAX_SAFE_INTEGER: tL
        } = tR,
        {
            re: tF,
            t: tU
        } = tM,
        {
            compareIdentifiers: t$
        } = {
            compareIdentifiers: tD,
            rcompareIdentifiers: (e, t) => tD(t, e)
        },
        tz = class e {
            constructor(t, r) {
                if (r && "object" == typeof r || (r = {
                        loose: !!r,
                        includePrerelease: !1
                    }), t instanceof e) {
                    if (!!r.loose === t.loose && !!r.includePrerelease === t.includePrerelease) return t;
                    t = t.version
                } else if ("string" != typeof t) throw TypeError(`Invalid Version: ${t}`);
                if (t.length > tj) throw TypeError(`version is longer than ${tj} characters`);
                tN("SemVer", t, r), this.options = r, this.loose = !!r.loose, this.includePrerelease = !!r.includePrerelease;
                let n = t.trim().match(r.loose ? tF[tU.LOOSE] : tF[tU.FULL]);
                if (!n) throw TypeError(`Invalid Version: ${t}`);
                if (this.raw = t, this.major = +n[1], this.minor = +n[2], this.patch = +n[3], this.major > tL || this.major < 0) throw TypeError("Invalid major version");
                if (this.minor > tL || this.minor < 0) throw TypeError("Invalid minor version");
                if (this.patch > tL || this.patch < 0) throw TypeError("Invalid patch version");
                n[4] ? this.prerelease = n[4].split(".").map(e => {
                    if (/^[0-9]+$/.test(e)) {
                        let t = +e;
                        if (t >= 0 && t < tL) return t
                    }
                    return e
                }) : this.prerelease = [], this.build = n[5] ? n[5].split(".") : [], this.format()
            }
            format() {
                return this.version = `${this.major}.${this.minor}.${this.patch}`, this.prerelease.length && (this.version += `-${this.prerelease.join(".")}`), this.version
            }
            toString() {
                return this.version
            }
            compare(t) {
                if (tN("SemVer.compare", this.version, this.options, t), !(t instanceof e)) {
                    if ("string" == typeof t && t === this.version) return 0;
                    t = new e(t, this.options)
                }
                return t.version === this.version ? 0 : this.compareMain(t) || this.comparePre(t)
            }
            compareMain(t) {
                return t instanceof e || (t = new e(t, this.options)), t$(this.major, t.major) || t$(this.minor, t.minor) || t$(this.patch, t.patch)
            }
            comparePre(t) {
                if (t instanceof e || (t = new e(t, this.options)), this.prerelease.length && !t.prerelease.length) return -1;
                if (!this.prerelease.length && t.prerelease.length) return 1;
                if (!this.prerelease.length && !t.prerelease.length) return 0;
                let r = 0;
                do {
                    let e = this.prerelease[r],
                        n = t.prerelease[r];
                    if (tN("prerelease compare", r, e, n), void 0 === e && void 0 === n) return 0;
                    if (void 0 === n) return 1;
                    if (void 0 === e) return -1;
                    if (e !== n) return t$(e, n)
                } while (++r)
            }
            compareBuild(t) {
                t instanceof e || (t = new e(t, this.options));
                let r = 0;
                do {
                    let e = this.build[r],
                        n = t.build[r];
                    if (tN("prerelease compare", r, e, n), void 0 === e && void 0 === n) return 0;
                    if (void 0 === n) return 1;
                    if (void 0 === e) return -1;
                    if (e !== n) return t$(e, n)
                } while (++r)
            }
            inc(e, t) {
                switch (e) {
                    case "premajor":
                        this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", t);
                        break;
                    case "preminor":
                        this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", t);
                        break;
                    case "prepatch":
                        this.prerelease.length = 0, this.inc("patch", t), this.inc("pre", t);
                        break;
                    case "prerelease":
                        0 === this.prerelease.length && this.inc("patch", t), this.inc("pre", t);
                        break;
                    case "major":
                        0 === this.minor && 0 === this.patch && 0 !== this.prerelease.length || this.major++, this.minor = 0, this.patch = 0, this.prerelease = [];
                        break;
                    case "minor":
                        0 === this.patch && 0 !== this.prerelease.length || this.minor++, this.patch = 0, this.prerelease = [];
                        break;
                    case "patch":
                        0 === this.prerelease.length && this.patch++, this.prerelease = [];
                        break;
                    case "pre":
                        if (0 === this.prerelease.length) this.prerelease = [0];
                        else {
                            let e = this.prerelease.length;
                            for (; --e >= 0;) "number" == typeof this.prerelease[e] && (this.prerelease[e]++, e = -2); - 1 === e && this.prerelease.push(0)
                        }
                        t && (this.prerelease[0] === t ? isNaN(this.prerelease[1]) && (this.prerelease = [t, 0]) : this.prerelease = [t, 0]);
                        break;
                    default:
                        throw Error(`invalid increment argument: ${e}`)
                }
                return this.format(), this.raw = this.version, this
            }
        },
        tB = (e, t, r) => new tz(e, r).compare(new tz(t, r)),
        tq = (e, t, r, n) => {
            switch (t) {
                case "===":
                    return "object" == typeof e && (e = e.version), "object" == typeof r && (r = r.version), e === r;
                case "!==":
                    return "object" == typeof e && (e = e.version), "object" == typeof r && (r = r.version), e !== r;
                case "":
                case "=":
                case "==":
                    return 0 === tB(e, r, n);
                case "!=":
                    return 0 !== tB(e, r, n);
                case ">":
                    return tB(e, r, n) > 0;
                case ">=":
                    return tB(e, r, n) >= 0;
                case "<":
                    return 0 > tB(e, r, n);
                case "<=":
                    return 0 >= tB(e, r, n);
                default:
                    throw TypeError(`Invalid operator: ${t}`)
            }
        },
        tW = Symbol("SemVer ANY"),
        tZ = class e {
            static get ANY() {
                return tW
            }
            constructor(t, r) {
                if (r && "object" == typeof r || (r = {
                        loose: !!r,
                        includePrerelease: !1
                    }), t instanceof e) {
                    if (!!r.loose === t.loose) return t;
                    t = t.value
                }
                tN("comparator", t, r), this.options = r, this.loose = !!r.loose, this.parse(t), this.semver === tW ? this.value = "" : this.value = this.operator + this.semver.version, tN("comp", this)
            }
            parse(e) {
                let t = this.options.loose ? tV[tK.COMPARATORLOOSE] : tV[tK.COMPARATOR],
                    r = e.match(t);
                if (!r) throw TypeError(`Invalid comparator: ${e}`);
                this.operator = void 0 !== r[1] ? r[1] : "", "=" === this.operator && (this.operator = ""), r[2] ? this.semver = new tz(r[2], this.options.loose) : this.semver = tW
            }
            toString() {
                return this.value
            }
            test(e) {
                if (tN("Comparator.test", e, this.options.loose), this.semver === tW || e === tW) return !0;
                if ("string" == typeof e) try {
                    e = new tz(e, this.options)
                } catch {
                    return !1
                }
                return tq(e, this.operator, this.semver, this.options)
            }
            intersects(t, r) {
                if (!(t instanceof e)) throw TypeError("a Comparator is required");
                if (r && "object" == typeof r || (r = {
                        loose: !!r,
                        includePrerelease: !1
                    }), "" === this.operator) return "" === this.value || new tH(t.value, r).test(this.value);
                if ("" === t.operator) return "" === t.value || new tH(this.value, r).test(t.semver);
                let n = (">=" === this.operator || ">" === this.operator) && (">=" === t.operator || ">" === t.operator),
                    a = ("<=" === this.operator || "<" === this.operator) && ("<=" === t.operator || "<" === t.operator),
                    i = this.semver.version === t.semver.version,
                    o = (">=" === this.operator || "<=" === this.operator) && (">=" === t.operator || "<=" === t.operator),
                    s = tq(this.semver, "<", t.semver, r) && (">=" === this.operator || ">" === this.operator) && ("<=" === t.operator || "<" === t.operator),
                    l = tq(this.semver, ">", t.semver, r) && ("<=" === this.operator || "<" === this.operator) && (">=" === t.operator || ">" === t.operator);
                return n || a || i && o || s || l
            }
        },
        {
            re: tV,
            t: tK
        } = tM,
        tH = class e {
            constructor(t, r) {
                if (r && "object" == typeof r || (r = {
                        loose: !!r,
                        includePrerelease: !1
                    }), t instanceof e) return !!r.loose === t.loose && !!r.includePrerelease === t.includePrerelease ? t : new e(t.raw, r);
                if (t instanceof tZ) return this.raw = t.value, this.set = [
                    [t]
                ], this.format(), this;
                if (this.options = r, this.loose = !!r.loose, this.includePrerelease = !!r.includePrerelease, this.raw = t, this.set = t.split(/\s*\|\|\s*/).map(e => this.parseRange(e.trim())).filter(e => e.length), !this.set.length) throw TypeError(`Invalid SemVer Range: ${t}`);
                this.format()
            }
            format() {
                return this.range = this.set.map(e => e.join(" ").trim()).join("||").trim(), this.range
            }
            toString() {
                return this.range
            }
            parseRange(e) {
                let {
                    loose: t
                } = this.options;
                e = e.trim();
                let r = t ? tG[tQ.HYPHENRANGELOOSE] : tG[tQ.HYPHENRANGE];
                tN("hyphen replace", e = e.replace(r, rt(this.options.includePrerelease))), tN("comparator trim", e = e.replace(tG[tQ.COMPARATORTRIM], tJ), tG[tQ.COMPARATORTRIM]), e = (e = (e = e.replace(tG[tQ.TILDETRIM], tY)).replace(tG[tQ.CARETTRIM], tX)).split(/\s+/).join(" ");
                let n = t ? tG[tQ.COMPARATORLOOSE] : tG[tQ.COMPARATOR];
                return e.split(" ").map(e => t1(e, this.options)).join(" ").split(/\s+/).map(e => re(e, this.options)).filter(this.options.loose ? e => !!e.match(n) : () => !0).map(e => new tZ(e, this.options))
            }
            intersects(t, r) {
                if (!(t instanceof e)) throw TypeError("a Range is required");
                return this.set.some(e => t0(e, r) && t.set.some(t => t0(t, r) && e.every(e => t.every(t => e.intersects(t, r)))))
            }
            test(e) {
                if (!e) return !1;
                if ("string" == typeof e) try {
                    e = new tz(e, this.options)
                } catch {
                    return !1
                }
                for (let t = 0; t < this.set.length; t++)
                    if (rr(this.set[t], e, this.options)) return !0;
                return !1
            }
        },
        {
            re: tG,
            t: tQ,
            comparatorTrimReplace: tJ,
            tildeTrimReplace: tY,
            caretTrimReplace: tX
        } = tM,
        t0 = (e, t) => {
            let r = !0,
                n = e.slice(),
                a = n.pop();
            for (; r && n.length;) r = n.every(e => a.intersects(e, t)), a = n.pop();
            return r
        },
        t1 = (e, t) => (tN("comp", e, t), tN("caret", e = t3(e, t)), tN("tildes", e = t6(e, t)), tN("xrange", e = t8(e, t)), tN("stars", e = t9(e, t)), e),
        t2 = e => !e || "x" === e.toLowerCase() || "*" === e,
        t6 = (e, t) => e.trim().split(/\s+/).map(e => t5(e, t)).join(" "),
        t5 = (e, t) => {
            let r = t.loose ? tG[tQ.TILDELOOSE] : tG[tQ.TILDE];
            return e.replace(r, (t, r, n, a, i) => {
                let o;
                return tN("tilde", e, t, r, n, a, i), t2(r) ? o = "" : t2(n) ? o = `>=${r}.0.0 <${+r+1}.0.0-0` : t2(a) ? o = `>=${r}.${n}.0 <${r}.${+n+1}.0-0` : i ? (tN("replaceTilde pr", i), o = `>=${r}.${n}.${a}-${i} <${r}.${+n+1}.0-0`) : o = `>=${r}.${n}.${a} <${r}.${+n+1}.0-0`, tN("tilde return", o), o
            })
        },
        t3 = (e, t) => e.trim().split(/\s+/).map(e => t4(e, t)).join(" "),
        t4 = (e, t) => {
            tN("caret", e, t);
            let r = t.loose ? tG[tQ.CARETLOOSE] : tG[tQ.CARET],
                n = t.includePrerelease ? "-0" : "";
            return e.replace(r, (t, r, a, i, o) => {
                let s;
                return tN("caret", e, t, r, a, i, o), t2(r) ? s = "" : t2(a) ? s = `>=${r}.0.0${n} <${+r+1}.0.0-0` : t2(i) ? s = "0" === r ? `>=${r}.${a}.0${n} <${r}.${+a+1}.0-0` : `>=${r}.${a}.0${n} <${+r+1}.0.0-0` : o ? (tN("replaceCaret pr", o), s = "0" === r ? "0" === a ? `>=${r}.${a}.${i}-${o} <${r}.${a}.${+i+1}-0` : `>=${r}.${a}.${i}-${o} <${r}.${+a+1}.0-0` : `>=${r}.${a}.${i}-${o} <${+r+1}.0.0-0`) : (tN("no pr"), s = "0" === r ? "0" === a ? `>=${r}.${a}.${i}${n} <${r}.${a}.${+i+1}-0` : `>=${r}.${a}.${i}${n} <${r}.${+a+1}.0-0` : `>=${r}.${a}.${i} <${+r+1}.0.0-0`), tN("caret return", s), s
            })
        },
        t8 = (e, t) => (tN("replaceXRanges", e, t), e.split(/\s+/).map(e => t7(e, t)).join(" ")),
        t7 = (e, t) => {
            e = e.trim();
            let r = t.loose ? tG[tQ.XRANGELOOSE] : tG[tQ.XRANGE];
            return e.replace(r, (r, n, a, i, o, s) => {
                tN("xRange", e, r, n, a, i, o, s);
                let l = t2(a),
                    c = l || t2(i),
                    u = c || t2(o);
                return "=" === n && u && (n = ""), s = t.includePrerelease ? "-0" : "", l ? r = ">" === n || "<" === n ? "<0.0.0-0" : "*" : n && u ? (c && (i = 0), o = 0, ">" === n ? (n = ">=", c ? (a = +a + 1, i = 0) : i = +i + 1, o = 0) : "<=" === n && (n = "<", c ? a = +a + 1 : i = +i + 1), "<" === n && (s = "-0"), r = `${n+a}.${i}.${o}${s}`) : c ? r = `>=${a}.0.0${s} <${+a+1}.0.0-0` : u && (r = `>=${a}.${i}.0${s} <${a}.${+i+1}.0-0`), tN("xRange return", r), r
            })
        },
        t9 = (e, t) => (tN("replaceStars", e, t), e.trim().replace(tG[tQ.STAR], "")),
        re = (e, t) => (tN("replaceGTE0", e, t), e.trim().replace(tG[t.includePrerelease ? tQ.GTE0PRE : tQ.GTE0], "")),
        rt = e => (t, r, n, a, i, o, s, l, c, u, d, f, p) => `${r=t2(n)?"":t2(a)?`>=${n}.0.0${e?"-0":""}`:t2(i)?`>=${n}.${a}.0${e?"-0":""}`:o?`>=${r}`:`>=${r}${e?"-0":""}`} ${l=t2(c)?"":t2(u)?`<${+c+1}.0.0-0`:t2(d)?`<${c}.${+u+1}.0-0`:f?`<=${c}.${u}.${d}-${f}`:e?`<${c}.${u}.${+d+1}-0`:`<=${l}`}`.trim(),
        rr = (e, t, r) => {
            for (let r = 0; r < e.length; r++)
                if (!e[r].test(t)) return !1;
            if (t.prerelease.length && !r.includePrerelease) {
                for (let r = 0; r < e.length; r++)
                    if (tN(e[r].semver), e[r].semver !== tZ.ANY && e[r].semver.prerelease.length > 0) {
                        let n = e[r].semver;
                        if (n.major === t.major && n.minor === t.minor && n.patch === t.patch) return !0
                    }
                return !1
            }
            return !0
        },
        {
            MAX_LENGTH: rn
        } = tR,
        {
            re: ra,
            t: ri
        } = tM,
        {
            re: ro,
            t: rs
        } = tM;

    function rl(e) {
        return String.fromCharCode(parseInt(e.slice(1), 16))
    }

    function rc(e) {
        return `%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`
    }

    function ru(e) {
        return btoa(encodeURIComponent(JSON.stringify(e)).replace(/%[0-9A-F]{2}/g, rl))
    }

    function rd(e) {
        return JSON.parse(decodeURIComponent(Array.from(atob(e), rc).join("")))
    }

    function rf(e) {
        return typeof e > "u"
    }

    function rp(e) {
        return null === e || rf(e)
    }

    function rh(e) {
        if (!e) return !0;
        for (let t in e)
            if (Object.hasOwnProperty.call(e, t)) return !1;
        return !0
    }
    var rm = {},
        ry = {
            "magic-sdk": "magic-sdk",
            "@magic-sdk/react-native": "magic-sdk-rn",
            "@magic-sdk/react-native-bare": "magic-sdk-rn-bare",
            "@magic-sdk/react-native-expo": "magic-sdk-rn-expo"
        },
        rg = class e extends Error {
            constructor(t, r) {
                super(`Magic SDK Error: [${t}] ${r}`), this.code = t, this.rawMessage = r, Object.setPrototypeOf(this, e.prototype)
            }
            __proto__ = Error
        },
        rb = class e extends Error {
            __proto__ = Error;
            code;
            rawMessage;
            data;
            constructor(t) {
                super();
                let r = Number(t ? .code);
                this.rawMessage = t ? .message || "Internal error", this.code = ! function(e) {
                    return !rp(e) && "number" == typeof e && Object.values(eG).includes(e)
                }(r) ? eG.InternalError : r, this.message = `Magic RPC Error: [${this.code}] ${this.rawMessage}`, this.data = t ? .data || void 0, Object.setPrototypeOf(this, e.prototype)
            }
        },
        rv = class {
            constructor(e, t) {
                this.code = e, this.rawMessage = t, this.message = `Magic SDK Warning: [${e}] ${t}`
            }
            message;
            log() {
                console.warn(this.message)
            }
        },
        rx = class e extends Error {
            constructor(t, r, n, a) {
                super(`Magic Extension Error (${t.name}): [${r}] ${n}`), this.code = r, this.rawMessage = n, this.data = a, Object.setPrototypeOf(this, e.prototype)
            }
            __proto__ = Error
        },
        rw = class {
            constructor(e, t, r) {
                this.code = t, this.rawMessage = r, this.message = `Magic Extension Warning (${e.name}): [${t}] ${r}`
            }
            message;
            log() {
                console.warn(this.message)
            }
        };

    function r_() {
        return new rg(eK.ModalNotReady, "Modal is not ready")
    }
    var rC = function*() {
        let e = 0;
        for (;;) e < Number.MAX_SAFE_INTEGER ? yield ++e: e = 0
    }();

    function rE() {
        return rC.next().value
    }
    var rS = {},
        rA = {
            clear: () => rN,
            getItem: () => rk,
            iterate: () => rj,
            key: () => rP,
            keys: () => rD,
            length: () => rM,
            removeItem: () => rR,
            setItem: () => rO
        };
    for (var rI in rA) tS(rS, rI, {
        get: rA[rI],
        enumerable: !0
    });

    function rT(e) {
        return async (...t) => (eL || (eL = await rm.configureStorage()), await eL.ready(), eL[e](...t))
    }
    var rk = rT("getItem"),
        rO = rT("setItem"),
        rR = rT("removeItem"),
        rN = rT("clear"),
        rM = rT("length"),
        rP = rT("key"),
        rD = rT("keys"),
        rj = rT("iterate"),
        rL = "STORE_KEY_PRIVATE_KEY",
        rF = "STORE_KEY_PUBLIC_JWK",
        rU = "ECDSA",
        r$ = {
            name: rU,
            namedCurve: "P-256"
        };

    function rz() {
        let e = "u" > typeof window && !!window.crypto,
            t = e && !!window.crypto.subtle;
        return e && t
    }
    async function rB() {
        var e, t;
        let r, n, a = await rq();
        if (!a) return void console.info("unable to create public key or webcrypto is unsupported");
        let {
            subtle: i
        } = window.crypto, o = await rk(rL);
        if (!o || !i) return void console.info("unable to find private key or webcrypto unsupported");
        let s = {
                iat: Math.floor(new Date().getTime() / 1e3),
                jti: ((n = window.crypto.getRandomValues(new Uint8Array(16)))[6] = 15 & n[6] | 64, n[8] = 191 & n[8] | 128, "" + n[0].toString(16) + n[1].toString(16) + n[2].toString(16) + n[3].toString(16) + "-" + n[4].toString(16) + n[5].toString(16) + "-" + n[6].toString(16) + n[7].toString(16) + "-" + n[8].toString(16) + n[9].toString(16) + "-" + n[10].toString(16) + n[11].toString(16) + n[12].toString(16) + n[13].toString(16) + n[14].toString(16) + n[15].toString(16))
            },
            l = {
                protected: rZ(rV(JSON.stringify({
                    typ: "dpop+jwt",
                    alg: "ES256",
                    jwk: a
                }))),
                claims: rZ(rV(JSON.stringify(s)))
            },
            c = (e = `${l.protected}.${l.claims}`, new TextEncoder().encode(e)),
            u = (t = new Uint8Array(await i.sign({
                name: rU,
                hash: {
                    name: "SHA-256"
                }
            }, o, c)), r = "", t.forEach(e => {
                r += String.fromCharCode(e)
            }), rZ(r));
        return `${l.protected}.${l.claims}.${u}`
    }
    async function rq() {
        return rz() ? (await rk(rF) || await rW(), rk(rF)) : void console.info("webcrypto is not supported")
    }
    async function rW() {
        let {
            subtle: e
        } = window.crypto, t = await e.generateKey(r$, !1, ["sign"]), r = await e.exportKey("jwk", t.publicKey);
        await rO(rL, t.privateKey), await rO(rF, r)
    }

    function rZ(e) {
        return btoa(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+/g, "")
    }

    function rV(e) {
        return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g, (e, t) => String.fromCharCode(parseInt(t, 16)))
    }
    var rK = Symbol("Payload pre-processed by Magic SDK");

    function rH(e) {
        return Object.defineProperty(e, rK, {
            value: !0,
            enumerable: !1
        }), e
    }

    function rG(e) {
        return e[rK] || (e.jsonrpc = e.jsonrpc ? ? "2.0", e.id = rE(), e.method = e.method ? ? "noop", e.params = e.params ? ? [], rH(e)), e
    }

    function rQ(e, t = []) {
        return rH({
            params: t,
            method: e,
            jsonrpc: "2.0",
            id: rE()
        })
    }
    var rJ = class e {
            _jsonrpc;
            _id;
            _result;
            _error;
            constructor(t) {
                t instanceof e ? (this._jsonrpc = t.payload.jsonrpc, this._id = t.payload.id, this._result = t.payload.result, this._error = t.payload.error) : function(e) {
                    return !rp(e) && !rf(e.jsonrpc) && !rf(e.id) && (!rf(e.result) || !rf(e.error))
                }(t) ? (this._jsonrpc = t.jsonrpc, this._id = t.id, this._result = t.result, this._error = t.error) : (this._jsonrpc = t.jsonrpc, this._id = t.id, this._result = void 0, this._error = void 0)
            }
            applyError(e) {
                return this._error = e, this
            }
            applyResult(e) {
                return this._result = e, this
            }
            get hasError() {
                return this._error ? .code === eG.DpopInvalidated && (rR(rF), rR(rL)), "u" > typeof this._error && null !== this._error
            }
            get hasResult() {
                return "u" > typeof this._result
            }
            get payload() {
                return {
                    jsonrpc: this._jsonrpc,
                    id: this._id,
                    result: this._result,
                    error: this._error
                }
            }
        },
        rY = (V = null != (W = tO()) ? tE(tT(W)) : {}, ((e, t, r, n) => {
            if (t && "object" == typeof t || "function" == typeof t)
                for (let a of tI(t)) tk.call(e, a) || a === r || tS(e, a, {
                    get: () => t[a],
                    enumerable: !(n = tA(t, a)) || n.enumerable
                });
            return e
        })(!Z && W && W.__esModule ? V : tS(V, "default", {
            value: W,
            enumerable: !0
        }), W)),
        rX = class extends rY.default {};

    function r0() {
        let e = new rX;
        return {
            emitter: e,
            createChainingEmitterMethod: (t, r) => (...n) => (e[t].apply(e, n), r),
            createBoundEmitterMethod: t => (...r) => e[t].apply(e, r)
        }
    }
    var r1 = Symbol("isPromiEvent");

    function r2(e) {
        return !!e[r1]
    }

    function r6(e) {
        let t = r5(e),
            {
                createBoundEmitterMethod: r,
                createChainingEmitterMethod: n
            } = r0(),
            a = Symbol("Promise.then"),
            i = Symbol("Promise.catch"),
            o = Symbol("Promise.finally"),
            s = (e, t) => (...r) => l(t[e].apply(t, r)),
            l = e => Object.assign(e, {
                [r1]: !0,
                [a]: e[a] || e.then,
                [i]: e[i] || e.catch,
                [o]: e[o] || e.finally,
                then: s(a, e),
                catch: s(i, e),
                finally: s(o, e),
                on: n("on", e),
                once: n("once", e),
                addListener: n("addListener", e),
                off: n("off", e),
                removeListener: n("removeListener", e),
                removeAllListeners: n("removeAllListeners", e),
                emit: r("emit"),
                eventNames: r("eventNames"),
                listeners: r("listeners"),
                listenerCount: r("listenerCount")
            }),
            c = l(t.then(e => (c.emit("done", e), c.emit("settled"), e), e => {
                throw c.emit("error", e), c.emit("settled"), e
            }));
        return c.on(tp.ClosedByUser, () => {
            c.emit(tf.ClosedByUser)
        }), c
    }

    function r5(e) {
        return new Promise((t, r) => {
            Promise.resolve(e(t, r)).catch(r)
        })
    }
    var r3 = class {
            constructor(e) {
                this.sdk = e
            }
            get overlay() {
                return this.sdk.overlay
            }
            request(e) {
                if (this.sdk.thirdPartyWallets.isConnected && !eX.includes(e.method)) return r6((t, r) => {
                    this.sdk.thirdPartyWallets.requestOverride(e).then(t).catch(r)
                });
                let t = this.overlay.post(e1.MAGIC_HANDLE_REQUEST, rG(e)),
                    r = r6((e, r) => {
                        t.then(t => {
                            if (n(), t.hasError) r(new rb(t.payload.error));
                            else if (t.hasResult) e(t.payload.result);
                            else throw new rg(eK.MalformedResponse, "Response from the Magic iframe is malformed.")
                        }).catch(e => {
                            n(), r(e)
                        })
                    }),
                    n = this.overlay.on(e0.MAGIC_HANDLE_EVENT, t => {
                        let {
                            response: n
                        } = t.data;
                        if (n.id === e.id && n.result ? .event) {
                            let {
                                event: e,
                                params: t = []
                            } = n.result;
                            r.emit(e, ...t)
                        }
                    });
                return r
            }
            createIntermediaryEvent(e, t) {
                return r => {
                    let n = rQ(eY.IntermediaryEvent, [{
                        payloadId: t,
                        eventType: e,
                        args: r
                    }]);
                    this.request(n)
                }
            }
        },
        r4 = {
            "magic-sdk": "v18.0.0",
            "@magic-sdk/react-native": "v14.0.0",
            "@magic-sdk/react-native-bare": "v19.0.0",
            "@magic-sdk/react-native-expo": "v19.0.0"
        },
        r8 = class extends r3 {
            loginWithMagicLink(e) {
                let t = "@magic-sdk/react-native" === rm.sdkName || "@magic-sdk/react-native-bare" === rm.sdkName || "@magic-sdk/react-native-expo" === rm.sdkName;
                if (t && function(e) {
                        let [t] = e.split(".").map(Number);
                        return t >= 19
                    }(rm.version)) throw Error("loginWithMagicLink() is deprecated for this package, please utilize a passcode method like loginWithSMS or loginWithEmailOTP instead.");
                t && (function(e) {
                    let {
                        method: t,
                        removalVersions: r,
                        useInstead: n
                    } = e, a = r[rm.sdkName], i = n ? ` Use \`${n}\` instead.` : "", o = `\`${t}\` will be removed from \`${rm.sdkName}\` in version \`${a}\`.${i}`;
                    return new rv(eH.DeprecationNotice, o)
                })({
                    method: "auth.loginWithMagicLink()",
                    removalVersions: r4,
                    useInstead: "auth.loginWithEmailOTP()"
                }).log();
                let {
                    email: r,
                    showUI: n = !0,
                    redirectURI: a,
                    overrides: i,
                    lifespan: o
                } = e, s = rQ(this.sdk.testMode ? eY.LoginWithMagicLinkTestMode : eY.LoginWithMagicLink, [{
                    email: r,
                    showUI: n,
                    redirectURI: a,
                    overrides: i,
                    lifespan: o
                }]);
                return this.request(s)
            }
            loginWithSMS(e) {
                let {
                    phoneNumber: t,
                    showUI: r = !0,
                    lifespan: n
                } = e, a = rQ(this.sdk.testMode ? eY.LoginWithSmsTestMode : eY.LoginWithSms, [{
                    phoneNumber: t,
                    showUI: r,
                    lifespan: n
                }]), i = this.request(a);
                return !r && i && (i.on(e4.VerifySmsOtp, e => {
                    this.createIntermediaryEvent(e4.VerifySmsOtp, a.id)(e)
                }), i.on(e4.Cancel, () => {
                    this.createIntermediaryEvent(e4.Cancel, a.id)()
                })), i
            }
            loginWithEmailOTP(e) {
                let {
                    email: t,
                    showUI: r,
                    deviceCheckUI: n,
                    overrides: a,
                    lifespan: i
                } = e, o = rQ(this.sdk.testMode ? eY.LoginWithEmailOTPTestMode : eY.LoginWithEmailOTP, [{
                    email: t,
                    showUI: r,
                    deviceCheckUI: n,
                    overrides: a,
                    lifespan: i
                }]), s = this.request(o);
                return !n && s && s.on(e9.Retry, () => {
                    this.createIntermediaryEvent(e9.Retry, o.id)()
                }), !r && s && (s.on(e3.VerifyEmailOtp, e => {
                    this.createIntermediaryEvent(e3.VerifyEmailOtp, o.id)(e)
                }), s.on(e3.VerifyMFACode, e => {
                    this.createIntermediaryEvent(e3.VerifyMFACode, o.id)(e)
                }), s.on(e3.LostDevice, () => {
                    this.createIntermediaryEvent(e3.LostDevice, o.id)()
                }), s.on(e3.VerifyRecoveryCode, e => {
                    this.createIntermediaryEvent(e3.VerifyRecoveryCode, o.id)(e)
                }), s.on(e3.Cancel, () => {
                    this.createIntermediaryEvent(e3.Cancel, o.id)()
                })), s
            }
            loginWithCredential(e) {
                let {
                    credentialOrQueryString: t,
                    lifespan: r
                } = e || {}, n = t ? ? "";
                if (!t && "web" === rm.platform) {
                    n = window.location.search;
                    let e = window.location.origin + window.location.pathname;
                    window.history.replaceState(null, "", e)
                }
                let a = rQ(this.sdk.testMode ? eY.LoginWithCredentialTestMode : eY.LoginWithCredential, [n, r]);
                return this.request(a)
            }
            setAuthorizationToken(e) {
                let t = rQ(eY.SetAuthorizationToken, [{
                    jwt: e
                }]);
                return this.request(t)
            }
            updateEmailWithUI(e) {
                let {
                    email: t,
                    showUI: r = !0
                } = e, n = rQ(this.sdk.testMode ? eY.UpdateEmailTestMode : eY.UpdateEmail, [{
                    email: t,
                    showUI: r
                }]), a = this.request(n);
                return r || (a.on(tt.Retry, () => {
                    this.createIntermediaryEvent(tt.Retry, n.id)()
                }), a.on(tt.Cancel, () => {
                    this.createIntermediaryEvent(tt.Cancel, n.id)()
                }), a.on(tt.VerifyEmailOtp, e => {
                    this.createIntermediaryEvent(tt.VerifyEmailOtp, n.id)(e)
                }), a.on(tt.VerifyMFACode, e => {
                    this.createIntermediaryEvent(tt.VerifyMFACode, n.id)(e)
                }), a.on(tn.RetryWithNewEmail, e => {
                    this.createIntermediaryEvent(tn.RetryWithNewEmail, n.id)(e)
                }), a.on(tn.Cancel, () => {
                    this.createIntermediaryEvent(tn.Cancel, n.id)()
                }), a.on(tn.VerifyEmailOtp, e => {
                    this.createIntermediaryEvent(tn.VerifyEmailOtp, n.id)(e)
                })), a
            }
        },
        r7 = "AES-GCM";
    async function r9() {
        let e = [];
        for (let t of (await rj((t, r, n) => {
                r.startsWith("ds_") && e.push(r)
            }), e)) await rR(t)
    }

    function ne(e) {
        let t = "",
            r = new Uint8Array(e),
            n = r.byteLength;
        for (let e = 0; e < n; e++) t += String.fromCharCode(r[e]);
        return window.btoa(t)
    }

    function nt(e) {
        let t = window.atob(e),
            r = t.length,
            n = new Uint8Array(r);
        for (let e = 0; e < r; e++) n[e] = t.charCodeAt(e);
        return n.buffer
    }
    async function nr() {
        if (!rz()) return void console.info("webcrypto is not supported");
        let {
            crypto: e
        } = window;
        return await rk("iv") || e.getRandomValues(new Uint8Array(12))
    }
    async function nn() {
        if (!rz()) return void console.info("webcrypto is not supported");
        let {
            subtle: e
        } = window.crypto;
        return await rk("ek") || await e.generateKey({
            name: r7,
            length: 256
        }, !1, ["encrypt", "decrypt"])
    }
    async function na(e, t) {
        let r = await nr(),
            n = await nn();
        if (!r || !n || !e) return;
        let a = nt(e),
            {
                subtle: i
            } = window.crypto,
            o = ne(await i.encrypt({
                name: r7,
                iv: r
            }, n, a));
        await rO(`ds_${t}`, o), await rO("ek", n), await rO("iv", r)
    }
    async function ni(e) {
        let t = await rk(`ds_${e}`),
            r = await rk("iv"),
            n = await rk("ek");
        if (!r || !t || !n || !rz()) return;
        let {
            subtle: a
        } = window.crypto;
        return ne(await a.decrypt({
            name: r7,
            iv: r
        }, n, nt(t)))
    }

    function no(e, t) {
        return t ? new URL(e, t) : new URL(e)
    }
    var ns = class extends r3 {
            getIdToken(e) {
                let t = rQ(this.sdk.testMode ? eY.GetIdTokenTestMode : eY.GetIdToken, [e]);
                return this.request(t)
            }
            generateIdToken(e) {
                let t = rQ(this.sdk.testMode ? eY.GenerateIdTokenTestMode : eY.GenerateIdToken, [e]);
                return this.request(t)
            }
            getInfo() {
                let e = rQ(eY.GetInfo, []);
                return this.request(e)
            }
            isLoggedIn() {
                return r6(async (e, t) => {
                    try {
                        let t = !1;
                        this.sdk.useStorageCache && (t = await rk(this.localForageIsLoggedInKey) === "true") && e(!0);
                        let r = rQ(this.sdk.testMode ? eY.IsLoggedInTestMode : eY.IsLoggedIn),
                            n = await this.request(r);
                        this.sdk.useStorageCache && (n ? rO(this.localForageIsLoggedInKey, !0) : rR(this.localForageIsLoggedInKey), t && !n && this.emitUserLoggedOut(!0)), e(n)
                    } catch (e) {
                        t(e)
                    }
                })
            }
            logout() {
                return rR(this.localForageIsLoggedInKey), r9(), r6(async (e, t) => {
                    try {
                        let t = rQ(this.sdk.testMode ? eY.LogoutTestMode : eY.Logout),
                            r = await this.request(t);
                        this.sdk.useStorageCache && this.emitUserLoggedOut(r), e(r)
                    } catch (e) {
                        t(e)
                    }
                })
            }
            requestInfoWithUI(e) {
                let t = rQ(eY.RequestUserInfoWithUI, e ? [e] : []);
                return this.request(t)
            }
            showSettings(e) {
                let {
                    showUI: t = !0
                } = e || {}, r = rQ(this.sdk.testMode ? eY.UserSettingsTestMode : eY.UserSettings, [e]), n = this.request(r);
                return !t && n && (n.on(tm.SendNewPhoneNumber, e => {
                    this.createIntermediaryEvent(tm.SendNewPhoneNumber, r.id)(e)
                }), n.on(tm.SendOtpCode, e => {
                    this.createIntermediaryEvent(tm.SendOtpCode, r.id)(e)
                }), n.on(tm.StartEditPhoneNumber, () => {
                    this.createIntermediaryEvent(tm.StartEditPhoneNumber, r.id)()
                }), n.on(tm.Cancel, () => {
                    this.createIntermediaryEvent(tm.Cancel, r.id)()
                }), n.on(tt.VerifyEmailOtp, e => {
                    this.createIntermediaryEvent(tt.VerifyEmailOtp, r.id)(e)
                })), n
            }
            recoverAccount(e) {
                let {
                    email: t,
                    showUI: r
                } = e, n = rQ(this.sdk.testMode ? eY.RecoverAccountTestMode : eY.RecoverAccount, [{
                    email: t,
                    showUI: r
                }]), a = this.request(n);
                return !r && a && (a.on(tb.Cancel, () => {
                    this.createIntermediaryEvent(tb.Cancel, n.id)()
                }), a.on(tb.ResendSms, () => {
                    this.createIntermediaryEvent(tb.ResendSms, n.id)()
                }), a.on(tb.VerifyOtp, e => {
                    this.createIntermediaryEvent(tb.VerifyOtp, n.id)(e)
                }), a.on(tb.UpdateEmail, e => {
                    this.createIntermediaryEvent(tb.UpdateEmail, n.id)(e)
                }), a.on(tn.Cancel, () => {
                    this.createIntermediaryEvent(tn.Cancel, n.id)()
                }), a.on(tn.RetryWithNewEmail, e => {
                    this.createIntermediaryEvent(tn.RetryWithNewEmail, n.id)(e)
                }), a.on(tn.VerifyEmailOtp, e => {
                    this.createIntermediaryEvent(tn.VerifyEmailOtp, n.id)(e)
                })), a
            }
            revealEVMPrivateKey() {
                let e = rQ(eY.RevealPK, [{
                    chain: "ETH"
                }]);
                return this.request(e)
            }
            revealPrivateKey() {
                throw Error("revealPrivateKey() has been decommissioned. For EVM chains, use `user.revealEVMPrivateKey()` instead. For non-EVM chains, use `[extension].revealPrivateKey()` instead.")
            }
            onUserLoggedOut(e) {
                this.userLoggedOutCallbacks.push(e)
            }
            enableMFA(e) {
                let {
                    showUI: t = !0
                } = e, r = rQ(eY.EnableMFA, [{
                    showUI: t
                }]), n = this.request(r);
                return !t && n && (n.on(tl.VerifyMFACode, e => {
                    this.createIntermediaryEvent(tl.VerifyMFACode, r.id)(e)
                }), n.on(tl.Cancel, () => {
                    this.createIntermediaryEvent(tl.Cancel, r.id)()
                })), n
            }
            disableMFA(e) {
                let {
                    showUI: t = !0
                } = e, r = rQ(eY.DisableMFA, [{
                    showUI: t
                }]), n = this.request(r);
                return !t && n && (n.on(tu.VerifyMFACode, e => {
                    this.createIntermediaryEvent(tu.VerifyMFACode, r.id)(e)
                }), n.on(tu.LostDevice, e => {
                    this.createIntermediaryEvent(tu.LostDevice, r.id)(e)
                }), n.on(tu.Cancel, () => {
                    this.createIntermediaryEvent(tu.Cancel, r.id)()
                })), n
            }
            emitUserLoggedOut(e) {
                this.userLoggedOutCallbacks.forEach(t => {
                    t(e)
                })
            }
            localForageIsLoggedInKey = "magic_auth_is_logged_in";
            userLoggedOutCallbacks = []
        },
        nl = class extends r3 {
            connectWithUI(e) {
                let t = r6(async (r, n) => {
                    try {
                        let a = rQ(eY.Login, [{
                                enabledWallets: this.sdk.thirdPartyWallets.enabledWallets,
                                ...e
                            }]),
                            i = this.request(a);
                        this.sdk.thirdPartyWallets.eventListeners.forEach(({
                            event: e,
                            callback: t
                        }) => {
                            i.on(e, () => t(a.id))
                        }), i.on("id-token-created", e => {
                            t.emit("id-token-created", e)
                        });
                        let o = await i;
                        o.error && n(o), r(o)
                    } catch (e) {
                        n(e)
                    }
                });
                return t
            }
            showUI(e) {
                return this.request(rQ(eY.ShowUI, [e]))
            }
            showAddress() {
                return this.request(rQ(eY.ShowAddress))
            }
            showSendTokensUI() {
                return this.request(rQ(eY.ShowSendTokensUI))
            }
            showOnRamp() {
                return this.request(rQ(eY.ShowOnRamp))
            }
            showNFTs() {
                return this.request(rQ(eY.ShowNFTs))
            }
            showBalances() {
                return this.request(rQ(eY.ShowBalances))
            }
            sendGaslessTransaction(e, t) {
                return this.request(rQ(eY.SendGaslessTransaction, [e, t]))
            }
        },
        nc = class extends r3 {
            eventListeners = [];
            enabledWallets = {};
            isConnected = !1;
            resetThirdPartyWalletState() {
                localStorage.removeItem(eQ.PROVIDER), localStorage.removeItem(eQ.ADDRESS), localStorage.removeItem(eQ.CHAIN_ID), this.isConnected = !1
            }
            requestOverride(e) {
                return e.method === eY.Login ? (this.resetThirdPartyWalletState(), super.request(e)) : e.method === eY.GetInfo ? this.getInfo(e) : e.method === eY.IsLoggedIn ? this.isLoggedIn(e) : e.method === eY.Logout ? this.logout(e) : "web3modal" === localStorage.getItem(eQ.PROVIDER) ? this.web3modalRequest(e) : (this.resetThirdPartyWalletState(), super.request(e))
            }
            isLoggedIn(e) {
                return "web3modal" === localStorage.getItem(eQ.PROVIDER) ? this.web3modalIsLoggedIn() : (this.resetThirdPartyWalletState(), super.request(e))
            }
            getInfo(e) {
                return "web3modal" === localStorage.getItem(eQ.PROVIDER) ? this.web3modalGetInfo() : (this.resetThirdPartyWalletState(), super.request(e))
            }
            logout(e) {
                let t = localStorage.getItem(eQ.PROVIDER);
                return (this.resetThirdPartyWalletState(), "web3modal" === t) ? this.web3modalLogout() : super.request(e)
            }
            web3modalRequest(e) {
                return r6((t, r) => {
                    this.sdk.web3modal.modal.getWalletProvider().request(e).then(t).catch(r)
                })
            }
            web3modalIsLoggedIn() {
                return r6(e => {
                    let t = this.sdk.web3modal.modal.getStatus();
                    if ("connected" === t && e(!0), "disconnected" === t && (this.resetThirdPartyWalletState(), e(!1)), "reconnecting" === t) {
                        let t = this.sdk.web3modal.modal.subscribeProvider(({
                            status: r
                        }) => {
                            "connected" === r && (t(), e(!0)), "disconnected" === r && (t(), this.resetThirdPartyWalletState(), e(!1))
                        })
                    }
                })
            }
            formatWeb3modalGetInfoResponse() {
                let e = this.sdk.web3modal.modal.getWalletInfo() ? .name,
                    t = this.sdk.web3modal.modal.getAddress();
                return {
                    publicAddress: t,
                    email: null,
                    issuer: `did:ethr:${t}`,
                    phoneNumber: null,
                    isMfaEnabled: !1,
                    recoveryFactors: [],
                    walletType: e || "web3modal",
                    firstLoginAt: null
                }
            }
            web3modalGetInfo() {
                return r6((e, t) => {
                    let r = this.sdk.web3modal.modal.getStatus();
                    if ("connected" === r && e(this.formatWeb3modalGetInfoResponse()), "disconnected" === r && (this.resetThirdPartyWalletState(), t("Magic RPC Error: [-32603] Internal error: User denied account access.")), "reconnecting" === r) {
                        let r = this.sdk.web3modal.modal.subscribeProvider(({
                            status: n
                        }) => {
                            "connected" === n && (r(), e(this.formatWeb3modalGetInfoResponse())), "disconnected" === n && (r(), this.resetThirdPartyWalletState(), t("Magic RPC Error: [-32603] Internal error: User denied account access."))
                        })
                    }
                })
            }
            web3modalLogout() {
                return r6(async e => {
                    try {
                        await this.sdk.web3modal.modal.disconnect()
                    } catch (e) {
                        console.error(e)
                    }
                    e(!0)
                })
            }
        },
        {
            createBoundEmitterMethod: nu,
            createChainingEmitterMethod: nd
        } = r0(),
        nf = class extends r3 {
            isMagic = !0;
            sendAsync(e, t) {
                if (!t) {
                    var r;
                    let e, n, a;
                    throw r = {
                        procedure: "Magic.rpcProvider.sendAsync",
                        argument: 1,
                        expected: "function",
                        received: null === t ? "null" : typeof t
                    }, new rg(eK.InvalidArgument, `Invalid ${(n=(e=r.argument+1)%10,a=e%100,1===n&&11!==a?`${e}st`:2===n&&12!==a?`${e}nd`:3===n&&13!==a?`${e}rd`:`${e}th`)} argument given to \`${r.procedure}\`.
  Expected: \`${r.expected}\`
  Received: \`${r.received}\``)
                }
                if (Array.isArray(e)) this.overlay.post(e1.MAGIC_HANDLE_REQUEST, e.map(e => {
                    let t = rG(e);
                    return this.prefixPayloadMethodForTestMode(t), t
                })).then(e => {
                    t(null, e.map(e => ({ ...e.payload,
                        error: e.hasError ? new rb(e.payload.error) : null
                    })))
                });
                else {
                    let r = rG(e);
                    this.prefixPayloadMethodForTestMode(r), this.overlay.post(e1.MAGIC_HANDLE_REQUEST, r).then(e => {
                        t(e.hasError ? new rb(e.payload.error) : null, e.payload)
                    })
                }
            }
            send(e, t) {
                if ("string" == typeof e) {
                    let r = rQ(e, Array.isArray(t) ? t : []);
                    return this.request(r)
                }
                if (Array.isArray(e) || t) return void this.sendAsync(e, t);
                let r = new rv(eH.SyncWeb3Method, "Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.");
                return r.log(), new rJ(e).applyError({
                    code: -32603,
                    message: r.rawMessage
                }).payload
            }
            enable() {
                let e = rQ(eY.Login);
                return this.request(e)
            }
            request(e) {
                return this.prefixPayloadMethodForTestMode(e), super.request(e)
            }
            prefixPayloadMethodForTestMode(e) {
                this.sdk.testMode && (e.method = `testMode/eth/${e.method}`)
            }
            on = nd("on", this);
            once = nd("once", this);
            addListener = nd("addListener", this);
            off = nd("off", this);
            removeListener = nd("removeListener", this);
            removeAllListeners = nd("removeAllListeners", this);
            emit = nu("emit");
            eventNames = nu("eventNames");
            listeners = nu("listeners");
            listenerCount = nu("listenerCount")
        },
        np = class extends r3 {
            purchase(e) {
                let t = rQ(eY.NFTPurchase, [e]);
                return this.request(t)
            }
            checkout(e) {
                let t = this.sdk.thirdPartyWallets.isConnected,
                    r = rQ(eY.NFTCheckout, [{ ...e,
                        walletProvider: t ? "web3modal" : "magic"
                    }]),
                    n = this.request(r);
                return t && (n.on(tv.Initiated, async e => {
                    try {
                        let t = await this.request({
                            method: "eth_sendTransaction",
                            params: [e]
                        });
                        this.createIntermediaryEvent(tv.Success, r.id)(t)
                    } catch {
                        this.createIntermediaryEvent(tv.Failure, r.id)()
                    }
                }), n.on(tv.Disconnect, () => {
                    this.sdk.thirdPartyWallets.resetThirdPartyWalletState(), n.emit("disconnect")
                })), n
            }
            transfer(e) {
                let t = rQ(eY.NFTTransfer, [e]);
                return this.request(t)
            }
        };

    function nh(e) {
        return !e.compat || null == e.compat[rm.sdkName] || ("string" == typeof e.compat[rm.sdkName] ? ((e, t, r) => {
            try {
                t = new tH(t, r)
            } catch {
                return !1
            }
            return t.test(e)
        })(((e, t) => {
            if (e instanceof tz) return e;
            if ("number" == typeof e && (e = String(e)), "string" != typeof e) return null;
            let r = null;
            if ((t = t || {}).rtl) {
                let t;
                for (;
                    (t = ro[rs.COERCERTL].exec(e)) && (!r || r.index + r[0].length !== e.length);) r && t.index + t[0].length === r.index + r[0].length || (r = t), ro[rs.COERCERTL].lastIndex = t.index + t[1].length + t[2].length;
                ro[rs.COERCERTL].lastIndex = -1
            } else r = e.match(ro[rs.COERCE]);
            return null === r ? null : ((e, t) => {
                if (t && "object" == typeof t || (t = {
                        loose: !!t,
                        includePrerelease: !1
                    }), e instanceof tz) return e;
                if ("string" != typeof e || e.length > rn || !(t.loose ? ra[ri.LOOSE] : ra[ri.FULL]).test(e)) return null;
                try {
                    return new tz(e, t)
                } catch {
                    return null
                }
            })(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`, t)
        })(rm.version), e.compat[rm.sdkName]) : !!e.compat[rm.sdkName])
    }

    function nm(e) {
        let t = e ? .extensions ? ? [],
            r = {},
            n = [];
        if (Array.isArray(t) ? t.forEach(e => {
                nh(e) ? (e.init(this), e.name && (this[e.name] = e), rh(e.config) || (r[e.name] = e.config)) : n.push(e)
            }) : Object.keys(t).forEach(e => {
                if (nh(t[e])) {
                    t[e].init(this);
                    let n = t[e];
                    this[e] = n, rh(n.config) || (r[t[e].name] = n.config)
                } else n.push(t[e])
            }), n.length) {
            let e;
            throw e = `Some extensions are incompatible with \`${rm.sdkName}@${rm.version}\`:`, n.filter(e => "u" > typeof e.compat && null !== e.compat).forEach(t => {
                let r = t.compat[rm.sdkName];
                "string" == typeof r ? e += `
  - Extension \`${t.name}\` supports version(s) \`${r}\`` : r || (e += `
  - Extension \`${t.name}\` does not support ${rm.platform} environments.`)
            }), new rg(eK.IncompatibleExtensions, e)
        }
        return r
    }
    var ny = class e {
        constructor(e, t) {
            if (this.apiKey = e, !e) throw new rg(eK.MissingApiKey, "Please provide an API key that you acquired from the Magic developer dashboard.");
            "react-native" === rm.platform && t ? .endpoint && new rv(eH.ReactNativeEndpointConfiguration, `CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${rm.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`).log();
            let {
                defaultEndpoint: r,
                version: n
            } = rm;
            this.testMode = !!t ? .testMode, this.useStorageCache = !!t ? .useStorageCache, this.endpoint = no(t ? .endpoint ? ? r).origin, this.auth = new r8(this), this.user = new ns(this), this.wallet = new nl(this), this.nft = new np(this), this.thirdPartyWallets = new nc(this), this.rpcProvider = new nf(this);
            let a = nm.call(this, t);
            this.parameters = ru({
                API_KEY: this.apiKey,
                DOMAIN_ORIGIN: "u" > typeof window && window ? .location ? window ? .location.origin : "",
                ETH_NETWORK: t ? .network,
                host: no(this.endpoint).host,
                sdk: ry[rm.sdkName],
                version: n,
                ext: rh(a) ? void 0 : a,
                locale: t ? .locale || "en_US",
                authConfig: t ? .authConfig ? { ...t.authConfig
                } : void 0,
                ...rm.bundleId ? {
                    bundleId: rm.bundleId
                } : {},
                meta: t ? .meta
            }), this.networkHash = function(e, t, r) {
                return t || r ? r ? `${e}_${JSON.stringify(r)}` : t ? "string" == typeof t ? `${e}_eth_${t}` : `${e}_${t.rpcUrl}_${t.chainId}_${t.chainType}` : `${e}_unknown` : `${e}_eth_mainnet`
            }(this.apiKey, t ? .network, rh(a) ? void 0 : a), t ? .deferPreload || this.preload()
        }
        static __overlays__ = new Map;
        endpoint;
        parameters;
        networkHash;
        testMode;
        useStorageCache;
        auth;
        user;
        wallet;
        nft;
        thirdPartyWallets;
        rpcProvider;
        get overlay() {
            if (!e.__overlays__.has(this.parameters)) {
                let t = new rm.ViewController(this.endpoint, this.parameters, this.networkHash);
                t.init(), e.__overlays__.set(this.parameters, t)
            }
            return e.__overlays__.get(this.parameters)
        }
        async preload() {
            await this.overlay.waitForReady()
        }
    };
    async function ng(e, t, r) {
        let n = await rk("rt"),
            a;
        if ("web" === rm.platform) try {
            a = await rk("jwt") ? ? await rB()
        } catch (e) {
            console.error("webcrypto error", e)
        }
        let i = {
            msgType: e,
            payload: t
        };
        a && (i.jwt = a), a && n && (i.rt = n);
        let o = await ni(r);
        return o && (i.deviceShare = o), i
    }
    async function nb(e) {
        e.data.rt && await rO("rt", e.data.rt)
    }
    var nv = class {
            constructor(e, t, r) {
                this.endpoint = e, this.parameters = t, this.networkHash = r, this.listen()
            }
            isReadyForRequest = !1;
            messageHandlers = new Set;
            isConnectedToInternet = !0;
            lastPongTime = null;
            heartbeatIntervalTimer = null;
            heartbeatDebounce = (function(e) {
                let t = null;
                return function(...r) {
                    t && clearTimeout(t), t = setTimeout(() => {
                        e(...r)
                    }, 36e5)
                }
            })(() => {
                "https://auth.magic.link/" === this.endpoint && this.heartBeatCheck()
            });
            async post(e, t) {
                return r5(async (r, n) => {
                    this.isConnectedToInternet || n(r_()), await this.checkRelayerExistsInDOM() || (this.isReadyForRequest = !1, await this.reloadRelayer()), this.isReadyForRequest || await this.waitForReady();
                    let a = [],
                        i = Array.isArray(t) ? t.map(e => e.id) : [],
                        o = await ng(`${e}-${this.parameters}`, t, this.networkHash);
                    await this._post(o);
                    let s = e => n => {
                            let o, s, {
                                id: l,
                                response: c
                            } = (o = n.data.response ? .id, s = o && Array.isArray(t) ? t.find(e => e.id === o) : t, o && s ? {
                                id: o,
                                response: new rJ(s).applyResult(n.data.response.result).applyError(n.data.response.error)
                            } : {});
                            if (nb(n), c ? .payload.error ? .message === "User denied account access.") r9();
                            else if (n.data.deviceShare) {
                                let {
                                    deviceShare: e
                                } = n.data;
                                na(e, this.networkHash)
                            }
                            l && c && Array.isArray(t) && i.includes(l) ? (a.push(c), a.length === t.length && (e(), r(a))) : l && c && !Array.isArray(t) && l === t.id && (e(), r(c))
                        },
                        l = this.on(e0.MAGIC_HANDLE_RESPONSE, s(() => l()))
                })
            }
            on(e, t) {
                let r = t.bind(window),
                    n = t => {
                        t.data.msgType === `${e}-${this.parameters}` && r(t)
                    };
                return this.messageHandlers.add(n), () => this.messageHandlers.delete(n)
            }
            waitForReady() {
                return new Promise(e => {
                    let t = this.on(e0.MAGIC_OVERLAY_READY, () => {
                        this.isReadyForRequest = !0, e(), t()
                    })
                })
            }
            listen() {
                this.on(e0.MAGIC_HIDE_OVERLAY, () => {
                    this.hideOverlay()
                }), this.on(e0.MAGIC_SHOW_OVERLAY, () => {
                    this.showOverlay()
                }), this.on(e0.MAGIC_SEND_PRODUCT_ANNOUNCEMENT, e => {
                    e.data.response.result.product_announcement && new rv(eH.ProductAnnouncement, e.data.response.result.product_announcement).log()
                })
            }
            heartBeatCheck() {
                let e = !0,
                    t = async () => {
                        let e = {
                            msgType: `${e1.MAGIC_PING}-${this.parameters}`,
                            payload: []
                        };
                        await this._post(e)
                    };
                this.heartbeatIntervalTimer = setInterval(async () => {
                    if (this.lastPongTime) {
                        if (Date.now() - this.lastPongTime > 6e5) {
                            this.reloadRelayer(), e = !0;
                            return
                        }
                    } else if (!e) {
                        this.reloadRelayer(), e = !0;
                        return
                    }
                    await t(), e = !1
                }, 3e5)
            }
            stopHeartBeat() {
                this.heartbeatDebounce(), this.lastPongTime = null, this.heartbeatIntervalTimer && (clearInterval(this.heartbeatIntervalTimer), this.heartbeatIntervalTimer = null)
            }
        },
        nx = ["request", "overlay", "sdk"],
        nw = class extends r3 {
            compat;
            __sdk_access_field_descriptors__ = new Map;
            __is_initialized__ = !1;
            utils = {
                createPromiEvent: r6,
                isPromiEvent: r2,
                encodeJSON: ru,
                decodeJSON: rd,
                createJsonRpcRequestPayload: rQ,
                standardizeJsonRpcRequestPayload: rG,
                storage: rS
            };
            constructor() {
                super(void 0);
                let e = [this, ... function(e) {
                    let t = Object.getPrototypeOf(e),
                        r = [t];
                    for (; t !== r3.prototype;) r.push(t = Object.getPrototypeOf(t));
                    return r
                }(this)];
                nx.forEach(t => {
                    let r = e.map(e => Object.getOwnPropertyDescriptor(e, t)),
                        n = r.findIndex(e => !!e),
                        a = r[n];
                    a && (this.__sdk_access_field_descriptors__.set(t, {
                        descriptor: a,
                        isPrototypeField: n > 0
                    }), Object.defineProperty(this, t, {
                        configurable: !0,
                        get: () => {
                            throw new rg(eK.ExtensionNotInitialized, `Extensions must be initialized with a Magic SDK instance before \`Extension.${t}\` can be accessed. Do not invoke \`Extension.${t}\` inside an extension constructor.`)
                        }
                    }))
                })
            }
            init(e) {
                this.__is_initialized__ || (nx.forEach(e => {
                    if (this.__sdk_access_field_descriptors__.has(e)) {
                        let {
                            descriptor: t,
                            isPrototypeField: r
                        } = this.__sdk_access_field_descriptors__.get(e);
                        r ? delete this[e] : Object.defineProperty(this, e, t)
                    }
                }), this.sdk = e, this.__is_initialized__ = !0)
            }
            createDeprecationWarning(e) {
                let {
                    method: t,
                    removalVersion: r,
                    useInstead: n
                } = e, a = n ? ` Use \`${n}\` instead.` : "";
                return new rw(this, "DEPRECATION_NOTICE", `\`${t}\` will be removed from this Extension in version \`${r}\`.${a}`)
            }
            createWarning(e, t) {
                return new rw(this, e, t)
            }
            createError(e, t, r) {
                return new rx(this, e, t, r)
            }
        },
        n_ = class extends nw {},
        nC = class {
            static Internal = n_
        },
        nE = e.i(464965),
        nS = ((K = nS || {}).Start = "magic_oauth_login_with_redirect_start", K.Verify = "magic_oauth_login_with_redirect_verify", K.Popup = "magic_oauth_login_with_popup", K.VerifyTelegramData = "magic_oauth_verify_telegram_data", K.VerifySteamData = "magic_oauth_verify_steam_data", K),
        nA = ((H = nA || {}).InvalidRequest = "invalid_request", H.InvalidClient = "invalid_client", H.InvalidScope = "invalid_scope", H.InvalidGrant = "invalid_grant", H.UnauthorizedClient = "unauthorized_client", H.UnsupportedResponseType = "unsupported_response_type", H.UnsupportedGrantType = "unsupported_grant_type", H.UnsupportedTokenType = "unsupported_token_type", H.AccessDenied = "access_denied", H.ServerError = "server_error", H.TemporarilyUnavailable = "temporarily_unavailable", H),
        nI = ((G = nI || {}).MissingApiKey = "MISSING_API_KEY", G.ModalNotReady = "MODAL_NOT_READY", G.ConnectionLost = "CONNECTION_WAS_LOST", G.MalformedResponse = "MALFORMED_RESPONSE", G.InvalidArgument = "INVALID_ARGUMENT", G.ExtensionNotInitialized = "EXTENSION_NOT_INITIALIZED", G.IncompatibleExtensions = "INCOMPATIBLE_EXTENSIONS", G),
        nT = ((Q = nT || {}).SyncWeb3Method = "SYNC_WEB3_METHOD", Q.DuplicateIframe = "DUPLICATE_IFRAME", Q.ReactNativeEndpointConfiguration = "REACT_NATIVE_ENDPOINT_CONFIGURATION", Q.DeprecationNotice = "DEPRECATION_NOTICE", Q.ProductAnnouncement = "ANNOUNCEMENT", Q),
        nk = ((J = nk || {})[J.ParseError = -32700] = "ParseError", J[J.InvalidRequest = -32600] = "InvalidRequest", J[J.MethodNotFound = -32601] = "MethodNotFound", J[J.InvalidParams = -32602] = "InvalidParams", J[J.InternalError = -32603] = "InternalError", J[J.MagicLinkFailedVerification = -1e4] = "MagicLinkFailedVerification", J[J.MagicLinkExpired = -10001] = "MagicLinkExpired", J[J.MagicLinkRateLimited = -10002] = "MagicLinkRateLimited", J[J.MagicLinkInvalidRedirectURL = -10006] = "MagicLinkInvalidRedirectURL", J[J.UserAlreadyLoggedIn = -10003] = "UserAlreadyLoggedIn", J[J.UpdateEmailFailed = -10004] = "UpdateEmailFailed", J[J.UserRequestEditEmail = -10005] = "UserRequestEditEmail", J[J.InactiveRecipient = -10010] = "InactiveRecipient", J[J.AccessDeniedToUser = -10011] = "AccessDeniedToUser", J[J.RedirectLoginComplete = -10015] = "RedirectLoginComplete", J[J.DpopInvalidated = -10019] = "DpopInvalidated", J),
        nO = ((Y = nO || {}).PROVIDER = "magic_3pw_provider", Y.ADDRESS = "magic_3pw_address", Y.CHAIN_ID = "magic_3pw_chainId", Y),
        nR = ((X = nR || {}).WalletConnected = "wallet_connected", X.WalletRejected = "wallet_rejected", X.Web3ModalSelected = "web3modal_selected", X),
        nN = ((ee = nN || {}).LoginWithSms = "magic_auth_login_with_sms", ee.LoginWithEmailOTP = "magic_auth_login_with_email_otp", ee.LoginWithMagicLink = "magic_auth_login_with_magic_link", ee.LoginWithCredential = "magic_auth_login_with_credential", ee.SetAuthorizationToken = "magic_auth_set_authorization_token", ee.GetIdToken = "magic_auth_get_id_token", ee.GenerateIdToken = "magic_auth_generate_id_token", ee.GetMetadata = "magic_auth_get_metadata", ee.IsLoggedIn = "magic_is_logged_in", ee.Logout = "magic_auth_logout", ee.UpdateEmail = "magic_auth_update_email", ee.UserSettings = "magic_auth_settings", ee.UserSettingsTestMode = "magic_auth_settings_testing_mode", ee.LoginWithSmsTestMode = "magic_auth_login_with_sms_testing_mode", ee.LoginWithEmailOTPTestMode = "magic_auth_login_with_email_otp_testing_mode", ee.LoginWithMagicLinkTestMode = "magic_login_with_magic_link_testing_mode", ee.LoginWithCredentialTestMode = "magic_auth_login_with_credential_testing_mode", ee.GetIdTokenTestMode = "magic_auth_get_id_token_testing_mode", ee.GenerateIdTokenTestMode = "magic_auth_generate_id_token_testing_mode", ee.GetMetadataTestMode = "magic_auth_get_metadata_testing_mode", ee.IsLoggedInTestMode = "magic_auth_is_logged_in_testing_mode", ee.LogoutTestMode = "magic_auth_logout_testing_mode", ee.UpdateEmailTestMode = "magic_auth_update_email_testing_mode", ee.IntermediaryEvent = "magic_intermediary_event", ee.RequestAccounts = "eth_requestAccounts", ee.GetInfo = "magic_get_info", ee.ShowUI = "magic_wallet", ee.NFTPurchase = "magic_nft_purchase", ee.NFTCheckout = "magic_nft_checkout", ee.NFTTransfer = "magic_nft_transfer", ee.RequestUserInfoWithUI = "mc_request_user_info", ee.Disconnect = "mc_disconnect", ee.RecoverAccount = "magic_auth_recover_account", ee.RecoverAccountTestMode = "magic_auth_recover_account_testing_mode", ee.MagicBoxHeartBeat = "magic_box_heart_beat", ee.AutoConnect = "mc_auto_connect", ee.Login = "mc_login", ee.EncryptV1 = "magic_auth_encrypt_v1", ee.DecryptV1 = "magic_auth_decrypt_v1", ee.ShowNFTs = "magic_show_nfts", ee.ShowOnRamp = "magic_show_fiat_onramp", ee.ShowSendTokensUI = "magic_show_send_tokens_ui", ee.ShowAddress = "magic_show_address", ee.ShowBalances = "magic_show_balances", ee.RevealPK = "magic_reveal_key", ee.EnableMFA = "magic_auth_enable_mfa_flow", ee.DisableMFA = "magic_auth_disable_mfa_flow", ee.GetMultichainPublicAddress = "magic_get_multichain_public_address", ee.Sign7702Authorization = "magic_wallet_sign_7702_authorization", ee.Send7702Transaction = "eth_send7702Transaction", ee),
        nM = ((et = nM || {}).MAGIC_HANDLE_RESPONSE = "MAGIC_HANDLE_RESPONSE", et.MAGIC_OVERLAY_READY = "MAGIC_OVERLAY_READY", et.MAGIC_SHOW_OVERLAY = "MAGIC_SHOW_OVERLAY", et.MAGIC_HIDE_OVERLAY = "MAGIC_HIDE_OVERLAY", et.MAGIC_HANDLE_EVENT = "MAGIC_HANDLE_EVENT", et.MAGIC_MG_BOX_SEND_RECEIPT = "MAGIC_MG_BOX_SEND_RECEIPT", et.MAGIC_SEND_PRODUCT_ANNOUNCEMENT = "MAGIC_SEND_PRODUCT_ANNOUNCEMENT", et.MAGIC_PONG = "MAGIC_PONG", et.MAGIC_POPUP_RESPONSE = "MAGIC_POPUP_RESPONSE", et.MAGIC_POPUP_OAUTH_VERIFY_RESPONSE = "MAGIC_POPUP_OAUTH_VERIFY_RESPONSE", et.MAGIC_THIRD_PARTY_WALLET_REQUEST = "MAGIC_THIRD_PARTY_WALLET_REQUEST", et.MAGIC_OPEN_MOBILE_URL = "MAGIC_OPEN_MOBILE_URL", et),
        nP = ((er = nP || {}).MAGIC_HANDLE_REQUEST = "MAGIC_HANDLE_REQUEST", er.MAGIC_THIRD_PARTY_WALLET_RESPONSE = "MAGIC_THIRD_PARTY_WALLET_RESPONSE", er.MAGIC_THIRD_PARTY_WALLET_UPDATE = "MAGIC_THIRD_PARTY_WALLET_EVENT", er.MAGIC_PING = "MAGIC_PING", er),
        nD = ((en = nD || {}).UpdateEmail = "update-email", en.MFA = "mfa", en.Recovery = "recovery", en),
        nj = ((ea = nj || {}).Retry = "retry", ea),
        nL = ((ei = nL || {}).EmailSent = "email-sent", ei.EmailNotDeliverable = "email-not-deliverable", ei),
        nF = ((eo = nF || {}).VerifyEmailOtp = "verify-email-otp", eo.VerifyMFACode = "verify-mfa-code", eo.LostDevice = "lost-device", eo.VerifyRecoveryCode = "verify-recovery-code", eo.Cancel = "cancel", eo),
        nU = ((es = nU || {}).VerifySmsOtp = "verify-sms-otp", es.VerifyMFACode = "verify-mfa-code", es.LostDevice = "lost-device", es.VerifyRecoveryCode = "verify-recovery-code", es.Cancel = "cancel", es.Retry = "retry", es),
        n$ = ((el = n$ || {}).SmsOTPSent = "sms-otp-sent", el.InvalidSmsOtp = "invalid-sms-otp", el.ExpiredSmsOtp = "expired-sms-otp", el.MfaSentHandle = "mfa-sent-handle", el.InvalidMfaOtp = "invalid-mfa-otp", el.LoginThrottled = "login-throttled", el.RecoveryCodeSentHandle = "recovery-code-sent-handle", el.InvalidRecoveryCode = "invalid-recovery-code", el.RecoveryCodeSuccess = "recovery-code-success", el),
        nz = ((ec = nz || {}).EmailOTPSent = "email-otp-sent", ec.InvalidEmailOtp = "invalid-email-otp", ec.InvalidMfaOtp = "invalid-mfa-otp", ec.ExpiredEmailOtp = "expired-email-otp", ec.MfaSentHandle = "mfa-sent-handle", ec.RecoveryCodeSentHandle = "recovery-code-sent-handle", ec.InvalidRecoveryCode = "invalid-recovery-code", ec.RecoveryCodeSuccess = "recovery-code-success", ec.LoginThrottled = "login-throttled", ec.MaxAttemptsReached = "max-attempts-reached", ec),
        nB = ((eu = nB || {}).Retry = "device-retry", eu),
        nq = ((ed = nq || {}).DeviceApproved = "device-approved", ed.DeviceNeedsApproval = "device-needs-approval", ed.DeviceVerificationLinkExpired = "device-verification-link-expired", ed.DeviceVerificationEmailSent = "device-verification-email-sent", ed),
        nW = ((ef = nW || {}).Retry = "Recency/auth-factor-retry", ef.Cancel = "Recency/auth-factor-verification-cancel", ef.VerifyEmailOtp = "Recency/auth-factor-verify-email-otp", ef.VerifyMFACode = "Recency/verify-mfa-code", ef),
        nZ = ((ep = nZ || {}).PrimaryAuthFactorNeedsVerification = "Recency/auth-factor-needs-verification", ep.PrimaryAuthFactorVerified = "Recency/auth-factor-verified", ep.InvalidEmailOtp = "Recency/auth-factor-invalid-email-otp", ep.EmailExpired = "Recency/auth-factor-verification-email-expired", ep.EmailSent = "Recency/auth-factor-verification-email-sent", ep.EmailNotDeliverable = "Recency/auth-factor-verification-email-not-deliverable", ep),
        nV = ((eh = nV || {}).RetryWithNewEmail = "UpdateEmail/retry-with-new-email", eh.Cancel = "UpdateEmail/new-email-verification-cancel", eh.VerifyEmailOtp = "UpdateEmail/new-email-verify-otp", eh),
        nK = ((em = nK || {}).NewAuthFactorNeedsVerification = "UpdateEmail/new-email-needs-verification", em.EmailUpdated = "UpdateEmail/email-updated", em.InvalidEmailOtp = "UpdateEmail/new-email-invalid-email-otp", em.EmailExpired = "UpdateEmail/new-email-verification-email-expired", em.EmailSent = "UpdateEmail/new-email-verification-email-sent", em.EmailNotDeliverable = "UpdateEmail/new-email-verification-email-not-deliverable", em.InvalidEmail = "UpdateEmail/new-email-invalid", em.EmailAlreadyExists = "UpdateEmail/new-email-already-exists", em),
        nH = ((ey = nH || {}).IDTokenCreated = "Auth/id-token-created", ey),
        nG = ((eg = nG || {}).Cancel = "Farcaster/cancel", eg),
        nQ = ((eb = nQ || {}).MFASecretGenerated = "mfa-secret-generated", eb.InvalidMFAOtp = "invalid-mfa-otp", eb.MFARecoveryCodes = "mfa-recovery-codes", eb),
        nJ = ((ev = nJ || {}).VerifyMFACode = "verify-mfa-code", ev.Cancel = "cancel-mfa-setup", ev),
        nY = ((ex = nY || {}).MFACodeRequested = "mfa-code-requested", ex.InvalidMFAOtp = "invalid-mfa-otp", ex.InvalidRecoveryCode = "invalid-recovery-code", ex),
        nX = ((ew = nX || {}).VerifyMFACode = "verify-mfa-code", ew.LostDevice = "lost-device", ew.Cancel = "cancel-mfa-disable", ew),
        n0 = ((e_ = n0 || {}).Harmony = "HARMONY", e_),
        n1 = ((eC = n1 || {}).ClosedByUser = "closed-by-user", eC),
        n2 = ((eE = n2 || {}).ClosedByUser = "closed-by-user-on-received", eE),
        n6 = ((eS = n6 || {}).EnterNewPhoneNumber = "enter-new-phone-number", eS.EnterOtpCode = "enter-otp-code", eS.RecoveryFactorAlreadyExists = "recovery-factor-already-exists", eS.MalformedPhoneNumber = "malformed-phone-number", eS.InvalidOtpCode = "invalid-otp-code", eS.RecoveryFactorUpdated = "recovery-factor-updated", eS.RecoveryFactorDeleted = "recovery-factor-deleted", eS),
        n5 = ((eA = n5 || {}).SendNewPhoneNumber = "send-new-phone-number", eA.SendOtpCode = "send-otp-code", eA.Cancel = "cancel", eA.StartEditPhoneNumber = "start-edit-phone-number", eA),
        n3 = ((eI = n3 || {}).PhoneNumber = "phone_number", eI),
        n4 = ((eT = n4 || {}).SmsOtpSent = "sms-otp-sent", eT.LoginThrottled = "login-throttled", eT.InvalidSmsOtp = "invalid-sms-otp", eT.SmsVerified = "sms-verified", eT.AccountRecovered = "account-recovered", eT.UpdateEmailRequired = "update-email-required", eT),
        n8 = ((ek = n8 || {}).Cancel = "cancel", ek.VerifyOtp = "verify-otp-code", ek.ResendSms = "resend-sms-otp", ek.UpdateEmail = "update-email", ek),
        n7 = ((eO = n7 || {}).Success = "nft-checkout-success", eO.Failure = "nft-checkout-failure", eO.Initiated = "nft-checkout-initiated", eO.Disconnect = "disconnect", eO),
        n9 = ((eR = n9 || {}).WalletInfoFetched = "Wallet/wallet-info-fetched", eR),
        ae = ((eN = ae || {}).CloseMagicWindow = "close-magic-window", eN),
        at = ((eM = at || {}).Cancel = "cancel", eM.VerifyMFACode = "verify-mfa-code", eM.LostDevice = "lost-device", eM.VerifyRecoveryCode = "verify-recovery-code", eM),
        ar = ((eP = ar || {}).MfaSentHandle = "mfa-sent-handle", eP.InvalidMfaOtp = "invalid-mfa-otp", eP.RecoveryCodeSentHandle = "recovery-code-sent-handle", eP.InvalidRecoveryCode = "invalid-recovery-code", eP.RecoveryCodeSuccess = "recovery-code-success", eP),
        an = ((eD = an || {}).PopupUrl = "popup-url", eD),
        aa = ((ej = aa || {}).PopupEvent = "popup-event", ej),
        ai = "u" > typeof window && !!window.crypto;

    function ao(e) {
        let t;
        if (!ai) throw Error("Secure random number generation is not available in this environment. PKCE requires crypto.getRandomValues.");
        let r = new Uint8Array(e);
        return window.crypto.getRandomValues(r), t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~", Array.from(r).map(e => t[e % t.length]).join("")
    }
    var as = "magic_oauth_pkce_verifier",
        al = class extends nC.Internal {
            name = "oauth2";
            config = {};
            compat = {
                "magic-sdk": ">=2.4.6",
                "@magic-sdk/react-native": !1,
                "@magic-sdk/react-native-bare": !1,
                "@magic-sdk/react-native-expo": !1
            };
            constructor() {
                super(), this.seamlessTelegramLogin()
            }
            loginWithRedirect(e) {
                return this.utils.createPromiEvent(async (t, r) => {
                    let n = "steam" === e.provider,
                        a, i = {};
                    if (!n) {
                        let e, t, r, n = (e = ao(128), t = ao(128), r = nE.default.SHA256(t).toString(nE.default.enc.Base64).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"), {
                            codeVerifier: t,
                            codeChallenge: r,
                            cryptoChallengeState: e
                        });
                        a = n.codeVerifier, i.codeChallenge = n.codeChallenge, i.cryptoChallengeState = n.cryptoChallengeState
                    }
                    let o = this.utils.createJsonRpcRequestPayload("magic_oauth_login_with_redirect_start", [{ ...e,
                            apiKey: this.sdk.apiKey,
                            platform: "web",
                            ...i
                        }]),
                        s = await this.request(o);
                    if (s.error && r(this.createError(s.error, s.error_description ? ? "An error occurred.", {
                            errorURI: s.error_uri,
                            provider: s.provider
                        })), s ? .pkceMetadata && a && (sessionStorage.setItem(as, JSON.stringify({
                            codeVerifier: a,
                            ...s.pkceMetadata
                        })), localStorage.setItem(as, JSON.stringify({
                            codeVerifier: a,
                            ...s.pkceMetadata
                        }))), s ? .oauthAuthoriationURI) {
                        let e = s.useMagicServerCallback ? new URL(s.oauthAuthoriationURI, this.sdk.endpoint).href : s.oauthAuthoriationURI;
                        s ? .shouldReturnURI ? t(e) : window.location.href = e
                    }
                    t(null)
                })
            }
            getRedirectResult(e = {}) {
                let t = e ? .optionalQueryString || window.location.search,
                    r = window.location.origin + window.location.pathname;
                window.history.replaceState(null, "", r);
                let n = t.startsWith("?") ? t.slice(1) : t;
                return "http://specs.openid.net/auth/2.0" === new URLSearchParams(n).get("openid.ns") ? (this.clearPKCEMetadata(), this.getSteamResult(n)) : this.getResult(e, t)
            }
            clearPKCEMetadata() {
                sessionStorage.removeItem(as), localStorage.removeItem(as)
            }
            getSteamResult(e) {
                let t = this.utils.createJsonRpcRequestPayload("magic_oauth_verify_steam_data", [{
                    openidParams: e
                }]);
                return this.utils.createPromiEvent(async (e, r) => {
                    try {
                        let n = await this.request(t);
                        if (n.error) return void r(this.createError(n.error, n.error_description ? ? "An error occurred.", {
                            errorURI: n.error_uri,
                            provider: n.provider
                        }));
                        e(n)
                    } catch (e) {
                        r(e)
                    }
                })
            }
            loginWithPopup(e) {
                let {
                    showMfaModal: t
                } = e, r = this.utils.createJsonRpcRequestPayload("magic_oauth_login_with_popup", [{ ...e,
                    showUI: t,
                    returnTo: window.location.href,
                    apiKey: this.sdk.apiKey,
                    platform: "web"
                }]), n = r6(async (a, i) => {
                    try {
                        let o = this.request(r),
                            s = e => {
                                this.createIntermediaryEvent(aa.PopupEvent, r.id)(e.data)
                            };
                        e.shouldReturnURI && o && o.on(an.PopupUrl, e => {
                            window.addEventListener("message", s), n.emit(an.PopupUrl, e)
                        }), t || (o.on(ar.MfaSentHandle, () => {
                            n.emit(ar.MfaSentHandle)
                        }), o.on(ar.InvalidMfaOtp, () => {
                            n.emit(ar.InvalidMfaOtp)
                        }), o.on(ar.RecoveryCodeSentHandle, () => {
                            n.emit(ar.RecoveryCodeSentHandle)
                        }), o.on(ar.InvalidRecoveryCode, () => {
                            n.emit(ar.InvalidRecoveryCode)
                        }), o.on(ar.RecoveryCodeSuccess, () => {
                            n.emit(ar.RecoveryCodeSuccess)
                        }));
                        let l = await o;
                        window.removeEventListener("message", s), l.error ? i(this.createError(l.error, l.error_description ? ? "An error occurred.", {
                            errorURI: l.error_uri,
                            provider: l.provider
                        })) : a(l)
                    } catch (e) {
                        i(e)
                    }
                });
                return !t && n && (n.on(at.VerifyMFACode, e => {
                    this.createIntermediaryEvent(at.VerifyMFACode, r.id)(e)
                }), n.on(at.LostDevice, () => {
                    this.createIntermediaryEvent(at.LostDevice, r.id)()
                }), n.on(at.VerifyRecoveryCode, e => {
                    this.createIntermediaryEvent(at.VerifyRecoveryCode, r.id)(e)
                }), n.on(at.Cancel, () => {
                    this.createIntermediaryEvent(at.Cancel, r.id)()
                })), n
            }
            getResult(e, t) {
                let {
                    showMfaModal: r
                } = e, {
                    hasStateMismatch: n,
                    clientMetadata: a
                } = this.retrievePKCEMetadata(t), i = this.utils.createJsonRpcRequestPayload("magic_oauth_login_with_redirect_verify", [{
                    authorizationResponseParams: t,
                    magicApiKey: this.sdk.apiKey,
                    platform: "web",
                    showUI: r,
                    ...e,
                    ...a ? {
                        clientMetadata: a
                    } : {}
                }]), o = this.utils.createPromiEvent(async (e, t) => {
                    if (!a) return t(this.createError("MISSING_PKCE_METADATA", "OAuth session metadata not found — the session may have expired or storage was cleared", {}));
                    if (n) return t(this.createError("STATE_MISMATCH", "OAuth state parameter mismatch — request may have been tampered with", {}));
                    let s = this.request(i);
                    r || (s.on(ar.MfaSentHandle, () => {
                        o.emit(ar.MfaSentHandle)
                    }), s.on(ar.InvalidMfaOtp, () => {
                        o.emit(ar.InvalidMfaOtp)
                    }), s.on(ar.RecoveryCodeSentHandle, () => {
                        o.emit(ar.RecoveryCodeSentHandle)
                    }), s.on(ar.InvalidRecoveryCode, () => {
                        o.emit(ar.InvalidRecoveryCode)
                    }), s.on(ar.RecoveryCodeSuccess, () => {
                        o.emit(ar.RecoveryCodeSuccess)
                    }));
                    let l = await s;
                    l.error && t(this.createError(l.error, l.error_description ? ? "An error occurred.", {
                        errorURI: l.error_uri,
                        provider: l.provider
                    })), e(l)
                });
                return !r && o && (o.on(at.VerifyMFACode, e => {
                    this.createIntermediaryEvent(at.VerifyMFACode, i.id)(e)
                }), o.on(at.LostDevice, () => {
                    this.createIntermediaryEvent(at.LostDevice, i.id)()
                }), o.on(at.VerifyRecoveryCode, e => {
                    this.createIntermediaryEvent(at.VerifyRecoveryCode, i.id)(e)
                }), o.on(at.Cancel, () => {
                    this.createIntermediaryEvent(at.Cancel, i.id)()
                })), o
            }
            seamlessTelegramLogin() {
                try {
                    if (!window.location.hash.toString().includes("#tgWebAppData")) return;
                    let e = document.createElement("script");
                    e.src = "https://telegram.org/js/telegram-web-app.js", document.head.prepend(e), e.onload = async () => {
                        try {
                            let e = window.Telegram ? .WebApp.initData,
                                t = this.utils.createJsonRpcRequestPayload("magic_oauth_verify_telegram_data", [{
                                    userData: e,
                                    isMiniApp: !0
                                }]);
                            await this.request(t)
                        } catch (e) {
                            console.log("Error while verifying telegram data", e)
                        }
                    }
                } catch (e) {
                    console.log("Error while loading telegram-web-app script", e)
                }
            }
            retrievePKCEMetadata(e) {
                let t = !1,
                    r = sessionStorage.getItem(as),
                    n = localStorage.getItem(as);
                sessionStorage.removeItem(as), localStorage.removeItem(as);
                let a = r ? JSON.parse(r) : n ? JSON.parse(n) : void 0;
                if (a) {
                    let r = new URLSearchParams(e).get("state");
                    r && r === a.state || (t = !0)
                }
                return {
                    clientMetadata: a,
                    hasStateMismatch: t
                }
            }
        },
        ac = Object.create,
        au = Object.defineProperty,
        ad = Object.getOwnPropertyDescriptor,
        af = Object.getOwnPropertyNames,
        ap = Object.getPrototypeOf,
        ah = Object.prototype.hasOwnProperty,
        am = e.z,
        ay = (e, t) => () => (t || e((t = {
            exports: {}
        }).exports, t), t.exports),
        ag = (e, t, r) => (r = null != e ? ac(ap(e)) : {}, ((e, t, r, n) => {
            if (t && "object" == typeof t || "function" == typeof t)
                for (let a of af(t)) ah.call(e, a) || a === r || au(e, a, {
                    get: () => t[a],
                    enumerable: !(n = ad(t, a)) || n.enumerable
                });
            return e
        })(!t && e && e.__esModule ? r : au(r, "default", {
            value: e,
            enumerable: !0
        }), e)),
        ab = ay((t, r) => {
            var n = function() {
                return (function e(t, r, n) {
                    function a(o, s) {
                        if (!r[o]) {
                            if (!t[o]) {
                                var l = "function" == typeof am && am;
                                if (!s && l) return l(o, !0);
                                if (i) return i(o, !0);
                                var c = Error("Cannot find module '" + o + "'");
                                throw c.code = "MODULE_NOT_FOUND", c
                            }
                            var u = r[o] = {
                                exports: {}
                            };
                            t[o][0].call(u.exports, function(e) {
                                return a(t[o][1][e] || e)
                            }, u, u.exports, e, t, r, n)
                        }
                        return r[o].exports
                    }
                    for (var i = "function" == typeof am && am, o = 0; o < n.length; o++) a(n[o]);
                    return a
                })({
                    1: [function(t, r, n) {
                        (function(e) {
                            var t, n = e.MutationObserver || e.WebKitMutationObserver;
                            if (n) {
                                var a = 0,
                                    i = new n(u),
                                    o = e.document.createTextNode("");
                                i.observe(o, {
                                    characterData: !0
                                }), t = function() {
                                    o.data = a = ++a % 2
                                }
                            } else if (!e.setImmediate && "u" > typeof e.MessageChannel) {
                                var s = new e.MessageChannel;
                                s.port1.onmessage = u, t = function() {
                                    s.port2.postMessage(0)
                                }
                            } else t = "document" in e && "onreadystatechange" in e.document.createElement("script") ? function() {
                                var t = e.document.createElement("script");
                                t.onreadystatechange = function() {
                                    u(), t.onreadystatechange = null, t.parentNode.removeChild(t), t = null
                                }, e.document.documentElement.appendChild(t)
                            } : function() {
                                setTimeout(u, 0)
                            };
                            var l, c = [];

                            function u() {
                                l = !0;
                                for (var e, t, r = c.length; r;) {
                                    for (t = c, c = [], e = -1; ++e < r;) t[e]();
                                    r = c.length
                                }
                                l = !1
                            }
                            r.exports = function(e) {
                                1 !== c.push(e) || l || t()
                            }
                        }).call(this, e.g)
                    }, {}],
                    2: [function(e, t, r) {
                        var n = e(1);

                        function a() {}
                        var i = {},
                            o = ["REJECTED"],
                            s = ["FULFILLED"],
                            l = ["PENDING"];

                        function c(e) {
                            if ("function" != typeof e) throw TypeError("resolver must be a function");
                            this.state = l, this.queue = [], this.outcome = void 0, e !== a && p(this, e)
                        }

                        function u(e, t, r) {
                            this.promise = e, "function" == typeof t && (this.onFulfilled = t, this.callFulfilled = this.otherCallFulfilled), "function" == typeof r && (this.onRejected = r, this.callRejected = this.otherCallRejected)
                        }

                        function d(e, t, r) {
                            n(function() {
                                var n;
                                try {
                                    n = t(r)
                                } catch (t) {
                                    return i.reject(e, t)
                                }
                                n === e ? i.reject(e, TypeError("Cannot resolve promise with itself")) : i.resolve(e, n)
                            })
                        }

                        function f(e) {
                            var t = e && e.then;
                            if (e && ("object" == typeof e || "function" == typeof e) && "function" == typeof t) return function() {
                                t.apply(e, arguments)
                            }
                        }

                        function p(e, t) {
                            var r = !1;

                            function n(t) {
                                r || (r = !0, i.reject(e, t))
                            }

                            function a(t) {
                                r || (r = !0, i.resolve(e, t))
                            }
                            var o = h(function() {
                                t(a, n)
                            });
                            "error" === o.status && n(o.value)
                        }

                        function h(e, t) {
                            var r = {};
                            try {
                                r.value = e(t), r.status = "success"
                            } catch (e) {
                                r.status = "error", r.value = e
                            }
                            return r
                        }
                        t.exports = c, c.prototype.catch = function(e) {
                            return this.then(null, e)
                        }, c.prototype.then = function(e, t) {
                            if ("function" != typeof e && this.state === s || "function" != typeof t && this.state === o) return this;
                            var r = new this.constructor(a);
                            return this.state !== l ? d(r, this.state === s ? e : t, this.outcome) : this.queue.push(new u(r, e, t)), r
                        }, u.prototype.callFulfilled = function(e) {
                            i.resolve(this.promise, e)
                        }, u.prototype.otherCallFulfilled = function(e) {
                            d(this.promise, this.onFulfilled, e)
                        }, u.prototype.callRejected = function(e) {
                            i.reject(this.promise, e)
                        }, u.prototype.otherCallRejected = function(e) {
                            d(this.promise, this.onRejected, e)
                        }, i.resolve = function(e, t) {
                            var r = h(f, t);
                            if ("error" === r.status) return i.reject(e, r.value);
                            var n = r.value;
                            if (n) p(e, n);
                            else {
                                e.state = s, e.outcome = t;
                                for (var a = -1, o = e.queue.length; ++a < o;) e.queue[a].callFulfilled(t)
                            }
                            return e
                        }, i.reject = function(e, t) {
                            e.state = o, e.outcome = t;
                            for (var r = -1, n = e.queue.length; ++r < n;) e.queue[r].callRejected(t);
                            return e
                        }, c.resolve = function(e) {
                            return e instanceof this ? e : i.resolve(new this(a), e)
                        }, c.reject = function(e) {
                            var t = new this(a);
                            return i.reject(t, e)
                        }, c.all = function(e) {
                            var t = this;
                            if ("[object Array]" !== Object.prototype.toString.call(e)) return this.reject(TypeError("must be an array"));
                            var r = e.length,
                                n = !1;
                            if (!r) return this.resolve([]);
                            for (var o = Array(r), s = 0, l = -1, c = new this(a); ++l < r;) ! function(e, a) {
                                t.resolve(e).then(function(e) {
                                    o[a] = e, ++s !== r || n || (n = !0, i.resolve(c, o))
                                }, function(e) {
                                    n || (n = !0, i.reject(c, e))
                                })
                            }(e[l], l);
                            return c
                        }, c.race = function(e) {
                            var t, r = this;
                            if ("[object Array]" !== Object.prototype.toString.call(e)) return this.reject(TypeError("must be an array"));
                            var n = e.length,
                                o = !1;
                            if (!n) return this.resolve([]);
                            for (var s = -1, l = new this(a); ++s < n;) {
                                t = e[s], r.resolve(t).then(function(e) {
                                    o || (o = !0, i.resolve(l, e))
                                }, function(e) {
                                    o || (o = !0, i.reject(l, e))
                                })
                            }
                            return l
                        }
                    }, {
                        1: 1
                    }],
                    3: [function(t, r, n) {
                        (function(e) {
                            "function" != typeof e.Promise && (e.Promise = t(2))
                        }).call(this, e.g)
                    }, {
                        2: 2
                    }],
                    4: [function(e, t, r) {
                        var n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
                                return typeof e
                            } : function(e) {
                                return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
                            },
                            a = function() {
                                try {
                                    if ("u" > typeof indexedDB) return indexedDB;
                                    if ("u" > typeof webkitIndexedDB) return webkitIndexedDB;
                                    if ("u" > typeof mozIndexedDB) return mozIndexedDB;
                                    if ("u" > typeof OIndexedDB) return OIndexedDB;
                                    if ("u" > typeof msIndexedDB) return msIndexedDB
                                } catch {
                                    return
                                }
                            }();

                        function i(e, t) {
                            e = e || [], t = t || {};
                            try {
                                return new Blob(e, t)
                            } catch (i) {
                                if ("TypeError" !== i.name) throw i;
                                for (var r = "u" > typeof BlobBuilder ? BlobBuilder : "u" > typeof MSBlobBuilder ? MSBlobBuilder : "u" > typeof MozBlobBuilder ? MozBlobBuilder : WebKitBlobBuilder, n = new r, a = 0; a < e.length; a += 1) n.append(e[a]);
                                return n.getBlob(t.type)
                            }
                        }
                        typeof Promise > "u" && e(3);
                        var o = Promise;

                        function s(e, t) {
                            t && e.then(function(e) {
                                t(null, e)
                            }, function(e) {
                                t(e)
                            })
                        }

                        function l(e, t, r) {
                            "function" == typeof t && e.then(t), "function" == typeof r && e.catch(r)
                        }

                        function c(e) {
                            return "string" != typeof e && (console.warn(e + " used as a key, but it is not a string."), e = String(e)), e
                        }

                        function u() {
                            if (arguments.length && "function" == typeof arguments[arguments.length - 1]) return arguments[arguments.length - 1]
                        }
                        var d = "local-forage-detect-blob-support",
                            f = void 0,
                            p = {},
                            h = Object.prototype.toString,
                            m = "readonly",
                            y = "readwrite";

                        function g(e) {
                            var t = p[e.name],
                                r = {};
                            r.promise = new o(function(e, t) {
                                r.resolve = e, r.reject = t
                            }), t.deferredOperations.push(r), t.dbReady ? t.dbReady = t.dbReady.then(function() {
                                return r.promise
                            }) : t.dbReady = r.promise
                        }

                        function b(e) {
                            var t = p[e.name].deferredOperations.pop();
                            if (t) return t.resolve(), t.promise
                        }

                        function v(e, t) {
                            var r = p[e.name].deferredOperations.pop();
                            if (r) return r.reject(t), r.promise
                        }

                        function x(e, t) {
                            return new o(function(r, n) {
                                if (p[e.name] = p[e.name] || A(), e.db)
                                    if (!t) return r(e.db);
                                    else g(e), e.db.close();
                                var i = [e.name];
                                t && i.push(e.version);
                                var o = a.open.apply(a, i);
                                t && (o.onupgradeneeded = function(t) {
                                    var r = o.result;
                                    try {
                                        r.createObjectStore(e.storeName), t.oldVersion <= 1 && r.createObjectStore(d)
                                    } catch (r) {
                                        if ("ConstraintError" === r.name) console.warn('The database "' + e.name + '" has been upgraded from version ' + t.oldVersion + " to version " + t.newVersion + ', but the storage "' + e.storeName + '" already exists.');
                                        else throw r
                                    }
                                }), o.onerror = function(e) {
                                    e.preventDefault(), n(o.error)
                                }, o.onsuccess = function() {
                                    var t = o.result;
                                    t.onversionchange = function(e) {
                                        e.target.close()
                                    }, r(t), b(e)
                                }
                            })
                        }

                        function w(e, t) {
                            if (!e.db) return !0;
                            var r = !e.db.objectStoreNames.contains(e.storeName),
                                n = e.version < e.db.version,
                                a = e.version > e.db.version;
                            if (n && (e.version !== t && console.warn('The database "' + e.name + "\" can't be downgraded from version " + e.db.version + " to version " + e.version + "."), e.version = e.db.version), a || r) {
                                if (r) {
                                    var i = e.db.version + 1;
                                    i > e.version && (e.version = i)
                                }
                                return !0
                            }
                            return !1
                        }

                        function _(e) {
                            return i([function(e) {
                                for (var t = e.length, r = new ArrayBuffer(t), n = new Uint8Array(r), a = 0; a < t; a++) n[a] = e.charCodeAt(a);
                                return r
                            }(atob(e.data))], {
                                type: e.type
                            })
                        }

                        function C(e) {
                            return e && e.__local_forage_encoded_blob
                        }

                        function E(e) {
                            var t = this,
                                r = t._initReady().then(function() {
                                    var e = p[t._dbInfo.name];
                                    if (e && e.dbReady) return e.dbReady
                                });
                            return l(r, e, e), r
                        }

                        function S(e, t, r, n) {
                            void 0 === n && (n = 1);
                            try {
                                var a = e.db.transaction(e.storeName, t);
                                r(null, a)
                            } catch (a) {
                                if (n > 0 && (!e.db || "InvalidStateError" === a.name || "NotFoundError" === a.name)) return o.resolve().then(function() {
                                    if (!e.db || "NotFoundError" === a.name && !e.db.objectStoreNames.contains(e.storeName) && e.version <= e.db.version) return e.db && (e.version = e.db.version + 1), x(e, !0)
                                }).then(function() {
                                    return (function(e) {
                                        g(e);
                                        for (var t = p[e.name], r = t.forages, n = 0; n < r.length; n++) {
                                            var a = r[n];
                                            a._dbInfo.db && (a._dbInfo.db.close(), a._dbInfo.db = null)
                                        }
                                        return e.db = null, x(e, !1).then(function(t) {
                                            return e.db = t, w(e) ? x(e, !0) : t
                                        }).then(function(n) {
                                            e.db = t.db = n;
                                            for (var a = 0; a < r.length; a++) r[a]._dbInfo.db = n
                                        }).catch(function(t) {
                                            throw v(e, t), t
                                        })
                                    })(e).then(function() {
                                        S(e, t, r, n - 1)
                                    })
                                }).catch(r);
                                r(a)
                            }
                        }

                        function A() {
                            return {
                                forages: [],
                                db: null,
                                dbReady: null,
                                deferredOperations: []
                            }
                        }
                        var I = {
                                _driver: "asyncStorage",
                                _initStorage: function(e) {
                                    var t = this,
                                        r = {
                                            db: null
                                        };
                                    if (e)
                                        for (var n in e) r[n] = e[n];
                                    var a = p[r.name];
                                    a || (a = A(), p[r.name] = a), a.forages.push(t), t._initReady || (t._initReady = t.ready, t.ready = E);
                                    var i = [];

                                    function s() {
                                        return o.resolve()
                                    }
                                    for (var l = 0; l < a.forages.length; l++) {
                                        var c = a.forages[l];
                                        c !== t && i.push(c._initReady().catch(s))
                                    }
                                    var u = a.forages.slice(0);
                                    return o.all(i).then(function() {
                                        return r.db = a.db, x(r, !1)
                                    }).then(function(e) {
                                        return r.db = e, w(r, t._defaultConfig.version) ? x(r, !0) : e
                                    }).then(function(e) {
                                        r.db = a.db = e, t._dbInfo = r;
                                        for (var n = 0; n < u.length; n++) {
                                            var i = u[n];
                                            i !== t && (i._dbInfo.db = r.db, i._dbInfo.version = r.version)
                                        }
                                    })
                                },
                                _support: function() {
                                    try {
                                        if (!a || !a.open) return !1;
                                        var e = "u" > typeof openDatabase && /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent) && !/BlackBerry/.test(navigator.platform),
                                            t = "function" == typeof fetch && -1 !== fetch.toString().indexOf("[native code");
                                        return (!e || t) && "u" > typeof indexedDB && "u" > typeof IDBKeyRange
                                    } catch {
                                        return !1
                                    }
                                }(),
                                iterate: function(e, t) {
                                    var r = this,
                                        n = new o(function(t, n) {
                                            r.ready().then(function() {
                                                S(r._dbInfo, m, function(a, i) {
                                                    if (a) return n(a);
                                                    try {
                                                        var o = i.objectStore(r._dbInfo.storeName).openCursor(),
                                                            s = 1;
                                                        o.onsuccess = function() {
                                                            var r = o.result;
                                                            if (r) {
                                                                var n = r.value;
                                                                C(n) && (n = _(n));
                                                                var a = e(n, r.key, s++);
                                                                void 0 !== a ? t(a) : r.continue()
                                                            } else t()
                                                        }, o.onerror = function() {
                                                            n(o.error)
                                                        }
                                                    } catch (e) {
                                                        n(e)
                                                    }
                                                })
                                            }).catch(n)
                                        });
                                    return s(n, t), n
                                },
                                getItem: function(e, t) {
                                    var r = this;
                                    e = c(e);
                                    var n = new o(function(t, n) {
                                        r.ready().then(function() {
                                            S(r._dbInfo, m, function(a, i) {
                                                if (a) return n(a);
                                                try {
                                                    var o = i.objectStore(r._dbInfo.storeName).get(e);
                                                    o.onsuccess = function() {
                                                        var e = o.result;
                                                        void 0 === e && (e = null), C(e) && (e = _(e)), t(e)
                                                    }, o.onerror = function() {
                                                        n(o.error)
                                                    }
                                                } catch (e) {
                                                    n(e)
                                                }
                                            })
                                        }).catch(n)
                                    });
                                    return s(n, t), n
                                },
                                setItem: function(e, t, r) {
                                    var n = this;
                                    e = c(e);
                                    var a = new o(function(r, a) {
                                        var s;
                                        n.ready().then(function() {
                                            var e;
                                            return s = n._dbInfo, "[object Blob]" === h.call(t) ? (e = s.db, "boolean" == typeof f ? o.resolve(f) : new o(function(t) {
                                                var r = e.transaction(d, y),
                                                    n = i([""]);
                                                r.objectStore(d).put(n, "key"), r.onabort = function(e) {
                                                    e.preventDefault(), e.stopPropagation(), t(!1)
                                                }, r.oncomplete = function() {
                                                    var e = navigator.userAgent.match(/Chrome\/(\d+)/);
                                                    t(navigator.userAgent.match(/Edge\//) || !e || parseInt(e[1], 10) >= 43)
                                                }
                                            }).catch(function() {
                                                return !1
                                            }).then(function(e) {
                                                return f = e
                                            })).then(function(e) {
                                                return e ? t : new o(function(e, r) {
                                                    var n = new FileReader;
                                                    n.onerror = r, n.onloadend = function(r) {
                                                        e({
                                                            __local_forage_encoded_blob: !0,
                                                            data: btoa(r.target.result || ""),
                                                            type: t.type
                                                        })
                                                    }, n.readAsBinaryString(t)
                                                })
                                            }) : t
                                        }).then(function(t) {
                                            S(n._dbInfo, y, function(i, o) {
                                                if (i) return a(i);
                                                try {
                                                    var s = o.objectStore(n._dbInfo.storeName);
                                                    null === t && (t = void 0);
                                                    var l = s.put(t, e);
                                                    o.oncomplete = function() {
                                                        void 0 === t && (t = null), r(t)
                                                    }, o.onabort = o.onerror = function() {
                                                        var e = l.error ? l.error : l.transaction.error;
                                                        a(e)
                                                    }
                                                } catch (e) {
                                                    a(e)
                                                }
                                            })
                                        }).catch(a)
                                    });
                                    return s(a, r), a
                                },
                                removeItem: function(e, t) {
                                    var r = this;
                                    e = c(e);
                                    var n = new o(function(t, n) {
                                        r.ready().then(function() {
                                            S(r._dbInfo, y, function(a, i) {
                                                if (a) return n(a);
                                                try {
                                                    var o = i.objectStore(r._dbInfo.storeName).delete(e);
                                                    i.oncomplete = function() {
                                                        t()
                                                    }, i.onerror = function() {
                                                        n(o.error)
                                                    }, i.onabort = function() {
                                                        var e = o.error ? o.error : o.transaction.error;
                                                        n(e)
                                                    }
                                                } catch (e) {
                                                    n(e)
                                                }
                                            })
                                        }).catch(n)
                                    });
                                    return s(n, t), n
                                },
                                clear: function(e) {
                                    var t = this,
                                        r = new o(function(e, r) {
                                            t.ready().then(function() {
                                                S(t._dbInfo, y, function(n, a) {
                                                    if (n) return r(n);
                                                    try {
                                                        var i = a.objectStore(t._dbInfo.storeName).clear();
                                                        a.oncomplete = function() {
                                                            e()
                                                        }, a.onabort = a.onerror = function() {
                                                            var e = i.error ? i.error : i.transaction.error;
                                                            r(e)
                                                        }
                                                    } catch (e) {
                                                        r(e)
                                                    }
                                                })
                                            }).catch(r)
                                        });
                                    return s(r, e), r
                                },
                                length: function(e) {
                                    var t = this,
                                        r = new o(function(e, r) {
                                            t.ready().then(function() {
                                                S(t._dbInfo, m, function(n, a) {
                                                    if (n) return r(n);
                                                    try {
                                                        var i = a.objectStore(t._dbInfo.storeName).count();
                                                        i.onsuccess = function() {
                                                            e(i.result)
                                                        }, i.onerror = function() {
                                                            r(i.error)
                                                        }
                                                    } catch (e) {
                                                        r(e)
                                                    }
                                                })
                                            }).catch(r)
                                        });
                                    return s(r, e), r
                                },
                                key: function(e, t) {
                                    var r = this,
                                        n = new o(function(t, n) {
                                            e < 0 ? t(null) : r.ready().then(function() {
                                                S(r._dbInfo, m, function(a, i) {
                                                    if (a) return n(a);
                                                    try {
                                                        var o = i.objectStore(r._dbInfo.storeName),
                                                            s = !1,
                                                            l = o.openKeyCursor();
                                                        l.onsuccess = function() {
                                                            var r = l.result;
                                                            r ? 0 === e || s ? t(r.key) : (s = !0, r.advance(e)) : t(null)
                                                        }, l.onerror = function() {
                                                            n(l.error)
                                                        }
                                                    } catch (e) {
                                                        n(e)
                                                    }
                                                })
                                            }).catch(n)
                                        });
                                    return s(n, t), n
                                },
                                keys: function(e) {
                                    var t = this,
                                        r = new o(function(e, r) {
                                            t.ready().then(function() {
                                                S(t._dbInfo, m, function(n, a) {
                                                    if (n) return r(n);
                                                    try {
                                                        var i = a.objectStore(t._dbInfo.storeName).openKeyCursor(),
                                                            o = [];
                                                        i.onsuccess = function() {
                                                            var t = i.result;
                                                            t ? (o.push(t.key), t.continue()) : e(o)
                                                        }, i.onerror = function() {
                                                            r(i.error)
                                                        }
                                                    } catch (e) {
                                                        r(e)
                                                    }
                                                })
                                            }).catch(r)
                                        });
                                    return s(r, e), r
                                },
                                dropInstance: function(e, t) {
                                    t = u.apply(this, arguments);
                                    var r, n = this.config();
                                    if ((e = "function" != typeof e && e || {}).name || (e.name = e.name || n.name, e.storeName = e.storeName || n.storeName), e.name) {
                                        var i = e.name === n.name && this._dbInfo.db ? o.resolve(this._dbInfo.db) : x(e, !1).then(function(t) {
                                            var r = p[e.name],
                                                n = r.forages;
                                            r.db = t;
                                            for (var a = 0; a < n.length; a++) n[a]._dbInfo.db = t;
                                            return t
                                        });
                                        r = e.storeName ? i.then(function(t) {
                                            if (t.objectStoreNames.contains(e.storeName)) {
                                                var r = t.version + 1;
                                                g(e);
                                                var n = p[e.name],
                                                    i = n.forages;
                                                t.close();
                                                for (var s = 0; s < i.length; s++) {
                                                    var l = i[s];
                                                    l._dbInfo.db = null, l._dbInfo.version = r
                                                }
                                                return new o(function(t, n) {
                                                    var i = a.open(e.name, r);
                                                    i.onerror = function(e) {
                                                        i.result.close(), n(e)
                                                    }, i.onupgradeneeded = function() {
                                                        i.result.deleteObjectStore(e.storeName)
                                                    }, i.onsuccess = function() {
                                                        var e = i.result;
                                                        e.close(), t(e)
                                                    }
                                                }).then(function(e) {
                                                    n.db = e;
                                                    for (var t = 0; t < i.length; t++) {
                                                        var r = i[t];
                                                        r._dbInfo.db = e, b(r._dbInfo)
                                                    }
                                                }).catch(function(t) {
                                                    throw (v(e, t) || o.resolve()).catch(function() {}), t
                                                })
                                            }
                                        }) : i.then(function(t) {
                                            g(e);
                                            var r = p[e.name],
                                                n = r.forages;
                                            t.close();
                                            for (var i = 0; i < n.length; i++) n[i]._dbInfo.db = null;
                                            return new o(function(t, r) {
                                                var n = a.deleteDatabase(e.name);
                                                n.onerror = function() {
                                                    var e = n.result;
                                                    e && e.close(), r(n.error)
                                                }, n.onblocked = function() {
                                                    console.warn('dropInstance blocked for database "' + e.name + '" until all open connections are closed')
                                                }, n.onsuccess = function() {
                                                    var e = n.result;
                                                    e && e.close(), t(e)
                                                }
                                            }).then(function(e) {
                                                r.db = e;
                                                for (var t = 0; t < n.length; t++) b(n[t]._dbInfo)
                                            }).catch(function(t) {
                                                throw (v(e, t) || o.resolve()).catch(function() {}), t
                                            })
                                        })
                                    } else r = o.reject("Invalid arguments");
                                    return s(r, t), r
                                }
                            },
                            T = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
                            k = /^~~local_forage_type~([^~]+)~/,
                            O = "__lfsc__:",
                            R = O.length,
                            N = "arbf",
                            M = "blob",
                            P = "si08",
                            D = "ui08",
                            j = "uic8",
                            L = "si16",
                            F = "si32",
                            U = "ur16",
                            $ = "ui32",
                            z = "fl32",
                            B = "fl64",
                            q = R + N.length,
                            W = Object.prototype.toString;

                        function Z(e) {
                            var t, r, n, a, i, o = .75 * e.length,
                                s = e.length,
                                l = 0;
                            "=" === e[e.length - 1] && (o--, "=" === e[e.length - 2] && o--);
                            var c = new ArrayBuffer(o),
                                u = new Uint8Array(c);
                            for (t = 0; t < s; t += 4) r = T.indexOf(e[t]), n = T.indexOf(e[t + 1]), a = T.indexOf(e[t + 2]), i = T.indexOf(e[t + 3]), u[l++] = r << 2 | n >> 4, u[l++] = (15 & n) << 4 | a >> 2, u[l++] = (3 & a) << 6 | 63 & i;
                            return c
                        }

                        function V(e) {
                            var t, r = new Uint8Array(e),
                                n = "";
                            for (t = 0; t < r.length; t += 3) n += T[r[t] >> 2], n += T[(3 & r[t]) << 4 | r[t + 1] >> 4], n += T[(15 & r[t + 1]) << 2 | r[t + 2] >> 6], n += T[63 & r[t + 2]];
                            return r.length % 3 == 2 ? n = n.substring(0, n.length - 1) + "=" : r.length % 3 == 1 && (n = n.substring(0, n.length - 2) + "=="), n
                        }
                        var K = {
                            serialize: function(e, t) {
                                var r = "";
                                if (e && (r = W.call(e)), e && ("[object ArrayBuffer]" === r || e.buffer && "[object ArrayBuffer]" === W.call(e.buffer))) {
                                    var n, a = O;
                                    e instanceof ArrayBuffer ? (n = e, a += N) : (n = e.buffer, "[object Int8Array]" === r ? a += P : "[object Uint8Array]" === r ? a += D : "[object Uint8ClampedArray]" === r ? a += j : "[object Int16Array]" === r ? a += L : "[object Uint16Array]" === r ? a += U : "[object Int32Array]" === r ? a += F : "[object Uint32Array]" === r ? a += $ : "[object Float32Array]" === r ? a += z : "[object Float64Array]" === r ? a += B : t(Error("Failed to get type for BinaryArray"))), t(a + V(n))
                                } else if ("[object Blob]" === r) {
                                    var i = new FileReader;
                                    i.onload = function() {
                                        t(O + M + ("~~local_forage_type~" + e.type + "~") + V(this.result))
                                    }, i.readAsArrayBuffer(e)
                                } else try {
                                    t(JSON.stringify(e))
                                } catch (r) {
                                    console.error("Couldn't convert value into a JSON string: ", e), t(null, r)
                                }
                            },
                            deserialize: function(e) {
                                if (e.substring(0, R) !== O) return JSON.parse(e);
                                var t, r = e.substring(q),
                                    n = e.substring(R, q);
                                if (n === M && k.test(r)) {
                                    var a = r.match(k);
                                    t = a[1], r = r.substring(a[0].length)
                                }
                                var o = Z(r);
                                switch (n) {
                                    case N:
                                        return o;
                                    case M:
                                        return i([o], {
                                            type: t
                                        });
                                    case P:
                                        return new Int8Array(o);
                                    case D:
                                        return new Uint8Array(o);
                                    case j:
                                        return new Uint8ClampedArray(o);
                                    case L:
                                        return new Int16Array(o);
                                    case U:
                                        return new Uint16Array(o);
                                    case F:
                                        return new Int32Array(o);
                                    case $:
                                        return new Uint32Array(o);
                                    case z:
                                        return new Float32Array(o);
                                    case B:
                                        return new Float64Array(o);
                                    default:
                                        throw Error("Unkown type: " + n)
                                }
                            },
                            stringToBuffer: Z,
                            bufferToString: V
                        };

                        function H(e, t, r, n) {
                            e.executeSql("CREATE TABLE IF NOT EXISTS " + t.storeName + " (id INTEGER PRIMARY KEY, key unique, value)", [], r, n)
                        }

                        function G(e, t, r, n, a, i) {
                            e.executeSql(r, n, a, function(e, o) {
                                o.code === o.SYNTAX_ERR ? e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?", [t.storeName], function(e, s) {
                                    s.rows.length ? i(e, o) : H(e, t, function() {
                                        e.executeSql(r, n, a, i)
                                    }, i)
                                }, i) : i(e, o)
                            }, i)
                        }

                        function Q(e, t, r, n) {
                            var a = this;
                            e = c(e);
                            var i = new o(function(i, o) {
                                a.ready().then(function() {
                                    void 0 === t && (t = null);
                                    var s = t,
                                        l = a._dbInfo;
                                    l.serializer.serialize(t, function(t, c) {
                                        c ? o(c) : l.db.transaction(function(r) {
                                            G(r, l, "INSERT OR REPLACE INTO " + l.storeName + " (key, value) VALUES (?, ?)", [e, t], function() {
                                                i(s)
                                            }, function(e, t) {
                                                o(t)
                                            })
                                        }, function(t) {
                                            if (t.code === t.QUOTA_ERR) {
                                                if (n > 0) return void i(Q.apply(a, [e, s, r, n - 1]));
                                                o(t)
                                            }
                                        })
                                    })
                                }).catch(o)
                            });
                            return s(i, r), i
                        }

                        function J(e, t) {
                            var r = e.name + "/";
                            return e.storeName !== t.storeName && (r += e.storeName + "/"), r
                        }
                        var Y = function(e, t) {
                                for (var r, n = e.length, a = 0; a < n;) {
                                    if ((r = e[a]) === t || "number" == typeof r && "number" == typeof t && isNaN(r) && isNaN(t)) return !0;
                                    a++
                                }
                                return !1
                            },
                            X = Array.isArray || function(e) {
                                return "[object Array]" === Object.prototype.toString.call(e)
                            },
                            ee = {},
                            et = {},
                            er = {
                                INDEXEDDB: I,
                                WEBSQL: {
                                    _driver: "webSQLStorage",
                                    _initStorage: function(e) {
                                        var t = this,
                                            r = {
                                                db: null
                                            };
                                        if (e)
                                            for (var n in e) r[n] = "string" != typeof e[n] ? e[n].toString() : e[n];
                                        var a = new o(function(e, n) {
                                            try {
                                                r.db = openDatabase(r.name, String(r.version), r.description, r.size)
                                            } catch (e) {
                                                return n(e)
                                            }
                                            r.db.transaction(function(a) {
                                                H(a, r, function() {
                                                    t._dbInfo = r, e()
                                                }, function(e, t) {
                                                    n(t)
                                                })
                                            }, n)
                                        });
                                        return r.serializer = K, a
                                    },
                                    _support: "function" == typeof openDatabase,
                                    iterate: function(e, t) {
                                        var r = this,
                                            n = new o(function(t, n) {
                                                r.ready().then(function() {
                                                    var a = r._dbInfo;
                                                    a.db.transaction(function(r) {
                                                        G(r, a, "SELECT * FROM " + a.storeName, [], function(r, n) {
                                                            for (var i = n.rows, o = i.length, s = 0; s < o; s++) {
                                                                var l = i.item(s),
                                                                    c = l.value;
                                                                if (c && (c = a.serializer.deserialize(c)), void 0 !== (c = e(c, l.key, s + 1))) return void t(c)
                                                            }
                                                            t()
                                                        }, function(e, t) {
                                                            n(t)
                                                        })
                                                    })
                                                }).catch(n)
                                            });
                                        return s(n, t), n
                                    },
                                    getItem: function(e, t) {
                                        var r = this;
                                        e = c(e);
                                        var n = new o(function(t, n) {
                                            r.ready().then(function() {
                                                var a = r._dbInfo;
                                                a.db.transaction(function(r) {
                                                    G(r, a, "SELECT * FROM " + a.storeName + " WHERE key = ? LIMIT 1", [e], function(e, r) {
                                                        var n = r.rows.length ? r.rows.item(0).value : null;
                                                        n && (n = a.serializer.deserialize(n)), t(n)
                                                    }, function(e, t) {
                                                        n(t)
                                                    })
                                                })
                                            }).catch(n)
                                        });
                                        return s(n, t), n
                                    },
                                    setItem: function(e, t, r) {
                                        return Q.apply(this, [e, t, r, 1])
                                    },
                                    removeItem: function(e, t) {
                                        var r = this;
                                        e = c(e);
                                        var n = new o(function(t, n) {
                                            r.ready().then(function() {
                                                var a = r._dbInfo;
                                                a.db.transaction(function(r) {
                                                    G(r, a, "DELETE FROM " + a.storeName + " WHERE key = ?", [e], function() {
                                                        t()
                                                    }, function(e, t) {
                                                        n(t)
                                                    })
                                                })
                                            }).catch(n)
                                        });
                                        return s(n, t), n
                                    },
                                    clear: function(e) {
                                        var t = this,
                                            r = new o(function(e, r) {
                                                t.ready().then(function() {
                                                    var n = t._dbInfo;
                                                    n.db.transaction(function(t) {
                                                        G(t, n, "DELETE FROM " + n.storeName, [], function() {
                                                            e()
                                                        }, function(e, t) {
                                                            r(t)
                                                        })
                                                    })
                                                }).catch(r)
                                            });
                                        return s(r, e), r
                                    },
                                    length: function(e) {
                                        var t = this,
                                            r = new o(function(e, r) {
                                                t.ready().then(function() {
                                                    var n = t._dbInfo;
                                                    n.db.transaction(function(t) {
                                                        G(t, n, "SELECT COUNT(key) as c FROM " + n.storeName, [], function(t, r) {
                                                            e(r.rows.item(0).c)
                                                        }, function(e, t) {
                                                            r(t)
                                                        })
                                                    })
                                                }).catch(r)
                                            });
                                        return s(r, e), r
                                    },
                                    key: function(e, t) {
                                        var r = this,
                                            n = new o(function(t, n) {
                                                r.ready().then(function() {
                                                    var a = r._dbInfo;
                                                    a.db.transaction(function(r) {
                                                        G(r, a, "SELECT key FROM " + a.storeName + " WHERE id = ? LIMIT 1", [e + 1], function(e, r) {
                                                            t(r.rows.length ? r.rows.item(0).key : null)
                                                        }, function(e, t) {
                                                            n(t)
                                                        })
                                                    })
                                                }).catch(n)
                                            });
                                        return s(n, t), n
                                    },
                                    keys: function(e) {
                                        var t = this,
                                            r = new o(function(e, r) {
                                                t.ready().then(function() {
                                                    var n = t._dbInfo;
                                                    n.db.transaction(function(t) {
                                                        G(t, n, "SELECT key FROM " + n.storeName, [], function(t, r) {
                                                            for (var n = [], a = 0; a < r.rows.length; a++) n.push(r.rows.item(a).key);
                                                            e(n)
                                                        }, function(e, t) {
                                                            r(t)
                                                        })
                                                    })
                                                }).catch(r)
                                            });
                                        return s(r, e), r
                                    },
                                    dropInstance: function(e, t) {
                                        t = u.apply(this, arguments);
                                        var r = this.config();
                                        (e = "function" != typeof e && e || {}).name || (e.name = e.name || r.name, e.storeName = e.storeName || r.storeName);
                                        var n, a = this;
                                        return s(n = e.name ? new o(function(t) {
                                            var n;
                                            n = e.name === r.name ? a._dbInfo.db : openDatabase(e.name, "", "", 0), t(e.storeName ? {
                                                db: n,
                                                storeNames: [e.storeName]
                                            } : new o(function(e, t) {
                                                n.transaction(function(r) {
                                                    r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'", [], function(t, r) {
                                                        for (var a = [], i = 0; i < r.rows.length; i++) a.push(r.rows.item(i).name);
                                                        e({
                                                            db: n,
                                                            storeNames: a
                                                        })
                                                    }, function(e, r) {
                                                        t(r)
                                                    })
                                                }, function(e) {
                                                    t(e)
                                                })
                                            }))
                                        }).then(function(e) {
                                            return new o(function(t, r) {
                                                e.db.transaction(function(n) {
                                                    for (var a = [], i = 0, s = e.storeNames.length; i < s; i++) a.push(function(e) {
                                                        return new o(function(t, r) {
                                                            n.executeSql("DROP TABLE IF EXISTS " + e, [], function() {
                                                                t()
                                                            }, function(e, t) {
                                                                r(t)
                                                            })
                                                        })
                                                    }(e.storeNames[i]));
                                                    o.all(a).then(function() {
                                                        t()
                                                    }).catch(function(e) {
                                                        r(e)
                                                    })
                                                }, function(e) {
                                                    r(e)
                                                })
                                            })
                                        }) : o.reject("Invalid arguments"), t), n
                                    }
                                },
                                LOCALSTORAGE: {
                                    _driver: "localStorageWrapper",
                                    _initStorage: function(e) {
                                        var t = {};
                                        if (e)
                                            for (var r in e) t[r] = e[r];
                                        return t.keyPrefix = J(e, this._defaultConfig), ! function() {
                                            var e = "_localforage_support_test";
                                            try {
                                                return localStorage.setItem(e, !0), localStorage.removeItem(e), !1
                                            } catch {
                                                return !0
                                            }
                                        }() || localStorage.length > 0 ? (this._dbInfo = t, t.serializer = K, o.resolve()) : o.reject()
                                    },
                                    _support: function() {
                                        try {
                                            return "u" > typeof localStorage && "setItem" in localStorage && !!localStorage.setItem
                                        } catch {
                                            return !1
                                        }
                                    }(),
                                    iterate: function(e, t) {
                                        var r = this,
                                            n = r.ready().then(function() {
                                                for (var t = r._dbInfo, n = t.keyPrefix, a = n.length, i = localStorage.length, o = 1, s = 0; s < i; s++) {
                                                    var l = localStorage.key(s);
                                                    if (0 === l.indexOf(n)) {
                                                        var c = localStorage.getItem(l);
                                                        if (c && (c = t.serializer.deserialize(c)), void 0 !== (c = e(c, l.substring(a), o++))) return c
                                                    }
                                                }
                                            });
                                        return s(n, t), n
                                    },
                                    getItem: function(e, t) {
                                        var r = this;
                                        e = c(e);
                                        var n = r.ready().then(function() {
                                            var t = r._dbInfo,
                                                n = localStorage.getItem(t.keyPrefix + e);
                                            return n && (n = t.serializer.deserialize(n)), n
                                        });
                                        return s(n, t), n
                                    },
                                    setItem: function(e, t, r) {
                                        var n = this;
                                        e = c(e);
                                        var a = n.ready().then(function() {
                                            void 0 === t && (t = null);
                                            var r = t;
                                            return new o(function(a, i) {
                                                var o = n._dbInfo;
                                                o.serializer.serialize(t, function(t, n) {
                                                    if (n) i(n);
                                                    else try {
                                                        localStorage.setItem(o.keyPrefix + e, t), a(r)
                                                    } catch (e) {
                                                        ("QuotaExceededError" === e.name || "NS_ERROR_DOM_QUOTA_REACHED" === e.name) && i(e), i(e)
                                                    }
                                                })
                                            })
                                        });
                                        return s(a, r), a
                                    },
                                    removeItem: function(e, t) {
                                        var r = this;
                                        e = c(e);
                                        var n = r.ready().then(function() {
                                            var t = r._dbInfo;
                                            localStorage.removeItem(t.keyPrefix + e)
                                        });
                                        return s(n, t), n
                                    },
                                    clear: function(e) {
                                        var t = this,
                                            r = t.ready().then(function() {
                                                for (var e = t._dbInfo.keyPrefix, r = localStorage.length - 1; r >= 0; r--) {
                                                    var n = localStorage.key(r);
                                                    0 === n.indexOf(e) && localStorage.removeItem(n)
                                                }
                                            });
                                        return s(r, e), r
                                    },
                                    length: function(e) {
                                        var t = this.keys().then(function(e) {
                                            return e.length
                                        });
                                        return s(t, e), t
                                    },
                                    key: function(e, t) {
                                        var r = this,
                                            n = r.ready().then(function() {
                                                var t, n = r._dbInfo;
                                                try {
                                                    t = localStorage.key(e)
                                                } catch {
                                                    t = null
                                                }
                                                return t && (t = t.substring(n.keyPrefix.length)), t
                                            });
                                        return s(n, t), n
                                    },
                                    keys: function(e) {
                                        var t = this,
                                            r = t.ready().then(function() {
                                                for (var e = t._dbInfo, r = localStorage.length, n = [], a = 0; a < r; a++) {
                                                    var i = localStorage.key(a);
                                                    0 === i.indexOf(e.keyPrefix) && n.push(i.substring(e.keyPrefix.length))
                                                }
                                                return n
                                            });
                                        return s(r, e), r
                                    },
                                    dropInstance: function(e, t) {
                                        if (t = u.apply(this, arguments), !(e = "function" != typeof e && e || {}).name) {
                                            var r = this.config();
                                            e.name = e.name || r.name, e.storeName = e.storeName || r.storeName
                                        }
                                        var n, a = this;
                                        return s(n = e.name ? new o(function(t) {
                                            t(e.storeName ? J(e, a._defaultConfig) : e.name + "/")
                                        }).then(function(e) {
                                            for (var t = localStorage.length - 1; t >= 0; t--) {
                                                var r = localStorage.key(t);
                                                0 === r.indexOf(e) && localStorage.removeItem(r)
                                            }
                                        }) : o.reject("Invalid arguments"), t), n
                                    }
                                }
                            },
                            en = [er.INDEXEDDB._driver, er.WEBSQL._driver, er.LOCALSTORAGE._driver],
                            ea = ["dropInstance"],
                            ei = ["clear", "getItem", "iterate", "key", "keys", "length", "removeItem", "setItem"].concat(ea),
                            eo = {
                                description: "",
                                driver: en.slice(),
                                name: "localforage",
                                size: 4980736,
                                storeName: "keyvaluepairs",
                                version: 1
                            };

                        function es() {
                            for (var e = 1; e < arguments.length; e++) {
                                var t = arguments[e];
                                if (t)
                                    for (var r in t) t.hasOwnProperty(r) && (X(t[r]) ? arguments[0][r] = t[r].slice() : arguments[0][r] = t[r])
                            }
                            return arguments[0]
                        }
                        t.exports = new(function() {
                            function e(t) {
                                if (!(this instanceof e)) throw TypeError("Cannot call a class as a function");
                                for (var r in er)
                                    if (er.hasOwnProperty(r)) {
                                        var n = er[r],
                                            a = n._driver;
                                        this[r] = a, ee[a] || this.defineDriver(n)
                                    }
                                this._defaultConfig = es({}, eo), this._config = es({}, this._defaultConfig, t), this._driverSet = null, this._initDriver = null, this._ready = !1, this._dbInfo = null, this._wrapLibraryMethodsWithReady(), this.setDriver(this._config.driver).catch(function() {})
                            }
                            return e.prototype.config = function(e) {
                                if ((typeof e > "u" ? "undefined" : n(e)) !== "object") return "string" == typeof e ? this._config[e] : this._config;
                                if (this._ready) return Error("Can't call config() after localforage has been used.");
                                for (var t in e) {
                                    if ("storeName" === t && (e[t] = e[t].replace(/\W/g, "_")), "version" === t && "number" != typeof e[t]) return Error("Database version must be a number.");
                                    this._config[t] = e[t]
                                }
                                return !("driver" in e) || !e.driver || this.setDriver(this._config.driver)
                            }, e.prototype.defineDriver = function(e, t, r) {
                                var n = new o(function(t, r) {
                                    try {
                                        var n = e._driver,
                                            a = Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");
                                        if (!e._driver) return void r(a);
                                        for (var i = ei.concat("_initStorage"), l = 0, c = i.length; l < c; l++) {
                                            var u = i[l];
                                            if ((!Y(ea, u) || e[u]) && "function" != typeof e[u]) return void r(a)
                                        }
                                        for (var d = function(e) {
                                                return function() {
                                                    var t = Error("Method " + e + " is not implemented by the current driver"),
                                                        r = o.reject(t);
                                                    return s(r, arguments[arguments.length - 1]), r
                                                }
                                            }, f = 0, p = ea.length; f < p; f++) {
                                            var h = ea[f];
                                            e[h] || (e[h] = d(h))
                                        }
                                        var m = function(r) {
                                            ee[n] && console.info("Redefining LocalForage driver: " + n), ee[n] = e, et[n] = r, t()
                                        };
                                        "_support" in e ? e._support && "function" == typeof e._support ? e._support().then(m, r) : m(!!e._support) : m(!0)
                                    } catch (e) {
                                        r(e)
                                    }
                                });
                                return l(n, t, r), n
                            }, e.prototype.driver = function() {
                                return this._driver || null
                            }, e.prototype.getDriver = function(e, t, r) {
                                var n = ee[e] ? o.resolve(ee[e]) : o.reject(Error("Driver not found."));
                                return l(n, t, r), n
                            }, e.prototype.getSerializer = function(e) {
                                var t = o.resolve(K);
                                return l(t, e), t
                            }, e.prototype.ready = function(e) {
                                var t = this,
                                    r = t._driverSet.then(function() {
                                        return null === t._ready && (t._ready = t._initDriver()), t._ready
                                    });
                                return l(r, e, e), r
                            }, e.prototype.setDriver = function(e, t, r) {
                                var n = this;
                                X(e) || (e = [e]);
                                var a = this._getSupportedDrivers(e);

                                function i() {
                                    n._config.driver = n.driver()
                                }

                                function s(e) {
                                    return n._extend(e), i(), n._ready = n._initStorage(n._config), n._ready
                                }
                                var c = null !== this._driverSet ? this._driverSet.catch(function() {
                                    return o.resolve()
                                }) : o.resolve();
                                return this._driverSet = c.then(function() {
                                    var e = a[0];
                                    return n._dbInfo = null, n._ready = null, n.getDriver(e).then(function(e) {
                                        n._driver = e._driver, i(), n._wrapLibraryMethodsWithReady(), n._initDriver = function() {
                                            var e = 0;
                                            return function t() {
                                                for (; e < a.length;) {
                                                    var r = a[e];
                                                    return e++, n._dbInfo = null, n._ready = null, n.getDriver(r).then(s).catch(t)
                                                }
                                                i();
                                                var l = Error("No available storage method found.");
                                                return n._driverSet = o.reject(l), n._driverSet
                                            }()
                                        }
                                    })
                                }).catch(function() {
                                    i();
                                    var e = Error("No available storage method found.");
                                    return n._driverSet = o.reject(e), n._driverSet
                                }), l(this._driverSet, t, r), this._driverSet
                            }, e.prototype.supports = function(e) {
                                return !!et[e]
                            }, e.prototype._extend = function(e) {
                                es(this, e)
                            }, e.prototype._getSupportedDrivers = function(e) {
                                for (var t = [], r = 0, n = e.length; r < n; r++) {
                                    var a = e[r];
                                    this.supports(a) && t.push(a)
                                }
                                return t
                            }, e.prototype._wrapLibraryMethodsWithReady = function() {
                                for (var e = 0, t = ei.length; e < t; e++) ! function(e, t) {
                                    e[t] = function() {
                                        var r = arguments;
                                        return e.ready().then(function() {
                                            return e[t].apply(e, r)
                                        })
                                    }
                                }(this, ei[e])
                            }, e.prototype.createInstance = function(t) {
                                return new e(t)
                            }, e
                        }())
                    }, {
                        3: 3
                    }]
                }, {}, [4])(4)
            };
            if ("object" == typeof t && "u" > typeof r) r.exports = n();
            else if ("function" == typeof define && define.amd) {
                let t;
                void 0 !== (t = n()) && e.v(t)
            } else("u" > typeof window ? window : e.g).localforage = n()
        }),
        av = ay((t, r) => {
            var n, a;
            let i;
            n = "u" > typeof self ? self : t, a = function(e) {
                var t = /^~~local_forage_type~([^~]+)~/,
                    r = Object.prototype.toString;

                function n(e) {
                    var t = .75 * e.length,
                        r = e.length;
                    "=" === e[e.length - 1] && (t--, "=" === e[e.length - 2] && t--);
                    for (var n = new ArrayBuffer(t), a = new Uint8Array(n), i = 0, o = 0; i < r; i += 4) {
                        var s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[i]),
                            l = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[i + 1]),
                            c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[i + 2]),
                            u = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[i + 3]);
                        a[o++] = s << 2 | l >> 4, a[o++] = (15 & l) << 4 | c >> 2, a[o++] = (3 & c) << 6 | 63 & u
                    }
                    return n
                }

                function a(e) {
                    for (var t = new Uint8Array(e), r = "", n = 0; n < t.length; n += 3) r += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" [t[n] >> 2], r += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" [(3 & t[n]) << 4 | t[n + 1] >> 4], r += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" [(15 & t[n + 1]) << 2 | t[n + 2] >> 6], r += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" [63 & t[n + 2]];
                    return t.length % 3 == 2 ? r = r.substring(0, r.length - 1) + "=" : t.length % 3 == 1 && (r = r.substring(0, r.length - 2) + "=="), r
                }

                function i(e, t) {
                    return (e.name || t.name) + "/" + (e.storeName || t.storeName) + "/"
                }

                function o(e, t) {
                    t && e.then(function(e) {
                        t(null, e)
                    }, function(e) {
                        t(e)
                    })
                }

                function s() {
                    for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
                    if (arguments.length && "function" == typeof arguments[arguments.length - 1]) return arguments[arguments.length - 1]
                }

                function l(e, t) {
                    var r = this;
                    if (t = s.apply(this, arguments), !(e = "function" != typeof e && e || {}).name) {
                        var n = this.config();
                        e.name = e.name || n.name, e.storeName = e.storeName || n.storeName
                    }
                    return {
                        promise: e.name ? new Promise(function(t) {
                            t(e.storeName ? i(e, r._defaultConfig) : e.name + "/")
                        }) : Promise.reject("Invalid arguments"),
                        callback: t
                    }
                }

                function c(e) {
                    return "string" != typeof e && (console.warn(e + " used as a key, but it is not a string."), e = String(e)), e
                }
                var u = {
                        bufferToString: a,
                        deserialize: function(e) {
                            if ("__lfsc__:" !== e.substring(0, 9)) return JSON.parse(e);
                            var r, a = e.substring(13),
                                i = e.substring(9, 13);
                            if ("blob" === i && t.test(a)) {
                                var o = a.match(t);
                                r = o[1], a = a.substring(o[0].length)
                            }
                            var s = n(a);
                            switch (i) {
                                case "arbf":
                                    return s;
                                case "blob":
                                    return function(e, t) {
                                        e = e || [], t = t || {};
                                        try {
                                            return new Blob(e, t)
                                        } catch (i) {
                                            if ("TypeError" !== i.name) throw i;
                                            for (var r = "u" > typeof BlobBuilder ? BlobBuilder : "u" > typeof MSBlobBuilder ? MSBlobBuilder : "u" > typeof MozBlobBuilder ? MozBlobBuilder : WebKitBlobBuilder, n = new r, a = 0; a < e.length; a += 1) n.append(e[a]);
                                            return n.getBlob(t.type)
                                        }
                                    }([s], {
                                        type: r
                                    });
                                case "si08":
                                    return new Int8Array(s);
                                case "ui08":
                                    return new Uint8Array(s);
                                case "uic8":
                                    return new Uint8ClampedArray(s);
                                case "si16":
                                    return new Int16Array(s);
                                case "ur16":
                                    return new Uint16Array(s);
                                case "si32":
                                    return new Int32Array(s);
                                case "ui32":
                                    return new Uint32Array(s);
                                case "fl32":
                                    return new Float32Array(s);
                                case "fl64":
                                    return new Float64Array(s);
                                default:
                                    throw Error("Unkown type: " + i)
                            }
                        },
                        serialize: function(e, t) {
                            var n = "";
                            if (e && (n = r.call(e)), e && ("[object ArrayBuffer]" === n || e.buffer && "[object ArrayBuffer]" === r.call(e.buffer))) {
                                var i = void 0,
                                    o = "__lfsc__:";
                                e instanceof ArrayBuffer ? (i = e, o += "arbf") : (i = e.buffer, "[object Int8Array]" === n ? o += "si08" : "[object Uint8Array]" === n ? o += "ui08" : "[object Uint8ClampedArray]" === n ? o += "uic8" : "[object Int16Array]" === n ? o += "si16" : "[object Uint16Array]" === n ? o += "ur16" : "[object Int32Array]" === n ? o += "si32" : "[object Uint32Array]" === n ? o += "ui32" : "[object Float32Array]" === n ? o += "fl32" : "[object Float64Array]" === n ? o += "fl64" : t(Error("Failed to get type for BinaryArray"))), t(o + a(i))
                            } else if ("[object Blob]" === n) {
                                var s = new FileReader;
                                s.onload = function() {
                                    t("__lfsc__:blob" + ("~~local_forage_type~" + e.type + "~") + a(this.result))
                                }, s.readAsArrayBuffer(e)
                            } else try {
                                t(JSON.stringify(e))
                            } catch (r) {
                                console.error("Couldn't convert value into a JSON string: ", e), t(null, r)
                            }
                        },
                        stringToBuffer: n
                    },
                    d = {},
                    f = function() {
                        function e(e) {
                            this.kp = e, this.data = {}
                        }
                        return e.resolve = function(t) {
                            return d[t] || (d[t] = new e(t)), d[t]
                        }, e.prototype.clear = function() {
                            this.data = {}
                        }, e.prototype.drop = function() {
                            this.clear(), delete d[this.kp]
                        }, e.prototype.get = function(e) {
                            return this.data[e]
                        }, e.prototype.key = function(e) {
                            return this.keys()[e]
                        }, e.prototype.keys = function() {
                            return Object.keys(this.data)
                        }, e.prototype.rm = function(e) {
                            delete this.data[e]
                        }, e.prototype.set = function(e, t) {
                            this.data[e] = t
                        }, e
                    }();
                e._support = !0, e._driver = "localforage-driver-memory", e._initStorage = function(e) {
                    var t = e ? function e(t) {
                            if (null === t || "object" != typeof t || "isActiveClone" in t) return t;
                            var r, n, a = t instanceof Date ? new Date(t) : t.constructor();
                            try {
                                for (var i, o, s, l = (i = Object.keys(t), o = "function" == typeof Symbol && i[Symbol.iterator], s = 0, o ? o.call(i) : {
                                        next: function() {
                                            return i && s >= i.length && (i = void 0), {
                                                value: i && i[s++],
                                                done: !i
                                            }
                                        }
                                    }), c = l.next(); !c.done; c = l.next()) {
                                    var u = c.value;
                                    Object.prototype.hasOwnProperty.call(t, u) && (t.isActiveClone = null, a[u] = e(t[u]), delete t.isActiveClone)
                                }
                            } catch (e) {
                                r = {
                                    error: e
                                }
                            } finally {
                                try {
                                    c && !c.done && (n = l.return) && n.call(l)
                                } finally {
                                    if (r) throw r.error
                                }
                            }
                            return a
                        }(e) : {},
                        r = i(t, this._defaultConfig),
                        n = f.resolve(r);
                    return this._dbInfo = t, this._dbInfo.serializer = u, this._dbInfo.keyPrefix = r, this._dbInfo.mStore = n, Promise.resolve()
                }, e.clear = function(e) {
                    var t = this,
                        r = this.ready().then(function() {
                            t._dbInfo.mStore.clear()
                        });
                    return o(r, e), r
                }, e.dropInstance = function(e, t) {
                    var r = l.apply(this, arguments),
                        n = r.promise,
                        a = r.callback;
                    return o(n.then(function(e) {
                        f.resolve(e).drop()
                    }), a), n
                }, e.getItem = function(e, t) {
                    var r = this;
                    e = c(e);
                    var n = this.ready().then(function() {
                        var t = r._dbInfo.mStore.get(e);
                        return null == t ? null : r._dbInfo.serializer.deserialize(t)
                    });
                    return o(n, t), n
                }, e.iterate = function(e, t) {
                    var r = this,
                        n = this.ready().then(function() {
                            for (var t = r._dbInfo.mStore, n = t.keys(), a = 0; a < n.length; a++) {
                                var i = t.get(n[a]);
                                if (i && (i = r._dbInfo.serializer.deserialize(i)), void 0 !== (i = e(i, n[a], a + 1))) return i
                            }
                        });
                    return o(n, t), n
                }, e.key = function(e, t) {
                    var r = this,
                        n = this.ready().then(function() {
                            var t;
                            try {
                                t = r._dbInfo.mStore.key(e), void 0 === t && (t = null)
                            } catch {
                                t = null
                            }
                            return t
                        });
                    return o(n, t), n
                }, e.keys = function(e) {
                    var t = this,
                        r = this.ready().then(function() {
                            return t._dbInfo.mStore.keys()
                        });
                    return o(r, e), r
                }, e.length = function(e) {
                    var t = this.keys().then(function(e) {
                        return e.length
                    });
                    return o(t, e), t
                }, e.removeItem = function(e, t) {
                    var r = this;
                    e = c(e);
                    var n = this.ready().then(function() {
                        r._dbInfo.mStore.rm(e)
                    });
                    return o(n, t), n
                }, e.setItem = function(e, t, r) {
                    var n = this;
                    e = c(e);
                    var a = this.ready().then(function() {
                        void 0 === t && (t = null);
                        var r = t;
                        return new Promise(function(a, i) {
                            n._dbInfo.serializer.serialize(t, function(t, o) {
                                if (o) i(o);
                                else try {
                                    n._dbInfo.mStore.set(e, t), a(r)
                                } catch (e) {
                                    i(e)
                                }
                            })
                        })
                    });
                    return o(a, r), a
                }, Object.defineProperty(e, "__esModule", {
                    value: !0
                })
            }, "object" == typeof t && "u" > typeof r ? a(t) : "function" == typeof define && define.amd ? void 0 !== (i = a(exports)) && e.v(i) : a(n.LocalforageDriverMemory = {})
        }),
        ax = ag(ab()),
        aw = ag(av()),
        a_ = {
            display: "none",
            position: "fixed",
            top: "0",
            right: "0",
            width: "100%",
            height: "100%",
            borderRadius: "0",
            border: "none",
            opacity: "0",
            zIndex: "-1"
        },
        aC = (Object.assign(rm, {
            platform: "web",
            sdkName: "magic-sdk",
            version: "33.0.0",
            defaultEndpoint: "https://auth.magic.link/",
            ViewController: class extends nv {
                activeElement = null;
                iframe;
                relayerSrc = no(`/send?params=${encodeURIComponent(this.parameters)}`, this.endpoint).href;
                init() {
                    this.test = "hello", this.iframe = new Promise(e => {
                        let t = () => {
                            var t;
                            if (t = encodeURIComponent(this.parameters), [].slice.call(document.querySelectorAll(".magic-iframe")).find(e => e.src.includes(t))) new rv(eH.DuplicateIframe, "Duplicate iframes found.").log();
                            else {
                                let t = document.createElement("iframe");
                                t.classList.add("magic-iframe"), t.dataset.magicIframeLabel = no(this.endpoint).host, t.title = "Secure Modal", t.src = this.relayerSrc, t.allow = "clipboard-read; clipboard-write",
                                    function(e) {
                                        for (let [t, r] of Object.entries(a_)) e.style[t] = r
                                    }(t), document.body.appendChild(t), e(t)
                            }
                        };
                        ["loaded", "interactive", "complete"].includes(document.readyState) ? t() : window.addEventListener("load", t, !1)
                    }), this.iframe.then(e => {
                        e instanceof HTMLIFrameElement && e.addEventListener("load", async () => {
                            this.heartbeatDebounce()
                        })
                    }), window.addEventListener("message", e => {
                        if (e.origin === this.endpoint && e.data.msgType && (e.data.msgType.includes(e0.MAGIC_PONG) && (this.lastPongTime = Date.now()), e.data && this.messageHandlers.size))
                            for (let t of (e.data.response = e.data.response ? ? {}, this.stopHeartBeat(), this.messageHandlers.values())) t(e)
                    }), window.addEventListener("beforeunload", () => {
                        this.stopHeartBeat()
                    })
                }
                async showOverlay() {
                    let e = await this.iframe;
                    e.style.display = "block", e.style.zIndex = "2147483647", e.style.opacity = "1", this.activeElement = document.activeElement, e.focus()
                }
                async hideOverlay() {
                    let e = await this.iframe;
                    e.style.display = "none", e.style.zIndex = "-1", e.style.opacity = "0", this.activeElement ? .focus && this.activeElement.focus(), this.activeElement = null
                }
                async _post(e) {
                    let t = await this.iframe;
                    if (t && t.contentWindow) t.contentWindow.postMessage(e, this.endpoint);
                    else throw r_()
                }
                async checkRelayerExistsInDOM() {
                    let e = await this.iframe;
                    return !!e && !!e.contentWindow && !![].slice.call(document.querySelectorAll(".magic-iframe")).find(e => e.src.includes(encodeURIComponent(this.parameters)))
                }
                async reloadRelayer() {
                    let e = await this.iframe;
                    if (this.stopHeartBeat(), !e) {
                        this.init(), console.warn("Magic SDK: Modal lost, re-initiating");
                        return
                    }
                    if (!e.contentWindow) {
                        document.body.appendChild(e), console.warn("Magic SDK: Modal did not append in the iframe, re-initiating");
                        return
                    }
                    e && (e.src = this.relayerSrc)
                }
            },
            configureStorage: async () => {
                let e = ax.default.createInstance({
                    name: "MagicAuthLocalStorageDB",
                    storeName: "MagicAuthLocalStorage"
                });
                return await e.defineDriver(aw), await e.setDriver([ax.default.INDEXEDDB, ax.default.LOCALSTORAGE, aw._driver]), e
            }
        }), ny),
        aE = e.i(510700),
        aS = e.i(829128);
    let aA = eV.default.env.NEXT_PUBLIC_MAGIC_KEY || "pk_live_99ABD23F9F1C8266",
        aI = ({
            chainId: e = 137,
            config: t
        } = {}) => {
            let r = aE.chainConfigs[e],
                n = (0, aS.createRpc)({
                    chainId: r.id,
                    provider: "alchemy",
                    apiKey: r.rpcUrls.alchemy.key
                });
            return new aC(t ? .environmentVariables ? .apiKey || aA, {
                network: {
                    rpcUrl: n.http,
                    chainId: r.id
                },
                extensions: [new al]
            })
        };
    e.s(["createMagicSdk", 0, aI], 864912);
    var aT = e.i(631222);
    e.s(["usePreloadMagic", 0, () => {
        ez.default.useEffect(() => {
            aI({
                chainId: 137,
                config: {
                    environmentVariables: {
                        apiKey: aT.MAGIC_KEY
                    }
                }
            }).preload()
        }, [])
    }], 498419)
}, 439013, e => {
    "use strict";
    var t = e.i(681727),
        r = e.i(416340),
        n = e.i(912504);
    e.s(["useConnectionEffect", 0, function(e = {}) {
        let {
            onConnect: a,
            onDisconnect: i
        } = e, o = (0, n.useConfig)(e);
        (0, r.useEffect)(() => (0, t.watchConnection)(o, {
            onChange(e, t) {
                if (("reconnecting" === t.status || "connecting" === t.status && void 0 === t.address) && "connected" === e.status) {
                    let {
                        address: r,
                        addresses: n,
                        chain: i,
                        chainId: o,
                        connector: s
                    } = e, l = "reconnecting" === t.status || void 0 === t.status;
                    a ? .({
                        address: r,
                        addresses: n,
                        chain: i,
                        chainId: o,
                        connector: s,
                        isReconnected: l
                    })
                } else "connected" === t.status && "disconnected" === e.status && i ? .()
            }
        }), [o, a, i])
    }])
}, 205463, e => {
    "use strict";
    e.s(["useReconnection", () => S], 205463);
    var t = e.i(999061),
        r = e.i(399482),
        n = e.i(905333),
        a = e.i(964063),
        i = e.i(213333),
        o = e.i(722045),
        s = e.i(416340),
        l = e.i(805949),
        c = e.i(439013),
        u = e.i(945930),
        d = e.i(53950),
        f = e.i(827681),
        p = e.i(566515),
        h = e.i(603580),
        m = e.i(933850),
        y = e.i(155963),
        g = e.i(789608),
        b = e.i(839968),
        v = e.i(601550),
        x = e.i(625377);

    function w(e) {
        return e.id
    }

    function _(e) {
        return e.id
    }

    function C(e) {
        return e.id
    }
    var E = e.i(846170);

    function S() {
        let e, S, A, I, T, k, O, R = (0, t.c)(30),
            {
                setAuthenticationStatus: N,
                setConnectorStatus: M,
                authenticationStatus: P
            } = (0, h.useSiwxContext)(),
            {
                isLoggedIn: D,
                isLoggedInPending: j,
                authenticatedUser: L,
                gamma: F
            } = (0, p.useAuthenticationContext)(),
            U = (0, a.useDocumentVisibility)(),
            {
                connector: $,
                status: z,
                address: B,
                chainId: q
            } = (0, l.useConnection)(),
            {
                disconnect: W
            } = (0, g.useDisconnect)(),
            {
                onConnect: Z
            } = (0, b.useOnConnect)(),
            {
                onReconnect: V
            } = function() {
                let e, a, i, o, s, l = (0, t.c)(16),
                    {
                        setConnector: c,
                        setAuthenticationStatus: d,
                        setConnectorStatus: m
                    } = (0, h.useSiwxContext)(),
                    {
                        signIn: y,
                        authenticatedUser: b,
                        setWasSessionPersisted: x
                    } = (0, p.useAuthenticationContext)(),
                    {
                        disconnect: w
                    } = (0, g.useDisconnect)();
                l[0] !== b || l[1] !== w || l[2] !== d || l[3] !== c || l[4] !== m || l[5] !== x || l[6] !== y ? (e = {
                    mutationFn: async e => {
                        let {
                            address: t,
                            chainId: a,
                            connector: i
                        } = e, o = (0, r.createWalletCache)();
                        if (!o.state.exists && (0, n.isMagicConnector)(i.id)) {
                            (0, u.setLogoutTrigger)({
                                reason: "session_invalidated",
                                initiator: "system",
                                trigger: "on_reconnect_missing_auth_cache"
                            }), w();
                            return
                        }
                        o.state.oauthRedirected && (c({
                            id: i.id,
                            name: i.name
                        }), y({
                            account: t,
                            connector: i,
                            chainId: a,
                            authenticatedUser: b
                        })), m(f.ConnectorStates.CONNECTED), o.state.oauthRedirected || d(f.AuthenticationStatusStates.SUCCESS), x(!0)
                    }
                }, l[0] = b, l[1] = w, l[2] = d, l[3] = c, l[4] = m, l[5] = x, l[6] = y, l[7] = e) : e = l[7];
                let _ = (0, v.useMutation)(e);
                return l[8] !== _ ? ({
                    mutate: a,
                    mutateAsync: i,
                    ...o
                } = _, l[8] = _, l[9] = a, l[10] = i, l[11] = o) : (a = l[9], i = l[10], o = l[11]), l[12] !== a || l[13] !== i || l[14] !== o ? (s = {
                    onReconnect: a,
                    onReconnectAsync: i,
                    ...o
                }, l[12] = a, l[13] = i, l[14] = o, l[15] = s) : s = l[15], s
            }(),
            {
                mutate: K
            } = function() {
                let e, n, a, i, o, s, l, c, u, y, b, v, E = (0, t.c)(32),
                    {
                        setAuthenticationStatus: S,
                        setConnectorStatus: A,
                        setConnector: I
                    } = (0, h.useSiwxContext)(),
                    {
                        authenticatedUser: T
                    } = (0, p.useAuthenticationContext)(),
                    {
                        disconnect: k
                    } = (0, g.useDisconnect)();
                E[0] !== T ? .type ? (e = e => {
                    let t = (0, r.createWalletCache)().state.value ? .connectorId;
                    return (0, m.getLogoutGuardDecision)({
                        authenticatedUserType: T ? .type,
                        cacheConnectorId: t,
                        connectorIds: [e]
                    })
                }, E[0] = T ? .type, E[1] = e) : e = E[1];
                let O = e;
                E[2] !== T || E[3] !== k || E[4] !== O || E[5] !== S || E[6] !== I || E[7] !== A ? (n = async (e, t) => {
                    let r = t ? .connectors ? .length ? t.connectors[0] : void 0,
                        n = e.find(e => e.connector.id === r ? .id);
                    if (n) {
                        I({
                            id: n.connector.id,
                            name: n.connector.name
                        }), A(f.ConnectorStates.CONNECTED);
                        return
                    }
                    let a = r ? .id;
                    if (!T) return void d.logger.info("[useReconnect > onSuccess] Ignoring reconnect without connection; auth unresolved", {
                        attemptedConnectorId: a
                    });
                    let i = O(a),
                        o = "magic_non_magic_connector" === i.reason ? "magic_non_magic_reconnect" : i.reason;
                    i.shouldLogout ? (d.logger.info("[useReconnect > onSuccess] Attempting connection from provided connectors", {
                        connectorIds: t ? .connectors ? .map(C)
                    }), A(f.ConnectorStates.DISCONNECTED), S(f.AuthenticationStatusStates.IDLE), k({
                        signOutOnDisconnect: !1
                    }), d.logger.info("[useReconnect > onSuccess] No connection found; preserving session", {
                        connectorIds: t ? .connectors ? .map(_),
                        attemptedConnectorId: a,
                        authType: T.type,
                        cacheConnectorId: i.cacheConnectorId
                    })) : d.logger.info("[useReconnect > onSuccess] Ignoring reconnect without connection", {
                        attemptedConnectorId: a,
                        authType: T.type,
                        cacheConnectorId: i.cacheConnectorId,
                        skipReason: o
                    })
                }, E[2] = T, E[3] = k, E[4] = O, E[5] = S, E[6] = I, E[7] = A, E[8] = n) : n = E[8], E[9] !== T || E[10] !== O || E[11] !== A ? (a = (e, t) => {
                    let r = t ? .connectors ? .[0] ? t.connectors[0].id : void 0;
                    if (!T) return void d.logger.info("[useReconnect > reconnectAsync] Ignoring reconnect error; auth unresolved", {
                        attemptedConnectorId: r,
                        error: e
                    });
                    let n = O(r),
                        a = "magic_non_magic_connector" === n.reason ? "magic_non_magic_reconnect" : n.reason;
                    n.shouldLogout ? (d.logger.info("[useReconnect > reconnectAsync] Reconnect error; preserving session", {
                        error: e,
                        connectorIds: t ? .connectors ? .map(w),
                        attemptedConnectorId: r,
                        authType: T.type,
                        cacheConnectorId: n.cacheConnectorId,
                        skipReason: a
                    }), A(f.ConnectorStates.DISCONNECTED)) : d.logger.info("[useReconnect > reconnectAsync] Ignoring reconnect error", {
                        attemptedConnectorId: r,
                        authType: T.type,
                        error: e,
                        cacheConnectorId: n.cacheConnectorId,
                        skipReason: a
                    })
                }, E[9] = T, E[10] = O, E[11] = A, E[12] = a) : a = E[12], E[13] !== n || E[14] !== a ? (i = {
                    mutation: {
                        onSuccess: n,
                        onError: a
                    }
                }, E[13] = n, E[14] = a, E[15] = i) : i = E[15];
                let R = (0, x.useReconnect)(i);
                return E[16] !== R ? ({
                    mutate: c,
                    mutateAsync: u,
                    isPending: s,
                    isSuccess: l,
                    isError: o,
                    status: b,
                    ...y
                } = R, E[16] = R, E[17] = o, E[18] = s, E[19] = l, E[20] = c, E[21] = u, E[22] = y, E[23] = b) : (o = E[17], s = E[18], l = E[19], c = E[20], u = E[21], y = E[22], b = E[23]), E[24] !== o || E[25] !== s || E[26] !== l || E[27] !== c || E[28] !== u || E[29] !== y || E[30] !== b ? (v = {
                    mutate: c,
                    mutateAsync: u,
                    isReconnecting: s,
                    isReconnected: l,
                    isError: o,
                    status: b,
                    ...y
                }, E[24] = o, E[25] = s, E[26] = l, E[27] = c, E[28] = u, E[29] = y, E[30] = b, E[31] = v) : v = E[31], v
            }(),
            H = (0, y.useConnectors)(),
            G = (0, i.usePrevious)(U),
            Q = s.default.useRef(!1),
            J = s.default.useRef(!1),
            Y = "disconnected" === z,
            X = "connected" === z;
        R[0] !== V ? (e = {
            onConnect: e => {
                let {
                    address: t,
                    chainId: a,
                    connector: i,
                    isReconnected: o
                } = e;
                o && ((0, n.isMagicConnector)(i.id) && (0, r.createWalletCache)().state.oauthRedirected && (J.current = !0), V({
                    address: t,
                    connector: i,
                    chainId: a
                }))
            }
        }, R[0] = V, R[1] = e) : e = R[1], (0, c.useConnectionEffect)(e), R[2] !== B || R[3] !== q || R[4] !== $ || R[5] !== Z ? (S = () => {
            !J.current && $ && q && B && (0, n.isMagicConnector)($.id) && (0, r.createWalletCache)().state.oauthReconnecting && (J.current = !0, Z({
                address: B,
                chainId: q,
                connector: $,
                isReconnected: !1
            }))
        }, A = [$, q, B, Z], R[2] = B, R[3] = q, R[4] = $, R[5] = Z, R[6] = S, R[7] = A) : (S = R[6], A = R[7]), s.default.useEffect(S, A), R[8] !== P || R[9] !== W || R[10] !== F || R[11] !== X || R[12] !== Y || R[13] !== D || R[14] !== j || R[15] !== N || R[16] !== M || R[17] !== z ? (I = () => {
            if (!Q.current && !j && P === f.AuthenticationStatusStates.PERSISTING) {
                if (Y) {
                    Q.current = !0, N(f.AuthenticationStatusStates.IDLE), M(f.ConnectorStates.DISCONNECTED);
                    return
                }
                X && !(0, r.createWalletCache)().state.oauthReconnecting && (D ? (Q.current = !0, N(f.AuthenticationStatusStates.SUCCESS), M(f.ConnectorStates.CONNECTED)) : "logged-out" === F.status ? (Q.current = !0, N(f.AuthenticationStatusStates.IDLE), M(f.ConnectorStates.DISCONNECTED), (0, u.setLogoutTrigger)({
                    reason: "session_invalidated",
                    initiator: "system",
                    trigger: "reconnection_connected_not_logged_in"
                }), W()) : "failure" === F.status && (Q.current = !0, N(f.AuthenticationStatusStates.SUCCESS), M(f.ConnectorStates.CONNECTED), d.logger.warn("[useReconnection] Preserving session on gamma auth check failure", {
                    gammaStatus: F.status,
                    gammaFailureCode: F.code,
                    gammaFailureType: F.type,
                    walletStatus: z
                })))
            }
        }, T = [D, F, j, Y, X, z, P, N, M, W], R[8] = P, R[9] = W, R[10] = F, R[11] = X, R[12] = Y, R[13] = D, R[14] = j, R[15] = N, R[16] = M, R[17] = z, R[18] = I, R[19] = T) : (I = R[18], T = R[19]), s.default.useEffect(I, T), R[20] !== L || R[21] !== H || R[22] !== D || R[23] !== j || R[24] !== G || R[25] !== K || R[26] !== z || R[27] !== U ? (k = () => {
            if ("visible" === U && "hidden" === G) {
                if (j) return void d.logger.info("[useReconnection] Skipping reconnect on visibility; auth still pending", {
                    visibility: U,
                    status: z
                });
                if (!D || "disconnected" !== z) return;
                let e = o.default.get(E.LAST_CONNECTOR_COOKIE_KEY),
                    t = H.find(t => t.id === e);
                if (!t) return;
                if (!L) return void d.logger.info("[useReconnection] Skipping reconnect on visibility; authenticated user unresolved", {
                    connectorId: t.id
                });
                let n = (0, r.createWalletCache)().state.value ? .connectorId;
                if (!n) return void d.logger.info("[useReconnection] Skipping reconnect on visibility; missing cache connector", {
                    authType: L.type,
                    connectorId: t.id
                });
                let a = (0, m.getLogoutGuardDecision)({
                        authenticatedUserType: L.type,
                        cacheConnectorId: n,
                        connectorIds: [t.id]
                    }),
                    i = "magic_non_magic_connector" === a.reason ? "magic_non_magic_reconnect" : a.reason;
                if (!a.shouldLogout) return void d.logger.info("[useReconnection] Skipping reconnect for visibility guard", {
                    authType: L.type,
                    connectorId: t.id,
                    cacheConnectorId: a.cacheConnectorId,
                    skipReason: i
                });
                d.logger.info("[useReconnection] Reconnecting on visibility restore", {
                    authType: L.type,
                    connectorId: t.id,
                    cacheConnectorId: a.cacheConnectorId
                }), K({
                    connectors: [t]
                })
            }
        }, O = [U, G, H, D, j, z, K, L], R[20] = L, R[21] = H, R[22] = D, R[23] = j, R[24] = G, R[25] = K, R[26] = z, R[27] = U, R[28] = k, R[29] = O) : (k = R[28], O = R[29]), s.default.useEffect(k, O)
    }
}, 912455, e => {
    "use strict";
    e.s(["createConnector", 0, function(e) {
        return e
    }])
}, 8969, e => {
    "use strict";
    e.s(["extractRpcUrls", 0, function(e) {
        let {
            chain: t
        } = e, r = t.rpcUrls.default.http[0];
        if (!e.transports) return [r];
        let n = e.transports ? .[t.id] ? .({
            chain: t
        });
        return (n ? .value ? .transports || [n]).map(({
            value: e
        }) => e ? .url || r)
    }])
}, 291833, e => {
    "use strict";
    var t = e.i(915341);
    class r extends t.BaseError {
        constructor() {
            super("Provider not found."), Object.defineProperty(this, "name", {
                enumerable: !0,
                configurable: !0,
                writable: !0,
                value: "ProviderNotFoundError"
            })
        }
    }
    class n extends t.BaseError {
        constructor({
            connector: e
        }) {
            super(`"${e.name}" does not support programmatic chain switching.`), Object.defineProperty(this, "name", {
                enumerable: !0,
                configurable: !0,
                writable: !0,
                value: "SwitchChainNotSupportedError"
            })
        }
    }
    e.s(["ProviderNotFoundError", 0, r, "SwitchChainNotSupportedError", 0, n])
}, 44071, 750367, 269639, e => {
    "use strict";
    e.s(["ConnectorContextProvider", () => T, "useConnectorContext", () => k], 44071);
    var t = e.i(221628),
        r = e.i(999061),
        n = e.i(905333),
        a = e.i(93257),
        i = e.i(416340),
        o = e.i(53950),
        s = e.i(827681),
        l = e.i(276990),
        c = e.i(290725),
        u = e.i(767158),
        d = e.i(498419),
        f = e.i(205463);
    e.s(["useContextWalletConnectModal", () => S, "useWalletConnectModal", () => A], 269639);
    var p = e.i(788494),
        h = e.i(912455),
        m = e.i(8969),
        y = e.i(291833),
        g = e.i(113967),
        b = e.i(186897),
        v = e.i(962702);

    function x(t) {
        let r, n, a, i, o, s, l, c, u = t.isNewChainsStale ? ? !0;
        return (0, h.createConnector)(d => ({
            id: "walletConnect",
            name: "WalletConnect",
            type: x.type,
            async setup() {
                let e = await this.getProvider().catch(() => null);
                e && (o || (o = this.onConnect.bind(this), e.on("connect", o)), l || (l = this.onSessionDelete.bind(this), e.on("session_delete", l)))
            },
            async connect({
                chainId: e,
                withCapabilities: t,
                ...r
            } = {}) {
                try {
                    let n = await this.getProvider();
                    if (!n) throw new y.ProviderNotFoundError;
                    s || (s = this.onDisplayUri, n.on("display_uri", s));
                    let u = e;
                    if (!u) {
                        let e = await d.storage ? .getItem("state") ? ? {};
                        u = d.chains.some(t => t.id === e.chainId) ? e.chainId : d.chains[0] ? .id
                    }
                    if (!u) throw Error("No chains found on connector.");
                    let f = await this.isChainsStale();
                    if (n.session && f && await n.disconnect(), !n.session || f) {
                        let e = d.chains.filter(e => e.id !== u).map(e => e.id);
                        await n.connect({
                            optionalChains: [u, ...e],
                            ..."pairingTopic" in r ? {
                                pairingTopic: r.pairingTopic
                            } : {}
                        }), this.setRequestedChainsIds(d.chains.map(e => e.id))
                    }
                    let p = (await n.enable()).map(e => (0, g.getAddress)(e)),
                        h = await this.getChainId();
                    if (e && h !== e) {
                        let t = await this.switchChain({
                            chainId: e
                        }).catch(e => {
                            if (e.code === v.UserRejectedRequestError.code && e.cause ? .message !== "Missing or invalid. request() method: wallet_addEthereumChain") throw e;
                            return {
                                id: h
                            }
                        });
                        h = t ? .id ? ? h
                    }
                    return s && (n.removeListener("display_uri", s), s = void 0), o && (n.removeListener("connect", o), o = void 0), a || (a = this.onAccountsChanged.bind(this), n.on("accountsChanged", a)), i || (i = this.onChainChanged.bind(this), n.on("chainChanged", i)), c || (c = this.onDisconnect.bind(this), n.on("disconnect", c)), l || (l = this.onSessionDelete.bind(this), n.on("session_delete", l)), {
                        accounts: t ? p.map(e => ({
                            address: e,
                            capabilities: {}
                        })) : p,
                        chainId: h
                    }
                } catch (e) {
                    if (/(user rejected|connection request reset)/i.test(e ? .message)) throw new v.UserRejectedRequestError(e);
                    throw e
                }
            },
            async disconnect() {
                let e = await this.getProvider();
                try {
                    await e ? .disconnect()
                } catch (e) {
                    if (!/No matching key/i.test(e.message)) throw e
                } finally {
                    i && (e ? .removeListener("chainChanged", i), i = void 0), c && (e ? .removeListener("disconnect", c), c = void 0), o || (o = this.onConnect.bind(this), e ? .on("connect", o)), a && (e ? .removeListener("accountsChanged", a), a = void 0), l && (e ? .removeListener("session_delete", l), l = void 0), this.setRequestedChainsIds([])
                }
            },
            async getAccounts() {
                return (await this.getProvider()).accounts.map(e => (0, g.getAddress)(e))
            },
            async getProvider({
                chainId: a
            } = {}) {
                async function i() {
                    let r = d.chains.map(e => e.id);
                    if (!r.length) return;
                    let {
                        EthereumProvider: n
                    } = await (() => {
                        try {
                            return e.A(463433)
                        } catch {
                            throw Error('dependency "@walletconnect/ethereum-provider" not found')
                        }
                    })();
                    return await n.init({ ...t,
                        disableProviderPing: !0,
                        optionalChains: r,
                        projectId: t.projectId,
                        rpcMap: Object.fromEntries(d.chains.map(e => {
                            let [t] = (0, m.extractRpcUrls)({
                                chain: e,
                                transports: d.transports
                            });
                            return [e.id, t]
                        })),
                        showQrModal: t.showQrModal ? ? !0
                    })
                }
                return r || (n || (n = i()), r = await n, r ? .events.setMaxListeners(1 / 0)), a && await this.switchChain ? .({
                    chainId: a
                }), r
            },
            async getChainId() {
                return (await this.getProvider()).chainId
            },
            async isAuthorized() {
                try {
                    let [e, t] = await Promise.all([this.getAccounts(), this.getProvider()]);
                    if (!e.length) return !1;
                    if (await this.isChainsStale() && t.session) return await t.disconnect().catch(() => {}), !1;
                    return !0
                } catch {
                    return !1
                }
            },
            async switchChain({
                addEthereumChainParameter: e,
                chainId: t
            }) {
                let r = await this.getProvider();
                if (!r) throw new y.ProviderNotFoundError;
                let n = d.chains.find(e => e.id === t);
                if (!n) throw new v.SwitchChainError(new p.ChainNotConfiguredError);
                let a = () => {};
                try {
                    await Promise.all([new Promise(e => {
                        a = r => {
                            r.chainId === t && (d.emitter.off("change", a), e())
                        }, d.emitter.on("change", a)
                    }), r.request({
                        method: "wallet_switchEthereumChain",
                        params: [{
                            chainId: (0, b.numberToHex)(t)
                        }]
                    })]);
                    let e = await this.getRequestedChainsIds();
                    return this.setRequestedChainsIds([...e, t]), n
                } catch (i) {
                    if (d.emitter.off("change", a), /(user rejected)/i.test(i.message)) throw new v.UserRejectedRequestError(i);
                    try {
                        let a, i;
                        a = e ? .blockExplorerUrls ? e.blockExplorerUrls : n.blockExplorers ? .default.url ? [n.blockExplorers ? .default.url] : [], i = e ? .rpcUrls ? .length ? e.rpcUrls : [...n.rpcUrls.default.http];
                        let o = {
                            blockExplorerUrls: a,
                            chainId: (0, b.numberToHex)(t),
                            chainName: e ? .chainName ? ? n.name,
                            iconUrls: e ? .iconUrls,
                            nativeCurrency: e ? .nativeCurrency ? ? n.nativeCurrency,
                            rpcUrls: i
                        };
                        await r.request({
                            method: "wallet_addEthereumChain",
                            params: [o]
                        });
                        let s = await this.getRequestedChainsIds();
                        return this.setRequestedChainsIds([...s, t]), n
                    } catch (e) {
                        throw new v.UserRejectedRequestError(e)
                    }
                }
            },
            onAccountsChanged(e) {
                0 === e.length ? this.onDisconnect() : d.emitter.emit("change", {
                    accounts: e.map(e => (0, g.getAddress)(e))
                })
            },
            onChainChanged(e) {
                let t = Number(e);
                d.emitter.emit("change", {
                    chainId: t
                })
            },
            async onConnect(e) {
                let t = Number(e.chainId),
                    r = await this.getAccounts();
                d.emitter.emit("connect", {
                    accounts: r,
                    chainId: t
                })
            },
            async onDisconnect(e) {
                this.setRequestedChainsIds([]), d.emitter.emit("disconnect");
                let t = await this.getProvider();
                a && (t.removeListener("accountsChanged", a), a = void 0), i && (t.removeListener("chainChanged", i), i = void 0), c && (t.removeListener("disconnect", c), c = void 0), l && (t.removeListener("session_delete", l), l = void 0), o || (o = this.onConnect.bind(this), t.on("connect", o))
            },
            onDisplayUri(e) {
                d.emitter.emit("message", {
                    type: "display_uri",
                    data: e
                })
            },
            onSessionDelete() {
                this.onDisconnect()
            },
            getNamespaceChainsIds: () => r ? r.session ? .namespaces.eip155 ? .accounts ? .map(e => Number.parseInt(e.split(":")[1] || "", 10)) ? ? [] : [],
            async getRequestedChainsIds() {
                return await d.storage ? .getItem(this.requestedChainsStorageKey) ? ? []
            },
            async isChainsStale() {
                if (!u) return !1;
                let e = d.chains.map(e => e.id),
                    t = this.getNamespaceChainsIds();
                if (t.length && !t.some(t => e.includes(t))) return !1;
                let r = await this.getRequestedChainsIds();
                return !e.every(e => r.includes(e))
            },
            async setRequestedChainsIds(e) {
                await d.storage ? .setItem(this.requestedChainsStorageKey, e)
            },
            get requestedChainsStorageKey() {
                return `${this.id}.requestedChains`
            }
        }))
    }
    x.type = "walletConnect", e.s(["walletConnect", 0, x], 750367);
    var w = e.i(631222),
        _ = e.i(603580),
        C = e.i(449907),
        E = e.i(155963);

    function S() {
        let {
            options: e
        } = (0, _.useSiwxContext)(), {
            connectAsync: t
        } = (0, C.useConnect)(), r = (0, E.useConnectors)(), [a, s] = i.default.useState(!1);
        return {
            isOpen: a,
            open: async () => {
                let a = document.createElement("style");
                a.innerHTML = "w3m-modal, wcm-modal{ --wcm-z-index: 2147483647; --w3m-z-index:2147483647; }", document.head.appendChild(a);
                let i = r.find(e => (0, n.isWalletConnectConnector)(e.id));
                if (i) try {
                    let {
                        projectId: r
                    } = (await i.getProvider()).rpc, n = x({ ...i,
                        showQrModal: !0,
                        projectId: r
                    });
                    s(!0);
                    try {
                        await t({
                            connector: n,
                            chainId: e.initialChainId ? ? w.MATIC_CONFIG.chainId
                        })
                    } catch (e) {
                        o.logger.error("[useWalletConnectModal > open]", {
                            err: e
                        })
                    }
                    s(!1), document.head.removeChild(a)
                } catch (e) {
                    o.logger.error("[useWalletConnectModal > Could not get provider]", {
                        err: e
                    })
                } else o.logger.debug("[useWalletConnectModal > No WalletConnect connector available]")
            }
        }
    }
    let A = () => {
            let e, t = (0, r.c)(3),
                {
                    isOpenW3M: n,
                    openW3M: a
                } = k();
            return t[0] !== n || t[1] !== a ? (e = {
                isOpenW3M: n,
                openW3M: a
            }, t[0] = n, t[1] = a, t[2] = e) : e = t[2], e
        },
        I = i.default.createContext({
            openW3M: () => {
                throw Error("openW3M must be inside a Provider")
            },
            isOpenW3M: !1,
            getUri: () => {
                throw Error("getUri must be inside a Provider")
            }
        });

    function T(e) {
        let p, h, m, y, g, b, v, x, w, C = (0, r.c)(23),
            {
                children: E
            } = e,
            {
                options: A,
                connectorStatus: T,
                connector: k
            } = (0, _.useSiwxContext)(),
            {
                isOpen: O,
                open: R
            } = S(),
            [N, M] = i.default.useState(!1),
            P = i.default.useRef(void 0);
        C[0] !== k || C[1] !== T || C[2] !== O || C[3] !== N ? (p = N || O || (0, n.isWalletConnectConnector)(k.id) && T === s.ConnectorStates.CONNECTING, C[0] = k, C[1] = T, C[2] = O, C[3] = N, C[4] = p) : p = C[4], C[5] !== p ? (h = {
            enabled: p
        }, C[5] = p, C[6] = h) : h = C[6];
        let {
            uri: D
        } = (0, l.useWalletConnectUri)(h);
        C[7] !== A.bufferPolyfill ? (m = () => {
            A.bufferPolyfill && (window.Buffer = window.Buffer ? ? a.Buffer)
        }, y = [A.bufferPolyfill], C[7] = A.bufferPolyfill, C[8] = m, C[9] = y) : (m = C[8], y = C[9]), i.default.useEffect(m, y), C[10] !== D || C[11] !== N ? (g = () => {
            if (!D) return;
            let e = !!P.current;
            P.current && (P.current.resolve(D), P.current = void 0), N && (o.logger.info("[ConnectorContext] WalletConnect URI flow completed; disabling temporary flag", {
                hadDeferred: e
            }), M(!1))
        }, b = [D, N], C[10] = D, C[11] = N, C[12] = g, C[13] = b) : (g = C[12], b = C[13]), i.default.useEffect(g, b), C[14] !== D ? (v = () => {
            if (D) return Promise.resolve(D);
            if (P.current) return P.current.p;
            let e = function() {
                let e, t = new Promise(t => {
                    e = t
                });
                if (!e) throw Error("resolve is undefined");
                return {
                    p: t,
                    resolve: e
                }
            }();
            return P.current = e, o.logger.info("[ConnectorContext] Enabling WalletConnect URI flow", {
                hasDeferred: !0
            }), M(!0), e.p
        }, C[14] = D, C[15] = v) : v = C[15];
        let j = v;
        (0, c.useLongPendingOauth)(), (0, u.useOptimisticMagicReconnect)(), (0, d.usePreloadMagic)(), (0, f.useReconnection)(), C[16] !== j || C[17] !== O || C[18] !== R ? (x = {
            openW3M: R,
            isOpenW3M: O,
            getUri: j
        }, C[16] = j, C[17] = O, C[18] = R, C[19] = x) : x = C[19];
        let L = x;
        return C[20] !== E || C[21] !== L ? (w = (0, t.jsx)(I.Provider, {
            value: L,
            children: E
        }), C[20] = E, C[21] = L, C[22] = w) : w = C[22], w
    }
    let k = () => {
        let e = i.default.useContext(I);
        if (!e) throw Error("useConnectorContext Hook must be inside a Provider.");
        return e
    }
}, 368342, e => {
    "use strict";
    var t = e.i(322324),
        r = e.i(165974);
    let n = (0, t.create)()((0, r.immer)((e, t) => ({
        misroutedEoas: {},
        setMisroutedEoa: (t, r) => {
            e(e => {
                e.misroutedEoas[t.toLowerCase()] = r
            })
        },
        isMisroutedEoa: e => !!e && !!t().misroutedEoas[e.toLowerCase()]
    })));
    e.s(["useMisroutedDepositWalletStore", 0, n])
}, 341219, (e, t, r) => {
    ! function(e) {
        "use strict";
        var n = "function",
            a = "undefined",
            i = "object",
            o = "string",
            s = "major",
            l = "model",
            c = "name",
            u = "type",
            d = "vendor",
            f = "version",
            p = "architecture",
            h = "console",
            m = "mobile",
            y = "tablet",
            g = "smarttv",
            b = "wearable",
            v = "embedded",
            x = "Amazon",
            w = "Apple",
            _ = "ASUS",
            C = "BlackBerry",
            E = "Browser",
            S = "Chrome",
            A = "Firefox",
            I = "Google",
            T = "Honor",
            k = "Huawei",
            O = "Microsoft",
            R = "Motorola",
            N = "Nvidia",
            M = "OnePlus",
            P = "Opera",
            D = "OPPO",
            j = "Samsung",
            L = "Sharp",
            F = "Sony",
            U = "Xiaomi",
            $ = "Zebra",
            z = "Facebook",
            B = "Chromium OS",
            q = "Mac OS",
            W = " Browser",
            Z = function(e, t) {
                var r = {};
                for (var n in e) t[n] && t[n].length % 2 == 0 ? r[n] = t[n].concat(e[n]) : r[n] = e[n];
                return r
            },
            V = function(e) {
                for (var t = {}, r = 0; r < e.length; r++) t[e[r].toUpperCase()] = e[r];
                return t
            },
            K = function(e, t) {
                return typeof e === o && -1 !== H(t).indexOf(H(e))
            },
            H = function(e) {
                return e.toLowerCase()
            },
            G = function(e, t) {
                if (typeof e === o) return e = e.replace(/^\s\s*/, ""), typeof t === a ? e : e.substring(0, 500)
            },
            Q = function(e, t) {
                for (var r, a, o, s, l, c, u = 0; u < t.length && !l;) {
                    var d = t[u],
                        f = t[u + 1];
                    for (r = a = 0; r < d.length && !l && d[r];)
                        if (l = d[r++].exec(e))
                            for (o = 0; o < f.length; o++) c = l[++a], typeof(s = f[o]) === i && s.length > 0 ? 2 === s.length ? typeof s[1] == n ? this[s[0]] = s[1].call(this, c) : this[s[0]] = s[1] : 3 === s.length ? typeof s[1] !== n || s[1].exec && s[1].test ? this[s[0]] = c ? c.replace(s[1], s[2]) : void 0 : this[s[0]] = c ? s[1].call(this, c, s[2]) : void 0 : 4 === s.length && (this[s[0]] = c ? s[3].call(this, c.replace(s[1], s[2])) : void 0) : this[s] = c || void 0;
                    u += 2
                }
            },
            J = function(e, t) {
                for (var r in t)
                    if (typeof t[r] === i && t[r].length > 0) {
                        for (var n = 0; n < t[r].length; n++)
                            if (K(t[r][n], e)) return "?" === r ? void 0 : r
                    } else if (K(t[r], e)) return "?" === r ? void 0 : r;
                return t.hasOwnProperty("*") ? t["*"] : e
            },
            Y = {
                ME: "4.90",
                "NT 3.11": "NT3.51",
                "NT 4.0": "NT4.0",
                2e3: "NT 5.0",
                XP: ["NT 5.1", "NT 5.2"],
                Vista: "NT 6.0",
                7: "NT 6.1",
                8: "NT 6.2",
                8.1: "NT 6.3",
                10: ["NT 6.4", "NT 10.0"],
                RT: "ARM"
            },
            X = {
                browser: [
                    [/\b(?:crmo|crios)\/([\w\.]+)/i],
                    [f, [c, "Chrome"]],
                    [/edg(?:e|ios|a)?\/([\w\.]+)/i],
                    [f, [c, "Edge"]],
                    [/(opera mini)\/([-\w\.]+)/i, /(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i, /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],
                    [c, f],
                    [/opios[\/ ]+([\w\.]+)/i],
                    [f, [c, P + " Mini"]],
                    [/\bop(?:rg)?x\/([\w\.]+)/i],
                    [f, [c, P + " GX"]],
                    [/\bopr\/([\w\.]+)/i],
                    [f, [c, P]],
                    [/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],
                    [f, [c, "Baidu"]],
                    [/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],
                    [f, [c, "Maxthon"]],
                    [/(kindle)\/([\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i, /(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i, /(?:ms|\()(ie) ([\w\.]+)/i, /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i, /(heytap|ovi|115)browser\/([\d\.]+)/i, /(weibo)__([\d\.]+)/i],
                    [c, f],
                    [/quark(?:pc)?\/([-\w\.]+)/i],
                    [f, [c, "Quark"]],
                    [/\bddg\/([\w\.]+)/i],
                    [f, [c, "DuckDuckGo"]],
                    [/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],
                    [f, [c, "UC" + E]],
                    [/microm.+\bqbcore\/([\w\.]+)/i, /\bqbcore\/([\w\.]+).+microm/i, /micromessenger\/([\w\.]+)/i],
                    [f, [c, "WeChat"]],
                    [/konqueror\/([\w\.]+)/i],
                    [f, [c, "Konqueror"]],
                    [/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],
                    [f, [c, "IE"]],
                    [/ya(?:search)?browser\/([\w\.]+)/i],
                    [f, [c, "Yandex"]],
                    [/slbrowser\/([\w\.]+)/i],
                    [f, [c, "Smart Lenovo " + E]],
                    [/(avast|avg)\/([\w\.]+)/i],
                    [
                        [c, /(.+)/, "$1 Secure " + E], f
                    ],
                    [/\bfocus\/([\w\.]+)/i],
                    [f, [c, A + " Focus"]],
                    [/\bopt\/([\w\.]+)/i],
                    [f, [c, P + " Touch"]],
                    [/coc_coc\w+\/([\w\.]+)/i],
                    [f, [c, "Coc Coc"]],
                    [/dolfin\/([\w\.]+)/i],
                    [f, [c, "Dolphin"]],
                    [/coast\/([\w\.]+)/i],
                    [f, [c, P + " Coast"]],
                    [/miuibrowser\/([\w\.]+)/i],
                    [f, [c, "MIUI" + W]],
                    [/fxios\/([\w\.-]+)/i],
                    [f, [c, A]],
                    [/\bqihoobrowser\/?([\w\.]*)/i],
                    [f, [c, "360"]],
                    [/\b(qq)\/([\w\.]+)/i],
                    [
                        [c, /(.+)/, "$1Browser"], f
                    ],
                    [/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],
                    [
                        [c, /(.+)/, "$1" + W], f
                    ],
                    [/samsungbrowser\/([\w\.]+)/i],
                    [f, [c, j + " Internet"]],
                    [/metasr[\/ ]?([\d\.]+)/i],
                    [f, [c, "Sogou Explorer"]],
                    [/(sogou)mo\w+\/([\d\.]+)/i],
                    [
                        [c, "Sogou Mobile"], f
                    ],
                    [/(electron)\/([\w\.]+) safari/i, /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, /m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],
                    [c, f],
                    [/(lbbrowser|rekonq)/i, /\[(linkedin)app\]/i],
                    [c],
                    [/ome\/([\w\.]+) \w* ?(iron) saf/i, /ome\/([\w\.]+).+qihu (360)[es]e/i],
                    [f, c],
                    [/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],
                    [
                        [c, z], f
                    ],
                    [/(Klarna)\/([\w\.]+)/i, /(kakao(?:talk|story))[\/ ]([\w\.]+)/i, /(naver)\(.*?(\d+\.[\w\.]+).*\)/i, /(daum)apps[\/ ]([\w\.]+)/i, /safari (line)\/([\w\.]+)/i, /\b(line)\/([\w\.]+)\/iab/i, /(alipay)client\/([\w\.]+)/i, /(twitter)(?:and| f.+e\/([\w\.]+))/i, /(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],
                    [c, f],
                    [/\bgsa\/([\w\.]+) .*safari\//i],
                    [f, [c, "GSA"]],
                    [/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],
                    [f, [c, "TikTok"]],
                    [/headlesschrome(?:\/([\w\.]+)| )/i],
                    [f, [c, S + " Headless"]],
                    [/ wv\).+(chrome)\/([\w\.]+)/i],
                    [
                        [c, S + " WebView"], f
                    ],
                    [/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],
                    [f, [c, "Android " + E]],
                    [/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],
                    [c, f],
                    [/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],
                    [f, [c, "Mobile Safari"]],
                    [/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],
                    [f, c],
                    [/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],
                    [c, [f, J, {
                        "1.0": "/8",
                        1.2: "/1",
                        1.3: "/3",
                        "2.0": "/412",
                        "2.0.2": "/416",
                        "2.0.3": "/417",
                        "2.0.4": "/419",
                        "?": "/"
                    }]],
                    [/(webkit|khtml)\/([\w\.]+)/i],
                    [c, f],
                    [/(navigator|netscape\d?)\/([-\w\.]+)/i],
                    [
                        [c, "Netscape"], f
                    ],
                    [/(wolvic|librewolf)\/([\w\.]+)/i],
                    [c, f],
                    [/mobile vr; rv:([\w\.]+)\).+firefox/i],
                    [f, [c, A + " Reality"]],
                    [/ekiohf.+(flow)\/([\w\.]+)/i, /(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i, /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i, /(firefox)\/([\w\.]+)/i, /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i, /(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i, /\b(links) \(([\w\.]+)/i],
                    [c, [f, /_/g, "."]],
                    [/(cobalt)\/([\w\.]+)/i],
                    [c, [f, /master.|lts./, ""]]
                ],
                cpu: [
                    [/\b((amd|x|x86[-_]?|wow|win)64)\b/i],
                    [
                        [p, "amd64"]
                    ],
                    [/(ia32(?=;))/i, /\b((i[346]|x)86)(pc)?\b/i],
                    [
                        [p, "ia32"]
                    ],
                    [/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],
                    [
                        [p, "arm64"]
                    ],
                    [/\b(arm(v[67])?ht?n?[fl]p?)\b/i],
                    [
                        [p, "armhf"]
                    ],
                    [/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],
                    [
                        [p, "arm"]
                    ],
                    [/((ppc|powerpc)(64)?)( mac|;|\))/i],
                    [
                        [p, /ower/, "", H]
                    ],
                    [/ sun4\w[;\)]/i],
                    [
                        [p, "sparc"]
                    ],
                    [/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],
                    [
                        [p, H]
                    ]
                ],
                device: [
                    [/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],
                    [l, [d, j],
                        [u, y]
                    ],
                    [/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i, /samsung[- ]((?!sm-[lr])[-\w]+)/i, /sec-(sgh\w+)/i],
                    [l, [d, j],
                        [u, m]
                    ],
                    [/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],
                    [l, [d, w],
                        [u, m]
                    ],
                    [/\((ipad);[-\w\),; ]+apple/i, /applecoremedia\/[\w\.]+ \((ipad)/i, /\b(ipad)\d\d?,\d\d?[;\]].+ios/i],
                    [l, [d, w],
                        [u, y]
                    ],
                    [/(macintosh);/i],
                    [l, [d, w]],
                    [/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],
                    [l, [d, L],
                        [u, m]
                    ],
                    [/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],
                    [l, [d, T],
                        [u, y]
                    ],
                    [/honor([-\w ]+)[;\)]/i],
                    [l, [d, T],
                        [u, m]
                    ],
                    [/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],
                    [l, [d, k],
                        [u, y]
                    ],
                    [/(?:huawei)([-\w ]+)[;\)]/i, /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],
                    [l, [d, k],
                        [u, m]
                    ],
                    [/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i, /\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],
                    [
                        [l, /_/g, " "],
                        [d, U],
                        [u, y]
                    ],
                    [/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i, /\b; (\w+) build\/hm\1/i, /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, /oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i, /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i, / ([\w ]+) miui\/v?\d/i],
                    [
                        [l, /_/g, " "],
                        [d, U],
                        [u, m]
                    ],
                    [/; (\w+) bui.+ oppo/i, /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],
                    [l, [d, D],
                        [u, m]
                    ],
                    [/\b(opd2(\d{3}a?))(?: bui|\))/i],
                    [l, [d, J, {
                            OnePlus: ["304", "403", "203"],
                            "*": D
                        }],
                        [u, y]
                    ],
                    [/vivo (\w+)(?: bui|\))/i, /\b(v[12]\d{3}\w?[at])(?: bui|;)/i],
                    [l, [d, "Vivo"],
                        [u, m]
                    ],
                    [/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],
                    [l, [d, "Realme"],
                        [u, m]
                    ],
                    [/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i, /\bmot(?:orola)?[- ](\w*)/i, /((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],
                    [l, [d, R],
                        [u, m]
                    ],
                    [/\b(mz60\d|xoom[2 ]{0,2}) build\//i],
                    [l, [d, R],
                        [u, y]
                    ],
                    [/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],
                    [l, [d, "LG"],
                        [u, y]
                    ],
                    [/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i, /\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i, /\blg-?([\d\w]+) bui/i],
                    [l, [d, "LG"],
                        [u, m]
                    ],
                    [/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i, /lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],
                    [l, [d, "Lenovo"],
                        [u, y]
                    ],
                    [/(nokia) (t[12][01])/i],
                    [d, l, [u, y]],
                    [/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i, /nokia[-_ ]?(([-\w\. ]*))/i],
                    [
                        [l, /_/g, " "],
                        [u, m],
                        [d, "Nokia"]
                    ],
                    [/(pixel (c|tablet))\b/i],
                    [l, [d, I],
                        [u, y]
                    ],
                    [/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],
                    [l, [d, I],
                        [u, m]
                    ],
                    [/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],
                    [l, [d, F],
                        [u, m]
                    ],
                    [/sony tablet [ps]/i, /\b(?:sony)?sgp\w+(?: bui|\))/i],
                    [
                        [l, "Xperia Tablet"],
                        [d, F],
                        [u, y]
                    ],
                    [/ (kb2005|in20[12]5|be20[12][59])\b/i, /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],
                    [l, [d, M],
                        [u, m]
                    ],
                    [/(alexa)webm/i, /(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i, /(kf[a-z]+)( bui|\)).+silk\//i],
                    [l, [d, x],
                        [u, y]
                    ],
                    [/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],
                    [
                        [l, /(.+)/g, "Fire Phone $1"],
                        [d, x],
                        [u, m]
                    ],
                    [/(playbook);[-\w\),; ]+(rim)/i],
                    [l, d, [u, y]],
                    [/\b((?:bb[a-f]|st[hv])100-\d)/i, /\(bb10; (\w+)/i],
                    [l, [d, C],
                        [u, m]
                    ],
                    [/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],
                    [l, [d, _],
                        [u, y]
                    ],
                    [/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],
                    [l, [d, _],
                        [u, m]
                    ],
                    [/(nexus 9)/i],
                    [l, [d, "HTC"],
                        [u, y]
                    ],
                    [/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i, /(zte)[- ]([\w ]+?)(?: bui|\/|\))/i, /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],
                    [d, [l, /_/g, " "],
                        [u, m]
                    ],
                    [/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],
                    [l, [d, "TCL"],
                        [u, y]
                    ],
                    [/(itel) ((\w+))/i],
                    [
                        [d, H], l, [u, J, {
                            tablet: ["p10001l", "w7001"],
                            "*": "mobile"
                        }]
                    ],
                    [/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],
                    [l, [d, "Acer"],
                        [u, y]
                    ],
                    [/droid.+; (m[1-5] note) bui/i, /\bmz-([-\w]{2,})/i],
                    [l, [d, "Meizu"],
                        [u, m]
                    ],
                    [/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],
                    [l, [d, "Ulefone"],
                        [u, m]
                    ],
                    [/; (energy ?\w+)(?: bui|\))/i, /; energizer ([\w ]+)(?: bui|\))/i],
                    [l, [d, "Energizer"],
                        [u, m]
                    ],
                    [/; cat (b35);/i, /; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],
                    [l, [d, "Cat"],
                        [u, m]
                    ],
                    [/((?:new )?andromax[\w- ]+)(?: bui|\))/i],
                    [l, [d, "Smartfren"],
                        [u, m]
                    ],
                    [/droid.+; (a(?:015|06[35]|142p?))/i],
                    [l, [d, "Nothing"],
                        [u, m]
                    ],
                    [/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i, /archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],
                    [l, [d, "Archos"],
                        [u, y]
                    ],
                    [/archos ([\w ]+)( b|\))/i, /; (ac[3-6]\d\w{2,8})( b|\))/i],
                    [l, [d, "Archos"],
                        [u, m]
                    ],
                    [/(imo) (tab \w+)/i, /(infinix) (x1101b?)/i],
                    [d, l, [u, y]],
                    [/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i, /; (hmd|imo) ([\w ]+?)(?: bui|\))/i, /(hp) ([\w ]+\w)/i, /(microsoft); (lumia[\w ]+)/i, /(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i, /(oppo) ?([\w ]+) bui/i],
                    [d, l, [u, m]],
                    [/(kobo)\s(ereader|touch)/i, /(hp).+(touchpad(?!.+tablet)|tablet)/i, /(kindle)\/([\w\.]+)/i, /(nook)[\w ]+build\/(\w+)/i, /(dell) (strea[kpr\d ]*[\dko])/i, /(le[- ]+pan)[- ]+(\w{1,9}) bui/i, /(trinity)[- ]*(t\d{3}) bui/i, /(gigaset)[- ]+(q\w{1,9}) bui/i, /(vodafone) ([\w ]+)(?:\)| bui)/i],
                    [d, l, [u, y]],
                    [/(surface duo)/i],
                    [l, [d, O],
                        [u, y]
                    ],
                    [/droid [\d\.]+; (fp\du?)(?: b|\))/i],
                    [l, [d, "Fairphone"],
                        [u, m]
                    ],
                    [/(u304aa)/i],
                    [l, [d, "AT&T"],
                        [u, m]
                    ],
                    [/\bsie-(\w*)/i],
                    [l, [d, "Siemens"],
                        [u, m]
                    ],
                    [/\b(rct\w+) b/i],
                    [l, [d, "RCA"],
                        [u, y]
                    ],
                    [/\b(venue[\d ]{2,7}) b/i],
                    [l, [d, "Dell"],
                        [u, y]
                    ],
                    [/\b(q(?:mv|ta)\w+) b/i],
                    [l, [d, "Verizon"],
                        [u, y]
                    ],
                    [/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],
                    [l, [d, "Barnes & Noble"],
                        [u, y]
                    ],
                    [/\b(tm\d{3}\w+) b/i],
                    [l, [d, "NuVision"],
                        [u, y]
                    ],
                    [/\b(k88) b/i],
                    [l, [d, "ZTE"],
                        [u, y]
                    ],
                    [/\b(nx\d{3}j) b/i],
                    [l, [d, "ZTE"],
                        [u, m]
                    ],
                    [/\b(gen\d{3}) b.+49h/i],
                    [l, [d, "Swiss"],
                        [u, m]
                    ],
                    [/\b(zur\d{3}) b/i],
                    [l, [d, "Swiss"],
                        [u, y]
                    ],
                    [/\b((zeki)?tb.*\b) b/i],
                    [l, [d, "Zeki"],
                        [u, y]
                    ],
                    [/\b([yr]\d{2}) b/i, /\b(dragon[- ]+touch |dt)(\w{5}) b/i],
                    [
                        [d, "Dragon Touch"], l, [u, y]
                    ],
                    [/\b(ns-?\w{0,9}) b/i],
                    [l, [d, "Insignia"],
                        [u, y]
                    ],
                    [/\b((nxa|next)-?\w{0,9}) b/i],
                    [l, [d, "NextBook"],
                        [u, y]
                    ],
                    [/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],
                    [
                        [d, "Voice"], l, [u, m]
                    ],
                    [/\b(lvtel\-)?(v1[12]) b/i],
                    [
                        [d, "LvTel"], l, [u, m]
                    ],
                    [/\b(ph-1) /i],
                    [l, [d, "Essential"],
                        [u, m]
                    ],
                    [/\b(v(100md|700na|7011|917g).*\b) b/i],
                    [l, [d, "Envizen"],
                        [u, y]
                    ],
                    [/\b(trio[-\w\. ]+) b/i],
                    [l, [d, "MachSpeed"],
                        [u, y]
                    ],
                    [/\btu_(1491) b/i],
                    [l, [d, "Rotor"],
                        [u, y]
                    ],
                    [/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],
                    [l, [d, N],
                        [u, y]
                    ],
                    [/(sprint) (\w+)/i],
                    [d, l, [u, m]],
                    [/(kin\.[onetw]{3})/i],
                    [
                        [l, /\./g, " "],
                        [d, O],
                        [u, m]
                    ],
                    [/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],
                    [l, [d, $],
                        [u, y]
                    ],
                    [/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],
                    [l, [d, $],
                        [u, m]
                    ],
                    [/smart-tv.+(samsung)/i],
                    [d, [u, g]],
                    [/hbbtv.+maple;(\d+)/i],
                    [
                        [l, /^/, "SmartTV"],
                        [d, j],
                        [u, g]
                    ],
                    [/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],
                    [
                        [d, "LG"],
                        [u, g]
                    ],
                    [/(apple) ?tv/i],
                    [d, [l, w + " TV"],
                        [u, g]
                    ],
                    [/crkey/i],
                    [
                        [l, S + "cast"],
                        [d, I],
                        [u, g]
                    ],
                    [/droid.+aft(\w+)( bui|\))/i],
                    [l, [d, x],
                        [u, g]
                    ],
                    [/(shield \w+ tv)/i],
                    [l, [d, N],
                        [u, g]
                    ],
                    [/\(dtv[\);].+(aquos)/i, /(aquos-tv[\w ]+)\)/i],
                    [l, [d, L],
                        [u, g]
                    ],
                    [/(bravia[\w ]+)( bui|\))/i],
                    [l, [d, F],
                        [u, g]
                    ],
                    [/(mi(tv|box)-?\w+) bui/i],
                    [l, [d, U],
                        [u, g]
                    ],
                    [/Hbbtv.*(technisat) (.*);/i],
                    [d, l, [u, g]],
                    [/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],
                    [
                        [d, G],
                        [l, G],
                        [u, g]
                    ],
                    [/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],
                    [l, [u, g]],
                    [/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],
                    [
                        [u, g]
                    ],
                    [/(ouya)/i, /(nintendo) ([wids3utch]+)/i],
                    [d, l, [u, h]],
                    [/droid.+; (shield)( bui|\))/i],
                    [l, [d, N],
                        [u, h]
                    ],
                    [/(playstation \w+)/i],
                    [l, [d, F],
                        [u, h]
                    ],
                    [/\b(xbox(?: one)?(?!; xbox))[\); ]/i],
                    [l, [d, O],
                        [u, h]
                    ],
                    [/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],
                    [l, [d, j],
                        [u, b]
                    ],
                    [/((pebble))app/i, /(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],
                    [d, l, [u, b]],
                    [/(ow(?:19|20)?we?[1-3]{1,3})/i],
                    [l, [d, D],
                        [u, b]
                    ],
                    [/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],
                    [l, [d, w],
                        [u, b]
                    ],
                    [/(opwwe\d{3})/i],
                    [l, [d, M],
                        [u, b]
                    ],
                    [/(moto 360)/i],
                    [l, [d, R],
                        [u, b]
                    ],
                    [/(smartwatch 3)/i],
                    [l, [d, F],
                        [u, b]
                    ],
                    [/(g watch r)/i],
                    [l, [d, "LG"],
                        [u, b]
                    ],
                    [/droid.+; (wt63?0{2,3})\)/i],
                    [l, [d, $],
                        [u, b]
                    ],
                    [/droid.+; (glass) \d/i],
                    [l, [d, I],
                        [u, b]
                    ],
                    [/(pico) (4|neo3(?: link|pro)?)/i],
                    [d, l, [u, b]],
                    [/; (quest( \d| pro)?)/i],
                    [l, [d, z],
                        [u, b]
                    ],
                    [/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],
                    [d, [u, v]],
                    [/(aeobc)\b/i],
                    [l, [d, x],
                        [u, v]
                    ],
                    [/(homepod).+mac os/i],
                    [l, [d, w],
                        [u, v]
                    ],
                    [/windows iot/i],
                    [
                        [u, v]
                    ],
                    [/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],
                    [l, [u, m]],
                    [/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],
                    [l, [u, y]],
                    [/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],
                    [
                        [u, y]
                    ],
                    [/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],
                    [
                        [u, m]
                    ],
                    [/droid .+?; ([\w\. -]+)( bui|\))/i],
                    [l, [d, "Generic"]]
                ],
                engine: [
                    [/windows.+ edge\/([\w\.]+)/i],
                    [f, [c, "EdgeHTML"]],
                    [/(arkweb)\/([\w\.]+)/i],
                    [c, f],
                    [/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],
                    [f, [c, "Blink"]],
                    [/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i, /ekioh(flow)\/([\w\.]+)/i, /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, /(icab)[\/ ]([23]\.[\d\.]+)/i, /\b(libweb)/i],
                    [c, f],
                    [/ladybird\//i],
                    [
                        [c, "LibWeb"]
                    ],
                    [/rv\:([\w\.]{1,9})\b.+(gecko)/i],
                    [f, c]
                ],
                os: [
                    [/microsoft (windows) (vista|xp)/i],
                    [c, f],
                    [/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],
                    [c, [f, J, Y]],
                    [/windows nt 6\.2; (arm)/i, /windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i, /(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],
                    [
                        [f, J, Y],
                        [c, "Windows"]
                    ],
                    [/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i, /(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i, /cfnetwork\/.+darwin/i],
                    [
                        [f, /_/g, "."],
                        [c, "iOS"]
                    ],
                    [/(mac os x) ?([\w\. ]*)/i, /(macintosh|mac_powerpc\b)(?!.+haiku)/i],
                    [
                        [c, q],
                        [f, /_/g, "."]
                    ],
                    [/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],
                    [f, c],
                    [/(ubuntu) ([\w\.]+) like android/i],
                    [
                        [c, /(.+)/, "$1 Touch"], f
                    ],
                    [/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],
                    [c, f],
                    [/\(bb(10);/i],
                    [f, [c, C]],
                    [/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],
                    [f, [c, "Symbian"]],
                    [/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],
                    [f, [c, A + " OS"]],
                    [/web0s;.+rt(tv)/i, /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],
                    [f, [c, "webOS"]],
                    [/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],
                    [f, [c, "watchOS"]],
                    [/crkey\/([\d\.]+)/i],
                    [f, [c, S + "cast"]],
                    [/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],
                    [
                        [c, B], f
                    ],
                    [/panasonic;(viera)/i, /(netrange)mmh/i, /(nettv)\/(\d+\.[\w\.]+)/i, /(nintendo|playstation) ([wids345portablevuch]+)/i, /(xbox); +xbox ([^\);]+)/i, /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i, /(mint)[\/\(\) ]?(\w*)/i, /(mageia|vectorlinux)[; ]/i, /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i, /(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i, /(gnu) ?([\w\.]*)/i, /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i, /(haiku) (\w+)/i],
                    [c, f],
                    [/(sunos) ?([\w\.\d]*)/i],
                    [
                        [c, "Solaris"], f
                    ],
                    [/((?:open)?solaris)[-\/ ]?([\w\.]*)/i, /(aix) ((\d)(?=\.|\)| )[\w\.])*/i, /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, /(unix) ?([\w\.]*)/i],
                    [c, f]
                ]
            },
            ee = function(t, r) {
                if (typeof t === i && (r = t, t = void 0), !(this instanceof ee)) return new ee(t, r).getResult();
                var h = typeof e !== a && e.navigator ? e.navigator : void 0,
                    g = t || (h && h.userAgent ? h.userAgent : ""),
                    b = h && h.userAgentData ? h.userAgentData : void 0,
                    v = r ? Z(X, r) : X,
                    x = h && h.userAgent == g;
                return this.getBrowser = function() {
                    var e, t = {};
                    return t[c] = void 0, t[f] = void 0, Q.call(t, g, v.browser), t[s] = typeof(e = t[f]) === o ? e.replace(/[^\d\.]/g, "").split(".")[0] : void 0, x && h && h.brave && typeof h.brave.isBrave == n && (t[c] = "Brave"), t
                }, this.getCPU = function() {
                    var e = {};
                    return e[p] = void 0, Q.call(e, g, v.cpu), e
                }, this.getDevice = function() {
                    var e = {};
                    return e[d] = void 0, e[l] = void 0, e[u] = void 0, Q.call(e, g, v.device), x && !e[u] && b && b.mobile && (e[u] = m), x && "Macintosh" == e[l] && h && typeof h.standalone !== a && h.maxTouchPoints && h.maxTouchPoints > 2 && (e[l] = "iPad", e[u] = y), e
                }, this.getEngine = function() {
                    var e = {};
                    return e[c] = void 0, e[f] = void 0, Q.call(e, g, v.engine), e
                }, this.getOS = function() {
                    var e = {};
                    return e[c] = void 0, e[f] = void 0, Q.call(e, g, v.os), x && !e[c] && b && b.platform && "Unknown" != b.platform && (e[c] = b.platform.replace(/chrome os/i, B).replace(/macos/i, q)), e
                }, this.getResult = function() {
                    return {
                        ua: this.getUA(),
                        browser: this.getBrowser(),
                        engine: this.getEngine(),
                        os: this.getOS(),
                        device: this.getDevice(),
                        cpu: this.getCPU()
                    }
                }, this.getUA = function() {
                    return g
                }, this.setUA = function(e) {
                    return g = typeof e === o && e.length > 500 ? G(e, 500) : e, this
                }, this.setUA(g), this
            };
        ee.VERSION = "1.0.41", ee.BROWSER = V([c, f, s]), ee.CPU = V([p]), ee.DEVICE = V([l, d, u, h, m, g, y, b, v]), ee.ENGINE = ee.OS = V([c, f]), t.exports && (r = t.exports = ee), r.UAParser = ee;
        var et = typeof e !== a && (e.jQuery || e.Zepto);
        if (et && !et.ua) {
            var er = new ee;
            et.ua = er.getResult(), et.ua.get = function() {
                return er.getUA()
            }, et.ua.set = function(e) {
                er.setUA(e);
                var t = er.getResult();
                for (var r in t) et.ua[r] = t[r]
            }
        }
    }("object" == typeof window ? window : e.e)
}, 132559, (e, t, r) => {
    "use strict";
    Object.defineProperty(r, "__esModule", {
        value: !0
    });
    var n = e.r(416340),
        a = n && "object" == typeof n && "default" in n ? n.default : n,
        i = e.r(341219),
        o = new i,
        s = o.getBrowser(),
        l = o.getCPU(),
        c = o.getDevice(),
        u = o.getEngine(),
        d = o.getOS(),
        f = o.getUA(),
        p = function(e) {
            return o.setUA(e)
        },
        h = function(e) {
            if (!e) return void console.error("No userAgent string was provided");
            var t = new i(e);
            return {
                UA: t,
                browser: t.getBrowser(),
                cpu: t.getCPU(),
                device: t.getDevice(),
                engine: t.getEngine(),
                os: t.getOS(),
                ua: t.getUA(),
                setUserAgent: function(e) {
                    return t.setUA(e)
                }
            }
        },
        m = Object.freeze({
            ClientUAInstance: o,
            browser: s,
            cpu: l,
            device: c,
            engine: u,
            os: d,
            ua: f,
            setUa: p,
            parseUserAgent: h
        });

    function y(e, t) {
        var r = Object.keys(e);
        if (Object.getOwnPropertySymbols) {
            var n = Object.getOwnPropertySymbols(e);
            t && (n = n.filter(function(t) {
                return Object.getOwnPropertyDescriptor(e, t).enumerable
            })), r.push.apply(r, n)
        }
        return r
    }

    function g(e) {
        return (g = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
            return typeof e
        } : function(e) {
            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
        })(e)
    }

    function b() {
        return (b = Object.assign || function(e) {
            for (var t = 1; t < arguments.length; t++) {
                var r = arguments[t];
                for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n])
            }
            return e
        }).apply(this, arguments)
    }

    function v(e) {
        return (v = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
            return e.__proto__ || Object.getPrototypeOf(e)
        })(e)
    }

    function x(e, t) {
        return (x = Object.setPrototypeOf || function(e, t) {
            return e.__proto__ = t, e
        })(e, t)
    }

    function w(e, t) {
        if (null == e) return {};
        var r, n, a = function(e, t) {
            if (null == e) return {};
            var r, n, a = {},
                i = Object.keys(e);
            for (n = 0; n < i.length; n++) r = i[n], t.indexOf(r) >= 0 || (a[r] = e[r]);
            return a
        }(e, t);
        if (Object.getOwnPropertySymbols) {
            var i = Object.getOwnPropertySymbols(e);
            for (n = 0; n < i.length; n++) r = i[n], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (a[r] = e[r])
        }
        return a
    }

    function _(e) {
        if (void 0 === e) throw ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e
    }

    function C(e, t) {
        (null == t || t > e.length) && (t = e.length);
        for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
        return n
    }
    var E = "mobile",
        S = "tablet",
        A = "smarttv",
        I = "console",
        T = "wearable",
        k = "embedded",
        O = void 0,
        R = {
            Chrome: "Chrome",
            Firefox: "Firefox",
            Opera: "Opera",
            Yandex: "Yandex",
            Safari: "Safari",
            InternetExplorer: "Internet Explorer",
            Edge: "Edge",
            Chromium: "Chromium",
            Ie: "IE",
            MobileSafari: "Mobile Safari",
            EdgeChromium: "Edge Chromium",
            MIUI: "MIUI Browser",
            SamsungBrowser: "Samsung Browser"
        },
        N = {
            IOS: "iOS",
            Android: "Android",
            WindowsPhone: "Windows Phone",
            Windows: "Windows",
            MAC_OS: "Mac OS"
        },
        M = {
            isMobile: !1,
            isTablet: !1,
            isBrowser: !1,
            isSmartTV: !1,
            isConsole: !1,
            isWearable: !1
        },
        P = function(e) {
            switch (e) {
                case E:
                    return {
                        isMobile: !0
                    };
                case S:
                    return {
                        isTablet: !0
                    };
                case A:
                    return {
                        isSmartTV: !0
                    };
                case I:
                    return {
                        isConsole: !0
                    };
                case T:
                    return {
                        isWearable: !0
                    };
                case O:
                    return {
                        isBrowser: !0
                    };
                case k:
                    return {
                        isEmbedded: !0
                    };
                default:
                    return M
            }
        },
        D = function(e) {
            var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "none";
            return e || t
        },
        j = function() {
            return !!("u" > typeof window && (window.navigator || navigator)) && (window.navigator || navigator)
        },
        L = function(e) {
            var t = j();
            return t && t.platform && (-1 !== t.platform.indexOf(e) || "MacIntel" === t.platform && t.maxTouchPoints > 1 && !window.MSStream)
        },
        F = function(e) {
            return e.type === E
        },
        U = function(e) {
            return e.type === S
        },
        $ = function(e) {
            var t = e.type;
            return t === E || t === S
        },
        z = function(e) {
            return e.type === A
        },
        B = function(e) {
            return e.type === O
        },
        q = function(e) {
            return e.type === T
        },
        W = function(e) {
            return e.type === I
        },
        Z = function(e) {
            return e.type === k
        },
        V = function(e) {
            return D(e.vendor)
        },
        K = function(e) {
            return D(e.model)
        },
        H = function(e) {
            return D(e.type, "browser")
        },
        G = function(e) {
            return e.name === N.Android
        },
        Q = function(e) {
            return e.name === N.Windows
        },
        J = function(e) {
            return e.name === N.MAC_OS
        },
        Y = function(e) {
            return e.name === N.WindowsPhone
        },
        X = function(e) {
            return e.name === N.IOS
        },
        ee = function(e) {
            return D(e.version)
        },
        et = function(e) {
            return D(e.name)
        },
        er = function(e) {
            return e.name === R.Chrome
        },
        en = function(e) {
            return e.name === R.Firefox
        },
        ea = function(e) {
            return e.name === R.Chromium
        },
        ei = function(e) {
            return e.name === R.Edge
        },
        eo = function(e) {
            return e.name === R.Yandex
        },
        es = function(e) {
            var t = e.name;
            return t === R.Safari || t === R.MobileSafari
        },
        el = function(e) {
            return e.name === R.MobileSafari
        },
        ec = function(e) {
            return e.name === R.Opera
        },
        eu = function(e) {
            var t = e.name;
            return t === R.InternetExplorer || t === R.Ie
        },
        ed = function(e) {
            return e.name === R.MIUI
        },
        ef = function(e) {
            return e.name === R.SamsungBrowser
        },
        ep = function(e) {
            return D(e.version)
        },
        eh = function(e) {
            return D(e.major)
        },
        em = function(e) {
            return D(e.name)
        },
        ey = function(e) {
            return D(e.name)
        },
        eg = function(e) {
            return D(e.version)
        },
        eb = function() {
            var e = j(),
                t = e && e.userAgent && e.userAgent.toLowerCase();
            return "string" == typeof t && /electron/.test(t)
        },
        ev = function(e) {
            return "string" == typeof e && -1 !== e.indexOf("Edg/")
        },
        ex = function() {
            var e = j();
            return e && (/iPad|iPhone|iPod/.test(e.platform) || "MacIntel" === e.platform && e.maxTouchPoints > 1) && !window.MSStream
        },
        ew = function() {
            return L("iPad")
        },
        e_ = function() {
            return L("iPhone")
        },
        eC = function() {
            return L("iPod")
        },
        eE = function(e) {
            return D(e)
        };

    function eS(e) {
        var t = e || m,
            r = t.device,
            n = t.browser,
            a = t.os,
            i = t.engine,
            o = t.ua;
        return {
            isSmartTV: z(r),
            isConsole: W(r),
            isWearable: q(r),
            isEmbedded: Z(r),
            isMobileSafari: el(n) || ew(),
            isChromium: ea(n),
            isMobile: $(r) || ew(),
            isMobileOnly: F(r),
            isTablet: U(r) || ew(),
            isBrowser: B(r),
            isDesktop: B(r),
            isAndroid: G(a),
            isWinPhone: Y(a),
            isIOS: X(a) || ew(),
            isChrome: er(n),
            isFirefox: en(n),
            isSafari: es(n),
            isOpera: ec(n),
            isIE: eu(n),
            osVersion: ee(a),
            osName: et(a),
            fullBrowserVersion: ep(n),
            browserVersion: eh(n),
            browserName: em(n),
            mobileVendor: V(r),
            mobileModel: K(r),
            engineName: ey(i),
            engineVersion: eg(i),
            getUA: eE(o),
            isEdge: ei(n) || ev(o),
            isYandex: eo(n),
            deviceType: H(r),
            isIOS13: ex(),
            isIPad13: ew(),
            isIPhone13: e_(),
            isIPod13: eC(),
            isElectron: eb(),
            isEdgeChromium: ev(o),
            isLegacyEdge: ei(n) && !ev(o),
            isWindows: Q(a),
            isMacOs: J(a),
            isMIUI: ed(n),
            isSamsungBrowser: ef(n)
        }
    }
    var eA = z(c),
        eI = W(c),
        eT = q(c),
        ek = Z(c),
        eO = el(s) || ew(),
        eR = ea(s),
        eN = $(c) || ew(),
        eM = F(c),
        eP = U(c) || ew(),
        eD = B(c),
        ej = B(c),
        eL = G(d),
        eF = Y(d),
        eU = X(d) || ew(),
        e$ = er(s),
        ez = en(s),
        eB = es(s),
        eq = ec(s),
        eW = eu(s),
        eZ = ee(d),
        eV = et(d),
        eK = ep(s),
        eH = eh(s),
        eG = em(s),
        eQ = V(c),
        eJ = K(c),
        eY = ey(u),
        eX = eg(u),
        e0 = eE(f),
        e1 = ei(s) || ev(f),
        e2 = eo(s),
        e6 = H(c),
        e5 = ex(),
        e3 = ew(),
        e4 = e_(),
        e8 = eC(),
        e7 = eb(),
        e9 = ev(f),
        te = ei(s) && !ev(f),
        tt = Q(d),
        tr = J(d),
        tn = ed(s),
        ta = ef(s);

    function ti(e) {
        return h(e || window.navigator.userAgent)
    }
    r.AndroidView = function(e) {
        var t = e.renderWithFragment,
            r = e.children,
            i = w(e, ["renderWithFragment", "children"]);
        return eL ? t ? a.createElement(n.Fragment, null, r) : a.createElement("div", i, r) : null
    }, r.BrowserTypes = R, r.BrowserView = function(e) {
        var t = e.renderWithFragment,
            r = e.children,
            i = w(e, ["renderWithFragment", "children"]);
        return eD ? t ? a.createElement(n.Fragment, null, r) : a.createElement("div", i, r) : null
    }, r.ConsoleView = function(e) {
        var t = e.renderWithFragment,
            r = e.children,
            i = w(e, ["renderWithFragment", "children"]);
        return eI ? t ? a.createElement(n.Fragment, null, r) : a.createElement("div", i, r) : null
    }, r.CustomView = function(e) {
        var t = e.renderWithFragment,
            r = e.children,
            i = (e.viewClassName, e.style, e.condition),
            o = w(e, ["renderWithFragment", "children", "viewClassName", "style", "condition"]);
        return i ? t ? a.createElement(n.Fragment, null, r) : a.createElement("div", o, r) : null
    }, r.IEView = function(e) {
        var t = e.renderWithFragment,
            r = e.children,
            i = w(e, ["renderWithFragment", "children"]);
        return eW ? t ? a.createElement(n.Fragment, null, r) : a.createElement("div", i, r) : null
    }, r.IOSView = function(e) {
        var t = e.renderWithFragment,
            r = e.children,
            i = w(e, ["renderWithFragment", "children"]);
        return eU ? t ? a.createElement(n.Fragment, null, r) : a.createElement("div", i, r) : null
    }, r.MobileOnlyView = function(e) {
        var t = e.renderWithFragment,
            r = e.children,
            i = (e.viewClassName, e.style, w(e, ["renderWithFragment", "children", "viewClassName", "style"]));
        return eM ? t ? a.createElement(n.Fragment, null, r) : a.createElement("div", i, r) : null
    }, r.MobileView = function(e) {
        var t = e.renderWithFragment,
            r = e.children,
            i = w(e, ["renderWithFragment", "children"]);
        return eN ? t ? a.createElement(n.Fragment, null, r) : a.createElement("div", i, r) : null
    }, r.OsTypes = N, r.SmartTVView = function(e) {
        var t = e.renderWithFragment,
            r = e.children,
            i = w(e, ["renderWithFragment", "children"]);
        return eA ? t ? a.createElement(n.Fragment, null, r) : a.createElement("div", i, r) : null
    }, r.TabletView = function(e) {
        var t = e.renderWithFragment,
            r = e.children,
            i = w(e, ["renderWithFragment", "children"]);
        return eP ? t ? a.createElement(n.Fragment, null, r) : a.createElement("div", i, r) : null
    }, r.WearableView = function(e) {
        var t = e.renderWithFragment,
            r = e.children,
            i = w(e, ["renderWithFragment", "children"]);
        return eT ? t ? a.createElement(n.Fragment, null, r) : a.createElement("div", i, r) : null
    }, r.WinPhoneView = function(e) {
        var t = e.renderWithFragment,
            r = e.children,
            i = w(e, ["renderWithFragment", "children"]);
        return eF ? t ? a.createElement(n.Fragment, null, r) : a.createElement("div", i, r) : null
    }, r.browserName = eG, r.browserVersion = eH, r.deviceDetect = function(e) {
        var t, r, n, a, i = e ? h(e) : m,
            o = i.device,
            s = i.browser,
            l = i.engine,
            c = i.os,
            u = i.ua,
            d = P(o.type),
            f = d.isBrowser,
            p = d.isMobile,
            g = d.isTablet,
            b = d.isSmartTV,
            v = d.isConsole,
            x = d.isWearable,
            w = d.isEmbedded;
        if (f) return {
            isBrowser: f,
            browserMajorVersion: D(s.major),
            browserFullVersion: D(s.version),
            browserName: D(s.name),
            engineName: D(l.name),
            engineVersion: D(l.version),
            osName: D(c.name),
            osVersion: D(c.version),
            userAgent: D(u)
        };
        if (b) return {
            isSmartTV: b,
            engineName: D(l.name),
            engineVersion: D(l.version),
            osName: D(c.name),
            osVersion: D(c.version),
            userAgent: D(u)
        };
        if (v) return {
            isConsole: v,
            engineName: D(l.name),
            engineVersion: D(l.version),
            osName: D(c.name),
            osVersion: D(c.version),
            userAgent: D(u)
        };
        if (p || g) {
            return t = d, r = o, n = c, a = u,
                function(e) {
                    for (var t = 1; t < arguments.length; t++) {
                        var r = null != arguments[t] ? arguments[t] : {};
                        t % 2 ? y(Object(r), !0).forEach(function(t) {
                            var n, a, i;
                            n = e, a = t, i = r[t], a in n ? Object.defineProperty(n, a, {
                                value: i,
                                enumerable: !0,
                                configurable: !0,
                                writable: !0
                            }) : n[a] = i
                        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : y(Object(r)).forEach(function(t) {
                            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t))
                        })
                    }
                    return e
                }({}, t, {
                    vendor: D(r.vendor),
                    model: D(r.model),
                    os: D(n.name),
                    osVersion: D(n.version),
                    ua: D(a)
                })
        }
        return x ? {
            isWearable: x,
            engineName: D(l.name),
            engineVersion: D(l.version),
            osName: D(c.name),
            osVersion: D(c.version),
            userAgent: D(u)
        } : w ? {
            isEmbedded: w,
            vendor: D(o.vendor),
            model: D(o.model),
            engineName: D(l.name),
            engineVersion: D(l.version),
            osName: D(c.name),
            osVersion: D(c.version),
            userAgent: D(u)
        } : void 0
    }, r.deviceType = e6, r.engineName = eY, r.engineVersion = eX, r.fullBrowserVersion = eK, r.getSelectorsByUserAgent = function(e) {
        if (!e || "string" != typeof e) return void console.error("No valid user agent string was provided");
        var t = h(e);
        return eS({
            device: t.device,
            browser: t.browser,
            os: t.os,
            engine: t.engine,
            ua: t.ua
        })
    }, r.getUA = e0, r.isAndroid = eL, r.isBrowser = eD, r.isChrome = e$, r.isChromium = eR, r.isConsole = eI, r.isDesktop = ej, r.isEdge = e1, r.isEdgeChromium = e9, r.isElectron = e7, r.isEmbedded = ek, r.isFirefox = ez, r.isIE = eW, r.isIOS = eU, r.isIOS13 = e5, r.isIPad13 = e3, r.isIPhone13 = e4, r.isIPod13 = e8, r.isLegacyEdge = te, r.isMIUI = tn, r.isMacOs = tr, r.isMobile = eN, r.isMobileOnly = eM, r.isMobileSafari = eO, r.isOpera = eq, r.isSafari = eB, r.isSamsungBrowser = ta, r.isSmartTV = eA, r.isTablet = eP, r.isWearable = eT, r.isWinPhone = eF, r.isWindows = tt, r.isYandex = e2, r.mobileModel = eJ, r.mobileVendor = eQ, r.osName = eV, r.osVersion = eZ, r.parseUserAgent = h, r.setUserAgent = function(e) {
        return p(e)
    }, r.useDeviceData = ti, r.useDeviceSelectors = function(e) {
        var t = ti(e || window.navigator.userAgent);
        return [eS(t), t]
    }, r.useMobileOrientation = function() {
        var e, t = function(e) {
                if (Array.isArray(e)) return e
            }(e = n.useState(function() {
                var e = 90 * (window.innerWidth > window.innerHeight);
                return {
                    isPortrait: 0 === e,
                    isLandscape: 90 === e,
                    orientation: 0 === e ? "portrait" : "landscape"
                }
            })) || function(e) {
                var t, r, n = null == e ? null : "u" > typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
                if (null != n) {
                    var a = [],
                        i = !0,
                        o = !1;
                    try {
                        for (n = n.call(e); !(i = (t = n.next()).done) && (a.push(t.value), 2 !== a.length); i = !0);
                    } catch (e) {
                        o = !0, r = e
                    } finally {
                        try {
                            i || null == n.return || n.return()
                        } finally {
                            if (o) throw r
                        }
                    }
                    return a
                }
            }(e) || function(e) {
                if (e) {
                    if ("string" == typeof e) return C(e, 2);
                    var t = Object.prototype.toString.call(e).slice(8, -1);
                    if ("Object" === t && e.constructor && (t = e.constructor.name), "Map" === t || "Set" === t) return Array.from(e);
                    if ("Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return C(e, 2)
                }
            }(e) || function() {
                throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
            }(),
            r = t[0],
            a = t[1],
            i = n.useCallback(function() {
                var e = 90 * (window.innerWidth > window.innerHeight),
                    t = {
                        isPortrait: 0 === e,
                        isLandscape: 90 === e,
                        orientation: 0 === e ? "portrait" : "landscape"
                    };
                r.orientation !== t.orientation && a(t)
            }, [r.orientation]);
        return n.useEffect(function() {
            return ("u" < typeof window ? "undefined" : g(window)) !== void 0 && eN && (i(), window.addEventListener("load", i, !1), window.addEventListener("resize", i, !1)),
                function() {
                    window.removeEventListener("resize", i, !1), window.removeEventListener("load", i, !1)
                }
        }, [i]), r
    }, r.withOrientationChange = function(e) {
        return function(t) {
            var r;
            if ("function" != typeof t && null !== t) throw TypeError("Super expression must either be null or a function");

            function n(e) {
                var t;
                if (!(this instanceof n)) throw TypeError("Cannot call a class as a function");
                return (t = function(e, t) {
                    if (t && ("object" == typeof t || "function" == typeof t)) return t;
                    if (void 0 !== t) throw TypeError("Derived constructors may only return object or undefined");
                    return _(e)
                }(this, v(n).call(this, e))).isEventListenerAdded = !1, t.handleOrientationChange = t.handleOrientationChange.bind(_(t)), t.onOrientationChange = t.onOrientationChange.bind(_(t)), t.onPageLoad = t.onPageLoad.bind(_(t)), t.state = {
                    isLandscape: !1,
                    isPortrait: !1
                }, t
            }
            return n.prototype = Object.create(t && t.prototype, {
                    constructor: {
                        value: n,
                        writable: !0,
                        configurable: !0
                    }
                }), t && x(n, t), r = [{
                    key: "handleOrientationChange",
                    value: function() {
                        this.isEventListenerAdded || (this.isEventListenerAdded = !0);
                        var e = 90 * (window.innerWidth > window.innerHeight);
                        this.setState({
                            isPortrait: 0 === e,
                            isLandscape: 90 === e
                        })
                    }
                }, {
                    key: "onOrientationChange",
                    value: function() {
                        this.handleOrientationChange()
                    }
                }, {
                    key: "onPageLoad",
                    value: function() {
                        this.handleOrientationChange()
                    }
                }, {
                    key: "componentDidMount",
                    value: function() {
                        ("u" < typeof window ? "undefined" : g(window)) !== void 0 && eN && (this.isEventListenerAdded ? window.removeEventListener("load", this.onPageLoad, !1) : (this.handleOrientationChange(), window.addEventListener("load", this.onPageLoad, !1)), window.addEventListener("resize", this.onOrientationChange, !1))
                    }
                }, {
                    key: "componentWillUnmount",
                    value: function() {
                        window.removeEventListener("resize", this.onOrientationChange, !1)
                    }
                }, {
                    key: "render",
                    value: function() {
                        return a.createElement(e, b({}, this.props, {
                            isLandscape: this.state.isLandscape,
                            isPortrait: this.state.isPortrait
                        }))
                    }
                }],
                function(e, t) {
                    for (var r = 0; r < t.length; r++) {
                        var n = t[r];
                        n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n)
                    }
                }(n.prototype, r), n
        }(a.Component)
    }
}, 125723, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061);
    let n = e => {
            let n, a, i, o, s, l, c, u, d, f, p, h, m, y, g, b, v = (0, r.c)(18);
            return v[0] !== e ? ({ ...n
            } = e, v[0] = e, v[1] = n) : n = v[1], v[2] === Symbol.for("react.memo_cache_sentinel") ? (a = {
                maskType: "alpha"
            }, v[2] = a) : a = v[2], v[3] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)("mask", {
                id: "mask0_8_554",
                style: a,
                maskUnits: "userSpaceOnUse",
                x: "0",
                y: "0",
                width: "120",
                height: "120",
                children: (0, t.jsx)("circle", {
                    cx: "60",
                    cy: "60",
                    r: "60",
                    fill: "#D9D9D9"
                })
            }), v[3] = i) : i = v[3], v[4] === Symbol.for("react.memo_cache_sentinel") ? (o = (0, t.jsxs)("g", {
                clipPath: "url(#clip0_8_554)",
                children: [i, (0, t.jsx)("g", {
                    mask: "url(#mask0_8_554)",
                    children: (0, t.jsx)("rect", {
                        width: "120",
                        height: "120",
                        fill: "url(#paint0_linear_8_554)"
                    })
                }), (0, t.jsx)("path", {
                    d: "M26.6667 41.6667H31.6667C57.44 41.6667 78.3333 62.56 78.3333 88.3333V93.3333H88.3333C91.0948 93.3333 93.3333 91.0947 93.3333 88.3333C93.3333 54.2758 65.7242 26.6667 31.6667 26.6667C28.9052 26.6667 26.6667 28.9052 26.6667 31.6667V41.6667Z",
                    fill: "url(#paint1_radial_8_554)"
                }), (0, t.jsx)("path", {
                    d: "M80 88.3333H93.3333C93.3333 91.0948 91.0947 93.3333 88.3333 93.3333H80V88.3333Z",
                    fill: "url(#paint2_linear_8_554)"
                }), (0, t.jsx)("path", {
                    d: "M31.6667 26.6667L31.6667 40H26.6667L26.6667 31.6667C26.6667 28.9052 28.9052 26.6667 31.6667 26.6667Z",
                    fill: "url(#paint3_linear_8_554)"
                }), (0, t.jsx)("path", {
                    d: "M26.6666 40H31.6666C58.3604 40 80 61.6396 80 88.3333V93.3333H65V88.3333C65 69.9238 50.0761 55 31.6666 55H26.6666V40Z",
                    fill: "url(#paint4_radial_8_554)"
                }), (0, t.jsx)("path", {
                    d: "M66.6666 88.3333H80V93.3333H66.6666V88.3333Z",
                    fill: "url(#paint5_linear_8_554)"
                }), (0, t.jsx)("path", {
                    d: "M26.6666 53.3333L26.6666 40L31.6666 40L31.6666 53.3333H26.6666Z",
                    fill: "url(#paint6_linear_8_554)"
                }), (0, t.jsx)("path", {
                    d: "M26.6666 61.6667C26.6666 64.4281 28.9052 66.6667 31.6666 66.6667C43.6328 66.6667 53.3333 76.3672 53.3333 88.3333C53.3333 91.0947 55.5719 93.3333 58.3333 93.3333H66.6666V88.3333C66.6666 69.0034 50.9966 53.3333 31.6666 53.3333H26.6666V61.6667Z",
                    fill: "url(#paint7_radial_8_554)"
                }), (0, t.jsx)("path", {
                    d: "M53.3333 88.3333H66.6666V93.3333H58.3333C55.5719 93.3333 53.3333 91.0948 53.3333 88.3333Z",
                    fill: "url(#paint8_radial_8_554)"
                }), (0, t.jsx)("path", {
                    d: "M31.6666 66.6667C28.9052 66.6667 26.6666 64.4281 26.6666 61.6667L26.6666 53.3333L31.6666 53.3333L31.6666 66.6667Z",
                    fill: "url(#paint9_radial_8_554)"
                })]
            }), v[4] = o) : o = v[4], v[5] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsxs)("linearGradient", {
                id: "paint0_linear_8_554",
                x1: "60",
                y1: "0",
                x2: "60",
                y2: "120",
                gradientUnits: "userSpaceOnUse",
                children: [(0, t.jsx)("stop", {
                    "stop-color": "#174299"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    "stop-color": "#001E59"
                })]
            }), v[5] = s) : s = v[5], v[6] === Symbol.for("react.memo_cache_sentinel") ? (l = (0, t.jsxs)("radialGradient", {
                id: "paint1_radial_8_554",
                cx: "0",
                cy: "0",
                r: "1",
                gradientUnits: "userSpaceOnUse",
                gradientTransform: "translate(31.6667 88.3333) rotate(-90) scale(61.6667)",
                children: [(0, t.jsx)("stop", {
                    offset: "0.770277",
                    "stop-color": "#FF4000"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    "stop-color": "#8754C9"
                })]
            }), v[6] = l) : l = v[6], v[7] === Symbol.for("react.memo_cache_sentinel") ? (c = (0, t.jsxs)("linearGradient", {
                id: "paint2_linear_8_554",
                x1: "79.1666",
                y1: "90.8333",
                x2: "93.3333",
                y2: "90.8333",
                gradientUnits: "userSpaceOnUse",
                children: [(0, t.jsx)("stop", {
                    "stop-color": "#FF4000"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    "stop-color": "#8754C9"
                })]
            }), v[7] = c) : c = v[7], v[8] === Symbol.for("react.memo_cache_sentinel") ? (u = (0, t.jsxs)("linearGradient", {
                id: "paint3_linear_8_554",
                x1: "29.1667",
                y1: "26.6667",
                x2: "29.1667",
                y2: "40.8333",
                gradientUnits: "userSpaceOnUse",
                children: [(0, t.jsx)("stop", {
                    "stop-color": "#8754C9"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    "stop-color": "#FF4000"
                })]
            }), v[8] = u) : u = v[8], v[9] === Symbol.for("react.memo_cache_sentinel") ? (d = (0, t.jsxs)("radialGradient", {
                id: "paint4_radial_8_554",
                cx: "0",
                cy: "0",
                r: "1",
                gradientUnits: "userSpaceOnUse",
                gradientTransform: "translate(31.6666 88.3333) rotate(-90) scale(48.3333)",
                children: [(0, t.jsx)("stop", {
                    offset: "0.723929",
                    "stop-color": "#FFF700"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    "stop-color": "#FF9901"
                })]
            }), v[9] = d) : d = v[9], v[10] === Symbol.for("react.memo_cache_sentinel") ? (f = (0, t.jsxs)("linearGradient", {
                id: "paint5_linear_8_554",
                x1: "66.6666",
                y1: "90.8333",
                x2: "80",
                y2: "90.8333",
                gradientUnits: "userSpaceOnUse",
                children: [(0, t.jsx)("stop", {
                    "stop-color": "#FFF700"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    "stop-color": "#FF9901"
                })]
            }), v[10] = f) : f = v[10], v[11] === Symbol.for("react.memo_cache_sentinel") ? (p = (0, t.jsxs)("linearGradient", {
                id: "paint6_linear_8_554",
                x1: "29.1666",
                y1: "53.3333",
                x2: "29.1666",
                y2: "40",
                gradientUnits: "userSpaceOnUse",
                children: [(0, t.jsx)("stop", {
                    "stop-color": "#FFF700"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    "stop-color": "#FF9901"
                })]
            }), v[11] = p) : p = v[11], v[12] === Symbol.for("react.memo_cache_sentinel") ? (h = (0, t.jsxs)("radialGradient", {
                id: "paint7_radial_8_554",
                cx: "0",
                cy: "0",
                r: "1",
                gradientUnits: "userSpaceOnUse",
                gradientTransform: "translate(31.6666 88.3333) rotate(-90) scale(35)",
                children: [(0, t.jsx)("stop", {
                    offset: "0.59513",
                    "stop-color": "#00AAFF"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    "stop-color": "#01DA40"
                })]
            }), v[12] = h) : h = v[12], v[13] === Symbol.for("react.memo_cache_sentinel") ? (m = (0, t.jsxs)("radialGradient", {
                id: "paint8_radial_8_554",
                cx: "0",
                cy: "0",
                r: "1",
                gradientUnits: "userSpaceOnUse",
                gradientTransform: "translate(52.5 90.8333) scale(14.1667 37.7778)",
                children: [(0, t.jsx)("stop", {
                    "stop-color": "#00AAFF"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    "stop-color": "#01DA40"
                })]
            }), v[13] = m) : m = v[13], v[14] === Symbol.for("react.memo_cache_sentinel") ? (y = (0, t.jsxs)("radialGradient", {
                id: "paint9_radial_8_554",
                cx: "0",
                cy: "0",
                r: "1",
                gradientUnits: "userSpaceOnUse",
                gradientTransform: "translate(29.1666 67.5) rotate(-90) scale(14.1667 268.642)",
                children: [(0, t.jsx)("stop", {
                    "stop-color": "#00AAFF"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    "stop-color": "#01DA40"
                })]
            }), v[14] = y) : y = v[14], v[15] === Symbol.for("react.memo_cache_sentinel") ? (g = (0, t.jsxs)("defs", {
                children: [s, l, c, u, d, f, p, h, m, y, (0, t.jsx)("clipPath", {
                    id: "clip0_8_554",
                    children: (0, t.jsx)("rect", {
                        width: "120",
                        height: "120",
                        fill: "white"
                    })
                })]
            }), v[15] = g) : g = v[15], v[16] !== n ? (b = (0, t.jsxs)("svg", {
                width: "120",
                height: "120",
                viewBox: "0 0 120 120",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg",
                ...n,
                children: [o, g]
            }), v[16] = n, v[17] = b) : b = v[17], b
        },
        a = e => {
            let n, a, i, o, s, l, c, u, d, f, p, h, m, y, g, b, v, x, w, _, C, E, S = (0, r.c)(24);
            return S[0] !== e ? ({ ...n
            } = e, S[0] = e, S[1] = n) : n = S[1], S[2] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsx)("rect", {
                width: "120",
                height: "120",
                fill: "url(#paint0_linear_62_329)"
            }), o = (0, t.jsx)("path", {
                d: "M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",
                fill: "url(#paint1_radial_62_329)"
            }), s = (0, t.jsx)("path", {
                d: "M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",
                fill: "url(#paint2_linear_62_329)"
            }), l = (0, t.jsx)("path", {
                d: "M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",
                fill: "url(#paint3_linear_62_329)"
            }), c = (0, t.jsx)("path", {
                d: "M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",
                fill: "url(#paint4_radial_62_329)"
            }), u = (0, t.jsx)("path", {
                d: "M68 94H84V100H68V94Z",
                fill: "url(#paint5_linear_62_329)"
            }), d = (0, t.jsx)("path", {
                d: "M20 52L20 36L26 36L26 52H20Z",
                fill: "url(#paint6_linear_62_329)"
            }), f = (0, t.jsx)("path", {
                d: "M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",
                fill: "url(#paint7_radial_62_329)"
            }), p = (0, t.jsx)("path", {
                d: "M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",
                fill: "url(#paint8_radial_62_329)"
            }), i = (0, t.jsx)("path", {
                d: "M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",
                fill: "url(#paint9_radial_62_329)"
            }), S[2] = a, S[3] = i, S[4] = o, S[5] = s, S[6] = l, S[7] = c, S[8] = u, S[9] = d, S[10] = f, S[11] = p) : (a = S[2], i = S[3], o = S[4], s = S[5], l = S[6], c = S[7], u = S[8], d = S[9], f = S[10], p = S[11]), S[12] === Symbol.for("react.memo_cache_sentinel") ? (h = (0, t.jsxs)("linearGradient", {
                id: "paint0_linear_62_329",
                x1: "60",
                y1: "0",
                x2: "60",
                y2: "120",
                gradientUnits: "userSpaceOnUse",
                children: [(0, t.jsx)("stop", {
                    "stop-color": "#174299"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    "stop-color": "#001E59"
                })]
            }), S[12] = h) : h = S[12], S[13] === Symbol.for("react.memo_cache_sentinel") ? (m = (0, t.jsxs)("radialGradient", {
                id: "paint1_radial_62_329",
                cx: "0",
                cy: "0",
                r: "1",
                gradientUnits: "userSpaceOnUse",
                gradientTransform: "translate(26 94) rotate(-90) scale(74)",
                children: [(0, t.jsx)("stop", {
                    offset: "0.770277",
                    "stop-color": "#FF4000"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    "stop-color": "#8754C9"
                })]
            }), S[13] = m) : m = S[13], S[14] === Symbol.for("react.memo_cache_sentinel") ? (y = (0, t.jsxs)("linearGradient", {
                id: "paint2_linear_62_329",
                x1: "83",
                y1: "97",
                x2: "100",
                y2: "97",
                gradientUnits: "userSpaceOnUse",
                children: [(0, t.jsx)("stop", {
                    "stop-color": "#FF4000"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    "stop-color": "#8754C9"
                })]
            }), S[14] = y) : y = S[14], S[15] === Symbol.for("react.memo_cache_sentinel") ? (g = (0, t.jsxs)("linearGradient", {
                id: "paint3_linear_62_329",
                x1: "23",
                y1: "20",
                x2: "23",
                y2: "37",
                gradientUnits: "userSpaceOnUse",
                children: [(0, t.jsx)("stop", {
                    "stop-color": "#8754C9"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    "stop-color": "#FF4000"
                })]
            }), S[15] = g) : g = S[15], S[16] === Symbol.for("react.memo_cache_sentinel") ? (b = (0, t.jsxs)("radialGradient", {
                id: "paint4_radial_62_329",
                cx: "0",
                cy: "0",
                r: "1",
                gradientUnits: "userSpaceOnUse",
                gradientTransform: "translate(26 94) rotate(-90) scale(58)",
                children: [(0, t.jsx)("stop", {
                    offset: "0.723929",
                    "stop-color": "#FFF700"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    "stop-color": "#FF9901"
                })]
            }), S[16] = b) : b = S[16], S[17] === Symbol.for("react.memo_cache_sentinel") ? (v = (0, t.jsxs)("linearGradient", {
                id: "paint5_linear_62_329",
                x1: "68",
                y1: "97",
                x2: "84",
                y2: "97",
                gradientUnits: "userSpaceOnUse",
                children: [(0, t.jsx)("stop", {
                    "stop-color": "#FFF700"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    "stop-color": "#FF9901"
                })]
            }), S[17] = v) : v = S[17], S[18] === Symbol.for("react.memo_cache_sentinel") ? (x = (0, t.jsxs)("linearGradient", {
                id: "paint6_linear_62_329",
                x1: "23",
                y1: "52",
                x2: "23",
                y2: "36",
                gradientUnits: "userSpaceOnUse",
                children: [(0, t.jsx)("stop", {
                    "stop-color": "#FFF700"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    "stop-color": "#FF9901"
                })]
            }), S[18] = x) : x = S[18], S[19] === Symbol.for("react.memo_cache_sentinel") ? (w = (0, t.jsxs)("radialGradient", {
                id: "paint7_radial_62_329",
                cx: "0",
                cy: "0",
                r: "1",
                gradientUnits: "userSpaceOnUse",
                gradientTransform: "translate(26 94) rotate(-90) scale(42)",
                children: [(0, t.jsx)("stop", {
                    offset: "0.59513",
                    "stop-color": "#00AAFF"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    "stop-color": "#01DA40"
                })]
            }), S[19] = w) : w = S[19], S[20] === Symbol.for("react.memo_cache_sentinel") ? (_ = (0, t.jsxs)("radialGradient", {
                id: "paint8_radial_62_329",
                cx: "0",
                cy: "0",
                r: "1",
                gradientUnits: "userSpaceOnUse",
                gradientTransform: "translate(51 97) scale(17 45.3333)",
                children: [(0, t.jsx)("stop", {
                    "stop-color": "#00AAFF"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    "stop-color": "#01DA40"
                })]
            }), S[20] = _) : _ = S[20], S[21] === Symbol.for("react.memo_cache_sentinel") ? (C = (0, t.jsxs)("defs", {
                children: [h, m, y, g, b, v, x, w, _, (0, t.jsxs)("radialGradient", {
                    id: "paint9_radial_62_329",
                    cx: "0",
                    cy: "0",
                    r: "1",
                    gradientUnits: "userSpaceOnUse",
                    gradientTransform: "translate(23 69) rotate(-90) scale(17 322.37)",
                    children: [(0, t.jsx)("stop", {
                        "stop-color": "#00AAFF"
                    }), (0, t.jsx)("stop", {
                        offset: "1",
                        "stop-color": "#01DA40"
                    })]
                })]
            }), S[21] = C) : C = S[21], S[22] !== n ? (E = (0, t.jsxs)("svg", {
                width: "120",
                height: "120",
                viewBox: "0 0 120 120",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg",
                ...n,
                children: [a, o, s, l, c, u, d, f, p, i, C]
            }), S[22] = n, S[23] = E) : E = S[23], E
        };
    e.s(["Logos", 0, {
        Injected: e => {
            let n, a, i, o = (0, r.c)(5);
            return o[0] !== e ? ({ ...n
            } = e, o[0] = e, o[1] = n) : n = o[1], o[2] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsx)("path", {
                fillRule: "evenodd",
                clipRule: "evenodd",
                d: "M15.6505 3.64041C15.6501 3.64062 15.6497 3.64083 15.6493 3.64103L6.05165 8.43985L16.2501 13.5391L26.4484 8.43987L16.8508 3.64103C16.8504 3.64083 16.85 3.64063 16.8496 3.64043C16.6632 3.54806 16.458 3.5 16.25 3.5C16.042 3.5 15.8369 3.54806 15.6505 3.64041ZM28 10.4592L17.5001 15.7091L17.5 28.5205L27.248 23.6465L27.2508 23.6452C27.4757 23.5334 27.665 23.3611 27.7973 23.1477C27.9297 22.9342 27.9999 22.6881 28 22.4369V10.4592ZM15 28.527L15.0001 15.7091L4.50006 10.4591V22.4333C4.49831 22.6849 4.56687 22.9319 4.69807 23.1466C4.82896 23.3608 5.01696 23.5342 5.24095 23.6475C5.24148 23.6477 5.242 23.648 5.24253 23.6483L15 28.527ZM14.5207 31.0824L4.12104 25.8826L4.11759 25.8809C3.47681 25.558 2.93902 25.0625 2.56486 24.4502C2.19154 23.8394 1.99597 23.1365 2.00006 22.4207V10.0486C2.00044 9.33234 2.20062 8.62972 2.5781 8.021C2.95529 7.41274 3.49457 6.92167 4.13537 6.60291C4.13585 6.60267 4.13633 6.60243 4.13681 6.60219L14.534 1.40359L14.5368 1.40221C15.0692 1.13767 15.6556 1 16.25 1C16.8445 1 17.4309 1.13767 17.9633 1.40221L17.966 1.40358L28.3633 6.60219C28.3638 6.60245 28.3643 6.6027 28.3648 6.60295C29.0055 6.92171 29.5448 7.41276 29.922 8.021C30.2994 8.62973 30.4996 9.33168 30.5 10.0479V22.4376C30.4996 23.1538 30.2994 23.8565 29.922 24.4652C29.5448 25.0734 29.0056 25.5644 28.365 25.8831C28.3644 25.8834 28.3638 25.8837 28.3633 25.884L17.9664 31.0824C17.9663 31.0825 17.9665 31.0824 17.9664 31.0824C17.4316 31.3499 16.8415 31.4894 16.2435 31.4894C15.6455 31.4894 15.0554 31.3499 14.5207 31.0824C14.5205 31.0824 14.5208 31.0825 14.5207 31.0824Z",
                fill: "#CCCCCC"
            }), o[2] = a) : a = o[2], o[3] !== n ? (i = (0, t.jsx)("svg", {
                width: "32",
                height: "32",
                viewBox: "0 0 32 32",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg",
                ...n,
                children: a
            }), o[3] = n, o[4] = i) : i = o[4], i
        },
        WalletConnect: e => {
            let n, a, i, o, s, l = (0, r.c)(11);
            l[0] !== e ? ({
                background: a,
                ...n
            } = e, l[0] = e, l[1] = n, l[2] = a) : (n = l[1], a = l[2]);
            let c = void 0 !== a && a;
            l[3] !== c ? (i = c ? {
                background: "#3B99FC"
            } : void 0, l[3] = c, l[4] = i) : i = l[4];
            let u = c ? "white" : "#3B99FC";
            return l[5] !== u ? (o = (0, t.jsx)("path", {
                d: "M9.58818 11.8556C13.1293 8.31442 18.8706 8.31442 22.4117 11.8556L22.8379 12.2818C23.015 12.4588 23.015 12.7459 22.8379 12.9229L21.3801 14.3808C21.2915 14.4693 21.148 14.4693 21.0595 14.3808L20.473 13.7943C18.0026 11.3239 13.9973 11.3239 11.5269 13.7943L10.8989 14.4223C10.8104 14.5109 10.6668 14.5109 10.5783 14.4223L9.12041 12.9645C8.94336 12.7875 8.94336 12.5004 9.12041 12.3234L9.58818 11.8556ZM25.4268 14.8706L26.7243 16.1682C26.9013 16.3452 26.9013 16.6323 26.7243 16.8093L20.8737 22.6599C20.6966 22.8371 20.4096 22.8371 20.2325 22.6599L16.0802 18.5076C16.0359 18.4634 15.9641 18.4634 15.9199 18.5076L11.7675 22.6599C11.5905 22.8371 11.3034 22.8371 11.1264 22.66C11.1264 22.66 11.1264 22.6599 11.1264 22.6599L5.27561 16.8092C5.09856 16.6322 5.09856 16.3451 5.27561 16.168L6.57313 14.8706C6.75019 14.6934 7.03726 14.6934 7.21431 14.8706L11.3668 19.023C11.411 19.0672 11.4828 19.0672 11.5271 19.023L15.6793 14.8706C15.8563 14.6934 16.1434 14.6934 16.3205 14.8706L20.473 19.023C20.5172 19.0672 20.589 19.0672 20.6332 19.023L24.7856 14.8706C24.9627 14.6935 25.2498 14.6935 25.4268 14.8706Z",
                fill: u
            }), l[5] = u, l[6] = o) : o = l[6], l[7] !== n || l[8] !== i || l[9] !== o ? (s = (0, t.jsx)("svg", {
                width: "32",
                height: "32",
                viewBox: "0 0 32 32",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg",
                style: i,
                ...n,
                children: o
            }), l[7] = n, l[8] = i, l[9] = o, l[10] = s) : s = l[10], s
        },
        MetaMask: e => {
            let n, a, i, o, s, l, c, u, d, f, p, h = (0, r.c)(15);
            h[0] !== e ? ({
                background: a,
                ...n
            } = e, h[0] = e, h[1] = n, h[2] = a) : (n = h[1], a = h[2]);
            let m = void 0 !== a && a;
            return h[3] !== m ? (i = m ? {
                background: "linear-gradient(0deg, #FF8D5D, #FF5C16)",
                borderRadius: "27.5%"
            } : void 0, h[3] = m, h[4] = i) : i = h[4], h[5] === Symbol.for("react.memo_cache_sentinel") ? (o = (0, t.jsx)("path", {
                d: "M132.682,132.192l-30.583-9.106l-23.063,13.787l-16.092-0.007l-23.077-13.78l-30.569,9.106L0,100.801\n            l9.299-34.839L0,36.507L9.299,0l47.766,28.538h27.85L132.682,0l9.299,36.507l-9.299,29.455l9.299,34.839L132.682,132.192\n            L132.682,132.192z",
                fill: "#FF5C16"
            }), s = (0, t.jsx)("path", {
                d: "M9.305,0l47.767,28.558l-1.899,19.599L9.305,0z M39.875,100.814l21.017,16.01l-21.017,6.261\n            C39.875,123.085,39.875,100.814,39.875,100.814z M59.212,74.345l-4.039-26.174L29.317,65.97l-0.014-0.007v0.013l0.08,18.321\n            l10.485-9.951L59.212,74.345L59.212,74.345z M132.682,0L84.915,28.558l1.893,19.599L132.682,0z M102.113,100.814l-21.018,16.01\n            l21.018,6.261V100.814z M112.678,65.975h0.007H112.678v-0.013l-0.006,0.007L86.815,48.171l-4.039,26.174h19.336l10.492,9.95\n            C112.604,84.295,112.678,65.975,112.678,65.975z",
                fill: "#FF5C16"
            }), l = (0, t.jsx)("path", {
                d: "M39.868,123.085l-30.569,9.106L0,100.814h39.868C39.868,100.814,39.868,123.085,39.868,123.085z\n            M59.205,74.338l5.839,37.84l-8.093-21.04L29.37,84.295l10.491-9.956h19.344L59.205,74.338z M102.112,123.085l30.57,9.106\n            l9.299-31.378h-39.869C102.112,100.814,102.112,123.085,102.112,123.085z M82.776,74.338l-5.839,37.84l8.092-21.04l27.583-6.843\n            l-10.498-9.956H82.776V74.338z",
                fill: "#E34807"
            }), c = (0, t.jsx)("path", {
                d: "M0,100.801l9.299-34.839h19.997l0.073,18.327l27.584,6.843l8.092,21.039l-4.16,4.633l-21.017-16.01H0\n            V100.801z M141.981,100.801l-9.299-34.839h-19.998l-0.073,18.327l-27.582,6.843l-8.093,21.039l4.159,4.633l21.018-16.01h39.868\n            V100.801z M84.915,28.538h-27.85l-1.891,19.599l9.872,64.013h11.891l9.878-64.013L84.915,28.538z",
                fill: "#FF8D5D"
            }), u = (0, t.jsx)("path", {
                d: "M9.299,0L0,36.507l9.299,29.455h19.997l25.87-17.804L9.299,0z M53.426,81.938h-9.059l-4.932,4.835\n            l17.524,4.344l-3.533-9.186V81.938z M132.682,0l9.299,36.507l-9.299,29.455h-19.998L86.815,48.158L132.682,0z M88.568,81.938h9.072\n            l4.932,4.841l-17.544,4.353l3.54-9.201V81.938z M79.029,124.385l2.067-7.567l-4.16-4.633h-11.9l-4.159,4.633l2.066,7.567",
                fill: "#661800"
            }), d = (0, t.jsx)("path", {
                d: "M79.029,124.384v12.495H62.945v-12.495L79.029,124.384L79.029,124.384z",
                fill: "#C0C4CD"
            }), f = (0, t.jsx)("path", {
                d: "M39.875,123.072l23.083,13.8v-12.495l-2.067-7.566C60.891,116.811,39.875,123.072,39.875,123.072z\n            M102.113,123.072l-23.084,13.8v-12.495l2.067-7.566C81.096,116.811,102.113,123.072,102.113,123.072z",
                fill: "#E7EBF6"
            }), h[5] = o, h[6] = s, h[7] = l, h[8] = c, h[9] = u, h[10] = d, h[11] = f) : (o = h[5], s = h[6], l = h[7], c = h[8], u = h[9], d = h[10], f = h[11]), h[12] !== n || h[13] !== i ? (p = (0, t.jsxs)("svg", {
                style: i,
                width: "32",
                height: "32",
                viewBox: "0 0 142 136.878",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg",
                ...n,
                children: [o, s, l, c, u, d, f]
            }), h[12] = n, h[13] = i, h[14] = p) : p = h[14], p
        },
        Coinbase: e => {
            let n, a, i, o, s, l, c = (0, r.c)(10);
            c[0] !== e ? ({
                background: a,
                ...n
            } = e, c[0] = e, c[1] = n, c[2] = a) : (n = c[1], a = c[2]);
            let u = void 0 !== a && a;
            return c[3] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)("circle", {
                cx: "10",
                cy: "10",
                r: "10",
                fill: "#0052FF"
            }), c[3] = i) : i = c[3], c[4] !== u ? (o = u && (0, t.jsx)("rect", {
                rx: "27%",
                width: "20",
                height: "20",
                fill: "#0052FF"
            }), c[4] = u, c[5] = o) : o = c[5], c[6] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsx)("path", {
                fillRule: "evenodd",
                clipRule: "evenodd",
                d: "M10.0001 17C13.8661 17 17.0001 13.866 17.0001 10C17.0001 6.13401 13.8661 3 10.0001 3C6.13413 3 3.00012 6.13401 3.00012 10C3.00012 13.866 6.13413 17 10.0001 17ZM8.25012 7.71429C7.95427 7.71429 7.71441 7.95414 7.71441 8.25V11.75C7.71441 12.0459 7.95427 12.2857 8.25012 12.2857H11.7501C12.046 12.2857 12.2858 12.0459 12.2858 11.75V8.25C12.2858 7.95414 12.046 7.71429 11.7501 7.71429H8.25012Z",
                fill: "white"
            }), c[6] = s) : s = c[6], c[7] !== n || c[8] !== o ? (l = (0, t.jsxs)("svg", {
                width: "32",
                height: "32",
                viewBox: "0 0 20 20",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg",
                ...n,
                children: [i, o, s]
            }), c[7] = n, c[8] = o, c[9] = l) : l = c[9], l
        },
        Rabby: e => {
            let n, a, i, o, s, l, c, u, d, f, p, h = (0, r.c)(13);
            return h[0] !== e ? ({ ...n
            } = e, h[0] = e, h[1] = n) : n = h[1], h[2] === Symbol.for("react.memo_cache_sentinel") ? (a = {
                background: "#8697FF",
                borderRadius: "27%"
            }, h[2] = a) : a = h[2], h[3] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)("path", {
                d: "M76.2062 48.0657C78.7621 42.356 66.1267 26.404 54.0555 19.7581C46.4467 14.6095 38.5183 15.3169 36.9125 17.5775C33.3886 22.5385 48.5814 26.7423 58.742 31.6478C56.5579 32.5964 54.4996 34.2987 53.2893 36.4758C49.5013 32.3404 41.1872 28.7791 31.4315 31.6478C24.8574 33.5809 19.3937 38.1382 17.2821 45.0216C16.7689 44.7936 16.2009 44.6669 15.6032 44.6669C13.3176 44.6669 11.4648 46.5197 11.4648 48.8052C11.4648 51.0908 13.3176 52.9435 15.6032 52.9435C16.0268 52.9435 17.3514 52.6594 17.3514 52.6594L38.5183 52.8128C30.0532 66.2418 23.3634 68.2049 23.3634 70.5314C23.3634 72.8579 29.7643 72.2274 32.1678 71.3602C43.6732 67.2088 56.0306 54.2706 58.1511 50.5462C67.056 51.6572 74.5397 51.7886 76.2062 48.0657Z",
                fill: "url(#paint0_linear_60607_36577)"
            }), o = (0, t.jsx)("path", {
                fillRule: "evenodd",
                clipRule: "evenodd",
                d: "M58.65 31.6053C58.682 31.6193 58.7139 31.6332 58.7458 31.6471C59.2168 31.4616 59.1406 30.766 59.0113 30.2198C58.714 28.9643 53.5856 23.9001 48.7696 21.6318C42.1984 18.5367 37.3618 18.7007 36.6582 20.1307C37.9975 22.8695 44.1927 25.441 50.663 28.1266C53.3909 29.2589 56.1676 30.4114 58.65 31.6053Z",
                fill: "url(#paint1_linear_60607_36577)"
            }), s = (0, t.jsx)("path", {
                fillRule: "evenodd",
                clipRule: "evenodd",
                d: "M50.4154 59.2247C49.0895 58.7182 47.592 58.2536 45.8898 57.8319C47.707 54.5801 48.0884 49.7663 46.3721 46.7226C43.9635 42.4512 40.9399 40.1777 33.9139 40.1777C30.0495 40.1777 19.6451 41.4794 19.4603 50.1648C19.441 51.0763 19.4599 51.9118 19.5259 52.68L38.5175 52.8176C35.9568 56.8798 33.5586 59.8928 31.4589 62.1841C33.9831 62.8309 36.0657 63.3738 37.9775 63.8722C39.7885 64.3443 41.4462 64.7764 43.1809 65.2191C45.8007 63.3102 48.2635 61.2288 50.4154 59.2247Z",
                fill: "url(#paint2_linear_60607_36577)"
            }), l = (0, t.jsx)("path", {
                d: "M17.0296 51.7821C17.8058 58.38 21.5555 60.9657 29.2177 61.7309C36.8799 62.4961 41.2751 61.9828 47.1265 62.5151C52.0136 62.9598 56.3772 65.4502 57.996 64.5895C59.4529 63.815 58.6378 61.0167 56.6884 59.2214C54.1614 56.8943 50.6641 55.2763 44.5104 54.7021C45.7368 51.3443 45.3931 46.6362 43.4885 44.0748C40.7345 40.3711 35.6513 38.6967 29.2177 39.4282C22.4962 40.1926 16.0556 43.5018 17.0296 51.7821Z",
                fill: "url(#paint3_linear_60607_36577)"
            }), h[3] = i, h[4] = o, h[5] = s, h[6] = l) : (i = h[3], o = h[4], s = h[5], l = h[6]), h[7] === Symbol.for("react.memo_cache_sentinel") ? (c = (0, t.jsxs)("linearGradient", {
                id: "paint0_linear_60607_36577",
                x1: "30.666",
                y1: "43.0094",
                x2: "75.6558",
                y2: "55.7677",
                gradientUnits: "userSpaceOnUse",
                children: [(0, t.jsx)("stop", {
                    stopColor: "white"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    stopColor: "white"
                })]
            }), h[7] = c) : c = h[7], h[8] === Symbol.for("react.memo_cache_sentinel") ? (u = (0, t.jsxs)("linearGradient", {
                id: "paint1_linear_60607_36577",
                x1: "68.0842",
                y1: "42.1521",
                x2: "35.6221",
                y2: "9.60636",
                gradientUnits: "userSpaceOnUse",
                children: [(0, t.jsx)("stop", {
                    stopColor: "#7258DC"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    stopColor: "#797DEA",
                    stopOpacity: "0"
                })]
            }), h[8] = u) : u = h[8], h[9] === Symbol.for("react.memo_cache_sentinel") ? (d = (0, t.jsxs)("linearGradient", {
                id: "paint2_linear_60607_36577",
                x1: "51.3184",
                y1: "60.3591",
                x2: "20.1383",
                y2: "42.4347",
                gradientUnits: "userSpaceOnUse",
                children: [(0, t.jsx)("stop", {
                    stopColor: "#7461EA"
                }), (0, t.jsx)("stop", {
                    offset: "1",
                    stopColor: "#BFC2FF",
                    stopOpacity: "0"
                })]
            }), h[9] = d) : d = h[9], h[10] === Symbol.for("react.memo_cache_sentinel") ? (f = (0, t.jsxs)("defs", {
                children: [c, u, d, (0, t.jsxs)("linearGradient", {
                    id: "paint3_linear_60607_36577",
                    x1: "33.3531",
                    y1: "42.6732",
                    x2: "54.4308",
                    y2: "69.4547",
                    gradientUnits: "userSpaceOnUse",
                    children: [(0, t.jsx)("stop", {
                        stopColor: "white"
                    }), (0, t.jsx)("stop", {
                        offset: "0.983895",
                        stopColor: "#D5CEFF"
                    })]
                })]
            }), h[10] = f) : f = h[10], h[11] !== n ? (p = (0, t.jsxs)("svg", {
                width: "32",
                height: "32",
                viewBox: "0 0 88 88",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg",
                style: a,
                ...n,
                children: [i, o, s, l, f]
            }), h[11] = n, h[12] = p) : p = h[12], p
        },
        Magic: e => {
            let n, a, i, o, s = (0, r.c)(6);
            return s[0] !== e ? ({ ...n
            } = e, s[0] = e, s[1] = n) : n = s[1], s[2] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsx)("title", {
                children: "mail"
            }), s[2] = a) : a = s[2], s[3] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsxs)("g", {
                id: "Icons",
                stroke: "none",
                strokeWidth: "1",
                fill: "#6851FF",
                fillRule: "evenodd",
                children: [(0, t.jsx)("path", {
                    d: "M200 0C218.262 21.2014 238.404 40.8906 260.185 58.8391C245.672 103.459 237.858 150.865 237.858 200C237.858 249.135 245.672 296.541 260.185 341.161C238.404 359.109 218.262 378.799 200 400C181.738 378.799 161.596 359.109 139.815 341.161C154.328 296.541 162.142 249.135 162.142 200C162.142 150.865 154.328 103.459 139.815 58.8392C161.596 40.8907 181.738 21.2015 200 0Z",
                    fill: "#6851FF"
                }), (0, t.jsx)("path", {
                    d: "M98.183 310.312C75.1276 294.994 50.6592 281.457 25 269.911C32.1177 247.797 35.9467 224.322 35.9467 200C35.9467 175.678 32.1177 152.204 25 130.089C50.6591 118.543 75.1275 105.006 98.183 89.6885C106.999 125.102 111.664 162.034 111.664 200C111.664 237.966 106.999 274.898 98.183 310.312Z",
                    fill: "#6851FF"
                }), (0, t.jsx)("path", {
                    d: "M288.336 200C288.336 237.966 293.001 274.898 301.817 310.312C324.872 294.994 349.341 281.457 375 269.911C367.882 247.797 364.053 224.322 364.053 200C364.053 175.678 367.882 152.204 375 130.089C349.341 118.543 324.872 105.006 301.817 89.6884C293.001 125.102 288.336 162.034 288.336 200Z",
                    fill: "#6851FF"
                })]
            }), s[3] = i) : i = s[3], s[4] !== n ? (o = (0, t.jsxs)("svg", {
                width: "32px",
                height: "32px",
                viewBox: "0 0 400 400",
                version: "1.1",
                ...n,
                children: [a, i]
            }), s[4] = n, s[5] = o) : o = s[5], o
        },
        Zerion: e => {
            let n, a, i, o, s, l, c = (0, r.c)(8);
            return c[0] !== e ? ({ ...n
            } = e, c[0] = e, c[1] = n) : n = c[1], c[2] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsx)("rect", {
                width: "512",
                height: "512",
                rx: "170.667",
                fill: "url('#paint0_linear_1098_5380')"
            }), i = (0, t.jsx)("rect", {
                x: "42.667",
                y: "42.667",
                width: "426.667",
                height: "426.667",
                rx: "170.667",
                fill: "#2461ED"
            }), o = (0, t.jsx)("path", {
                fillRule: "evenodd",
                clipRule: "evenodd",
                d: "M286.757 250.326c-41.73-22.55-92.506-51.794-130.72-75.629-11.276-8.123-5.553-25.364 8.074-25.364h189.086c10.548 0 17.604 11.761 12.318 20.66-12.706 21.944-31.256 49.805-46.75 71.895-8.317 11.857-21.872 13.894-32.008 8.438Zm-60.862 7.323c40.349 21.508 96.895 54.218 137.074 78.951 12.415 7.663 7.468 26.042-7.032 26.042-23.728 0-62.285.007-100.641.013-37.961.006-75.725.012-98.726.012-11.59 0-17.531-12.027-12.609-20.417 16.634-28.346 35.33-56.959 50.872-78.321 6.911-9.529 20.975-11.663 31.062-6.28Z",
                fill: "#fff"
            }), c[2] = a, c[3] = i, c[4] = o) : (a = c[2], i = c[3], o = c[4]), c[5] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsx)("defs", {
                children: (0, t.jsxs)("linearGradient", {
                    id: "paint0_linear_1098_5380",
                    x1: "0",
                    y1: "0",
                    x2: "604.983",
                    y2: "352.348",
                    gradientUnits: "userSpaceOnUse",
                    children: [(0, t.jsx)("stop", {
                        stopColor: "#2962EF"
                    }), (0, t.jsx)("stop", {
                        offset: "1",
                        stopColor: "#255CE5"
                    })]
                })
            }), c[5] = s) : s = c[5], c[6] !== n ? (l = (0, t.jsxs)("svg", {
                xmlns: "http://www.w3.org/2000/svg",
                width: "32px",
                height: "32px",
                viewBox: "0 0 512 512",
                fill: "none",
                ...n,
                children: [a, i, o, s]
            }), c[6] = n, c[7] = l) : l = c[7], l
        },
        Okx: e => {
            let n, a, i, o, s, l, c, u, d, f = (0, r.c)(11);
            return f[0] !== e ? ({ ...n
            } = e, f[0] = e, f[1] = n) : n = f[1], f[2] === Symbol.for("react.memo_cache_sentinel") ? (a = {
                borderRadius: "27.5%"
            }, f[2] = a) : a = f[2], f[3] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)("path", {
                fill: "#FFFFFF",
                opacity: "1.000000",
                stroke: "none",
                d: "\nM333.000000,514.000000 \n	C222.026932,514.000000 111.553864,514.000000 1.040397,514.000000 \n	C1.040397,343.068604 1.040397,172.137222 1.040397,1.102912 \n	C171.556396,1.102912 342.112885,1.102912 512.834717,1.102912 \n	C512.834717,171.999863 512.834717,342.999908 512.834717,514.000000 \n	C453.137177,514.000000 393.318573,514.000000 333.000000,514.000000 \nM149.500153,106.296974 \n	C137.679108,106.296974 125.858002,106.275078 114.037025,106.305374 \n	C107.193314,106.322906 105.007622,108.477486 105.003799,115.206032 \n	C104.987999,143.010406 104.988739,170.814774 105.003159,198.619141 \n	C105.006721,205.496872 107.116180,207.685822 113.862015,207.692139 \n	C141.666367,207.718124 169.470764,207.719223 197.275101,207.691544 \n	C204.219543,207.684631 206.277847,205.671249 206.286438,198.803192 \n	C206.321213,170.998871 206.318512,143.194443 206.288712,115.390106 \n	C206.281113,108.297028 204.189957,106.308426 196.951782,106.301506 \n	C181.467926,106.286697 165.984039,106.296967 149.500153,106.296974 \nM360.499817,207.703033 \n	C373.486572,207.703018 386.473297,207.713654 399.460052,207.698898 \n	C406.866913,207.690491 408.997681,205.585556 408.999725,198.283096 \n	C409.007416,170.811203 409.006287,143.339310 409.000549,115.867424 \n	C408.998962,108.322479 407.041901,106.305756 399.638947,106.302231 \n	C372.000549,106.289101 344.362183,106.288246 316.723785,106.303131 \n	C309.831238,106.306847 307.716339,108.339226 307.708130,115.158676 \n	C307.674622,142.963516 307.676483,170.768433 307.706360,198.573288 \n	C307.713928,205.633774 309.844757,207.682373 317.043213,207.695450 \n	C331.195374,207.721176 345.347565,207.703033 360.499817,207.703033 \nM307.835571,272.500061 \n	C307.835571,254.020844 307.852997,235.541595 307.826691,217.062424 \n	C307.816620,209.980988 305.624878,207.714005 298.695282,207.706848 \n	C270.893219,207.678146 243.091080,207.681274 215.289017,207.704651 \n	C208.539688,207.710327 206.316681,209.920135 206.309784,216.679733 \n	C206.281433,244.481796 206.279022,272.283936 206.311646,300.085968 \n	C206.319443,306.731720 208.657730,308.989594 215.404510,308.994232 \n	C243.206589,309.013367 271.008698,309.015533 298.810791,308.992523 \n	C305.475708,308.987030 307.788635,306.663483 307.824036,299.970306 \n	C307.870728,291.147125 307.835541,282.323547 307.835571,272.500061 \nM206.295914,361.500183 \n	C206.295914,347.347748 206.303299,333.195282 206.293137,319.042847 \n	C206.287186,310.746338 204.582611,309.003357 196.495056,309.002045 \n	C169.189148,308.997620 141.883240,308.996155 114.577332,309.003113 \n	C107.017197,309.005066 105.008812,310.947021 105.005447,318.319336 \n	C104.992844,345.958252 104.993156,373.597137 105.005539,401.236053 \n	C105.008606,408.084229 107.071625,410.273865 113.809303,410.283661 \n	C141.614655,410.324066 169.420135,410.320862 197.225494,410.286896 \n	C204.391434,410.278137 206.271317,408.301575 206.287842,400.961578 \n	C206.316681,388.141205 206.295898,375.320709 206.295914,361.500183 \nM405.272217,309.830139 \n	C403.497650,309.553558 401.723541,309.039185 399.948486,309.035950 \n	C372.128693,308.985260 344.308807,308.990540 316.488922,309.007721 \n	C309.933502,309.011780 307.731995,311.087433 307.720886,317.582550 \n	C307.672699,345.735504 307.675659,373.888641 307.718475,402.041626 \n	C307.727783,408.170410 309.704224,410.249603 315.823975,410.265076 \n	C344.143433,410.336578 372.463196,410.331268 400.782715,410.270630 \n	C406.739746,410.257874 408.978577,407.959930 408.985138,402.144501 \n	C409.017090,373.824921 409.069275,345.504791 408.871033,317.186523 \n	C408.854675,314.844818 407.022522,312.515839 405.272217,309.830139 \nz"
            }), o = (0, t.jsx)("path", {
                fill: "#020202",
                opacity: "1.000000",
                stroke: "none",
                d: "\nM150.000153,106.296974 \n	C165.984039,106.296967 181.467926,106.286697 196.951782,106.301506 \n	C204.189957,106.308426 206.281113,108.297028 206.288712,115.390106 \n	C206.318512,143.194443 206.321213,170.998871 206.286438,198.803192 \n	C206.277847,205.671249 204.219543,207.684631 197.275101,207.691544 \n	C169.470764,207.719223 141.666367,207.718124 113.862015,207.692139 \n	C107.116180,207.685822 105.006721,205.496872 105.003159,198.619141 \n	C104.988739,170.814774 104.987999,143.010406 105.003799,115.206032 \n	C105.007622,108.477486 107.193314,106.322906 114.037025,106.305374 \n	C125.858002,106.275078 137.679108,106.296974 150.000153,106.296974 \nz"
            }), s = (0, t.jsx)("path", {
                fill: "#020202",
                opacity: "1.000000",
                stroke: "none",
                d: "\nM359.999786,207.703033 \n	C345.347565,207.703033 331.195374,207.721176 317.043213,207.695450 \n	C309.844757,207.682373 307.713928,205.633774 307.706360,198.573288 \n	C307.676483,170.768433 307.674622,142.963516 307.708130,115.158676 \n	C307.716339,108.339226 309.831238,106.306847 316.723785,106.303131 \n	C344.362183,106.288246 372.000549,106.289101 399.638947,106.302231 \n	C407.041901,106.305756 408.998962,108.322479 409.000549,115.867424 \n	C409.006287,143.339310 409.007416,170.811203 408.999725,198.283096 \n	C408.997681,205.585556 406.866913,207.690491 399.460052,207.698898 \n	C386.473297,207.713654 373.486572,207.703018 359.999786,207.703033 \nz"
            }), l = (0, t.jsx)("path", {
                fill: "#010101",
                opacity: "1.000000",
                stroke: "none",
                d: "\nM307.835571,273.000092 \n	C307.835541,282.323547 307.870728,291.147125 307.824036,299.970306 \n	C307.788635,306.663483 305.475708,308.987030 298.810791,308.992523 \n	C271.008698,309.015533 243.206589,309.013367 215.404510,308.994232 \n	C208.657730,308.989594 206.319443,306.731720 206.311646,300.085968 \n	C206.279022,272.283936 206.281433,244.481796 206.309784,216.679733 \n	C206.316681,209.920135 208.539688,207.710327 215.289017,207.704651 \n	C243.091080,207.681274 270.893219,207.678146 298.695282,207.706848 \n	C305.624878,207.714005 307.816620,209.980988 307.826691,217.062424 \n	C307.852997,235.541595 307.835571,254.020844 307.835571,273.000092 \nz"
            }), c = (0, t.jsx)("path", {
                fill: "#000000",
                opacity: "1.000000",
                stroke: "none",
                d: "\nM206.295914,362.000214 \n	C206.295898,375.320709 206.316681,388.141205 206.287842,400.961578 \n	C206.271317,408.301575 204.391434,410.278137 197.225494,410.286896 \n	C169.420135,410.320862 141.614655,410.324066 113.809303,410.283661 \n	C107.071625,410.273865 105.008606,408.084229 105.005539,401.236053 \n	C104.993156,373.597137 104.992844,345.958252 105.005447,318.319336 \n	C105.008812,310.947021 107.017197,309.005066 114.577332,309.003113 \n	C141.883240,308.996155 169.189148,308.997620 196.495056,309.002045 \n	C204.582611,309.003357 206.287186,310.746338 206.293137,319.042847 \n	C206.303299,333.195282 206.295914,347.347748 206.295914,362.000214 \nz"
            }), u = (0, t.jsx)("path", {
                fill: "#000000",
                opacity: "1.000000",
                stroke: "none",
                d: "\nM405.653137,310.005554 \n	C407.022522,312.515839 408.854675,314.844818 408.871033,317.186523 \n	C409.069275,345.504791 409.017090,373.824921 408.985138,402.144501 \n	C408.978577,407.959930 406.739746,410.257874 400.782715,410.270630 \n	C372.463196,410.331268 344.143433,410.336578 315.823975,410.265076 \n	C309.704224,410.249603 307.727783,408.170410 307.718475,402.041626 \n	C307.675659,373.888641 307.672699,345.735504 307.720886,317.582550 \n	C307.731995,311.087433 309.933502,309.011780 316.488922,309.007721 \n	C344.308807,308.990540 372.128693,308.985260 399.948486,309.035950 \n	C401.723541,309.039185 403.497650,309.553558 405.653137,310.005554 \nz"
            }), f[3] = i, f[4] = o, f[5] = s, f[6] = l, f[7] = c, f[8] = u) : (i = f[3], o = f[4], s = f[5], l = f[6], c = f[7], u = f[8]), f[9] !== n ? (d = (0, t.jsxs)("svg", {
                version: "1.1",
                xmlns: "http://www.w3.org/2000/svg",
                width: "32px",
                height: "32px",
                viewBox: "0 0 512 513",
                "enable-background": "new 0 0 512 513",
                style: a,
                ...n,
                children: [i, o, s, l, c, u]
            }), f[9] = n, f[10] = d) : d = f[10], d
        },
        Bitget: e => {
            let n, a, i, o, s, l = (0, r.c)(7);
            return l[0] !== e ? ({ ...n
            } = e, l[0] = e, l[1] = n) : n = l[1], l[2] === Symbol.for("react.memo_cache_sentinel") ? (a = {
                borderRadius: "27.5%"
            }, l[2] = a) : a = l[2], l[3] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)("rect", {
                width: "512",
                height: "512",
                fill: "#001F29"
            }), o = (0, t.jsx)("path", {
                d: "M219.948 95.7022C201.623 95.6929 183.33 95.6835 164.941 95.7116C153.822 95.7116 149.651 109.671 157.921 117.939L283.098 243.117C287.004 246.69 289.441 250.574 289.53 255.693C289.441 260.812 287.004 264.696 283.098 268.269L157.921 393.446C149.651 401.715 153.822 415.674 164.941 415.674C183.33 415.702 201.623 415.693 219.948 415.683C229.122 415.679 238.305 415.674 247.511 415.674C259.555 415.674 266.72 409.24 273.154 402.805L386.047 289.912C395.057 280.902 403.119 268.939 403.009 255.693C403.119 242.447 395.057 230.484 386.047 221.474L273.154 108.58C266.72 102.146 259.555 95.7116 247.511 95.7116C238.305 95.7116 229.122 95.7069 219.948 95.7022Z",
                fill: "#00F0FF"
            }), l[3] = i, l[4] = o) : (i = l[3], o = l[4]), l[5] !== n ? (s = (0, t.jsxs)("svg", {
                width: "32",
                height: "32",
                viewBox: "0 0 512 512",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg",
                style: a,
                ...n,
                children: [i, o]
            }), l[5] = n, l[6] = s) : s = l[6], s
        },
        Phantom: e => {
            let n, a, i, o, s, l = (0, r.c)(11);
            l[0] !== e ? ({
                background: a,
                ...n
            } = e, l[0] = e, l[1] = n, l[2] = a) : (n = l[1], a = l[2]);
            let c = void 0 !== a && a;
            l[3] !== c ? (i = c ? {
                background: "#AB9FF2",
                borderRadius: "27.5%"
            } : void 0, l[3] = c, l[4] = i) : i = l[4];
            let u = c ? "#ffffff" : "currentColor";
            return l[5] !== u ? (o = (0, t.jsx)("path", {
                fillRule: "evenodd",
                clipRule: "evenodd",
                d: "M37.7425 57.0705C34.1942 62.3362 28.2483 69 20.3366 69C16.5965 69 13.0001 67.5093 13 61.0322C12.9997 44.5362 36.2555 19.0003 57.8334 19C70.1084 18.9998 75 27.2474 75 36.6136C75 48.6357 66.9442 62.3824 58.9368 62.3824C56.3955 62.3824 55.1487 61.031 55.1487 58.888C55.1487 58.3288 55.2442 57.7228 55.4365 57.0705C52.7029 61.5902 47.4285 65.7849 42.4896 65.7849C38.8933 65.7849 37.0713 63.5944 37.0713 60.5187C37.0713 59.4003 37.311 58.2357 37.7425 57.0705ZM53.7586 31.6834C51.8054 31.6868 50.4738 33.2938 50.478 35.5864C50.4822 37.879 51.8198 39.5273 53.7729 39.5241C55.6789 39.5208 57.0099 37.8679 57.0058 35.5752C57.0016 33.2827 55.6646 31.6802 53.7586 31.6834ZM64.1193 31.6725C62.1661 31.6759 60.8345 33.2829 60.8387 35.5755C60.8429 37.868 62.1798 39.5164 64.1336 39.5131C66.0396 39.5099 67.3706 37.8569 67.3664 35.5643C67.3622 33.2718 66.0253 31.6693 64.1193 31.6725Z",
                fill: u
            }), l[5] = u, l[6] = o) : o = l[6], l[7] !== n || l[8] !== i || l[9] !== o ? (s = (0, t.jsx)("svg", {
                width: "32",
                height: "32",
                viewBox: "0 0 88 88",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg",
                style: i,
                ...n,
                children: o
            }), l[7] = n, l[8] = i, l[9] = o, l[10] = s) : s = l[10], s
        },
        Rainbow: e => {
            let i, o, s, l, c = (0, r.c)(7);
            c[0] !== e ? ({
                round: o,
                ...i
            } = e, c[0] = e, c[1] = i, c[2] = o) : (i = c[1], o = c[2]);
            let u = void 0 !== o && o ? n : a;
            return c[3] === Symbol.for("react.memo_cache_sentinel") ? (s = {
                borderRadius: "8px"
            }, c[3] = s) : s = c[3], c[4] !== u || c[5] !== i ? (l = (0, t.jsx)(u, {
                width: 32,
                height: 32,
                style: s,
                ...i
            }), c[4] = u, c[5] = i, c[6] = l) : l = c[6], l
        },
        Family: e => {
            let n, a, i, o = (0, r.c)(5);
            return o[0] !== e ? ({ ...n
            } = e, o[0] = e, o[1] = n) : n = o[1], o[2] === Symbol.for("react.memo_cache_sentinel") ? (a = {
                backgroundSize: "100% 100%",
                backgroundImage: 'url("/images/logos/family.png")'
            }, o[2] = a) : a = o[2], o[3] !== n ? (i = (0, t.jsx)("svg", {
                width: "32",
                height: "32",
                viewBox: "0 0 120 120",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg",
                style: a,
                ...n
            }), o[3] = n, o[4] = i) : i = o[4], i
        },
        Trust: e => {
            let n, a, i, o, s, l = (0, r.c)(11);
            l[0] !== e ? ({
                theme: a,
                ...n
            } = e, l[0] = e, l[1] = n, l[2] = a) : (n = l[1], a = l[2]);
            let c = void 0 === a ? "light" : a,
                u = "light" === c ? "#ffffff" : "#3375BB";
            l[3] !== u ? (i = (0, t.jsx)("rect", {
                width: "44",
                height: "44",
                fill: u
            }), l[3] = u, l[4] = i) : i = l[4];
            let d = "light" === c ? "#3375BB" : "#ffffff";
            return l[5] !== d ? (o = (0, t.jsx)("path", {
                fillRule: "evenodd",
                clipRule: "evenodd",
                d: "M33.0246 11.8662C33.4096 11.8662 33.774 12.0243 34.0421 12.2925C34.3102 12.5675 34.4615 12.9387 34.4546 13.3168C34.3859 17.4143 34.2277 20.5493 33.9321 23.0312C33.6433 25.5131 33.2102 27.3556 32.5571 28.8475C32.1171 29.8443 31.574 30.6693 30.9346 31.3706C30.0752 32.2987 29.0921 32.9725 28.0196 33.6119C27.561 33.8861 27.0843 34.1568 26.5842 34.4408C25.5172 35.0468 24.3441 35.713 23.0146 36.6025C22.5333 36.9256 21.9077 36.9256 21.4265 36.6025C20.0766 35.7026 18.8879 35.0281 17.8112 34.4173C17.5718 34.2815 17.3379 34.1488 17.109 34.0175C15.8509 33.2887 14.7165 32.5943 13.7265 31.5906C13.0665 30.9306 12.4959 30.1262 12.0421 29.1706C11.4234 27.8918 11.004 26.345 10.6946 24.3443C10.2821 21.67 10.0759 18.1706 10.0002 13.3168C9.99336 12.9387 10.1377 12.5675 10.4059 12.2925C10.674 12.0243 11.0452 11.8662 11.4302 11.8662H12.0215C13.8433 11.8731 17.8652 11.6943 21.344 8.98559C21.8596 8.58683 22.5815 8.58683 23.0971 8.98559C26.5759 11.6943 30.5977 11.8731 32.4265 11.8662H33.0246ZM29.8277 27.9331C30.2746 27.0118 30.6459 25.74 30.9277 23.9112C31.2646 21.725 31.4709 18.755 31.5671 14.7125C29.4221 14.6506 25.7371 14.2381 22.224 11.8731C18.7109 14.2312 15.0259 14.6437 12.8877 14.7125C12.9633 18.0537 13.1146 20.6525 13.3552 22.6943C13.6302 25.0181 14.0221 26.5925 14.5102 27.6993C14.8333 28.435 15.1909 28.9643 15.6171 29.4318C16.1877 30.0575 16.9096 30.5731 17.8927 31.1643C18.3005 31.409 18.7502 31.6635 19.2396 31.9406C20.1116 32.4341 21.1099 32.9991 22.224 33.7081C23.3175 33.0107 24.3014 32.4515 25.1633 31.9616C25.4231 31.8139 25.6717 31.6725 25.909 31.5356C27.119 30.8412 28.0127 30.2637 28.6796 29.59C29.1265 29.1293 29.4909 28.6275 29.8277 27.9331Z",
                fill: d
            }), l[5] = d, l[6] = o) : o = l[6], l[7] !== n || l[8] !== i || l[9] !== o ? (s = (0, t.jsxs)("svg", {
                width: "32",
                height: "32",
                viewBox: "0 0 44 44",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg",
                ...n,
                children: [i, o]
            }), l[7] = n, l[8] = i, l[9] = o, l[10] = s) : s = l[10], s
        },
        Ledger: e => {
            let n, a, i, o, s = (0, r.c)(6);
            return s[0] !== e ? ({ ...n
            } = e, s[0] = e, s[1] = n) : n = s[1], s[2] === Symbol.for("react.memo_cache_sentinel") ? (a = {
                background: "black"
            }, s[2] = a) : a = s[2], s[3] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)("path", {
                fillRule: "evenodd",
                clipRule: "evenodd",
                d: "M37.2106 16H16V29.4577H19.2182V19.2182L37.2106 19.1011V16ZM37.3568 33.4073V54.6179H50.8146V51.3997H40.575L40.458 33.4073H37.3568ZM16 72.1714H37.2106V69.0703L19.2182 68.9533V58.7137H16V72.1714ZM50.9609 16H72.1714V29.4577H68.9533V19.2182L50.9609 19.1011V16ZM72.1714 72.1714H50.9609V69.0703L68.9533 68.9533V58.7137H72.1714V72.1714Z",
                fill: "white"
            }), s[3] = i) : i = s[3], s[4] !== n ? (o = (0, t.jsx)("svg", {
                width: "32",
                height: "32",
                viewBox: "0 0 88 88",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg",
                style: a,
                ...n,
                children: i
            }), s[4] = n, s[5] = o) : o = s[5], o
        },
        Safe: e => {
            let n, a, i, o, s, l, c = (0, r.c)(8);
            return c[0] !== e ? ({ ...n
            } = e, c[0] = e, c[1] = n) : n = c[1], c[2] === Symbol.for("react.memo_cache_sentinel") ? (a = {
                background: "#12FF80"
            }, c[2] = a) : a = c[2], c[3] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)("path", {
                d: "M68.7186 44H62.6472C60.8339 44 59.3646 45.4686 59.3646 47.281V56.0888C59.3646 57.9012 57.8952 59.3697 56.0819 59.3697H31.9278C30.1145 59.3697 28.6452 60.8383 28.6452 62.6507V68.719C28.6452 70.5314 30.1145 72 31.9278 72H57.48C59.2933 72 60.7417 70.5314 60.7417 68.719V63.8504C60.7417 62.038 62.2111 60.7524 64.0244 60.7524H68.7174C70.5307 60.7524 72 59.2838 72 57.4714V47.2429C72 45.4305 70.5307 44 68.7174 44H68.7186Z",
                fill: "#121312"
            }), o = (0, t.jsx)("path", {
                d: "M28.6406 31.9308C28.6406 30.1162 30.1104 28.6458 31.9243 28.6458H56.0712C57.8851 28.6458 59.3548 27.1754 59.3548 25.3608V19.285C59.3548 17.4704 57.8851 16 56.0712 16H30.5245C28.7107 16 27.2409 17.4704 27.2409 19.285V23.9666C27.2409 25.7813 25.7711 27.2516 23.9572 27.2516H19.2837C17.4698 27.2516 16 28.722 16 30.5366V40.7888C16 42.6034 17.4759 44 19.2898 44H25.3631C27.177 44 28.6468 42.5296 28.6468 40.715L28.6406 31.932V31.9308Z",
                fill: "#121312"
            }), s = (0, t.jsx)("path", {
                d: "M41.1004 37.6774H46.8995C48.7894 37.6774 50.3226 39.2117 50.3226 41.1004V46.8995C50.3226 48.7894 48.7882 50.3225 46.8995 50.3225H41.1004C39.2106 50.3225 37.6774 48.7882 37.6774 46.8995V41.1004C37.6774 39.2105 39.2118 37.6774 41.1004 37.6774V37.6774Z",
                fill: "#121312"
            }), c[3] = i, c[4] = o, c[5] = s) : (i = c[3], o = c[4], s = c[5]), c[6] !== n ? (l = (0, t.jsxs)("svg", {
                width: "32",
                height: "32",
                viewBox: "0 0 88 88",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg",
                style: a,
                ...n,
                children: [i, o, s]
            }), c[6] = n, c[7] = l) : l = c[7], l
        }
    }], 125723)
}, 281932, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        n = e.i(132559),
        a = e.i(125723);
    let i = () => ({
            name: "Bitget Wallet",
            shortName: "Bitget",
            icon: (0, t.jsx)(a.Logos.Bitget, {}),
            connectorIcon: (0, t.jsx)(a.Logos.Bitget, {}),
            iconShouldShrink: !0,
            iconShape: "squircle",
            downloadUrls: {
                website: "https://web3.bitget.com",
                chrome: "https://chromewebstore.google.com/detail/bitget-wallet-formerly-bi/jiidiaalihmmhddjgbnbgdfflelocpak",
                ios: "https://apps.apple.com/us/app/bitget-wallet-bitcoin-crypto/id1395301115",
                android: "https://play.google.com/store/apps/details?id=com.bitkeep.wallet"
            },
            enabled: !0,
            order: 6,
            getWalletConnectDeeplink: e => n.isAndroid ? e : `bitkeep://wc?uri=${encodeURIComponent(e)}`
        }),
        o = () => ({
            name: "OKX Wallet",
            shortName: "OKX",
            icon: (0, t.jsx)(a.Logos.Okx, {}),
            connectorIcon: (0, t.jsx)(a.Logos.Okx, {}),
            iconShouldShrink: !0,
            iconShape: "squircle",
            downloadUrls: {
                website: "https://www.okx.com",
                chrome: "https://chromewebstore.google.com/detail/okx-wallet/mcohilncbfahbmgdjkbpemcciiolgcge?hl=en",
                ios: "https://apps.apple.com/us/app/okx-buy-bitcoin-eth-crypto/id1327268470",
                android: "https://play.google.com/store/apps/details?id=com.okinc.okex.gp"
            },
            enabled: !0,
            order: 5,
            getWalletConnectDeeplink: e => n.isAndroid ? e : `okex://main/wc?uri=${encodeURIComponent(e)}`
        }),
        s = () => ({
            name: "Rabby Wallet",
            shortName: "Rabby",
            icon: (0, t.jsx)(a.Logos.Rabby, {}),
            connectorIcon: (0, t.jsx)(a.Logos.Rabby, {}),
            iconShouldShrink: !0,
            iconShape: "squircle",
            downloadUrls: {
                download: "https://rabby.io",
                website: "https://rabby.io",
                chrome: "https://chrome.google.com/webstore/detail/rabby-wallet/acmacodkjbdgmoleebolmdjonilkdbch"
            },
            enabled: !0,
            preventDeeplinkIfNotInstalled: !0,
            order: 3
        }),
        l = () => ({
            name: "Coinbase Wallet",
            shortName: "Coinbase",
            icon: (0, t.jsx)(a.Logos.Coinbase, {
                background: !0
            }),
            connectorIcon: (0, t.jsx)(a.Logos.Coinbase, {
                background: !0
            }),
            iconShouldShrink: !0,
            iconShape: "squircle",
            downloadUrls: {
                download: "https://www.coinbase.com/en-ca/wallet/downloads",
                website: "https://www.coinbase.com/wallet/getting-started-extension",
                android: "https://play.google.com/store/apps/details?id=org.toshi",
                ios: "https://apps.apple.com/app/coinbase-wallet-store-crypto/id1278383455",
                chrome: "https://chrome.google.com/webstore/detail/coinbase-wallet-extension/hnfanknocfeofbddgcijnmhnfnkdnaad"
            },
            enabled: !0,
            getWalletConnectDeeplink: e => `https://go.cb-w.com/wc?uri=${encodeURIComponent(e)}`,
            shouldDeeplinkDesktop: !1,
            order: 2
        }),
        c = {
            "coinbaseWallet, coinbaseWalletSDK": l(),
            "com.coinbase.wallet": l(),
            "com.bitget.web3": i(),
            "co.family.wallet": {
                name: "Family",
                shortName: "Family",
                icon: (0, t.jsx)(a.Logos.Family, {}),
                iconShouldShrink: !0,
                iconShape: "squircle",
                downloadUrls: {
                    download: "https://connect.family.co/v0/download/family",
                    website: "https://family.co",
                    ios: "https://family.co/download"
                },
                enabled: !1,
                getWalletConnectDeeplink: e => n.isAndroid ? e : `familywallet://wc?uri=${encodeURIComponent(e)}`
            },
            "com.okex.wallet": o(),
            injected: {
                name: "Browser Wallet",
                shortName: "Browser",
                icon: (0, t.jsx)(a.Logos.Injected, {}),
                iconShouldShrink: !0,
                iconShape: "squircle"
            },
            ledger: {
                name: "Ledger Live",
                shortName: "Ledger",
                icon: (0, t.jsx)(a.Logos.Ledger, {}),
                downloadUrls: {
                    download: "https://www.ledger.com/ledger-live/download#download-device-2",
                    website: "https://www.ledger.com/ledger-live/download#download-device-2",
                    android: "https://play.google.com/store/apps/details?id=com.ledger.live",
                    ios: "https://apps.apple.com/app/ledger-live-web3-wallet/id1361671700"
                },
                enabled: !1,
                getWalletConnectDeeplink: e => n.isAndroid ? e : `ledgerlive://wc?uri=${encodeURIComponent(e)}`
            },
            magic: {
                name: "Magic",
                icon: (0, t.jsx)(a.Logos.Magic, {}),
                connectorIcon: (0, t.jsx)(a.Logos.Magic, {}),
                iconShouldShrink: !0,
                iconShape: "squircle",
                enabled: !0,
                isInstalled: !0
            },
            "metaMask, metaMask-io, io.metamask, io.metamask.mobile, metaMaskSDK": {
                name: "MetaMask",
                icon: (0, t.jsx)(a.Logos.MetaMask, {}),
                connectorIcon: (0, t.jsx)(a.Logos.MetaMask, {}),
                iconShouldShrink: !1,
                iconShape: "squircle",
                downloadUrls: {
                    download: "https://metamask.io/download/",
                    website: "https://metamask.io/",
                    android: "https://play.google.com/store/apps/details?id=io.metamask",
                    ios: "https://apps.apple.com/app/metamask/id1438144202",
                    chrome: "https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",
                    firefox: "https://addons.mozilla.org/en-US/firefox/addon/ether-metamask/",
                    brave: "https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",
                    edge: "https://microsoftedge.microsoft.com/addons/detail/metamask/ejbalbakoplchlghecdalmeeeajnimhm"
                },
                enabled: !0,
                getWalletConnectDeeplink: e => `https://metamask.app.link/wc?uri=${encodeURIComponent(e)}`,
                order: 1
            },
            "app.phantom, phantom": {
                name: "Phantom",
                icon: (0, t.jsx)(a.Logos.Phantom, {
                    background: !0
                }),
                connectorIcon: (0, t.jsx)(a.Logos.Phantom, {
                    background: !0
                }),
                iconShouldShrink: !0,
                iconShape: "squircle",
                enabled: !0,
                downloadUrls: {
                    download: "https://phantom.app/download/",
                    website: "https://phantom.app/",
                    android: "https://play.google.com/store/apps/details?id=app.phantom",
                    ios: "https://apps.apple.com/app/phantom-solana-wallet/1598432977",
                    chrome: "https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa",
                    edge: "https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa",
                    brave: "https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa"
                },
                order: 4,
                getWalletConnectDeeplink: e => {
                    let t = encodeURIComponent("https://polymarket.com"),
                        r = encodeURIComponent(window.location.href);
                    return `https://phantom.app/ul/browse/${t}?ref=${r}`
                },
                bypassWalletConnectUri: !0,
                shouldDeeplinkDesktop: !1
            },
            "me.rainbow": {
                name: "Rainbow Wallet",
                shortName: "Rainbow",
                icon: (0, t.jsx)(a.Logos.Rainbow, {}),
                iconShouldShrink: !0,
                iconShape: "squircle",
                downloadUrls: {
                    download: "https://rainbow.me/?utm_source=polymarket",
                    website: "https://rainbow.me/?utm_source=connectkit",
                    android: "https://play.google.com/store/apps/details?id=me.rainbow&referrer=utm_source%3Dconnectkit&utm_source=connectkit",
                    ios: "https://apps.apple.com/app/rainbow-ethereum-wallet/id1457119021?pt=119997837&ct=connectkit&mt=8",
                    chrome: "https://rainbow.me/extension?utm_source=connectkit",
                    edge: "https://rainbow.me/extension?utm_source=connectkit",
                    brave: "https://rainbow.me/extension?utm_source=connectkit"
                },
                enabled: !0,
                getWalletConnectDeeplink: e => n.isAndroid ? e : `https://rnbwapp.com/wc?uri=${encodeURIComponent(e)}&connector=polymarket`
            },
            "io.rabby, rabby": s(),
            "io.zerion.wallet": {
                name: "Zerion Wallet",
                icon: (0, t.jsx)(a.Logos.Zerion, {}),
                connectorIcon: (0, t.jsx)(a.Logos.Zerion, {}),
                iconShape: "squircle",
                enabled: !0,
                downloadUrls: {
                    website: "https://zerion.io/",
                    chrome: "https://chromewebstore.google.com/detail/zerion-wallet-for-web3-nf/klghhnkeealcohjjanjjdaeeggmfmlpl?hl=en"
                }
            },
            safe: {
                name: "Safe",
                icon: (0, t.jsx)(a.Logos.Safe, {}),
                iconShouldShrink: !0,
                iconShape: "squircle",
                downloadUrls: {
                    download: "https://connect.family.co/v0/download/safe",
                    website: "https://safe.global/wallet",
                    android: "https://play.google.com/store/apps/details?id=io.gnosis.safe",
                    ios: "https://apps.apple.com/app/id1515759131"
                },
                enabled: !1,
                getWalletConnectDeeplink: e => n.isAndroid ? e : `https://gnosis-safe.io/wc?uri=${encodeURIComponent(e)}`
            },
            "com.trustwallet.app": {
                name: "Trust Wallet",
                shortName: "Trust",
                icon: (0, t.jsx)(a.Logos.Trust, {}),
                iconShouldShrink: !0,
                iconShape: "squircle",
                downloadUrls: {
                    download: "https://trustwallet.com/download",
                    android: "https://play.google.com/store/apps/details?id=com.wallet.crypto.trustapp",
                    ios: "https://apps.apple.com/app/trust-crypto-bitcoin-wallet/id1288339409",
                    chrome: "https://chromewebstore.google.com/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph"
                },
                enabled: !0,
                getWalletConnectDeeplink: e => n.isAndroid ? e : `https://link.trustwallet.com/wc?uri=${encodeURIComponent(e)}`
            },
            walletConnect: {
                name: "WalletConnect",
                shortName: "WalletConnect",
                icon: (0, t.jsx)(a.Logos.WalletConnect, {}),
                connectorIcon: (0, t.jsx)(a.Logos.WalletConnect, {
                    height: "42",
                    width: "42",
                    style: {
                        position: "relative",
                        top: "-5px",
                        left: "-5px"
                    }
                }),
                iconShouldShrink: !0,
                iconShape: "squircle",
                enabled: !0,
                getWalletConnectDeeplink: e => e,
                order: 4
            }
        };
    var u = e.i(905333);
    e.i(416340);
    var d = e.i(531299);
    let f = [{
            id: "io.rabby",
            config: s()
        }, {
            id: "com.okex.wallet",
            config: o()
        }, {
            id: "com.bitget.web3",
            config: i()
        }],
        p = () => {
            let e, t, n = (0, r.c)(4),
                a = (0, d.useConnectors)();
            if (n[0] !== a) {
                let t = a.map(m),
                    r = a.find(y),
                    i = [...t, ...r ? f.map(e => {
                        let {
                            id: t,
                            config: n
                        } = e;
                        return {
                            id: t,
                            connector: r,
                            ...n,
                            isInstalled: !1
                        }
                    }) : []],
                    o = i.reduce(g, {});
                e = i.filter(e => !o[e.id] && !(0, u.isDenylistedConnector)(e.id)).filter(b).map(v).filter(w).filter(C).filter(S).filter(I).sort(T).sort(k), n[0] = a, n[1] = e
            } else e = n[1];
            return n[2] !== e ? (t = {
                wallets: e
            }, n[2] = e, n[3] = t) : t = n[3], t
        };

    function h(e) {
        return e.trim()
    }

    function m(e) {
        let r = Object.entries(c).find(t => {
                let [r] = t;
                return -1 !== r.split(",").map(h).indexOf(e.id)
            }),
            n = r ? .[1],
            a = {
                id: e.id,
                name: e.name ? ? e.id ? ? e.type,
                icon: (0, t.jsx)("img", {
                    src: e.icon,
                    alt: e.name,
                    width: "100%",
                    height: "100%"
                }),
                connector: e,
                iconShape: "squircle",
                isInstalled: "mock" === e.type || "injected" === e.type && "metaMask" !== e.id && "phantom" !== e.id || (0, u.isCoinbaseWalletConnector)(e.id) || (0, u.isMagicConnector)(e.id)
            };
        if (n) {
            let {
                isInstalled: e,
                ...t
            } = n;
            return { ...a,
                ...t
            }
        }
        return a
    }

    function y(e) {
        return "walletConnect" === e.id
    }

    function g(e, t) {
        return !1 === t.enabled && (e[t.id] = !0), e
    }

    function b(e, t, r) {
        return r.findIndex(t => t.id === e.id) === t
    }

    function v(e) {
        return "walletConnect" === e.id ? { ...e,
            name: e.name,
            shortName: e.shortName
        } : e
    }

    function x(e) {
        return "com.coinbase.wallet" === e.id
    }

    function w(e, t, r) {
        return !("coinbaseWalletSDK" === e.id && r.find(x))
    }

    function _(e) {
        return "rabby" === e.id && "injected" === e.connector.type
    }

    function C(e, t, r) {
        return !("io.rabby" === e.id && "walletConnect" === e.connector.id && r.find(_))
    }

    function E(e) {
        return "io.metamask" === e.id || "io.metamask.mobile" === e.id
    }

    function S(e, t, r) {
        return !(("metaMaskSDK" === e.id || "metaMask" === e.id) && r.find(E))
    }

    function A(e) {
        return "app.phantom" === e.id
    }

    function I(e, t, r) {
        return !("phantom" === e.id && r.find(A))
    }

    function T(e, t) {
        let r = e.isInstalled && (0, u.isInjectedConnector)(e.connector.type),
            n = t.isInstalled && (0, u.isInjectedConnector)(t.connector.type);
        if (r && !n) return -1;
        if (!r && n) return 1;
        if (e.order && !t.order) return -1;
        if (!e.order && t.order) return 1;
        if (e.order && t.order) {
            if (e.order < t.order) return -1;
            if (e.order > t.order) return 1
        }
        return 0
    }

    function k(e, t) {
        return "walletConnect" === e.id ? 1 : "walletConnect" === t.id ? -1 : 0
    }
    e.s(["useWallet", 0, e => {
        let t, n = (0, r.c)(5),
            {
                wallets: a
            } = p();
        if (n[0] !== e || n[1] !== a) {
            let r;
            n[3] !== e ? (r = t => t.id === e, n[3] = e, n[4] = r) : r = n[4], t = a.find(r), n[0] = e, n[1] = a, n[2] = t
        } else t = n[2];
        let i = t;
        return i || null
    }, "useWallets", 0, p], 281932)
}, 246290, e => {
    "use strict";
    e.s(["useAccount", () => h]);
    var t = e.i(999061),
        r = e.i(399482),
        n = e.i(905333),
        a = e.i(964974);
    e.i(416340);
    var i = e.i(805949),
        o = e.i(439013),
        s = e.i(510954),
        l = e.i(57096),
        c = e.i(827681),
        u = e.i(566515),
        d = e.i(603580),
        f = e.i(721270),
        p = e.i(281932);

    function h(e) {
        let h, y, g, b, v, x, w, _, C, E, S = (0, t.c)(54);
        S[0] !== e ? (h = void 0 === e ? {} : e, S[0] = e, S[1] = h) : h = S[1], S[2] !== h ? ({
            onConnect: y,
            onDisconnect: g,
            optimisticMagic: b,
            ...v
        } = h, S[2] = h, S[3] = y, S[4] = g, S[5] = b, S[6] = v) : (y = S[3], g = S[4], b = S[5], v = S[6]);
        let {
            authenticationStatus: A
        } = (0, d.useSiwxContext)(), {
            isLoggedIn: I,
            authenticatedUser: T
        } = (0, u.useAuthenticationContext)(), {
            address: k,
            connector: O,
            status: R,
            chain: N,
            chainId: M
        } = (0, i.useConnection)(v), P = (0, p.useWallet)("magic");
        S[7] === Symbol.for("react.memo_cache_sentinel") ? (x = (0, r.createWalletCache)().wallets.value, S[7] = x) : x = S[7];
        let D = x;
        S[8] === Symbol.for("react.memo_cache_sentinel") ? (w = {
            queryKey: s.queryKeys[l.QueryKey.Account].profile().queryKey,
            queryFn: m,
            enabled: !1
        }, S[8] = w) : w = S[8];
        let {
            data: j
        } = (0, a.useQuery)(w), L = "connecting" === R, F = "connected" === R, U = "reconnecting" === R, $ = "disconnected" === R;
        S[9] !== y || S[10] !== g ? (_ = {
            onConnect: y,
            onDisconnect: g
        }, S[9] = y, S[10] = g, S[11] = _) : _ = S[11], (0, o.useConnectionEffect)(_), j ? .proxyWallet;
        e: {
            let e, t;
            if (b && A === c.AuthenticationStatusStates.SUCCESS && I && !O && T ? .type === "magic" && T.address && (0, r.createWalletCache)().state.canReconnect) {
                let e, t, r, n, a = T.address;
                S[12] !== a || S[13] !== j ? .proxyWallet ? (e = (0, f.getProxyAddress)(a, "depositWallet"), t = j ? .proxyWallet ? .toLowerCase() === e.toLowerCase() || D ? .toLowerCase() === e.toLowerCase(), S[12] = a, S[13] = j ? .proxyWallet, S[14] = e, S[15] = t) : (e = S[14], t = S[15]);
                let i = t,
                    o = i ? "depositWallet" : "proxy";
                S[16] !== a || S[17] !== e || S[18] !== i ? (r = i ? e : (0, f.getProxyAddress)(a, "magic"), S[16] = a, S[17] = e, S[18] = i, S[19] = r) : r = S[19];
                let s = r,
                    l = P ? P.connector : void 0;
                S[20] !== a || S[21] !== o || S[22] !== s || S[23] !== l || S[24] !== F || S[25] !== L ? (n = {
                    address: a,
                    proxyAddress: s,
                    authenticationType: "magic",
                    walletMode: o,
                    connector: l,
                    isConnecting: L,
                    isConnected: F
                }, S[20] = a, S[21] = o, S[22] = s, S[23] = l, S[24] = F, S[25] = L, S[26] = n) : n = S[26], C = n;
                break e
            }
            if (!O || !k) {
                let e;
                S[27] !== F || S[28] !== L ? (e = {
                    address: void 0,
                    proxyAddress: void 0,
                    authenticationType: void 0,
                    walletMode: void 0,
                    connector: void 0,
                    isConnecting: L,
                    isConnected: F
                }, S[27] = F, S[28] = L, S[29] = e) : e = S[29], C = e;
                break e
            }
            let a = (0, n.isMagicConnector)(O.id),
                i = (0, f.getProxyAddress)(k, "depositWallet"),
                o = j ? .proxyWallet ? .toLowerCase() === i.toLowerCase() || D ? .toLowerCase() === i.toLowerCase(),
                s = a ? "magic" : "eoa",
                l = o ? "depositWallet" : a ? "proxy" : "safe",
                u = o ? "depositWallet" : O.id;S[30] !== u || S[31] !== k ? (e = (0, f.getProxyAddress)(k, u), S[30] = u, S[31] = k, S[32] = e) : e = S[32];
            let d = e;S[33] !== s || S[34] !== l || S[35] !== d || S[36] !== k || S[37] !== O || S[38] !== F || S[39] !== L ? (t = {
                address: k,
                proxyAddress: d,
                authenticationType: s,
                walletMode: l,
                connector: O,
                isConnecting: L,
                isConnected: F
            }, S[33] = s, S[34] = l, S[35] = d, S[36] = k, S[37] = O, S[38] = F, S[39] = L, S[40] = t) : t = S[40],
            C = t
        }
        let {
            address: z,
            proxyAddress: B,
            authenticationType: q,
            walletMode: W,
            connector: Z,
            isConnected: V,
            isConnecting: K
        } = C;
        return S[41] !== z || S[42] !== q || S[43] !== N || S[44] !== M || S[45] !== Z || S[46] !== V || S[47] !== K || S[48] !== $ || S[49] !== U || S[50] !== B || S[51] !== R || S[52] !== W ? (E = {
            address: z,
            proxyAddress: B,
            authenticationType: q,
            walletMode: W,
            connector: Z,
            status: R,
            isConnecting: K,
            isConnected: V,
            isReconnecting: U,
            isDisconnected: $,
            chain: N,
            chainId: M
        }, S[41] = z, S[42] = q, S[43] = N, S[44] = M, S[45] = Z, S[46] = V, S[47] = K, S[48] = $, S[49] = U, S[50] = B, S[51] = R, S[52] = W, S[53] = E) : E = S[53], E
    }

    function m() {}
}, 832565, e => {
    "use strict";
    e.s(["SafeContextProvider", () => m, "useSafeContext", () => y], 832565);
    var t = e.i(221628),
        r = e.i(999061),
        n = e.i(964974),
        a = e.i(416340),
        i = e.i(510954),
        o = e.i(57096),
        s = e.i(368342),
        l = e.i(53950),
        c = e.i(566515),
        u = e.i(721270),
        d = e.i(246290);

    function f(e) {
        return e.setMisroutedEoa
    }

    function p(e) {
        return e.misroutedEoas
    }
    let h = a.default.createContext(null),
        m = e => {
            let m, y, g, b, v, x, w = (0, r.c)(14),
                {
                    children: _
                } = e,
                {
                    proxyAddress: C,
                    walletMode: E
                } = (0, d.useAccount)();
            (() => {
                let e, t, n, i = (0, r.c)(10),
                    {
                        address: o,
                        walletMode: h,
                        proxyAddress: m,
                        isConnected: y,
                        isReconnecting: g
                    } = (0, d.useAccount)(),
                    {
                        isLoggedIn: b,
                        isLoggedInPending: v
                    } = (0, c.useAuthenticationContext)(),
                    x = (0, s.useMisroutedDepositWalletStore)(f),
                    w = (0, s.useMisroutedDepositWalletStore)(p);
                i[0] !== o || i[1] !== w ? (e = !!o && !!w[o.toLowerCase()], i[0] = o, i[1] = w, i[2] = e) : e = i[2];
                let _ = e,
                    C = b && !v && y && !g && !!o && "depositWallet" === h;
                i[3] !== o || i[4] !== _ || i[5] !== C || i[6] !== m || i[7] !== x ? (t = () => {
                    if (!C || !o || _) return;
                    let e = !1;
                    return (async () => {
                        let t, r = (0, u.getProxyAddress)(o, "eoa");
                        try {
                            t = await (0, u.isSafeDeployedOnChain)(r)
                        } catch (e) {
                            l.logger.warn("[misrouted-deposit-wallet] safe-deployed check failed; skipping detection", {
                                eoa: o,
                                safeAddress: r,
                                errorMessage: e instanceof Error ? e.message : String(e)
                            });
                            return
                        }
                        e || t && (l.logger.info("[misrouted-deposit-wallet] EOA in deposit wallet flow with deployed Safe detected", {
                            eoa: o,
                            depositWallet: m,
                            safe: r
                        }), x(o, !0))
                    })(), () => {
                        e = !0
                    }
                }, n = [o, m, _, C, x], i[3] = o, i[4] = _, i[5] = C, i[6] = m, i[7] = x, i[8] = t, i[9] = n) : (t = i[8], n = i[9]), a.default.useEffect(t, n)
            })(), w[0] !== C ? (m = i.queryKeys[o.QueryKey.Auth].safeDeployed(C), w[0] = C, w[1] = m) : m = w[1], w[2] !== C ? (y = () => (0, u.isSafeDeployedOnChain)(C), w[2] = C, w[3] = y) : y = w[3];
            let S = !!C && "safe" === E;
            w[4] === Symbol.for("react.memo_cache_sentinel") ? (g = {
                persist: !0
            }, w[4] = g) : g = w[4], w[5] !== m.queryKey || w[6] !== y || w[7] !== S ? (b = {
                queryKey: m.queryKey,
                queryFn: y,
                enabled: S,
                gcTime: 0x7fffffff,
                staleTime: 0x7fffffff,
                meta: g
            }, w[5] = m.queryKey, w[6] = y, w[7] = S, w[8] = b) : b = w[8];
            let {
                data: A
            } = (0, n.useQuery)(b), I = !!A;
            w[9] !== I ? (v = {
                isSafeDeployed: I
            }, w[9] = I, w[10] = v) : v = w[10];
            let T = v;
            return w[11] !== _ || w[12] !== T ? (x = (0, t.jsx)(h.Provider, {
                value: T,
                children: _
            }), w[11] = _, w[12] = T, w[13] = x) : x = w[13], x
        },
        y = () => {
            let e = a.default.useContext(h);
            if (!e) throw Error("useSafeContext Hook must be inside a Provider.");
            return e
        }
}, 603580, e => {
    "use strict";
    e.s(["SiwxContextProvider", () => d, "useSiwxContext", () => f]);
    var t = e.i(221628),
        r = e.i(213333),
        n = e.i(416340),
        a = e.i(631222),
        i = e.i(827681),
        o = e.i(846170),
        s = e.i(566515),
        l = e.i(44071),
        c = e.i(832565);
    let u = n.default.createContext(null),
        d = ({
            enabled: e = !0,
            debugMode: d = !1,
            language: f = "en-US",
            walletConnectCTA: p = "both",
            hideRecentBadge: h = !1,
            walletConnectName: m,
            bufferPolyfill: y = !0,
            initialChainId: g = a.MATIC_CONFIG.chainId,
            enforceSupportedChains: b = !0,
            nonceRefetchInterval: v = 9e5,
            isLoggedInRefetchInterval: x = 9e5,
            signOutOnDisconnect: w = !0,
            signOutOnAccountChange: _ = !1,
            signOutOnNetworkChange: C = !1,
            children: E
        }) => {
            let S = n.default.useMemo(() => ({
                    language: f,
                    walletConnectCTA: p,
                    hideRecentBadge: h,
                    walletConnectName: m,
                    bufferPolyfill: y,
                    initialChainId: g,
                    enforceSupportedChains: b,
                    nonceRefetchInterval: v,
                    isLoggedInRefetchInterval: x,
                    signOutOnDisconnect: w,
                    signOutOnAccountChange: _,
                    signOutOnNetworkChange: C
                }), [f, p, h, m, y, g, b, v, x, w, _, C]),
                [A, I] = n.default.useState(i.AuthenticationStatusStates.PERSISTING),
                [T, k] = n.default.useState({
                    id: "",
                    name: void 0,
                    coercedConnector: void 0
                }),
                [O, R] = n.default.useState(!1),
                [N, M] = n.default.useState(i.AuthRoute.CONNECTORS),
                [P, D] = n.default.useState(i.ConnectorRoute.LOGIN),
                [j, L] = n.default.useState(i.OnboardingRoute.CREATEACCOUNT),
                [F, U] = n.default.useState(i.ConnectorStates.RECONNECTING),
                [$, z] = n.default.useState("en-US"),
                [B, q] = n.default.useState(!1),
                [W, Z] = n.default.useState(""),
                {
                    lastConnectorId: V,
                    updateLastConnectorId: K
                } = (0, o.useSingletonLastConnector)(),
                [H, G] = n.default.useState(0),
                Q = n.default.useCallback(() => {
                    G(e => e + 1)
                }, [G]),
                J = n.default.useRef(null),
                Y = n.default.useRef(null),
                X = (0, r.usePrevious)(O);
            n.default.useEffect(() => {
                let e;
                if (!O && X) {
                    let t = A === i.AuthenticationStatusStates.REJECTED || A === i.AuthenticationStatusStates.ERROR || A === i.AuthenticationStatusStates.ACCOUNT_DELETED ? i.AuthenticationStatusStates.IDLE : void 0,
                        r = F === i.ConnectorStates.REJECTED || F === i.ConnectorStates.FAILED || F === i.ConnectorStates.UNAVAILABLE ? i.ConnectorStates.DISCONNECTED : void 0;
                    e = setTimeout(() => {
                        M(i.AuthRoute.CONNECTORS), q(!1), r && U(r), t && I(t)
                    }, 500)
                }
                return () => {
                    e && clearTimeout(e)
                }
            }, [O]);
            let ee = n.default.useMemo(() => ({
                connector: T,
                connectorRoute: P,
                connectorStatus: F,
                debugMode: d,
                displayError: e => {
                    Z(e)
                },
                enabled: e,
                errorMessage: W,
                lang: $,
                lastConnectorId: V,
                magicOauthPendingTimeout: Y,
                magicOauthRedirectTimeout: J,
                onboardingRoute: j,
                open: O,
                options: S,
                preventClose: B,
                resize: H,
                route: N,
                setConnector: k,
                setConnectorRoute: D,
                setConnectorStatus: U,
                setErrorMessage: Z,
                setLang: z,
                setOnboardingRoute: L,
                setOpen: R,
                setPreventClose: q,
                setRoute: M,
                triggerResize: Q,
                updateLastConnectorId: K,
                ready: !0,
                authenticationStatus: A,
                setAuthenticationStatus: I
            }), [T, P, F, d, e, W, $, V, Y, J, j, O, S, B, H, N, k, D, U, Z, z, L, R, q, M, K, Q, A, I]);
            return (0, t.jsx)(u.Provider, {
                value: ee,
                children: (0, t.jsx)(s.AuthenticationContextProvider, {
                    children: (0, t.jsx)(c.SafeContextProvider, {
                        children: (0, t.jsx)(l.ConnectorContextProvider, {
                            children: E
                        })
                    })
                })
            })
        },
        f = () => {
            let e = n.default.useContext(u);
            if (!e) throw Error("useSiwxContext Hook must be inside a Provider.");
            return e
        }
}, 635672, e => {
    "use strict";
    let t = "pm_session_hint";
    e.s(["clearSessionHint", 0, () => {
        "u" > typeof document && (document.cookie = `${t}=; path=/; max-age=0; SameSite=Lax`)
    }, "getSessionHint", 0, () => {
        if ("u" < typeof document) return;
        let e = document.cookie.match(RegExp(`(?:^|; )${t}=([^;]+)`));
        if (!e ? .[1]) return;
        let [r, n] = e[1].split(":");
        if (r ? .startsWith("0x") && ("magic" === n || "eoa" === n)) return {
            address: r,
            type: n
        }
    }, "setSessionHint", 0, (e, r) => {
        "u" > typeof document && (document.cookie = `${t}=${e}:${r}; path=/; max-age=604800; SameSite=Lax`)
    }])
}, 752794, e => {
    "use strict";
    e.s(["useAccountState", () => l]);
    var t = e.i(416340),
        r = e.i(134709),
        n = e.i(827681),
        a = e.i(566515),
        i = e.i(603580),
        o = e.i(635672),
        s = e.i(246290);
    let l = () => {
        let e = (0, r.default)(),
            {
                connectorStatus: l,
                authenticationStatus: c
            } = (0, i.useSiwxContext)(),
            {
                authenticatedUser: u,
                isLoggedIn: d,
                isLoggedInPending: f
            } = (0, a.useAuthenticationContext)(),
            {
                address: p,
                proxyAddress: h,
                authenticationType: m,
                walletMode: y,
                status: g
            } = (0, s.useAccount)({
                optimisticMagic: !0
            }),
            b = t.default.useRef(void 0);
        return e && void 0 === b.current && (b.current = !!(0, o.getSessionHint)()), t.default.useMemo(() => {
            let t = l === n.ConnectorStates.RECONNECTING || "reconnecting" === g && !p,
                r = f || c === n.AuthenticationStatusStates.PERSISTING;
            if (e) {
                let e = !!u ? .address && !!p && u.address.toLowerCase() === p.toLowerCase();
                if (p && u && e && d && l === n.ConnectorStates.CONNECTED && c === n.AuthenticationStatusStates.SUCCESS) return {
                    baseAddress: p,
                    proxyAddress: h,
                    authenticated: !0,
                    isSessionLoading: t || r,
                    authenticationType: m,
                    walletMode: y
                }
            }
            let a = b.current ? ? !0;
            return {
                baseAddress: void 0,
                proxyAddress: void 0,
                authenticated: !1,
                isSessionLoading: !e || (t || r) && a,
                authenticationType: void 0,
                walletMode: void 0
            }
        }, [p, h, m, y, u, e, c, l, d, f, g])
    }
}, 5146, 193790, e => {
    "use strict";
    e.s(["default", () => y, "getChainSpecificUsdcAddress", () => m], 5146);
    var t = e.i(914640),
        r = e.i(318594),
        n = e.i(416340),
        a = e.i(196593),
        i = e.i(752794);
    e.s(["default", () => d], 193790);
    var o = e.i(999061),
        s = e.i(964974),
        l = e.i(510954),
        c = e.i(57096),
        u = e.i(631222);
    let d = (e, t) => {
        let n, a, d, f, p = (0, o.c)(12),
            h = (0, r.useQueryClient)(),
            {
                proxyAddress: m
            } = (0, i.useAccountState)(),
            y = e ? ? u.MATIC_CONFIG.chainId;
        p[0] !== y || p[1] !== m ? (n = l.queryKeys[c.QueryKey.PendingTransactions].count(m, y), p[0] = y, p[1] = m, p[2] = n) : n = p[2], p[3] !== y || p[4] !== m || p[5] !== h ? (a = () => h.getQueryData(l.queryKeys[c.QueryKey.PendingTransactions].count(m, y).queryKey) || 0, p[3] = y, p[4] = m, p[5] = h, p[6] = a) : a = p[6];
        let g = !!m && (void 0 === t || t);
        p[7] === Symbol.for("react.memo_cache_sentinel") ? (d = {
            persist: !0
        }, p[7] = d) : d = p[7], p[8] !== n.queryKey || p[9] !== a || p[10] !== g ? (f = {
            queryKey: n.queryKey,
            queryFn: a,
            enabled: g,
            refetchOnWindowFocus: !0,
            refetchOnReconnect: !0,
            gcTime: 864e5,
            meta: d,
            placeholderData: 0
        }, p[8] = n.queryKey, p[9] = a, p[10] = g, p[11] = f) : f = p[11];
        let {
            data: b
        } = (0, s.useQuery)(f);
        return b || 0
    };
    var f = e.i(53950),
        p = u,
        h = e.i(493164);
    let m = e => {
            switch (e) {
                case 1:
                    return "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48";
                case 137:
                    return p.USDC_ADDRESS;
                case 80001:
                    return "0x40fa79E4Cab51e11F935760BCFdA90662d418D74";
                default:
                    throw Error(`Unsupported chainId: ${e}`)
            }
        },
        y = (e, o = p.MATIC_CONFIG.chainId, s = {}) => {
            let u = (0, r.useQueryClient)(),
                {
                    proxyAddress: y,
                    isSessionLoading: g
                } = (0, i.useAccountState)(),
                b = d(o, !s.disablePendingTxnSubscription),
                v = (0, n.useRef)(void 0),
                x = e ? ? y,
                {
                    data: w,
                    isFetching: _,
                    isLoading: C,
                    isPending: E,
                    isFetched: S
                } = (0, h.default)(x ? ? t.zeroAddress, m(o), o, p.USDC_DECIMALS, { ...s,
                    pendingTxnCount: b,
                    ...!s ? .staleTime && 0 === b && {
                        staleTime: 3e5
                    },
                    enabled : (s ? .enabled ? ? !0) && !!x
                });
            (0, n.useEffect)(() => {
                if (!x || w.current >= 0) {
                    v.current = void 0;
                    return
                }
                let e = [x, o, w.current, w.pending, b].join(":");
                v.current !== e && (v.current = e, f.logger.warn("[useTrackedProxyUSDCBalance] negative cash balance", {
                    proxyAddress: x,
                    chainId: o,
                    current: w.current,
                    pending: w.pending,
                    pendingTxnCount: b,
                    isFetched: S,
                    isFetching: _
                }))
            }, [x, o, w, b, S, _]);
            let A = (0, n.useCallback)(async () => {
                    0 === b && await u.invalidateQueries({
                        queryKey: l.queryKeys[c.QueryKey.TokenBalance].token(e ? ? y ? ? t.zeroAddress, m(o), o).queryKey
                    })
                }, [b, u, o, e, y]),
                I = (0, n.useMemo)(() => ({
                    pendingBalance: (0, a.formatCurrency)(w.pending, {
                        decimals: 2
                    }),
                    currentBalance: (0, a.formatCurrency)(w.current > 1e3 ? Math.round(w.current) : w.current, {
                        decimals: 2
                    }),
                    presentationalPendingBalance: (0, a.formatCurrency)(Math.abs(w.pending), {
                        decimals: 2
                    }),
                    pendingDirectionDescription: w.pending > .001 ? "Incoming USDC" : w.pending < -.001 ? "Outgoing USDC" : "Pending USDC"
                }), [w]),
                T = (0, n.useMemo)(() => b > 0 && Math.abs(w.pending) > .001, [b, w]);
            return {
                trackedProxyUsdcBalance: w,
                proxyUsdcBalanceMetadata: I,
                refreshTrackedProxyUsdcBalance: A,
                hasPendingProxyUsdcBalance: T,
                isProxyUsdcBalanceLoading: C || g,
                isProxyUsdcBalancePending: E || g,
                isProxyUsdcBalanceFetching: _,
                isProxyUsdcBalanceFetched: S
            }
        }
}, 17812, 261414, 483008, 552442, 955547, 669448, 560993, 416671, 165789, 599944, 582803, 451464, 85462, 905778, 164444, 981974, 420641, 940110, 917503, 349808, 464332, 721266, 926609, 267673, 216056, 948938, e => {
    "use strict";
    e.i(284553);
    let t = e => {
        try {
            let t = new WeakSet;
            return JSON.stringify(e, (e, r) => {
                if ("bigint" == typeof r) return `BigInt(${r.toString()})`;
                if ("object" == typeof r && null !== r) {
                    if (t.has(r)) return "[Circular Reference]";
                    t.add(r)
                }
                return r
            })
        } catch (e) {
            return `[Serialization Error: ${e instanceof Error?e.message:"Unknown safeStringify error"}]`
        }
    };
    class r {
        name;
        replaceConsole;
        enabled;
        constructor(e, t = {}) {
            this.name = e, this.enabled = t.enabled ? ? !0, this.replaceConsole = t.replaceConsole ? ? !1
        }
        init() {}
        authenticate(e) {}
    }
    let n = e => "http" === e ? "info" : "verbose" === e ? "debug" : e;
    class a extends r {
        constructor(e = {}) {
            super("console", { ...e
            })
        }
        log(e) {
            let r, a;
            n(e.level);
            let i = (r = e.formattedMessage, a = e.context, `${r}${a?`: ${t(a)}`:""}`),
                o = n(e.level);
            "error" === o ? console.error(i) : "warn" === o ? console.warn(i) : "info" === o ? console.info(i) : console.debug(i)
        }
    }
    class i extends r {
        config;
        groundcover;
        initPromise;
        isDisabled = !1;
        queuedUser;
        constructor(e) {
            super("groundcover", {
                replaceConsole: e.replaceConsole ? ? !0
            }), this.config = e
        }
        init() {
            !this.isDisabled && (this.initPromise || (this.initPromise = this.#d()))
        }
        authenticate(e) {
            this.queuedUser = e, this.#f(e)
        }
        log(e) {
            this.isDisabled || (this.init(), this.#p(e))
        }
        async# d() {
            try {
                let e = await this.#h();
                if (!e) return;
                let {
                    initialize: t = !0,
                    globalContext: r,
                    ...n
                } = this.config.options;
                t && e.init(n), this.queuedUser && e.identifyUser(this.queuedUser)
            } catch {
                this.isDisabled = !0
            }
        }
        async# h() {
            return this.groundcover || (this.groundcover = e.A(970454).then(e => e.default).catch(() => null)), this.groundcover
        }
        async# p(e) {
            let t = await this.#h();
            if (!t) return;
            let r = { ...this.config.options.globalContext,
                ...e.context,
                level: e.level,
                scope: e.scope,
                title: e.title,
                message: e.message,
                formattedMessage: e.formattedMessage
            };
            if ("error" === e.level) {
                let n;
                return void t.captureException((n = e.context ? .error) instanceof Error ? n : Error(e.message), r)
            }
            t.sendCustomEvent({
                event: "logger.log",
                attributes: r
            })
        }
        async# f(e) {
            let t = await this.#h();
            t && t.identifyUser(e)
        }
    }
    let o = {
        error: 6,
        warn: 5,
        info: 4,
        http: 3,
        verbose: 2,
        debug: 1
    };
    class s {
        level;
        services;
        transports;
        user;
        consoleTransport;
        serviceTransports;
        lastAuthByTransport = new WeakMap;
        constructor(e) {
            this.level = e.level, this.services = e.services, this.transports = e.transports, this.user = e.user, this.consoleTransport = new a, this.serviceTransports = this.createServiceTransports(this.services)
        }
        configure(e) {
            e.level && (this.level = e.level), void 0 !== e.services && (this.services = e.services, this.serviceTransports = this.createServiceTransports(this.services)), void 0 !== e.transports && (this.transports = e.transports), e.user && (this.user = e.user), (void 0 !== e.services || void 0 !== e.transports) && this.user && this.authenticate(this.user)
        }
        authenticate(e) {
            this.user = e;
            let r = t(e);
            for (let t of this.activeTransports()) this.lastAuthByTransport.get(t) !== r && (this.lastAuthByTransport.set(t, r), t.authenticate(e))
        }
        log({
            scope: e,
            level: t,
            params: r
        }) {
            if (!this.validate(t)) return;
            let n = (({
                    level: e,
                    scope: t,
                    title: r,
                    message: n
                }) => {
                    let a = `[${e}][${t}]`;
                    return r && (a = `${a}[${r}]`), `${a}: ${n}`
                })({
                    level: t,
                    scope: e,
                    title: r.title,
                    message: r.message
                }),
                a = {
                    level: t,
                    scope: e,
                    title: r.title,
                    message: r.message,
                    context: r.context,
                    formattedMessage: n
                };
            for (let e of this.activeTransports()) e.init(), e.log(a)
        }
        validate(e) {
            return o[e] >= o[this.level]
        }
        activeTransports() {
            return (({
                consoleTransport: e,
                serviceTransports: t,
                transports: r
            }) => {
                let n = [...t ? ? [], ...r ? ? []].filter(e => e.enabled),
                    a = n.some(e => e.replaceConsole),
                    i = n.some(e => "console" === e.name);
                return a && !i || i ? n : [e, ...n]
            })({
                consoleTransport: this.consoleTransport,
                serviceTransports: this.serviceTransports,
                transports: this.transports
            }).filter(e => e.enabled)
        }
        createServiceTransports(e) {
            let t = [];
            return e ? .groundcover ? .enabled && t.push(new i(e.groundcover)), t
        }
    }
    class l {
        core;
        scope;
        constructor({
            scope: e,
            core: t
        }) {
            this.core = t, this.scope = e
        }
        debug(e) {
            this.core.log({
                scope: this.scope,
                level: "debug",
                params: e
            })
        }
        info(e) {
            this.core.log({
                scope: this.scope,
                level: "info",
                params: e
            })
        }
        warn(e) {
            this.core.log({
                scope: this.scope,
                level: "warn",
                params: e
            })
        }
        error(e) {
            this.core.log({
                scope: this.scope,
                level: "error",
                params: e
            })
        }
        http(e) {
            this.core.log({
                scope: this.scope,
                level: "http",
                params: e
            })
        }
        verbose(e) {
            this.core.log({
                scope: this.scope,
                level: "verbose",
                params: e
            })
        }
        authenticate(e) {
            this.core.authenticate(e)
        }
        instance(e) {
            return new l({
                scope: e ? ? this.scope,
                core: this.core
            })
        }
        configure(e) {
            e.scope && (this.scope = e.scope), this.core.configure({
                level: e.level,
                services: e.services,
                transports: e.transports,
                user: e.user
            })
        }
        static create({
            scope: e,
            level: t,
            services: r,
            transports: n,
            user: a
        }) {
            return new l({
                scope: e,
                core: new s({
                    level: t,
                    services: r,
                    transports: n,
                    user: a
                })
            })
        }
    }
    async function c(e, t = e => e) {
        return t(await e())
    }
    async function u(e, {
        onSuccess: t,
        onError: r,
        select: n = e => e,
        transformError: a = e => e
    } = {}) {
        try {
            let r = await c(e, n);
            return t ? .(r), r
        } catch (t) {
            let e = a(t);
            throw r ? .(e), e
        }
    }
    e.s(["createLogger", 0, ({
        scope: e,
        level: t,
        config: r
    }) => l.create({
        scope: e,
        level: t,
        ...r ? .groundcover && {
            services: {
                groundcover: (({
                    replaceConsole: e,
                    ...t
                }) => ({
                    enabled: !0,
                    replaceConsole: e,
                    options: t
                }))(r.groundcover)
            }
        }
    })], 17812), e.s(["bindKeyedExecutable", 0, e => function(t, r) {
        let n = ((e, t) => {
                let r = t.split(":"),
                    n = e;
                for (let e of r) {
                    if ("object" != typeof n || null === n) return () => Promise.resolve({
                        status: "failure"
                    });
                    n = n[e]
                }
                return n
            })(new e.client(r.config), t),
            a = r.select || r.onSuccess || r.onError ? {
                select: r.select,
                onSuccess: r.onSuccess,
                onError: r.onError
            } : void 0;
        return "variables" in r && void 0 !== r.variables ? n(r.variables, a) : n(a)
    }], 261414);
    var d, f, p, h = e.i(177217),
        m = e.i(737807);
    class y {}
    class g extends Error {
        type;
        name;
        cause;
        constructor(e) {
            super(e.message), this.type = e.type, this.name = e.name, this.cause = e.cause, e.stack && (this.stack = e.stack), Object.setPrototypeOf(this, new.target.prototype)
        }
    }
    let b = {
        Info: {
            Continue: 100,
            SwitchingProtocols: 101,
            Processing: 102,
            EarlyHints: 103
        },
        Success: {
            OK: 200,
            Created: 201,
            Accepted: 202,
            NonAuthoritativeInformation: 203,
            NoContent: 204,
            ResetContent: 205,
            PartialContent: 206,
            MultiStatus: 207,
            AlreadyReported: 208,
            ImUsed: 226
        },
        Redirect: {
            MultipleChoices: 300,
            MovedPermanently: 301,
            Found: 302,
            SeeOther: 303,
            NotModified: 304,
            UseProxy: 305,
            TemporaryRedirect: 307,
            PermanentRedirect: 308
        },
        ClientError: {
            BadRequest: 400,
            Unauthorized: 401,
            PaymentRequired: 402,
            Forbidden: 403,
            NotFound: 404,
            MethodNotAllowed: 405,
            NotAcceptable: 406,
            ProxyAuthenticationRequired: 407,
            RequestTimeout: 408,
            Conflict: 409,
            Gone: 410,
            LengthRequired: 411,
            PreconditionFailed: 412,
            PayloadTooLarge: 413,
            URITooLong: 414,
            UnsupportedMediaType: 415,
            RangeNotSatisfiable: 416,
            ExpectationFailed: 417,
            ImATeapot: 418,
            MisdirectedRequest: 421,
            UnprocessableEntity: 422,
            Locked: 423,
            FailedDependency: 424,
            TooEarly: 425,
            UpgradeRequired: 426,
            PreconditionRequired: 428,
            TooManyRequests: 429,
            RequestHeaderFieldsTooLarge: 431,
            UnavailableForLegalReasons: 451
        },
        ServerError: {
            Internal: 500,
            NotImplemented: 501,
            BadGateway: 502,
            ServiceUnavailable: 503,
            GatewayTimeout: 504,
            HTTPVersionNotSupported: 505,
            VariantAlsoNegotiates: 506,
            InsufficientStorage: 507,
            LoopDetected: 508,
            BandwidthLimitExceeded: 509,
            NotExtended: 510,
            NetworkAuthenticationRequired: 511
        },
        Other: {
            Unknown: -1
        }
    };
    e.s(["StatusCodes", 0, b], 483008);
    let v = e => {
            let t = e ? .code ? ? e ? .response ? .status;
            if (void 0 !== t && "number" == typeof t) return t;
            if (void 0 !== t && "string" == typeof t) {
                let e = parseInt(t, 10);
                if (Number.isFinite(e) && !Number.isNaN(e)) return e
            }
            return b.Other.Unknown
        },
        x = "RestError";
    class w extends g {
        code;
        url;
        method;
        path;
        statusText;
        response;
        constructor({
            type: e,
            name: t,
            message: r,
            stack: n,
            cause: a,
            code: i,
            url: o,
            method: s,
            path: l,
            statusText: c,
            response: u
        }) {
            super({
                type: e,
                name: t,
                message: r,
                stack: n,
                cause: a
            }), this.code = i, this.url = o, this.method = s, this.path = l, this.statusText = c, this.response = u
        }
        static castFromError(e, t = {}) {
            let {
                type: r = x,
                name: n = "RestError",
                ...a
            } = t;
            return new w({
                type: r,
                name: e.name ? ? n,
                message: e.message,
                stack: e.stack,
                cause: e,
                code: v(e),
                ...a
            })
        }
        static castFromUnknownError(e, t = {}) {
            let {
                type: r = x,
                name: n = "RestError",
                ...a
            } = t;
            return new w({
                type: r,
                name: n,
                message: "An unknown error occurred",
                cause: e,
                code: b.Other.Unknown,
                ...a
            })
        }
        static init(e, t = {}) {
            return e instanceof Error ? w.castFromError(e, t) : w.castFromUnknownError(e, t)
        }
        static instanceOf(e) {
            return e instanceof w
        }
    }
    e.s(["DEFAULT_REST_ERROR_TYPE", 0, x, "RestError", 0, w], 552442);
    let _ = (e, t) => {
            if (!t) return e;
            let r = t.startsWith("Bearer ") ? t : `Bearer ${t}`;
            if ("u" > typeof Headers && e instanceof Headers) return e.set("Authorization", r), e;
            if (Array.isArray(e)) {
                let t = Object.fromEntries(e);
                return t.Authorization = r, t
            }
            return { ...e,
                Authorization: r
            }
        },
        C = e => h.default.isAxiosError(e) ? new w({
            type: x,
            name: e.name ? ? "RestError",
            message: e.message,
            stack: e.stack,
            cause: e,
            code: (e => {
                if (h.default.isAxiosError(e)) {
                    if (e.code) {
                        let t = parseInt(e.code, 10);
                        if (Number.isFinite(t) && !Number.isNaN(t)) return t
                    }
                    if (e.response ? .status && Number.isFinite(e.response.status) && !Number.isNaN(e.response.status)) return e.response.status
                }
                return v(e)
            })(e),
            statusText: e.response ? .statusText,
            url: e.config ? .url,
            method: e.config ? .method,
            response: e.response ? .data,
            transport: "axios"
        }) : w.init(e, {
            transport: "axios"
        });
    class E extends y {
        instance;
        logger;
        constructor({
            instance: e,
            logger: t,
            ...r
        }) {
            super(), this.instance = e ? ? this.createAxiosInstance(r)
        }
        execute(e, t, r = {}) {
            let {
                callbacks: n,
                ...a
            } = r;
            return u(...this.bindRequest(e, t, a))
        }
        bindRequest(e, t, r) {
            let {
                callbacks: n,
                ...a
            } = r;
            return [async () => {
                let r = ((e, t, r) => {
                    if ("post" === e || "put" === e) {
                        let {
                            headers: e,
                            auth: n,
                            params: a,
                            body: i,
                            ...o
                        } = r;
                        return [t, i, {
                            headers: _(e, n ? .token),
                            ...n ? .credentialed && {
                                withCredentials: !0
                            },
                            params : a,
                            ...o
                        }]
                    }
                    let {
                        headers: n,
                        auth: a,
                        params: i,
                        ...o
                    } = r;
                    return [t, {
                        headers: _(n, a ? .token),
                        withCredentials: a ? .credentialed,
                        params: i,
                        ...o
                    }]
                })(e, t, a);
                return await this.instance[e](...r)
            }, {
                select: e => ({
                    status: e.status,
                    data: e.data
                }),
                onSuccess: r => {
                    n ? .onSuccess ? .({
                        data: r.data,
                        variables: { ...a
                        }
                    }), this.log("debug", e, {
                        path: t,
                        ...a
                    })
                },
                onError: r => {
                    n ? .onError ? .({
                        error: r,
                        variables: { ...a
                        }
                    }), this.log("error", e, {
                        path: t,
                        ...a,
                        error: r
                    })
                },
                transformError: C
            }]
        }
        log(e, t, r) {
            this.logger && this.logger[e]({
                title: `RestClient > ${t}`,
                message: "debug" === e ? "Request succeeded" : "Request failed",
                context: r
            })
        }
        createAxiosInstance({
            url: e,
            options: t
        }) {
            let r = h.default.create({
                baseURL: e,
                ...t
            });
            return t ? .retries ? .enabled && (0, m.default)(r, {
                retries: t.retries.count,
                retryDelay: t.retries.delay
            }), t ? .interceptors ? .request ? .length && t.interceptors.request.forEach(e => {
                r.interceptors.request.use(e)
            }), t ? .interceptors ? .response ? .length && t.interceptors.response.forEach(e => {
                r.interceptors.response.use(e)
            }), r
        }
    }
    e.s(["RestClient", 0, class {
        transport;
        constructor(e) {
            if ("axios" === e.transport.type) this.transport = new E({
                url: e.url,
                logger: e.logger,
                ...e.transport.options
            });
            else throw Error(`Transport type ${e.transport.type} not supported`)
        }
        async get({
            path: e,
            options: t = {}
        }) {
            return this.transport.execute("get", e, t)
        }
        async put({
            path: e,
            options: t
        }) {
            return this.transport.execute("put", e, t)
        }
        async post({
            path: e,
            options: t
        }) {
            return this.transport.execute("post", e, t)
        }
        async delete({
            path: e,
            options: t
        }) {
            return this.transport.execute("delete", e, t)
        }
    }], 955547);
    let S = e => "object" == typeof e && null !== e && ("select" in e || "onSuccess" in e || "onError" in e),
        A = (e, t) => 0 === e.length && void 0 === t ? new e : new e(t),
        I = (e, t) => {
            let r = (e, r, n) => t(e, ((e, t) => {
                    let r = S(e) ? e : void 0,
                        n = r ? {
                            onSuccess: ({
                                data: e
                            }) => {
                                r.onSuccess ? .({
                                    data: e,
                                    variables: t
                                })
                            },
                            onError: ({
                                error: e
                            }) => {
                                r.onError ? .({
                                    error: e,
                                    variables: t
                                })
                            }
                        } : void 0,
                        a = "function" == typeof r ? .select,
                        i = !!(r ? .onSuccess || r ? .onError);
                    if (a || i) return {
                        select: r ? .select,
                        onSuccess: n ? .onSuccess,
                        onError: n ? .onError
                    }
                })(n, r)),
                n = (...t) => {
                    let {
                        rawVariables: n,
                        optionsArg: a
                    } = (e => {
                        let [t, r] = e, n = e.length >= 2 || 1 === e.length && void 0 !== t && !S(t);
                        return {
                            rawVariables: n ? t : void 0,
                            optionsArg: n ? r : t
                        }
                    })(t);
                    return r(A(e, n), n, a)
                };
            return n.request = t => A(e, t), n.execute = (e, t, n) => r(e, t, n), n
        };
    e.s(["bindRequest", 0, I], 669448);
    let T = ({
        module: e,
        logger: t
    }) => (r, n, a) => {
        t && t[r]({
            title: (({
                module: e,
                operation: t
            }) => e ? `${e} > ${t}` : t)({
                module: e,
                operation: n
            }),
            message: "info" === r ? "Request succeeded" : "Request failed",
            context: a
        })
    };
    e.s(["createRequestLog", 0, T], 560993);
    let k = e => (e.prepare = (...t) => {
        let r = t[0],
            n = e.request(r);
        return {
            key: n.key,
            execute: (t, a) => e.execute(n, { ...r ? ? {},
                ...t ? ? {}
            }, a),
            request: n
        }
    }, e);

    function O(e, t) {
        return t ? k(I(e, t)) : k(e)
    }
    e.s(["withPrepare", 0, O], 416671);
    var R = ((d = R || {}).Build = "BuildRequestError", d.Execute = "ExecuteRequestError", d.Parse = "ParseResponseError", d.Select = "SelectResponseError", d.Callbacks = "CallbacksError", d.Log = "LogError", d.Success = "SuccessError", d);
    class N extends w {
        constructor({
            type: e,
            name: t,
            message: r,
            stack: n,
            cause: a,
            code: i,
            url: o,
            method: s,
            path: l,
            statusText: c,
            response: u
        }) {
            super({
                type: e,
                name: t,
                message: r,
                stack: n,
                cause: a,
                code: i,
                url: o,
                method: s,
                path: l,
                statusText: c,
                response: u
            })
        }
        static init(e, t = {}) {
            let {
                type: r = "RequestError",
                name: n = "RequestError",
                ...a
            } = t, i = w.init(e, {
                type: r,
                name: n,
                ...a
            });
            return N.castRestError(i)
        }
        static instanceOf(e) {
            return e instanceof N
        }
        static castRestError(e) {
            return new N(e)
        }
    }

    function M(e) {
        return "object" == typeof e && null !== e && ("select" in e || "onSuccess" in e || "onError" in e)
    }
    class P {
        operation;
        build;
        request;
        parse;
        log;
        constructor(e) {
            this.operation = e.operation, this.build = e.build, this.request = e.request, this.parse = e.parse, this.log = e.log
        }
        async execute(e, t, r = e => e) {
            let n = R.Build;
            try {
                n = R.Build;
                let a = this.build(e);
                n = R.Execute;
                let i = await this.request(a);
                n = R.Parse;
                let o = this.parse(i);
                n = R.Select;
                let s = r(o);
                return n = R.Callbacks, t ? .onSuccess ? .({
                    data: s,
                    variables: e
                }), n = R.Log, this.log ? .("info", this.operation, {
                    variables: e
                }), n = R.Success, {
                    status: "success",
                    data: s
                }
            } catch (a) {
                let r = N.instanceOf(a) ? a : N.init(a, {
                    name: n
                });
                return t ? .onError ? .({
                    error: r,
                    variables: e
                }), this.log ? .("error", this.operation, {
                    variables: e,
                    error: r,
                    step: n
                }), {
                    status: "failure",
                    error: r
                }
            }
        }
    }

    function D(e) {
        let {
            log: t,
            operation: r,
            build: n = e => e,
            request: a,
            parse: i = e => e
        } = e, o = new P({
            operation: r,
            build: n,
            request: a,
            parse: i,
            log: t
        });
        return (...e) => {
            let [t, r] = e, n = e.length >= 2 || 1 === e.length && void 0 !== t && !M(t), a = n ? r : t, i = M(a) ? a : void 0, s = "function" == typeof i ? .select ? i.select : void 0, l = "function" == typeof i ? .onSuccess || "function" == typeof i ? .onError ? {
                onSuccess: i ? .onSuccess,
                onError: i ? .onError
            } : void 0, c = (n ? t : void 0) ? ? void 0;
            return s ? o.execute(c, l, s) : o.execute(c, l)
        }
    }
    e.s(["createRequest", 0, D], 165789);
    let j = e => ({
        type: "magic" === e.type ? "magic" : "eoa",
        address: e.address
    });
    var L = ((f = {}).Intl = "international", f.US = "us", f);
    class F {
        environment;
        id;
        trackedId;
        constructor(e) {
            const {
                id: t = crypto.randomUUID(),
                environment: r = L.Intl,
                trackedId: n
            } = e ? ? {};
            this.environment = r, this.id = t, this.trackedId = n
        }
    }
    class U extends F {
        constructor(e) {
            super({ ...e,
                id: e ? .id ? ? crypto.randomUUID()
            })
        }
    }
    class $ extends U {
        token;
        auth;
        variables;
        constructor(e) {
            super();
            const t = e ? ? {};
            this.variables = { ...t,
                auth: void 0,
                ..."token" in t && "string" == typeof t.token && {
                    token: t.token
                }
            }, this.auth = t.auth, "token" in t && "string" == typeof t.token ? this.token = t.token : this.token = ""
        }
        initializeRequest(e = {}) {
            let t, {
                    credentialed: r = !1,
                    initialParams: n = new URLSearchParams,
                    exclude: a = []
                } = e,
                i = new URLSearchParams(n);
            return a.includes("id") || this.auth ? .id === void 0 || i.set("id", this.auth.id), a.includes("address") || this.auth ? .address === void 0 || i.set("address", this.auth.address), this.auth ? .token !== void 0 && (t = this.auth.token), this.token && "" !== this.token && (t = this.token), {
                params: i,
                auth: {
                    credentialed: r,
                    ...t && {
                        token: t
                    }
                }
            }
        }
    }
    e.s(["GammaApiRequest", 0, $], 599944);
    class z extends $ {
        constructor(e = {}) {
            super(e)
        }
        encode() {
            return {
                path: "/logout",
                options: this.initializeRequest({
                    credentialed: !0
                })
            }
        }
        execute({
            client: e
        }) {
            return e.get(this.encode())
        }
        get path() {
            return "/logout"
        }
        get key() {
            return ["logout"]
        }
    }
    class B extends $ {
        constructor(e = {}) {
            super(e)
        }
        encode() {
            return {
                path: "/nonce",
                options: this.initializeRequest({
                    credentialed: !0
                })
            }
        }
        execute({
            client: e
        }) {
            return e.get(this.encode())
        }
        get path() {
            return "/nonce"
        }
        get key() {
            return ["nonce"]
        }
    }
    class q extends $ {
        constructor(e = {}) {
            super(e)
        }
        encode() {
            return {
                path: "/is-logged-in",
                options: this.initializeRequest({
                    credentialed: !0
                })
            }
        }
        execute({
            client: e
        }) {
            return e.get(this.encode())
        }
        get path() {
            return "/is-logged-in"
        }
        get key() {
            return ["session"]
        }
    }
    class W extends $ {
        encode() {
            let e = this.initializeRequest({
                credentialed: !0
            });
            return {
                path: this.path,
                options: e
            }
        }
        execute({
            client: e
        }) {
            return e.get(this.encode())
        }
        get path() {
            return "/login"
        }
        get key() {
            return ["login"]
        }
    }
    e.s(["AuthClient", 0, class {
        constructor({
            client: e,
            logger: t
        }) {
            const r = T({
                module: "auth",
                logger: t
            });
            this.login = O(I(W, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "login",
                request: t => t.execute({
                    client: e
                }),
                parse: e => j(e.data)
            }))({
                client: e,
                log: r
            }))), this.logout = O(I(z, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "logout",
                request: t => (t ? ? new z).execute({
                    client: e
                }),
                parse: e => e.data
            }))({
                client: e,
                log: r
            }))), this.nonce = O(I(B, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "nonce",
                request: t => (t ? ? new B).execute({
                    client: e
                }),
                parse: e => e.data.nonce
            }))({
                client: e,
                log: r
            }))), this.session = O(I(q, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "session",
                request: t => (t ? ? new q).execute({
                    client: e
                }),
                parse: e => j(e.data)
            }))({
                client: e,
                log: r
            })))
        }
        login;
        logout;
        nonce;
        session
    }], 582803);
    let Z = e => {
            if (0 !== e.length) try {
                return [...e].sort((e, t) => {
                    let r = e.createdAt ? new Date(e.createdAt).getTime() : 0,
                        n = t.createdAt ? new Date(t.createdAt).getTime() : 0;
                    return r - n
                })[0]
            } catch {
                if (e.length > 0) return e[0];
                return
            }
        },
        V = (e, t) => {
            let r = new Set,
                n = [];
            for (let a of e) r.has(a[t]) || (r.add(a[t]), n.push(a));
            return n
        },
        K = (e, t) => {
            if (Array.isArray(e)) return e;
            if (!e) return t;
            try {
                return JSON.parse(e)
            } catch {
                return t
            }
        },
        H = e => ({ ...e,
            markets: (e.markets ? ? []).map(({
                outcomes: e,
                outcomePrices: t,
                clobTokenIds: r,
                ...n
            }) => ({ ...n,
                outcomes: K(e, ["yes", "no"]),
                outcomePrices: K(t, ["0.5", "0.5"]),
                clobTokenIds: K(r, null)
            }))
        }),
        G = (e, t = {
            deduplicate: !0
        }) => {
            if (!Array.isArray(e)) return [];
            let r = e.map(e => H(e));
            return t.deduplicate ? V(r, "id") : r
        },
        Q = e => {
            if (Array.isArray(e.data)) return {
                events: G(e.data),
                hasMore: !1,
                totalResults: e.data.length,
                tags: []
            };
            let {
                data: t,
                pagination: r,
                tags: n
            } = e.data;
            return {
                events: G(t ? ? []),
                hasMore: !!r ? .hasMore,
                totalResults: r ? .totalResults ? ? t ? .length ? ? 0,
                tags: n ? ? []
            }
        },
        J = e => {
            let {
                events: t = [],
                tags: r,
                hasMore: n
            } = e, a = V(t, "id"), i = (r ? ? []).map(e => ({
                id: e.id,
                label: e.label,
                slug: e.slug,
                forceShow: !1
            }));
            return {
                events: a,
                hasMore: n,
                totalResults: a.length,
                tags: i
            }
        };
    class Y extends $ {
        encode() {
            let {
                params: e,
                ...t
            } = this.initializeRequest();
            return this.variables.includeLiveChat && e.set("include_chat", "true"), {
                path: this.path,
                options: {
                    params: e,
                    ...t
                }
            }
        }
        execute({
            client: e
        }) {
            return e.get(this.encode())
        }
        get path() {
            return "id" in this.variables ? `/events/${this.variables.id}` : `/events/slug/${this.variables.slug}`
        }
        get key() {
            return "id" in this.variables ? ["get-event", "id", this.variables.id.toString()] : ["get-event", "slug", this.variables.slug]
        }
    }

    function X(e) {
        return null === e ? "null" : void 0 === e ? "undefined" : "string" == typeof e ? e : "number" == typeof e || "boolean" == typeof e || "bigint" == typeof e ? String(e) : e instanceof Date ? e.toISOString() : String(e)
    }

    function ee(e, t = "") {
        if (void 0 === e) return t ? [`${t}=undefined`] : [];
        if (null === e || "object" != typeof e || e instanceof Date) return t ? [`${t}=${X(e)}`] : [X(e)];
        if (e instanceof URLSearchParams) return (!e ? [] : Array.from(e.entries()).sort(([e, t], [r, n]) => e === r ? t.localeCompare(n) : e.localeCompare(r))).map(([e, r]) => {
            let n = t ? `${t}.${e}` : e;
            return `${n}=${r}`
        });
        if (Array.isArray(e)) {
            let r = t ? `${t}[]` : "[]";
            return e.flatMap(e => ee(e, r))
        }
        let r = Object.keys(e).filter(t => {
            let r = e[t];
            return void 0 !== r && "function" != typeof r
        });
        return r.sort((e, t) => e.localeCompare(t)), r.flatMap(r => {
            let n = t ? `${t}.${r}` : r;
            return ee(e[r], n)
        })
    }

    function et(e, t) {
        return (t ? .length ? t.flatMap(t => ee(function(e, t) {
            if (!t) return e;
            let r = t.split(".").filter(Boolean),
                n = e;
            for (let e of r) {
                if (null == n || "object" != typeof n) return;
                n = n[e]
            }
            return n
        }(e, t), t)) : ee(e)).map(e => String(e)).sort((e, t) => e.localeCompare(t))
    }
    var er = e.i(93257);
    let en = ({
            limit: e,
            page: t,
            offset: r,
            overrides: n
        }) => n ? .cursor !== void 0 ? n.cursor : er.Buffer.from((void 0 === r && void 0 !== t ? t * e : r ? ? 0).toString()).toString("base64"),
        ea = {
            cursor: e => {
                let {
                    limit: t = 0,
                    ...r
                } = e;
                return {
                    next_cursor: e.overrides ? .cursor ? ? en({
                        limit: t,
                        ...r
                    })
                }
            },
            "cursor-page": e => {
                let {
                    limit: t = 0,
                    ...r
                } = e;
                return {
                    next_cursor: e.overrides ? .cursor ? ? en({
                        limit: t,
                        ...r
                    }),
                    page_size: e.overrides ? .limit ? ? `${t}`
                }
            },
            offset: e => {
                let {
                    limit: t = 0
                } = e;
                return {
                    offset: e.overrides ? .offset ? ? `${(e=>{let{limit:t=0,page:r,offset:n}=e;return void 0!==n?n:(r??1)*t})(e)}`,
                    limit: e.overrides ? .limit ? ? `${t}`
                }
            },
            page: e => {
                let {
                    limit: t = 0
                } = e;
                return {
                    page: e.overrides ? .page ? ? `${(e=>{let{limit:t=0,page:r,offset:n}=e;return 0===t?0:void 0!==r?r:(n??0)/(t??1)})(e)}`,
                    limit: e.overrides ? .limit ? ? `${t}`
                }
            }
        },
        ei = (e, t, r) => void 0 === e ? e : void 0 !== t && e < t ? t : void 0 !== r && e > r ? r : e,
        eo = ({
            result: e,
            constraints: t
        }) => ({
            limit: ei(e.limit, t ? .min ? .limit, t ? .max ? .limit),
            offset: ei(e.offset, t ? .min ? .offset, t ? .max ? .offset),
            page: ei(e.page, t ? .min ? .page, t ? .max ? .page)
        }),
        es = e => t => {
            Object.entries(e).forEach(([e, r]) => {
                t.set(e, r)
            })
        },
        el = (e, t, r, n = e => e) => {
            r && e.set(t, n(r))
        },
        ec = (e, t, r, n = e => e) => {
            r && e.append(t, n(r))
        },
        eu = (e, t, r, n) => {
            r && r.forEach(r => {
                ec(e, t, r, n)
            })
        };
    e.s(["appendFilter", 0, ec, "appendFilters", 0, eu, "setFilter", 0, el], 451464);
    let ed = {
            "start-date": "startDate",
            "start-time": "startTime",
            "end-date": "endDate",
            "closed-time": "closedTime",
            competitive: "competitive",
            liquidity: "liquidity",
            volume: "volume",
            "daily-volume": "volume24hr"
        },
        ef = {
            monthly: "monthly",
            weekly: "weekly",
            daily: "daily",
            hourly: "hourly"
        },
        ep = e => "asc" === e || "desc" !== e && void 0,
        eh = (e = "active") => "resolved" === e ? "true" : "active" === e ? "false" : void 0;
    class em extends $ {
        encode() {
            var e, t;
            let r, n, a, i, o, {
                    params: s,
                    ...l
                } = this.initializeRequest({
                    credentialed: this.variables.filters ? .watchlist
                }),
                c = (e = this.variables, r = e.options ? ? {}, (n = new URLSearchParams(s)).set("limit", String(r.pagination ? .limit ? ? 20)), a = e ? .options ? .overrides ? .active !== void 0 && !1 == !e ? .options ? .overrides ? .active ? "false" : "true", i = e ? .options ? .overrides ? .archived !== void 0 && e ? .options ? .overrides ? .archived === !0 ? "true" : "false", n.set("active", a), n.set("archived", i), n);
            return ((e, t) => {
                let {
                    pagination: r = {}
                } = t ? ? {};
                (({
                    input: e,
                    defaults: t,
                    transform: r = e => e,
                    constraints: n
                }) => {
                    let a = "function" == typeof r ? r : r in ea ? ea[r] : e => e;
                    if (e ? .type === "cursor") {
                        let r = a(eo({
                            result: (({
                                input: e,
                                defaults: t
                            }) => {
                                try {
                                    let {
                                        limit: r = t ? .limit
                                    } = e ? ? {}, n = void 0 !== e.cursor ? (e => {
                                        try {
                                            let t = parseInt(er.Buffer.from(e, "base64").toString("utf-8"), 10);
                                            if (Number.isNaN(t) || !Number.isFinite(t)) return 0;
                                            return t ? ? 0
                                        } catch {
                                            return 0
                                        }
                                    })(e.cursor) : t ? .offset ? ? 0;
                                    return {
                                        limit: r,
                                        offset: n,
                                        overrides: {
                                            cursor: e.cursor
                                        }
                                    }
                                } catch {
                                    return {
                                        limit: e.limit,
                                        offset: t ? .offset ? ? 0,
                                        overrides: {
                                            cursor: e.cursor
                                        }
                                    }
                                }
                            })({
                                input: e,
                                defaults: t
                            }),
                            constraints: n
                        }));
                        return {
                            data: r,
                            apply: es(r)
                        }
                    }
                    if (e && (!e.type || "default" === e.type)) {
                        let r = a(eo({
                            result: (({
                                input: e,
                                defaults: t
                            }) => {
                                let {
                                    limit: r = t ? .limit,
                                    ...n
                                } = e ? ? {};
                                if (void 0 !== n.offset) {
                                    let e = n.page;
                                    return void 0 === n.page && r && (e = Math.floor(n.offset / r)), {
                                        limit: r,
                                        offset: n.offset,
                                        page: e
                                    }
                                }
                                if (void 0 !== n.page) {
                                    let e = n.offset;
                                    return void 0 === n.offset && r && (e = n.page * r), {
                                        limit: r,
                                        page: n.page,
                                        offset: e
                                    }
                                }
                                return {
                                    limit: r,
                                    offset: t ? .offset ? ? 0,
                                    page: t ? .page ? ? 0
                                }
                            })({
                                input: e,
                                defaults: t
                            }),
                            constraints: n
                        }));
                        return {
                            data: r,
                            apply: es(r)
                        }
                    }
                    let i = a(eo({
                        result: {},
                        constraints: n
                    }));
                    return {
                        data: i,
                        apply: es(i)
                    }
                })({
                    input: r,
                    defaults: {
                        limit: 20
                    },
                    constraints: {
                        max: {
                            limit: 25,
                            offset: 500
                        }
                    },
                    transform: "offset"
                }).apply(e);
                let n = (e => {
                    if (e) return ed[e]
                })(t ? .sort ? ? null);
                void 0 !== n && el(e, "order", n), t ? .sort === "competitive" && el(e, "ascending", "true");
                let a = ep(t ? .sortDirection);
                void 0 !== a && el(e, "ascending", !0 === a ? "true" : "false")
            })(c, this.variables.options), t = this.variables.filters, eu(c, "id", t ? .events ? .include ? .ids ? .map(e => `${e}`)), eu(c, "slug", t ? .events ? .include ? .slugs), eu(c, "tag_slug", t ? .tags ? .include ? .slugs), eu(c, "tag_id", t ? .tags ? .include ? .ids ? .map(e => `${e}`)), eu(c, "exclude_tag_id", t ? .tags ? .omit ? .ids ? .map(e => `${e}`)), t ? .tags ? .include ? .ids ? .length && t.tags.related && ec(c, "related_tags", "true"), eu(c, "series_id", t ? .series ? .include ? .ids ? .map(e => `${e}`)), eu(c, "series_slug", t ? .series ? .include ? .slugs), t ? .sports && (t ? .sports ? .games ? .include ? .ids ? .length && eu(c, "game_id", t ? .sports ? .games ? .include ? .ids ? .map(e => `${e}`)), t ? .sports ? .includeBestLines && ec(c, "include_best_lines", "true")), void 0 !== (o = eh(t ? .status)) && el(c, "closed", o), ec(c, "event_date", t ? .eventDate), ec(c, "event_week", t ? .eventWeek ? `${t?.eventWeek}` : void 0), t && "startDate" in t && t ? .startDate && (t ? .startDate ? .min && ec(c, "start_date_min", t.startDate.min), t ? .startDate ? .max && ec(c, "start_date_max", t.startDate.max)), t && "startTime" in t && t ? .startTime && (t ? .startTime ? .min && ec(c, "start_time_min", t.startTime.min), t ? .startTime ? .max && ec(c, "start_time_max", t.startTime.max)), t ? .endDate && (t ? .endDate ? .min && ec(c, "end_date_min", t.endDate.min), t ? .endDate ? .max && ec(c, "end_date_max", t.endDate.max)), t ? .liquidity && (t ? .liquidity ? .min && ec(c, "liquidity_min", t.liquidity.min.toString()), t ? .liquidity ? .max && ec(c, "liquidity_max", t.liquidity.max.toString())), t ? .volume && (t ? .volume ? .min && ec(c, "volume_min", t.volume.min.toString()), t ? .volume ? .max && ec(c, "volume_max", t.volume.max.toString())), t ? .recurrence && ec(c, "recurrence", ef[t.recurrence]), t ? .category && t ? .category !== "all" && ec(c, "tag_slug", t ? .category), t ? .featured && el(c, "featured", "true"), {
                path: this.path,
                options: {
                    params: c,
                    ...l
                }
            }
        }
        execute({
            client: e
        }) {
            return e.get(this.encode())
        }
        get path() {
            return this.variables.filters ? .watchlist ? "/events/watchlist" : "/events/pagination"
        }
        get key() {
            return ["list-events", ...et(this.variables, ["filters", "options"])]
        }
    }
    class ey extends $ {
        encode() {
            let {
                slugs: e,
                options: t,
                filters: r
            } = this.variables;
            return {
                options: t,
                filters: { ...r,
                    events: {
                        include: {
                            slugs: e
                        }
                    }
                },
                auth: this.auth
            }
        }
        async execute({
            self: e
        }) {
            let t = await e.events.list(this.encode());
            if ("failure" === t.status) throw t.error;
            return t.data
        }
        get path() {
            return new em(this.encode()).path
        }
        get key() {
            return new em(this.encode()).key
        }
    }
    class eg extends $ {
        encode() {
            let {
                tags: e,
                options: t,
                filters: r
            } = this.variables;
            return {
                options: t,
                filters: { ...r,
                    tags: {
                        include: {
                            slugs: e
                        }
                    }
                },
                auth: this.auth
            }
        }
        async execute({
            self: e
        }) {
            let t = await e.events.list(this.encode());
            if ("failure" === t.status) throw t.error;
            return t.data
        }
        get path() {
            return new em(this.encode()).path
        }
        get key() {
            return new em(this.encode()).key
        }
    }
    let eb = ["EventsTitle", "Events"];
    class ev extends $ {
        encode() {
            var e, t, r;
            let n, a, i, {
                    params: o,
                    ...s
                } = this.initializeRequest(),
                l = (e = this.variables.query, t = this.variables.options, (n = new URLSearchParams(o)).set("q", e), n.set("limit_per_type", String(t ? .pagination ? .limit ? ? 20)), n.set("type", "events"), n);
            return ((e, t) => {
                let {
                    pagination: r = {}
                } = t ? ? {}, n = 0;
                "page" in r && r ? .page ? n = r.page : "offset" in r && r ? .offset && (n = r.offset / (r ? .limit ? ? 20)), ec(e, "page", String(n + 1)), el(e, "sort", t ? .sort), ep(t ? .sortDirection) && el(e, "ascending", "true"), t ? .cache && el(e, "cache", "true")
            })(l, this.variables.options), r = this.variables.filters, eu(l, "events_tag", r ? .tags ? .include ? .slugs), eu(l, "exclude_tag_id", r ? .tags ? .omit ? .ids ? .map(e => `${e}`)), r ? .preset === "markets" && eu(l, "presets", eb), r ? .watchlist && el(l, "watchlist", "true"), r ? .creator && el(l, "creator", r ? .creator), r ? .searchTags && el(l, "search_tags", "true"), r ? .searchProfiles && el(l, "search_profiles", "true"), "all" !== (a = r ? .status ? ? "active") && el(l, "events_status", a), void 0 !== (i = eh(r ? .status)) && el(l, "closed", i), r ? .recurrence && el(l, "recurrence", r ? .recurrence), {
                path: "/public-search",
                options: {
                    params: l,
                    ...s
                }
            }
        }
        execute({
            client: e
        }) {
            return e.get(this.encode())
        }
        get path() {
            return "/public-search"
        }
        get key() {
            return ["search", ...et(this.variables, ["options", "filters"])]
        }
    }
    class ex extends $ {
        encode() {
            return {
                query: this.variables.query,
                options: { ...this.variables.options,
                    pagination: { ...this.variables.options ? .pagination,
                        limit : this.variables.options ? .pagination ? .limit ? ? 20
                    }
                },
                filters: { ...this.variables.filters,
                    preset: "markets"
                },
                auth: this.variables.auth
            }
        }
        async execute({
            self: e
        }) {
            let t = await e.search.search(this.encode());
            if ("failure" === t.status) throw t.error;
            return t.data
        }
        get path() {
            return new ev(this.encode()).path
        }
        get key() {
            return new ev(this.encode()).key
        }
    }
    e.s(["EventsClient", 0, class {
        constructor({
            client: e,
            self: t,
            logger: r
        }) {
            const n = T({
                module: "events",
                logger: r
            });
            this.get = O(I(Y, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "get-event",
                request: t => t.execute({
                    client: e
                }),
                parse: e => H(e.data)
            }))({
                client: e,
                log: n
            }))), this.list = O(I(em, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "list-events",
                request: t => t.execute({
                    client: e
                }),
                parse: Q
            }))({
                client: e,
                log: n
            }))), this.listBySlug = O(I(ey, (({
                self: e,
                log: t
            }) => D({
                log: t,
                operation: "list-events-by-slug",
                request: t => t.execute({
                    self: e
                })
            }))({
                self: t,
                log: n
            }))), this.listByTag = O(I(eg, (({
                self: e,
                log: t
            }) => D({
                log: t,
                operation: "list-events-by-tag",
                request: t => t.execute({
                    self: e
                })
            }))({
                self: t,
                log: n
            }))), this.search = O(I(ex, (({
                self: e,
                log: t
            }) => D({
                log: t,
                operation: "search-events",
                request: t => t.execute({
                    self: e
                }),
                parse: J
            }))({
                self: t,
                log: n
            })))
        }
        get;
        list;
        listBySlug;
        listByTag;
        search
    }], 85462);
    var ew = ((p = {}).Event = "event", p);
    let e_ = e => ({
            type: ew.Event,
            id: e.id,
            eventId: e.event_id,
            userId: e.user_id,
            event: e.event
        }),
        eC = e => {
            let t = e.data;
            if (!t) throw Error("No favorite event found");
            return e_(t)
        },
        eE = e => {
            let t = e.data;
            if (!Array.isArray(t)) throw Error("No favorite events found");
            return t.map(e_)
        };
    class eS extends $ {
        encode() {
            let e = this.initializeRequest({
                credentialed: !0
            });
            return {
                path: this.path,
                options: {
                    body: {
                        event_id: this.variables.id
                    },
                    ...e
                }
            }
        }
        execute({
            client: e
        }) {
            return e.post(this.encode())
        }
        get path() {
            return "/favorite_events"
        }
        get key() {
            return ["favorite-event", "create", this.variables.id]
        }
    }
    class eA extends $ {
        encode() {
            let e = this.initializeRequest({
                credentialed: !0
            });
            return {
                path: this.path,
                options: e
            }
        }
        execute({
            client: e
        }) {
            return e.delete(this.encode())
        }
        get path() {
            return `/favorite_events/${this.variables.id}`
        }
        get key() {
            return ["favorite-events", "delete", this.id]
        }
    }
    class eI extends $ {
        constructor(e = {}) {
            super(e)
        }
        encode() {
            let {
                limit: e,
                page: t
            } = this.variables, {
                params: r,
                ...n
            } = this.initializeRequest({
                credentialed: !0
            });
            return e && (ec(r, "limit", e.toString()), t && ec(r, "offset", (t * e).toString())), {
                path: "/favorite_events",
                options: {
                    params: r,
                    ...n
                }
            }
        }
        execute({
            client: e
        }) {
            return e.get(this.encode())
        }
        get path() {
            return "/favorite_events"
        }
        get key() {
            return ["favorite-events", "list"]
        }
    }
    class eT extends $ {
        encode() {
            let {
                auth: e,
                id: t,
                eventId: r,
                userId: n,
                ...a
            } = this.variables, i = this.initializeRequest({
                credentialed: !0
            });
            return {
                path: this.path,
                options: {
                    body: {
                        event_id: r,
                        user_id: n,
                        ...a
                    },
                    ...i
                }
            }
        }
        execute({
            client: e
        }) {
            return e.put(this.encode())
        }
        get path() {
            return `/favorite_events/${this.variables.id}`
        }
        get key() {
            return ["favorite-event", "update", this.variables.id]
        }
    }
    class ek {
        constructor({
            client: e,
            logger: t
        }) {
            const r = T({
                module: "favorite-events",
                logger: t
            });
            this.list = O(I(eI, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "list-favorite-events",
                request: t => t.execute({
                    client: e
                }),
                parse: eE
            }))({
                client: e,
                log: r
            }))), this.create = O(I(eS, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "create-favorite-event",
                request: t => t.execute({
                    client: e
                }),
                parse: eC
            }))({
                client: e,
                log: r
            }))), this.update = O(I(eT, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "update-favorite-event",
                request: t => t.execute({
                    client: e
                }),
                parse: e => e.data
            }))({
                client: e,
                log: r
            }))), this.delete = O(I(eA, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "delete-favorite-event",
                request: t => t.execute({
                    client: e
                }),
                parse: e => e.data
            }))({
                client: e,
                log: r
            })))
        }
        list;
        create;
        update;
        delete
    }
    e.s(["FavoritesClient", 0, class {
        events;
        constructor(e) {
            this.events = new ek(e)
        }
    }], 905778);
    let eO = ({
        outcomes: e,
        outcomePrices: t,
        clobTokenIds: r,
        ...n
    }) => ({ ...n,
        outcomes: (e => {
            let t = ["yes", "no"];
            if (Array.isArray(e)) return e;
            try {
                let r = JSON.parse(e);
                return Array.isArray(r) ? r : t
            } catch {
                return t
            }
        })(e),
        outcomePrices: (e => {
            let t = ["0.5", "0.5"];
            if (Array.isArray(e)) return e;
            try {
                let r = JSON.parse(e);
                return Array.isArray(r) ? r : t
            } catch {
                return t
            }
        })(t),
        clobTokenIds: (e => {
            if (!e) return null;
            if (Array.isArray(e)) return e;
            try {
                let t = JSON.parse(e);
                return Array.isArray(t) ? t : null
            } catch {
                return null
            }
        })(r)
    });
    class eR extends $ {
        encode() {
            let {
                params: e,
                ...t
            } = this.initializeRequest();
            return {
                path: this.path,
                options: {
                    params: e,
                    ...t
                }
            }
        }
        execute({
            client: e
        }) {
            return e.get(this.encode())
        }
        get path() {
            return "id" in this.variables ? `/markets/${this.variables.id}` : `/markets/slug/${this.variables.slug}`
        }
        get key() {
            return "id" in this.variables ? ["market", "get", this.variables.id.toString()] : ["market", "get", this.variables.slug]
        }
    }
    class eN extends $ {
        encode() {
            let {
                params: e,
                ...t
            } = this.initializeRequest();
            return "ids" in this.variables && this.variables.ids && e.set("ids", this.variables.ids.join(",")), "slugs" in this.variables && this.variables.slugs && e.set("slugs", this.variables.slugs.join(",")), {
                path: this.path,
                options: {
                    params: e,
                    ...t
                }
            }
        }
        execute({
            client: e
        }) {
            return e.get(this.encode())
        }
        get path() {
            return "/markets"
        }
        get key() {
            return "ids" in this.variables && this.variables.ids ? ["markets", "list", ...this.variables.ids.map(e => e.toString())] : "slugs" in this.variables && this.variables.slugs ? ["markets", "list", ...this.variables.slugs] : ["markets", "list"]
        }
    }
    e.s(["MarketsClient", 0, class {
        constructor({
            client: e,
            logger: t
        }) {
            const r = T({
                module: "markets",
                logger: t
            });
            this.get = O(I(eR, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "get-market",
                request: t => t.execute({
                    client: e
                }),
                parse: e => eO(e.data)
            }))({
                client: e,
                log: r
            }))), this.list = O(I(eN, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "list-markets",
                request: t => t.execute({
                    client: e
                }),
                parse: e => e.data.map(eO)
            }))({
                client: e,
                log: r
            })))
        }
        get;
        list
    }], 164444);
    let eM = (e, t = []) => ({
            generalEmail: {
                sendEmails: e
            },
            marketEmails: {
                sendEmails: e
            },
            newsletterEmails: {
                sendEmails: e
            },
            promotionalEmails: {
                sendEmails: e
            },
            eventEmails: {
                sendEmails: e,
                tagIds: t
            },
            orderFillEmails: {
                sendEmails: e,
                hideSmallFills: !0
            },
            resolutionEmails: {
                sendEmails: e
            }
        }),
        eP = (e, t = []) => ({
            eventApp: {
                sendApp: e,
                tagIds: t
            },
            marketPriceChangeApp: {
                sendApp: e
            },
            orderFillApp: {
                sendApp: e,
                hideSmallFills: !0
            },
            resolutionApp: {
                sendApp: e
            }
        }),
        eD = (e, t = !1, r = !0, n) => {
            let {
                chartPreferences: a,
                emailNotificationPreferences: i = eM(t, n),
                appNotificationPreferences: o = eP(r, n),
                marketInterests: s = [],
                preferencesStatus: l = "New/Existing - Created Prefs",
                subscriptionStatus: c = !0
            } = e;
            return {
                chartPreferences: a,
                emailNotificationPreferences: i,
                appNotificationPreferences: o,
                marketInterests: s,
                preferencesStatus: l,
                subscriptionStatus: c
            }
        },
        ej = e => {
            let {
                chartPreferences: t,
                emailNotificationPreferences: r,
                appNotificationPreferences: n,
                marketInterests: a,
                ...i
            } = e;
            return { ...i,
                ...t && {
                    chartPreferences: JSON.stringify(t)
                },
                ...r && {
                    emailNotificationPreferences: JSON.stringify(r)
                },
                ...n && {
                    appNotificationPreferences: JSON.stringify(n)
                },
                ...a && {
                    marketInterests: JSON.stringify(a)
                }
            }
        };
    e.s(["createDefaultUserAppPreferences", 0, eP, "createDefaultUserEmailPreferences", 0, eM, "extractUserPreferences", 0, eD, "formatCreateUserPreferencesBody", 0, ej], 981974);
    let eL = e => {
            var t;
            let r = new Date().toISOString();
            return {
                chartPreferences: (t = e.chartPreferences) ? "string" == typeof t ? JSON.parse(t) : t : {
                    defaultTimeScale: "1D"
                },
                createdAt: e.createdAt ? ? r,
                emailNotificationPreferences: (e => {
                    try {
                        if (!e) return eM(!1);
                        let t = JSON.parse(e);
                        return {
                            generalEmail: {
                                sendEmails: t.generalEmail ? .sendEmails ? ? !1
                            },
                            marketEmails: {
                                sendEmails: t.marketEmails ? .sendEmails ? ? !1
                            },
                            newsletterEmails: {
                                sendEmails: t.newsletterEmails ? .sendEmails ? ? !1
                            },
                            promotionalEmails: {
                                sendEmails: t.promotionalEmails ? .sendEmails ? ? !1
                            },
                            eventEmails: {
                                sendEmails: t.eventEmails ? .sendEmails ? ? !1,
                                tagIds: t.eventEmails ? .tagIds ? ? []
                            },
                            orderFillEmails: {
                                sendEmails: t.orderFillEmails ? .sendEmails ? ? !1,
                                hideSmallFills: t.orderFillEmails ? .hideSmallFills ? ? !0
                            },
                            resolutionEmails: {
                                sendEmails: t.resolutionEmails ? .sendEmails ? ? !1
                            }
                        }
                    } catch {
                        return eM(!1)
                    }
                })(e.emailNotificationPreferences),
                appNotificationPreferences: (e => {
                    try {
                        if (!e) return eP(!0);
                        let t = JSON.parse(e);
                        return {
                            eventApp: {
                                sendApp: t.eventApp ? .sendApp ? ? !0,
                                tagIds: t.eventApp ? .tagIds ? ? []
                            },
                            marketPriceChangeApp: {
                                sendApp: t.marketPriceChangeApp ? .sendApp ? ? !0
                            },
                            orderFillApp: {
                                sendApp: t.orderFillApp ? .sendApp ? ? !0,
                                hideSmallFills: t.orderFillApp ? .hideSmallFills ? ? !0
                            },
                            resolutionApp: {
                                sendApp: t.resolutionApp ? .sendApp ? ? !0
                            }
                        }
                    } catch {
                        return eP(!0)
                    }
                })(e.appNotificationPreferences),
                id: e.id,
                marketInterests: (e => {
                    try {
                        if (!e) return [];
                        let t = JSON.parse(e);
                        if (Array.isArray(t)) return t;
                        return []
                    } catch {
                        return []
                    }
                })(e.marketInterests),
                preferencesStatus: e.preferencesStatus,
                subscriptionStatus: e.subscriptionStatus,
                updatedAt: e.updatedAt ? ? r,
                userID: e.userID
            }
        },
        eF = e => {
            let t = e.data;
            if (!t) throw Error("No user preferences found");
            return eL(t)
        };
    class eU extends $ {
        constructor(e = {}) {
            super(e)
        }
        encode() {
            let e = this.initializeRequest({
                credentialed: !0
            });
            return {
                path: this.path,
                options: e
            }
        }
        execute({
            client: e
        }) {
            return e.get(this.encode())
        }
        get path() {
            return "/preferences"
        }
        get key() {
            return ["preferences", "get"]
        }
    }
    let e$ = e => {
        let t = e.data;
        if (!Array.isArray(t) || 0 === t.length) throw Error("No user preferences found");
        return eL(t[0])
    };
    class ez extends $ {
        encode() {
            let e = this.initializeRequest({
                credentialed: !0
            });
            return {
                path: this.path,
                options: {
                    body: ej(eD(this.variables)),
                    ...e
                }
            }
        }
        execute({
            client: e
        }) {
            return e.post(this.encode())
        }
        get path() {
            return "/preferences"
        }
        get key() {
            return ["preferences", "create"]
        }
    }
    class eB extends $ {
        encode() {
            let {
                auth: e,
                id: t,
                emailNotificationPreferences: r,
                appNotificationPreferences: n,
                marketInterests: a,
                ...i
            } = this.variables, o = this.initializeRequest({
                credentialed: !0
            });
            return {
                path: this.path,
                options: {
                    body: { ...i,
                        ...r && {
                            emailNotificationPreferences: JSON.stringify(r)
                        },
                        ...n && {
                            appNotificationPreferences: JSON.stringify(n)
                        },
                        ...a && {
                            marketInterests: JSON.stringify(a)
                        }
                    },
                    ...o
                }
            }
        }
        async execute({
            client: e
        }) {
            return e.put(this.encode())
        }
        get path() {
            return `/preferences/${this.variables.id}`
        }
        get key() {
            return ["preferences", "update"]
        }
    }
    e.s(["UserPreferencesClient", 0, class {
        constructor({
            self: e,
            client: t,
            logger: r
        }) {
            const n = T({
                module: "preferences",
                logger: r
            });
            this.get = O(I(eU, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "get",
                request: t => (t ? ? new eU).execute({
                    client: e
                }),
                parse: e$
            }))({
                client: t,
                log: n
            }))), this.create = O(I(ez, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "create",
                request: t => t.execute({
                    client: e
                }),
                parse: eF
            }))({
                client: t,
                log: n
            }))), this.update = O(I(eB, (({
                self: e,
                client: t,
                log: r
            }) => D({
                log: r,
                operation: "update",
                request: r => r.execute({
                    client: t,
                    self: e
                }),
                parse: e => e.data
            }))({
                self: e,
                client: t,
                log: n
            })))
        }
        get;
        create;
        update
    }], 420641), e.s(["parseBaseUser", () => eW, "parseUser", () => eZ], 940110);
    let eq = e => {
            if (void 0 !== e) return null !== e ? e : void 0
        },
        eW = e => ({
            address: e.address,
            blocked: e.blocked ? ? !1,
            confirmed: e.confirmed ? ? !1,
            createdAt: e.createdAt,
            creator: e.creator ? ? !1,
            email: e.email ? ? void 0,
            id: e.id,
            isExternalAuth: e.isExternalAuth ? ? !1,
            issuer: e.issuer ? ? void 0,
            metamaskPreferenceID: e.metamaskPreferenceID ? ? void 0,
            mod: e.mod ? ? !1,
            password: e.password ? ? void 0,
            preferencesID: eq(e.preferencesID),
            profileID: e.profileID,
            provider: e.provider ? ? void 0,
            proxyWallet: e.proxyWallet,
            resetPasswordToken: e.resetPasswordToken ? ? void 0,
            role: eq(e.role),
            updatedAt: e.updatedAt ? ? new Date().toISOString(),
            userTag: e.userTag ? ? void 0,
            username: e.username ? ? void 0,
            walletPreferenceID: eq(e.walletPreferenceID),
            xUsername: e.xUsername ? ? void 0
        }),
        eZ = (e, t = {
            withProfile: !0
        }) => {
            if (t.withProfile) {
                let t = Z(e.profiles);
                if (!t) return;
                let r = eK(t);
                if (!r) return;
                return { ...eW(e),
                    profile: r
                }
            }
            return eW(e)
        },
        eV = e => {
            let t = new Date().toISOString();
            return {
                advancedMode: e.advancedMode ? ? !1,
                createdAt: e.createdAt ? ? t,
                customGasPrice: e.customGasPrice ? ? "30",
                gasPreference: e.gasPreference ? ? "fast",
                id: e.id,
                updatedAt: e.updatedAt ? ? t,
                userID: e.userID,
                walletPreferencesStatus: e.walletPreferencesStatus ? ? "New/Existing - Created Wallet Prefs"
            }
        };
    e.s(["parseWalletPreferences", 0, eV], 917503);
    let eK = ({
            id: e,
            ...t
        }) => ({
            id: "string" == typeof e ? parseInt(e, 10) : e,
            ...t
        }),
        eH = e => {
            let {
                users: t,
                ...r
            } = e, n = Z(t), a = n ? .preferences ? Z(n.preferences) : void 0, i = n ? .walletPreferences ? Z(n.walletPreferences) : void 0;
            if (n && a) return { ...eK(r),
                ...n && {
                    user: eW(n)
                },
                ...a && {
                    preference: eL(a)
                },
                ...i && {
                    walletPreference: eV(i)
                }
            }
        },
        eG = e => {
            let t = eH(e.data);
            if (!t) throw new N({
                type: "RequestError",
                name: "ProfileParseError",
                code: b.Other.Unknown,
                message: "Failed to parse profile"
            });
            return t
        };
    class eQ extends $ {
        constructor(e = {}) {
            super(e)
        }
        encode() {
            let e = this.initializeRequest({
                credentialed: !0
            });
            return {
                path: this.path,
                options: e
            }
        }
        async execute({
            client: e
        }) {
            let t = await e.get(this.encode());
            if (!t.data || 0 === t.data.length) throw new N({
                type: "RequestError",
                name: "ProfileNotFoundError",
                code: b.ClientError.NotFound,
                message: "Profile not found"
            });
            return t
        }
        get path() {
            return "/profiles"
        }
        get key() {
            return ["profile", "get"]
        }
    }
    let eJ = e => {
            let t = eH(e.data[0]);
            if (!t) throw Error("Failed to parse profile");
            return t
        },
        eY = e => {
            let {
                advancedMode: t = !1,
                customGasPrice: r = "30",
                gasPreference: n = "fast",
                walletPreferencesStatus: a = "New/Existing - Created Wallet Prefs"
            } = e;
            return {
                advancedMode: t,
                customGasPrice: r,
                gasPreference: n,
                walletPreferencesStatus: a
            }
        },
        eX = e => e;
    e.s(["extractWalletPreferences", 0, eY, "formatCreateWalletPreferencesBody", 0, eX], 349808);
    class e0 extends $ {
        encode() {
            let e = this.initializeRequest({
                credentialed: !0
            });
            return {
                path: this.path,
                options: {
                    body: this.createCreateProfileBody(this.variables),
                    ...e
                }
            }
        }
        async execute({
            client: e
        }) {
            let t = await e.post(this.encode());
            if (!t.data) throw new N({
                type: "RequestError",
                name: "ProfileNotCreated",
                code: t.status,
                message: "Profile not found"
            });
            return t
        }
        get path() {
            return "/profiles"
        }
        get key() {
            return ["profile", "create"]
        }
        createCreateProfileBody(e) {
            let {
                auth: t,
                authenticationType: r,
                user: n,
                preferences: a,
                walletPreferences: i,
                ...o
            } = e, {
                displayUsernamePublic: s = !0,
                emailOptIn: l = !1,
                walletActivated: c = !1,
                ...u
            } = o;
            return {
                displayUsernamePublic: s,
                emailOptIn: l,
                walletActivated: c,
                ...u,
                ...n && {
                    users: this.createProfileUsersProperty({
                        authenticationType: r,
                        emailOptIn: l,
                        user: n,
                        preferences: a,
                        walletPreferences: i
                    })
                }
            }
        }
        createProfileUsersProperty({
            authenticationType: e,
            emailOptIn: t,
            user: r,
            preferences: n,
            walletPreferences: a
        }) {
            let {
                address: i,
                email: o = "",
                proxyWallet: s,
                username: l
            } = r;
            return [{
                address: i,
                email: o,
                isExternalAuth: "eoa" === e,
                proxyWallet: s,
                username: l,
                ..."eoa" === e && {
                    provider: "metamask"
                },
                preferences: [ej(eD(n ? ? {}, t, !0))],
                ..."eoa" === e && {
                    walletPreferences: [eX(eY(a ? ? {}))]
                }
            }]
        }
    }
    e.s(["CreateProfileRequest", 0, e0], 464332);
    class e1 extends $ {
        encode() {
            return {
                query: this.variables.query,
                options: { ...this.variables.options,
                    pagination: { ...this.variables.options ? .pagination,
                        limit : this.variables.options ? .pagination ? .limit ? ? 6
                    }
                },
                filters: {
                    preset: "profiles",
                    searchProfiles: !0
                },
                auth: this.variables.auth
            }
        }
        async execute({
            self: e
        }) {
            let t = await e.search.search(this.encode());
            if ("failure" === t.status) throw t.error;
            return t.data
        }
        get path() {
            return new ev(this.encode()).path
        }
        get key() {
            return new ev(this.encode()).key
        }
    }
    class e2 extends $ {
        encode() {
            let {
                id: e,
                auth: t,
                userId: r,
                ...n
            } = this.variables, a = this.initializeRequest({
                credentialed: !0
            });
            return {
                path: this.path,
                options: {
                    body: { ...n
                    },
                    ...a
                }
            }
        }
        execute({
            client: e
        }) {
            return e.put(this.encode())
        }
        get path() {
            return `/profiles/${this.variables.id}`
        }
        get key() {
            return ["profile", "update"]
        }
    }
    e.s(["ProfilesClient", 0, class {
        constructor({
            client: e,
            self: t,
            logger: r
        }) {
            const n = T({
                module: "profiles",
                logger: r
            });
            this.get = O(I(eQ, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "get",
                request: t => (t ? ? new eQ).execute({
                    client: e
                }),
                parse: eJ
            }))({
                client: e,
                log: n
            }))), this.create = O(I(e0, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "create",
                request: t => t.execute({
                    client: e
                }),
                parse: eG
            }))({
                client: e,
                log: n
            }))), this.update = O(I(e2, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "update",
                request: t => t.execute({
                    client: e
                }),
                parse: e => e.data
            }))({
                client: e,
                log: n
            }))), this.search = O(I(e1, (({
                self: e,
                log: t
            }) => D({
                log: t,
                operation: "search-profiles",
                request: t => t.execute({
                    self: e
                })
            }))({
                self: t,
                log: n
            })))
        }
        get;
        create;
        update;
        search
    }], 721266), e.s(["SearchClient", 0, class {
        constructor({
            client: e,
            logger: t
        }) {
            const r = T({
                module: "search",
                logger: t
            });
            this.search = O(I(ev, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "search",
                request: t => t.execute({
                    client: e
                }),
                parse: e => (({
                    events: e = [],
                    tags: t,
                    profiles: r,
                    hasMore: n
                }) => ({
                    events: G(e),
                    tags: t ? ? [],
                    profiles: r ? ? [],
                    hasMore: !!n
                }))(e.data)
            }))({
                client: e,
                log: r
            })))
        }
        search
    }], 926609);
    let e6 = e => {
        let t = e.data;
        if (!t) throw Error("No series found");
        return Array.isArray(t) ? t[0] : t
    };
    class e5 extends $ {
        encode() {
            let {
                params: e,
                ...t
            } = this.initializeRequest(), r = (e => {
                if (void 0 !== e) return "boolean" == typeof e ? e ? "true" : "false" : String(e)
            })(this.variables.includeChat);
            return (void 0 !== r && el(e, "include_chat", r), el(e, "exclude_events", "true"), "id" in this.variables) ? {
                path: `/series/${this.variables.id}`,
                options: {
                    params: e
                }
            } : (el(e, "slug", this.variables.slug), {
                path: this.path,
                options: {
                    params: e,
                    ...t
                }
            })
        }
        execute({
            client: e
        }) {
            return e.get(this.encode())
        }
        get path() {
            return "/series"
        }
        get key() {
            return "slug" in this.variables ? ["series", "get", "slug", this.variables.slug] : ["series", "get", "id", this.variables.id.toString()]
        }
    }
    e.s(["SeriesClient", 0, class {
        constructor({
            client: e,
            logger: t
        }) {
            const r = T({
                module: "series",
                logger: t
            });
            this.get = O(I(e5, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "get",
                request: t => t.execute({
                    client: e
                }),
                parse: e6
            }))({
                client: e,
                log: r
            })))
        }
        get
    }], 267673);
    let e3 = e => {
        let t = e.data;
        if (!t) throw Error("No summary found");
        return t
    };
    class e4 extends $ {
        encode() {
            let {
                status: e = "all"
            } = this.variables.filters ? ? {};
            return {
                options: this.variables.options,
                filters: {
                    status: e,
                    series: {
                        include: {
                            ids: [this.variables.seriesId]
                        }
                    },
                    eventDate: this.variables.date
                },
                auth: this.variables.auth
            }
        }
        async execute({
            self: e
        }) {
            let t = await e.events.list(this.encode());
            if ("failure" === t.status) throw t.error;
            return t.data
        }
        get path() {
            return new em(this.encode()).path
        }
        get key() {
            return new em(this.encode()).key
        }
    }
    class e8 extends $ {
        encode() {
            let {
                status: e = "all"
            } = this.variables.filters ? ? {};
            return {
                options: this.variables.options,
                filters: {
                    status: e,
                    series: {
                        include: {
                            ids: this.variables.filters ? .seriesIds
                        }
                    },
                    ...((e, t = 3) => {
                        let r = e ? .start,
                            n = e ? .end;
                        if (!n) {
                            let e = new Date;
                            e.setSeconds(0, 0), n = new Date(e.getTime() + 864e5 * t).toISOString(), r || (r = new Date(e.getTime() - 864e5).toISOString())
                        }
                        return {
                            startTimeMin: r,
                            startTimeMax: n
                        }
                    })(this.variables.filters ? .range, 3)
                },
                auth: this.variables.auth
            }
        }
        async execute({
            self: e
        }) {
            let t = await e.events.list(this.encode());
            if ("failure" === t.status) throw t.error;
            return t.data
        }
        get path() {
            return new em(this.encode()).path
        }
        get key() {
            return new em(this.encode()).key
        }
    }
    class e7 extends $ {
        encode() {
            let e = this.initializeRequest();
            return {
                path: this.path,
                options: e
            }
        }
        async execute({
            client: e
        }) {
            return e.get(this.encode())
        }
        get path() {
            return `/series-summary/${this.variables.seriesId}`
        }
        get key() {
            return ["sports", "summary", this.variables.seriesId.toString()]
        }
    }
    class e9 extends $ {
        limit;
        offset = 0;
        constructor(e) {
            super(e), this.limit = e.limit ? ? 500
        }
        encode() {
            let e = this.params(),
                {
                    params: t,
                    ...r
                } = this.initializeRequest({
                    initialParams: e
                });
            return ec(t, "limit", String(this.variables.limit)), ec(t, "offset", String(this.offset)), {
                path: this.path,
                options: {
                    params: t,
                    ...r
                }
            }
        }
        async execute({
            client: e
        }) {
            let t = [],
                r = !0,
                n = !1;
            try {
                for (; r;) {
                    let a = this.encode(),
                        i = await e.get(a);
                    n = !0, t.push(...i.data ? ? []), !Array.isArray(i.data) || i.data.length < this.limit ? r = !1 : this.offset += this.limit
                }
            } catch (e) {
                if (!n) throw e
            }
            return t
        }
        get path() {
            return "/teams"
        }
        get key() {
            return ["sports", "teams", this.variables.leagues ? .join(",") ? ? "", this.variables.teams ? .join(",") ? ? ""]
        }
        params() {
            let e = new URLSearchParams;
            return eu(e, "league", this.variables.leagues), eu(e, "abbreviation", this.variables.teams, e => e.replace(/abbreviation=([^&]+)/g, (e, t) => `${t.toLowerCase()}`)), e
        }
    }
    class te extends $ {
        encode() {
            let {
                status: e = "all"
            } = this.variables.filters ? ? {};
            return {
                options: this.variables.options,
                filters: {
                    status: e,
                    series: {
                        include: {
                            ids: [this.variables.seriesId]
                        }
                    },
                    eventWeek: this.variables.week
                },
                auth: this.variables.auth
            }
        }
        async execute({
            self: e
        }) {
            let t = await e.events.list(this.encode());
            if ("failure" === t.status) throw t.error;
            return t.data
        }
        get path() {
            return new em(this.encode()).path
        }
        get key() {
            return new em(this.encode()).key
        }
    }
    e.s(["SportsClient", 0, class {
        constructor({
            client: e,
            self: t,
            logger: r
        }) {
            const n = T({
                module: "sports",
                logger: r
            });
            this.getSummary = O(I(e7, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "summary",
                request: t => t.execute({
                    client: e
                }),
                parse: e3
            }))({
                client: e,
                log: n
            }))), this.getTeams = O(I(e9, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "teams",
                request: t => t.execute({
                    client: e
                })
            }))({
                client: e,
                log: n
            }))), this.getDailyEvents = O(I(e4, (({
                self: e,
                log: t
            }) => D({
                log: t,
                operation: "get-daily-events",
                request: t => t.execute({
                    self: e
                }),
                parse: e => e.events
            }))({
                self: t,
                log: n
            }))), this.getWeeklyEvents = O(I(te, (({
                self: e,
                log: t
            }) => D({
                log: t,
                operation: "get-weekly-events",
                request: t => t.execute({
                    self: e
                }),
                parse: e => e.events
            }))({
                self: t,
                log: n
            }))), this.getLiveEvents = O(I(e8, (({
                self: e,
                log: t
            }) => D({
                log: t,
                operation: "get-live-events",
                request: t => t.execute({
                    self: e
                }),
                parse: e => e.events
            }))({
                self: t,
                log: n
            })))
        }
        getSummary;
        getTeams;
        getDailyEvents;
        getWeeklyEvents;
        getLiveEvents
    }], 216056);
    let tt = e => {
            let t = e.data;
            if (!t) throw Error("No ranked tags found");
            return t
        },
        tr = e => {
            let t = e.data;
            if (!t) throw Error("No related tags found");
            return t
        },
        tn = e => {
            let t = e.data;
            if (!t) throw Error("No tag found");
            return t
        };
    class ta extends $ {
        encode() {
            let {
                params: e,
                ...t
            } = this.initializeRequest(), {
                limit: r = 15
            } = this.variables.pagination ? ? {};
            return ec(e, "limit", String(r)), {
                path: this.path,
                options: {
                    params: e,
                    ...t
                }
            }
        }
        execute({
            client: e
        }) {
            return e.get(this.encode())
        }
        get path() {
            return "/ranked_tags"
        }
        get key() {
            return ["tags", "ranked", this.variables.pagination ? .limit ? .toString() ? ? ""]
        }
    }
    class ti extends $ {
        encode() {
            var e;
            let {
                params: t,
                ...r
            } = this.initializeRequest();
            el(t, "omit_empty", "true");
            let n = "active" === (e = this.variables.status) ? "active" : "resolved" === e ? "closed" : "all" === e ? "all" : void 0;
            return n && el(t, "status", n), {
                path: this.path,
                options: {
                    params: t,
                    ...r
                }
            }
        }
        execute({
            client: e
        }) {
            return e.get(this.encode())
        }
        get path() {
            return "tagId" in this.variables ? `/tags/${this.variables.tagId}/related-tags/tags` : `/tags/slug/${this.variables.slug}/related-tags/tags`
        }
        get key() {
            return "tagId" in this.variables ? ["tags", "related", this.variables.tagId, this.variables.status ? ? ""] : ["tags", "related", this.variables.slug, this.variables.status ? ? ""]
        }
    }
    class to extends $ {
        encode() {
            let e = this.initializeRequest();
            return {
                path: this.path,
                options: e
            }
        }
        execute({
            client: e
        }) {
            return e.get(this.encode())
        }
        get path() {
            return `/tags/slug/${encodeURIComponent(this.variables.slug)}`
        }
        get key() {
            return ["tags", "get", this.variables.slug]
        }
    }
    e.s(["TagsClient", 0, class {
        constructor({
            client: e,
            logger: t
        }) {
            const r = T({
                module: "tags",
                logger: t
            });
            this.get = O(I(to, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "get",
                request: t => t.execute({
                    client: e
                }),
                parse: tn
            }))({
                client: e,
                log: r
            }))), this.ranked = O(I(ta, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "ranked",
                request: t => t.execute({
                    client: e
                }),
                parse: tt
            }))({
                client: e,
                log: r
            }))), this.related = O(I(ti, (({
                client: e,
                log: t
            }) => D({
                log: t,
                operation: "related",
                request: t => t.execute({
                    client: e
                }),
                parse: tr
            }))({
                client: e,
                log: r
            })))
        }
        get;
        ranked;
        related
    }], 948938)
}, 305292, e => {
    "use strict";
    e.i(284553);
    var t = e.i(17812),
        r = e.i(261414),
        n = e.i(955547),
        a = e.i(582803),
        i = e.i(85462),
        o = e.i(905778),
        s = e.i(164444),
        l = e.i(420641),
        c = e.i(721266),
        u = e.i(926609),
        d = e.i(267673),
        f = e.i(216056),
        p = e.i(948938),
        h = e.i(669448),
        m = e.i(560993),
        y = e.i(416671),
        g = e.i(165789),
        b = e.i(552442),
        v = e.i(483008),
        x = e.i(544572),
        w = e.i(599944),
        _ = e.i(940110);
    class C extends w.GammaApiRequest {
        constructor(e = {}) {
            super(e)
        }
        encode() {
            return {
                path: this.path,
                options: this.initializeRequest({
                    credentialed: !0
                })
            }
        }
        async execute({
            client: e,
            self: t
        }) {
            let r = await this.getUser(e);
            if ("success" === r.status) {
                if ("existing" === r.type) return {
                    type: "existing",
                    user: r.user
                };
                if ("new" === r.type) {
                    let e = await t.users.register(this.encodeRegisterRequest(r.variables));
                    if ("success" === e.status) return {
                        type: "new",
                        user: e.data
                    };
                    throw e.error
                }
            }
            throw r.error
        }
        get path() {
            return "/users"
        }
        get key() {
            return ["user", "get"]
        }
        encodeRegisterRequest(e) {
            return {
                authenticationType: e.type,
                address: e.address,
                proxyWallet: (0, x.deriveProxyAddress)(e.address, e.type),
                auth: {
                    token: this.token
                }
            }
        }
        async getUser(e) {
            try {
                let t = await e.get(this.encode());
                if (t.status === v.StatusCodes.Success.OK)
                    if (t.data && 0 !== t.data.length) {
                        let e = (0, _.parseUser)(t.data[0], {
                            withProfile: !0
                        });
                        if (e) return {
                            status: "success",
                            type: "existing",
                            user: e
                        };
                        return {
                            status: "failure",
                            error: new b.RestError({
                                type: "RestError",
                                name: "GetUserError",
                                code: v.StatusCodes.Other.Unknown,
                                message: "Failed to parse user"
                            })
                        }
                    } else {
                        if (this.variables ? .register) return {
                            status: "success",
                            type: "new",
                            variables: this.variables
                        };
                        return {
                            status: "failure",
                            error: new b.RestError({
                                type: "RestError",
                                name: "GetUserError",
                                code: v.StatusCodes.ClientError.NotFound,
                                message: "User not found"
                            })
                        }
                    }
                return {
                    status: "failure",
                    error: new b.RestError({
                        type: "RestError",
                        name: "GetUserError",
                        code: t.status,
                        message: "Failed to get user"
                    })
                }
            } catch (e) {
                return {
                    status: "failure",
                    error: e
                }
            }
        }
    }
    let E = e => {
        let {
            user: t,
            preference: r,
            walletPreference: n,
            ...a
        } = e;
        return { ...t,
            profile: a,
            preferences: r,
            walletPreferences: n
        }
    };
    var S = w,
        A = e.i(981974),
        I = e.i(464332),
        T = e.i(349808);
    class k extends S.GammaApiRequest {
        encode() {
            return { ...this.extractProfile(this.variables),
                user: this.extractUser(this.variables),
                preferences: (0, A.extractUserPreferences)({}, this.variables.emailOptIn, !0),
                ..."eoa" === this.variables.authenticationType && {
                    walletPreferences: (0, T.extractWalletPreferences)({})
                },
                auth: this.variables.auth
            }
        }
        async execute({
            self: e
        }) {
            let t = await e.profiles.create(this.encode());
            if ("failure" === t.status) throw t.error;
            return t.data
        }
        get path() {
            return new I.CreateProfileRequest(this.encode()).path
        }
        get key() {
            return new I.CreateProfileRequest(this.encode()).key
        }
        extractUser(e) {
            let {
                address: t,
                email: r,
                proxyWallet: n,
                username: a
            } = e;
            return {
                address: t,
                email: r,
                proxyWallet: n,
                username: a,
                ..."eoa" === e.authenticationType && {
                    provider: "metamask"
                }
            }
        }
        extractProfile(e) {
            let {
                username: t,
                pseudonym: r,
                emailOptIn: n = !1,
                proxyWallet: a
            } = e;
            return {
                authenticationType: e.authenticationType,
                displayUsernamePublic: !0,
                emailOptIn: n,
                name: t ? ? a,
                proxyWallet: a,
                pseudonym: r ? ? a,
                referral: "",
                utmCampaign: "",
                utmContent: "",
                utmMedium: "",
                utmSource: "",
                utmTerm: "",
                walletActivated: !1
            }
        }
    }
    var O = e.i(451464),
        R = w;
    class N extends R.GammaApiRequest {
        encode() {
            let {
                auth: e,
                id: t,
                address: r,
                authenticationType: n,
                ...a
            } = this.variables, {
                params: i,
                ...o
            } = this.initializeRequest({
                credentialed: !0
            });
            return (0, O.appendFilter)(i, "address", r), {
                path: this.path,
                options: {
                    params: i,
                    body: { ...a
                    },
                    ...o
                }
            }
        }
        async execute({
            client: e
        }) {
            return e.put(this.encode())
        }
        get path() {
            return `/users/${this.variables.id}`
        }
        get key() {
            return ["user", "update"]
        }
    }
    class M {
        constructor({
            client: e,
            self: t,
            logger: r
        }) {
            const n = (0, m.createRequestLog)({
                module: "user",
                logger: r
            });
            this.get = (0, y.withPrepare)((0, h.bindRequest)(C, (({
                self: e,
                client: t,
                log: r
            }) => (0, g.createRequest)({
                log: r,
                operation: "get",
                request: r => (r ? ? new C).execute({
                    client: t,
                    self: e
                })
            }))({
                self: t,
                client: e,
                log: n
            }))), this.update = (0, y.withPrepare)((0, h.bindRequest)(N, (({
                client: e,
                log: t
            }) => (0, g.createRequest)({
                log: t,
                operation: "update",
                request: t => t.execute({
                    client: e
                }),
                parse: e => e.data
            }))({
                client: e,
                log: n
            }))), this.register = (0, y.withPrepare)((0, h.bindRequest)(k, (({
                self: e,
                log: t
            }) => (0, g.createRequest)({
                log: t,
                operation: "register",
                request: t => t.execute({
                    self: e
                }),
                parse: E
            }))({
                self: t,
                log: n
            })))
        }
        get;
        update;
        register
    }
    let P = e => {
            let {
                email: t,
                hash: r,
                timestamp: n,
                id: a,
                userID: i,
                updatedAt: o,
                verified: s
            } = e;
            if (void 0 !== t && void 0 !== r && void 0 !== n && void 0 !== a && void 0 !== i) return {
                email: t,
                hash: r,
                id: a,
                timestamp: n.replace(" ", "T"),
                updatedAt: o,
                userID: i,
                verified: s
            }
        },
        D = e => {
            let t = e.data;
            if (!t) throw Error("No verification email found");
            let r = P(t);
            if (!r) throw Error("Failed to parse verification email");
            return r
        },
        j = e => {
            let t = e.data;
            if (!Array.isArray(t)) throw Error("No verification emails found");
            return t.reduce((e, t) => {
                let r = P(t);
                return r && e.push(r), e
            }, [])
        };
    var L = w;
    class F extends L.GammaApiRequest {
        encode() {
            let e = this.initializeRequest({
                credentialed: !0
            });
            return {
                path: this.path,
                options: {
                    body: {
                        hash: this.variables.hash,
                        email: this.variables.email,
                        timestamp: this.variables.timestamp ? ? new Date().toISOString(),
                        verified: this.variables.verified ? ? !1
                    },
                    ...e
                }
            }
        }
        async execute({
            client: e
        }) {
            return e.post(this.encode())
        }
        get path() {
            return "/verification_emails"
        }
        get key() {
            return ["verification-emails", "create"]
        }
    }
    var U = w;
    class $ extends U.GammaApiRequest {
        encode() {
            let e = this.initializeRequest({
                credentialed: !0
            });
            return {
                path: this.path,
                options: e
            }
        }
        async execute({
            client: e
        }) {
            return e.delete(this.encode())
        }
        get path() {
            return `/verification_emails/${this.variables.id}`
        }
        get key() {
            return ["verification-emails", "delete", this.variables.id]
        }
    }
    var z = w;
    class B extends z.GammaApiRequest {
        constructor(e = {}) {
            super(e)
        }
        encode() {
            let {
                params: e,
                ...t
            } = this.initializeRequest({
                credentialed: !0
            });
            return {
                path: this.path,
                options: {
                    params: e,
                    ...t
                }
            }
        }
        async execute({
            client: e
        }) {
            return e.get(this.encode())
        }
        get path() {
            return "/verification_emails"
        }
        get key() {
            return ["verification-emails", "list"]
        }
    }
    var q = w;
    class W extends q.GammaApiRequest {
        encode() {
            let {
                auth: e,
                id: t,
                ...r
            } = this.variables, n = this.initializeRequest({
                credentialed: !0
            });
            return {
                path: this.path,
                options: {
                    body: { ...r
                    },
                    ...n
                }
            }
        }
        async execute({
            client: e
        }) {
            return e.put(this.encode())
        }
        get path() {
            return `/verification_emails/${this.variables.id}`
        }
        get key() {
            return ["verification-emails", "update", this.variables.id]
        }
    }
    class Z {
        constructor({
            client: e,
            logger: t
        }) {
            const r = (0, m.createRequestLog)({
                module: "verification",
                logger: t
            });
            this.list = (0, y.withPrepare)((0, h.bindRequest)(B, (({
                client: e,
                log: t
            }) => (0, g.createRequest)({
                log: t,
                operation: "get",
                request: t => t.execute({
                    client: e
                }),
                parse: j
            }))({
                client: e,
                log: r
            }))), this.create = (0, y.withPrepare)((0, h.bindRequest)(F, (({
                client: e,
                log: t
            }) => (0, g.createRequest)({
                log: t,
                operation: "create",
                request: t => t.execute({
                    client: e
                }),
                parse: D
            }))({
                client: e,
                log: r
            }))), this.update = (0, y.withPrepare)((0, h.bindRequest)(W, (({
                client: e,
                log: t
            }) => (0, g.createRequest)({
                log: t,
                operation: "update",
                request: t => t.execute({
                    client: e
                }),
                parse: e => e.data
            }))({
                client: e,
                log: r
            }))), this.delete = (0, y.withPrepare)((0, h.bindRequest)($, (({
                client: e,
                log: t
            }) => (0, g.createRequest)({
                log: t,
                operation: "delete",
                request: t => t.execute({
                    client: e
                }),
                parse: e => e.data
            }))({
                client: e,
                log: r
            })))
        }
        list;
        create;
        update;
        delete
    }
    var V = e.i(917503);
    let K = e => {
        let t = e.data;
        if (!t) throw Error("No wallet preferences created");
        let r = (0, V.parseWalletPreferences)(t);
        if (!r) throw Error("Failed to parse wallet preferences");
        return r
    };
    var H = w;
    class G extends H.GammaApiRequest {
        constructor(e = {}) {
            super(e)
        }
        encode() {
            let e = this.initializeRequest({
                credentialed: !0
            });
            return {
                path: this.path,
                options: e
            }
        }
        async execute({
            client: e
        }) {
            return e.get(this.encode())
        }
        get path() {
            return "/wallet_preferences"
        }
        get key() {
            return ["wallet-preferences", "get"]
        }
    }
    let Q = e => {
        let t = e.data;
        if (!Array.isArray(t) || 0 === t.length) throw Error("No wallet preferences found");
        let r = t[0];
        return (0, V.parseWalletPreferences)(r)
    };
    var J = w;
    class Y extends J.GammaApiRequest {
        encode() {
            let e = this.initializeRequest({
                credentialed: !0
            });
            return {
                path: this.path,
                options: {
                    body: (0, T.extractWalletPreferences)(this.variables),
                    ...e
                }
            }
        }
        async execute({
            client: e
        }) {
            return e.post(this.encode())
        }
        get path() {
            return "/wallet_preferences"
        }
        get key() {
            return ["wallet-preferences", "create"]
        }
    }
    var X = w;
    class ee extends X.GammaApiRequest {
        encode() {
            let {
                auth: e,
                id: t,
                ...r
            } = this.variables, n = this.initializeRequest({
                credentialed: !0
            });
            return {
                path: this.path,
                options: {
                    body: { ...r
                    },
                    ...n
                }
            }
        }
        async execute({
            client: e
        }) {
            return e.put(this.encode())
        }
        get path() {
            return `/wallet_preferences/${this.variables.id}`
        }
        get key() {
            return ["wallet-preferences", "update"]
        }
    }
    class et {
        constructor({
            client: e,
            logger: t
        }) {
            const r = (0, m.createRequestLog)({
                module: "wallet-preferences",
                logger: t
            });
            this.get = (0, y.withPrepare)((0, h.bindRequest)(G, (({
                client: e,
                log: t
            }) => (0, g.createRequest)({
                log: t,
                operation: "get",
                request: t => (t ? ? new G).execute({
                    client: e
                }),
                parse: Q
            }))({
                client: e,
                log: r
            }))), this.create = (0, y.withPrepare)((0, h.bindRequest)(Y, (({
                client: e,
                log: t
            }) => (0, g.createRequest)({
                log: t,
                operation: "create",
                request: t => t.execute({
                    client: e
                }),
                parse: K
            }))({
                client: e,
                log: r
            }))), this.update = (0, y.withPrepare)((0, h.bindRequest)(ee, (({
                client: e,
                log: t
            }) => (0, g.createRequest)({
                log: t,
                operation: "update",
                request: t => t.execute({
                    client: e
                }),
                parse: e => e.data
            }))({
                client: e,
                log: r
            })))
        }
        get;
        create;
        update
    }
    class er {
        constructor(e = {}) {
            const t = this.#m(e),
                r = e.client ? ? new n.RestClient({
                    url: this.#y(e),
                    logger: t,
                    transport: {
                        type: "axios"
                    }
                });
            this.search = new u.SearchClient({
                client: r,
                logger: t
            }), this.events = new i.EventsClient({
                client: r,
                logger: t,
                self: this
            }), this.markets = new s.MarketsClient({
                client: r,
                logger: t
            }), this.sports = new f.SportsClient({
                client: r,
                logger: t,
                self: this
            }), this.series = new d.SeriesClient({
                client: r,
                logger: t
            }), this.tags = new p.TagsClient({
                client: r,
                logger: t
            }), this.auth = new a.AuthClient({
                client: r,
                logger: t
            }), this.profiles = new c.ProfilesClient({
                client: r,
                logger: t,
                self: this
            }), this.preferences = new l.UserPreferencesClient({
                client: r,
                logger: t,
                self: this
            }), this.walletPreferences = new et({
                client: r,
                logger: t
            }), this.users = new M({
                client: r,
                logger: t,
                self: this
            }), this.favorites = new o.FavoritesClient({
                client: r,
                logger: t
            }), this.verifications = new Z({
                client: r,
                logger: t
            })
        }
        auth;
        events;
        markets;
        favorites;
        preferences;
        profiles;
        search;
        series;
        sports;
        tags;
        users;
        verifications;
        walletPreferences;#
        m(e) {
            return e.logger ? e.logger : (0, t.createLogger)({
                scope: "intl-gamma-client",
                level: "error"
            })
        }#
        y(e) {
            if (e.url) return e.url;
            if ("" !== "https://gamma-api.polymarket.com".trim()) return "https://gamma-api.polymarket.com";
            throw Error("A Gamma API URL is required to be provided or `NEXT_PUBLIC_GAMMA_API_URL` to be set in the environment variables")
        }
        static execute = (0, r.bindKeyedExecutable)({
            client: er
        })
    }
    var en = e.i(631222);
    let ea = null;
    e.s(["getGammaClient", 0, () => (ea || (ea = new er({
        url: en.GAMMA_API_URL
    })), ea), "initGammaClient", 0, e => ea = new er({
        url: en.GAMMA_API_URL,
        logger: e.instance("intl-gamma-client")
    })], 305292)
}, 191010, e => {
    "use strict";
    e.s(["useIsLoggedIn", () => h]);
    var t = e.i(964974),
        r = e.i(318594),
        n = e.i(416340),
        a = e.i(778983),
        i = e.i(493164),
        o = e.i(5146),
        s = e.i(510954),
        l = e.i(57096),
        c = e.i(305292),
        u = e.i(631222),
        d = e.i(721270),
        f = e.i(635672);
    let p = async () => {
            let e = await (0, c.getGammaClient)().auth.session();
            return "success" === e.status ? {
                status: "success",
                type: e.data.type,
                address: e.data.address
            } : 401 === e.error.code ? {
                status: "logged-out"
            } : {
                status: "failure",
                error: e.error,
                code: e.error.code,
                type: "other"
            }
        },
        h = () => {
            let e = (0, r.useQueryClient)(),
                c = n.default.useRef(void 0),
                h = n.default.useRef(void 0),
                m = n.default.useCallback(t => {
                    if (h.current === t) return;
                    h.current = t;
                    let r = u.MATIC_CONFIG.chainId,
                        n = (0, o.getChainSpecificUsdcAddress)(r);
                    e.prefetchQuery({
                        queryKey: s.queryKeys[l.QueryKey.Positions].value(t).queryKey,
                        queryFn: () => (0, a.positionsValueFetcher)(t),
                        staleTime: 15e3
                    }), e.prefetchQuery({
                        queryKey: s.queryKeys[l.QueryKey.TokenBalance].token(t, n, r).queryKey,
                        queryFn: () => (0, i.tokenBalanceFetcher)(t, n, u.USDC_DECIMALS),
                        staleTime: 15e3
                    })
                }, [e]);
            n.default.useEffect(() => {
                let e = (0, f.getSessionHint)();
                e && m((0, d.getProxyAddress)(e.address, e.type))
            }, [m]);
            let {
                data: y,
                isPending: g,
                refetch: b
            } = (0, t.useQuery)({
                queryKey: s.queryKeys[l.QueryKey.Auth].isLoggedIn().queryKey,
                queryFn: p,
                refetchOnMount: !0,
                refetchOnWindowFocus: !1,
                refetchOnReconnect: !1,
                retry: !1
            });
            return n.default.useEffect(() => {
                if (y) {
                    if ("success" !== y.status) {
                        h.current = void 0, (0, f.clearSessionHint)();
                        return
                    }(0, f.setSessionHint)(y.address, y.type), m((0, d.getProxyAddress)(y.address, y.type))
                }
            }, [y, m]), {
                refetch: b,
                data: n.default.useMemo(() => {
                    if (!y && g) return {
                        isLoggedIn: !1,
                        isLoggedInPending: !0,
                        authenticatedUser: void 0,
                        gamma: {
                            status: "pending"
                        }
                    };
                    if (y ? .status === "success") {
                        let e = {
                            type: y.type,
                            address: y.address
                        };
                        return c.current = e, {
                            isLoggedIn: !0,
                            isLoggedInPending: !1,
                            authenticatedUser: e,
                            gamma: {
                                status: "success",
                                type: y.type,
                                address: y.address
                            }
                        }
                    }
                    return y ? .status === "failure" ? c.current ? {
                        isLoggedIn: !0,
                        isLoggedInPending: !1,
                        authenticatedUser: c.current,
                        gamma: {
                            status: "failure",
                            code: y.code,
                            type: y.type
                        }
                    } : {
                        isLoggedIn: !1,
                        isLoggedInPending: !1,
                        authenticatedUser: void 0,
                        gamma: {
                            status: "failure",
                            code: y.code,
                            type: y.type
                        }
                    } : (c.current = void 0, {
                        isLoggedIn: !1,
                        isLoggedInPending: !1,
                        authenticatedUser: void 0,
                        gamma: {
                            status: "logged-out"
                        }
                    })
                }, [y, g])
            }
        }
}, 516494, 748063, 357805, 497329, 298537, 467458, e => {
    "use strict";
    e.s(["BUILDER_FEES_BPS", 0, 1e4, "END_CURSOR", 0, "LTE=", "INITIAL_CURSOR", 0, "MA==", "ORDER_VERSION_MISMATCH_ERROR", 0, "order_version_mismatch", "bytes32Zero", 0, "0x0000000000000000000000000000000000000000000000000000000000000000"], 516494), e.s(["ARE_ORDERS_SCORING", 0, "/orders-scoring", "CANCEL_ALL", 0, "/cancel-all", "CANCEL_MARKET_ORDERS", 0, "/cancel-market-orders", "CANCEL_ORDER", 0, "/order", "CANCEL_ORDERS", 0, "/orders", "CLOSED_ONLY", 0, "/auth/ban-status/closed-only", "CREATE_API_KEY", 0, "/auth/api-key", "CREATE_BUILDER_API_KEY", 0, "/auth/builder-api-key", "CREATE_READONLY_API_KEY", 0, "/auth/readonly-api-key", "DELETE_API_KEY", 0, "/auth/api-key", "DELETE_READONLY_API_KEY", 0, "/auth/readonly-api-key", "DERIVE_API_KEY", 0, "/auth/derive-api-key", "DROP_NOTIFICATIONS", 0, "/notifications", "GET_API_KEYS", 0, "/auth/api-keys", "GET_BALANCE_ALLOWANCE", 0, "/balance-allowance", "GET_BUILDER_API_KEYS", 0, "/auth/builder-api-key", "GET_BUILDER_FEES", 0, "/fees/builder-fees/", "GET_BUILDER_TRADES", 0, "/builder/trades", "GET_CLOB_MARKET", 0, "/clob-markets/", "GET_EARNINGS_FOR_USER_FOR_DAY", 0, "/rewards/user", "GET_FEE_RATE", 0, "/fee-rate", "GET_LAST_TRADES_PRICES", 0, "/last-trades-prices", "GET_LAST_TRADE_PRICE", 0, "/last-trade-price", "GET_LIQUIDITY_REWARD_PERCENTAGES", 0, "/rewards/user/percentages", "GET_MARKET", 0, "/markets/", "GET_MARKETS", 0, "/markets", "GET_MARKET_BY_TOKEN", 0, "/markets-by-token/", "GET_MARKET_TRADES_EVENTS", 0, "/markets/live-activity/", "GET_MIDPOINT", 0, "/midpoint", "GET_MIDPOINTS", 0, "/midpoints", "GET_NEG_RISK", 0, "/neg-risk", "GET_NOTIFICATIONS", 0, "/notifications", "GET_OPEN_ORDERS", 0, "/data/orders", "GET_ORDER", 0, "/data/order/", "GET_ORDER_BOOK", 0, "/book", "GET_ORDER_BOOKS", 0, "/books", "GET_PRE_MIGRATION_ORDERS", 0, "/data/pre-migration-orders", "GET_PRICE", 0, "/price", "GET_PRICES", 0, "/prices", "GET_PRICES_HISTORY", 0, "/prices-history", "GET_READONLY_API_KEYS", 0, "/auth/readonly-api-keys", "GET_REWARDS_EARNINGS_PERCENTAGES", 0, "/rewards/user/markets", "GET_REWARDS_MARKETS", 0, "/rewards/markets/", "GET_REWARDS_MARKETS_CURRENT", 0, "/rewards/markets/current", "GET_SAMPLING_MARKETS", 0, "/sampling-markets", "GET_SAMPLING_SIMPLIFIED_MARKETS", 0, "/sampling-simplified-markets", "GET_SIMPLIFIED_MARKETS", 0, "/simplified-markets", "GET_SPREAD", 0, "/spread", "GET_SPREADS", 0, "/spreads", "GET_TICK_SIZE", 0, "/tick-size", "GET_TOTAL_EARNINGS_FOR_USER_FOR_DAY", 0, "/rewards/user/total", "GET_TRADES", 0, "/data/trades", "HEARTBEAT", 0, "/v1/heartbeats", "IS_ORDER_SCORING", 0, "/order-scoring", "OK", 0, "/ok", "POST_ORDER", 0, "/order", "POST_ORDERS", 0, "/orders", "REVOKE_BUILDER_API_KEY", 0, "/auth/builder-api-key", "TIME", 0, "/time", "UPDATE_BALANCE_ALLOWANCE", 0, "/balance-allowance/update"], 748063);
    let t = Error("Signer is needed to interact with this endpoint!"),
        r = Error("API Credentials are needed to interact with this endpoint!");
    var n = class extends Error {
        status;
        data;
        constructor(e, t, r) {
            super(e), this.name = "ApiError", this.status = t, this.data = r
        }
    };

    function a(e) {
        if (!Number.isFinite(e) || e < 0 || e > 100 || e > 0 && e < 1) throw Error("feeSlippage must be 0 or a percentage between 1 and 100")
    }
    e.s(["ApiError", 0, n, "L1_AUTH_UNAVAILABLE_ERROR", 0, t, "L2_AUTH_NOT_AVAILABLE", 0, r], 357805), e.s(["adjustBuyAmountForFees", 0, function(e, t, r, n, i, o, s = 0) {
        a(s);
        let l = n * (t * (1 - t)) ** i * (1 + s / 100),
            c = Math.min(e, r),
            u = c / t * l,
            d = c * o;
        return r <= e + u + d ? Math.max(r - u - d, 0) : e
    }, "validateFeeSlippage", 0, a], 497329);
    let i = async e => {
            let t = e.account ? .address;
            if ("string" == typeof t && t.length > 0) return t;
            if ("function" == typeof e.requestAddresses) {
                let [t] = await e.requestAddresses();
                if ("string" == typeof t && t.length > 0) return t
            }
            if ("function" == typeof e.getAddresses) {
                let [t] = await e.getAddresses();
                if ("string" == typeof t && t.length > 0) return t
            }
            throw Error("wallet client is missing account address")
        },
        o = async e => {
            if ("function" == typeof e._signTypedData) return e.getAddress();
            if ("function" == typeof e.signTypedData) return i(e);
            throw Error("unsupported signer type")
        },
        s = async ({
            signer: e,
            domain: t,
            types: r,
            value: n,
            primaryType: a
        }) => {
            if ("function" == typeof e._signTypedData) return e._signTypedData(t, r, n);
            if ("function" == typeof e.signTypedData) {
                let o = e.account ? ? await i(e);
                return e.signTypedData({
                    account: o,
                    domain: t,
                    types: r,
                    primaryType: a,
                    message: n
                })
            }
            throw Error("unsupported signer type")
        };
    e.s(["getSignerAddress", 0, o, "signTypedDataWithSigner", 0, s], 298537);
    let l = async (e, t, r, n, a) => {
            let i = a ? ? await o(e),
                l = r.toString();
            return await s({
                signer: e,
                domain: {
                    name: "ClobAuthDomain",
                    version: "1",
                    chainId: t
                },
                types: {
                    ClobAuth: [{
                        name: "address",
                        type: "address"
                    }, {
                        name: "timestamp",
                        type: "string"
                    }, {
                        name: "nonce",
                        type: "uint256"
                    }, {
                        name: "message",
                        type: "string"
                    }]
                },
                value: {
                    address: i,
                    timestamp: l,
                    nonce: n,
                    message: "This message attests that I control the given wallet"
                },
                primaryType: "ClobAuth"
            })
        },
        c = async (e, t, r, n, a) => {
            if (!e) throw Error("buildPolyHmacSignature: secret is empty");
            if (!globalThis.crypto ? .subtle) throw Error("buildPolyHmacSignature: globalThis.crypto.subtle is unavailable. Requires Node >=20 or a secure browser context (HTTPS or localhost).");
            let i = t + r + n;
            void 0 !== a && (i += a);
            let o = (e => {
                    let t = e.replace(/-/g, "+").replace(/_/g, "/"),
                        r = atob(t + "=".repeat((4 - t.length % 4) % 4)),
                        n = new Uint8Array(new ArrayBuffer(r.length));
                    for (let e = 0; e < r.length; e++) n[e] = r.charCodeAt(e);
                    return n
                })(e),
                s = await globalThis.crypto.subtle.importKey("raw", o, {
                    name: "HMAC",
                    hash: "SHA-256"
                }, !1, ["sign"]),
                l = new Uint8Array(await globalThis.crypto.subtle.sign("HMAC", s, new TextEncoder().encode(i))),
                c = "";
            for (let e = 0; e < l.length; e++) c += String.fromCharCode(l[e]);
            return btoa(c).replace(/\+/g, "-").replace(/\//g, "_")
        },
        u = async (e, t, r, n, a) => {
            let i = Math.floor(Date.now() / 1e3);
            void 0 !== n && (i = n);
            let s = 0;
            void 0 !== r && (s = r);
            let c = await l(e, t, i, s, a);
            return {
                POLY_ADDRESS: a ? ? await o(e),
                POLY_SIGNATURE: c,
                POLY_TIMESTAMP: `${i}`,
                POLY_NONCE: `${s}`
            }
        },
        d = async (e, t, r, n) => {
            let a = Math.floor(Date.now() / 1e3);
            return void 0 !== n && (a = n), {
                POLY_ADDRESS: await o(e),
                POLY_SIGNATURE: await c(t.secret, a, r.method, r.requestPath, r.body),
                POLY_TIMESTAMP: `${a}`,
                POLY_API_KEY: t.key,
                POLY_PASSPHRASE: t.passphrase
            }
        };
    e.s(["createL1Headers", 0, u, "createL2Headers", 0, d], 467458)
}, 179191, e => {
    "use strict";
    let t, r, n, a;
    var i, o, s, l, c = e.i(284553);

    function u(e, t) {
        return function() {
            return e.apply(t, arguments)
        }
    }
    let {
        toString: d
    } = Object.prototype, {
        getPrototypeOf: f
    } = Object, {
        iterator: p,
        toStringTag: h
    } = Symbol, m = (t = Object.create(null), e => {
        let r = d.call(e);
        return t[r] || (t[r] = r.slice(8, -1).toLowerCase())
    }), y = e => (e = e.toLowerCase(), t => m(t) === e), g = e => t => typeof t === e, {
        isArray: b
    } = Array, v = g("undefined");

    function x(e) {
        return null !== e && !v(e) && null !== e.constructor && !v(e.constructor) && C(e.constructor.isBuffer) && e.constructor.isBuffer(e)
    }
    let w = y("ArrayBuffer"),
        _ = g("string"),
        C = g("function"),
        E = g("number"),
        S = e => null !== e && "object" == typeof e,
        A = e => {
            if ("object" !== m(e)) return !1;
            let t = f(e);
            return (null === t || t === Object.prototype || null === Object.getPrototypeOf(t)) && !(h in e) && !(p in e)
        },
        I = y("Date"),
        T = y("File"),
        k = y("Blob"),
        O = y("FileList"),
        R = "u" > typeof globalThis ? globalThis : "u" > typeof self ? self : "u" > typeof window ? window : e.g,
        N = void 0 !== R.FormData ? R.FormData : void 0,
        M = y("URLSearchParams"),
        [P, D, j, L] = ["ReadableStream", "Request", "Response", "Headers"].map(y);

    function F(e, t, {
        allOwnKeys: r = !1
    } = {}) {
        let n, a;
        if (null != e)
            if ("object" != typeof e && (e = [e]), b(e))
                for (n = 0, a = e.length; n < a; n++) t.call(null, e[n], n, e);
            else {
                let a;
                if (x(e)) return;
                let i = r ? Object.getOwnPropertyNames(e) : Object.keys(e),
                    o = i.length;
                for (n = 0; n < o; n++) a = i[n], t.call(null, e[a], a, e)
            }
    }

    function U(e, t) {
        let r;
        if (x(e)) return null;
        t = t.toLowerCase();
        let n = Object.keys(e),
            a = n.length;
        for (; a-- > 0;)
            if (t === (r = n[a]).toLowerCase()) return r;
        return null
    }
    let $ = "u" > typeof globalThis ? globalThis : "u" > typeof self ? self : "u" > typeof window ? window : e.g,
        z = e => !v(e) && e !== $,
        B = (r = "u" > typeof Uint8Array && f(Uint8Array), e => r && e instanceof r),
        q = y("HTMLFormElement"),
        W = (({
            hasOwnProperty: e
        }) => (t, r) => e.call(t, r))(Object.prototype),
        Z = y("RegExp"),
        V = (e, t) => {
            let r = Object.getOwnPropertyDescriptors(e),
                n = {};
            F(r, (r, a) => {
                let i;
                !1 !== (i = t(r, a, e)) && (n[a] = i || r)
            }), Object.defineProperties(e, n)
        },
        K = y("AsyncFunction"),
        H = (i = "function" == typeof setImmediate, o = C($.postMessage), i ? setImmediate : o ? (s = `axios@${Math.random()}`, l = [], $.addEventListener("message", ({
            source: e,
            data: t
        }) => {
            e === $ && t === s && l.length && l.shift()()
        }, !1), e => {
            l.push(e), $.postMessage(s, "*")
        }) : e => setTimeout(e)),
        G = "u" > typeof queueMicrotask ? queueMicrotask.bind($) : void 0 !== c.default && c.default.nextTick || H,
        Q = {
            isArray: b,
            isArrayBuffer: w,
            isBuffer: x,
            isFormData: e => {
                if (!e) return !1;
                if (N && e instanceof N) return !0;
                let t = f(e);
                if (!t || t === Object.prototype || !C(e.append)) return !1;
                let r = m(e);
                return "formdata" === r || "object" === r && C(e.toString) && "[object FormData]" === e.toString()
            },
            isArrayBufferView: function(e) {
                return "u" > typeof ArrayBuffer && ArrayBuffer.isView ? ArrayBuffer.isView(e) : e && e.buffer && w(e.buffer)
            },
            isString: _,
            isNumber: E,
            isBoolean: e => !0 === e || !1 === e,
            isObject: S,
            isPlainObject: A,
            isEmptyObject: e => {
                if (!S(e) || x(e)) return !1;
                try {
                    return 0 === Object.keys(e).length && Object.getPrototypeOf(e) === Object.prototype
                } catch (e) {
                    return !1
                }
            },
            isReadableStream: P,
            isRequest: D,
            isResponse: j,
            isHeaders: L,
            isUndefined: v,
            isDate: I,
            isFile: T,
            isReactNativeBlob: e => !!(e && void 0 !== e.uri),
            isReactNative: e => e && void 0 !== e.getParts,
            isBlob: k,
            isRegExp: Z,
            isFunction: C,
            isStream: e => S(e) && C(e.pipe),
            isURLSearchParams: M,
            isTypedArray: B,
            isFileList: O,
            forEach: F,
            merge: function e(...t) {
                let {
                    caseless: r,
                    skipUndefined: n
                } = z(this) && this || {}, a = {}, i = (t, i) => {
                    if ("__proto__" === i || "constructor" === i || "prototype" === i) return;
                    let o = r && U(a, i) || i,
                        s = W(a, o) ? a[o] : void 0;
                    A(s) && A(t) ? a[o] = e(s, t) : A(t) ? a[o] = e({}, t) : b(t) ? a[o] = t.slice() : n && v(t) || (a[o] = t)
                };
                for (let e = 0, r = t.length; e < r; e++) t[e] && F(t[e], i);
                return a
            },
            extend: (e, t, r, {
                allOwnKeys: n
            } = {}) => (F(t, (t, n) => {
                r && C(t) ? Object.defineProperty(e, n, {
                    __proto__: null,
                    value: u(t, r),
                    writable: !0,
                    enumerable: !0,
                    configurable: !0
                }) : Object.defineProperty(e, n, {
                    __proto__: null,
                    value: t,
                    writable: !0,
                    enumerable: !0,
                    configurable: !0
                })
            }, {
                allOwnKeys: n
            }), e),
            trim: e => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""),
            stripBOM: e => (65279 === e.charCodeAt(0) && (e = e.slice(1)), e),
            inherits: (e, t, r, n) => {
                e.prototype = Object.create(t.prototype, n), Object.defineProperty(e.prototype, "constructor", {
                    __proto__: null,
                    value: e,
                    writable: !0,
                    enumerable: !1,
                    configurable: !0
                }), Object.defineProperty(e, "super", {
                    __proto__: null,
                    value: t.prototype
                }), r && Object.assign(e.prototype, r)
            },
            toFlatObject: (e, t, r, n) => {
                let a, i, o, s = {};
                if (t = t || {}, null == e) return t;
                do {
                    for (i = (a = Object.getOwnPropertyNames(e)).length; i-- > 0;) o = a[i], (!n || n(o, e, t)) && !s[o] && (t[o] = e[o], s[o] = !0);
                    e = !1 !== r && f(e)
                } while (e && (!r || r(e, t)) && e !== Object.prototype) return t
            },
            kindOf: m,
            kindOfTest: y,
            endsWith: (e, t, r) => {
                e = String(e), (void 0 === r || r > e.length) && (r = e.length), r -= t.length;
                let n = e.indexOf(t, r);
                return -1 !== n && n === r
            },
            toArray: e => {
                if (!e) return null;
                if (b(e)) return e;
                let t = e.length;
                if (!E(t)) return null;
                let r = Array(t);
                for (; t-- > 0;) r[t] = e[t];
                return r
            },
            forEachEntry: (e, t) => {
                let r, n = (e && e[p]).call(e);
                for (;
                    (r = n.next()) && !r.done;) {
                    let n = r.value;
                    t.call(e, n[0], n[1])
                }
            },
            matchAll: (e, t) => {
                let r, n = [];
                for (; null !== (r = e.exec(t));) n.push(r);
                return n
            },
            isHTMLForm: q,
            hasOwnProperty: W,
            hasOwnProp: W,
            reduceDescriptors: V,
            freezeMethods: e => {
                V(e, (t, r) => {
                    if (C(e) && ["arguments", "caller", "callee"].includes(r)) return !1;
                    if (C(e[r])) {
                        if (t.enumerable = !1, "writable" in t) {
                            t.writable = !1;
                            return
                        }
                        t.set || (t.set = () => {
                            throw Error("Can not rewrite read-only method '" + r + "'")
                        })
                    }
                })
            },
            toObjectSet: (e, t) => {
                let r = {};
                return (b(e) ? e : String(e).split(t)).forEach(e => {
                    r[e] = !0
                }), r
            },
            toCamelCase: e => e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function(e, t, r) {
                return t.toUpperCase() + r
            }),
            noop: () => {},
            toFiniteNumber: (e, t) => null != e && Number.isFinite(e *= 1) ? e : t,
            findKey: U,
            global: $,
            isContextDefined: z,
            isSpecCompliantForm: function(e) {
                return !!(e && C(e.append) && "FormData" === e[h] && e[p])
            },
            toJSONObject: e => {
                let t = Array(10),
                    r = (e, n) => {
                        if (S(e)) {
                            if (t.indexOf(e) >= 0) return;
                            if (x(e)) return e;
                            if (!("toJSON" in e)) {
                                t[n] = e;
                                let a = b(e) ? [] : {};
                                return F(e, (e, t) => {
                                    let i = r(e, n + 1);
                                    v(i) || (a[t] = i)
                                }), t[n] = void 0, a
                            }
                        }
                        return e
                    };
                return r(e, 0)
            },
            isAsyncFn: K,
            isThenable: e => e && (S(e) || C(e)) && C(e.then) && C(e.catch),
            setImmediate: H,
            asap: G,
            isIterable: e => null != e && C(e[p])
        };
    var J = e.i(93257);
    let Y = Q.toObjectSet(["age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent"]),
        X = Symbol("internals"),
        ee = /[^\x09\x20-\x7E\x80-\xFF]/g;

    function et(e) {
        return e && String(e).trim().toLowerCase()
    }

    function er(e) {
        return !1 === e || null == e ? e : Q.isArray(e) ? e.map(er) : function(e) {
            let t = 0,
                r = e.length;
            for (; t < r;) {
                let r = e.charCodeAt(t);
                if (9 !== r && 32 !== r) break;
                t += 1
            }
            for (; r > t;) {
                let t = e.charCodeAt(r - 1);
                if (9 !== t && 32 !== t) break;
                r -= 1
            }
            return 0 === t && r === e.length ? e : e.slice(t, r)
        }(String(e).replace(ee, ""))
    }

    function en(e, t, r, n, a) {
        if (Q.isFunction(n)) return n.call(this, t, r);
        if (a && (t = r), Q.isString(t)) {
            if (Q.isString(n)) return -1 !== t.indexOf(n);
            if (Q.isRegExp(n)) return n.test(t)
        }
    }
    class ea {
        constructor(e) {
            e && this.set(e)
        }
        set(e, t, r) {
            let n = this;

            function a(e, t, r) {
                let a = et(t);
                if (!a) throw Error("header name must be a non-empty string");
                let i = Q.findKey(n, a);
                i && void 0 !== n[i] && !0 !== r && (void 0 !== r || !1 === n[i]) || (n[i || t] = er(e))
            }
            let i = (e, t) => Q.forEach(e, (e, r) => a(e, r, t));
            if (Q.isPlainObject(e) || e instanceof this.constructor) i(e, t);
            else {
                let n;
                if (Q.isString(e) && (e = e.trim()) && (n = e, !/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim()))) {
                    var o;
                    let r, n, a, s;
                    i((s = {}, (o = e) && o.split("\n").forEach(function(e) {
                        a = e.indexOf(":"), r = e.substring(0, a).trim().toLowerCase(), n = e.substring(a + 1).trim(), !r || s[r] && Y[r] || ("set-cookie" === r ? s[r] ? s[r].push(n) : s[r] = [n] : s[r] = s[r] ? s[r] + ", " + n : n)
                    }), s), t)
                } else if (Q.isObject(e) && Q.isIterable(e)) {
                    let r = {},
                        n, a;
                    for (let t of e) {
                        if (!Q.isArray(t)) throw TypeError("Object iterator must return a key-value pair");
                        r[a = t[0]] = (n = r[a]) ? Q.isArray(n) ? [...n, t[1]] : [n, t[1]] : t[1]
                    }
                    i(r, t)
                } else null != e && a(t, e, r)
            }
            return this
        }
        get(e, t) {
            if (e = et(e)) {
                let r = Q.findKey(this, e);
                if (r) {
                    let e = this[r];
                    if (!t) return e;
                    if (!0 === t) {
                        let t, r = Object.create(null),
                            n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
                        for (; t = n.exec(e);) r[t[1]] = t[2];
                        return r
                    }
                    if (Q.isFunction(t)) return t.call(this, e, r);
                    if (Q.isRegExp(t)) return t.exec(e);
                    throw TypeError("parser must be boolean|regexp|function")
                }
            }
        }
        has(e, t) {
            if (e = et(e)) {
                let r = Q.findKey(this, e);
                return !!(r && void 0 !== this[r] && (!t || en(this, this[r], r, t)))
            }
            return !1
        }
        delete(e, t) {
            let r = this,
                n = !1;

            function a(e) {
                if (e = et(e)) {
                    let a = Q.findKey(r, e);
                    a && (!t || en(r, r[a], a, t)) && (delete r[a], n = !0)
                }
            }
            return Q.isArray(e) ? e.forEach(a) : a(e), n
        }
        clear(e) {
            let t = Object.keys(this),
                r = t.length,
                n = !1;
            for (; r--;) {
                let a = t[r];
                (!e || en(this, this[a], a, e, !0)) && (delete this[a], n = !0)
            }
            return n
        }
        normalize(e) {
            let t = this,
                r = {};
            return Q.forEach(this, (n, a) => {
                let i = Q.findKey(r, a);
                if (i) {
                    t[i] = er(n), delete t[a];
                    return
                }
                let o = e ? a.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, t, r) => t.toUpperCase() + r) : String(a).trim();
                o !== a && delete t[a], t[o] = er(n), r[o] = !0
            }), this
        }
        concat(...e) {
            return this.constructor.concat(this, ...e)
        }
        toJSON(e) {
            let t = Object.create(null);
            return Q.forEach(this, (r, n) => {
                null != r && !1 !== r && (t[n] = e && Q.isArray(r) ? r.join(", ") : r)
            }), t
        }[Symbol.iterator]() {
            return Object.entries(this.toJSON())[Symbol.iterator]()
        }
        toString() {
            return Object.entries(this.toJSON()).map(([e, t]) => e + ": " + t).join("\n")
        }
        getSetCookie() {
            return this.get("set-cookie") || []
        }
        get[Symbol.toStringTag]() {
            return "AxiosHeaders"
        }
        static from(e) {
            return e instanceof this ? e : new this(e)
        }
        static concat(e, ...t) {
            let r = new this(e);
            return t.forEach(e => r.set(e)), r
        }
        static accessor(e) {
            let t = (this[X] = this[X] = {
                    accessors: {}
                }).accessors,
                r = this.prototype;

            function n(e) {
                let n = et(e);
                if (!t[n]) {
                    let a;
                    a = Q.toCamelCase(" " + e), ["get", "set", "has"].forEach(t => {
                        Object.defineProperty(r, t + a, {
                            __proto__: null,
                            value: function(r, n, a) {
                                return this[t].call(this, e, r, n, a)
                            },
                            configurable: !0
                        })
                    }), t[n] = !0
                }
            }
            return Q.isArray(e) ? e.forEach(n) : n(e), this
        }
    }
    ea.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]), Q.reduceDescriptors(ea.prototype, ({
        value: e
    }, t) => {
        let r = t[0].toUpperCase() + t.slice(1);
        return {
            get: () => e,
            set(e) {
                this[r] = e
            }
        }
    }), Q.freezeMethods(ea);
    class ei extends Error {
        static from(e, t, r, n, a, i) {
            let o = new ei(e.message, t || e.code, r, n, a);
            return o.cause = e, o.name = e.name, null != e.status && null == o.status && (o.status = e.status), i && Object.assign(o, i), o
        }
        constructor(e, t, r, n, a) {
            super(e), Object.defineProperty(this, "message", {
                __proto__: null,
                value: e,
                enumerable: !0,
                writable: !0,
                configurable: !0
            }), this.name = "AxiosError", this.isAxiosError = !0, t && (this.code = t), r && (this.config = r), n && (this.request = n), a && (this.response = a, this.status = a.status)
        }
        toJSON() {
            let e, t, r, n = this.config,
                a = n && Q.hasOwnProp(n, "redact") ? n.redact : void 0,
                i = Q.isArray(a) && a.length > 0 ? (e = new Set(a.map(e => String(e).toLowerCase())), t = [], (r = n => {
                    let a;
                    if (null === n || "object" != typeof n || Q.isBuffer(n)) return n;
                    if (-1 === t.indexOf(n)) {
                        if (n instanceof ea && (n = n.toJSON()), t.push(n), Q.isArray(n)) a = [], n.forEach((e, t) => {
                            let n = r(e);
                            Q.isUndefined(n) || (a[t] = n)
                        });
                        else {
                            if (!Q.isPlainObject(n) && function(e) {
                                    if (Q.hasOwnProp(e, "toJSON")) return !0;
                                    let t = Object.getPrototypeOf(e);
                                    for (; t && t !== Object.prototype;) {
                                        if (Q.hasOwnProp(t, "toJSON")) return !0;
                                        t = Object.getPrototypeOf(t)
                                    }
                                    return !1
                                }(n)) return t.pop(), n;
                            for (let [t, i] of (a = Object.create(null), Object.entries(n))) {
                                let n = e.has(t.toLowerCase()) ? "[REDACTED ****]" : r(i);
                                Q.isUndefined(n) || (a[t] = n)
                            }
                        }
                        return t.pop(), a
                    }
                })(n)) : Q.toJSONObject(n);
            return {
                message: this.message,
                name: this.name,
                description: this.description,
                number: this.number,
                fileName: this.fileName,
                lineNumber: this.lineNumber,
                columnNumber: this.columnNumber,
                stack: this.stack,
                config: i,
                code: this.code,
                status: this.status
            }
        }
    }
    ei.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE", ei.ERR_BAD_OPTION = "ERR_BAD_OPTION", ei.ECONNABORTED = "ECONNABORTED", ei.ETIMEDOUT = "ETIMEDOUT", ei.ECONNREFUSED = "ECONNREFUSED", ei.ERR_NETWORK = "ERR_NETWORK", ei.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS", ei.ERR_DEPRECATED = "ERR_DEPRECATED", ei.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE", ei.ERR_BAD_REQUEST = "ERR_BAD_REQUEST", ei.ERR_CANCELED = "ERR_CANCELED", ei.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT", ei.ERR_INVALID_URL = "ERR_INVALID_URL", ei.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
    let eo = ei;

    function es(e) {
        return Q.isPlainObject(e) || Q.isArray(e)
    }

    function el(e) {
        return Q.endsWith(e, "[]") ? e.slice(0, -2) : e
    }

    function ec(e, t, r) {
        return e ? e.concat(t).map(function(e, t) {
            return e = el(e), !r && t ? "[" + e + "]" : e
        }).join(r ? "." : "") : t
    }
    let eu = Q.toFlatObject(Q, {}, null, function(e) {
            return /^is[A-Z]/.test(e)
        }),
        ed = function(e, t, r) {
            if (!Q.isObject(e)) throw TypeError("target must be an object");
            t = t || new FormData;
            let n = (r = Q.toFlatObject(r, {
                    metaTokens: !0,
                    dots: !1,
                    indexes: !1
                }, !1, function(e, t) {
                    return !Q.isUndefined(t[e])
                })).metaTokens,
                a = r.visitor || d,
                i = r.dots,
                o = r.indexes,
                s = r.Blob || "u" > typeof Blob && Blob,
                l = void 0 === r.maxDepth ? 100 : r.maxDepth,
                c = s && Q.isSpecCompliantForm(t);
            if (!Q.isFunction(a)) throw TypeError("visitor must be a function");

            function u(e) {
                if (null === e) return "";
                if (Q.isDate(e)) return e.toISOString();
                if (Q.isBoolean(e)) return e.toString();
                if (!c && Q.isBlob(e)) throw new eo("Blob is not supported. Use a Buffer instead.");
                return Q.isArrayBuffer(e) || Q.isTypedArray(e) ? c && "function" == typeof Blob ? new Blob([e]) : J.Buffer.from(e) : e
            }

            function d(e, r, a) {
                let s = e;
                if (Q.isReactNative(t) && Q.isReactNativeBlob(e)) return t.append(ec(a, r, i), u(e)), !1;
                if (e && !a && "object" == typeof e)
                    if (Q.endsWith(r, "{}")) r = n ? r : r.slice(0, -2), e = JSON.stringify(e);
                    else {
                        var l;
                        if (Q.isArray(e) && (l = e, Q.isArray(l) && !l.some(es)) || (Q.isFileList(e) || Q.endsWith(r, "[]")) && (s = Q.toArray(e))) return r = el(r), s.forEach(function(e, n) {
                            Q.isUndefined(e) || null === e || t.append(!0 === o ? ec([r], n, i) : null === o ? r : r + "[]", u(e))
                        }), !1
                    }
                return !!es(e) || (t.append(ec(a, r, i), u(e)), !1)
            }
            let f = [],
                p = Object.assign(eu, {
                    defaultVisitor: d,
                    convertValue: u,
                    isVisitable: es
                });
            if (!Q.isObject(e)) throw TypeError("data must be an object");
            return ! function e(r, n, i = 0) {
                if (!Q.isUndefined(r)) {
                    if (i > l) throw new eo("Object is too deeply nested (" + i + " levels). Max depth: " + l, eo.ERR_FORM_DATA_DEPTH_EXCEEDED);
                    if (-1 !== f.indexOf(r)) throw Error("Circular reference detected in " + n.join("."));
                    f.push(r), Q.forEach(r, function(r, o) {
                        !0 === (!(Q.isUndefined(r) || null === r) && a.call(t, r, Q.isString(o) ? o.trim() : o, n, p)) && e(r, n ? n.concat(o) : [o], i + 1)
                    }), f.pop()
                }
            }(e), t
        };

    function ef(e) {
        let t = {
            "!": "%21",
            "'": "%27",
            "(": "%28",
            ")": "%29",
            "~": "%7E",
            "%20": "+"
        };
        return encodeURIComponent(e).replace(/[!'()~]|%20/g, function(e) {
            return t[e]
        })
    }

    function ep(e, t) {
        this._pairs = [], e && ed(e, this, t)
    }
    let eh = ep.prototype;

    function em(e) {
        return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+")
    }

    function ey(e, t, r) {
        let n;
        if (!t) return e;
        let a = r && r.encode || em,
            i = Q.isFunction(r) ? {
                serialize: r
            } : r,
            o = i && i.serialize;
        if (n = o ? o(t, i) : Q.isURLSearchParams(t) ? t.toString() : new ep(t, i).toString(a)) {
            let t = e.indexOf("#"); - 1 !== t && (e = e.slice(0, t)), e += (-1 === e.indexOf("?") ? "?" : "&") + n
        }
        return e
    }
    eh.append = function(e, t) {
        this._pairs.push([e, t])
    }, eh.toString = function(e) {
        let t = e ? function(t) {
            return e.call(this, t, ef)
        } : ef;
        return this._pairs.map(function(e) {
            return t(e[0]) + "=" + t(e[1])
        }, "").join("&")
    };
    let eg = class {
            constructor() {
                this.handlers = []
            }
            use(e, t, r) {
                return this.handlers.push({
                    fulfilled: e,
                    rejected: t,
                    synchronous: !!r && r.synchronous,
                    runWhen: r ? r.runWhen : null
                }), this.handlers.length - 1
            }
            eject(e) {
                this.handlers[e] && (this.handlers[e] = null)
            }
            clear() {
                this.handlers && (this.handlers = [])
            }
            forEach(e) {
                Q.forEach(this.handlers, function(t) {
                    null !== t && e(t)
                })
            }
        },
        eb = {
            silentJSONParsing: !0,
            forcedJSONParsing: !0,
            clarifyTimeoutError: !1,
            legacyInterceptorReqResOrdering: !0
        },
        ev = "u" > typeof URLSearchParams ? URLSearchParams : ep,
        ex = "u" > typeof FormData ? FormData : null,
        ew = "u" > typeof Blob ? Blob : null,
        e_ = "u" > typeof window && "u" > typeof document,
        eC = "object" == typeof navigator && navigator || void 0,
        eE = e_ && (!eC || 0 > ["ReactNative", "NativeScript", "NS"].indexOf(eC.product)),
        eS = "u" > typeof WorkerGlobalScope && self instanceof WorkerGlobalScope && "function" == typeof self.importScripts,
        eA = e_ && window.location.href || "http://localhost";
    e.s(["hasBrowserEnv", 0, e_, "hasStandardBrowserEnv", 0, eE, "hasStandardBrowserWebWorkerEnv", 0, eS, "navigator", 0, eC, "origin", 0, eA], 417183);
    let eI = { ...e.i(417183),
            isBrowser: !0,
            classes: {
                URLSearchParams: ev,
                FormData: ex,
                Blob: ew
            },
            protocols: ["http", "https", "file", "blob", "url", "data"]
        },
        eT = function(e) {
            if (Q.isFormData(e) && Q.isFunction(e.entries)) {
                let t = {};
                return Q.forEachEntry(e, (e, r) => {
                    ! function e(t, r, n, a) {
                        let i = t[a++];
                        if ("__proto__" === i) return !0;
                        let o = Number.isFinite(+i),
                            s = a >= t.length;
                        return (i = !i && Q.isArray(n) ? n.length : i, s) ? Q.hasOwnProp(n, i) ? n[i] = Q.isArray(n[i]) ? n[i].concat(r) : [n[i], r] : n[i] = r : (n[i] && Q.isObject(n[i]) || (n[i] = []), e(t, r, n[i], a) && Q.isArray(n[i]) && (n[i] = function(e) {
                            let t, r, n = {},
                                a = Object.keys(e),
                                i = a.length;
                            for (t = 0; t < i; t++) n[r = a[t]] = e[r];
                            return n
                        }(n[i]))), !o
                    }(Q.matchAll(/\w+|\[(\w*)]/g, e).map(e => "[]" === e[0] ? "" : e[1] || e[0]), r, t, 0)
                }), t
            }
            return null
        },
        ek = (e, t) => null != e && Q.hasOwnProp(e, t) ? e[t] : void 0,
        eO = {
            transitional: eb,
            adapter: ["xhr", "http", "fetch"],
            transformRequest: [function(e, t) {
                let r, n = t.getContentType() || "",
                    a = n.indexOf("application/json") > -1,
                    i = Q.isObject(e);
                if (i && Q.isHTMLForm(e) && (e = new FormData(e)), Q.isFormData(e)) return a ? JSON.stringify(eT(e)) : e;
                if (Q.isArrayBuffer(e) || Q.isBuffer(e) || Q.isStream(e) || Q.isFile(e) || Q.isBlob(e) || Q.isReadableStream(e)) return e;
                if (Q.isArrayBufferView(e)) return e.buffer;
                if (Q.isURLSearchParams(e)) return t.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
                if (i) {
                    let t = ek(this, "formSerializer");
                    if (n.indexOf("application/x-www-form-urlencoded") > -1) return ed(e, new eI.classes.URLSearchParams, {
                        visitor: function(e, t, r, n) {
                            return eI.isNode && Q.isBuffer(e) ? (this.append(t, e.toString("base64")), !1) : n.defaultVisitor.apply(this, arguments)
                        },
                        ...t
                    }).toString();
                    if ((r = Q.isFileList(e)) || n.indexOf("multipart/form-data") > -1) {
                        let n = ek(this, "env"),
                            a = n && n.FormData;
                        return ed(r ? {
                            "files[]": e
                        } : e, a && new a, t)
                    }
                }
                if (i || a) {
                    t.setContentType("application/json", !1);
                    var o = e;
                    if (Q.isString(o)) try {
                        return (0, JSON.parse)(o), Q.trim(o)
                    } catch (e) {
                        if ("SyntaxError" !== e.name) throw e
                    }
                    return (0, JSON.stringify)(o)
                }
                return e
            }],
            transformResponse: [function(e) {
                let t = ek(this, "transitional") || eO.transitional,
                    r = t && t.forcedJSONParsing,
                    n = ek(this, "responseType"),
                    a = "json" === n;
                if (Q.isResponse(e) || Q.isReadableStream(e)) return e;
                if (e && Q.isString(e) && (r && !n || a)) {
                    let r = t && t.silentJSONParsing;
                    try {
                        return JSON.parse(e, ek(this, "parseReviver"))
                    } catch (e) {
                        if (!r && a) {
                            if ("SyntaxError" === e.name) throw eo.from(e, eo.ERR_BAD_RESPONSE, this, null, ek(this, "response"));
                            throw e
                        }
                    }
                }
                return e
            }],
            timeout: 0,
            xsrfCookieName: "XSRF-TOKEN",
            xsrfHeaderName: "X-XSRF-TOKEN",
            maxContentLength: -1,
            maxBodyLength: -1,
            env: {
                FormData: eI.classes.FormData,
                Blob: eI.classes.Blob
            },
            validateStatus: function(e) {
                return e >= 200 && e < 300
            },
            headers: {
                common: {
                    Accept: "application/json, text/plain, */*",
                    "Content-Type": void 0
                }
            }
        };

    function eR(e, t) {
        let r = this || eO,
            n = t || r,
            a = ea.from(n.headers),
            i = n.data;
        return Q.forEach(e, function(e) {
            i = e.call(r, i, a.normalize(), t ? t.status : void 0)
        }), a.normalize(), i
    }

    function eN(e) {
        return !!(e && e.__CANCEL__)
    }
    Q.forEach(["delete", "get", "head", "post", "put", "patch", "query"], e => {
        eO.headers[e] = {}
    });
    let eM = class extends eo {
        constructor(e, t, r) {
            super(null == e ? "canceled" : e, eo.ERR_CANCELED, t, r), this.name = "CanceledError", this.__CANCEL__ = !0
        }
    };

    function eP(e, t, r) {
        let n = r.config.validateStatus;
        !r.status || !n || n(r.status) ? e(r) : t(new eo("Request failed with status code " + r.status, r.status >= 400 && r.status < 500 ? eo.ERR_BAD_REQUEST : eo.ERR_BAD_RESPONSE, r.config, r.request, r))
    }
    let eD = function(e, t) {
            let r, n = Array(e = e || 10),
                a = Array(e),
                i = 0,
                o = 0;
            return t = void 0 !== t ? t : 1e3,
                function(s) {
                    let l = Date.now(),
                        c = a[o];
                    r || (r = l), n[i] = s, a[i] = l;
                    let u = o,
                        d = 0;
                    for (; u !== i;) d += n[u++], u %= e;
                    if ((i = (i + 1) % e) === o && (o = (o + 1) % e), l - r < t) return;
                    let f = c && l - c;
                    return f ? Math.round(1e3 * d / f) : void 0
                }
        },
        ej = function(e, t) {
            let r, n, a = 0,
                i = 1e3 / t,
                o = (t, i = Date.now()) => {
                    a = i, r = null, n && (clearTimeout(n), n = null), e(...t)
                };
            return [(...e) => {
                let t = Date.now(),
                    s = t - a;
                s >= i ? o(e, t) : (r = e, n || (n = setTimeout(() => {
                    n = null, o(r)
                }, i - s)))
            }, () => r && o(r)]
        },
        eL = (e, t, r = 3) => {
            let n = 0,
                a = eD(50, 250);
            return ej(r => {
                let i = r.loaded,
                    o = r.lengthComputable ? r.total : void 0,
                    s = null != o ? Math.min(i, o) : i,
                    l = Math.max(0, s - n),
                    c = a(l);
                n = Math.max(n, s), e({
                    loaded: s,
                    total: o,
                    progress: o ? s / o : void 0,
                    bytes: l,
                    rate: c || void 0,
                    estimated: c && o ? (o - s) / c : void 0,
                    event: r,
                    lengthComputable: null != o,
                    [t ? "download" : "upload"]: !0
                })
            }, r)
        },
        eF = (e, t) => {
            let r = null != e;
            return [n => t[0]({
                lengthComputable: r,
                total: e,
                loaded: n
            }), t[1]]
        },
        eU = e => (...t) => Q.asap(() => e(...t)),
        e$ = eI.hasStandardBrowserEnv ? (n = new URL(eI.origin), a = eI.navigator && /(msie|trident)/i.test(eI.navigator.userAgent), e => (e = new URL(e, eI.origin), n.protocol === e.protocol && n.host === e.host && (a || n.port === e.port))) : () => !0,
        ez = eI.hasStandardBrowserEnv ? {
            write(e, t, r, n, a, i, o) {
                if ("u" < typeof document) return;
                let s = [`${e}=${encodeURIComponent(t)}`];
                Q.isNumber(r) && s.push(`expires=${new Date(r).toUTCString()}`), Q.isString(n) && s.push(`path=${n}`), Q.isString(a) && s.push(`domain=${a}`), !0 === i && s.push("secure"), Q.isString(o) && s.push(`SameSite=${o}`), document.cookie = s.join("; ")
            },
            read(e) {
                if ("u" < typeof document) return null;
                let t = document.cookie.split(";");
                for (let r = 0; r < t.length; r++) {
                    let n = t[r].replace(/^\s+/, ""),
                        a = n.indexOf("=");
                    if (-1 !== a && n.slice(0, a) === e) return decodeURIComponent(n.slice(a + 1))
                }
                return null
            },
            remove(e) {
                this.write(e, "", Date.now() - 864e5, "/")
            }
        } : {
            write() {},
            read: () => null,
            remove() {}
        };

    function eB(e, t, r) {
        let n = !("string" == typeof t && /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t));
        return e && (n || !1 === r) ? t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e : t
    }
    let eq = e => e instanceof ea ? { ...e
    } : e;

    function eW(e, t) {
        t = t || {};
        let r = Object.create(null);

        function n(e, t, r, n) {
            return Q.isPlainObject(e) && Q.isPlainObject(t) ? Q.merge.call({
                caseless: n
            }, e, t) : Q.isPlainObject(t) ? Q.merge({}, t) : Q.isArray(t) ? t.slice() : t
        }

        function a(e, t, r, a) {
            return Q.isUndefined(t) ? Q.isUndefined(e) ? void 0 : n(void 0, e, r, a) : n(e, t, r, a)
        }

        function i(e, t) {
            if (!Q.isUndefined(t)) return n(void 0, t)
        }

        function o(e, t) {
            return Q.isUndefined(t) ? Q.isUndefined(e) ? void 0 : n(void 0, e) : n(void 0, t)
        }

        function s(r, a, i) {
            return Q.hasOwnProp(t, i) ? n(r, a) : Q.hasOwnProp(e, i) ? n(void 0, r) : void 0
        }
        Object.defineProperty(r, "hasOwnProperty", {
            __proto__: null,
            value: Object.prototype.hasOwnProperty,
            enumerable: !1,
            writable: !0,
            configurable: !0
        });
        let l = {
            url: i,
            method: i,
            data: i,
            baseURL: o,
            transformRequest: o,
            transformResponse: o,
            paramsSerializer: o,
            timeout: o,
            timeoutMessage: o,
            withCredentials: o,
            withXSRFToken: o,
            adapter: o,
            responseType: o,
            xsrfCookieName: o,
            xsrfHeaderName: o,
            onUploadProgress: o,
            onDownloadProgress: o,
            decompress: o,
            maxContentLength: o,
            maxBodyLength: o,
            beforeRedirect: o,
            transport: o,
            httpAgent: o,
            httpsAgent: o,
            cancelToken: o,
            socketPath: o,
            allowedSocketPaths: o,
            responseEncoding: o,
            validateStatus: s,
            headers: (e, t, r) => a(eq(e), eq(t), r, !0)
        };
        return Q.forEach(Object.keys({ ...e,
            ...t
        }), function(n) {
            if ("__proto__" === n || "constructor" === n || "prototype" === n) return;
            let i = Q.hasOwnProp(l, n) ? l[n] : a,
                o = i(Q.hasOwnProp(e, n) ? e[n] : void 0, Q.hasOwnProp(t, n) ? t[n] : void 0, n);
            Q.isUndefined(o) && i !== s || (r[n] = o)
        }), r
    }
    let eZ = ["content-type", "content-length"],
        eV = e => {
            let t = eW({}, e),
                r = e => Q.hasOwnProp(t, e) ? t[e] : void 0,
                n = r("data"),
                a = r("withXSRFToken"),
                i = r("xsrfHeaderName"),
                o = r("xsrfCookieName"),
                s = r("headers"),
                l = r("auth"),
                c = r("baseURL"),
                u = r("allowAbsoluteUrls"),
                d = r("url");
            if (t.headers = s = ea.from(s), t.url = ey(eB(c, d, u), e.params, e.paramsSerializer), l && s.set("Authorization", "Basic " + btoa((l.username || "") + ":" + (l.password ? encodeURIComponent(l.password).replace(/%([0-9A-F]{2})/gi, (e, t) => String.fromCharCode(parseInt(t, 16))) : ""))), Q.isFormData(n))
                if (eI.hasStandardBrowserEnv || eI.hasStandardBrowserWebWorkerEnv) s.setContentType(void 0);
                else {
                    var f, p;
                    Q.isFunction(n.getHeaders) && (f = s, p = n.getHeaders(), "content-only" !== r("formDataHeaderPolicy") ? f.set(p) : Object.entries(p).forEach(([e, t]) => {
                        eZ.includes(e.toLowerCase()) && f.set(e, t)
                    }))
                }
            if (eI.hasStandardBrowserEnv && (Q.isFunction(a) && (a = a(t)), !0 === a || null == a && e$(t.url))) {
                let e = i && o && ez.read(o);
                e && s.set(i, e)
            }
            return t
        },
        eK = "u" > typeof XMLHttpRequest && function(e) {
            return new Promise(function(t, r) {
                var n;
                let a, i, o, s, l, c, u = eV(e),
                    d = u.data,
                    f = ea.from(u.headers).normalize(),
                    {
                        responseType: p,
                        onUploadProgress: h,
                        onDownloadProgress: m
                    } = u;

                function y() {
                    s && s(), l && l(), u.cancelToken && u.cancelToken.unsubscribe(a), u.signal && u.signal.removeEventListener("abort", a)
                }
                let g = new XMLHttpRequest;

                function b() {
                    if (!g) return;
                    let n = ea.from("getAllResponseHeaders" in g && g.getAllResponseHeaders());
                    eP(function(e) {
                        t(e), y()
                    }, function(e) {
                        r(e), y()
                    }, {
                        data: p && "text" !== p && "json" !== p ? g.response : g.responseText,
                        status: g.status,
                        statusText: g.statusText,
                        headers: n,
                        config: e,
                        request: g
                    }), g = null
                }
                g.open(u.method.toUpperCase(), u.url, !0), g.timeout = u.timeout, "onloadend" in g ? g.onloadend = b : g.onreadystatechange = function() {
                    !g || 4 !== g.readyState || (0 !== g.status || g.responseURL && g.responseURL.startsWith("file:")) && setTimeout(b)
                }, g.onabort = function() {
                    g && (r(new eo("Request aborted", eo.ECONNABORTED, e, g)), y(), g = null)
                }, g.onerror = function(t) {
                    let n = new eo(t && t.message ? t.message : "Network Error", eo.ERR_NETWORK, e, g);
                    n.event = t || null, r(n), y(), g = null
                }, g.ontimeout = function() {
                    let t = u.timeout ? "timeout of " + u.timeout + "ms exceeded" : "timeout exceeded",
                        n = u.transitional || eb;
                    u.timeoutErrorMessage && (t = u.timeoutErrorMessage), r(new eo(t, n.clarifyTimeoutError ? eo.ETIMEDOUT : eo.ECONNABORTED, e, g)), y(), g = null
                }, void 0 === d && f.setContentType(null), "setRequestHeader" in g && Q.forEach(f.toJSON(), function(e, t) {
                    g.setRequestHeader(t, e)
                }), Q.isUndefined(u.withCredentials) || (g.withCredentials = !!u.withCredentials), p && "json" !== p && (g.responseType = u.responseType), m && ([o, l] = eL(m, !0), g.addEventListener("progress", o)), h && g.upload && ([i, s] = eL(h), g.upload.addEventListener("progress", i), g.upload.addEventListener("loadend", s)), (u.cancelToken || u.signal) && (a = t => {
                    g && (r(!t || t.type ? new eM(null, e, g) : t), g.abort(), y(), g = null)
                }, u.cancelToken && u.cancelToken.subscribe(a), u.signal && (u.signal.aborted ? a() : u.signal.addEventListener("abort", a)));
                let v = (n = u.url, (c = /^([-+\w]{1,25}):(?:\/\/)?/.exec(n)) && c[1] || "");
                v && !eI.protocols.includes(v) ? r(new eo("Unsupported protocol " + v + ":", eo.ERR_BAD_REQUEST, e)) : g.send(d || null)
            })
        },
        eH = function*(e, t) {
            let r, n = e.byteLength;
            if (!t || n < t) return void(yield e);
            let a = 0;
            for (; a < n;) r = a + t, yield e.slice(a, r), a = r
        },
        eG = async function*(e, t) {
            for await (let r of eQ(e)) yield* eH(r, t)
        },
        eQ = async function*(e) {
            if (e[Symbol.asyncIterator]) return void(yield* e);
            let t = e.getReader();
            try {
                for (;;) {
                    let {
                        done: e,
                        value: r
                    } = await t.read();
                    if (e) break;
                    yield r
                }
            } finally {
                await t.cancel()
            }
        },
        eJ = (e, t, r, n) => {
            let a, i = eG(e, t),
                o = 0,
                s = e => {
                    !a && (a = !0, n && n(e))
                };
            return new ReadableStream({
                async pull(e) {
                    try {
                        let {
                            done: t,
                            value: n
                        } = await i.next();
                        if (t) {
                            s(), e.close();
                            return
                        }
                        let a = n.byteLength;
                        if (r) {
                            let e = o += a;
                            r(e)
                        }
                        e.enqueue(new Uint8Array(n))
                    } catch (e) {
                        throw s(e), e
                    }
                },
                cancel: e => (s(e), i.return())
            }, {
                highWaterMark: 2
            })
        },
        eY = "1.16.0",
        {
            isFunction: eX
        } = Q,
        e0 = (e, ...t) => {
            try {
                return !!e(...t)
            } catch (e) {
                return !1
            }
        },
        e1 = e => {
            let t, r = Q.global ? ? globalThis,
                {
                    ReadableStream: n,
                    TextEncoder: a
                } = r,
                {
                    fetch: i,
                    Request: o,
                    Response: s
                } = e = Q.merge.call({
                    skipUndefined: !0
                }, {
                    Request: r.Request,
                    Response: r.Response
                }, e),
                l = i ? eX(i) : "function" == typeof fetch,
                c = eX(o),
                u = eX(s);
            if (!l) return !1;
            let d = l && eX(n),
                f = l && ("function" == typeof a ? (t = new a, e => t.encode(e)) : async e => new Uint8Array(await new o(e).arrayBuffer())),
                p = c && d && e0(() => {
                    let e = !1,
                        t = new o(eI.origin, {
                            body: new n,
                            method: "POST",
                            get duplex() {
                                return e = !0, "half"
                            }
                        }),
                        r = t.headers.has("Content-Type");
                    return null != t.body && t.body.cancel(), e && !r
                }),
                h = u && d && e0(() => Q.isReadableStream(new s("").body)),
                m = {
                    stream: h && (e => e.body)
                };
            l && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach(e => {
                m[e] || (m[e] = (t, r) => {
                    let n = t && t[e];
                    if (n) return n.call(t);
                    throw new eo(`Response type '${e}' is not supported`, eo.ERR_NOT_SUPPORT, r)
                })
            });
            let y = async e => {
                    if (null == e) return 0;
                    if (Q.isBlob(e)) return e.size;
                    if (Q.isSpecCompliantForm(e)) {
                        let t = new o(eI.origin, {
                            method: "POST",
                            body: e
                        });
                        return (await t.arrayBuffer()).byteLength
                    }
                    return Q.isArrayBufferView(e) || Q.isArrayBuffer(e) ? e.byteLength : (Q.isURLSearchParams(e) && (e += ""), Q.isString(e)) ? (await f(e)).byteLength : void 0
                },
                g = async (e, t) => {
                    let r = Q.toFiniteNumber(e.getContentLength());
                    return null == r ? y(t) : r
                };
            return async e => {
                let t, {
                        url: r,
                        method: n,
                        data: l,
                        signal: u,
                        cancelToken: d,
                        timeout: f,
                        onDownloadProgress: y,
                        onUploadProgress: b,
                        responseType: v,
                        headers: x,
                        withCredentials: w = "same-origin",
                        fetchOptions: _,
                        maxContentLength: C,
                        maxBodyLength: E
                    } = eV(e),
                    S = Q.isNumber(C) && C > -1,
                    A = Q.isNumber(E) && E > -1,
                    I = i || fetch;
                v = v ? (v + "").toLowerCase() : "text";
                let T = ((e, t) => {
                        let {
                            length: r
                        } = e = e ? e.filter(Boolean) : [];
                        if (t || r) {
                            let r, n = new AbortController,
                                a = function(e) {
                                    if (!r) {
                                        r = !0, o();
                                        let t = e instanceof Error ? e : this.reason;
                                        n.abort(t instanceof eo ? t : new eM(t instanceof Error ? t.message : t))
                                    }
                                },
                                i = t && setTimeout(() => {
                                    i = null, a(new eo(`timeout of ${t}ms exceeded`, eo.ETIMEDOUT))
                                }, t),
                                o = () => {
                                    e && (i && clearTimeout(i), i = null, e.forEach(e => {
                                        e.unsubscribe ? e.unsubscribe(a) : e.removeEventListener("abort", a)
                                    }), e = null)
                                };
                            e.forEach(e => e.addEventListener("abort", a));
                            let {
                                signal: s
                            } = n;
                            return s.unsubscribe = () => Q.asap(o), s
                        }
                    })([u, d && d.toAbortSignal()], f),
                    k = null,
                    O = T && T.unsubscribe && (() => {
                        T.unsubscribe()
                    });
                try {
                    if (S && "string" == typeof r && r.startsWith("data:") && function(e) {
                            if (!e || "string" != typeof e || !e.startsWith("data:")) return 0;
                            let t = e.indexOf(",");
                            if (t < 0) return 0;
                            let r = e.slice(5, t),
                                n = e.slice(t + 1);
                            if (/;base64/i.test(r)) {
                                let e = n.length,
                                    t = n.length;
                                for (let r = 0; r < t; r++)
                                    if (37 === n.charCodeAt(r) && r + 2 < t) {
                                        let t = n.charCodeAt(r + 1),
                                            a = n.charCodeAt(r + 2);
                                        (t >= 48 && t <= 57 || t >= 65 && t <= 70 || t >= 97 && t <= 102) && (a >= 48 && a <= 57 || a >= 65 && a <= 70 || a >= 97 && a <= 102) && (e -= 2, r += 2)
                                    }
                                let r = 0,
                                    a = t - 1,
                                    i = e => e >= 2 && 37 === n.charCodeAt(e - 2) && 51 === n.charCodeAt(e - 1) && (68 === n.charCodeAt(e) || 100 === n.charCodeAt(e));
                                a >= 0 && (61 === n.charCodeAt(a) ? (r++, a--) : i(a) && (r++, a -= 3)), 1 === r && a >= 0 && (61 === n.charCodeAt(a) ? r++ : i(a) && r++);
                                let o = 3 * Math.floor(e / 4) - (r || 0);
                                return o > 0 ? o : 0
                            }
                            if (void 0 !== J.Buffer && "function" == typeof J.Buffer.byteLength) return J.Buffer.byteLength(n, "utf8");
                            let a = 0;
                            for (let e = 0, t = n.length; e < t; e++) {
                                let r = n.charCodeAt(e);
                                if (r < 128) a += 1;
                                else if (r < 2048) a += 2;
                                else if (r >= 55296 && r <= 56319 && e + 1 < t) {
                                    let t = n.charCodeAt(e + 1);
                                    t >= 56320 && t <= 57343 ? (a += 4, e++) : a += 3
                                } else a += 3
                            }
                            return a
                        }(r) > C) throw new eo("maxContentLength size of " + C + " exceeded", eo.ERR_BAD_RESPONSE, e, k);
                    if (A && "get" !== n && "head" !== n) {
                        let t = await g(x, l);
                        if ("number" == typeof t && isFinite(t) && t > E) throw new eo("Request body larger than maxBodyLength limit", eo.ERR_BAD_REQUEST, e, k)
                    }
                    if (b && p && "get" !== n && "head" !== n && 0 !== (t = await g(x, l))) {
                        let e, n = new o(r, {
                            method: "POST",
                            body: l,
                            duplex: "half"
                        });
                        if (Q.isFormData(l) && (e = n.headers.get("content-type")) && x.setContentType(e), n.body) {
                            let [e, r] = eF(t, eL(eU(b)));
                            l = eJ(n.body, 65536, e, r)
                        }
                    }
                    Q.isString(w) || (w = w ? "include" : "omit");
                    let i = c && "credentials" in o.prototype;
                    if (Q.isFormData(l)) {
                        let e = x.getContentType();
                        e && /^multipart\/form-data/i.test(e) && !/boundary=/i.test(e) && x.delete("content-type")
                    }
                    x.set("User-Agent", "axios/" + eY, !1);
                    let u = { ..._,
                        signal: T,
                        method: n.toUpperCase(),
                        headers: x.normalize().toJSON(),
                        body: l,
                        duplex: "half",
                        credentials: i ? w : void 0
                    };
                    k = c && new o(r, u);
                    let d = await (c ? I(k, _) : I(r, u));
                    if (S) {
                        let t = Q.toFiniteNumber(d.headers.get("content-length"));
                        if (null != t && t > C) throw new eo("maxContentLength size of " + C + " exceeded", eo.ERR_BAD_RESPONSE, e, k)
                    }
                    let f = h && ("stream" === v || "response" === v);
                    if (h && d.body && (y || S || f && O)) {
                        let t = {};
                        ["status", "statusText", "headers"].forEach(e => {
                            t[e] = d[e]
                        });
                        let r = Q.toFiniteNumber(d.headers.get("content-length")),
                            [n, a] = y && eF(r, eL(eU(y), !0)) || [];
                        d = new s(eJ(d.body, 65536, t => {
                            if (S && t > C) throw new eo("maxContentLength size of " + C + " exceeded", eo.ERR_BAD_RESPONSE, e, k);
                            n && n(t)
                        }, () => {
                            a && a(), O && O()
                        }), t)
                    }
                    v = v || "text";
                    let R = await m[Q.findKey(m, v) || "text"](d, e);
                    if (S && !h && !f) {
                        let t;
                        if (null != R && ("number" == typeof R.byteLength ? t = R.byteLength : "number" == typeof R.size ? t = R.size : "string" == typeof R && (t = "function" == typeof a ? new a().encode(R).byteLength : R.length)), "number" == typeof t && t > C) throw new eo("maxContentLength size of " + C + " exceeded", eo.ERR_BAD_RESPONSE, e, k)
                    }
                    return !f && O && O(), await new Promise((t, r) => {
                        eP(t, r, {
                            data: R,
                            headers: ea.from(d.headers),
                            status: d.status,
                            statusText: d.statusText,
                            config: e,
                            request: k
                        })
                    })
                } catch (t) {
                    if (O && O(), T && T.aborted && T.reason instanceof eo) {
                        let r = T.reason;
                        throw r.config = e, k && (r.request = k), t !== r && (r.cause = t), r
                    }
                    if (t && "TypeError" === t.name && /Load failed|fetch/i.test(t.message)) throw Object.assign(new eo("Network Error", eo.ERR_NETWORK, e, k, t && t.response), {
                        cause: t.cause || t
                    });
                    throw eo.from(t, t && t.code, e, k, t && t.response)
                }
            }
        },
        e2 = new Map,
        e6 = e => {
            let t = e && e.env || {},
                {
                    fetch: r,
                    Request: n,
                    Response: a
                } = t,
                i = [n, a, r],
                o = i.length,
                s, l, c = e2;
            for (; o--;) s = i[o], void 0 === (l = c.get(s)) && c.set(s, l = o ? new Map : e1(t)), c = l;
            return l
        };
    e6();
    let e5 = {
        http: null,
        xhr: eK,
        fetch: {
            get: e6
        }
    };
    Q.forEach(e5, (e, t) => {
        if (e) {
            try {
                Object.defineProperty(e, "name", {
                    __proto__: null,
                    value: t
                })
            } catch (e) {}
            Object.defineProperty(e, "adapterName", {
                __proto__: null,
                value: t
            })
        }
    });
    let e3 = e => `- ${e}`,
        e4 = e => Q.isFunction(e) || null === e || !1 === e,
        e8 = function(e, t) {
            let r, n, {
                    length: a
                } = e = Q.isArray(e) ? e : [e],
                i = {};
            for (let o = 0; o < a; o++) {
                let a;
                if (n = r = e[o], !e4(r) && void 0 === (n = e5[(a = String(r)).toLowerCase()])) throw new eo(`Unknown adapter '${a}'`);
                if (n && (Q.isFunction(n) || (n = n.get(t)))) break;
                i[a || "#" + o] = n
            }
            if (!n) {
                let e = Object.entries(i).map(([e, t]) => `adapter ${e} ` + (!1 === t ? "is not supported by the environment" : "is not available in the build"));
                throw new eo("There is no suitable adapter to dispatch the request " + (a ? e.length > 1 ? "since :\n" + e.map(e3).join("\n") : " " + e3(e[0]) : "as no adapter specified"), "ERR_NOT_SUPPORT")
            }
            return n
        };

    function e7(e) {
        if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted) throw new eM(null, e)
    }

    function e9(e) {
        return e7(e), e.headers = ea.from(e.headers), e.data = eR.call(e, e.transformRequest), -1 !== ["post", "put", "patch"].indexOf(e.method) && e.headers.setContentType("application/x-www-form-urlencoded", !1), e8(e.adapter || eO.adapter, e)(e).then(function(t) {
            e7(e), e.response = t;
            try {
                t.data = eR.call(e, e.transformResponse, t)
            } finally {
                delete e.response
            }
            return t.headers = ea.from(t.headers), t
        }, function(t) {
            if (!eN(t) && (e7(e), t && t.response)) {
                e.response = t.response;
                try {
                    t.response.data = eR.call(e, e.transformResponse, t.response)
                } finally {
                    delete e.response
                }
                t.response.headers = ea.from(t.response.headers)
            }
            return Promise.reject(t)
        })
    }
    let te = {};
    ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
        te[e] = function(r) {
            return typeof r === e || "a" + (t < 1 ? "n " : " ") + e
        }
    });
    let tt = {};
    te.transitional = function(e, t, r) {
        function n(e, t) {
            return "[Axios v" + eY + "] Transitional option '" + e + "'" + t + (r ? ". " + r : "")
        }
        return (r, a, i) => {
            if (!1 === e) throw new eo(n(a, " has been removed" + (t ? " in " + t : "")), eo.ERR_DEPRECATED);
            return t && !tt[a] && (tt[a] = !0, console.warn(n(a, " has been deprecated since v" + t + " and will be removed in the near future"))), !e || e(r, a, i)
        }
    }, te.spelling = function(e) {
        return (t, r) => (console.warn(`${r} is likely a misspelling of ${e}`), !0)
    };
    let tr = function(e, t, r) {
        if ("object" != typeof e) throw new eo("options must be an object", eo.ERR_BAD_OPTION_VALUE);
        let n = Object.keys(e),
            a = n.length;
        for (; a-- > 0;) {
            let i = n[a],
                o = Object.prototype.hasOwnProperty.call(t, i) ? t[i] : void 0;
            if (o) {
                let t = e[i],
                    r = void 0 === t || o(t, i, e);
                if (!0 !== r) throw new eo("option " + i + " must be " + r, eo.ERR_BAD_OPTION_VALUE);
                continue
            }
            if (!0 !== r) throw new eo("Unknown option " + i, eo.ERR_BAD_OPTION)
        }
    };
    class tn {
        constructor(e) {
            this.defaults = e || {}, this.interceptors = {
                request: new eg,
                response: new eg
            }
        }
        async request(e, t) {
            try {
                return await this._request(e, t)
            } catch (e) {
                if (e instanceof Error) {
                    let t = {};
                    Error.captureStackTrace ? Error.captureStackTrace(t) : t = Error();
                    let r = (() => {
                        if (!t.stack) return "";
                        let e = t.stack.indexOf("\n");
                        return -1 === e ? "" : t.stack.slice(e + 1)
                    })();
                    try {
                        if (e.stack) {
                            if (r) {
                                let t = r.indexOf("\n"),
                                    n = -1 === t ? -1 : r.indexOf("\n", t + 1),
                                    a = -1 === n ? "" : r.slice(n + 1);
                                String(e.stack).endsWith(a) || (e.stack += "\n" + r)
                            }
                        } else e.stack = r
                    } catch (e) {}
                }
                throw e
            }
        }
        _request(e, t) {
            let r, n;
            "string" == typeof e ? (t = t || {}).url = e : t = e || {};
            let {
                transitional: a,
                paramsSerializer: i,
                headers: o
            } = t = eW(this.defaults, t);
            void 0 !== a && tr(a, {
                silentJSONParsing: te.transitional(te.boolean),
                forcedJSONParsing: te.transitional(te.boolean),
                clarifyTimeoutError: te.transitional(te.boolean),
                legacyInterceptorReqResOrdering: te.transitional(te.boolean)
            }, !1), null != i && (Q.isFunction(i) ? t.paramsSerializer = {
                serialize: i
            } : tr(i, {
                encode: te.function,
                serialize: te.function
            }, !0)), void 0 !== t.allowAbsoluteUrls || (void 0 !== this.defaults.allowAbsoluteUrls ? t.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : t.allowAbsoluteUrls = !0), tr(t, {
                baseUrl: te.spelling("baseURL"),
                withXsrfToken: te.spelling("withXSRFToken")
            }, !0), t.method = (t.method || this.defaults.method || "get").toLowerCase();
            let s = o && Q.merge(o.common, o[t.method]);
            o && Q.forEach(["delete", "get", "head", "post", "put", "patch", "query", "common"], e => {
                delete o[e]
            }), t.headers = ea.concat(s, o);
            let l = [],
                c = !0;
            this.interceptors.request.forEach(function(e) {
                if ("function" == typeof e.runWhen && !1 === e.runWhen(t)) return;
                c = c && e.synchronous;
                let r = t.transitional || eb;
                r && r.legacyInterceptorReqResOrdering ? l.unshift(e.fulfilled, e.rejected) : l.push(e.fulfilled, e.rejected)
            });
            let u = [];
            this.interceptors.response.forEach(function(e) {
                u.push(e.fulfilled, e.rejected)
            });
            let d = 0;
            if (!c) {
                let e = [e9.bind(this), void 0];
                for (e.unshift(...l), e.push(...u), n = e.length, r = Promise.resolve(t); d < n;) r = r.then(e[d++], e[d++]);
                return r
            }
            n = l.length;
            let f = t;
            for (; d < n;) {
                let e = l[d++],
                    t = l[d++];
                try {
                    f = e(f)
                } catch (e) {
                    t.call(this, e);
                    break
                }
            }
            try {
                r = e9.call(this, f)
            } catch (e) {
                return Promise.reject(e)
            }
            for (d = 0, n = u.length; d < n;) r = r.then(u[d++], u[d++]);
            return r
        }
        getUri(e) {
            return ey(eB((e = eW(this.defaults, e)).baseURL, e.url, e.allowAbsoluteUrls), e.params, e.paramsSerializer)
        }
    }
    Q.forEach(["delete", "get", "head", "options"], function(e) {
        tn.prototype[e] = function(t, r) {
            return this.request(eW(r || {}, {
                method: e,
                url: t,
                data: (r || {}).data
            }))
        }
    }), Q.forEach(["post", "put", "patch", "query"], function(e) {
        function t(t) {
            return function(r, n, a) {
                return this.request(eW(a || {}, {
                    method: e,
                    headers: t ? {
                        "Content-Type": "multipart/form-data"
                    } : {},
                    url: r,
                    data: n
                }))
            }
        }
        tn.prototype[e] = t(), "query" !== e && (tn.prototype[e + "Form"] = t(!0))
    });
    class ta {
        constructor(e) {
            let t;
            if ("function" != typeof e) throw TypeError("executor must be a function.");
            this.promise = new Promise(function(e) {
                t = e
            });
            const r = this;
            this.promise.then(e => {
                if (!r._listeners) return;
                let t = r._listeners.length;
                for (; t-- > 0;) r._listeners[t](e);
                r._listeners = null
            }), this.promise.then = e => {
                let t, n = new Promise(e => {
                    r.subscribe(e), t = e
                }).then(e);
                return n.cancel = function() {
                    r.unsubscribe(t)
                }, n
            }, e(function(e, n, a) {
                r.reason || (r.reason = new eM(e, n, a), t(r.reason))
            })
        }
        throwIfRequested() {
            if (this.reason) throw this.reason
        }
        subscribe(e) {
            this.reason ? e(this.reason) : this._listeners ? this._listeners.push(e) : this._listeners = [e]
        }
        unsubscribe(e) {
            if (!this._listeners) return;
            let t = this._listeners.indexOf(e); - 1 !== t && this._listeners.splice(t, 1)
        }
        toAbortSignal() {
            let e = new AbortController,
                t = t => {
                    e.abort(t)
                };
            return this.subscribe(t), e.signal.unsubscribe = () => this.unsubscribe(t), e.signal
        }
        static source() {
            let e;
            return {
                token: new ta(function(t) {
                    e = t
                }),
                cancel: e
            }
        }
    }
    let ti = {
        Continue: 100,
        SwitchingProtocols: 101,
        Processing: 102,
        EarlyHints: 103,
        Ok: 200,
        Created: 201,
        Accepted: 202,
        NonAuthoritativeInformation: 203,
        NoContent: 204,
        ResetContent: 205,
        PartialContent: 206,
        MultiStatus: 207,
        AlreadyReported: 208,
        ImUsed: 226,
        MultipleChoices: 300,
        MovedPermanently: 301,
        Found: 302,
        SeeOther: 303,
        NotModified: 304,
        UseProxy: 305,
        Unused: 306,
        TemporaryRedirect: 307,
        PermanentRedirect: 308,
        BadRequest: 400,
        Unauthorized: 401,
        PaymentRequired: 402,
        Forbidden: 403,
        NotFound: 404,
        MethodNotAllowed: 405,
        NotAcceptable: 406,
        ProxyAuthenticationRequired: 407,
        RequestTimeout: 408,
        Conflict: 409,
        Gone: 410,
        LengthRequired: 411,
        PreconditionFailed: 412,
        PayloadTooLarge: 413,
        UriTooLong: 414,
        UnsupportedMediaType: 415,
        RangeNotSatisfiable: 416,
        ExpectationFailed: 417,
        ImATeapot: 418,
        MisdirectedRequest: 421,
        UnprocessableEntity: 422,
        Locked: 423,
        FailedDependency: 424,
        TooEarly: 425,
        UpgradeRequired: 426,
        PreconditionRequired: 428,
        TooManyRequests: 429,
        RequestHeaderFieldsTooLarge: 431,
        UnavailableForLegalReasons: 451,
        InternalServerError: 500,
        NotImplemented: 501,
        BadGateway: 502,
        ServiceUnavailable: 503,
        GatewayTimeout: 504,
        HttpVersionNotSupported: 505,
        VariantAlsoNegotiates: 506,
        InsufficientStorage: 507,
        LoopDetected: 508,
        NotExtended: 510,
        NetworkAuthenticationRequired: 511,
        WebServerIsDown: 521,
        ConnectionTimedOut: 522,
        OriginIsUnreachable: 523,
        TimeoutOccurred: 524,
        SslHandshakeFailed: 525,
        InvalidSslCertificate: 526
    };
    Object.entries(ti).forEach(([e, t]) => {
        ti[t] = e
    });
    let to = function e(t) {
        let r = new tn(t),
            n = u(tn.prototype.request, r);
        return Q.extend(n, tn.prototype, r, {
            allOwnKeys: !0
        }), Q.extend(n, r, null, {
            allOwnKeys: !0
        }), n.create = function(r) {
            return e(eW(t, r))
        }, n
    }(eO);
    to.Axios = tn, to.CanceledError = eM, to.CancelToken = ta, to.isCancel = eN, to.VERSION = eY, to.toFormData = ed, to.AxiosError = eo, to.Cancel = to.CanceledError, to.all = function(e) {
        return Promise.all(e)
    }, to.spread = function(e) {
        return function(t) {
            return e.apply(null, t)
        }
    }, to.isAxiosError = function(e) {
        return Q.isObject(e) && !0 === e.isAxiosError
    }, to.mergeConfig = eW, to.AxiosHeaders = ea, to.formToJSON = e => eT(Q.isHTMLForm(e) ? new FormData(e) : e), to.getAdapter = e8, to.HttpStatusCode = ti, to.default = to, e.s(["default", 0, to], 179191)
}, 67385, 773925, 907360, 132762, 35245, e => {
    "use strict";
    var t, r, n, a, i = e.i(516494),
        o = e.i(748063),
        s = e.i(357805),
        l = e.i(497329),
        c = e.i(467458),
        u = e.i(179191),
        d = e.i(284553),
        f = "u" > typeof window && void 0 !== window.document;
    void 0 !== d.default && null != d.default.versions && d.default.versions.node, "object" == typeof self && self.constructor && self.constructor.name, "u" > typeof window && "nodejs" === window.name || "u" > typeof navigator && "userAgent" in navigator && "string" == typeof navigator.userAgent && (navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom")), "u" > typeof Deno && void 0 !== Deno.version && Deno.version.deno, void 0 !== d.default && null != d.default.versions && d.default.versions.bun, e.s(["isBrowser", 0, f], 773925);
    let p = "POST",
        h = "DELETE",
        m = async (e, t, r, n, a) => (((e, t = {}) => {
            f || (t["User-Agent"] = "@polymarket/clob-client", t.Accept = "*/*", t.Connection = "keep-alive", t["Content-Type"] = "application/json", "GET" === e && (t["Accept-Encoding"] = "gzip"))
        })(t, r), await (0, u.default)({
            method: t,
            url: e,
            headers: r,
            data: n,
            params: a
        })),
        y = async (e, t, r = !1) => {
            try {
                return (await m(e, p, t ? .headers, t ? .data, t ? .params)).data
            } catch (n) {
                if (r && x(n)) {
                    await new Promise(e => setTimeout(e, 30));
                    try {
                        return (await m(e, p, t ? .headers, t ? .data, t ? .params)).data
                    } catch (e) {
                        return v(e)
                    }
                }
                return v(n)
            }
        },
        g = async (e, t) => {
            try {
                return (await m(e, "GET", t ? .headers, t ? .data, t ? .params)).data
            } catch (e) {
                return v(e)
            }
        },
        b = async (e, t) => {
            try {
                return (await m(e, h, t ? .headers, t ? .data, t ? .params)).data
            } catch (e) {
                return v(e)
            }
        },
        v = e => {
            if (u.default.isAxiosError(e)) {
                if (e.response && e.response ? .data) return "string" == typeof e.response ? .data || e.response ? .data instanceof String || !Object.prototype.hasOwnProperty.call(e.response ? .data, "error") ? {
                    error: e.response ? .data,
                    status: e.response ? .status
                } : { ...e.response ? .data,
                    status : e.response ? .status
                };
                if (e.message) return {
                    error: e.message
                }
            }
            return {
                error: e
            }
        },
        x = e => {
            if (!u.default.isAxiosError(e)) return !1;
            if (!e.response) return !0;
            let t = e.response.status ? ? 0;
            return t >= 500 && t < 600 || ["ECONNABORTED", "ENETUNREACH", "EAI_AGAIN", "ETIMEDOUT"].includes((e.code ? ? "").toString())
        },
        w = ((t = {})[t.EOA = 0] = "EOA", t[t.POLY_PROXY = 1] = "POLY_PROXY", t[t.POLY_GNOSIS_SAFE = 2] = "POLY_GNOSIS_SAFE", t[t.POLY_1271 = 3] = "POLY_1271", t);
    e.s(["SignatureTypeV2", 0, w], 907360);
    let _ = ((r = {}).BUY = "BUY", r.SELL = "SELL", r);
    e.s(["Side", 0, _], 132762);
    let C = ((n = {}).GTC = "GTC", n.FOK = "FOK", n.GTD = "GTD", n.FAK = "FAK", n);

    function E(e, t, r, n = !1, a = !1) {
        return {
            deferExec: a,
            postOnly: n,
            order: {
                salt: parseInt(e.salt, 10),
                maker: e.maker,
                signer: e.signer,
                taker: e.taker,
                tokenId: e.tokenId,
                makerAmount: e.makerAmount,
                takerAmount: e.takerAmount,
                side: e.side,
                expiration: e.expiration,
                nonce: e.nonce,
                feeRateBps: e.feeRateBps,
                signatureType: e.signatureType,
                signature: e.signature
            },
            owner: t,
            orderType: r
        }
    }

    function S(e, t, r, n = !1, a = !1) {
        return {
            deferExec: a,
            postOnly: n,
            order: {
                salt: parseInt(e.salt, 10),
                maker: e.maker,
                signer: e.signer,
                taker: e.taker,
                tokenId: e.tokenId,
                makerAmount: e.makerAmount,
                takerAmount: e.takerAmount,
                side: e.side,
                signatureType: e.signatureType,
                timestamp: e.timestamp,
                expiration: e.expiration,
                metadata: e.metadata,
                builder: e.builder,
                signature: e.signature
            },
            owner: t,
            orderType: r
        }
    }

    function A(e) {
        return "version" in e && "order" in e ? 2 === e.version : "timestamp" in e && "metadata" in e && "builder" in e
    }
    e.s(["OrderType", 0, C], 35245);
    let I = (e, t) => O(e) <= t ? e : Math.round((e + Number.EPSILON) * 10 ** t) / 10 ** t,
        T = (e, t) => O(e) <= t ? e : Math.floor(e * 10 ** t) / 10 ** t,
        k = (e, t) => O(e) <= t ? e : Math.ceil(e * 10 ** t) / 10 ** t,
        O = e => {
            if (Number.isInteger(e)) return 0;
            let t = e.toString().split(".");
            return t.length <= 1 ? 0 : t[1].length
        },
        R = async e => {
            if (!globalThis.crypto ? .subtle) throw Error("generateOrderBookSummaryHash: globalThis.crypto.subtle is unavailable. Requires Node >=20 or a secure browser context (HTTPS or localhost).");
            e.hash = "";
            let t = new TextEncoder().encode(JSON.stringify(e)),
                r = Array.from(new Uint8Array(await globalThis.crypto.subtle.digest("SHA-1", t))).map(e => e.toString(16).padStart(2, "0")).join("");
            return e.hash = r, r
        },
        N = (e, t) => e >= parseFloat(t) && e <= 1 - parseFloat(t),
        M = {
            "0.1": {
                price: 1,
                size: 2,
                amount: 3
            },
            "0.01": {
                price: 2,
                size: 2,
                amount: 4
            },
            "0.001": {
                price: 3,
                size: 2,
                amount: 5
            },
            "0.0001": {
                price: 4,
                size: 2,
                amount: 6
            }
        };
    var P = e.i(298537);
    let D = {
            exchange: "0xdFE02Eb6733538f8Ea35D585af8DE5958AD99E40",
            negRiskAdapter: "0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296",
            negRiskExchange: "0xC5d563A36AE78145C45a50134d48A1215220f80a",
            collateral: "0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB",
            conditionalTokens: "0x69308FB512518e39F9b16112fA8d994F4e2Bf8bB",
            exchangeV2: "0xE111180000d2663C0091e4f400237545B87B996B",
            negRiskExchangeV2: "0xe2222d279d744050d28e00520010520000310F59"
        },
        j = {
            exchange: "0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E",
            negRiskAdapter: "0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296",
            negRiskExchange: "0xC5d563A36AE78145C45a50134d48A1215220f80a",
            collateral: "0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB",
            conditionalTokens: "0x4D97DCd97eC945f40cF65F87097ACe5EA0476045",
            exchangeV2: "0xE111180000d2663C0091e4f400237545B87B996B",
            negRiskExchangeV2: "0xe2222d279d744050d28e00520010520000310F59"
        },
        L = e => {
            switch (e) {
                case 137:
                    return j;
                case 80002:
                    return D;
                default:
                    throw Error("Invalid network")
            }
        };
    var F = e.i(63238),
        U = e.i(914640);
    async function $(e, t, r, n, a, o = 2) {
        let {
            side: s,
            rawMakerAmt: l,
            rawTakerAmt: c
        } = ((e, t, r, n) => {
            let a = T(r, n.price);
            if (e === _.BUY) {
                let e = T(t, n.size),
                    r = e / a;
                return O(r) > n.amount && O(r = k(r, n.amount + 4)) > n.amount && (r = T(r, n.amount)), {
                    side: _.BUY,
                    rawMakerAmt: e,
                    rawTakerAmt: r
                }
            } {
                let e = T(t, n.size),
                    r = e * a;
                return O(r) > n.amount && O(r = k(r, n.amount + 4)) > n.amount && (r = T(r, n.amount)), {
                    side: _.SELL,
                    rawMakerAmt: e,
                    rawTakerAmt: r
                }
            }
        })(n.side, n.amount, n.price || 1, a), u = (0, F.parseUnits)(l.toString(), 6).toString(), d = (0, F.parseUnits)(c.toString(), 6).toString();
        return 1 === o ? {
            maker: t,
            taker: n.taker ? ? U.zeroAddress,
            tokenId: n.tokenID,
            makerAmount: u,
            takerAmount: d,
            side: s,
            signer: e,
            signatureType: r,
            feeRateBps: n.feeRateBps ? .toString() ? ? "0",
            nonce: n.nonce ? .toString() ? ? "0"
        } : {
            maker: t,
            tokenId: n.tokenID,
            makerAmount: u,
            takerAmount: d,
            side: s,
            signer: e,
            signatureType: r,
            timestamp: Date.now().toString(),
            metadata: "metadata" in n ? n.metadata ? ? i.bytes32Zero : i.bytes32Zero,
            builder: n.builderCode ? ? i.bytes32Zero
        }
    }
    let z = [{
            name: "salt",
            type: "uint256"
        }, {
            name: "maker",
            type: "address"
        }, {
            name: "signer",
            type: "address"
        }, {
            name: "taker",
            type: "address"
        }, {
            name: "tokenId",
            type: "uint256"
        }, {
            name: "makerAmount",
            type: "uint256"
        }, {
            name: "takerAmount",
            type: "uint256"
        }, {
            name: "expiration",
            type: "uint256"
        }, {
            name: "nonce",
            type: "uint256"
        }, {
            name: "feeRateBps",
            type: "uint256"
        }, {
            name: "side",
            type: "uint8"
        }, {
            name: "signatureType",
            type: "uint8"
        }],
        B = [{
            name: "name",
            type: "string"
        }, {
            name: "version",
            type: "string"
        }, {
            name: "chainId",
            type: "uint256"
        }, {
            name: "verifyingContract",
            type: "address"
        }],
        q = ((a = {})[a.EOA = 0] = "EOA", a[a.POLY_PROXY = 1] = "POLY_PROXY", a[a.POLY_GNOSIS_SAFE = 2] = "POLY_GNOSIS_SAFE", a);

    function W() {
        return `${Math.round(Math.random()*Date.now())}`
    }
    var Z = e.i(7326),
        V = class {
            constructor(e, t, r, n = W) {
                this.contractAddress = e, this.chainId = t, this.signer = r, this.generateSalt = n
            }
            async buildSignedOrder(e) {
                let t = await this.buildOrder(e),
                    r = this.buildOrderTypedData(t),
                    n = await this.buildOrderSignature(r);
                return { ...t,
                    signature: n
                }
            }
            async buildOrder({
                maker: e,
                taker: t,
                tokenId: r,
                makerAmount: n,
                takerAmount: a,
                side: i,
                feeRateBps: o,
                nonce: s,
                signer: l,
                expiration: c,
                signatureType: u
            }) {
                let d, f, p;
                l || (l = e);
                let h = await (0, P.getSignerAddress)(this.signer);
                if (l !== h) throw Error("signer does not match");
                return c || (c = "0"), u || (u = q.EOA), d = void 0 !== t && t ? t : "0x0000000000000000000000000000000000000000", f = void 0 !== o && o ? o.toString() : "0", p = void 0 !== s && s ? s.toString() : "0", {
                    salt: this.generateSalt(),
                    maker: e,
                    signer: l,
                    taker: d,
                    tokenId: r,
                    makerAmount: n,
                    takerAmount: a,
                    expiration: c,
                    nonce: p,
                    feeRateBps: f,
                    side: i,
                    signatureType: u
                }
            }
            buildOrderTypedData(e) {
                return {
                    primaryType: "Order",
                    types: {
                        EIP712Domain: B,
                        Order: z
                    },
                    domain: {
                        name: "Polymarket CTF Exchange",
                        version: "1",
                        chainId: this.chainId,
                        verifyingContract: this.contractAddress
                    },
                    message: {
                        salt: e.salt,
                        maker: e.maker,
                        signer: e.signer,
                        taker: e.taker,
                        tokenId: e.tokenId,
                        makerAmount: e.makerAmount,
                        takerAmount: e.takerAmount,
                        expiration: e.expiration,
                        nonce: e.nonce,
                        feeRateBps: e.feeRateBps,
                        side: +("BUY" !== e.side),
                        signatureType: e.signatureType
                    }
                }
            }
            buildOrderSignature(e) {
                return delete e.types.EIP712Domain, (0, P.signTypedDataWithSigner)({
                    signer: this.signer,
                    domain: e.domain,
                    types: e.types,
                    value: e.message,
                    primaryType: e.primaryType
                })
            }
            buildOrderHash(e) {
                return (0, Z.hashTypedData)(e)
            }
        };
    let K = "Polymarket CTF Exchange",
        H = [{
            name: "salt",
            type: "uint256"
        }, {
            name: "maker",
            type: "address"
        }, {
            name: "signer",
            type: "address"
        }, {
            name: "tokenId",
            type: "uint256"
        }, {
            name: "makerAmount",
            type: "uint256"
        }, {
            name: "takerAmount",
            type: "uint256"
        }, {
            name: "side",
            type: "uint8"
        }, {
            name: "signatureType",
            type: "uint8"
        }, {
            name: "timestamp",
            type: "uint256"
        }, {
            name: "metadata",
            type: "bytes32"
        }, {
            name: "builder",
            type: "bytes32"
        }];
    var G = e.i(198905),
        Q = e.i(415013),
        J = e.i(186897);
    let Y = "Order(uint256 salt,address maker,address signer,uint256 tokenId,uint256 makerAmount,uint256 takerAmount,uint8 side,uint8 signatureType,uint256 timestamp,bytes32 metadata,bytes32 builder)",
        X = (0, Q.keccak256)((0, J.toHex)(Y)),
        ee = (0, Q.keccak256)((0, J.toHex)("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)")),
        et = [{
            name: "contents",
            type: "Order"
        }, {
            name: "name",
            type: "string"
        }, {
            name: "version",
            type: "string"
        }, {
            name: "chainId",
            type: "uint256"
        }, {
            name: "verifyingContract",
            type: "address"
        }, {
            name: "salt",
            type: "bytes32"
        }],
        er = (0, Q.keccak256)((0, J.toHex)(K)),
        en = (0, Q.keccak256)((0, J.toHex)("2"));
    var ea = class {
        appDomainSep;
        constructor(e, t, r, n = W) {
            this.contractAddress = e, this.chainId = t, this.signer = r, this.generateSalt = n, this.appDomainSep = (0, Q.keccak256)((0, G.encodeAbiParameters)([{
                type: "bytes32"
            }, {
                type: "bytes32"
            }, {
                type: "bytes32"
            }, {
                type: "uint256"
            }, {
                type: "address"
            }], [ee, er, en, BigInt(t), e]))
        }
        async buildSignedOrder(e) {
            let t = await this.buildOrder(e),
                r = this.buildOrderTypedData(t),
                n = await this.buildOrderSignature(r);
            return { ...t,
                signature: n
            }
        }
        async buildOrder({
            maker: e,
            tokenId: t,
            makerAmount: r,
            takerAmount: n,
            side: a,
            signer: o,
            signatureType: s,
            timestamp: l,
            metadata: c,
            builder: u,
            expiration: d
        }) {
            if (o || (o = e), s !== w.POLY_1271) {
                let e = await (0, P.getSignerAddress)(this.signer);
                if (o !== e) throw Error("signer does not match")
            }
            return {
                salt: this.generateSalt(),
                maker: e,
                signer: o,
                tokenId: t,
                makerAmount: r,
                takerAmount: n,
                side: a,
                signatureType: s ? ? w.EOA,
                metadata: c ? ? i.bytes32Zero,
                builder: u ? ? i.bytes32Zero,
                timestamp: l ? ? Date.now().toString(),
                expiration: d ? ? "0"
            }
        }
        buildOrderTypedData(e) {
            return {
                primaryType: "Order",
                types: {
                    EIP712Domain: B,
                    Order: H
                },
                domain: {
                    name: K,
                    version: "2",
                    chainId: this.chainId,
                    verifyingContract: this.contractAddress
                },
                message: {
                    salt: e.salt,
                    maker: e.maker,
                    signer: e.signer,
                    tokenId: e.tokenId,
                    makerAmount: e.makerAmount,
                    takerAmount: e.takerAmount,
                    timestamp: e.timestamp,
                    side: +("BUY" !== e.side),
                    signatureType: e.signatureType,
                    metadata: e.metadata,
                    builder: e.builder
                }
            }
        }
        async buildOrderSignature(e) {
            delete e.types.EIP712Domain;
            let t = e.message;
            if (t.signatureType !== w.POLY_1271) return (0, P.signTypedDataWithSigner)({
                signer: this.signer,
                domain: e.domain,
                types: e.types,
                value: e.message,
                primaryType: e.primaryType
            });
            let r = (0, Q.keccak256)((0, G.encodeAbiParameters)([{
                    type: "bytes32"
                }, {
                    type: "uint256"
                }, {
                    type: "address"
                }, {
                    type: "address"
                }, {
                    type: "uint256"
                }, {
                    type: "uint256"
                }, {
                    type: "uint256"
                }, {
                    type: "uint8"
                }, {
                    type: "uint8"
                }, {
                    type: "uint256"
                }, {
                    type: "bytes32"
                }, {
                    type: "bytes32"
                }], [X, BigInt(t.salt), t.maker, t.signer, BigInt(t.tokenId), BigInt(t.makerAmount), BigInt(t.takerAmount), t.side, t.signatureType, BigInt(t.timestamp), t.metadata, t.builder])),
                n = await (0, P.signTypedDataWithSigner)({
                    signer: this.signer,
                    domain: {
                        name: K,
                        version: "2",
                        chainId: this.chainId,
                        verifyingContract: this.contractAddress
                    },
                    types: {
                        TypedDataSign: et,
                        Order: H
                    },
                    primaryType: "TypedDataSign",
                    value: {
                        contents: e.message,
                        name: "DepositWallet",
                        version: "1",
                        chainId: this.chainId,
                        verifyingContract: t.signer,
                        salt: i.bytes32Zero
                    }
                }),
                a = "ba".padStart(4, "0");
            return `0x${n.slice(2)}${this.appDomainSep.slice(2)}${r.slice(2)}${(0,J.toHex)(Y).slice(2)}${a}`
        }
        buildOrderHash(e) {
            return (0, Z.hashTypedData)(e)
        }
    };
    let ei = async (e, t, r, n, a = 2) => {
            switch (a) {
                case 1:
                    return eo(e, t, r, n);
                case 2:
                    return es(e, t, r, n);
                default:
                    throw Error(`unsupported order version ${a}`)
            }
        },
        eo = async (e, t, r, n) => new V(t, r, e).buildSignedOrder(n),
        es = async (e, t, r, n) => new ea(t, r, e).buildSignedOrder(n),
        el = async (e, t, r, n, a, i, o) => {
            let s, l = await (0, P.getSignerAddress)(e),
                c = void 0 === n ? l : n,
                u = r === w.POLY_1271 ? c : l,
                d = L(t),
                f = await $(u, c, r, a, M[i.tickSize], o);
            switch (o) {
                case 1:
                    if (r === w.POLY_1271) throw Error("signature type POLY_1271 is not supported for v1 orders");
                    s = i.negRisk ? d.negRiskExchange : d.exchange;
                    break;
                case 2:
                    s = i.negRisk ? d.negRiskExchangeV2 : d.exchangeV2;
                    break;
                default:
                    throw Error(`unsupported order version ${o}`)
            }
            return ei(e, s, t, f, o)
        };
    async function ec(e, t, r, n, a, o = 2) {
        let {
            side: s,
            rawMakerAmt: l,
            rawTakerAmt: c
        } = ((e, t, r, n) => {
            let a = I(r, n.price);
            if (e === _.BUY) {
                let e = T(t, n.size),
                    r = e * a;
                return O(r) > n.amount && O(r = k(r, n.amount + 4)) > n.amount && (r = T(r, n.amount)), {
                    side: _.BUY,
                    rawMakerAmt: r,
                    rawTakerAmt: e
                }
            } {
                let e = T(t, n.size),
                    r = e * a;
                return O(r) > n.amount && O(r = k(r, n.amount + 4)) > n.amount && (r = T(r, n.amount)), {
                    side: _.SELL,
                    rawMakerAmt: e,
                    rawTakerAmt: r
                }
            }
        })(n.side, n.size, n.price, a), u = (0, F.parseUnits)(l.toString(), 6).toString(), d = (0, F.parseUnits)(c.toString(), 6).toString();
        return 1 === o ? {
            maker: t,
            taker: n.taker ? ? U.zeroAddress,
            tokenId: n.tokenID,
            makerAmount: u,
            takerAmount: d,
            side: s,
            signer: e,
            signatureType: r,
            feeRateBps: n.feeRateBps ? .toString() ? ? "0",
            nonce: n.nonce ? .toString() ? ? "0",
            expiration: void 0 !== n.expiration ? n.expiration.toString() : "0"
        } : {
            maker: t,
            tokenId: n.tokenID,
            makerAmount: u,
            takerAmount: d,
            side: s,
            signer: e,
            signatureType: r,
            timestamp: Date.now().toString(),
            metadata: "metadata" in n ? n.metadata ? ? i.bytes32Zero : i.bytes32Zero,
            builder: n.builderCode ? ? i.bytes32Zero,
            expiration: void 0 !== n.expiration ? n.expiration.toString() : "0"
        }
    }
    let eu = async (e, t, r, n, a, i, o) => {
        let s, l = await (0, P.getSignerAddress)(e),
            c = void 0 === n ? l : n,
            u = r === w.POLY_1271 ? c : l,
            d = L(t),
            f = await ec(u, c, r, a, M[i.tickSize], o);
        switch (o) {
            case 1:
                if (r === w.POLY_1271) throw Error("signature type POLY_1271 is not supported for v1 orders");
                s = i.negRisk ? d.negRiskExchange : d.exchange;
                break;
            case 2:
                s = i.negRisk ? d.negRiskExchangeV2 : d.exchangeV2;
                break;
            default:
                throw Error(`unsupported order version ${o}`)
        }
        return ei(e, s, t, f, o)
    };
    var ed = class {
            signer;
            chainId;
            signatureType;
            funderAddress;
            getSigner;
            constructor(e, t, r, n, a) {
                this.signer = e, this.chainId = t, this.signatureType = void 0 === r ? w.EOA : r, this.funderAddress = n, this.getSigner = a
            }
            async buildOrder(e, t, r) {
                return eu(await this.resolveSigner(), this.chainId, this.signatureType, this.funderAddress, e, t, r)
            }
            async buildMarketOrder(e, t, r) {
                return el(await this.resolveSigner(), this.chainId, this.signatureType, this.funderAddress, e, t, r)
            }
            async resolveSigner() {
                if (this.getSigner) {
                    let e = await this.getSigner();
                    if (!e) throw Error("getSigner() function returned undefined or null");
                    return e
                }
                return this.signer
            }
        },
        ef = class {
            host;
            chainId;
            signer;
            creds;
            orderBuilder;
            tickSizes;
            negRisk;
            feeInfos;
            feeRates;
            builderFeeRates;
            tokenConditionMap;
            useServerTime;
            builderConfig;
            signatureType;
            funderAddress;
            cachedVersion;
            retryOnError;
            throwOnError;
            feeSlippage;
            constructor({
                host: e,
                chain: t,
                signer: r,
                creds: n,
                signatureType: a,
                funderAddress: i,
                useServerTime: o,
                builderConfig: s,
                getSigner: c,
                retryOnError: u,
                throwOnError: d,
                feeSlippage: f
            }) {
                this.host = e.endsWith("/") ? e.slice(0, -1) : e, this.chainId = t, void 0 !== r && (this.signer = r), void 0 !== n && (this.creds = n), this.orderBuilder = new ed(r, t, a, i, c), this.signatureType = a ? ? w.EOA, this.funderAddress = i, this.tickSizes = {}, this.negRisk = {}, this.feeRates = {}, this.feeInfos = {}, this.builderFeeRates = {}, this.tokenConditionMap = {}, this.retryOnError = u, this.throwOnError = d, this.feeSlippage = f ? ? 0, (0, l.validateFeeSlippage)(this.feeSlippage), this.useServerTime = o, void 0 !== s && (this.builderConfig = s)
            }
            async getOk() {
                return this.get(`${this.host}${o.OK}`)
            }
            async postHeartbeat(e = "") {
                this.canL2Auth();
                let t = JSON.stringify({
                        heartbeat_id: e
                    }),
                    r = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: p,
                        requestPath: o.HEARTBEAT,
                        body: t
                    }, this.useServerTime ? await this.getServerTime() : void 0);
                return this.post(`${this.host}${o.HEARTBEAT}`, {
                    headers: r,
                    data: {
                        heartbeat_id: e
                    }
                })
            }
            async getVersion() {
                return (await this.get(`${this.host}/version`)) ? .version ? ? 2
            }
            async getServerTime() {
                return this.get(`${this.host}${o.TIME}`)
            }
            async getSamplingSimplifiedMarkets(e = i.INITIAL_CURSOR) {
                return this.get(`${this.host}${o.GET_SAMPLING_SIMPLIFIED_MARKETS}`, {
                    params: {
                        next_cursor: e
                    }
                })
            }
            async getSamplingMarkets(e = i.INITIAL_CURSOR) {
                return this.get(`${this.host}${o.GET_SAMPLING_MARKETS}`, {
                    params: {
                        next_cursor: e
                    }
                })
            }
            async getSimplifiedMarkets(e = i.INITIAL_CURSOR) {
                return this.get(`${this.host}${o.GET_SIMPLIFIED_MARKETS}`, {
                    params: {
                        next_cursor: e
                    }
                })
            }
            async getMarkets(e = i.INITIAL_CURSOR) {
                return this.get(`${this.host}${o.GET_MARKETS}`, {
                    params: {
                        next_cursor: e
                    }
                })
            }
            async getMarket(e) {
                return this.get(`${this.host}${o.GET_MARKET}${e}`)
            }
            async getClobMarketInfo(e) {
                let t = await this.get(`${this.host}${o.GET_CLOB_MARKET}${e}`);
                if (!t ? .t) throw Error(`failed to fetch market info for condition id ${e}`);
                for (let r of t.t) {
                    if (!r) continue;
                    let n = r.t;
                    this.tokenConditionMap[n] = e, this.tickSizes[n] = t.mts.toString(), this.negRisk[n] = t.nr ? ? !1, this.feeInfos[n] = {
                        rate: t.fd ? .r ? ? 0,
                        exponent: t.fd ? .e ? ? 0
                    }
                }
                return t
            }
            async getOrderBook(e) {
                return this.get(`${this.host}${o.GET_ORDER_BOOK}`, {
                    params: {
                        token_id: e
                    }
                })
            }
            async getOrderBooks(e) {
                return this.post(`${this.host}${o.GET_ORDER_BOOKS}`, {
                    data: e
                })
            }
            async getTickSize(e) {
                if (e in this.tickSizes) return this.tickSizes[e];
                if (e in this.tokenConditionMap) return await this.getClobMarketInfo(this.tokenConditionMap[e]), this.tickSizes[e];
                let t = await this.get(`${this.host}${o.GET_TICK_SIZE}`, {
                    params: {
                        token_id: e
                    }
                });
                return this.tickSizes[e] = t.minimum_tick_size.toString(), this.tickSizes[e]
            }
            async getNegRisk(e) {
                if (e in this.negRisk) return this.negRisk[e];
                if (e in this.tokenConditionMap) return await this.getClobMarketInfo(this.tokenConditionMap[e]), this.negRisk[e];
                let t = await this.get(`${this.host}${o.GET_NEG_RISK}`, {
                    params: {
                        token_id: e
                    }
                });
                return this.negRisk[e] = t.neg_risk, this.negRisk[e]
            }
            async getFeeRateBps(e) {
                if (e in this.feeRates) return this.feeRates[e];
                let t = await this.get(`${this.host}${o.GET_FEE_RATE}`, {
                    params: {
                        token_id: e
                    }
                });
                return this.feeRates[e] = t.base_fee, this.feeRates[e]
            }
            async getFeeExponent(e) {
                return e in this.feeInfos || await this._ensureMarketInfoCached(e), this.feeInfos[e].exponent
            }
            async getOrderBookHash(e) {
                return R(e)
            }
            async getMidpoint(e) {
                return this.get(`${this.host}${o.GET_MIDPOINT}`, {
                    params: {
                        token_id: e
                    }
                })
            }
            async getMidpoints(e) {
                return this.post(`${this.host}${o.GET_MIDPOINTS}`, {
                    data: e
                })
            }
            async getPrice(e, t) {
                return this.get(`${this.host}${o.GET_PRICE}`, {
                    params: {
                        token_id: e,
                        side: t
                    }
                })
            }
            async getPrices(e) {
                return this.post(`${this.host}${o.GET_PRICES}`, {
                    data: e
                })
            }
            async getSpread(e) {
                return this.get(`${this.host}${o.GET_SPREAD}`, {
                    params: {
                        token_id: e
                    }
                })
            }
            async getSpreads(e) {
                return this.post(`${this.host}${o.GET_SPREADS}`, {
                    data: e
                })
            }
            async getLastTradePrice(e) {
                return this.get(`${this.host}${o.GET_LAST_TRADE_PRICE}`, {
                    params: {
                        token_id: e
                    }
                })
            }
            async getLastTradesPrices(e) {
                return this.post(`${this.host}${o.GET_LAST_TRADES_PRICES}`, {
                    data: e
                })
            }
            async getPricesHistory(e) {
                if (!e.interval && (void 0 === e.startTs || void 0 === e.endTs)) throw Error("getPricesHistory requires either interval or both startTs and endTs");
                return this.get(`${this.host}${o.GET_PRICES_HISTORY}`, {
                    params: e
                })
            }
            async createApiKey(e) {
                this.canL1Auth();
                let t = `${this.host}${o.CREATE_API_KEY}`,
                    r = await (0, c.createL1Headers)(this.signer, this.chainId, e, this.useServerTime ? await this.getServerTime() : void 0);
                return await this.post(t, {
                    headers: r
                }).then(e => ({
                    key: e.apiKey,
                    secret: e.secret,
                    passphrase: e.passphrase
                }))
            }
            async deriveApiKey(e) {
                this.canL1Auth();
                let t = `${this.host}${o.DERIVE_API_KEY}`,
                    r = await (0, c.createL1Headers)(this.signer, this.chainId, e, this.useServerTime ? await this.getServerTime() : void 0);
                return await this.get(t, {
                    headers: r
                }).then(e => ({
                    key: e.apiKey,
                    secret: e.secret,
                    passphrase: e.passphrase
                }))
            }
            async createOrDeriveApiKey(e) {
                return this.createApiKey(e).then(t => t.key ? t : this.deriveApiKey(e))
            }
            async getApiKeys() {
                this.canL2Auth();
                let e = o.GET_API_KEYS,
                    t = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: "GET",
                        requestPath: e
                    }, this.useServerTime ? await this.getServerTime() : void 0);
                return this.get(`${this.host}${e}`, {
                    headers: t
                })
            }
            async getClosedOnlyMode() {
                this.canL2Auth();
                let e = o.CLOSED_ONLY,
                    t = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: "GET",
                        requestPath: e
                    }, this.useServerTime ? await this.getServerTime() : void 0);
                return this.get(`${this.host}${e}`, {
                    headers: t
                })
            }
            async deleteApiKey() {
                this.canL2Auth();
                let e = o.DELETE_API_KEY,
                    t = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: h,
                        requestPath: e
                    }, this.useServerTime ? await this.getServerTime() : void 0);
                return this.del(`${this.host}${e}`, {
                    headers: t
                })
            }
            async createReadonlyApiKey() {
                this.canL2Auth();
                let e = o.CREATE_READONLY_API_KEY,
                    t = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: p,
                        requestPath: e
                    }, this.useServerTime ? await this.getServerTime() : void 0);
                return this.post(`${this.host}${e}`, {
                    headers: t
                })
            }
            async getReadonlyApiKeys() {
                this.canL2Auth();
                let e = o.GET_READONLY_API_KEYS,
                    t = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: "GET",
                        requestPath: e
                    }, this.useServerTime ? await this.getServerTime() : void 0);
                return this.get(`${this.host}${e}`, {
                    headers: t
                })
            }
            async deleteReadonlyApiKey(e) {
                this.canL2Auth();
                let t = o.DELETE_READONLY_API_KEY,
                    r = {
                        key: e
                    },
                    n = {
                        method: h,
                        requestPath: t,
                        body: JSON.stringify(r)
                    },
                    a = await (0, c.createL2Headers)(this.signer, this.creds, n, this.useServerTime ? await this.getServerTime() : void 0);
                return this.del(`${this.host}${t}`, {
                    headers: a,
                    data: r
                })
            }
            async getOrder(e) {
                this.canL2Auth();
                let t = `${o.GET_ORDER}${e}`,
                    r = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: "GET",
                        requestPath: t
                    }, this.useServerTime ? await this.getServerTime() : void 0);
                return this.get(`${this.host}${t}`, {
                    headers: r
                })
            }
            async getTrades(e, t = !1, r) {
                this.canL2Auth();
                let n = o.GET_TRADES,
                    a = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: "GET",
                        requestPath: n
                    }, this.useServerTime ? await this.getServerTime() : void 0),
                    s = [];
                for (r = r || i.INITIAL_CURSOR; r !== i.END_CURSOR && (r === i.INITIAL_CURSOR || !t);) {
                    let t = { ...e,
                            next_cursor: r
                        },
                        i = await this.get(`${this.host}${n}`, {
                            headers: a,
                            params: t
                        });
                    r = i.next_cursor, s = [...s, ...i.data]
                }
                return s
            }
            async getTradesPaginated(e, t) {
                this.canL2Auth();
                let r = o.GET_TRADES,
                    n = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: "GET",
                        requestPath: r
                    }, this.useServerTime ? await this.getServerTime() : void 0);
                t = t || i.INITIAL_CURSOR;
                let a = { ...e,
                        next_cursor: t
                    },
                    {
                        data: s,
                        ...l
                    } = await this.get(`${this.host}${r}`, {
                        headers: n,
                        params: a
                    });
                return {
                    trades: Array.isArray(s) ? [...s] : [],
                    ...l
                }
            }
            async getBuilderTrades(e, t) {
                if (!e.builder_code || e.builder_code === i.bytes32Zero) throw Error("builderCode is required and cannot be zero");
                let r = { ...e,
                        next_cursor: t || i.INITIAL_CURSOR
                    },
                    {
                        data: n,
                        ...a
                    } = await this.get(`${this.host}${o.GET_BUILDER_TRADES}`, {
                        params: r
                    });
                return {
                    trades: Array.isArray(n) ? [...n] : [],
                    ...a
                }
            }
            async getNotifications() {
                this.canL2Auth();
                let e = o.GET_NOTIFICATIONS,
                    t = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: "GET",
                        requestPath: e
                    }, this.useServerTime ? await this.getServerTime() : void 0);
                return this.get(`${this.host}${e}`, {
                    headers: t,
                    params: {
                        signature_type: this.orderBuilder.signatureType
                    }
                })
            }
            async dropNotifications(e) {
                let t;
                this.canL2Auth();
                let r = o.DROP_NOTIFICATIONS,
                    n = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: h,
                        requestPath: r
                    }, this.useServerTime ? await this.getServerTime() : void 0);
                return this.del(`${this.host}${r}`, {
                    headers: n,
                    params: (t = {}, void 0 !== e && void 0 !== e.ids && (t.ids = e ? .ids.join(",")), t)
                })
            }
            async getBalanceAllowance(e) {
                this.canL2Auth();
                let t = o.GET_BALANCE_ALLOWANCE,
                    r = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: "GET",
                        requestPath: t
                    }, this.useServerTime ? await this.getServerTime() : void 0),
                    n = { ...e,
                        signature_type: this.orderBuilder.signatureType
                    };
                return this.get(`${this.host}${t}`, {
                    headers: r,
                    params: n
                })
            }
            async updateBalanceAllowance(e) {
                this.canL2Auth();
                let t = o.UPDATE_BALANCE_ALLOWANCE,
                    r = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: "GET",
                        requestPath: t
                    }, this.useServerTime ? await this.getServerTime() : void 0),
                    n = { ...e,
                        signature_type: this.orderBuilder.signatureType
                    };
                return this.get(`${this.host}${t}`, {
                    headers: r,
                    params: n
                })
            }
            async createOrder(e, t) {
                this.canL1Auth();
                let r = { ...e
                };
                this.builderConfig ? .builderCode && !r.builderCode && (r.builderCode = this.builderConfig.builderCode);
                let {
                    tokenID: n
                } = r, a = await this._resolveTickSize(n, t ? .tickSize);
                if (!N(r.price, a)) throw Error(`invalid price (${r.price}), min: ${parseFloat(a)} - max: ${1-parseFloat(a)}`);
                r.price = I(r.price, M[a].price);
                let i = await this.resolveVersion();
                2 === i && r.side === _.BUY && "userUSDCBalance" in r && void 0 !== r.userUSDCBalance && (r.size = await this.adjustBuyAmountForBalance(n, r.size * r.price, r.price, r.userUSDCBalance, r.builderCode) / r.price);
                let o = t ? .negRisk ? ? await this.getNegRisk(n);
                if (1 === i) {
                    let e = "feeRateBps" in r ? r.feeRateBps : void 0;
                    r.feeRateBps = await this._resolveFeeRateBps(n, e)
                }
                return this.orderBuilder.buildOrder(r, {
                    tickSize: a,
                    negRisk: o
                }, i)
            }
            async createMarketOrder(e, t) {
                this.canL1Auth();
                let {
                    tokenID: r
                } = e;
                await this._ensureMarketInfoCached(r);
                let n = await this._resolveTickSize(r, t ? .tickSize);
                if (e.price || (e.price = await this.calculateMarketPrice(r, e.side, e.amount, e.orderType)), !N(e.price, n)) throw Error(`invalid price (${e.price}), min: ${parseFloat(n)} - max: ${1-parseFloat(n)}`);
                let a = { ...e
                };
                if (this.builderConfig ? .builderCode && !a.builderCode && (a.builderCode = this.builderConfig.builderCode), await this.ensureBuilderFeeRateCached(a.builderCode), a.side === _.BUY && "userUSDCBalance" in a && void 0 !== a.userUSDCBalance) {
                    let e = a.price;
                    a.amount = await this.adjustBuyAmountForBalance(r, a.amount, e, a.userUSDCBalance, a.builderCode)
                }
                let i = t ? .negRisk ? ? await this.getNegRisk(r),
                    o = await this.resolveVersion();
                if (1 === o) {
                    let e = "feeRateBps" in a ? a.feeRateBps : void 0;
                    a.feeRateBps = await this._resolveFeeRateBps(r, e)
                }
                return this.orderBuilder.buildMarketOrder(a, {
                    tickSize: n,
                    negRisk: i
                }, o)
            }
            async createAndPostOrder(e, t, r = C.GTC, n = !1, a = !1) {
                let i;
                return await this._retryOnVersionUpdate(async () => {
                    let o = await this.createOrder(e, t);
                    i = await this.postOrder(o, r, n, a)
                }), i
            }
            async createAndPostMarketOrder(e, t, r = C.FOK, n = !1) {
                let a;
                return await this._retryOnVersionUpdate(async () => {
                    let i = await this.createMarketOrder(e, t);
                    a = await this.postOrder(i, r, !1, n)
                }), a
            }
            async getOpenOrders(e, t = !1, r) {
                this.canL2Auth();
                let n = o.GET_OPEN_ORDERS,
                    a = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: "GET",
                        requestPath: n
                    }, this.useServerTime ? await this.getServerTime() : void 0),
                    s = [];
                for (r = r || i.INITIAL_CURSOR; r !== i.END_CURSOR && (r === i.INITIAL_CURSOR || !t);) {
                    let t = { ...e,
                            next_cursor: r
                        },
                        i = await this.get(`${this.host}${n}`, {
                            headers: a,
                            params: t
                        });
                    r = i.next_cursor, s = [...s, ...i.data]
                }
                return s
            }
            async getPreMigrationOrders(e = !1, t) {
                this.canL2Auth();
                let r = o.GET_PRE_MIGRATION_ORDERS,
                    n = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: "GET",
                        requestPath: r
                    }, this.useServerTime ? await this.getServerTime() : void 0),
                    a = [];
                for (t = t || i.INITIAL_CURSOR; t !== i.END_CURSOR && (t === i.INITIAL_CURSOR || !e);) {
                    let e = {
                            next_cursor: t
                        },
                        i = await this.get(`${this.host}${r}`, {
                            headers: n,
                            params: e
                        });
                    t = i.next_cursor, a = [...a, ...i.data]
                }
                return a
            }
            async postOrder(e, t = C.GTC, r = !1, n = !1) {
                if (this.canL2Auth(), r && (t === C.FOK || t === C.FAK)) throw Error("postOnly is not supported for FOK/FAK orders");
                let a = o.POST_ORDER,
                    i = A(e) ? S(e, this.creds ? .key || "", t, r, n) : E(e, this.creds ? .key || "", t, r, n),
                    s = {
                        method: p,
                        requestPath: a,
                        body: JSON.stringify(i)
                    },
                    l = await (0, c.createL2Headers)(this.signer, this.creds, s, this.useServerTime ? await this.getServerTime() : void 0),
                    u = await this.post(`${this.host}${a}`, {
                        headers: l,
                        data: i
                    }, !0);
                return this._isOrderVersionMismatch(u) && await this.resolveVersion(!0), this.throwIfError(u)
            }
            async postOrders(e, t = !1, r = !1) {
                if (this.canL2Auth(), t && e.some(({
                        orderType: e
                    }) => e === C.FOK || e === C.FAK)) throw Error("postOnly is not supported for FOK/FAK orders");
                let n = o.POST_ORDERS,
                    a = [];
                for (let n of e) {
                    let {
                        order: e,
                        orderType: i
                    } = n, o = A(e) ? S(e, this.creds ? .key || "", i, t, r) : E(e, this.creds ? .key || "", i, t, r);
                    a.push(o)
                }
                let i = {
                        method: p,
                        requestPath: n,
                        body: JSON.stringify(a)
                    },
                    s = await (0, c.createL2Headers)(this.signer, this.creds, i, this.useServerTime ? await this.getServerTime() : void 0),
                    l = await this.post(`${this.host}${n}`, {
                        headers: s,
                        data: a
                    }, !0);
                return this._isOrderVersionMismatch(l) && await this.resolveVersion(!0), this.throwIfError(l)
            }
            async cancelOrder(e) {
                this.canL2Auth();
                let t = o.CANCEL_ORDER,
                    r = {
                        method: h,
                        requestPath: t,
                        body: JSON.stringify(e)
                    },
                    n = await (0, c.createL2Headers)(this.signer, this.creds, r, this.useServerTime ? await this.getServerTime() : void 0);
                return this.del(`${this.host}${t}`, {
                    headers: n,
                    data: e
                })
            }
            async cancelOrders(e) {
                this.canL2Auth();
                let t = o.CANCEL_ORDERS,
                    r = {
                        method: h,
                        requestPath: t,
                        body: JSON.stringify(e)
                    },
                    n = await (0, c.createL2Headers)(this.signer, this.creds, r, this.useServerTime ? await this.getServerTime() : void 0);
                return this.del(`${this.host}${t}`, {
                    headers: n,
                    data: e
                })
            }
            async cancelAll() {
                this.canL2Auth();
                let e = o.CANCEL_ALL,
                    t = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: h,
                        requestPath: e
                    }, this.useServerTime ? await this.getServerTime() : void 0);
                return this.del(`${this.host}${e}`, {
                    headers: t
                })
            }
            async cancelMarketOrders(e) {
                this.canL2Auth();
                let t = o.CANCEL_MARKET_ORDERS,
                    r = {
                        method: h,
                        requestPath: t,
                        body: JSON.stringify(e)
                    },
                    n = await (0, c.createL2Headers)(this.signer, this.creds, r, this.useServerTime ? await this.getServerTime() : void 0);
                return this.del(`${this.host}${t}`, {
                    headers: n,
                    data: e
                })
            }
            async isOrderScoring(e) {
                this.canL2Auth();
                let t = o.IS_ORDER_SCORING,
                    r = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: "GET",
                        requestPath: t
                    }, this.useServerTime ? await this.getServerTime() : void 0);
                return this.get(`${this.host}${t}`, {
                    headers: r,
                    params: e
                })
            }
            async areOrdersScoring(e) {
                this.canL2Auth();
                let t = o.ARE_ORDERS_SCORING,
                    r = JSON.stringify(e ? .orderIds),
                    n = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: p,
                        requestPath: t,
                        body: r
                    }, this.useServerTime ? await this.getServerTime() : void 0);
                return this.post(`${this.host}${t}`, {
                    headers: n,
                    data: r
                })
            }
            async getEarningsForUserForDay(e) {
                this.canL2Auth();
                let t = o.GET_EARNINGS_FOR_USER_FOR_DAY,
                    r = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: "GET",
                        requestPath: t
                    }, this.useServerTime ? await this.getServerTime() : void 0),
                    n = [],
                    a = i.INITIAL_CURSOR;
                for (; a !== i.END_CURSOR;) {
                    let i = {
                            date: e,
                            signature_type: this.orderBuilder.signatureType,
                            next_cursor: a
                        },
                        o = await this.get(`${this.host}${t}`, {
                            headers: r,
                            params: i
                        });
                    a = o.next_cursor, n = [...n, ...o.data]
                }
                return n
            }
            async getTotalEarningsForUserForDay(e) {
                this.canL2Auth();
                let t = o.GET_TOTAL_EARNINGS_FOR_USER_FOR_DAY,
                    r = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: "GET",
                        requestPath: t
                    }, this.useServerTime ? await this.getServerTime() : void 0),
                    n = {
                        date: e,
                        signature_type: this.orderBuilder.signatureType
                    };
                return await this.get(`${this.host}${t}`, {
                    headers: r,
                    params: n
                })
            }
            async getUserEarningsAndMarketsConfig(e, t = "", r = "", n = !1) {
                this.canL2Auth();
                let a = o.GET_REWARDS_EARNINGS_PERCENTAGES,
                    s = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: "GET",
                        requestPath: a
                    }, this.useServerTime ? await this.getServerTime() : void 0),
                    l = [],
                    u = i.INITIAL_CURSOR;
                for (; u !== i.END_CURSOR;) {
                    let i = {
                            date: e,
                            signature_type: this.orderBuilder.signatureType,
                            next_cursor: u,
                            order_by: t,
                            position: r,
                            no_competition: n
                        },
                        o = await this.get(`${this.host}${a}`, {
                            headers: s,
                            params: i
                        });
                    u = o.next_cursor, l = [...l, ...o.data]
                }
                return l
            }
            async getRewardPercentages() {
                this.canL2Auth();
                let e = o.GET_LIQUIDITY_REWARD_PERCENTAGES,
                    t = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: "GET",
                        requestPath: e
                    }, this.useServerTime ? await this.getServerTime() : void 0),
                    r = {
                        signature_type: this.orderBuilder.signatureType
                    };
                return this.get(`${this.host}${e}`, {
                    headers: t,
                    params: r
                })
            }
            async getCurrentRewards() {
                let e = [],
                    t = i.INITIAL_CURSOR;
                for (; t !== i.END_CURSOR;) {
                    let r = await this.get(`${this.host}${o.GET_REWARDS_MARKETS_CURRENT}`, {
                        params: {
                            next_cursor: t
                        }
                    });
                    t = r.next_cursor, e = [...e, ...r.data]
                }
                return e
            }
            async getRawRewardsForMarket(e) {
                let t = [],
                    r = i.INITIAL_CURSOR;
                for (; r !== i.END_CURSOR;) {
                    let n = await this.get(`${this.host}${o.GET_REWARDS_MARKETS}${e}`, {
                        params: {
                            next_cursor: r
                        }
                    });
                    r = n.next_cursor, t = [...t, ...n.data]
                }
                return t
            }
            async calculateMarketPrice(e, t, r, n = C.FOK) {
                let a = await this.getOrderBook(e);
                if (!a) throw Error("no orderbook");
                if (t === _.BUY) {
                    if (!a.asks) throw Error("no match");
                    return ((e, t, r) => {
                        if (!e.length) throw Error("no match");
                        let n = 0;
                        for (let r = e.length - 1; r >= 0; r--) {
                            let a = e[r];
                            if ((n += parseFloat(a.size) * parseFloat(a.price)) >= t) return parseFloat(a.price)
                        }
                        if (r === C.FOK) throw Error("no match");
                        return parseFloat(e[0].price)
                    })(a.asks, r, n)
                }
                if (!a.bids) throw Error("no match");
                return ((e, t, r) => {
                    if (!e.length) throw Error("no match");
                    let n = 0;
                    for (let r = e.length - 1; r >= 0; r--) {
                        let a = e[r];
                        if ((n += parseFloat(a.size)) >= t) return parseFloat(a.price)
                    }
                    if (r === C.FOK) throw Error("no match");
                    return parseFloat(e[0].price)
                })(a.bids, r, n)
            }
            async createBuilderApiKey() {
                this.canL2Auth();
                let e = o.CREATE_BUILDER_API_KEY,
                    t = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: p,
                        requestPath: e
                    }, this.useServerTime ? await this.getServerTime() : void 0);
                return this.post(`${this.host}${e}`, {
                    headers: t
                })
            }
            async getBuilderApiKeys() {
                this.canL2Auth();
                let e = o.GET_BUILDER_API_KEYS,
                    t = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: "GET",
                        requestPath: e
                    }, this.useServerTime ? await this.getServerTime() : void 0);
                return this.get(`${this.host}${e}`, {
                    headers: t
                })
            }
            async revokeBuilderApiKey() {
                this.canL2Auth();
                let e = o.REVOKE_BUILDER_API_KEY,
                    t = await (0, c.createL2Headers)(this.signer, this.creds, {
                        method: h,
                        requestPath: e
                    }, this.useServerTime ? await this.getServerTime() : void 0);
                return this.del(`${this.host}${e}`, {
                    headers: t
                })
            }
            async getMarketTradesEvents(e) {
                return this.get(`${this.host}${o.GET_MARKET_TRADES_EVENTS}${e}`)
            }
            canL1Auth() {
                if (void 0 === this.signer) throw s.L1_AUTH_UNAVAILABLE_ERROR
            }
            canL2Auth() {
                if (void 0 === this.signer) throw s.L1_AUTH_UNAVAILABLE_ERROR;
                if (void 0 === this.creds) throw s.L2_AUTH_NOT_AVAILABLE
            }
            isBuilderOrder(e) {
                return void 0 !== e && e !== i.bytes32Zero
            }
            async getBuilderTakerFeeRate(e) {
                return this.isBuilderOrder(e) ? (await this.ensureBuilderFeeRateCached(e), this.builderFeeRates[e ? ? ""] ? .taker ? ? 0) : 0
            }
            async adjustBuyAmountForBalance(e, t, r, n, a) {
                await this._ensureMarketInfoCached(e);
                let i = await this.getBuilderTakerFeeRate(a);
                return (0, l.adjustBuyAmountForFees)(t, r, n, this.feeInfos[e].rate, this.feeInfos[e].exponent, i, this.feeSlippage)
            }
            async _ensureMarketInfoCached(e) {
                if (!(e in this.feeInfos)) {
                    if (!(e in this.tokenConditionMap)) {
                        let t = await this.get(`${this.host}${o.GET_MARKET_BY_TOKEN}${e}`);
                        if (!t ? .condition_id) throw Error(`failed to resolve condition id for token ${e}`);
                        this.tokenConditionMap[e] = t.condition_id
                    }
                    await this.getClobMarketInfo(this.tokenConditionMap[e])
                }
            }
            async ensureBuilderFeeRateCached(e) {
                if (!e || e === i.bytes32Zero || e in this.builderFeeRates) return;
                let t = await this.get(`${this.host}${o.GET_BUILDER_FEES}${e}`);
                this.builderFeeRates[e] = {
                    maker: t.builder_maker_fee_rate_bps / i.BUILDER_FEES_BPS,
                    taker: t.builder_taker_fee_rate_bps / i.BUILDER_FEES_BPS
                }
            }
            async _resolveTickSize(e, t) {
                let r = await this.getTickSize(e);
                if (t) {
                    if (parseFloat(t) < parseFloat(r)) throw Error(`invalid tick size (${t}), minimum for the market is ${r}`)
                } else t = r;
                return t
            }
            async _resolveFeeRateBps(e, t) {
                let r = await this.getFeeRateBps(e);
                if (r > 0 && void 0 !== t && t !== r) throw Error(`invalid user provided fee rate: ${t}, fee rate for the market must be ${r}`);
                return r
            }
            async resolveVersion(e = !1) {
                if (!e && void 0 !== this.cachedVersion) return this.cachedVersion;
                let t = await this.getVersion();
                return this.cachedVersion = t, t
            }
            async _retryOnVersionUpdate(e) {
                let t = await this.resolveVersion();
                for (let r = 0; r < 2 && (await e(), t !== await this.resolveVersion()); r++);
            }
            _isOrderVersionMismatch(e) {
                let t = e ? .error;
                return !!t && ("string" == typeof t ? t : JSON.stringify(t)).includes(i.ORDER_VERSION_MISMATCH_ERROR)
            }
            throwIfError(e) {
                if (this.throwOnError && e && "object" == typeof e && "error" in e) throw new s.ApiError("string" == typeof e.error ? e.error : JSON.stringify(e.error), e.status, e);
                return e
            }
            async get(e, t, r = !1) {
                let n = await g(e, t);
                return r ? n : this.throwIfError(n)
            }
            async post(e, t, r = !1) {
                let n = await y(e, t, this.retryOnError);
                return r ? n : this.throwIfError(n)
            }
            async del(e, t, r = !1) {
                let n = await b(e, t);
                return r ? n : this.throwIfError(n)
            }
        };
    e.s(["ClobClient", 0, ef], 67385)
}, 932889, e => {
    "use strict";
    var t = e.i(788494),
        r = e.i(291833);
    async function n(e, n) {
        let {
            addEthereumChainParameter: a,
            chainId: i
        } = n, o = e.state.connections.get(n.connector ? .uid ? ? e.state.current);
        if (o) {
            let e = o.connector;
            if (!e.switchChain) throw new r.SwitchChainNotSupportedError({
                connector: e
            });
            return await e.switchChain({
                addEthereumChainParameter: a,
                chainId: i
            })
        }
        let s = e.chains.find(e => e.id === i);
        if (!s) throw new t.ChainNotConfiguredError;
        return e.setState(e => ({ ...e,
            chainId: i
        })), s
    }
    e.s(["switchChainMutationOptions", 0, function(e, t = {}) {
        return { ...t.mutation,
            mutationFn: t => n(e, t),
            mutationKey: ["switchChain"]
        }
    }], 932889)
}, 585192, 400072, e => {
    "use strict";
    var t = e.i(112130);
    let r = [];
    e.s(["getChains", 0, function(e) {
        let n = e.chains;
        return (0, t.deepEqual)(r, n) ? r : (r = n, n)
    }], 585192), e.s(["watchChains", 0, function(e, t) {
        let {
            onChange: r
        } = t;
        return e._internal.chains.subscribe((e, t) => {
            r(e, t)
        })
    }], 400072)
}, 73836, 8998, e => {
    "use strict";
    var t = e.i(601550),
        r = e.i(932889),
        n = e.i(585192),
        a = e.i(400072),
        i = e.i(416340),
        o = e.i(912504);

    function s(e = {}) {
        let t = (0, o.useConfig)(e);
        return (0, i.useSyncExternalStore)(e => (0, a.watchChains)(t, {
            onChange: e
        }), () => (0, n.getChains)(t), () => (0, n.getChains)(t))
    }
    e.s(["useChains", 0, s], 8998), e.s(["useSwitchChain", 0, function(e = {}) {
        let n = (0, o.useConfig)(e),
            a = (0, r.switchChainMutationOptions)(n, e),
            i = (0, t.useMutation)(a);
        return { ...i,
            chains: s({
                config: n
            }),
            switchChain: i.mutate,
            switchChainAsync: i.mutateAsync
        }
    }], 73836)
}, 366478, e => {
    "use strict";
    var t = e.i(849872),
        r = e.i(922448);
    async function n(e, a = {}) {
        return (await (0, r.getConnectorClient)(e, a)).extend(t.walletActions)
    }
    e.s(["getWalletClient", 0, n])
}, 645934, e => {
    "use strict";
    var t = e.i(122538);

    function r(e) {
        return "[object Object]" === Object.prototype.toString.call(e)
    }
    e.s(["filterQueryOptions", 0, function(e) {
        let {
            _defaulted: t,
            behavior: r,
            gcTime: n,
            initialData: a,
            initialDataUpdatedAt: i,
            maxPages: o,
            meta: s,
            networkMode: l,
            queryFn: c,
            queryHash: u,
            queryKey: d,
            queryKeyHashFn: f,
            retry: p,
            retryDelay: h,
            structuralSharing: m,
            getPreviousPageParam: y,
            getNextPageParam: g,
            initialPageParam: b,
            _optimisticResults: v,
            enabled: x,
            notifyOnChangeProps: w,
            placeholderData: _,
            refetchInterval: C,
            refetchIntervalInBackground: E,
            refetchOnMount: S,
            refetchOnReconnect: A,
            refetchOnWindowFocus: I,
            retryOnMount: T,
            select: k,
            staleTime: O,
            suspense: R,
            throwOnError: N,
            abi: M,
            config: P,
            connector: D,
            query: j,
            watch: L,
            ...F
        } = e;
        return D ? {
            connectorUid: D ? .uid,
            ...F
        } : F
    }, "hashFn", 0, function(e) {
        return JSON.stringify(e, (e, t) => ! function(e) {
            if (!r(e)) return !1;
            let t = e.constructor;
            if (void 0 === t) return !0;
            let n = t.prototype;
            return !!r(n) && !!n.hasOwnProperty("isPrototypeOf")
        }(t) ? "bigint" == typeof t ? t.toString() : t : Object.keys(t).sort().reduce((e, r) => (e[r] = t[r], e), {}))
    }, "structuralSharing", 0, function(e, r) {
        return (0, t.replaceEqualDeep)(e, r)
    }])
}, 101162, e => {
    "use strict";
    var t = e.i(366478),
        r = e.i(645934);
    e.s(["getWalletClientQueryOptions", 0, function(e, n = {}) {
        return { ...n.query,
            enabled: !!(n.connector ? .getProvider && (n.query ? .enabled ? ? !0)),
            gcTime: 0,
            queryFn: async r => {
                if (!n.connector ? .getProvider) throw Error("connector is required");
                let [, {
                    connectorUid: a,
                    scopeKey: i,
                    ...o
                }] = r.queryKey;
                return (0, t.getWalletClient)(e, { ...o,
                    connector: n.connector
                })
            },
            queryKey: function(e = {}) {
                return ["walletClient", (0, r.filterQueryOptions)(e)]
            }(n),
            staleTime: 1 / 0
        }
    }])
}, 58794, e => {
    "use strict";
    var t = e.i(964974);
    e.i(601550);
    var r = e.i(645934);
    e.s(["useQuery", 0, function(e) {
        let n = (0, t.useQuery)({ ...e,
            queryKeyHashFn: r.hashFn
        });
        return n.queryKey = e.queryKey, n
    }])
}, 413102, 692146, e => {
    "use strict";
    e.s(["getChainId", 0, function(e) {
        return e.state.chainId
    }], 413102), e.s(["watchChainId", 0, function(e, t) {
        let {
            onChange: r
        } = t;
        return e.subscribe(e => e.chainId, r)
    }], 692146)
}, 478088, e => {
    "use strict";
    var t = e.i(413102),
        r = e.i(692146),
        n = e.i(416340),
        a = e.i(912504);
    e.s(["useChainId", 0, function(e = {}) {
        let i = (0, a.useConfig)(e);
        return (0, n.useSyncExternalStore)(e => (0, r.watchChainId)(i, {
            onChange: e
        }), () => (0, t.getChainId)(i), () => (0, t.getChainId)(i))
    }])
}, 423708, e => {
    "use strict";
    var t = e.i(318594),
        r = e.i(101162),
        n = e.i(416340),
        a = e.i(58794),
        i = e.i(478088),
        o = e.i(912504),
        s = e.i(805949);
    e.s(["useWalletClient", 0, function(e = {}) {
        let l = (0, o.useConfig)(e),
            c = (0, i.useChainId)({
                config: l
            }),
            {
                address: u,
                connector: d
            } = (0, s.useConnection)({
                config: l
            }),
            f = (0, r.getWalletClientQueryOptions)(l, { ...e,
                chainId: e.chainId ? ? c,
                connector: e.connector ? ? d,
                query: e.query
            }),
            p = (0, n.useRef)(u),
            h = (0, t.useQueryClient)();
        return (0, n.useEffect)(() => {
            let e = p.current;
            !u && e ? (h.removeQueries({
                queryKey: f.queryKey
            }), p.current = void 0) : u !== e && (h.invalidateQueries({
                queryKey: f.queryKey
            }), p.current = u)
        }, [u, h]), (0, a.useQuery)(f)
    }])
}, 751669, e => {
    "use strict";
    e.s(["AuthenticationTypesEnum", 0, {
        magic: "magic",
        eoa: "eoa"
    }])
}, 494703, 932918, 484096, e => {
    "use strict";
    e.s(["createStore", 0, function() {
        let e = new Set,
            t = [],
            r = () => (function(e) {
                if ("u" < typeof window) return;
                let t = t => e(t.detail);
                return window.addEventListener("eip6963:announceProvider", t), window.dispatchEvent(new CustomEvent("eip6963:requestProvider")), () => window.removeEventListener("eip6963:announceProvider", t)
            })(r => {
                t.some(({
                    info: e
                }) => e.uuid === r.info.uuid) || (t = [...t, r], e.forEach(e => e(t, {
                    added: [r]
                })))
            }),
            n = r();
        return {
            _listeners: () => e,
            clear() {
                e.forEach(e => e([], {
                    removed: [...t]
                })), t = []
            },
            destroy() {
                this.clear(), e.clear(), n ? .()
            },
            findProvider: ({
                rdns: e
            }) => t.find(t => t.info.rdns === e),
            getProviders: () => t,
            reset() {
                this.clear(), n ? .(), n = r()
            },
            subscribe: (r, {
                emitImmediately: n
            } = {}) => (e.add(r), n && r(t, {
                added: t
            }), () => e.delete(r))
        }
    }], 494703);
    let t = e => r => {
        try {
            let n = e(r);
            if (n instanceof Promise) return n;
            return {
                then: e => t(e)(n),
                catch (e) {
                    return this
                }
            }
        } catch (e) {
            return {
                then(e) {
                    return this
                },
                catch: r => t(r)(e)
            }
        }
    };
    e.s(["persist", 0, (e, r) => (n, a, i) => {
        let o, s = {
                storage: function(e) {
                    let t;
                    try {
                        t = e()
                    } catch (e) {
                        return
                    }
                    return {
                        getItem: e => {
                            var r;
                            let n = e => null === e ? null : JSON.parse(e, void 0),
                                a = null != (r = t.getItem(e)) ? r : null;
                            return a instanceof Promise ? a.then(n) : n(a)
                        },
                        setItem: (e, r) => t.setItem(e, JSON.stringify(r, void 0)),
                        removeItem: e => t.removeItem(e)
                    }
                }(() => localStorage),
                partialize: e => e,
                version: 0,
                merge: (e, t) => ({ ...t,
                    ...e
                }),
                ...r
            },
            l = !1,
            c = new Set,
            u = new Set,
            d = s.storage;
        if (!d) return e((...e) => {
            console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`), n(...e)
        }, a, i);
        let f = () => {
                let e = s.partialize({ ...a()
                });
                return d.setItem(s.name, {
                    state: e,
                    version: s.version
                })
            },
            p = i.setState;
        i.setState = (e, t) => {
            p(e, t), f()
        };
        let h = e((...e) => {
            n(...e), f()
        }, a, i);
        i.getInitialState = () => h;
        let m = () => {
            var e, r;
            if (!d) return;
            l = !1, c.forEach(e => {
                var t;
                return e(null != (t = a()) ? t : h)
            });
            let i = (null == (r = s.onRehydrateStorage) ? void 0 : r.call(s, null != (e = a()) ? e : h)) || void 0;
            return t(d.getItem.bind(d))(s.name).then(e => {
                if (e)
                    if ("number" != typeof e.version || e.version === s.version) return [!1, e.state];
                    else {
                        if (s.migrate) return [!0, s.migrate(e.state, e.version)];
                        console.error("State loaded from storage couldn't be migrated since no migrate function was provided")
                    }
                return [!1, void 0]
            }).then(e => {
                var t;
                let [r, i] = e;
                if (n(o = s.merge(i, null != (t = a()) ? t : h), !0), r) return f()
            }).then(() => {
                null == i || i(o, void 0), o = a(), l = !0, u.forEach(e => e(o))
            }).catch(e => {
                null == i || i(void 0, e)
            })
        };
        return i.persist = {
            setOptions: e => {
                s = { ...s,
                    ...e
                }, e.storage && (d = e.storage)
            },
            clearStorage: () => {
                null == d || d.removeItem(s.name)
            },
            getOptions: () => s,
            rehydrate: () => m(),
            hasHydrated: () => l,
            onHydrate: e => (c.add(e), () => {
                c.delete(e)
            }),
            onFinishHydration: e => (u.add(e), () => {
                u.delete(e)
            })
        }, s.skipHydration || m(), o || h
    }, "subscribeWithSelector", 0, e => (t, r, n) => {
        let a = n.subscribe;
        return n.subscribe = (e, t, r) => {
            let i = e;
            if (t) {
                let a = (null == r ? void 0 : r.equalityFn) || Object.is,
                    o = e(n.getState());
                i = r => {
                    let n = e(r);
                    if (!a(o, n)) {
                        let e = o;
                        t(o = n, e)
                    }
                }, (null == r ? void 0 : r.fireImmediately) && t(o, o)
            }
            return a(i)
        }, e(t, r, n)
    }], 932918);
    let r = e => {
        let t, r = new Set,
            n = (e, n) => {
                let a = "function" == typeof e ? e(t) : e;
                if (!Object.is(a, t)) {
                    let e = t;
                    t = (null != n ? n : "object" != typeof a || null === a) ? a : Object.assign({}, t, a), r.forEach(r => r(t, e))
                }
            },
            a = () => t,
            i = {
                setState: n,
                getState: a,
                getInitialState: () => o,
                subscribe: e => (r.add(e), () => r.delete(e))
            },
            o = t = e(n, a, i);
        return i
    };
    e.s(["createStore", 0, e => e ? r(e) : r], 484096)
}, 288172, 195393, e => {
    "use strict";
    var t = e.i(113967),
        r = e.i(186897),
        n = e.i(962702),
        a = e.i(644988),
        i = e.i(46933),
        o = e.i(788494),
        s = e.i(291833),
        l = e.i(912455);

    function c(e = {}) {
        let f, p, h, m, {
            shimDisconnect: y = !0,
            unstable_shimAsyncInject: g
        } = e;

        function b() {
            let t = e.target;
            if ("function" == typeof t) {
                let e = t();
                if (e) return e
            }
            return "object" == typeof t ? t : "string" == typeof t ? { ...u[t] ? ? {
                    id: t,
                    name: `${t[0].toUpperCase()}${t.slice(1)}`,
                    provider: `is${t[0].toUpperCase()}${t.slice(1)}`
                }
            } : {
                id: "injected",
                name: "Injected",
                provider: e => e ? .ethereum
            }
        }
        return (0, l.createConnector)(l => ({
            get icon() {
                return b().icon
            },
            get id() {
                return b().id
            },
            get name() {
                return b().name
            },
            type: c.type,
            async setup() {
                let t = await this.getProvider();
                t ? .on && e.target && (h || (h = this.onConnect.bind(this), t.on("connect", h)), f || (f = this.onAccountsChanged.bind(this), t.on("accountsChanged", f)))
            },
            async connect({
                chainId: r,
                isReconnecting: a,
                withCapabilities: i
            } = {}) {
                let o = await this.getProvider();
                if (!o) throw new s.ProviderNotFoundError;
                let c = [];
                if (a) c = await this.getAccounts().catch(() => []);
                else if (y) try {
                    let e = await o.request({
                        method: "wallet_requestPermissions",
                        params: [{
                            eth_accounts: {}
                        }]
                    });
                    (c = e[0] ? .caveats ? .[0] ? .value ? .map(e => (0, t.getAddress)(e))).length > 0 && (c = await this.getAccounts())
                } catch (e) {
                    if (e.code === n.UserRejectedRequestError.code) throw new n.UserRejectedRequestError(e);
                    if (e.code === n.ResourceUnavailableRpcError.code) throw e
                }
                try {
                    c ? .length || a || (c = (await o.request({
                        method: "eth_requestAccounts"
                    })).map(e => (0, t.getAddress)(e))), h && (o.removeListener("connect", h), h = void 0), f || (f = this.onAccountsChanged.bind(this), o.on("accountsChanged", f)), p || (p = this.onChainChanged.bind(this), o.on("chainChanged", p)), m || (m = this.onDisconnect.bind(this), o.on("disconnect", m));
                    let s = await this.getChainId();
                    if (r && s !== r) {
                        let e = await this.switchChain({
                            chainId: r
                        }).catch(e => {
                            if (e.code === n.UserRejectedRequestError.code) throw e;
                            return {
                                id: s
                            }
                        });
                        s = e ? .id ? ? s
                    }
                    return y && await l.storage ? .removeItem(`${this.id}.disconnected`), e.target || await l.storage ? .setItem("injected.connected", !0), {
                        accounts: i ? c.map(e => ({
                            address: e,
                            capabilities: {}
                        })) : c,
                        chainId: s
                    }
                } catch (e) {
                    if (e.code === n.UserRejectedRequestError.code) throw new n.UserRejectedRequestError(e);
                    if (e.code === n.ResourceUnavailableRpcError.code) throw new n.ResourceUnavailableRpcError(e);
                    throw e
                }
            },
            async disconnect() {
                let t = await this.getProvider();
                if (!t) throw new s.ProviderNotFoundError;
                p && (t.removeListener("chainChanged", p), p = void 0), m && (t.removeListener("disconnect", m), m = void 0), h || (h = this.onConnect.bind(this), t.on("connect", h));
                try {
                    await (0, i.withTimeout)(() => t.request({
                        method: "wallet_revokePermissions",
                        params: [{
                            eth_accounts: {}
                        }]
                    }), {
                        timeout: 100
                    })
                } catch {}
                y && await l.storage ? .setItem(`${this.id}.disconnected`, !0), e.target || await l.storage ? .removeItem("injected.connected")
            },
            async getAccounts() {
                let e = await this.getProvider();
                if (!e) throw new s.ProviderNotFoundError;
                return (await e.request({
                    method: "eth_accounts"
                })).map(e => (0, t.getAddress)(e))
            },
            async getChainId() {
                let e = await this.getProvider();
                if (!e) throw new s.ProviderNotFoundError;
                return Number(await e.request({
                    method: "eth_chainId"
                }))
            },
            async getProvider() {
                let e;
                if ("u" < typeof window) return;
                let t = b();
                return (e = "function" == typeof t.provider ? t.provider(window) : "string" == typeof t.provider ? d(window, t.provider) : t.provider) && !e.removeListener && ("off" in e && "function" == typeof e.off ? e.removeListener = e.off : e.removeListener = () => {}), e
            },
            async isAuthorized() {
                try {
                    if (y && await l.storage ? .getItem(`${this.id}.disconnected`) || !e.target && !await l.storage ? .getItem("injected.connected")) return !1;
                    if (!await this.getProvider()) {
                        if (void 0 !== g && !1 !== g) {
                            let e = async () => ("u" > typeof window && window.removeEventListener("ethereum#initialized", e), !!await this.getProvider()),
                                t = "number" == typeof g ? g : 1e3;
                            if (await Promise.race([..."u" > typeof window ? [new Promise(t => window.addEventListener("ethereum#initialized", () => t(e()), {
                                    once: !0
                                }))] : [], new Promise(r => setTimeout(() => r(e()), t))])) return !0
                        }
                        throw new s.ProviderNotFoundError
                    }
                    return !!(await (0, a.withRetry)(() => this.getAccounts())).length
                } catch {
                    return !1
                }
            },
            async switchChain({
                addEthereumChainParameter: e,
                chainId: t
            }) {
                let a = await this.getProvider();
                if (!a) throw new s.ProviderNotFoundError;
                let i = l.chains.find(e => e.id === t);
                if (!i) throw new n.SwitchChainError(new o.ChainNotConfiguredError);
                let c = new Promise(e => {
                    let r = n => {
                        "chainId" in n && n.chainId === t && (l.emitter.off("change", r), e())
                    };
                    l.emitter.on("change", r)
                });
                try {
                    return await Promise.all([a.request({
                        method: "wallet_switchEthereumChain",
                        params: [{
                            chainId: (0, r.numberToHex)(t)
                        }]
                    }).then(async () => {
                        await this.getChainId() === t && l.emitter.emit("change", {
                            chainId: t
                        })
                    }), c]), i
                } catch (o) {
                    if (4902 === o.code || o ? .data ? .originalError ? .code === 4902) try {
                        let o, s, {
                            default: u,
                            ...d
                        } = i.blockExplorers ? ? {};
                        e ? .blockExplorerUrls ? o = e.blockExplorerUrls : u && (o = [u.url, ...Object.values(d).map(e => e.url)]), s = e ? .rpcUrls ? .length ? e.rpcUrls : [i.rpcUrls.default ? .http[0] ? ? ""];
                        let f = {
                            blockExplorerUrls: o,
                            chainId: (0, r.numberToHex)(t),
                            chainName: e ? .chainName ? ? i.name,
                            iconUrls: e ? .iconUrls,
                            nativeCurrency: e ? .nativeCurrency ? ? i.nativeCurrency,
                            rpcUrls: s
                        };
                        return await Promise.all([a.request({
                            method: "wallet_addEthereumChain",
                            params: [f]
                        }).then(async () => {
                            if (await this.getChainId() === t) l.emitter.emit("change", {
                                chainId: t
                            });
                            else throw new n.UserRejectedRequestError(Error("User rejected switch after adding network."))
                        }), c]), i
                    } catch (e) {
                        throw new n.UserRejectedRequestError(e)
                    }
                    if (o.code === n.UserRejectedRequestError.code) throw new n.UserRejectedRequestError(o);
                    throw new n.SwitchChainError(o)
                }
            },
            async onAccountsChanged(e) {
                if (0 === e.length) this.onDisconnect();
                else if (l.emitter.listenerCount("connect")) {
                    let e = (await this.getChainId()).toString();
                    this.onConnect({
                        chainId: e
                    }), y && await l.storage ? .removeItem(`${this.id}.disconnected`)
                } else l.emitter.emit("change", {
                    accounts: e.map(e => (0, t.getAddress)(e))
                })
            },
            onChainChanged(e) {
                let t = Number(e);
                l.emitter.emit("change", {
                    chainId: t
                })
            },
            async onConnect(e) {
                let t = await this.getAccounts();
                if (0 === t.length) return;
                let r = Number(e.chainId);
                l.emitter.emit("connect", {
                    accounts: t,
                    chainId: r
                });
                let n = await this.getProvider();
                n && (h && (n.removeListener("connect", h), h = void 0), f || (f = this.onAccountsChanged.bind(this), n.on("accountsChanged", f)), p || (p = this.onChainChanged.bind(this), n.on("chainChanged", p)), m || (m = this.onDisconnect.bind(this), n.on("disconnect", m)))
            },
            async onDisconnect(e) {
                let t = await this.getProvider();
                e && 1013 === e.code && t && (await this.getAccounts()).length || (l.emitter.emit("disconnect"), t && (p && (t.removeListener("chainChanged", p), p = void 0), m && (t.removeListener("disconnect", m), m = void 0), h || (h = this.onConnect.bind(this), t.on("connect", h))))
            }
        }))
    }
    c.type = "injected";
    let u = {
        coinbaseWallet: {
            id: "coinbaseWallet",
            name: "Coinbase Wallet",
            provider: e => e ? .coinbaseWalletExtension ? e.coinbaseWalletExtension : d(e, "isCoinbaseWallet")
        },
        metaMask: {
            id: "metaMask",
            name: "MetaMask",
            provider: e => d(e, e => {
                if (!e.isMetaMask || e.isBraveWallet && !e._events && !e._state) return !1;
                for (let t of ["isApexWallet", "isAvalanche", "isBitKeep", "isBlockWallet", "isKuCoinWallet", "isMathWallet", "isOkxWallet", "isOKExWallet", "isOneInchIOSWallet", "isOneInchAndroidWallet", "isOpera", "isPhantom", "isPortal", "isRabby", "isTokenPocket", "isTokenary", "isUniswapWallet", "isZerion"])
                    if (e[t]) return !1;
                return !0
            })
        },
        phantom: {
            id: "phantom",
            name: "Phantom",
            provider: e => e ? .phantom ? .ethereum ? e.phantom ? .ethereum : d(e, "isPhantom")
        }
    };

    function d(e, t) {
        function r(e) {
            return "function" == typeof t ? t(e) : "string" != typeof t || e[t]
        }
        let n = e.ethereum;
        return n ? .providers ? n.providers.find(e => r(e)) : n && r(n) ? n : void 0
    }
    e.s(["injected", 0, c], 288172), e.i(102201);
    var f = e.i(154325);
    class p {
        constructor(e) {
            Object.defineProperty(this, "uid", {
                enumerable: !0,
                configurable: !0,
                writable: !0,
                value: e
            }), Object.defineProperty(this, "_emitter", {
                enumerable: !0,
                configurable: !0,
                writable: !0,
                value: new f.EventEmitter
            })
        }
        on(e, t) {
            this._emitter.on(e, t)
        }
        once(e, t) {
            this._emitter.once(e, t)
        }
        off(e, t) {
            this._emitter.off(e, t)
        }
        emit(e, ...t) {
            let r = t[0];
            this._emitter.emit(e, {
                uid: this.uid,
                ...r
            })
        }
        listenerCount(e) {
            return this._emitter.listenerCount(e)
        }
    }
    e.s(["createEmitter", 0, function(e) {
        return new p(e)
    }], 195393)
}, 697242, e => {
    "use strict";
    let t;
    var r = e.i(494703),
        n = e.i(212146),
        a = e.i(932918),
        i = e.i(484096),
        o = e.i(288172),
        s = e.i(195393),
        l = e.i(94371),
        c = e.i(788494);
    let u = 256;
    var d = e.i(659662);
    e.s(["createConfig", 0, function(e) {
        let f, {
                multiInjectedProviderDiscovery: p = !0,
                storage: h = (0, l.createStorage)({
                    storage: (0, l.getDefaultStorage)()
                }),
                syncConnectedChain: m = !0,
                ssr: y = !1,
                ...g
            } = e,
            b = "u" > typeof window && p ? (0, r.createStore)() : void 0,
            v = (0, i.createStore)(() => g.chains),
            x = (0, i.createStore)(() => {
                let e = [],
                    t = new Set;
                for (let r of g.connectors ? ? []) {
                    let n = w(r);
                    if (e.push(n), !y && n.rdns)
                        for (let e of "string" == typeof n.rdns ? [n.rdns] : n.rdns) t.add(e)
                }
                if (!y && b)
                    for (let r of b.getProviders()) t.has(r.info.rdns) || e.push(w(_(r)));
                return e
            });

        function w(e) {
            let r = (0, s.createEmitter)(function(e = 11) {
                    if (!t || u + e > 512) {
                        t = "", u = 0;
                        for (let e = 0; e < 256; e++) t += (256 + 256 * Math.random() | 0).toString(16).substring(1)
                    }
                    return t.substring(u, u++ + e)
                }()),
                n = { ...e({
                        emitter: r,
                        chains: v.getState(),
                        storage: h,
                        transports: g.transports
                    }),
                    emitter: r,
                    uid: r.uid
                };
            return r.on("connect", k), n.setup ? .(), n
        }

        function _(e) {
            let {
                info: t
            } = e, r = e.provider;
            return (0, o.injected)({
                target: { ...t,
                    id: t.rdns,
                    provider: r
                }
            })
        }
        let C = new Map;

        function E() {
            return {
                chainId: v.getState()[0].id,
                connections: new Map,
                current: null,
                status: "disconnected"
            }
        }
        let S = "0.0.0-canary-";
        f = d.version.startsWith(S) ? Number.parseInt(d.version.replace(S, ""), 10) : Number.parseInt(d.version.split(".")[0] ? ? "0", 10);
        let A = (0, i.createStore)((0, a.subscribeWithSelector)(h ? (0, a.persist)(E, {
            migrate(e, t) {
                if (t === f) return e;
                let r = E(),
                    n = I(e, r.chainId);
                return { ...r,
                    chainId: n
                }
            },
            name: "store",
            partialize: e => ({
                connections: {
                    __type: "Map",
                    value: Array.from(e.connections.entries()).map(([e, t]) => {
                        let {
                            id: r,
                            name: n,
                            type: a,
                            uid: i
                        } = t.connector;
                        return [e, { ...t,
                            connector: {
                                id: r,
                                name: n,
                                type: a,
                                uid: i
                            }
                        }]
                    })
                },
                chainId: e.chainId,
                current: e.current
            }),
            merge(e, t) {
                "object" == typeof e && e && "status" in e && delete e.status;
                let r = I(e, t.chainId);
                return { ...t,
                    ...e,
                    chainId: r
                }
            },
            skipHydration: y,
            storage: h,
            version: f
        }) : E));

        function I(e, t) {
            return e && "object" == typeof e && "chainId" in e && "number" == typeof e.chainId && v.getState().some(t => t.id === e.chainId) ? e.chainId : t
        }

        function T(e) {
            A.setState(t => {
                let r = t.connections.get(e.uid);
                return r ? { ...t,
                    connections: new Map(t.connections).set(e.uid, {
                        accounts: e.accounts ? ? r.accounts,
                        chainId: e.chainId ? ? r.chainId,
                        connector: r.connector
                    })
                } : t
            })
        }

        function k(e) {
            "connecting" !== A.getState().status && "reconnecting" !== A.getState().status && A.setState(t => {
                let r = x.getState().find(t => t.uid === e.uid);
                return r ? (r.emitter.listenerCount("connect") && r.emitter.off("connect", T), r.emitter.listenerCount("change") || r.emitter.on("change", T), r.emitter.listenerCount("disconnect") || r.emitter.on("disconnect", O), { ...t,
                    connections: new Map(t.connections).set(e.uid, {
                        accounts: e.accounts,
                        chainId: e.chainId,
                        connector: r
                    }),
                    current: e.uid,
                    status: "connected"
                }) : t
            })
        }

        function O(e) {
            A.setState(t => {
                let r = t.connections.get(e.uid);
                if (r) {
                    let e = r.connector;
                    e.emitter.listenerCount("change") && r.connector.emitter.off("change", T), e.emitter.listenerCount("disconnect") && r.connector.emitter.off("disconnect", O), e.emitter.listenerCount("connect") || r.connector.emitter.on("connect", k)
                }
                if (t.connections.delete(e.uid), 0 === t.connections.size) return { ...t,
                    connections: new Map,
                    current: null,
                    status: "disconnected"
                };
                let n = t.connections.values().next().value;
                return { ...t,
                    connections: new Map(t.connections),
                    current: n.connector.uid
                }
            })
        }
        return A.setState(E()), m && A.subscribe(({
            connections: e,
            current: t
        }) => t ? e.get(t) ? .chainId : void 0, e => {
            if (v.getState().some(t => t.id === e)) return A.setState(t => ({ ...t,
                chainId: e ? ? t.chainId
            }))
        }), b ? .subscribe(e => {
            let t = new Set,
                r = new Set;
            for (let e of x.getState())
                if (t.add(e.id), e.rdns)
                    for (let t of "string" == typeof e.rdns ? [e.rdns] : e.rdns) r.add(t);
            let n = [];
            for (let a of e) {
                if (r.has(a.info.rdns)) continue;
                let e = w(_(a));
                t.has(e.id) || n.push(e)
            }(!h || A.persist.hasHydrated()) && x.setState(e => [...e, ...n], !0)
        }), {
            get chains() {
                return v.getState()
            },
            get connectors() {
                return x.getState()
            },
            storage: h,
            getClient: function(e = {}) {
                let t, r = e.chainId ? ? A.getState().chainId,
                    a = v.getState().find(e => e.id === r);
                if (e.chainId && !a) throw new c.ChainNotConfiguredError; {
                    let e = C.get(A.getState().chainId);
                    if (e && !a) return e;
                    if (!a) throw new c.ChainNotConfiguredError
                } {
                    let e = C.get(r);
                    if (e) return e
                }
                if (g.client) t = g.client({
                    chain: a
                });
                else {
                    let e = a.id,
                        r = v.getState().map(e => e.id),
                        i = {};
                    for (let [t, n] of Object.entries(g))
                        if ("chains" !== t && "client" !== t && "connectors" !== t && "transports" !== t)
                            if ("object" == typeof n)
                                if (e in n) i[t] = n[e];
                                else {
                                    if (r.some(e => e in n)) continue;
                                    i[t] = n
                                }
                    else i[t] = n;
                    t = (0, n.createClient)({ ...i,
                        chain: a,
                        batch: i.batch ? ? {
                            multicall: !0
                        },
                        transport: t => g.transports[e]({ ...t,
                            connectors: x
                        })
                    })
                }
                return C.set(r, t), t
            },
            get state() {
                return A.getState()
            },
            setState(e) {
                let t;
                t = "function" == typeof e ? e(A.getState()) : e;
                let r = E();
                "object" != typeof t && (t = r), Object.keys(r).some(e => !(e in t)) && (t = r), A.setState(t, !0)
            },
            subscribe: (e, t, r) => A.subscribe(e, t, r ? { ...r,
                fireImmediately: r.emitImmediately
            } : void 0),
            _internal: {
                mipd: b,
                async revalidate() {
                    let e = A.getState(),
                        t = e.connections,
                        r = e.current;
                    for (let [, e] of t) {
                        let n = e.connector;
                        n.isAuthorized && await n.isAuthorized() || (t.delete(n.uid), r === n.uid && (r = null))
                    }
                    A.setState(e => ({ ...e,
                        connections: t,
                        current: r
                    }))
                },
                store: A,
                ssr: !!y,
                syncConnectedChain: m,
                transports: g.transports,
                chains: {
                    setState(e) {
                        let t = "function" == typeof e ? e(v.getState()) : e;
                        if (0 !== t.length) return v.setState(t, !0)
                    },
                    subscribe: e => v.subscribe(e)
                },
                connectors: {
                    providerDetailToConnector: _,
                    setup: w,
                    setState: e => x.setState("function" == typeof e ? e(x.getState()) : e, !0),
                    subscribe: e => x.subscribe(e)
                },
                events: {
                    change: T,
                    connect: k,
                    disconnect: O
                }
            }
        }
    }], 697242)
}, 620190, 574094, e => {
    "use strict";
    let t;
    var r, n = e.i(366478);
    e.i(284553);
    var a = e.i(94371),
        i = e.i(697242),
        o = e.i(970464),
        s = e.i(684129),
        l = e.i(510700),
        c = e.i(788494),
        u = e.i(912455),
        d = e.i(113967),
        f = e.i(186897),
        p = e.i(962702);

    function h(t = {}) {
        let r, n, a, i;
        return (0, u.createConnector)(o => ({
            id: "coinbaseWalletSDK",
            name: "Coinbase Wallet",
            rdns: "com.coinbase.wallet",
            type: h.type,
            async connect({
                chainId: e,
                withCapabilities: t,
                ...r
            } = {}) {
                try {
                    let o = await this.getProvider(),
                        s = (await o.request({
                            method: "eth_requestAccounts",
                            params: "instantOnboarding" in r && r.instantOnboarding ? [{
                                onboarding: "instant"
                            }] : []
                        })).map(e => (0, d.getAddress)(e));
                    n || (n = this.onAccountsChanged.bind(this), o.on("accountsChanged", n)), a || (a = this.onChainChanged.bind(this), o.on("chainChanged", a)), i || (i = this.onDisconnect.bind(this), o.on("disconnect", i));
                    let l = await this.getChainId();
                    if (e && l !== e) {
                        let t = await this.switchChain({
                            chainId: e
                        }).catch(e => {
                            if (e.code === p.UserRejectedRequestError.code) throw e;
                            return {
                                id: l
                            }
                        });
                        l = t ? .id ? ? l
                    }
                    return {
                        accounts: t ? s.map(e => ({
                            address: e,
                            capabilities: {}
                        })) : s,
                        chainId: l
                    }
                } catch (e) {
                    if (/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(e.message)) throw new p.UserRejectedRequestError(e);
                    throw e
                }
            },
            async disconnect() {
                let e = await this.getProvider();
                n && (e.removeListener("accountsChanged", n), n = void 0), a && (e.removeListener("chainChanged", a), a = void 0), i && (e.removeListener("disconnect", i), i = void 0), e.disconnect(), e.close ? .()
            },
            async getAccounts() {
                let e = await this.getProvider();
                return (await e.request({
                    method: "eth_accounts"
                })).map(e => (0, d.getAddress)(e))
            },
            async getChainId() {
                let e = await this.getProvider();
                return Number(await e.request({
                    method: "eth_chainId"
                }))
            },
            async getProvider() {
                if (!r) {
                    let {
                        createCoinbaseWalletSDK: n
                    } = await (() => {
                        try {
                            return e.A(19094)
                        } catch {
                            throw Error('dependency "@coinbase/wallet-sdk" not found')
                        }
                    })();
                    r = n({ ...t,
                        appChainIds: o.chains.map(e => e.id),
                        preference: {
                            options: "all",
                            ...t.preference ? ? {}
                        }
                    }).getProvider()
                }
                return r
            },
            async isAuthorized() {
                try {
                    return !!(await this.getAccounts()).length
                } catch {
                    return !1
                }
            },
            async switchChain({
                addEthereumChainParameter: e,
                chainId: t
            }) {
                let r = o.chains.find(e => e.id === t);
                if (!r) throw new p.SwitchChainError(new c.ChainNotConfiguredError);
                let n = await this.getProvider();
                try {
                    return await n.request({
                        method: "wallet_switchEthereumChain",
                        params: [{
                            chainId: (0, f.numberToHex)(r.id)
                        }]
                    }), r
                } catch (a) {
                    if (4902 === a.code) try {
                        let a, i;
                        a = e ? .blockExplorerUrls ? e.blockExplorerUrls : r.blockExplorers ? .default.url ? [r.blockExplorers ? .default.url] : [], i = e ? .rpcUrls ? .length ? e.rpcUrls : [r.rpcUrls.default ? .http[0] ? ? ""];
                        let o = {
                            blockExplorerUrls: a,
                            chainId: (0, f.numberToHex)(t),
                            chainName: e ? .chainName ? ? r.name,
                            iconUrls: e ? .iconUrls,
                            nativeCurrency: e ? .nativeCurrency ? ? r.nativeCurrency,
                            rpcUrls: i
                        };
                        return await n.request({
                            method: "wallet_addEthereumChain",
                            params: [o]
                        }), r
                    } catch (e) {
                        throw new p.UserRejectedRequestError(e)
                    }
                    throw new p.SwitchChainError(a)
                }
            },
            onAccountsChanged(e) {
                0 === e.length ? this.onDisconnect() : o.emitter.emit("change", {
                    accounts: e.map(e => (0, d.getAddress)(e))
                })
            },
            onChainChanged(e) {
                let t = Number(e);
                o.emitter.emit("change", {
                    chainId: t
                })
            },
            async onDisconnect(e) {
                o.emitter.emit("disconnect");
                let t = await this.getProvider();
                n && (t.removeListener("accountsChanged", n), n = void 0), a && (t.removeListener("chainChanged", a), a = void 0), i && (t.removeListener("disconnect", i), i = void 0)
            }
        }))
    }
    h.type = "coinbaseWallet";
    var m = e.i(288172),
        y = e.i(750367),
        g = e.i(399482),
        b = e.i(722045);
    let v = e => "string" == typeof e ? Number.parseInt(e, "0x" === e.trim().substring(0, 2) ? 16 : 10) : "bigint" == typeof e ? Number(e) : e;
    var x = e.i(990793),
        w = e.i(883798),
        _ = e.i(864912),
        C = e.i(775404),
        E = e.i(498561),
        S = e.i(631222);
    let A = (t = (r = {
        app: {
            chainId: S.MATIC_CONFIG.chainId,
            meta: {
                name: "Polymarket",
                description: "Polymarket",
                url: "https://polymarket.com"
            },
            credentials: {
                magic: S.MAGIC_KEY,
                walletConnect: "65eb22fce2077beb8b6f4b9970650ae8"
            },
            origin: S.CURRENT_ORIGIN
        }
    }).chains ? ? (0, l.getChains)({
        chainId: r.app.chainId
    }), (0, i.createConfig)({
        chains: t,
        connectors: (({
            config: e,
            chains: t
        }) => {
            let r, n, a = (e => {
                    let {
                        name: t = "Polymarket",
                        icon: r,
                        description: n = "Polymarket",
                        url: a = "https://polymarket.com"
                    } = e.app.meta ? ? {};
                    return {
                        name: t,
                        description: n,
                        url: a,
                        icons: r ? [r] : []
                    }
                })(e),
                i = (0, g.createWalletCache)(),
                o = (r = !!window.Capacitor ? .isNativePlatform ? .(), n = window.navigator.userAgent.includes("PolymarketApp"), r || n);
            return [...o ? [] : [(0, m.injected)({
                target: "metaMask",
                unstable_shimAsyncInject: 2e3
            })], h({
                appName: a.name
            }), (0, y.walletConnect)({
                showQrModal: !1,
                projectId: e.app.credentials.walletConnect,
                metadata: a
            }), ...o ? [] : [(0, u.createConnector)(e => ({ ...(0, m.injected)({
                    target: "phantom",
                    shimDisconnect: !0,
                    unstable_shimAsyncInject: 2e3
                })(e)
            }))], function({
                chains: e,
                primaryChainId: t = 137,
                origin: r,
                logger: n,
                cache: a,
                apiKey: i
            }) {
                return (0, u.createConnector)(o => {
                    let {
                        id: s,
                        name: l,
                        type: c,
                        getProvider: u,
                        onAccountsChanged: f,
                        getMagicSDK: p,
                        getAccount: h,
                        getCache: m,
                        getChainIdWithFallback: y,
                        getChainId: g
                    } = function({
                        chains: e,
                        primaryChainId: t = 137,
                        apiKey: r,
                        cache: n
                    }) {
                        if (!r) throw Error("Magic API Key is required. Get one at https://dashboard.magic.link/");
                        let a = () => {
                                let e = n.state.magic;
                                if (!e) throw Error("[MagicConnectorV3 > getCache] No cache.");
                                if ("magic" !== e.type) throw Error("[MagicConnectorV3 > getCache] Mismatched cache type.");
                                return e
                            },
                            i = ({
                                chainId: e = t
                            } = {}) => {
                                if (!r) throw Error("No Magic API key found.");
                                return (0, _.createMagicSdk)({
                                    chainId: e
                                })
                            },
                            o = ({
                                chainId: t
                            } = {}) => t || e[0].id,
                            s = async ({
                                chainId: e
                            } = {}) => {
                                let t = i({
                                    chainId: e
                                });
                                return t ? t.rpcProvider : null
                            },
                            l = async e => {
                                let t = o({
                                        chainId: e ? .chainId
                                    }),
                                    r = n.accounts.get(t);
                                if (r) return r;
                                let i = a();
                                if (i.address) return n.accounts.update(t, i.address), i.address;
                                let l = await s({
                                        chainId: t
                                    }),
                                    c = await l ? .request({
                                        method: "eth_accounts"
                                    }),
                                    u = (0, d.getAddress)(c[0]);
                                return n.accounts.update(t, u), u
                            },
                            c = async ({
                                chainId: t
                            } = {}) => {
                                let r = await s({
                                        chainId: t
                                    }),
                                    n = await l(),
                                    a = e.find(e => e.id === t) ? ? e[0];
                                if (!r) throw Error("provider is required.");
                                return (0, x.createWalletClient)({
                                    account: n,
                                    chain: a,
                                    transport: (0, w.custom)(r)
                                })
                            },
                            u = async e => {
                                let t = await s();
                                0 !== e.length && e[0] ? t ? .emit("change", {
                                    account: (0, d.getAddress)(e[0])
                                }) : t ? .emit("disconnect")
                            },
                            f = async () => {
                                let e = await s();
                                return e ? v(await e.request({
                                    method: "eth_chainId",
                                    params: []
                                })) : v(137)
                            };
                        return {
                            id: "magic",
                            name: "Magic",
                            type: "Magic",
                            isReady: !1,
                            getMagicSDK: i,
                            getProvider: s,
                            getAccount: l,
                            getWalletClient: c,
                            onAccountsChanged: u,
                            getCache: a,
                            getChainIdWithFallback: o,
                            getChainId: f
                        }
                    }({
                        chains: e,
                        primaryChainId: t,
                        origin: r,
                        logger: n,
                        cache: a,
                        apiKey: i
                    });
                    p({
                        chainId: t
                    }).preload();
                    let C = async () => {
                            try {
                                let e = p();
                                await e ? .user.logout(), a.accounts.clear(), o.emitter.emit("disconnect")
                            } catch (e) {
                                n ? .error({
                                    title: "MagicConnector > disconnect",
                                    message: "Disconnecting from Magic",
                                    context: {
                                        error: e
                                    }
                                })
                            }
                        },
                        E = async () => {
                            let e;
                            try {
                                n ? .debug({
                                    title: "MagicConnectorV3 > getCoercedChainId",
                                    message: "Getting coerced chain id"
                                }), e = await g(), n ? .debug({
                                    title: "MagicConnectorV3 > getCoercedChainId",
                                    message: "Getting coerced chain id",
                                    context: {
                                        chainId: e
                                    }
                                })
                            } catch {
                                e = 0
                            }
                            return e
                        },
                        S = e => {
                            let t = v(e);
                            o.emitter.emit("change", {
                                chainId: t
                            })
                        },
                        A = () => {
                            o.emitter.emit("disconnect")
                        },
                        I = async () => {
                            let e = await u();
                            return e ? .on && (e.on("accountsChanged", f), e.on("chainChanged", S), e.on("disconnect", A)), e
                        },
                        T = async () => {
                            try {
                                m()
                            } catch (e) {
                                throw n ? .error({
                                    title: "MagicConnectorV3 > validateConnectState",
                                    message: "Validating connect state failed",
                                    context: {
                                        error: e
                                    }
                                }), await C(), e
                            }
                        },
                        k = async e => {
                            let t = m();
                            n ? .debug({
                                title: "MagicConnectorV3 > reconnect",
                                message: "Reconnecting to Magic"
                            });
                            let r = !1;
                            if ("oauth" === t.magicAuthType && t.oauthProvider);
                            else if ("email" === t.magicAuthType && t.address) {
                                let n = await h({
                                    chainId: e
                                });
                                if (n ? .toLowerCase() !== t.address.toLowerCase()) try {
                                    await p().user.logout()
                                } catch {} finally {
                                    r = !0
                                }
                            }
                            if (!r) {
                                let r = await h({
                                    chainId: e
                                });
                                return a.state.update({ ..."email" === t.magicAuthType && "pending" === t.connectionState && {
                                        connectionState: "ready"
                                    }
                                }), {
                                    chainId: e,
                                    accounts: [r]
                                }
                            }
                        },
                        O = async ({
                            chainId: e
                        } = {}) => {
                            await T();
                            let t = m();
                            n ? .debug({
                                title: "MagicConnectorV3 > connect",
                                message: "Connecting to Magic"
                            }), await I();
                            let i = y({
                                chainId: e ? ? await E()
                            });
                            if ("requesting" === t.connectionState) try {
                                await C()
                            } catch {}
                            if ("ready" === (t = m()).connectionState) {
                                let e = await k(i);
                                if (n ? .debug({
                                        title: "MagicConnectorV3 > connect > reconnect result",
                                        message: "Reconnecting to Magic",
                                        context: {
                                            accounts: e ? .accounts,
                                            chainId: e ? .chainId
                                        }
                                    }), e) return e
                            }
                            if ("oauth" === t.magicAuthType && t.oauthProvider && "requesting" === t.connectionState) {
                                a.state.update({
                                    connectionState: "redirect"
                                }), await o.storage ? .setItem("recentConnectorId", s);
                                try {
                                    {
                                        let e = `${window.location.pathname}${window.location.search}`;
                                        e.startsWith("/") && b.default.set("pm_return_to", e, {
                                            path: "/",
                                            sameSite: "lax",
                                            secure: "https:" === window.location.protocol
                                        })
                                    }
                                } catch {}
                                if (window.location.pathname && "" !== window.location.pathname && "/" !== window.location.pathname) {
                                    let e = window.location.pathname;
                                    e.endsWith("/") && (e = e.slice(0, -1)), b.default.set("polymarket.magic.redirect_path", e, {
                                        path: "/"
                                    })
                                }
                                if ("telegram" === t.oauthProvider) {
                                    let e = await p({
                                        chainId: i
                                    }).oauth2.loginWithPopup({
                                        provider: "telegram"
                                    });
                                    e && a.state.update({
                                        email: e.magic.userMetadata.email ? ? e.oauth ? .userInfo ? .email ? ? void 0,
                                        address: e.magic.userMetadata.publicAddress,
                                        connectionState: "after-redirect-result"
                                    })
                                } else await p({
                                    chainId: i
                                }).oauth2.loginWithRedirect({
                                    provider: t.oauthProvider,
                                    redirectURI: r ? ? "https://polymarket.com"
                                })
                            }
                            if ("email" === t.magicAuthType && t.email && "requesting" === t.connectionState) {
                                let e = document.body.style.pointerEvents || "";
                                document.body.style.pointerEvents = "auto", a.state.update({
                                    connectionState: "pending"
                                });
                                let r = p({
                                    chainId: i
                                });
                                if (!r ? .auth) throw n ? .error({
                                    title: "MagicConnectorV3 > connect > email",
                                    message: "Missing Magic auth instance"
                                }), Error("Magic authentication is unavailable");
                                if ("function" != typeof r.auth.loginWithEmailOTP) throw n ? .error({
                                    title: "MagicConnectorV3 > connect > email",
                                    message: "OTP authentication not supported"
                                }), Error("Email OTP authentication is unavailable");
                                await r.auth.loginWithEmailOTP({
                                    email: t.email,
                                    showUI: !0,
                                    lifespan: 604800
                                }), n ? .debug({
                                    title: "MagicConnectorV3 > connect > email",
                                    message: "Email authentication successful"
                                }), t = m(), document.body.style.pointerEvents = e
                            }
                            let l = await h();
                            return a.state.update({
                                address: l,
                                ..."email" === t.magicAuthType && {
                                    connectionState: "ready"
                                }
                            }), {
                                accounts: [l],
                                chainId: i
                            }
                        },
                        R = async ({
                            chainId: e
                        } = {}) => {
                            try {
                                let t = m();
                                if (n ? .debug({
                                        title: "MagicConnectorV3 > isAuthorizedViaOauthRedirect > start",
                                        message: "Checking if authorized via oauth redirect"
                                    }), t ? .type !== "magic") throw Error("Mismatched cache type.");
                                let r = await p({
                                    chainId: e
                                }).oauth2.getRedirectResult({
                                    lifespan: 604800
                                });
                                if (n ? .debug({
                                        title: "MagicConnectorV3 > isAuthorizedViaOauthRedirect",
                                        message: "Authorized via oauth redirect"
                                    }), r) return a.state.update({
                                    email: r.magic.userMetadata.email ? ? r.oauth ? .userInfo ? .email ? ? void 0,
                                    address: r.magic.userMetadata.publicAddress,
                                    connectionState: "after-redirect-result"
                                }), !0;
                                return !1
                            } catch (e) {
                                throw n ? .error({
                                    title: "MagicConnectorV3 > isAuthorizedViaOauthRedirect",
                                    message: "Authorized via oauth redirect failed",
                                    context: {
                                        error: e
                                    }
                                }), e
                            }
                        },
                        N = async ({
                            chainId: e
                        } = {}) => {
                            try {
                                let t = a.state.getMagicState({
                                    type: "oauth"
                                });
                                if (n ? .debug({
                                        title: "MagicConnectorV3 > isAuthorized",
                                        message: "Checking if authorized"
                                    }), t) {
                                    if (n ? .debug({
                                            title: "MagicConnectorV3 > isAuthorized > start oauth",
                                            message: "Checking if authorized via oauth"
                                        }), "redirect" === t.connectionState) return await R({
                                        chainId: e
                                    });
                                    if ("after-redirect-result" === t.connectionState) return !0
                                }
                                n ? .debug({
                                    title: "MagicConnectorV3 > isAuthorized > start",
                                    message: "Checking if authorized"
                                });
                                let r = await p({
                                    chainId: e
                                }).user.isLoggedIn();
                                if (n ? .debug({
                                        title: "MagicConnectorV3 > isAuthorized",
                                        message: "Authorized",
                                        context: {
                                            isLoggedIn: r
                                        }
                                    }), r) return !0
                            } catch {}
                            return !1
                        },
                        M = async () => {
                            let e = await u();
                            return (await e ? .request({
                                method: "eth_accounts"
                            })).map(e => (0, d.getAddress)(e))
                        },
                        P = async e => {
                            let t = v(e.chainId),
                                r = await M();
                            o.emitter.emit("connect", {
                                accounts: r,
                                chainId: t
                            })
                        };
                    return {
                        id: s,
                        uid: s,
                        name: l,
                        type: c,
                        getProvider: u,
                        onAccountsChanged: f,
                        getMagicSDK: p,
                        getAccount: h,
                        getCache: m,
                        getChainIdWithFallback: y,
                        getChainId: g,
                        disconnect: C,
                        getCoercedChainId: E,
                        getInstantiatedProvider: I,
                        reconnect: k,
                        connect: O,
                        isAuthorizedViaOauthRedirect: R,
                        isAuthorized: N,
                        getAccounts: M,
                        onChainChanged: S,
                        onConnect: P,
                        onDisconnect: A,
                        validateConnectState: T
                    }
                })
            }({
                chains: t,
                cache: i,
                apiKey: e.app.credentials.magic,
                origin: e.app.origin
            })]
        })({
            config: r,
            chains: t
        }),
        transports: (0, E.createTransports)({
            chains: t
        }),
        storage: (0, a.createStorage)({
            key: "polymarket.cache.wagmi.v2",
            storage: (0, C.createLocalStorage)(),
            serialize: s.serialize,
            deserialize: o.deserialize
        }),
        ...(({
            app: e,
            ssr: t = !0,
            multiInjectedProviderDiscovery: r = !0,
            ...n
        }) => ({
            ssr: t,
            multiInjectedProviderDiscovery: r,
            ...n
        }))(r)
    }));
    e.s(["config", 0, A], 574094);
    var I = e.i(53950);
    let T = async e => {
            if (e) try {
                let t = await e.getProvider();
                if (t && "function" == typeof t.request) {
                    let e = await t.request({
                        method: "eth_chainId"
                    });
                    return parseInt(e, 16)
                }
            } catch (e) {
                I.logger.error("[getActualChainId]: could not get chain id", {
                    error: e
                })
            }
        },
        k = async (e, t, r, a) => {
            try {
                if (e ? .id === "magic") {
                    if (t) return t;
                    I.logger.info("[ensurePolygonSigner]: Magic user, currentSigner is undefined, fetching fresh signer");
                    let e = await (0, n.getWalletClient)(A, {
                        chainId: S.MATIC_CONFIG.chainId
                    });
                    if (e) return e;
                    I.logger.error("[ensurePolygonSigner]: Magic user, could not get signer");
                    return
                }
                let i = await T(e);
                if (i || (I.logger.warn("[ensurePolygonSigner]: could not get chain id, using wagmi chainId", {
                        wagmiChainId: r
                    }), i = r), i && i !== S.MATIC_CONFIG.chainId) {
                    I.logger.info("[ensurePolygonSigner]: switching to Polygon", {
                        currentChain: i,
                        targetChain: S.MATIC_CONFIG.chainId
                    }), await a({
                        chainId: S.MATIC_CONFIG.chainId
                    });
                    let e = await (0, n.getWalletClient)(A, {
                        chainId: S.MATIC_CONFIG.chainId
                    });
                    if (e) return e;
                    return I.logger.error("[ensurePolygonSigner]: error getting fresh signer after chain switch"), t
                }
                if (t) return t;
                I.logger.info("[ensurePolygonSigner]: currentSigner is undefined, fetching fresh signer");
                let o = await (0, n.getWalletClient)(A, {
                    chainId: S.MATIC_CONFIG.chainId
                });
                if (o) return o;
                I.logger.error("[ensurePolygonSigner]: could not get signer from connector client");
                return
            } catch (e) {
                return I.logger.error("[ensurePolygonSigner]: unexpected error", {
                    error: e
                }), t
            }
        };
    e.s(["ensurePolygonSigner", 0, k], 620190)
}, 377960, 606479, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(149534);
    e.s(["IconXmarkOutline18", 0, ({
        strokeWidth: e = 1.5,
        ...n
    }) => t.default.createElement(r.Icon, {
        size: "18px",
        ...n
    }, t.default.createElement("line", {
        x1: "14",
        y1: "4",
        x2: "4",
        y2: "14",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), t.default.createElement("line", {
        x1: "4",
        y1: "4",
        x2: "14",
        y2: "14",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }))], 377960);
    var n = e.i(546904);
    e.s(["Dialog", 0, n], 606479)
}, 317681, e => {
    "use strict";
    let t;
    var r = e.i(546904),
        n = e.i(416340);
    let a = n.default.createContext({
            drawerRef: {
                current: null
            },
            overlayRef: {
                current: null
            },
            onPress: () => {},
            onRelease: () => {},
            onDrag: () => {},
            onNestedDrag: () => {},
            onNestedOpenChange: () => {},
            onNestedRelease: () => {},
            openProp: void 0,
            dismissible: !1,
            isOpen: !1,
            isDragging: !1,
            keyboardIsOpen: {
                current: !1
            },
            snapPointsOffset: null,
            snapPoints: null,
            handleOnly: !1,
            modal: !1,
            shouldFade: !1,
            activeSnapPoint: null,
            onOpenChange: () => {},
            setActiveSnapPoint: () => {},
            closeDrawer: () => {},
            direction: "bottom",
            shouldAnimate: {
                current: !0
            },
            shouldScaleBackground: !1,
            setBackgroundColorOnScale: !0,
            noBodyStyles: !1,
            container: null,
            autoFocus: !1
        }),
        i = () => {
            let e = n.default.useContext(a);
            if (!e) throw Error("useDrawerContext must be used within a Drawer.Root");
            return e
        };

    function o() {
        return /^((?!chrome|android).)*safari/i.test(navigator.userAgent)
    }

    function s() {
        return l(/^iPhone/) || l(/^iPad/) || l(/^Mac/) && navigator.maxTouchPoints > 1
    }

    function l(e) {
        return "u" > typeof window && null != window.navigator ? e.test(window.navigator.platform) : void 0
    }! function(e) {
        if (!e || "u" < typeof document) return;
        let t = document.head || document.getElementsByTagName("head")[0],
            r = document.createElement("style");
        r.type = "text/css", t.appendChild(r), r.styleSheet ? r.styleSheet.cssText = e : r.appendChild(document.createTextNode(e))
    }("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");
    let c = "u" > typeof window ? n.useLayoutEffect : n.useEffect;

    function u(...e) {
        return (...t) => {
            for (let r of e) "function" == typeof r && r(...t)
        }
    }
    let d = "u" > typeof document && window.visualViewport;

    function f(e) {
        let t = window.getComputedStyle(e);
        return /(auto|scroll)/.test(t.overflow + t.overflowX + t.overflowY)
    }

    function p(e) {
        for (f(e) && (e = e.parentElement); e && !f(e);) e = e.parentElement;
        return e || document.scrollingElement || document.documentElement
    }
    let h = new Set(["checkbox", "radio", "range", "color", "file", "image", "button", "submit", "reset"]),
        m = 0;

    function y(e, t, r, n) {
        return e.addEventListener(t, r, n), () => {
            e.removeEventListener(t, r, n)
        }
    }

    function g(e) {
        let t = document.scrollingElement || document.documentElement;
        for (; e && e !== t;) {
            let t = p(e);
            if (t !== document.documentElement && t !== document.body && t !== e) {
                let r = t.getBoundingClientRect().top,
                    n = e.getBoundingClientRect().top;
                e.getBoundingClientRect().bottom > t.getBoundingClientRect().bottom + 24 && (t.scrollTop += n - r)
            }
            e = t.parentElement
        }
    }

    function b(e) {
        return e instanceof HTMLInputElement && !h.has(e.type) || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable
    }

    function v(...e) {
        return n.useCallback(function(...e) {
            return t => e.forEach(e => {
                "function" == typeof e ? e(t) : null != e && (e.current = t)
            })
        }(...e), e)
    }
    let x = new WeakMap;

    function w(e, t, r = !1) {
        if (!e || !(e instanceof HTMLElement)) return;
        let n = {};
        Object.entries(t).forEach(([t, r]) => {
            t.startsWith("--") ? e.style.setProperty(t, r) : (n[t] = e.style[t], e.style[t] = r)
        }), r || x.set(e, n)
    }
    let _ = e => {
        switch (e) {
            case "top":
            case "bottom":
                return !0;
            case "left":
            case "right":
                return !1;
            default:
                return e
        }
    };

    function C(e, t) {
        if (!e) return null;
        let r = window.getComputedStyle(e),
            n = r.transform || r.webkitTransform || r.mozTransform,
            a = n.match(/^matrix3d\((.+)\)$/);
        return a ? parseFloat(a[1].split(", ")[_(t) ? 13 : 12]) : (a = n.match(/^matrix\((.+)\)$/)) ? parseFloat(a[1].split(", ")[_(t) ? 5 : 4]) : null
    }

    function E(e, t) {
        if (!e) return () => {};
        let r = e.style.cssText;
        return Object.assign(e.style, t), () => {
            e.style.cssText = r
        }
    }
    let S = [.32, .72, 0, 1],
        A = "vaul-dragging";

    function I(e) {
        let t = n.default.useRef(e);
        return n.default.useEffect(() => {
            t.current = e
        }), n.default.useMemo(() => (...e) => null == t.current ? void 0 : t.current.call(t, ...e), [])
    }

    function T({
        prop: e,
        defaultProp: t,
        onChange: r = () => {}
    }) {
        let [a, i] = function({
            defaultProp: e,
            onChange: t
        }) {
            let r = n.default.useState(e),
                [a] = r,
                i = n.default.useRef(a),
                o = I(t);
            return n.default.useEffect(() => {
                i.current !== a && (o(a), i.current = a)
            }, [a, i, o]), r
        }({
            defaultProp: t,
            onChange: r
        }), o = void 0 !== e, s = o ? e : a, l = I(r);
        return [s, n.default.useCallback(t => {
            if (o) {
                let r = "function" == typeof t ? t(e) : t;
                r !== e && l(r)
            } else i(t)
        }, [o, e, i, l])]
    }
    let k = () => () => {},
        O = null;

    function R({
        open: e,
        onOpenChange: i,
        children: l,
        onDrag: f,
        onRelease: h,
        snapPoints: v,
        shouldScaleBackground: E = !1,
        setBackgroundColorOnScale: I = !0,
        closeThreshold: k = .25,
        scrollLockTimeout: N = 100,
        dismissible: M = !0,
        handleOnly: P = !1,
        fadeFromIndex: D = v && v.length - 1,
        activeSnapPoint: j,
        setActiveSnapPoint: L,
        fixed: F,
        modal: U = !0,
        onClose: $,
        nested: z,
        noBodyStyles: B = !1,
        direction: q = "bottom",
        defaultOpen: W = !1,
        disablePreventScroll: Z = !0,
        snapToSequentialPoint: V = !1,
        preventScrollRestoration: K = !1,
        repositionInputs: H = !0,
        onAnimationEnd: G,
        container: Q,
        autoFocus: J = !1
    }) {
        var Y, X;
        let [ee = !1, et] = T({
            defaultProp: W,
            prop: e,
            onChange: e => {
                null == i || i(e), e || z || eN(), setTimeout(() => {
                    null == G || G(e)
                }, 500), e && !U && "u" > typeof window && window.requestAnimationFrame(() => {
                    document.body.style.pointerEvents = "auto"
                }), e || (document.body.style.pointerEvents = "auto")
            }
        }), [er, en] = n.default.useState(!1), [ea, ei] = n.default.useState(!1), [eo, es] = n.default.useState(!1), el = n.default.useRef(null), ec = n.default.useRef(null), eu = n.default.useRef(null), ed = n.default.useRef(null), ef = n.default.useRef(null), ep = n.default.useRef(!1), eh = n.default.useRef(null), em = n.default.useRef(0), ey = n.default.useRef(!1), eg = n.default.useRef(!W), eb = n.default.useRef(0), ev = n.default.useRef(null), ex = n.default.useRef((null == (Y = ev.current) ? void 0 : Y.getBoundingClientRect().height) || 0), ew = n.default.useRef((null == (X = ev.current) ? void 0 : X.getBoundingClientRect().width) || 0), e_ = n.default.useRef(0), eC = n.default.useCallback(e => {
            v && e === eT.length - 1 && (ec.current = new Date)
        }, []), {
            activeSnapPoint: eE,
            activeSnapPointIndex: eS,
            setActiveSnapPoint: eA,
            onRelease: eI,
            snapPointsOffset: eT,
            onDrag: ek,
            shouldFade: eO,
            getPercentageDragged: eR
        } = function({
            activeSnapPointProp: e,
            setActiveSnapPointProp: t,
            snapPoints: r,
            drawerRef: a,
            overlayRef: i,
            fadeFromIndex: o,
            onSnapPointChange: s,
            direction: l = "bottom",
            container: c,
            snapToSequentialPoint: u
        }) {
            let [d, f] = T({
                prop: e,
                defaultProp: null == r ? void 0 : r[0],
                onChange: t
            }), [p, h] = n.default.useState("u" > typeof window ? {
                innerWidth: window.innerWidth,
                innerHeight: window.innerHeight
            } : void 0);
            n.default.useEffect(() => {
                function e() {
                    h({
                        innerWidth: window.innerWidth,
                        innerHeight: window.innerHeight
                    })
                }
                return window.addEventListener("resize", e), () => window.removeEventListener("resize", e)
            }, []);
            let m = n.default.useMemo(() => d === (null == r ? void 0 : r[r.length - 1]) || null, [r, d]),
                y = n.default.useMemo(() => {
                    var e;
                    return null != (e = null == r ? void 0 : r.findIndex(e => e === d)) ? e : null
                }, [r, d]),
                g = r && r.length > 0 && (o || 0 === o) && !Number.isNaN(o) && r[o] === d || !r,
                b = n.default.useMemo(() => {
                    var e;
                    let t = c ? {
                        width: c.getBoundingClientRect().width,
                        height: c.getBoundingClientRect().height
                    } : "u" > typeof window ? {
                        width: window.innerWidth,
                        height: window.innerHeight
                    } : {
                        width: 0,
                        height: 0
                    };
                    return null != (e = null == r ? void 0 : r.map(e => {
                        let r = "string" == typeof e,
                            n = 0;
                        if (r && (n = parseInt(e, 10)), _(l)) {
                            let a = r ? n : p ? e * t.height : 0;
                            return p ? "bottom" === l ? t.height - a : -t.height + a : a
                        }
                        let a = r ? n : p ? e * t.width : 0;
                        return p ? "right" === l ? t.width - a : -t.width + a : a
                    })) ? e : []
                }, [r, p, c]),
                v = n.default.useMemo(() => null !== y ? null == b ? void 0 : b[y] : null, [b, y]),
                x = n.default.useCallback(e => {
                    var t;
                    let n = null != (t = null == b ? void 0 : b.findIndex(t => t === e)) ? t : null;
                    s(n), w(a.current, {
                        transition: `transform 0.5s cubic-bezier(${S.join(",")})`,
                        transform: _(l) ? `translate3d(0, ${e}px, 0)` : `translate3d(${e}px, 0, 0)`
                    }), b && n !== b.length - 1 && void 0 !== o && n !== o && n < o ? w(i.current, {
                        transition: `opacity 0.5s cubic-bezier(${S.join(",")})`,
                        opacity: "0"
                    }) : w(i.current, {
                        transition: `opacity 0.5s cubic-bezier(${S.join(",")})`,
                        opacity: "1"
                    }), f(null == r ? void 0 : r[Math.max(n, 0)])
                }, [a.current, r, b, o, i, f]);
            return n.default.useEffect(() => {
                if (d || e) {
                    var t;
                    let n = null != (t = null == r ? void 0 : r.findIndex(t => t === e || t === d)) ? t : -1;
                    b && -1 !== n && "number" == typeof b[n] && x(b[n])
                }
            }, [d, e, r, b, x]), {
                isLastSnapPoint: m,
                activeSnapPoint: d,
                shouldFade: g,
                getPercentageDragged: function(e, t) {
                    if (!r || "number" != typeof y || !b || void 0 === o) return null;
                    let n = y === o - 1;
                    if (y >= o && t) return 0;
                    if (n && !t) return 1;
                    if (!g && !n) return null;
                    let a = n ? y + 1 : y - 1,
                        i = e / Math.abs(n ? b[a] - b[a - 1] : b[a + 1] - b[a]);
                    return n ? 1 - i : i
                },
                setActiveSnapPoint: f,
                activeSnapPointIndex: y,
                onRelease: function({
                    draggedDistance: e,
                    closeDrawer: t,
                    velocity: n,
                    dismissible: a
                }) {
                    if (void 0 === o) return;
                    let s = "bottom" === l || "right" === l ? (null != v ? v : 0) - e : (null != v ? v : 0) + e,
                        c = y === o - 1,
                        d = 0 === y,
                        f = e > 0;
                    if (c && w(i.current, {
                            transition: `opacity 0.5s cubic-bezier(${S.join(",")})`
                        }), !u && n > 2 && !f) return void(a ? t() : x(b[0]));
                    if (!u && n > 2 && f && b && r) return void x(b[r.length - 1]);
                    let p = null == b ? void 0 : b.reduce((e, t) => "number" != typeof e || "number" != typeof t ? e : Math.abs(t - s) < Math.abs(e - s) ? t : e),
                        h = _(l) ? window.innerHeight : window.innerWidth;
                    if (n > .4 && Math.abs(e) < .4 * h) {
                        let e = f ? 1 : -1;
                        return e > 0 && m && r ? void x(b[r.length - 1]) : void(d && e < 0 && a && t(), null === y || x(b[y + e]))
                    }
                    x(p)
                },
                onDrag: function({
                    draggedDistance: e
                }) {
                    if (null === v) return;
                    let t = "bottom" === l || "right" === l ? v - e : v + e;
                    ("bottom" === l || "right" === l) && t < b[b.length - 1] || ("top" === l || "left" === l) && t > b[b.length - 1] || w(a.current, {
                        transform: _(l) ? `translate3d(0, ${t}px, 0)` : `translate3d(${t}px, 0, 0)`
                    })
                },
                snapPointsOffset: b
            }
        }({
            snapPoints: v,
            activeSnapPointProp: j,
            setActiveSnapPointProp: L,
            drawerRef: ev,
            fadeFromIndex: D,
            overlayRef: el,
            onSnapPointChange: eC,
            direction: q,
            container: Q,
            snapToSequentialPoint: V
        });
        ! function(e = {}) {
            let {
                isDisabled: r
            } = e;
            c(() => {
                if (!r) {
                    var e, n, a;
                    let r, i, o, l, c, f, h;
                    return 1 == ++m && s() && (o = 0, l = window.pageXOffset, c = window.pageYOffset, f = u((e = document.documentElement, n = "paddingRight", a = `${window.innerWidth-document.documentElement.clientWidth}px`, r = e.style[n], e.style[n] = a, () => {
                        e.style[n] = r
                    })), window.scrollTo(0, 0), h = u(y(document, "touchstart", e => {
                        ((i = p(e.target)) !== document.documentElement || i !== document.body) && (o = e.changedTouches[0].pageY)
                    }, {
                        passive: !1,
                        capture: !0
                    }), y(document, "touchmove", e => {
                        if (!i || i === document.documentElement || i === document.body) return void e.preventDefault();
                        let t = e.changedTouches[0].pageY,
                            r = i.scrollTop,
                            n = i.scrollHeight - i.clientHeight;
                        0 !== n && ((r <= 0 && t > o || r >= n && t < o) && e.preventDefault(), o = t)
                    }, {
                        passive: !1,
                        capture: !0
                    }), y(document, "touchend", e => {
                        let t = e.target;
                        b(t) && t !== document.activeElement && (e.preventDefault(), t.style.transform = "translateY(-2000px)", t.focus(), requestAnimationFrame(() => {
                            t.style.transform = ""
                        }))
                    }, {
                        passive: !1,
                        capture: !0
                    }), y(document, "focus", e => {
                        let t = e.target;
                        b(t) && (t.style.transform = "translateY(-2000px)", requestAnimationFrame(() => {
                            t.style.transform = "", d && (d.height < window.innerHeight ? requestAnimationFrame(() => {
                                g(t)
                            }) : d.addEventListener("resize", () => g(t), {
                                once: !0
                            }))
                        }))
                    }, !0), y(window, "scroll", () => {
                        window.scrollTo(0, 0)
                    })), t = () => {
                        f(), h(), window.scrollTo(l, c)
                    }), () => {
                        0 == --m && (null == t || t())
                    }
                }
            }, [r])
        }({
            isDisabled: !ee || ea || !U || eo || !er || !H || !Z
        });
        let {
            restorePositionSetting: eN
        } = function({
            isOpen: e,
            modal: t,
            nested: r,
            hasBeenOpened: a,
            preventScrollRestoration: i,
            noBodyStyles: s
        }) {
            let [l, c] = n.default.useState(() => "u" > typeof window ? window.location.href : ""), u = n.default.useRef(0), d = n.default.useCallback(() => {
                if (o() && null === O && e && !s) {
                    O = {
                        position: document.body.style.position,
                        top: document.body.style.top,
                        left: document.body.style.left,
                        height: document.body.style.height,
                        right: "unset"
                    };
                    let {
                        scrollX: e,
                        innerHeight: t
                    } = window;
                    document.body.style.setProperty("position", "fixed", "important"), Object.assign(document.body.style, {
                        top: `${-u.current}px`,
                        left: `${-e}px`,
                        right: "0px",
                        height: "auto"
                    }), window.setTimeout(() => window.requestAnimationFrame(() => {
                        let e = t - window.innerHeight;
                        e && u.current >= t && (document.body.style.top = `${-(u.current+e)}px`)
                    }), 300)
                }
            }, [e]), f = n.default.useCallback(() => {
                if (o() && null !== O && !s) {
                    let e = -parseInt(document.body.style.top, 10),
                        t = -parseInt(document.body.style.left, 10);
                    Object.assign(document.body.style, O), window.requestAnimationFrame(() => {
                        i && l !== window.location.href ? c(window.location.href) : window.scrollTo(t, e)
                    }), O = null
                }
            }, [l]);
            return n.default.useEffect(() => {
                function e() {
                    u.current = window.scrollY
                }
                return e(), window.addEventListener("scroll", e), () => {
                    window.removeEventListener("scroll", e)
                }
            }, []), n.default.useEffect(() => {
                if (t) return () => {
                    "u" < typeof document || document.querySelector("[data-vaul-drawer]") || f()
                }
            }, [t, f]), n.default.useEffect(() => {
                !r && a && (e ? (window.matchMedia("(display-mode: standalone)").matches || d(), t || window.setTimeout(() => {
                    f()
                }, 500)) : f())
            }, [e, a, l, t, r, d, f]), {
                restorePositionSetting: f
            }
        }({
            isOpen: ee,
            modal: U,
            nested: null != z && z,
            hasBeenOpened: er,
            preventScrollRestoration: K,
            noBodyStyles: B
        });

        function eM() {
            return (window.innerWidth - 26) / window.innerWidth
        }

        function eP(e, t) {
            var r;
            let n = e,
                a = null == (r = window.getSelection()) ? void 0 : r.toString(),
                i = ev.current ? C(ev.current, q) : null,
                o = new Date;
            if ("SELECT" === n.tagName || n.hasAttribute("data-vaul-no-drag") || n.closest("[data-vaul-no-drag]")) return !1;
            if ("right" === q || "left" === q) return !0;
            if (ec.current && o.getTime() - ec.current.getTime() < 500) return !1;
            if (null !== i && ("bottom" === q ? i > 0 : i < 0)) return !0;
            if (a && a.length > 0) return !1;
            if (ef.current && o.getTime() - ef.current.getTime() < N && 0 === i || t) return ef.current = o, !1;
            for (; n;) {
                if (n.scrollHeight > n.clientHeight) {
                    if (0 !== n.scrollTop) return ef.current = new Date, !1;
                    if ("dialog" === n.getAttribute("role")) break
                }
                n = n.parentNode
            }
            return !0
        }

        function eD(e) {
            ea && ev.current && (ev.current.classList.remove(A), ep.current = !1, ei(!1), ed.current = new Date), null == $ || $(), e || et(!1), setTimeout(() => {
                v && eA(v[0])
            }, 500)
        }

        function ej() {
            if (!ev.current) return;
            let e = document.querySelector("[data-vaul-drawer-wrapper]"),
                t = C(ev.current, q);
            w(ev.current, {
                transform: "translate3d(0, 0, 0)",
                transition: `transform 0.5s cubic-bezier(${S.join(",")})`
            }), w(el.current, {
                transition: `opacity 0.5s cubic-bezier(${S.join(",")})`,
                opacity: "1"
            }), E && t && t > 0 && ee && w(e, {
                borderRadius: "8px",
                overflow: "hidden",
                ..._(q) ? {
                    transform: `scale(${eM()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,
                    transformOrigin: "top"
                } : {
                    transform: `scale(${eM()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,
                    transformOrigin: "left"
                },
                transitionProperty: "transform, border-radius",
                transitionDuration: "0.5s",
                transitionTimingFunction: `cubic-bezier(${S.join(",")})`
            }, !0)
        }
        return n.default.useEffect(() => {
            window.requestAnimationFrame(() => {
                eg.current = !0
            })
        }, []), n.default.useEffect(() => {
            var e;

            function t() {
                if (ev.current && H && (b(document.activeElement) || ey.current)) {
                    var e;
                    let t = (null == (e = window.visualViewport) ? void 0 : e.height) || 0,
                        r = window.innerHeight,
                        n = r - t,
                        a = ev.current.getBoundingClientRect().height || 0;
                    e_.current || (e_.current = a);
                    let i = ev.current.getBoundingClientRect().top;
                    if (Math.abs(eb.current - n) > 60 && (ey.current = !ey.current), v && v.length > 0 && eT && eS && (n += eT[eS] || 0), eb.current = n, a > t || ey.current) {
                        let e = ev.current.getBoundingClientRect().height,
                            o = e;
                        e > t && (o = t - (a > .8 * r ? i : 26)), F ? ev.current.style.height = `${e-Math.max(n,0)}px` : ev.current.style.height = `${Math.max(o,t-i)}px`
                    } else {
                        let e;
                        e = navigator.userAgent, "u" > typeof window && (/Firefox/.test(e) && /Mobile/.test(e) || /FxiOS/.test(e)) || (ev.current.style.height = `${e_.current}px`)
                    }
                    v && v.length > 0 && !ey.current ? ev.current.style.bottom = "0px" : ev.current.style.bottom = `${Math.max(n,0)}px`
                }
            }
            return null == (e = window.visualViewport) || e.addEventListener("resize", t), () => {
                var e;
                return null == (e = window.visualViewport) ? void 0 : e.removeEventListener("resize", t)
            }
        }, [eS, v, eT]), n.default.useEffect(() => (ee && (w(document.documentElement, {
            scrollBehavior: "auto"
        }), ec.current = new Date), () => {
            ! function(e, t) {
                if (!e || !(e instanceof HTMLElement)) return;
                let r = x.get(e);
                r && (e.style[t] = r[t])
            }(document.documentElement, "scrollBehavior")
        }), [ee]), n.default.useEffect(() => {
            U || window.requestAnimationFrame(() => {
                document.body.style.pointerEvents = "auto"
            })
        }, [U]), n.default.createElement(r.Root, {
            defaultOpen: W,
            onOpenChange: e => {
                (M || e) && (e ? en(!0) : eD(!0), et(e))
            },
            open: ee
        }, n.default.createElement(a.Provider, {
            value: {
                activeSnapPoint: eE,
                snapPoints: v,
                setActiveSnapPoint: eA,
                drawerRef: ev,
                overlayRef: el,
                onOpenChange: i,
                onPress: function(e) {
                    var t, r;
                    !M && !v || (!ev.current || ev.current.contains(e.target)) && (ex.current = (null == (t = ev.current) ? void 0 : t.getBoundingClientRect().height) || 0, ew.current = (null == (r = ev.current) ? void 0 : r.getBoundingClientRect().width) || 0, ei(!0), eu.current = new Date, s() && window.addEventListener("touchend", () => ep.current = !1, {
                        once: !0
                    }), e.target.setPointerCapture(e.pointerId), em.current = _(q) ? e.pageY : e.pageX)
                },
                onRelease: function(e) {
                    var t, r;
                    if (!ea || !ev.current) return;
                    ev.current.classList.remove(A), ep.current = !1, ei(!1), ed.current = new Date;
                    let n = C(ev.current, q);
                    if (!e || !eP(e.target, !1) || !n || Number.isNaN(n) || null === eu.current) return;
                    let a = ed.current.getTime() - eu.current.getTime(),
                        i = em.current - (_(q) ? e.pageY : e.pageX),
                        o = Math.abs(i) / a;
                    if (o > .05 && (es(!0), setTimeout(() => {
                            es(!1)
                        }, 200)), v) {
                        eI({
                            draggedDistance: i * ("bottom" === q || "right" === q ? 1 : -1),
                            closeDrawer: eD,
                            velocity: o,
                            dismissible: M
                        }), null == h || h(e, !0);
                        return
                    }
                    if ("bottom" === q || "right" === q ? i > 0 : i < 0) {
                        ej(), null == h || h(e, !0);
                        return
                    }
                    if (o > .4) {
                        eD(), null == h || h(e, !1);
                        return
                    }
                    let s = Math.min(null != (t = ev.current.getBoundingClientRect().height) ? t : 0, window.innerHeight),
                        l = Math.min(null != (r = ev.current.getBoundingClientRect().width) ? r : 0, window.innerWidth);
                    if (Math.abs(n) >= ("left" === q || "right" === q ? l : s) * k) {
                        eD(), null == h || h(e, !1);
                        return
                    }
                    null == h || h(e, !0), ej()
                },
                onDrag: function(e) {
                    if (ev.current && ea) {
                        let t = "bottom" === q || "right" === q ? 1 : -1,
                            r = (em.current - (_(q) ? e.pageY : e.pageX)) * t,
                            n = r > 0,
                            a = v && !M && !n;
                        if (a && 0 === eS) return;
                        let i = Math.abs(r),
                            o = document.querySelector("[data-vaul-drawer-wrapper]"),
                            s = i / ("bottom" === q || "top" === q ? ex.current : ew.current),
                            l = eR(i, n);
                        if (null !== l && (s = l), a && s >= 1 || !ep.current && !eP(e.target, n)) return;
                        if (ev.current.classList.add(A), ep.current = !0, w(ev.current, {
                                transition: "none"
                            }), w(el.current, {
                                transition: "none"
                            }), v && ek({
                                draggedDistance: r
                            }), n && !v) {
                            let e = Math.min(-(8 * (Math.log(r + 1) - 2) * 1), 0) * t;
                            w(ev.current, {
                                transform: _(q) ? `translate3d(0, ${e}px, 0)` : `translate3d(${e}px, 0, 0)`
                            });
                            return
                        }
                        let c = 1 - s;
                        if ((eO || D && eS === D - 1) && (null == f || f(e, s), w(el.current, {
                                opacity: `${c}`,
                                transition: "none"
                            }, !0)), o && el.current && E) {
                            let e = Math.min(eM() + s * (1 - eM()), 1),
                                t = 8 - 8 * s,
                                r = Math.max(0, 14 - 14 * s);
                            w(o, {
                                borderRadius: `${t}px`,
                                transform: _(q) ? `scale(${e}) translate3d(0, ${r}px, 0)` : `scale(${e}) translate3d(${r}px, 0, 0)`,
                                transition: "none"
                            }, !0)
                        }
                        if (!v) {
                            let e = i * t;
                            w(ev.current, {
                                transform: _(q) ? `translate3d(0, ${e}px, 0)` : `translate3d(${e}px, 0, 0)`
                            })
                        }
                    }
                },
                dismissible: M,
                shouldAnimate: eg,
                handleOnly: P,
                isOpen: ee,
                isDragging: ea,
                shouldFade: eO,
                closeDrawer: eD,
                onNestedDrag: function(e, t) {
                    if (t < 0) return;
                    let r = (window.innerWidth - 16) / window.innerWidth,
                        n = r + t * (1 - r),
                        a = -16 + 16 * t;
                    w(ev.current, {
                        transform: _(q) ? `scale(${n}) translate3d(0, ${a}px, 0)` : `scale(${n}) translate3d(${a}px, 0, 0)`,
                        transition: "none"
                    })
                },
                onNestedOpenChange: function(e) {
                    let t = e ? (window.innerWidth - 16) / window.innerWidth : 1,
                        r = e ? -16 : 0;
                    eh.current && window.clearTimeout(eh.current), w(ev.current, {
                        transition: `transform 0.5s cubic-bezier(${S.join(",")})`,
                        transform: _(q) ? `scale(${t}) translate3d(0, ${r}px, 0)` : `scale(${t}) translate3d(${r}px, 0, 0)`
                    }), !e && ev.current && (eh.current = setTimeout(() => {
                        let e = C(ev.current, q);
                        w(ev.current, {
                            transition: "none",
                            transform: _(q) ? `translate3d(0, ${e}px, 0)` : `translate3d(${e}px, 0, 0)`
                        })
                    }, 500))
                },
                onNestedRelease: function(e, t) {
                    let r = _(q) ? window.innerHeight : window.innerWidth,
                        n = t ? (r - 16) / r : 1,
                        a = t ? -16 : 0;
                    t && w(ev.current, {
                        transition: `transform 0.5s cubic-bezier(${S.join(",")})`,
                        transform: _(q) ? `scale(${n}) translate3d(0, ${a}px, 0)` : `scale(${n}) translate3d(${a}px, 0, 0)`
                    })
                },
                keyboardIsOpen: ey,
                modal: U,
                snapPointsOffset: eT,
                activeSnapPointIndex: eS,
                direction: q,
                shouldScaleBackground: E,
                setBackgroundColorOnScale: I,
                noBodyStyles: B,
                container: Q,
                autoFocus: J
            }
        }, l))
    }
    let N = n.default.forwardRef(function({ ...e
    }, t) {
        let {
            overlayRef: a,
            snapPoints: o,
            onRelease: s,
            shouldFade: l,
            isOpen: c,
            modal: u,
            shouldAnimate: d
        } = i(), f = v(t, a), p = o && o.length > 0;
        if (!u) return null;
        let h = n.default.useCallback(e => s(e), [s]);
        return n.default.createElement(r.Overlay, {
            onMouseUp: h,
            ref: f,
            "data-vaul-overlay": "",
            "data-vaul-snap-points": c && p ? "true" : "false",
            "data-vaul-snap-points-overlay": c && l ? "true" : "false",
            "data-vaul-animate": (null == d ? void 0 : d.current) ? "true" : "false",
            ...e
        })
    });
    N.displayName = "Drawer.Overlay";
    let M = n.default.forwardRef(function({
        onPointerDownOutside: e,
        style: t,
        onOpenAutoFocus: a,
        ...o
    }, s) {
        let {
            drawerRef: l,
            onPress: c,
            onRelease: u,
            onDrag: d,
            keyboardIsOpen: f,
            snapPointsOffset: p,
            activeSnapPointIndex: h,
            modal: m,
            isOpen: y,
            direction: g,
            snapPoints: b,
            container: x,
            handleOnly: w,
            shouldAnimate: C,
            autoFocus: A
        } = i(), [I, T] = n.default.useState(!1), O = v(s, l), R = n.default.useRef(null), N = n.default.useRef(null), M = n.default.useRef(!1), P = b && b.length > 0;

        function D(e) {
            R.current = null, M.current = !1, u(e)
        }
        return ! function() {
            let {
                direction: e,
                isOpen: t,
                shouldScaleBackground: r,
                setBackgroundColorOnScale: a,
                noBodyStyles: o
            } = i(), s = n.default.useRef(null), l = (0, n.useMemo)(() => document.body.style.backgroundColor, []);

            function c() {
                return (window.innerWidth - 26) / window.innerWidth
            }
            n.default.useEffect(() => {
                if (t && r) {
                    s.current && clearTimeout(s.current);
                    let t = document.querySelector("[data-vaul-drawer-wrapper]") || document.querySelector("[vaul-drawer-wrapper]");
                    if (!t) return;
                    ! function(...e) {}(a && !o ? E(document.body, {
                        background: "black"
                    }) : k, E(t, {
                        transformOrigin: _(e) ? "top" : "left",
                        transitionProperty: "transform, border-radius",
                        transitionDuration: "0.5s",
                        transitionTimingFunction: `cubic-bezier(${S.join(",")})`
                    }));
                    let r = E(t, {
                        borderRadius: "8px",
                        overflow: "hidden",
                        ..._(e) ? {
                            transform: `scale(${c()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`
                        } : {
                            transform: `scale(${c()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`
                        }
                    });
                    return () => {
                        r(), s.current = window.setTimeout(() => {
                            l ? document.body.style.background = l : document.body.style.removeProperty("background")
                        }, 500)
                    }
                }
            }, [t, r, l])
        }(), n.default.useEffect(() => {
            P && window.requestAnimationFrame(() => {
                T(!0)
            })
        }, []), n.default.createElement(r.Content, {
            "data-vaul-drawer-direction": g,
            "data-vaul-drawer": "",
            "data-vaul-delayed-snap-points": I ? "true" : "false",
            "data-vaul-snap-points": y && P ? "true" : "false",
            "data-vaul-custom-container": x ? "true" : "false",
            "data-vaul-animate": (null == C ? void 0 : C.current) ? "true" : "false",
            ...o,
            ref: O,
            style: p && p.length > 0 ? {
                "--snap-point-height": `${p[null!=h?h:0]}px`,
                ...t
            } : t,
            onPointerDown: e => {
                w || (null == o.onPointerDown || o.onPointerDown.call(o, e), R.current = {
                    x: e.pageX,
                    y: e.pageY
                }, c(e))
            },
            onOpenAutoFocus: e => {
                null == a || a(e), A || e.preventDefault()
            },
            onPointerDownOutside: t => {
                (null == e || e(t), !m || t.defaultPrevented) ? t.preventDefault(): f.current && (f.current = !1)
            },
            onFocusOutside: e => {
                if (!m) return void e.preventDefault()
            },
            onPointerMove: e => {
                if (N.current = e, w || (null == o.onPointerMove || o.onPointerMove.call(o, e), !R.current)) return;
                let t = e.pageY - R.current.y,
                    r = e.pageX - R.current.x,
                    n = "touch" === e.pointerType ? 10 : 2;
                ((e, t, r = 0) => {
                    if (M.current) return !0;
                    let n = Math.abs(e.y),
                        a = Math.abs(e.x),
                        i = a > n,
                        o = ["bottom", "right"].includes(t) ? 1 : -1;
                    if ("left" === t || "right" === t) {
                        if (!(e.x * o < 0) && a >= 0 && a <= r) return i
                    } else if (!(e.y * o < 0) && n >= 0 && n <= r) return !i;
                    return M.current = !0, !0
                })({
                    x: r,
                    y: t
                }, g, n) ? d(e): (Math.abs(r) > n || Math.abs(t) > n) && (R.current = null)
            },
            onPointerUp: e => {
                null == o.onPointerUp || o.onPointerUp.call(o, e), R.current = null, M.current = !1, u(e)
            },
            onPointerOut: e => {
                null == o.onPointerOut || o.onPointerOut.call(o, e), D(N.current)
            },
            onContextMenu: e => {
                null == o.onContextMenu || o.onContextMenu.call(o, e), N.current && D(N.current)
            }
        })
    });
    M.displayName = "Drawer.Content";
    let P = n.default.forwardRef(function({
        preventCycle: e = !1,
        children: t,
        ...r
    }, a) {
        let {
            closeDrawer: o,
            isDragging: s,
            snapPoints: l,
            activeSnapPoint: c,
            setActiveSnapPoint: u,
            dismissible: d,
            handleOnly: f,
            isOpen: p,
            onPress: h,
            onDrag: m
        } = i(), y = n.default.useRef(null), g = n.default.useRef(!1);

        function b() {
            y.current && window.clearTimeout(y.current), g.current = !1
        }
        return n.default.createElement("div", {
            onClick: function() {
                g.current ? b() : window.setTimeout(() => {
                    ! function() {
                        if (s || e || g.current) return b();
                        if (b(), !l || 0 === l.length) {
                            d || o();
                            return
                        }
                        if (c === l[l.length - 1] && d) return o();
                        let t = l.findIndex(e => e === c); - 1 === t || u(l[t + 1])
                    }()
                }, 120)
            },
            onPointerCancel: b,
            onPointerDown: e => {
                f && h(e), y.current = window.setTimeout(() => {
                    g.current = !0
                }, 250)
            },
            onPointerMove: e => {
                f && m(e)
            },
            ref: a,
            "data-vaul-drawer-visible": p ? "true" : "false",
            "data-vaul-handle": "",
            "aria-hidden": "true",
            ...r
        }, n.default.createElement("span", {
            "data-vaul-handle-hitarea": "",
            "aria-hidden": "true"
        }, t))
    });
    P.displayName = "Drawer.Handle";
    let D = {
        Root: R,
        NestedRoot: function({
            onDrag: e,
            onOpenChange: t,
            open: r,
            ...a
        }) {
            let {
                onNestedDrag: o,
                onNestedOpenChange: s,
                onNestedRelease: l
            } = i();
            if (!o) throw Error("Drawer.NestedRoot must be placed in another drawer");
            return n.default.createElement(R, {
                nested: !0,
                open: r,
                onClose: () => {
                    s(!1)
                },
                onDrag: (t, r) => {
                    o(t, r), null == e || e(t, r)
                },
                onOpenChange: e => {
                    e && s(e), null == t || t(e)
                },
                onRelease: l,
                ...a
            })
        },
        Content: M,
        Overlay: N,
        Trigger: r.Trigger,
        Portal: function(e) {
            let t = i(),
                {
                    container: a = t.container,
                    ...o
                } = e;
            return n.default.createElement(r.Portal, {
                container: a,
                ...o
            })
        },
        Handle: P,
        Close: r.Close,
        Title: r.Title,
        Description: r.Description
    };
    e.s(["Drawer", 0, D])
}, 697972, e => {
    "use strict";
    var t = e.i(416340);
    e.s(["useMediaQuery", 0, function(e) {
        let r = t.useCallback(t => {
                let r = window.matchMedia(e);
                return r.addEventListener("change", t), () => r.removeEventListener("change", t)
            }, [e]),
            n = t.useCallback(() => window.matchMedia(e).matches, [e]),
            a = t.useCallback(() => !1, []);
        return t.useSyncExternalStore(r, n, a)
    }])
}, 827525, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        n = e.i(317681),
        a = e.i(86831);

    function i(e) {
        let a, i, o, s = (0, r.c)(6);
        s[0] !== e ? ({
            repositionInputs: i,
            ...a
        } = e, s[0] = e, s[1] = a, s[2] = i) : (a = s[1], i = s[2]);
        let l = void 0 !== i && i;
        return s[3] !== a || s[4] !== l ? (o = (0, t.jsx)(n.Drawer.Root, {
            "data-slot": "drawer",
            repositionInputs: l,
            ...a
        }), s[3] = a, s[4] = l, s[5] = o) : o = s[5], o
    }

    function o(e) {
        let a, i, o = (0, r.c)(4);
        return o[0] !== e ? ({ ...a
        } = e, o[0] = e, o[1] = a) : a = o[1], o[2] !== a ? (i = (0, t.jsx)(n.Drawer.Portal, {
            "data-slot": "drawer-portal",
            ...a
        }), o[2] = a, o[3] = i) : i = o[3], i
    }

    function s(e) {
        let i, o, s, l, c = (0, r.c)(8);
        return c[0] !== e ? ({
            className: i,
            ...o
        } = e, c[0] = e, c[1] = i, c[2] = o) : (i = c[1], o = c[2]), c[3] !== i ? (s = (0, a.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/40", i), c[3] = i, c[4] = s) : s = c[4], c[5] !== o || c[6] !== s ? (l = (0, t.jsx)(n.Drawer.Overlay, {
            "data-slot": "drawer-overlay",
            className: s,
            ...o
        }), c[5] = o, c[6] = s, c[7] = l) : l = c[7], l
    }

    function l(e) {
        let i, o, s, l, c, u = (0, r.c)(10);
        return u[0] !== e ? ({
            className: o,
            children: i,
            ...s
        } = e, u[0] = e, u[1] = i, u[2] = o, u[3] = s) : (i = u[1], o = u[2], s = u[3]), u[4] !== o ? (l = (0, a.cn)("group/drawer-content bg-background flex h-auto flex-col outline-none focus:outline-none", o), u[4] = o, u[5] = l) : l = u[5], u[6] !== i || u[7] !== s || u[8] !== l ? (c = (0, t.jsx)(n.Drawer.Content, {
            "data-slot": "drawer-content",
            className: l,
            ...s,
            children: i
        }), u[6] = i, u[7] = s, u[8] = l, u[9] = c) : c = u[9], c
    }

    function c(e) {
        let i, o, s, l, c = (0, r.c)(8);
        return c[0] !== e ? ({
            className: i,
            ...o
        } = e, c[0] = e, c[1] = i, c[2] = o) : (i = c[1], o = c[2]), c[3] !== i ? (s = (0, a.cn)("absolute! top-2 left-1/2 -translate-x-1/2 w-[60px]! h-[5px]! rounded-full bg-muted!", i), c[3] = i, c[4] = s) : s = c[4], c[5] !== o || c[6] !== s ? (l = (0, t.jsx)(n.Drawer.Handle, {
            "data-slot": "drawer-handle",
            className: s,
            ...o
        }), c[5] = o, c[6] = s, c[7] = l) : l = c[7], l
    }
    let u = Object.assign(i, {
        Root: i,
        NestedRoot: function(e) {
            let a, i, o = (0, r.c)(4);
            return o[0] !== e ? ({ ...a
            } = e, o[0] = e, o[1] = a) : a = o[1], o[2] !== a ? (i = (0, t.jsx)(n.Drawer.NestedRoot, {
                "data-slot": "drawer-nested-root",
                ...a
            }), o[2] = a, o[3] = i) : i = o[3], i
        },
        Portal: o,
        Overlay: s,
        Trigger: function(e) {
            let a, i, o = (0, r.c)(4);
            return o[0] !== e ? ({ ...a
            } = e, o[0] = e, o[1] = a) : a = o[1], o[2] !== a ? (i = (0, t.jsx)(n.Drawer.Trigger, {
                "data-slot": "drawer-trigger",
                ...a
            }), o[2] = a, o[3] = i) : i = o[3], i
        },
        Close: function(e) {
            let a, i, o = (0, r.c)(4);
            return o[0] !== e ? ({ ...a
            } = e, o[0] = e, o[1] = a) : a = o[1], o[2] !== a ? (i = (0, t.jsx)(n.Drawer.Close, {
                "data-slot": "drawer-close",
                ...a
            }), o[2] = a, o[3] = i) : i = o[3], i
        },
        Content: l,
        Header: function(e) {
            let n, i, o, s, l = (0, r.c)(8);
            return l[0] !== e ? ({
                className: n,
                ...i
            } = e, l[0] = e, l[1] = n, l[2] = i) : (n = l[1], i = l[2]), l[3] !== n ? (o = (0, a.cn)("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left", n), l[3] = n, l[4] = o) : o = l[4], l[5] !== i || l[6] !== o ? (s = (0, t.jsx)("div", {
                "data-slot": "drawer-header",
                className: o,
                ...i
            }), l[5] = i, l[6] = o, l[7] = s) : s = l[7], s
        },
        Footer: function(e) {
            let n, i, o, s, l = (0, r.c)(8);
            return l[0] !== e ? ({
                className: n,
                ...i
            } = e, l[0] = e, l[1] = n, l[2] = i) : (n = l[1], i = l[2]), l[3] !== n ? (o = (0, a.cn)("mt-auto flex flex-col gap-2 p-4", n), l[3] = n, l[4] = o) : o = l[4], l[5] !== i || l[6] !== o ? (s = (0, t.jsx)("div", {
                "data-slot": "drawer-footer",
                className: o,
                ...i
            }), l[5] = i, l[6] = o, l[7] = s) : s = l[7], s
        },
        Title: function(e) {
            let i, o, s, l, c = (0, r.c)(8);
            return c[0] !== e ? ({
                className: i,
                ...o
            } = e, c[0] = e, c[1] = i, c[2] = o) : (i = c[1], o = c[2]), c[3] !== i ? (s = (0, a.cn)("text-foreground font-semibold", i), c[3] = i, c[4] = s) : s = c[4], c[5] !== o || c[6] !== s ? (l = (0, t.jsx)(n.Drawer.Title, {
                "data-slot": "drawer-title",
                className: s,
                ...o
            }), c[5] = o, c[6] = s, c[7] = l) : l = c[7], l
        },
        Description: function(e) {
            let i, o, s, l, c = (0, r.c)(8);
            return c[0] !== e ? ({
                className: i,
                ...o
            } = e, c[0] = e, c[1] = i, c[2] = o) : (i = c[1], o = c[2]), c[3] !== i ? (s = (0, a.cn)("text-muted-foreground text-sm", i), c[3] = i, c[4] = s) : s = c[4], c[5] !== o || c[6] !== s ? (l = (0, t.jsx)(n.Drawer.Description, {
                "data-slot": "drawer-description",
                className: s,
                ...o
            }), c[5] = o, c[6] = s, c[7] = l) : l = c[7], l
        },
        Handle: c,
        Notch: function(e) {
            let n, i, o, s, l = (0, r.c)(8);
            return l[0] !== e ? ({
                className: n,
                ...i
            } = e, l[0] = e, l[1] = n, l[2] = i) : (n = l[1], i = l[2]), l[3] !== n ? (o = (0, a.cn)("mx-auto mb-3 h-1.5 w-12 shrink-0 rounded-full bg-gray-200", n), l[3] = n, l[4] = o) : o = l[4], l[5] !== i || l[6] !== o ? (s = (0, t.jsx)("div", {
                "data-slot": "drawer-notch",
                className: o,
                ...i
            }), l[5] = i, l[6] = o, l[7] = s) : s = l[7], s
        }
    });
    e.s(["Drawer", 0, u, "DrawerContent", 0, l, "DrawerContentWithOverlay", 0, function(e) {
        let i, l, u, d, f, p, h, m, y, g, b = (0, r.c)(20);
        b[0] !== e ? ({
            className: l,
            overlayClassName: u,
            children: i,
            hasNotch: f,
            ...d
        } = e, b[0] = e, b[1] = i, b[2] = l, b[3] = u, b[4] = d, b[5] = f) : (i = b[1], l = b[2], u = b[3], d = b[4], f = b[5]);
        let v = void 0 === f || f;
        return b[6] !== u ? (p = (0, t.jsx)(s, {
            className: u
        }), b[6] = u, b[7] = p) : p = b[7], b[8] !== l ? (h = (0, a.cn)("group/drawer-content bg-background fixed z-50 flex h-auto flex-col outline-none", "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[85dvh] data-[vaul-drawer-direction=top]:rounded-b-3xl data-[vaul-drawer-direction=top]:border-b", "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[85dvh] data-[vaul-drawer-direction=bottom]:rounded-t-3xl data-[vaul-drawer-direction=bottom]:border-t", "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm", l), b[8] = l, b[9] = h) : h = b[9], b[10] !== v ? (m = v && (0, t.jsx)(c, {}), b[10] = v, b[11] = m) : m = b[11], b[12] !== i || b[13] !== d || b[14] !== h || b[15] !== m ? (y = (0, t.jsxs)(n.Drawer.Content, {
            "data-slot": "drawer-content",
            className: h,
            ...d,
            children: [m, i]
        }), b[12] = i, b[13] = d, b[14] = h, b[15] = m, b[16] = y) : y = b[16], b[17] !== p || b[18] !== y ? (g = (0, t.jsxs)(o, {
            "data-slot": "drawer-portal",
            children: [p, y]
        }), b[17] = p, b[18] = y, b[19] = g) : g = b[19], g
    }, "DrawerHandle", 0, c, "DrawerOverlay", 0, s, "DrawerPortal", 0, o])
}, 525962, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        n = e.i(377960),
        a = e.i(606479),
        i = e.i(416340),
        o = e.i(317681),
        s = e.i(697972),
        l = e.i(86831),
        c = e.i(827525);
    let u = i.createContext(null);

    function d() {
        return i.useContext(u)
    }

    function f() {
        let e = d();
        if (!e) throw Error("Modal components must be used within <Modal>");
        return e
    }

    function p() {
        document.body.style.pointerEvents = ""
    }
    let h = {
        sm: "max-w-sm",
        default: "max-w-md"
    };
    e.s(["Modal", 0, function(e) {
        let n, l, c, d, f, h = (0, r.c)(20),
            {
                open: m,
                onOpenChange: y,
                size: g,
                children: b
            } = e,
            v = void 0 === g ? "default" : g,
            x = (0, s.useMediaQuery)("(min-width: 640px)");
        h[0] !== x || h[1] !== v ? (n = {
            isDesktop: x,
            size: v
        }, h[0] = x, h[1] = v, h[2] = n) : n = h[2];
        let w = n;
        if (h[3] !== m ? (l = () => {
                if (!1 !== m) return;
                let e = setTimeout(p, 500);
                return () => clearTimeout(e)
            }, c = [m], h[3] = m, h[4] = l, h[5] = c) : (l = h[4], c = h[5]), i.useEffect(l, c), x) {
            let e, r;
            return h[6] !== b || h[7] !== y || h[8] !== m ? (e = (0, t.jsx)(a.Dialog.Root, {
                open: m,
                onOpenChange: y,
                children: b
            }), h[6] = b, h[7] = y, h[8] = m, h[9] = e) : e = h[9], h[10] !== e || h[11] !== w ? (r = (0, t.jsx)(u.Provider, {
                value: w,
                children: e
            }), h[10] = e, h[11] = w, h[12] = r) : r = h[12], r
        }
        return h[13] !== b || h[14] !== y || h[15] !== m ? (d = (0, t.jsx)(o.Drawer.Root, {
            open: m,
            onOpenChange: y,
            repositionInputs: !1,
            children: b
        }), h[13] = b, h[14] = y, h[15] = m, h[16] = d) : d = h[16], h[17] !== d || h[18] !== w ? (f = (0, t.jsx)(u.Provider, {
            value: w,
            children: d
        }), h[17] = d, h[18] = w, h[19] = f) : f = h[19], f
    }, "ModalClose", 0, function(e) {
        let n, i, s = (0, r.c)(8);
        s[0] !== e ? ({ ...n
        } = e, s[0] = e, s[1] = n) : n = s[1];
        let l = d();
        if (l ? .isDesktop) {
            let e;
            return s[2] !== n ? (e = (0, t.jsx)(a.Dialog.Close, {
                "data-slot": "modal-close",
                ...n
            }), s[2] = n, s[3] = e) : e = s[3], e
        }
        if (l) {
            let e;
            return s[4] !== n ? (e = (0, t.jsx)(o.Drawer.Close, {
                "data-slot": "modal-close",
                ...n
            }), s[4] = n, s[5] = e) : e = s[5], e
        }
        return s[6] !== n ? (i = (0, t.jsx)("button", {
            type: "button",
            "data-slot": "modal-close",
            ...n
        }), s[6] = n, s[7] = i) : i = s[7], i
    }, "ModalContent", 0, function(e) {
        let n, i, o, s, u, d, p, m, y, g, b = (0, r.c)(34);
        b[0] !== e ? ({
            className: i,
            contentClassName: o,
            overlayClassName: s,
            children: n,
            ...u
        } = e, b[0] = e, b[1] = n, b[2] = i, b[3] = o, b[4] = s, b[5] = u) : (n = b[1], i = b[2], o = b[3], s = b[4], u = b[5]);
        let {
            isDesktop: v,
            size: x
        } = f();
        if (v) {
            let e, r, o, c, d;
            b[6] !== s ? (e = (0, l.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[250] bg-black/40", s), b[6] = s, b[7] = e) : e = b[7], b[8] !== e ? (r = (0, t.jsx)(a.Dialog.Overlay, {
                "data-slot": "modal-overlay",
                className: e
            }), b[8] = e, b[9] = r) : r = b[9];
            let f = h[x];
            return b[10] !== i || b[11] !== f ? (o = (0, l.cn)("bg-background fixed top-1/2 left-1/2 z-[250] grid w-full min-w-0 -translate-x-1/2 -translate-y-1/2 gap-4 rounded-3xl border p-6 shadow-lg overflow-hidden outline-none", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 duration-200", f, i), b[10] = i, b[11] = f, b[12] = o) : o = b[12], b[13] !== n || b[14] !== u || b[15] !== o ? (c = (0, t.jsx)(a.Dialog.Content, {
                "data-slot": "modal-content",
                className: o,
                ...u,
                children: n
            }), b[13] = n, b[14] = u, b[15] = o, b[16] = c) : c = b[16], b[17] !== r || b[18] !== c ? (d = (0, t.jsxs)(a.Dialog.Portal, {
                children: [r, c]
            }), b[17] = r, b[18] = c, b[19] = d) : d = b[19], d
        }
        return b[20] !== i ? (d = (0, l.cn)("z-[250]", i), b[20] = i, b[21] = d) : d = b[21], b[22] !== s ? (p = (0, l.cn)("z-[250]", s), b[22] = s, b[23] = p) : p = b[23], b[24] !== o ? (m = (0, l.cn)("flex flex-col gap-4 overflow-y-auto p-6", o), b[24] = o, b[25] = m) : m = b[25], b[26] !== n || b[27] !== m ? (y = (0, t.jsx)("div", {
            className: m,
            children: n
        }), b[26] = n, b[27] = m, b[28] = y) : y = b[28], b[29] !== u || b[30] !== d || b[31] !== p || b[32] !== y ? (g = (0, t.jsx)(c.DrawerContentWithOverlay, {
            className: d,
            overlayClassName: p,
            ...u,
            children: y
        }), b[29] = u, b[30] = d, b[31] = p, b[32] = y, b[33] = g) : g = b[33], g
    }, "ModalDescription", 0, function(e) {
        let n, i, s, c, u = (0, r.c)(14);
        u[0] !== e ? ({
            className: n,
            ...i
        } = e, u[0] = e, u[1] = n, u[2] = i) : (n = u[1], i = u[2]);
        let f = d();
        u[3] !== n ? (s = (0, l.cn)("-mt-1 text-sm text-text-secondary font-medium [&_a]:text-text-brand [&_a]:hover:underline", n), u[3] = n, u[4] = s) : s = u[4];
        let p = s;
        if (f ? .isDesktop) {
            let e;
            return u[5] !== p || u[6] !== i ? (e = (0, t.jsx)(a.Dialog.Description, {
                "data-slot": "modal-description",
                className: p,
                ...i
            }), u[5] = p, u[6] = i, u[7] = e) : e = u[7], e
        }
        if (f) {
            let e;
            return u[8] !== p || u[9] !== i ? (e = (0, t.jsx)(o.Drawer.Description, {
                "data-slot": "modal-description",
                className: p,
                ...i
            }), u[8] = p, u[9] = i, u[10] = e) : e = u[10], e
        }
        return u[11] !== p || u[12] !== i ? (c = (0, t.jsx)("p", {
            "data-slot": "modal-description",
            className: p,
            ...i
        }), u[11] = p, u[12] = i, u[13] = c) : c = u[13], c
    }, "ModalFooter", 0, function(e) {
        let n, a, i, o, s = (0, r.c)(8);
        return s[0] !== e ? ({
            className: n,
            ...a
        } = e, s[0] = e, s[1] = n, s[2] = a) : (n = s[1], a = s[2]), s[3] !== n ? (i = (0, l.cn)("flex w-full items-center gap-2 [&>*]:flex-1 [&>*]:h-11", n), s[3] = n, s[4] = i) : i = s[4], s[5] !== a || s[6] !== i ? (o = (0, t.jsx)("div", {
            "data-slot": "modal-footer",
            className: i,
            ...a
        }), s[5] = a, s[6] = i, s[7] = o) : o = s[7], o
    }, "ModalHeader", 0, function(e) {
        let i, o, s, c, u, f, p, h, m, y, g = (0, r.c)(21);
        g[0] !== e ? ({
            showClose: u,
            onClose: s,
            className: o,
            children: i,
            ...c
        } = e, g[0] = e, g[1] = i, g[2] = o, g[3] = s, g[4] = c, g[5] = u) : (i = g[1], o = g[2], s = g[3], c = g[4], u = g[5]);
        let b = void 0 === u || u,
            v = d();
        if (!i && !b) return null;
        let x = v ? void 0 : s;
        g[6] === Symbol.for("react.memo_cache_sentinel") ? (f = (0, t.jsx)(n.IconXmarkOutline18, {}), g[6] = f) : f = g[6], g[7] !== x ? (p = (0, t.jsx)("button", {
            type: "button",
            className: "ml-auto shrink-0 cursor-pointer rounded-sm p-1 text-text-secondary hover:text-text-tertiary transition-colors duration-200",
            "aria-label": "Close",
            onClick: x,
            children: f
        }), g[7] = x, g[8] = p) : p = g[8];
        let w = p;
        g[9] !== o ? (h = (0, l.cn)("flex items-center", o), g[9] = o, g[10] = h) : h = g[10], g[11] !== w || g[12] !== v ? .isDesktop || g[13] !== b ? (m = b && v ? .isDesktop && (0, t.jsx)(a.Dialog.Close, {
            asChild: !0,
            children: w
        }), g[11] = w, g[12] = v ? .isDesktop, g[13] = b, g[14] = m) : m = g[14];
        let _ = b && !v && s && w;
        return g[15] !== i || g[16] !== c || g[17] !== h || g[18] !== m || g[19] !== _ ? (y = (0, t.jsxs)("div", {
            "data-slot": "modal-header",
            className: h,
            ...c,
            children: [i, m, _]
        }), g[15] = i, g[16] = c, g[17] = h, g[18] = m, g[19] = _, g[20] = y) : y = g[20], y
    }, "ModalTitle", 0, function(e) {
        let n, i, s, c, u = (0, r.c)(14);
        u[0] !== e ? ({
            className: n,
            ...i
        } = e, u[0] = e, u[1] = n, u[2] = i) : (n = u[1], i = u[2]);
        let f = d();
        u[3] !== n ? (s = (0, l.cn)("text-xl font-semibold", n), u[3] = n, u[4] = s) : s = u[4];
        let p = s;
        if (f ? .isDesktop) {
            let e;
            return u[5] !== p || u[6] !== i ? (e = (0, t.jsx)(a.Dialog.Title, {
                "data-slot": "modal-title",
                className: p,
                ...i
            }), u[5] = p, u[6] = i, u[7] = e) : e = u[7], e
        }
        if (f) {
            let e;
            return u[8] !== p || u[9] !== i ? (e = (0, t.jsx)(o.Drawer.Title, {
                "data-slot": "modal-title",
                className: p,
                ...i
            }), u[8] = p, u[9] = i, u[10] = e) : e = u[10], e
        }
        return u[11] !== p || u[12] !== i ? (c = (0, t.jsx)("h2", {
            "data-slot": "modal-title",
            className: p,
            ...i
        }), u[11] = p, u[12] = i, u[13] = c) : c = u[13], c
    }, "ModalTrigger", 0, function(e) {
        let n, i, s = (0, r.c)(6);
        s[0] !== e ? ({ ...n
        } = e, s[0] = e, s[1] = n) : n = s[1];
        let {
            isDesktop: l
        } = f();
        if (l) {
            let e;
            return s[2] !== n ? (e = (0, t.jsx)(a.Dialog.Trigger, {
                "data-slot": "modal-trigger",
                ...n
            }), s[2] = n, s[3] = e) : e = s[3], e
        }
        return s[4] !== n ? (i = (0, t.jsx)(o.Drawer.Trigger, {
            "data-slot": "modal-trigger",
            ...n
        }), s[4] = n, s[5] = i) : i = s[5], i
    }, "useModal", 0, f])
}, 249792, 419160, 337232, 652202, 606572, e => {
    "use strict";
    var t, r, n, a = e.i(416340),
        i = e.i(221628),
        o = e.i(999061),
        s = ((t = {}).Default = "default", t),
        l = ((r = {}).Default = "default", r.Success = "success", r.Info = "info", r.Error = "error", r.Custom = "custom", r),
        c = ((n = {}).Default = "default", n.Time = "time", n);
    e.s(["ToastIcon", () => c, "ToastLayout", () => s, "ToastStatus", () => l], 419160);
    let u = (0, a.createContext)({});
    e.s(["ToastContext", 0, u, "ToastContextProvider", 0, e => {
        let t, r, n, a, s, c, d, f, p = (0, o.c)(23),
            {
                setToasts: h,
                setZIndex: m,
                setPosition: y,
                children: g
            } = e;
        p[0] !== y || p[1] !== h || p[2] !== m ? (t = e => {
            y(e.side ? ? "bottom"), m(e.zIndex), h(t => {
                let r = new Map(t);
                return r.set(String(Date.now()), { ...e,
                    open: !0
                }), r
            })
        }, p[0] = y, p[1] = h, p[2] = m, p[3] = t) : t = p[3];
        let b = t;
        p[4] !== b ? (r = e => b(e.build()), p[4] = b, p[5] = r) : r = p[5];
        let v = r;
        p[6] !== b ? (n = e => b(e.status(l.Info).build()), p[6] = b, p[7] = n) : n = p[7];
        let x = n;
        p[8] !== b ? (a = e => b(e.status(l.Success).build()), p[8] = b, p[9] = a) : a = p[9];
        let w = a;
        p[10] !== b ? (s = e => b(e.status(l.Error).build()), p[10] = b, p[11] = s) : s = p[11];
        let _ = s;
        p[12] !== b ? (c = e => b(e.status(l.Custom).build()), p[12] = b, p[13] = c) : c = p[13];
        let C = c;
        p[14] !== C || p[15] !== v || p[16] !== _ || p[17] !== x || p[18] !== w ? (d = Object.assign(v, {
            success: w,
            info: x,
            error: _,
            custom: C
        }), p[14] = C, p[15] = v, p[16] = _, p[17] = x, p[18] = w, p[19] = d) : d = p[19];
        let E = d;
        return p[20] !== g || p[21] !== E ? (f = (0, i.jsx)(u.Provider, {
            value: E,
            children: g
        }), p[20] = g, p[21] = E, p[22] = f) : f = p[22], f
    }], 337232);
    let d = () => {
        let e = (0, a.useContext)(u);
        if (e) return e;
        throw Error("useToast must be used within Toasts")
    };
    e.s(["default", 0, d], 652202), e.s(["useToast", 0, d], 249792), e.s(["ToastBuilder", 0, class {
        toastDetails;
        constructor() {
            this.toastDetails = {
                layout: s.Default,
                status: l.Default,
                icon: c.Default,
                title: "",
                description: ""
            }
        }
        layout(e) {
            return this.toastDetails.layout = e, this
        }
        status(e) {
            return this.toastDetails.status = e, this
        }
        title(e) {
            return this.toastDetails.title = e, this
        }
        description(e) {
            return this.toastDetails.description = e, this
        }
        icon(e) {
            return this.toastDetails.icon = e, this
        }
        subtext(e) {
            return this.toastDetails.subtext = e, this
        }
        link(e) {
            return this.toastDetails.link = e, this
        }
        action(e) {
            return this.toastDetails.action = e, this
        }
        zIndex(e) {
            return this.toastDetails.zIndex = e, this
        }
        custom(e) {
            return this.toastDetails.component = e, this
        }
        position({
            side: e = "bottom",
            align: t = "left"
        }) {
            return this.toastDetails.side = e, this.toastDetails.align = t, this
        }
        build() {
            return this.toastDetails
        }
    }], 606572)
}, 423582, 230097, e => {
    "use strict";
    var t, r, n, a, i, o, s, l, c = e.i(773925),
        u = e.i(914640),
        d = e.i(179191);
    let f = "POST";
    class p {
        instance;
        constructor() {
            this.instance = d.default.create({
                withCredentials: !0
            })
        }
        async send(e, t, r, n, a) {
            void 0 !== r && (r["Access-Control-Allow-Credentials"] = !0);
            try {
                return await this.instance.request({
                    method: t,
                    url: e,
                    headers: r,
                    data: n,
                    params: a
                })
            } catch (e) {
                if (d.default.isAxiosError(e))
                    if (e.response) {
                        let t = {
                            error: "request error",
                            status: e.response ? .status,
                            statusText: e.response ? .statusText,
                            data: e.response ? .data
                        };
                        throw console.error("request error", t), Error(JSON.stringify(t))
                    } else {
                        let e = {
                            error: "connection error"
                        };
                        throw console.error("connection error", e), Error(JSON.stringify(e))
                    }
                throw Error(JSON.stringify({
                    error: e
                }))
            }
        }
    }
    class h {
        url;
        httpClient;
        token;
        cookie;
        constructor(e, t) {
            if (void 0 === t.authUrl || void 0 === t.authToken) throw Error("invalid authorization arguments");
            this.url = t.authUrl.endsWith("/") ? t.authUrl.slice(0, -1) : t.authUrl, this.token = t.authToken, this.httpClient = e
        }
        async login() {
            if (void 0 === this.cookie) {
                let e = (await this.httpClient.send(`${this.url}/login/internal`, "GET", {
                        Authorization: `Bearer ${this.token}`
                    })).headers["set-cookie"],
                    t = "";
                for (let r of e) r.includes("polymarket") && (t += `${r}; `);
                "" !== t && (this.cookie = t), console.log("Successfully logged in!")
            }
        }
        async getPolymarketCookies() {
            return void 0 === this.cookie && (console.log("Authorization not set, logging in..."), await this.login()), this.cookie
        }
    }
    var m = e.i(913739);
    (t = i || (i = {})).PROXY = "PROXY", t.SAFE = "SAFE", t.SAFE_CREATE = "SAFE-CREATE", t.WALLET = "WALLET", t.WALLET_CREATE = "WALLET-CREATE", (r = o || (o = {})).Invalid = "0", r.Call = "1", r.DelegateCall = "2", (n = s || (s = {}))[n.Call = 0] = "Call", n[n.DelegateCall = 1] = "DelegateCall", (a = l || (l = {})).STATE_NEW = "STATE_NEW", a.STATE_EXECUTED = "STATE_EXECUTED", a.STATE_MINED = "STATE_MINED", a.STATE_INVALID = "STATE_INVALID", a.STATE_CONFIRMED = "STATE_CONFIRMED", a.STATE_FAILED = "STATE_FAILED", e.s(["CallType", 0, o, "OperationType", 0, s, "RelayerTransactionState", 0, l, "TransactionType", 0, i], 230097);
    let y = {
        Call: [{
            name: "target",
            type: "address"
        }, {
            name: "value",
            type: "uint256"
        }, {
            name: "data",
            type: "bytes"
        }],
        Batch: [{
            name: "wallet",
            type: "address"
        }, {
            name: "nonce",
            type: "uint256"
        }, {
            name: "deadline",
            type: "uint256"
        }, {
            name: "calls",
            type: "Call[]"
        }]
    };
    async function g(e, t, r, n, a, i) {
        let o = {
                name: m.DEPOSIT_WALLET_DOMAIN_NAME,
                version: m.DEPOSIT_WALLET_DOMAIN_VERSION,
                chainId: t,
                verifyingContract: r
            },
            s = {
                wallet: r,
                nonce: BigInt(n),
                deadline: BigInt(a),
                calls: i.map(e => ({
                    target: e.target,
                    value: BigInt(e.value),
                    data: e.data
                }))
            };
        return e.signTypedData(o, y, s, "Batch")
    }
    async function b(e, t, r) {
        let n = await g(e, t.chainId, t.walletAddress, t.nonce, t.deadline, t.calls);
        return {
            type: i.WALLET,
            from: t.from,
            to: r.DepositWalletFactory,
            nonce: t.nonce,
            signature: n,
            depositWalletParams: {
                depositWallet: t.walletAddress,
                deadline: t.deadline,
                calls: t.calls
            }
        }
    }
    var v = e.i(844268),
        x = e.i(415013),
        w = e.i(186897),
        _ = e.i(844779);
    async function C(e, t) {
        return e.signMessage(t)
    }
    async function E(e, t, r, n) {
        var a, o, s, l, c;
        let u, d, f, p, h, m, y = r.ProxyFactory,
            g = (0, _.deriveProxyWallet)(t.from, y),
            b = r.RelayHub,
            E = (t.gasLimit ? t.gasLimit : await e.estimateGas({
                from: t.from,
                to: y,
                data: t.data
            })).toString(),
            S = {
                gasPrice: t.gasPrice,
                gasLimit: E,
                relayerFee: "0",
                relayHub: b,
                relay: t.relay
            },
            A = (a = t.from, o = t.data, s = t.gasPrice, l = t.nonce, c = t.relay, u = (0, w.toHex)("rlx:"), d = (0, w.toHex)(BigInt("0"), {
                size: 32
            }), f = (0, w.toHex)(BigInt(s), {
                size: 32
            }), p = (0, w.toHex)(BigInt(E), {
                size: 32
            }), h = (0, w.toHex)(BigInt(l), {
                size: 32
            }), m = (0, v.concat)([u, a, y, o, d, f, p, h, b, c]), (0, x.keccak256)(m)),
            I = await C(e, A);
        void 0 === n && (n = "");
        let T = {
            from: t.from,
            to: y,
            proxyWallet: g,
            data: t.data,
            nonce: t.nonce,
            signature: I,
            signatureParams: S,
            type: i.PROXY,
            metadata: n
        };
        return console.log("Created Proxy Transaction Request:"), console.log(T), T
    }
    async function S(e, t, r, n, a, i) {
        let o = {
                name: m.SAFE_FACTORY_NAME,
                chainId: BigInt(r),
                verifyingContract: t
            },
            s = {
                paymentToken: n,
                payment: BigInt(a),
                paymentReceiver: i
            },
            l = await e.signTypedData(o, {
                CreateProxy: [{
                    name: "paymentToken",
                    type: "address"
                }, {
                    name: "payment",
                    type: "uint256"
                }, {
                    name: "paymentReceiver",
                    type: "address"
                }]
            }, s, "CreateProxy");
        return console.log(`Sig: ${l}`), l
    }
    async function A(e, t, r) {
        let n = t.SafeFactory,
            a = await S(e, n, r.chainId, r.paymentToken, r.payment, r.paymentReceiver),
            o = {
                paymentToken: r.paymentToken,
                payment: r.payment,
                paymentReceiver: r.paymentReceiver
            },
            s = (0, _.deriveSafe)(r.from, n),
            l = {
                from: r.from,
                to: n,
                proxyWallet: s,
                data: "0x",
                signature: a,
                signatureParams: o,
                type: i.SAFE_CREATE
            };
        return console.log("Created a SAFE-CREATE Transaction:"), console.log(l), l
    }
    var I = e.i(7326),
        T = e.i(56339),
        k = e.i(966727),
        O = e.i(640897),
        R = e.i(203375);
    let N = (0, O.prepareEncodeFunctionData)({
        abi: [{
            constant: !1,
            inputs: [{
                internalType: "bytes",
                name: "transactions",
                type: "bytes"
            }],
            name: "multiSend",
            outputs: [],
            payable: !1,
            stateMutability: "nonpayable",
            type: "function"
        }],
        functionName: "multiSend"
    });
    var M = e.i(637608);
    async function P(e, t) {
        return e.signMessage(t)
    }

    function D(e, t) {
        let r;
        if (1 === e.length) r = e[0];
        else {
            let n;
            n = [(0, v.concatHex)(e.map(e => (0, k.encodePacked)(["uint8", "address", "uint256", "uint256", "bytes"], [e.operation, e.to, BigInt(e.value), BigInt((0, R.size)(e.data)), e.data])))], r = {
                to: t,
                value: "0",
                data: (0, T.encodeFunctionData)({ ...N,
                    args: n
                }),
                operation: s.DelegateCall
            }
        }
        return r
    }
    async function j(e, t, r, n) {
        var a, o, s, l, c, d;
        let f, p = r.SafeFactory,
            h = r.SafeMultisend,
            m = D(t.transactions, h),
            y = u.zeroAddress,
            g = u.zeroAddress,
            b = (0, _.deriveSafe)(t.from, p),
            v = (a = t.chainId, o = m.to, s = m.value, l = m.data, c = m.operation, d = t.nonce, (0, I.hashTypedData)({
                primaryType: "SafeTx",
                domain: {
                    chainId: a,
                    verifyingContract: b
                },
                types: {
                    SafeTx: [{
                        name: "to",
                        type: "address"
                    }, {
                        name: "value",
                        type: "uint256"
                    }, {
                        name: "data",
                        type: "bytes"
                    }, {
                        name: "operation",
                        type: "uint8"
                    }, {
                        name: "safeTxGas",
                        type: "uint256"
                    }, {
                        name: "baseGas",
                        type: "uint256"
                    }, {
                        name: "gasPrice",
                        type: "uint256"
                    }, {
                        name: "gasToken",
                        type: "address"
                    }, {
                        name: "refundReceiver",
                        type: "address"
                    }, {
                        name: "nonce",
                        type: "uint256"
                    }]
                },
                message: {
                    to: o,
                    value: s,
                    data: l,
                    operation: c,
                    safeTxGas: "0",
                    baseGas: "0",
                    gasPrice: "0",
                    gasToken: y,
                    refundReceiver: g,
                    nonce: d
                }
            })),
            x = (f = function(e) {
                let t = parseInt(e.slice(-2), 16);
                switch (t) {
                    case 0:
                    case 1:
                        t += 31;
                        break;
                    case 27:
                    case 28:
                        t += 4;
                        break;
                    default:
                        throw Error("Invalid signature")
                }
                return e = e.slice(0, -2) + t.toString(16), {
                    r: (0, M.hexToBigInt)(`0x${e.slice(2,66)}`).toString(),
                    s: (0, M.hexToBigInt)(`0x${e.slice(66,130)}`).toString(),
                    v: (0, M.hexToBigInt)(`0x${e.slice(130,132)}`).toString()
                }
            }(await P(e, v)), (0, k.encodePacked)(["uint256", "uint256", "uint8"], [BigInt(f.r), BigInt(f.s), parseInt(f.v, 10)])),
            w = {
                gasPrice: "0",
                operation: `${m.operation}`,
                safeTxnGas: "0",
                baseGas: "0",
                gasToken: y,
                refundReceiver: g
            };
        void 0 === n && (n = "");
        let C = {
            from: t.from,
            to: m.to,
            proxyWallet: b,
            data: m.data,
            nonce: t.nonce,
            signature: x,
            signatureParams: w,
            type: i.SAFE,
            metadata: n
        };
        return console.log("Created Safe Transaction Request: "), console.log(C), C
    }
    let L = {
            ProxyContracts: {
                ProxyFactory: "",
                RelayHub: ""
            },
            SafeContracts: {
                SafeFactory: "",
                SafeMultisend: ""
            },
            DepositWalletContracts: {
                DepositWalletFactory: "0x801c740Bcd28531d75a5da176D5511F3329Ab049",
                DepositWalletImplementation: "0x24f3257BF9451bA575E864777ab6f8D7Eac0139B"
            }
        },
        F = {
            ProxyContracts: {
                ProxyFactory: "0xaB45c5A4B0c941a2F231C04C3f49182e1A254052",
                RelayHub: "0xD216153c06E857cD7f72665E0aF1d7D82172F494"
            },
            SafeContracts: {
                SafeFactory: "0xaacFeEa03eb1561C4e67d661e40682Bd20E3541b",
                SafeMultisend: "0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761"
            },
            DepositWalletContracts: {
                DepositWalletFactory: "0x00000000000Fb5C9ADea0298D729A0CB3823Cc07",
                DepositWalletImplementation: "0x58CA52ebe0DadfdF531Cde7062e76746de4Db1eB"
            }
        },
        U = [{
            constant: !1,
            inputs: [{
                components: [{
                    name: "typeCode",
                    type: "uint8"
                }, {
                    name: "to",
                    type: "address"
                }, {
                    name: "value",
                    type: "uint256"
                }, {
                    name: "data",
                    type: "bytes"
                }],
                name: "calls",
                type: "tuple[]"
            }],
            name: "proxy",
            outputs: [{
                name: "returnValues",
                type: "bytes[]"
            }],
            payable: !0,
            stateMutability: "payable",
            type: "function"
        }, {
            constant: !1,
            inputs: [{
                name: "",
                type: "bytes"
            }],
            name: "cloneConstructor",
            outputs: [],
            payable: !1,
            stateMutability: "nonpayable",
            type: "function"
        }, {
            constant: !1,
            inputs: [],
            name: "renounceOwnership",
            outputs: [],
            payable: !1,
            stateMutability: "nonpayable",
            type: "function"
        }, {
            constant: !0,
            inputs: [],
            name: "getHubAddr",
            outputs: [{
                name: "",
                type: "address"
            }],
            payable: !1,
            stateMutability: "view",
            type: "function"
        }, {
            constant: !1,
            inputs: [{
                name: "context",
                type: "bytes"
            }],
            name: "preRelayedCall",
            outputs: [{
                name: "",
                type: "bytes32"
            }],
            payable: !1,
            stateMutability: "nonpayable",
            type: "function"
        }, {
            constant: !0,
            inputs: [{
                name: "",
                type: "address"
            }, {
                name: "",
                type: "address"
            }, {
                name: "",
                type: "bytes"
            }, {
                name: "",
                type: "uint256"
            }, {
                name: "",
                type: "uint256"
            }, {
                name: "",
                type: "uint256"
            }, {
                name: "",
                type: "uint256"
            }, {
                name: "",
                type: "bytes"
            }, {
                name: "",
                type: "uint256"
            }],
            name: "acceptRelayedCall",
            outputs: [{
                name: "doCall",
                type: "uint256"
            }, {
                name: "context",
                type: "bytes"
            }],
            payable: !1,
            stateMutability: "view",
            type: "function"
        }, {
            constant: !0,
            inputs: [],
            name: "owner",
            outputs: [{
                name: "",
                type: "address"
            }],
            payable: !1,
            stateMutability: "view",
            type: "function"
        }, {
            constant: !0,
            inputs: [],
            name: "isOwner",
            outputs: [{
                name: "",
                type: "bool"
            }],
            payable: !1,
            stateMutability: "view",
            type: "function"
        }, {
            constant: !0,
            inputs: [],
            name: "getImplementation",
            outputs: [{
                name: "",
                type: "address"
            }],
            payable: !1,
            stateMutability: "view",
            type: "function"
        }, {
            constant: !0,
            inputs: [],
            name: "relayHubVersion",
            outputs: [{
                name: "",
                type: "string"
            }],
            payable: !1,
            stateMutability: "view",
            type: "function"
        }, {
            constant: !1,
            inputs: [{
                name: "gsnModule",
                type: "address"
            }],
            name: "setGSNModule",
            outputs: [],
            payable: !1,
            stateMutability: "nonpayable",
            type: "function"
        }, {
            constant: !1,
            inputs: [{
                name: "context",
                type: "bytes"
            }, {
                name: "success",
                type: "bool"
            }, {
                name: "actualCharge",
                type: "uint256"
            }, {
                name: "preRetVal",
                type: "bytes32"
            }],
            name: "postRelayedCall",
            outputs: [],
            payable: !1,
            stateMutability: "nonpayable",
            type: "function"
        }, {
            constant: !1,
            inputs: [{
                name: "newOwner",
                type: "address"
            }],
            name: "transferOwnership",
            outputs: [],
            payable: !1,
            stateMutability: "nonpayable",
            type: "function"
        }, {
            constant: !0,
            inputs: [],
            name: "getGSNModule",
            outputs: [{
                name: "",
                type: "address"
            }],
            payable: !1,
            stateMutability: "view",
            type: "function"
        }, {
            inputs: [],
            payable: !1,
            stateMutability: "nonpayable",
            type: "constructor"
        }, {
            payable: !0,
            stateMutability: "payable",
            type: "fallback"
        }, {
            anonymous: !1,
            inputs: [{
                indexed: !0,
                name: "oldRelayHub",
                type: "address"
            }, {
                indexed: !0,
                name: "newRelayHub",
                type: "address"
            }],
            name: "RelayHubChanged",
            type: "event"
        }, {
            anonymous: !1,
            inputs: [{
                indexed: !0,
                name: "previousOwner",
                type: "address"
            }, {
                indexed: !0,
                name: "newOwner",
                type: "address"
            }],
            name: "OwnershipTransferred",
            type: "event"
        }],
        $ = (0, O.prepareEncodeFunctionData)({
            abi: U,
            functionName: "proxy"
        }),
        z = "/transaction";
    class B {
        client;
        transactionID;
        transactionHash;
        hash;
        state;
        constructor(e, t, r, n) {
            this.transactionID = e, this.state = t, this.transactionHash = r, this.hash = r, this.client = n
        }
        async getTransaction() {
            return this.client.getTransaction(this.transactionID)
        }
        async wait() {
            return this.client.pollUntilState(this.transactionID, [l.STATE_MINED, l.STATE_CONFIRMED], l.STATE_FAILED, 30)
        }
    }
    class q {
        hash;
        transactionHash;
        waitTillMined;
        constructor(e, t) {
            this.transactionHash = e, this.hash = e, this.waitTillMined = t
        }
        async wait() {
            return this.waitTillMined(this.hash)
        }
    }
    let W = (0, O.prepareEncodeFunctionData)({
        abi: [{
            anonymous: !1,
            inputs: [{
                indexed: !1,
                internalType: "address",
                name: "owner",
                type: "address"
            }],
            name: "AddedOwner",
            type: "event"
        }, {
            anonymous: !1,
            inputs: [{
                indexed: !0,
                internalType: "bytes32",
                name: "approvedHash",
                type: "bytes32"
            }, {
                indexed: !0,
                internalType: "address",
                name: "owner",
                type: "address"
            }],
            name: "ApproveHash",
            type: "event"
        }, {
            anonymous: !1,
            inputs: [{
                indexed: !1,
                internalType: "address",
                name: "handler",
                type: "address"
            }],
            name: "ChangedFallbackHandler",
            type: "event"
        }, {
            anonymous: !1,
            inputs: [{
                indexed: !1,
                internalType: "address",
                name: "guard",
                type: "address"
            }],
            name: "ChangedGuard",
            type: "event"
        }, {
            anonymous: !1,
            inputs: [{
                indexed: !1,
                internalType: "uint256",
                name: "threshold",
                type: "uint256"
            }],
            name: "ChangedThreshold",
            type: "event"
        }, {
            anonymous: !1,
            inputs: [{
                indexed: !1,
                internalType: "address",
                name: "module",
                type: "address"
            }],
            name: "DisabledModule",
            type: "event"
        }, {
            anonymous: !1,
            inputs: [{
                indexed: !1,
                internalType: "address",
                name: "module",
                type: "address"
            }],
            name: "EnabledModule",
            type: "event"
        }, {
            anonymous: !1,
            inputs: [{
                indexed: !1,
                internalType: "bytes32",
                name: "txHash",
                type: "bytes32"
            }, {
                indexed: !1,
                internalType: "uint256",
                name: "payment",
                type: "uint256"
            }],
            name: "ExecutionFailure",
            type: "event"
        }, {
            anonymous: !1,
            inputs: [{
                indexed: !0,
                internalType: "address",
                name: "module",
                type: "address"
            }],
            name: "ExecutionFromModuleFailure",
            type: "event"
        }, {
            anonymous: !1,
            inputs: [{
                indexed: !0,
                internalType: "address",
                name: "module",
                type: "address"
            }],
            name: "ExecutionFromModuleSuccess",
            type: "event"
        }, {
            anonymous: !1,
            inputs: [{
                indexed: !1,
                internalType: "bytes32",
                name: "txHash",
                type: "bytes32"
            }, {
                indexed: !1,
                internalType: "uint256",
                name: "payment",
                type: "uint256"
            }],
            name: "ExecutionSuccess",
            type: "event"
        }, {
            anonymous: !1,
            inputs: [{
                indexed: !1,
                internalType: "address",
                name: "owner",
                type: "address"
            }],
            name: "RemovedOwner",
            type: "event"
        }, {
            anonymous: !1,
            inputs: [{
                indexed: !1,
                internalType: "address",
                name: "module",
                type: "address"
            }, {
                indexed: !1,
                internalType: "address",
                name: "to",
                type: "address"
            }, {
                indexed: !1,
                internalType: "uint256",
                name: "value",
                type: "uint256"
            }, {
                indexed: !1,
                internalType: "bytes",
                name: "data",
                type: "bytes"
            }, {
                indexed: !1,
                internalType: "enum Enum.Operation",
                name: "operation",
                type: "uint8"
            }],
            name: "SafeModuleTransaction",
            type: "event"
        }, {
            anonymous: !1,
            inputs: [{
                indexed: !1,
                internalType: "address",
                name: "to",
                type: "address"
            }, {
                indexed: !1,
                internalType: "uint256",
                name: "value",
                type: "uint256"
            }, {
                indexed: !1,
                internalType: "bytes",
                name: "data",
                type: "bytes"
            }, {
                indexed: !1,
                internalType: "enum Enum.Operation",
                name: "operation",
                type: "uint8"
            }, {
                indexed: !1,
                internalType: "uint256",
                name: "safeTxGas",
                type: "uint256"
            }, {
                indexed: !1,
                internalType: "uint256",
                name: "baseGas",
                type: "uint256"
            }, {
                indexed: !1,
                internalType: "uint256",
                name: "gasPrice",
                type: "uint256"
            }, {
                indexed: !1,
                internalType: "address",
                name: "gasToken",
                type: "address"
            }, {
                indexed: !1,
                internalType: "address payable",
                name: "refundReceiver",
                type: "address"
            }, {
                indexed: !1,
                internalType: "bytes",
                name: "signatures",
                type: "bytes"
            }, {
                indexed: !1,
                internalType: "bytes",
                name: "additionalInfo",
                type: "bytes"
            }],
            name: "SafeMultiSigTransaction",
            type: "event"
        }, {
            anonymous: !1,
            inputs: [{
                indexed: !0,
                internalType: "address",
                name: "sender",
                type: "address"
            }, {
                indexed: !1,
                internalType: "uint256",
                name: "value",
                type: "uint256"
            }],
            name: "SafeReceived",
            type: "event"
        }, {
            anonymous: !1,
            inputs: [{
                indexed: !0,
                internalType: "address",
                name: "initiator",
                type: "address"
            }, {
                indexed: !1,
                internalType: "address[]",
                name: "owners",
                type: "address[]"
            }, {
                indexed: !1,
                internalType: "uint256",
                name: "threshold",
                type: "uint256"
            }, {
                indexed: !1,
                internalType: "address",
                name: "initializer",
                type: "address"
            }, {
                indexed: !1,
                internalType: "address",
                name: "fallbackHandler",
                type: "address"
            }],
            name: "SafeSetup",
            type: "event"
        }, {
            anonymous: !1,
            inputs: [{
                indexed: !0,
                internalType: "bytes32",
                name: "msgHash",
                type: "bytes32"
            }],
            name: "SignMsg",
            type: "event"
        }, {
            stateMutability: "nonpayable",
            type: "fallback"
        }, {
            inputs: [],
            name: "VERSION",
            outputs: [{
                internalType: "string",
                name: "",
                type: "string"
            }],
            stateMutability: "view",
            type: "function"
        }, {
            inputs: [{
                internalType: "address",
                name: "owner",
                type: "address"
            }, {
                internalType: "uint256",
                name: "_threshold",
                type: "uint256"
            }],
            name: "addOwnerWithThreshold",
            outputs: [],
            stateMutability: "nonpayable",
            type: "function"
        }, {
            inputs: [{
                internalType: "bytes32",
                name: "hashToApprove",
                type: "bytes32"
            }],
            name: "approveHash",
            outputs: [],
            stateMutability: "nonpayable",
            type: "function"
        }, {
            inputs: [{
                internalType: "address",
                name: "",
                type: "address"
            }, {
                internalType: "bytes32",
                name: "",
                type: "bytes32"
            }],
            name: "approvedHashes",
            outputs: [{
                internalType: "uint256",
                name: "",
                type: "uint256"
            }],
            stateMutability: "view",
            type: "function"
        }, {
            inputs: [{
                internalType: "uint256",
                name: "_threshold",
                type: "uint256"
            }],
            name: "changeThreshold",
            outputs: [],
            stateMutability: "nonpayable",
            type: "function"
        }, {
            inputs: [{
                internalType: "bytes32",
                name: "dataHash",
                type: "bytes32"
            }, {
                internalType: "bytes",
                name: "data",
                type: "bytes"
            }, {
                internalType: "bytes",
                name: "signatures",
                type: "bytes"
            }, {
                internalType: "uint256",
                name: "requiredSignatures",
                type: "uint256"
            }],
            name: "checkNSignatures",
            outputs: [],
            stateMutability: "view",
            type: "function"
        }, {
            inputs: [{
                internalType: "bytes32",
                name: "dataHash",
                type: "bytes32"
            }, {
                internalType: "bytes",
                name: "data",
                type: "bytes"
            }, {
                internalType: "bytes",
                name: "signatures",
                type: "bytes"
            }],
            name: "checkSignatures",
            outputs: [],
            stateMutability: "view",
            type: "function"
        }, {
            inputs: [{
                internalType: "address",
                name: "prevModule",
                type: "address"
            }, {
                internalType: "address",
                name: "module",
                type: "address"
            }],
            name: "disableModule",
            outputs: [],
            stateMutability: "nonpayable",
            type: "function"
        }, {
            inputs: [],
            name: "domainSeparator",
            outputs: [{
                internalType: "bytes32",
                name: "",
                type: "bytes32"
            }],
            stateMutability: "view",
            type: "function"
        }, {
            inputs: [{
                internalType: "address",
                name: "module",
                type: "address"
            }],
            name: "enableModule",
            outputs: [],
            stateMutability: "nonpayable",
            type: "function"
        }, {
            inputs: [{
                internalType: "address",
                name: "to",
                type: "address"
            }, {
                internalType: "uint256",
                name: "value",
                type: "uint256"
            }, {
                internalType: "bytes",
                name: "data",
                type: "bytes"
            }, {
                internalType: "enum Enum.Operation",
                name: "operation",
                type: "uint8"
            }, {
                internalType: "uint256",
                name: "safeTxGas",
                type: "uint256"
            }, {
                internalType: "uint256",
                name: "baseGas",
                type: "uint256"
            }, {
                internalType: "uint256",
                name: "gasPrice",
                type: "uint256"
            }, {
                internalType: "address",
                name: "gasToken",
                type: "address"
            }, {
                internalType: "address",
                name: "refundReceiver",
                type: "address"
            }, {
                internalType: "uint256",
                name: "_nonce",
                type: "uint256"
            }],
            name: "encodeTransactionData",
            outputs: [{
                internalType: "bytes",
                name: "",
                type: "bytes"
            }],
            stateMutability: "view",
            type: "function"
        }, {
            inputs: [{
                internalType: "address",
                name: "to",
                type: "address"
            }, {
                internalType: "uint256",
                name: "value",
                type: "uint256"
            }, {
                internalType: "bytes",
                name: "data",
                type: "bytes"
            }, {
                internalType: "enum Enum.Operation",
                name: "operation",
                type: "uint8"
            }, {
                internalType: "uint256",
                name: "safeTxGas",
                type: "uint256"
            }, {
                internalType: "uint256",
                name: "baseGas",
                type: "uint256"
            }, {
                internalType: "uint256",
                name: "gasPrice",
                type: "uint256"
            }, {
                internalType: "address",
                name: "gasToken",
                type: "address"
            }, {
                internalType: "address payable",
                name: "refundReceiver",
                type: "address"
            }, {
                internalType: "bytes",
                name: "signatures",
                type: "bytes"
            }],
            name: "execTransaction",
            outputs: [{
                internalType: "bool",
                name: "",
                type: "bool"
            }],
            stateMutability: "payable",
            type: "function"
        }, {
            inputs: [{
                internalType: "address",
                name: "to",
                type: "address"
            }, {
                internalType: "uint256",
                name: "value",
                type: "uint256"
            }, {
                internalType: "bytes",
                name: "data",
                type: "bytes"
            }, {
                internalType: "enum Enum.Operation",
                name: "operation",
                type: "uint8"
            }],
            name: "execTransactionFromModule",
            outputs: [{
                internalType: "bool",
                name: "success",
                type: "bool"
            }],
            stateMutability: "nonpayable",
            type: "function"
        }, {
            inputs: [{
                internalType: "address",
                name: "to",
                type: "address"
            }, {
                internalType: "uint256",
                name: "value",
                type: "uint256"
            }, {
                internalType: "bytes",
                name: "data",
                type: "bytes"
            }, {
                internalType: "enum Enum.Operation",
                name: "operation",
                type: "uint8"
            }],
            name: "execTransactionFromModuleReturnData",
            outputs: [{
                internalType: "bool",
                name: "success",
                type: "bool"
            }, {
                internalType: "bytes",
                name: "returnData",
                type: "bytes"
            }],
            stateMutability: "nonpayable",
            type: "function"
        }, {
            inputs: [],
            name: "getChainId",
            outputs: [{
                internalType: "uint256",
                name: "",
                type: "uint256"
            }],
            stateMutability: "view",
            type: "function"
        }, {
            inputs: [{
                internalType: "address",
                name: "start",
                type: "address"
            }, {
                internalType: "uint256",
                name: "pageSize",
                type: "uint256"
            }],
            name: "getModulesPaginated",
            outputs: [{
                internalType: "address[]",
                name: "array",
                type: "address[]"
            }, {
                internalType: "address",
                name: "next",
                type: "address"
            }],
            stateMutability: "view",
            type: "function"
        }, {
            inputs: [],
            name: "getOwners",
            outputs: [{
                internalType: "address[]",
                name: "",
                type: "address[]"
            }],
            stateMutability: "view",
            type: "function"
        }, {
            inputs: [{
                internalType: "uint256",
                name: "offset",
                type: "uint256"
            }, {
                internalType: "uint256",
                name: "length",
                type: "uint256"
            }],
            name: "getStorageAt",
            outputs: [{
                internalType: "bytes",
                name: "",
                type: "bytes"
            }],
            stateMutability: "view",
            type: "function"
        }, {
            inputs: [],
            name: "getThreshold",
            outputs: [{
                internalType: "uint256",
                name: "",
                type: "uint256"
            }],
            stateMutability: "view",
            type: "function"
        }, {
            inputs: [{
                internalType: "address",
                name: "to",
                type: "address"
            }, {
                internalType: "uint256",
                name: "value",
                type: "uint256"
            }, {
                internalType: "bytes",
                name: "data",
                type: "bytes"
            }, {
                internalType: "enum Enum.Operation",
                name: "operation",
                type: "uint8"
            }, {
                internalType: "uint256",
                name: "safeTxGas",
                type: "uint256"
            }, {
                internalType: "uint256",
                name: "baseGas",
                type: "uint256"
            }, {
                internalType: "uint256",
                name: "gasPrice",
                type: "uint256"
            }, {
                internalType: "address",
                name: "gasToken",
                type: "address"
            }, {
                internalType: "address",
                name: "refundReceiver",
                type: "address"
            }, {
                internalType: "uint256",
                name: "_nonce",
                type: "uint256"
            }],
            name: "getTransactionHash",
            outputs: [{
                internalType: "bytes32",
                name: "",
                type: "bytes32"
            }],
            stateMutability: "view",
            type: "function"
        }, {
            inputs: [{
                internalType: "address",
                name: "module",
                type: "address"
            }],
            name: "isModuleEnabled",
            outputs: [{
                internalType: "bool",
                name: "",
                type: "bool"
            }],
            stateMutability: "view",
            type: "function"
        }, {
            inputs: [{
                internalType: "address",
                name: "owner",
                type: "address"
            }],
            name: "isOwner",
            outputs: [{
                internalType: "bool",
                name: "",
                type: "bool"
            }],
            stateMutability: "view",
            type: "function"
        }, {
            inputs: [],
            name: "nonce",
            outputs: [{
                internalType: "uint256",
                name: "",
                type: "uint256"
            }],
            stateMutability: "view",
            type: "function"
        }, {
            inputs: [{
                internalType: "address",
                name: "prevOwner",
                type: "address"
            }, {
                internalType: "address",
                name: "owner",
                type: "address"
            }, {
                internalType: "uint256",
                name: "_threshold",
                type: "uint256"
            }],
            name: "removeOwner",
            outputs: [],
            stateMutability: "nonpayable",
            type: "function"
        }, {
            inputs: [{
                internalType: "address",
                name: "to",
                type: "address"
            }, {
                internalType: "uint256",
                name: "value",
                type: "uint256"
            }, {
                internalType: "bytes",
                name: "data",
                type: "bytes"
            }, {
                internalType: "enum Enum.Operation",
                name: "operation",
                type: "uint8"
            }],
            name: "requiredTxGas",
            outputs: [{
                internalType: "uint256",
                name: "",
                type: "uint256"
            }],
            stateMutability: "nonpayable",
            type: "function"
        }, {
            inputs: [{
                internalType: "address",
                name: "handler",
                type: "address"
            }],
            name: "setFallbackHandler",
            outputs: [],
            stateMutability: "nonpayable",
            type: "function"
        }, {
            inputs: [{
                internalType: "address",
                name: "guard",
                type: "address"
            }],
            name: "setGuard",
            outputs: [],
            stateMutability: "nonpayable",
            type: "function"
        }, {
            inputs: [{
                internalType: "address[]",
                name: "_owners",
                type: "address[]"
            }, {
                internalType: "uint256",
                name: "_threshold",
                type: "uint256"
            }, {
                internalType: "address",
                name: "to",
                type: "address"
            }, {
                internalType: "bytes",
                name: "data",
                type: "bytes"
            }, {
                internalType: "address",
                name: "fallbackHandler",
                type: "address"
            }, {
                internalType: "address",
                name: "paymentToken",
                type: "address"
            }, {
                internalType: "uint256",
                name: "payment",
                type: "uint256"
            }, {
                internalType: "address payable",
                name: "paymentReceiver",
                type: "address"
            }],
            name: "setup",
            outputs: [],
            stateMutability: "nonpayable",
            type: "function"
        }, {
            inputs: [{
                internalType: "bytes32",
                name: "",
                type: "bytes32"
            }],
            name: "signedMessages",
            outputs: [{
                internalType: "uint256",
                name: "",
                type: "uint256"
            }],
            stateMutability: "view",
            type: "function"
        }, {
            inputs: [{
                internalType: "address",
                name: "targetContract",
                type: "address"
            }, {
                internalType: "bytes",
                name: "calldataPayload",
                type: "bytes"
            }],
            name: "simulateAndRevert",
            outputs: [],
            stateMutability: "nonpayable",
            type: "function"
        }, {
            inputs: [{
                internalType: "address",
                name: "prevOwner",
                type: "address"
            }, {
                internalType: "address",
                name: "oldOwner",
                type: "address"
            }, {
                internalType: "address",
                name: "newOwner",
                type: "address"
            }],
            name: "swapOwner",
            outputs: [],
            stateMutability: "nonpayable",
            type: "function"
        }, {
            stateMutability: "payable",
            type: "receive"
        }],
        functionName: "execTransaction"
    });
    async function Z(e, t, r, n) {
        let a = await e.getAddress(),
            i = D(r, t.SafeMultisend),
            o = (0, k.encodePacked)(["uint256", "uint256", "uint8"], [BigInt((0, M.hexToBigInt)(a)), BigInt(0), 1]),
            s = (0, _.deriveSafe)(a, t.SafeFactory),
            l = (0, T.encodeFunctionData)({ ...W,
                args: [i.to, i.value, i.data, i.operation, 0, 0, 0, u.zeroAddress, u.zeroAddress, o]
            });
        if (void 0 === n.gasLimit) {
            let t = await e.estimateGas({
                to: s,
                data: l,
                from: a
            });
            console.log(`Estimated gas Limit: ${t}`), n.gasLimit = t
        }
        return new q(await e.sendTransaction({
            data: l,
            to: s,
            gasPrice: n.gasPrice,
            gasLimit: n.gasLimit
        }), t => e.waitTillMined(t))
    }
    var V = e.i(26128),
        K = e.i(318877),
        H = e.i(289241);
    let G = (0, e.i(970413).defineChain)({
        id: 80002,
        name: "Polygon Amoy",
        nativeCurrency: {
            name: "POL",
            symbol: "POL",
            decimals: 18
        },
        rpcUrls: {
            default: {
                http: ["https://rpc-amoy.polygon.technology"]
            }
        },
        blockExplorers: {
            default: {
                name: "PolygonScan",
                url: "https://amoy.polygonscan.com",
                apiUrl: "https://api.etherscan.io/v2/api"
            }
        },
        contracts: {
            multicall3: {
                address: "0xca11bde05977b3631167028862be2a173976ca11",
                blockCreated: 3127388
            }
        },
        testnet: !0
    });
    async function Q(e) {
        let t = e.account ? .address;
        if ("string" == typeof t && t.length > 0) return t;
        try {
            let [t] = await e.getAddresses();
            if ("string" == typeof t && t.length > 0) return t
        } catch {}
        let [r] = await e.requestAddresses();
        if ("string" == typeof r && r.length > 0) return r;
        throw Error("wallet client is missing account address")
    }
    async function J(e) {
        return void 0 !== e.account ? e.account : Q(e)
    }
    class Y {
        relayerUrl;
        chainId;
        contractConfig;
        httpClient;
        signer;
        authHandler;
        constructor(e, t, r, n) {
            this.relayerUrl = e.endsWith("/") ? e.slice(0, -1) : e, this.chainId = t, this.contractConfig = (e => {
                switch (e) {
                    case 137:
                        return F;
                    case 80002:
                        return L;
                    default:
                        throw Error("Invalid network")
                }
            })(t), this.httpClient = new p, void 0 !== r && (this.signer = function(e, t) {
                if (void 0 !== t.chain && t.chain.id !== e) throw Error("wallet client chain id does not match chain id");
                let r = t.chain ? ? function(e) {
                        switch (e) {
                            case 137:
                                return H.polygon;
                            case 80002:
                                return G;
                            default:
                                throw Error(`unsupported chainId ${e}`)
                        }
                    }(e),
                    n = t.transport,
                    a = (0, V.createPublicClient)({
                        chain: r,
                        transport: () => ({
                            config: n.config,
                            name: n.name,
                            request: n.request,
                            type: n.type,
                            value: n.value
                        })
                    });
                return {
                    async signMessage(e) {
                        let r = await J(t);
                        return t.signMessage({
                            account: r,
                            message: {
                                raw: (0, K.toBytes)(e)
                            }
                        })
                    },
                    async signTypedData(e, r, n, a) {
                        if (void 0 === a) throw Error("primaryType is required in viem signers");
                        let i = await J(t);
                        return t.signTypedData({
                            account: i,
                            domain: e,
                            types: r,
                            primaryType: a,
                            message: n
                        })
                    },
                    getAddress: async () => Q(t),
                    async estimateGas(e) {
                        let r = e.from ? ? await Q(t);
                        return a.estimateGas({
                            account: r,
                            to: e.to,
                            data: e.data,
                            value: e.value,
                            nonce: e.nonce
                        })
                    },
                    async sendTransaction(e) {
                        let n = await J(t);
                        return t.sendTransaction({
                            account: n,
                            chain: r,
                            to: e.to,
                            data: e.data,
                            value: e.value,
                            gas: e.gasLimit,
                            gasPrice: e.gasPrice,
                            nonce: e.nonce
                        })
                    },
                    waitTillMined: async e => a.waitForTransactionReceipt({
                        hash: e
                    })
                }
            }(t, r)), void 0 !== n && (this.authHandler = new h(this.httpClient, n))
        }
        async getRelayAddress() {
            return this.send(`${this.relayerUrl}/address`, "GET")
        }
        async getNonce(e, t) {
            return this.send(`${this.relayerUrl}/nonce?address=${e}&type=${t}`, "GET")
        }
        async getRelayPayload(e, t) {
            return this.send(`${this.relayerUrl}/relay-payload?address=${e}&type=${t}`, "GET")
        }
        async getTransaction(e) {
            return this.send(`${this.relayerUrl}${z}?id=${e}`, "GET")
        }
        async getTransactions() {
            return this.send(`${this.relayerUrl}${z}s`, "GET")
        }
        async executeProxyTransactions(e, t) {
            if (void 0 === this.signer) throw Error("missing signer");
            let r = Date.now(),
                n = await this.signer.getAddress(),
                a = await this.getRelayPayload(n, i.PROXY),
                o = {
                    from: n,
                    gasPrice: "0",
                    data: (0, T.encodeFunctionData)({ ...$,
                        args: [e]
                    }),
                    relay: a.address,
                    nonce: a.nonce
                },
                s = this.contractConfig.ProxyContracts,
                l = await E(this.signer, o, s, t);
            console.log(`Client side proxy request creation took: ${(Date.now()-r)/1e3} seconds`);
            let c = await this.submitTransaction(l);
            return new B(c.transactionID, c.state, c.transactionHash, this)
        }
        async executeSafeTransactions(e, t) {
            if (void 0 === this.signer) throw Error("missing signer");
            let r = Date.now(),
                n = await this.signer.getAddress(),
                a = await this.getNonce(n, i.SAFE),
                o = {
                    transactions: e,
                    from: n,
                    nonce: a.nonce,
                    chainId: this.chainId
                },
                s = this.contractConfig.SafeContracts,
                l = await j(this.signer, o, s, t);
            console.log(`Client side safe request creation took: ${(Date.now()-r)/1e3} seconds`);
            let c = await this.submitTransaction(l);
            return new B(c.transactionID, c.state, c.transactionHash, this)
        }
        async executeManualTransactions(e, t) {
            if (void 0 === t && (t = {}), void 0 === this.signer) throw Error("missing signer");
            return Z(this.signer, this.contractConfig.SafeContracts, e, t)
        }
        async deploySafe() {
            if (void 0 === this.signer) throw Error("missing signer");
            let e = Date.now(),
                t = {
                    from: await this.signer ? .getAddress(),
                    chainId: this.chainId,
                    paymentToken: u.zeroAddress,
                    payment: "0",
                    paymentReceiver: u.zeroAddress
                },
                r = this.contractConfig.SafeContracts,
                n = await A(this.signer, r, t);
            console.log(`Client side deploy request creation took: ${(Date.now()-e)/1e3} seconds`);
            let a = await this.submitTransaction(n);
            return new B(a.transactionID, a.state, a.transactionHash, this)
        }
        async deployDepositWallet() {
            if (void 0 === this.signer) throw Error("missing signer");
            let e = await this.signer.getAddress(),
                t = this.contractConfig.DepositWalletContracts,
                r = {
                    type: i.WALLET_CREATE,
                    from: e,
                    to: t.DepositWalletFactory
                },
                n = await this.submitTransaction(r);
            return new B(n.transactionID, n.state, n.transactionHash, this)
        }
        async executeDepositWalletBatch(e, t, r) {
            if (void 0 === this.signer) throw Error("missing signer");
            let n = await this.signer.getAddress(),
                a = await this.getNonce(n, i.WALLET),
                o = {
                    from: n,
                    chainId: this.chainId,
                    walletAddress: t,
                    nonce: a.nonce,
                    deadline: r,
                    calls: e
                },
                s = this.contractConfig.DepositWalletContracts,
                l = await b(this.signer, o, s),
                c = await this.submitTransaction(l);
            return new B(c.transactionID, c.state, c.transactionHash, this)
        }
        async deriveDepositWalletAddress() {
            if (void 0 === this.signer) throw Error("missing signer");
            let e = this.contractConfig.DepositWalletContracts,
                t = await this.signer.getAddress();
            return (0, _.deriveDepositWallet)(t, e.DepositWalletFactory, e.DepositWalletImplementation)
        }
        async pollUntilState(e, t, r, n, a) {
            console.log(`Waiting for transaction ${e} matching states: ${t}...`);
            let i = void 0 !== n ? n : 10,
                o = 2e3;
            void 0 !== a && a >= 1e3 && (o = a);
            let s = 0;
            for (; s < i;) {
                let n = await this.getTransaction(e);
                if (n.length > 0) {
                    let e = n[0];
                    if (t.includes(e.state)) return e;
                    if (void 0 !== r && e.state === r) return
                }
                s++, await
                function(e) {
                    return new Promise(t => setTimeout(t, e))
                }(o)
            }
            console.log("Transaction not found or not in given states, timing out")
        }
        async createRelayerApiKey() {
            return this.send(`${this.relayerUrl}/relayer/api/auth`, f)
        }
        async getRelayerApiKeys(e) {
            let t = e ? {
                RELAYER_API_KEY: e.apiKey,
                RELAYER_API_KEY_ADDRESS: e.address
            } : void 0;
            return this.send(`${this.relayerUrl}/relayer/api/keys`, "GET", t)
        }
        async deleteRelayerApiKey(e, t) {
            let r = t ? {
                RELAYER_API_KEY: t.apiKey,
                RELAYER_API_KEY_ADDRESS: t.address
            } : void 0;
            return this.send(`${this.relayerUrl}/relayer/api/keys?apiKey=${e}`, "DELETE", r)
        }
        async submitTransaction(e) {
            return this.send(`${this.relayerUrl}/submit`, f, void 0, e)
        }
        async send(e, t, r, n, a) {
            let i = r ? .RELAYER_API_KEY != null;
            if (!c.isBrowser && void 0 !== this.authHandler && !i) {
                let e = await this.authHandler.getPolymarketCookies();
                void 0 !== r ? r.Cookie = e : r = {
                    Cookie: e
                }
            }
            return (await this.httpClient.send(e, t, r, n, a)).data
        }
    }
    var X = e.i(631222);
    let ee = async e => void 0 !== e && !!await e.wait();
    e.s(["getRelayerClient", 0, e => new Y(X.V2_RELAYER_URL, X.MATIC_CONFIG.chainId, e), "waitTillMined", 0, ee], 423582)
}, 768735, e => {
    "use strict";
    e.s(["useDeploySafe", () => v]);
    var t = e.i(999061),
        r = e.i(399482),
        n = e.i(601550),
        a = e.i(318594),
        i = e.i(423708),
        o = e.i(249792),
        s = e.i(606572),
        l = e.i(510954),
        c = e.i(57096),
        u = e.i(305457),
        d = e.i(306941),
        f = e.i(660006),
        p = e.i(53950),
        h = e.i(631222),
        m = e.i(423582),
        y = e.i(721270),
        g = e.i(246290);
    let b = async e => {
            try {
                let t = (0, m.getRelayerClient)(e),
                    r = await t.deployDepositWallet();
                if (!await (0, m.waitTillMined)(r)) return {
                    status: 400,
                    message: "Deploy not confirmed on-chain (relayer timed out before STATE_MINED)"
                };
                return {
                    status: 200
                }
            } catch (e) {
                if (console.error("[deploy:depositWallet]", {
                        error: e
                    }), (0, d.isUserRejection)(e)) return {
                    status: 401,
                    message: e instanceof Error ? e.message : String(e)
                };
                return {
                    status: 400,
                    message: e instanceof Error ? e.message : String(e)
                }
            }
        },
        v = () => {
            let e, m, v, x, w = (0, t.c)(14),
                _ = (0, u.useGoogleAnalytics)(),
                C = (0, o.useToast)(),
                E = (0, a.useQueryClient)(),
                {
                    address: S,
                    proxyAddress: A,
                    walletMode: I
                } = (0, g.useAccount)();
            w[0] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                chainId: h.MATIC_CONFIG.chainId
            }, w[0] = e) : e = w[0];
            let {
                data: T
            } = (0, i.useWalletClient)(e);
            return w[1] !== S || w[2] !== _ || w[3] !== A || w[4] !== E || w[5] !== T || w[6] !== C || w[7] !== I ? (m = async () => {
                if ("safe" === I) throw p.logger.error("[useDeploySafe] blocked: legacy Safe flow", {
                    proxyAddress: A,
                    walletMode: I
                }), C.error(new s.ToastBuilder().title("Legacy account").description("Please create a new account to continue.")), Error("Cannot deploy: user is on legacy flow, Please create a new account.");
                if (S) {
                    let e = (0, y.getProxyAddress)(S, "eoa"),
                        t = !1;
                    try {
                        t = await (0, y.isSafeDeployedOnChain)(e)
                    } catch (t) {
                        p.logger.warn("[useDeploySafe] safe deployment precheck failed; proceeding", {
                            address: S,
                            safeAddress: e,
                            proxyAddress: A,
                            walletMode: I,
                            errorMessage: t instanceof Error ? t.message : String(t)
                        })
                    }
                    if (t) throw p.logger.error("[useDeploySafe] blocked: existing Safe wallet detected for EOA", {
                        address: S,
                        safeAddress: e,
                        proxyAddress: A,
                        walletMode: I
                    }), (0, r.createWalletCache)().wallets.clear(), C.error(new s.ToastBuilder().title("Existing wallet detected").description("You already have a safe wallet deployed for this account. Please logout and login again to access.")), Error("Safe already deployed; please log out and log in again.")
                }
                if (!T) throw _.trackEvent("deploy_deposit_wallet", {
                    event_status: "error",
                    event_value: -1,
                    event_error_msg: d.UNAUTHENTICATED
                }), p.logger.error("[dw] deploy_failed", {
                    reason: "unauthenticated",
                    proxyAddress: A,
                    walletMode: I
                }), Error(d.UNAUTHENTICATED);
                let e = await b(T);
                if (401 === e.status) throw _.trackEvent("deploy_deposit_wallet", {
                    event_status: "error",
                    event_value: e.status,
                    event_error_msg: e.message
                }), p.logger.error("[dw] deploy_failed", {
                    reason: "rejected_signature",
                    proxyAddress: A,
                    walletMode: I,
                    errorMessage: e.message
                }), Error(d.REJECTED_SIGNATURE);
                if (400 === e.status) throw _.trackEvent("deploy_deposit_wallet", {
                    event_status: "error",
                    event_value: e.status,
                    event_error_msg: e.message
                }), p.logger.error("[dw] deploy_failed", {
                    reason: e.message ? .includes("STATE_MINED") ? "not_mined" : "execution_reverted",
                    proxyAddress: A,
                    walletMode: I,
                    errorMessage: e.message
                }), Error(d.EXECUTION_REVERTED);
                let t = l.queryKeys[c.QueryKey.Auth].depositWalletDeployed(A).queryKey;
                return await E.invalidateQueries({
                    queryKey: t
                }), E.setQueryData(t, !0), _.trackEvent("deploy_deposit_wallet", {
                    event_status: "success",
                    event_value: e.status
                }), p.logger.info("[dw] deploy_succeeded", {
                    proxyAddress: A,
                    walletMode: I
                }), e
            }, w[1] = S, w[2] = _, w[3] = A, w[4] = E, w[5] = T, w[6] = C, w[7] = I, w[8] = m) : m = w[8], w[9] !== A ? (v = e => {
                (0, f.handleError)(e, "useDeploySafe", A)
            }, w[9] = A, w[10] = v) : v = w[10], w[11] !== m || w[12] !== v ? (x = {
                mutationFn: m,
                onError: v
            }, w[11] = m, w[12] = v, w[13] = x) : x = w[13], (0, n.useMutation)(x)
        }
}, 635103, e => {
    "use strict";
    e.s(["useDepositWallet", () => h], 635103);
    var t = e.i(964974),
        r = e.i(416340),
        n = e.i(914640),
        a = e.i(200036),
        i = e.i(510954),
        o = e.i(57096),
        s = e.i(53950),
        l = e.i(631222),
        c = e.i(246290),
        u = e.i(999061),
        d = e.i(601550),
        f = e.i(318594);
    let p = [{
            name: "nonce",
            type: "function",
            stateMutability: "view",
            inputs: [],
            outputs: [{
                name: "",
                type: "uint256"
            }]
        }],
        h = () => {
            let {
                proxyAddress: e,
                walletMode: h
            } = (0, c.useAccount)(), m = r.default.useRef(null), y = "depositWallet" === h, {
                data: g,
                isFetchedAfterMount: b
            } = (0, t.useQuery)({
                queryKey: i.queryKeys[o.QueryKey.Auth].depositWalletDeployed(y ? e : void 0).queryKey,
                queryFn: async () => {
                    try {
                        let t = (0, a.createChainAwarePublicClient)({
                                chainId: l.MATIC_CONFIG.chainId
                            }),
                            r = await t ? .getCode({
                                address: e
                            });
                        return !!r && "0x" !== r
                    } catch {
                        return !1
                    }
                },
                enabled: y && !!e && e !== n.zeroAddress,
                staleTime: 0,
                refetchOnMount: "always",
                refetchOnWindowFocus: !0,
                meta: {
                    persist: !1
                }
            }), v = b && !!g;
            r.default.useEffect(() => {
                if (!y || !e || !g || b) return;
                let t = e.toLowerCase();
                m.current !== t && (m.current = t, s.logger.info("[dw] ignoring cached deposit wallet deployment state", {
                    proxyAddress: e,
                    walletMode: h
                }))
            }, [y, e, g, b, h]);
            let {
                nonce: x,
                incrementNonce: w,
                refreshNonce: _
            } = (e => {
                let r, s, h, m, y, g, b, v, x, w = (0, u.c)(23);
                w[0] !== e ? (r = e ? ? {}, w[0] = e, w[1] = r) : r = w[1];
                let {
                    enabled: _
                } = r, C = (0, f.useQueryClient)(), {
                    proxyAddress: E,
                    walletMode: S
                } = (0, c.useAccount)(), A = "depositWallet" === S;
                w[2] !== E ? (s = i.queryKeys[o.QueryKey.Auth].depositWalletNonce(E), w[2] = E, w[3] = s) : s = w[3], w[4] !== E ? (h = async () => {
                    let e = (0, a.createChainAwarePublicClient)({
                        chainId: l.MATIC_CONFIG.chainId
                    });
                    return Number(await e.readContract({
                        address: E,
                        abi: p,
                        functionName: "nonce"
                    }))
                }, w[4] = E, w[5] = h) : h = w[5];
                let I = (void 0 === _ || _) && A && !!E && E !== n.zeroAddress;
                w[6] === Symbol.for("react.memo_cache_sentinel") ? (m = {
                    persist: !1
                }, w[6] = m) : m = w[6], w[7] !== s.queryKey || w[8] !== h || w[9] !== I ? (y = {
                    queryKey: s.queryKey,
                    queryFn: h,
                    enabled: I,
                    refetchOnWindowFocus: !1,
                    refetchOnReconnect: !1,
                    refetchOnMount: !0,
                    gcTime: 864e5,
                    staleTime: 864e5,
                    meta: m
                }, w[7] = s.queryKey, w[8] = h, w[9] = I, w[10] = y) : y = w[10];
                let {
                    data: T,
                    refetch: k
                } = (0, t.useQuery)(y);
                w[11] !== E ? (g = i.queryKeys[o.QueryKey.Auth].depositWalletNonce(E), w[11] = E, w[12] = g) : g = w[12], w[13] !== E || w[14] !== C ? (b = async () => {
                    let e = C.getQueryData(i.queryKeys[o.QueryKey.Auth].depositWalletNonce(E).queryKey);
                    return null != e ? (C.setQueryData(i.queryKeys[o.QueryKey.Auth].depositWalletNonce(E).queryKey, e + 1), e + 1) : e
                }, w[13] = E, w[14] = C, w[15] = b) : b = w[15], w[16] !== g.queryKey || w[17] !== b ? (v = {
                    mutationKey: g.queryKey,
                    mutationFn: b
                }, w[16] = g.queryKey, w[17] = b, w[18] = v) : v = w[18];
                let {
                    mutateAsync: O
                } = (0, d.useMutation)(v), R = A ? T : void 0;
                return w[19] !== O || w[20] !== k || w[21] !== R ? (x = {
                    nonce: R,
                    incrementNonce: O,
                    refreshNonce: k
                }, w[19] = O, w[20] = k, w[21] = R, w[22] = x) : x = w[22], x
            })({
                enabled: v
            });
            return r.default.useMemo(() => ({
                address: y ? e : void 0,
                nonce: x,
                incrementNonce: w,
                refreshNonce: _,
                isDeployed: v,
                isDepositWallet: y
            }), [e, x, w, _, v, y])
        }
}, 628684, e => {
    "use strict";
    e.s(["useSafe", () => m], 628684);
    var t = e.i(999061);
    e.i(416340);
    var r = e.i(832565),
        n = e.i(768735),
        a = e.i(635103),
        i = e.i(914640),
        o = e.i(601550),
        s = e.i(964974),
        l = e.i(318594),
        c = e.i(200036);
    let u = [{
        anonymous: !1,
        inputs: [{
            indexed: !1,
            internalType: "address",
            name: "owner",
            type: "address"
        }],
        name: "AddedOwner",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !0,
            internalType: "bytes32",
            name: "approvedHash",
            type: "bytes32"
        }, {
            indexed: !0,
            internalType: "address",
            name: "owner",
            type: "address"
        }],
        name: "ApproveHash",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !1,
            internalType: "address",
            name: "handler",
            type: "address"
        }],
        name: "ChangedFallbackHandler",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !1,
            internalType: "address",
            name: "guard",
            type: "address"
        }],
        name: "ChangedGuard",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !1,
            internalType: "uint256",
            name: "threshold",
            type: "uint256"
        }],
        name: "ChangedThreshold",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !1,
            internalType: "address",
            name: "module",
            type: "address"
        }],
        name: "DisabledModule",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !1,
            internalType: "address",
            name: "module",
            type: "address"
        }],
        name: "EnabledModule",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !1,
            internalType: "bytes32",
            name: "txHash",
            type: "bytes32"
        }, {
            indexed: !1,
            internalType: "uint256",
            name: "payment",
            type: "uint256"
        }],
        name: "ExecutionFailure",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !0,
            internalType: "address",
            name: "module",
            type: "address"
        }],
        name: "ExecutionFromModuleFailure",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !0,
            internalType: "address",
            name: "module",
            type: "address"
        }],
        name: "ExecutionFromModuleSuccess",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !1,
            internalType: "bytes32",
            name: "txHash",
            type: "bytes32"
        }, {
            indexed: !1,
            internalType: "uint256",
            name: "payment",
            type: "uint256"
        }],
        name: "ExecutionSuccess",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !1,
            internalType: "address",
            name: "owner",
            type: "address"
        }],
        name: "RemovedOwner",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !1,
            internalType: "address",
            name: "module",
            type: "address"
        }, {
            indexed: !1,
            internalType: "address",
            name: "to",
            type: "address"
        }, {
            indexed: !1,
            internalType: "uint256",
            name: "value",
            type: "uint256"
        }, {
            indexed: !1,
            internalType: "bytes",
            name: "data",
            type: "bytes"
        }, {
            indexed: !1,
            internalType: "enum Enum.Operation",
            name: "operation",
            type: "uint8"
        }],
        name: "SafeModuleTransaction",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !1,
            internalType: "address",
            name: "to",
            type: "address"
        }, {
            indexed: !1,
            internalType: "uint256",
            name: "value",
            type: "uint256"
        }, {
            indexed: !1,
            internalType: "bytes",
            name: "data",
            type: "bytes"
        }, {
            indexed: !1,
            internalType: "enum Enum.Operation",
            name: "operation",
            type: "uint8"
        }, {
            indexed: !1,
            internalType: "uint256",
            name: "safeTxGas",
            type: "uint256"
        }, {
            indexed: !1,
            internalType: "uint256",
            name: "baseGas",
            type: "uint256"
        }, {
            indexed: !1,
            internalType: "uint256",
            name: "gasPrice",
            type: "uint256"
        }, {
            indexed: !1,
            internalType: "address",
            name: "gasToken",
            type: "address"
        }, {
            indexed: !1,
            internalType: "address payable",
            name: "refundReceiver",
            type: "address"
        }, {
            indexed: !1,
            internalType: "bytes",
            name: "signatures",
            type: "bytes"
        }, {
            indexed: !1,
            internalType: "bytes",
            name: "additionalInfo",
            type: "bytes"
        }],
        name: "SafeMultiSigTransaction",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !0,
            internalType: "address",
            name: "sender",
            type: "address"
        }, {
            indexed: !1,
            internalType: "uint256",
            name: "value",
            type: "uint256"
        }],
        name: "SafeReceived",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !0,
            internalType: "address",
            name: "initiator",
            type: "address"
        }, {
            indexed: !1,
            internalType: "address[]",
            name: "owners",
            type: "address[]"
        }, {
            indexed: !1,
            internalType: "uint256",
            name: "threshold",
            type: "uint256"
        }, {
            indexed: !1,
            internalType: "address",
            name: "initializer",
            type: "address"
        }, {
            indexed: !1,
            internalType: "address",
            name: "fallbackHandler",
            type: "address"
        }],
        name: "SafeSetup",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !0,
            internalType: "bytes32",
            name: "msgHash",
            type: "bytes32"
        }],
        name: "SignMsg",
        type: "event"
    }, {
        stateMutability: "nonpayable",
        type: "fallback"
    }, {
        inputs: [],
        name: "VERSION",
        outputs: [{
            internalType: "string",
            name: "",
            type: "string"
        }],
        stateMutability: "view",
        type: "function"
    }, {
        inputs: [{
            internalType: "address",
            name: "owner",
            type: "address"
        }, {
            internalType: "uint256",
            name: "_threshold",
            type: "uint256"
        }],
        name: "addOwnerWithThreshold",
        outputs: [],
        stateMutability: "nonpayable",
        type: "function"
    }, {
        inputs: [{
            internalType: "bytes32",
            name: "hashToApprove",
            type: "bytes32"
        }],
        name: "approveHash",
        outputs: [],
        stateMutability: "nonpayable",
        type: "function"
    }, {
        inputs: [{
            internalType: "address",
            name: "",
            type: "address"
        }, {
            internalType: "bytes32",
            name: "",
            type: "bytes32"
        }],
        name: "approvedHashes",
        outputs: [{
            internalType: "uint256",
            name: "",
            type: "uint256"
        }],
        stateMutability: "view",
        type: "function"
    }, {
        inputs: [{
            internalType: "uint256",
            name: "_threshold",
            type: "uint256"
        }],
        name: "changeThreshold",
        outputs: [],
        stateMutability: "nonpayable",
        type: "function"
    }, {
        inputs: [{
            internalType: "bytes32",
            name: "dataHash",
            type: "bytes32"
        }, {
            internalType: "bytes",
            name: "data",
            type: "bytes"
        }, {
            internalType: "bytes",
            name: "signatures",
            type: "bytes"
        }, {
            internalType: "uint256",
            name: "requiredSignatures",
            type: "uint256"
        }],
        name: "checkNSignatures",
        outputs: [],
        stateMutability: "view",
        type: "function"
    }, {
        inputs: [{
            internalType: "bytes32",
            name: "dataHash",
            type: "bytes32"
        }, {
            internalType: "bytes",
            name: "data",
            type: "bytes"
        }, {
            internalType: "bytes",
            name: "signatures",
            type: "bytes"
        }],
        name: "checkSignatures",
        outputs: [],
        stateMutability: "view",
        type: "function"
    }, {
        inputs: [{
            internalType: "address",
            name: "prevModule",
            type: "address"
        }, {
            internalType: "address",
            name: "module",
            type: "address"
        }],
        name: "disableModule",
        outputs: [],
        stateMutability: "nonpayable",
        type: "function"
    }, {
        inputs: [],
        name: "domainSeparator",
        outputs: [{
            internalType: "bytes32",
            name: "",
            type: "bytes32"
        }],
        stateMutability: "view",
        type: "function"
    }, {
        inputs: [{
            internalType: "address",
            name: "module",
            type: "address"
        }],
        name: "enableModule",
        outputs: [],
        stateMutability: "nonpayable",
        type: "function"
    }, {
        inputs: [{
            internalType: "address",
            name: "to",
            type: "address"
        }, {
            internalType: "uint256",
            name: "value",
            type: "uint256"
        }, {
            internalType: "bytes",
            name: "data",
            type: "bytes"
        }, {
            internalType: "enum Enum.Operation",
            name: "operation",
            type: "uint8"
        }, {
            internalType: "uint256",
            name: "safeTxGas",
            type: "uint256"
        }, {
            internalType: "uint256",
            name: "baseGas",
            type: "uint256"
        }, {
            internalType: "uint256",
            name: "gasPrice",
            type: "uint256"
        }, {
            internalType: "address",
            name: "gasToken",
            type: "address"
        }, {
            internalType: "address",
            name: "refundReceiver",
            type: "address"
        }, {
            internalType: "uint256",
            name: "_nonce",
            type: "uint256"
        }],
        name: "encodeTransactionData",
        outputs: [{
            internalType: "bytes",
            name: "",
            type: "bytes"
        }],
        stateMutability: "view",
        type: "function"
    }, {
        inputs: [{
            internalType: "address",
            name: "to",
            type: "address"
        }, {
            internalType: "uint256",
            name: "value",
            type: "uint256"
        }, {
            internalType: "bytes",
            name: "data",
            type: "bytes"
        }, {
            internalType: "enum Enum.Operation",
            name: "operation",
            type: "uint8"
        }, {
            internalType: "uint256",
            name: "safeTxGas",
            type: "uint256"
        }, {
            internalType: "uint256",
            name: "baseGas",
            type: "uint256"
        }, {
            internalType: "uint256",
            name: "gasPrice",
            type: "uint256"
        }, {
            internalType: "address",
            name: "gasToken",
            type: "address"
        }, {
            internalType: "address payable",
            name: "refundReceiver",
            type: "address"
        }, {
            internalType: "bytes",
            name: "signatures",
            type: "bytes"
        }],
        name: "execTransaction",
        outputs: [{
            internalType: "bool",
            name: "",
            type: "bool"
        }],
        stateMutability: "payable",
        type: "function"
    }, {
        inputs: [{
            internalType: "address",
            name: "to",
            type: "address"
        }, {
            internalType: "uint256",
            name: "value",
            type: "uint256"
        }, {
            internalType: "bytes",
            name: "data",
            type: "bytes"
        }, {
            internalType: "enum Enum.Operation",
            name: "operation",
            type: "uint8"
        }],
        name: "execTransactionFromModule",
        outputs: [{
            internalType: "bool",
            name: "success",
            type: "bool"
        }],
        stateMutability: "nonpayable",
        type: "function"
    }, {
        inputs: [{
            internalType: "address",
            name: "to",
            type: "address"
        }, {
            internalType: "uint256",
            name: "value",
            type: "uint256"
        }, {
            internalType: "bytes",
            name: "data",
            type: "bytes"
        }, {
            internalType: "enum Enum.Operation",
            name: "operation",
            type: "uint8"
        }],
        name: "execTransactionFromModuleReturnData",
        outputs: [{
            internalType: "bool",
            name: "success",
            type: "bool"
        }, {
            internalType: "bytes",
            name: "returnData",
            type: "bytes"
        }],
        stateMutability: "nonpayable",
        type: "function"
    }, {
        inputs: [],
        name: "getChainId",
        outputs: [{
            internalType: "uint256",
            name: "",
            type: "uint256"
        }],
        stateMutability: "view",
        type: "function"
    }, {
        inputs: [{
            internalType: "address",
            name: "start",
            type: "address"
        }, {
            internalType: "uint256",
            name: "pageSize",
            type: "uint256"
        }],
        name: "getModulesPaginated",
        outputs: [{
            internalType: "address[]",
            name: "array",
            type: "address[]"
        }, {
            internalType: "address",
            name: "next",
            type: "address"
        }],
        stateMutability: "view",
        type: "function"
    }, {
        inputs: [],
        name: "getOwners",
        outputs: [{
            internalType: "address[]",
            name: "",
            type: "address[]"
        }],
        stateMutability: "view",
        type: "function"
    }, {
        inputs: [{
            internalType: "uint256",
            name: "offset",
            type: "uint256"
        }, {
            internalType: "uint256",
            name: "length",
            type: "uint256"
        }],
        name: "getStorageAt",
        outputs: [{
            internalType: "bytes",
            name: "",
            type: "bytes"
        }],
        stateMutability: "view",
        type: "function"
    }, {
        inputs: [],
        name: "getThreshold",
        outputs: [{
            internalType: "uint256",
            name: "",
            type: "uint256"
        }],
        stateMutability: "view",
        type: "function"
    }, {
        inputs: [{
            internalType: "address",
            name: "to",
            type: "address"
        }, {
            internalType: "uint256",
            name: "value",
            type: "uint256"
        }, {
            internalType: "bytes",
            name: "data",
            type: "bytes"
        }, {
            internalType: "enum Enum.Operation",
            name: "operation",
            type: "uint8"
        }, {
            internalType: "uint256",
            name: "safeTxGas",
            type: "uint256"
        }, {
            internalType: "uint256",
            name: "baseGas",
            type: "uint256"
        }, {
            internalType: "uint256",
            name: "gasPrice",
            type: "uint256"
        }, {
            internalType: "address",
            name: "gasToken",
            type: "address"
        }, {
            internalType: "address",
            name: "refundReceiver",
            type: "address"
        }, {
            internalType: "uint256",
            name: "_nonce",
            type: "uint256"
        }],
        name: "getTransactionHash",
        outputs: [{
            internalType: "bytes32",
            name: "",
            type: "bytes32"
        }],
        stateMutability: "view",
        type: "function"
    }, {
        inputs: [{
            internalType: "address",
            name: "module",
            type: "address"
        }],
        name: "isModuleEnabled",
        outputs: [{
            internalType: "bool",
            name: "",
            type: "bool"
        }],
        stateMutability: "view",
        type: "function"
    }, {
        inputs: [{
            internalType: "address",
            name: "owner",
            type: "address"
        }],
        name: "isOwner",
        outputs: [{
            internalType: "bool",
            name: "",
            type: "bool"
        }],
        stateMutability: "view",
        type: "function"
    }, {
        inputs: [],
        name: "nonce",
        outputs: [{
            internalType: "uint256",
            name: "",
            type: "uint256"
        }],
        stateMutability: "view",
        type: "function"
    }, {
        inputs: [{
            internalType: "address",
            name: "prevOwner",
            type: "address"
        }, {
            internalType: "address",
            name: "owner",
            type: "address"
        }, {
            internalType: "uint256",
            name: "_threshold",
            type: "uint256"
        }],
        name: "removeOwner",
        outputs: [],
        stateMutability: "nonpayable",
        type: "function"
    }, {
        inputs: [{
            internalType: "address",
            name: "to",
            type: "address"
        }, {
            internalType: "uint256",
            name: "value",
            type: "uint256"
        }, {
            internalType: "bytes",
            name: "data",
            type: "bytes"
        }, {
            internalType: "enum Enum.Operation",
            name: "operation",
            type: "uint8"
        }],
        name: "requiredTxGas",
        outputs: [{
            internalType: "uint256",
            name: "",
            type: "uint256"
        }],
        stateMutability: "nonpayable",
        type: "function"
    }, {
        inputs: [{
            internalType: "address",
            name: "handler",
            type: "address"
        }],
        name: "setFallbackHandler",
        outputs: [],
        stateMutability: "nonpayable",
        type: "function"
    }, {
        inputs: [{
            internalType: "address",
            name: "guard",
            type: "address"
        }],
        name: "setGuard",
        outputs: [],
        stateMutability: "nonpayable",
        type: "function"
    }, {
        inputs: [{
            internalType: "address[]",
            name: "_owners",
            type: "address[]"
        }, {
            internalType: "uint256",
            name: "_threshold",
            type: "uint256"
        }, {
            internalType: "address",
            name: "to",
            type: "address"
        }, {
            internalType: "bytes",
            name: "data",
            type: "bytes"
        }, {
            internalType: "address",
            name: "fallbackHandler",
            type: "address"
        }, {
            internalType: "address",
            name: "paymentToken",
            type: "address"
        }, {
            internalType: "uint256",
            name: "payment",
            type: "uint256"
        }, {
            internalType: "address payable",
            name: "paymentReceiver",
            type: "address"
        }],
        name: "setup",
        outputs: [],
        stateMutability: "nonpayable",
        type: "function"
    }, {
        inputs: [{
            internalType: "bytes32",
            name: "",
            type: "bytes32"
        }],
        name: "signedMessages",
        outputs: [{
            internalType: "uint256",
            name: "",
            type: "uint256"
        }],
        stateMutability: "view",
        type: "function"
    }, {
        inputs: [{
            internalType: "address",
            name: "targetContract",
            type: "address"
        }, {
            internalType: "bytes",
            name: "calldataPayload",
            type: "bytes"
        }],
        name: "simulateAndRevert",
        outputs: [],
        stateMutability: "nonpayable",
        type: "function"
    }, {
        inputs: [{
            internalType: "address",
            name: "prevOwner",
            type: "address"
        }, {
            internalType: "address",
            name: "oldOwner",
            type: "address"
        }, {
            internalType: "address",
            name: "newOwner",
            type: "address"
        }],
        name: "swapOwner",
        outputs: [],
        stateMutability: "nonpayable",
        type: "function"
    }, {
        stateMutability: "payable",
        type: "receive"
    }];
    var d = e.i(510954),
        f = e.i(57096),
        p = e.i(631222),
        h = e.i(246290);
    let m = () => {
        let e, m, y = (0, t.c)(8),
            {
                isSafeDeployed: g
            } = (0, r.useSafeContext)(),
            {
                isDeployed: b,
                isDepositWallet: v
            } = (0, a.useDepositWallet)(),
            {
                mutateAsync: x
            } = (0, n.useDeploySafe)(),
            w = v ? b : g,
            _ = !v && g;
        y[0] !== _ ? (e = {
            enabled: _
        }, y[0] = _, y[1] = e) : e = y[1];
        let {
            nonce: C,
            refreshNonce: E,
            incrementNonce: S
        } = (e => {
            let r, n, a, m, y, g, b, v = (0, t.c)(17);
            v[0] !== e ? (r = e ? ? {}, v[0] = e, v[1] = r) : r = v[1];
            let {
                enabled: x
            } = r, w = (0, l.useQueryClient)(), {
                proxyAddress: _,
                walletMode: C
            } = (0, h.useAccount)();
            v[2] !== _ ? (n = d.queryKeys[f.QueryKey.Auth].safeNonce(_), v[2] = _, v[3] = n) : n = v[3], v[4] !== _ ? (a = async () => {
                let e = (0, c.createChainAwarePublicClient)({
                    chainId: p.MATIC_CONFIG.chainId
                });
                return Number(await e.readContract({
                    address: _,
                    abi: u,
                    functionName: "nonce"
                }))
            }, v[4] = _, v[5] = a) : a = v[5];
            let E = (void 0 === x || x) && "safe" === C && !!_ && _ !== i.zeroAddress;
            v[6] !== n.queryKey || v[7] !== a || v[8] !== E ? (m = {
                queryKey: n.queryKey,
                queryFn: a,
                enabled: E,
                refetchOnWindowFocus: !1,
                refetchOnReconnect: !1,
                refetchOnMount: !0,
                gcTime: 864e5,
                staleTime: 864e5
            }, v[6] = n.queryKey, v[7] = a, v[8] = E, v[9] = m) : m = v[9];
            let {
                data: S,
                refetch: A
            } = (0, s.useQuery)(m);
            v[10] === Symbol.for("react.memo_cache_sentinel") ? (y = d.queryKeys[f.QueryKey.Auth].safeNonce(), v[10] = y) : y = v[10], v[11] !== w ? (g = {
                mutationKey: y.queryKey,
                mutationFn: async () => {
                    let e = w.getQueryData(d.queryKeys[f.QueryKey.Auth].safeNonce().queryKey);
                    return e ? (w.setQueryData(d.queryKeys[f.QueryKey.Auth].safeNonce().queryKey, e + 1), e + 1) : e ? e + 1 : e
                }
            }, v[11] = w, v[12] = g) : g = v[12];
            let {
                mutateAsync: I
            } = (0, o.useMutation)(g), T = "safe" === C ? S : void 0;
            return v[13] !== I || v[14] !== A || v[15] !== T ? (b = {
                nonce: T,
                incrementNonce: I,
                refreshNonce: A
            }, v[13] = I, v[14] = A, v[15] = T, v[16] = b) : b = v[16], b
        })(e);
        return y[2] !== x || y[3] !== S || y[4] !== w || y[5] !== C || y[6] !== E ? (m = {
            isSafeDeployed: w,
            deploySafe: x,
            nonce: C,
            refreshNonce: E,
            incrementNonce: S
        }, y[2] = x, y[3] = S, y[4] = w, y[5] = C, y[6] = E, y[7] = m) : m = y[7], m
    }
}, 730474, e => {
    "use strict";
    let t = (0, e.i(322324).create)()(e => ({
        showDeploySafeModal: !1,
        setShowDeploySafeModal: t => {
            e({
                showDeploySafeModal: t
            })
        },
        showLogoutConnectionErrorModal: !1,
        setShowLogoutConnectionErrorModal: t => {
            e({
                showLogoutConnectionErrorModal: t
            })
        },
        showApprovalModal: !1,
        setShowApprovalModal: t => {
            e({
                showApprovalModal: t
            })
        },
        showDepositWalletMigrationModal: !1,
        setShowDepositWalletMigrationModal: t => {
            e({
                showDepositWalletMigrationModal: t
            })
        }
    }));
    e.s(["useModalStore", 0, t])
}, 17025, 98191, e => {
    "use strict";
    e.s(["default", () => E], 17025);
    var t, r, n = e.i(221628),
        a = e.i(999061),
        i = e.i(525962),
        o = e.i(784521),
        s = e.i(23128),
        l = e.i(336896),
        c = e.i(416340),
        u = e.i(8998),
        d = e.i(73836),
        f = e.i(246290),
        p = e.i(628684),
        h = e.i(668122),
        m = e.i(604777),
        y = e.i(305457),
        g = e.i(730474);
    let b = e => {
        let t, r, i, o, s, l = (0, a.c)(9);
        l[0] !== e ? ({
            color: r,
            ...t
        } = e, l[0] = e, l[1] = t, l[2] = r) : (t = l[1], r = l[2]);
        let c = void 0 === r ? "var(--color-bg-brand)" : r;
        return l[3] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, n.jsx)("animateTransform", {
            attributeName: "transform",
            attributeType: "XML",
            type: "rotate",
            dur: "1s",
            from: "0 50 50",
            to: "360 50 50",
            repeatCount: "indefinite"
        }), l[3] = i) : i = l[3], l[4] !== c ? (o = (0, n.jsx)("path", {
            fill: c,
            d: "M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50",
            children: i
        }), l[4] = c, l[5] = o) : o = l[5], l[6] !== t || l[7] !== o ? (s = (0, n.jsx)("svg", {
            version: "1.1",
            id: "L9",
            x: "0px",
            y: "0px",
            viewBox: "0 0 100 100",
            enableBackground: "new 0 0 0 0",
            xmlSpace: "preserve",
            ...t,
            children: o
        }), l[6] = t, l[7] = o, l[8] = s) : s = l[8], s
    };
    e.s(["default", 0, b], 98191);
    var v = e.i(660006),
        x = e.i(631222),
        w = ((t = w || {})[t.Initial = 0] = "Initial", t[t.Pending = 1] = "Pending", t[t.Complete = 2] = "Complete", t),
        _ = ((r = _ || {})[r.Rejection = 0] = "Rejection", r[r.Pending = 1] = "Pending", r[r.Unknown = 2] = "Unknown", r);
    let C = function({
            forceOpen: e,
            onClose: t
        }) {
            let r = (0, m.useTranslations)(),
                a = (0, l.useRouter)(),
                {
                    address: w,
                    connector: _,
                    isConnected: C,
                    isConnecting: E,
                    chain: S
                } = (0, f.useAccount)(),
                A = (0, u.useChains)(),
                I = (0, y.useAmplitudeAnalytics)(),
                {
                    switchChainAsync: T
                } = (0, d.useSwitchChain)(),
                {
                    setShowDeploySafeModal: k
                } = (0, g.useModalStore)(),
                {
                    deploySafe: O
                } = (0, p.useSafe)(),
                {
                    preventModalClose: R,
                    setPreventModalClose: N
                } = (0, o.useAccountContext)(["preventModalClose", "setPreventModalClose"]),
                [M, P] = (0, c.useState)(0),
                [D, j] = (0, c.useState)(),
                [L, F] = (0, c.useState)(!1),
                U = (0, c.useCallback)(async () => {
                    try {
                        if (!w) throw Error("No address");
                        if (!_) throw Error("No connector");
                        if (j(void 0), P(1), 1 === M) return void j(1);
                        I.trackEvent(h.Events.AttemptingProxyWalletCreation);
                        let e = await O();
                        if (200 === e.status) {
                            k(!1), I.trackEvent(h.Events.ProxyWalletCreationSuccess);
                            return
                        }
                        401 === e.status && j(0), 400 === e.status && (j(2), I.trackEvent(h.Events.ProxyWalletCreationError, {
                            error: e.message
                        }))
                    } catch (e) {
                        j(2), (0, v.handleError)(e, "handleDeploySafe", w), I.trackEvent(h.Events.ProxyWalletCreationError, {
                            error: e
                        })
                    } finally {
                        P(0)
                    }
                }, [w, _, M, O, k, I]),
                $ = (0, c.useCallback)(async e => {
                    try {
                        F(!0), await T ? .({
                            chainId: e
                        })
                    } catch (e) {
                        (0, v.handleError)(e, "[DeploySafeFlow > Error handling network change]")
                    } finally {
                        F(!1)
                    }
                }, [T]),
                z = (0, c.useCallback)(() => {
                    R && (N(!1), a.push("/")), t()
                }, [R, N, a, t]);
            return (0, n.jsxs)(n.Fragment, {
                children: [(0, n.jsx)(i.ModalHeader, {
                    showClose: !e,
                    onClose: z,
                    children: (0, n.jsx)(i.ModalTitle, {
                        children: r("auth.enableTrading")
                    })
                }), (0, n.jsx)(i.ModalDescription, {
                    children: "In order to easily and securely trade on Polymarket, you will need to set up a proxy wallet."
                }), 1 === D && (0, n.jsx)("p", {
                    className: "text-sm text-red-500",
                    children: "There is already a pending request. Please check your wallet."
                }), 0 === D && (0, n.jsx)("p", {
                    className: "text-sm text-red-500",
                    children: "The signature request was rejected. Please try again."
                }), 2 === D && (0, n.jsx)("p", {
                    className: "text-sm text-red-500",
                    children: "An unexpected error occurred. Please try again."
                }), (0, n.jsx)(i.ModalFooter, {
                    children: C && !E && _ && S ? .id !== A[x.WAGMI_CHAIN_INDICES.polygon].id ? (0, n.jsx)(s.Button, {
                        onClick: () => $(A[x.WAGMI_CHAIN_INDICES.polygon].id),
                        disabled: L,
                        children: "Switch to Polygon"
                    }) : (0, n.jsxs)(s.Button, {
                        onClick: U,
                        disabled: 1 === M,
                        className: "relative disabled:cursor-wait",
                        children: ["Continue", 1 === M && (0, n.jsx)(b, {
                            className: "absolute right-3 size-5 opacity-50"
                        })]
                    })
                })]
            })
        },
        E = function(e) {
            let t, r, s, l, c, u, d, f, p = (0, a.c)(21),
                {
                    forceOpen: h,
                    onClose: m
                } = e,
                y = void 0 === h || h;
            p[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["preventModalClose"], p[0] = t) : t = p[0];
            let {
                preventModalClose: g
            } = (0, o.useAccountContext)(t);
            return p[1] !== m || p[2] !== g ? (r = e => {
                e || g || m()
            }, p[1] = m, p[2] = g, p[3] = r) : r = p[3], p[4] !== m || p[5] !== g ? (s = e => {
                e.preventDefault(), g || m()
            }, l = e => {
                e.preventDefault(), g || m()
            }, c = e => {
                e.preventDefault(), g || m()
            }, p[4] = m, p[5] = g, p[6] = s, p[7] = l, p[8] = c) : (s = p[6], l = p[7], c = p[8]), p[9] !== y || p[10] !== m ? (u = (0, n.jsx)(C, {
                onClose: m,
                forceOpen: y
            }), p[9] = y, p[10] = m, p[11] = u) : u = p[11], p[12] !== s || p[13] !== l || p[14] !== c || p[15] !== u ? (d = (0, n.jsx)(i.ModalContent, {
                onPointerDownOutside: s,
                onInteractOutside: l,
                onEscapeKeyDown: c,
                children: u
            }), p[12] = s, p[13] = l, p[14] = c, p[15] = u, p[16] = d) : d = p[16], p[17] !== y || p[18] !== r || p[19] !== d ? (f = (0, n.jsx)(i.Modal, {
                open: y,
                onOpenChange: r,
                size: "sm",
                children: d
            }), p[17] = y, p[18] = r, p[19] = d, p[20] = f) : f = p[20], f
        }
}, 456262, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(600317),
        n = e.i(221628),
        a = Object.freeze({
            position: "absolute",
            border: 0,
            width: 1,
            height: 1,
            padding: 0,
            margin: -1,
            overflow: "hidden",
            clip: "rect(0, 0, 0, 0)",
            whiteSpace: "nowrap",
            wordWrap: "normal"
        }),
        i = t.forwardRef((e, t) => (0, n.jsx)(r.Primitive.span, { ...e,
            ref: t,
            style: { ...a,
                ...e.style
            }
        }));
    i.displayName = "VisuallyHidden", e.s(["Root", 0, i, "VISUALLY_HIDDEN_STYLES", 0, a, "VisuallyHidden", 0, i])
}, 415142, e => {
    "use strict";
    var t = e.i(456262);
    e.s(["VisuallyHidden", 0, t])
}, 160809, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(149534);
    e.s(["IconChevronLeftOutline18", 0, ({
        strokeWidth: e = 1.5,
        ...n
    }) => t.default.createElement(r.Icon, {
        size: "18px",
        ...n
    }, t.default.createElement("polyline", {
        points: "11.5 15.25 5.25 9 11.5 2.75",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }))])
}, 36964, e => {
    "use strict";
    var t = e.i(690151);
    let r = () => {
            let e = (0, t.detect)();
            return e ? .os ? ? ""
        },
        n = () => r().toLowerCase().includes("ios"),
        a = () => r().toLowerCase().includes("android");
    e.s(["detectBrowser", 0, () => {
        let e = (0, t.detect)();
        return e ? .name ? ? ""
    }, "isAndroid", 0, a, "isIOS", 0, n, "isMobile", 0, () => a() || n()])
}, 651278, e => {
    "use strict";
    e.s(["useLocales", () => l], 651278);
    var t = e.i(221628),
        r = e.i(999061),
        n = e.i(125723),
        a = e.i(416340),
        i = e.i(53950),
        o = e.i(603580);
    let s = {
        connectorsScreen_loginHeading: "Log in",
        connectorsScreen_signupHeading: "Sign up",
        scanScreen_heading: "Connect",
        scanScreen_heading_withConnector: "Scan with {{ CONNECTORNAME }}",
        signInWithEthereumScreen_h1: "Requesting Signature",
        signInWithEthereumScreen_p: "Please sign to connect.",
        signInWithMagicEmail_h1: "Requesting Code",
        signInWithMagicOauth_h1: "Redirecting...",
        signInWithMagicEmail_p: "Enter this code into the email you just received",
        signInWithMagicOauth_p: "Please wait while we redirect you.",
        signIn_rejected_h1: "Request Cancelled",
        signIn_rejected_p: "You cancelled the request. Please try again.",
        signIn_failed_h1: "Connection Failed",
        signIn_failed_p: "Sorry, something went wrong. Please try again.",
        signIn_accountDeleted_h1: "Account Deleted",
        signIn_accountDeleted_p: "This account has been deleted. If you believe this is an error, please contact support.",
        signIn_accountDeleted_helpCenter: "Help Center",
        signIn_notconnected_h1: "Login to {{ CONNECTORNAME }}",
        signIn_notconnected_p: "To continue, please login to your {{ CONNECTORNAME }} extension.",
        signIn_unavailable_h1: "Unsupported Browser",
        signIn_unavailable_p: `To connect your {{ CONNECTORSHORTNAME }} wallet,
install the extension on {{ SUGGESTEDEXTENSIONBROWSER }}.`,
        switchNetworkScreen_heading: "Switch to Polygon",
        injectionScreen_install_h1: "Install {{ CONNECTORNAME }}",
        injectionScreen_install_p: `To connect your {{ CONNECTORSHORTNAME }} wallet,
install the browser extension.`,
        onboardingScreen_createAccount_heading: "Choose a username",
        onboardingScreen_captureEmail_heading: "Add Email",
        connectorNotFound_h1: "Connector not found",
        connectorNotFound_p: "We couldn't find the wallet you selected. Please try again.",
        walletNotFound: "Wallet not found",
        tryAgain: "Try again",
        copyToClipboard: "Copy to Clipboard",
        copyCode: "Copy Code",
        scanTheQRCode: "Scan the QR code",
        useWalletConnectModal: "Use WalletConnect Modal",
        useModal: "Use Modal",
        installTheExtension: "Install the Extension",
        download: "Download",
        or: "Or",
        otherWallets: "Other Wallets",
        moreMethods: "More methods"
    };

    function l(e) {
        let l, c = (0, r.c)(4),
            {
                options: u
            } = (0, o.useSiwxContext)(),
            d = u ? .language ? ? "en-US";
        if (c[0] !== d || c[1] !== e) {
            e: {
                if (!s) {
                    let e;
                    i.logger.error(`Missing translations for: ${d}`), c[3] === Symbol.for("react.memo_cache_sentinel") ? (e = {}, c[3] = e) : e = c[3], l = e;
                    break e
                }
                let r = {};Object.keys(s).forEach(i => {
                    var o, l;
                    let c, u;
                    r[i] = (o = s[i], l = e, u = o, l && Object.keys(l).forEach(e => {
                        u = u.replace(RegExp(`({{ ${e} }})`, "g"), l[e] ? ? "")
                    }), (c = u.split("\n")).map((e, r) => (0, t.jsxs)(a.default.Fragment, {
                        children: [e.split(/(\*\*[^*]*\*\*)/g).map((e, r) => /(\*\*.*\*\*)/g.test(e) ? (0, t.jsx)("strong", {
                            children: e.replace(/\*\*/g, "")
                        }, r) : `${e}`).map(e => "string" == typeof e ? e.split(/(\[WALLETCONNECTLOGO\])/g).map(e => "[WALLETCONNECTLOGO]" === e ? (0, t.jsx)("span", {
                            className: "ck-tt-logo",
                            children: (0, t.jsx)(n.Logos.WalletConnect, {})
                        }, e) : e) : e), r < c.length - 1 && (0, t.jsx)("br", {})]
                    }, r)))
                }),
                l = r
            }
            c[0] = d,
            c[1] = e,
            c[2] = l
        }
        else l = c[2];
        return l
    }
}, 631626, 708596, 318054, 323716, 257656, 670285, 550827, e => {
    "use strict";
    e.s(["default", () => M], 631626);
    var t = e.i(221628),
        r = e.i(999061),
        n = e.i(23128),
        a = e.i(905333),
        i = e.i(219469),
        o = e.i(215959),
        s = e.i(416340),
        l = e.i(827681),
        c = e.i(36964),
        u = e.i(246290),
        d = e.i(449907),
        f = e.i(651278),
        p = e.i(566515),
        h = e.i(863828),
        m = e.i(281932),
        y = e.i(604777),
        g = e.i(631222),
        b = e.i(870555);

    function v(e) {
        let n, a, i, o, s = (0, r.c)(8);
        return s[0] !== e ? ({
            className: n,
            ...a
        } = e, s[0] = e, s[1] = n, s[2] = a) : (n = s[1], a = s[2]), s[3] !== n ? (i = (0, b.cn)("flex w-full flex-col", n), s[3] = n, s[4] = i) : i = s[4], s[5] !== a || s[6] !== i ? (o = (0, t.jsx)("div", {
            className: i,
            ...a
        }), s[5] = a, s[6] = i, s[7] = o) : o = s[7], o
    }

    function x(e) {
        let n, a, i, o, s = (0, r.c)(8);
        return s[0] !== e ? ({
            className: n,
            ...a
        } = e, s[0] = e, s[1] = n, s[2] = a) : (n = s[1], a = s[2]), s[3] !== n ? (i = (0, b.cn)("flex w-full justify-center", n), s[3] = n, s[4] = i) : i = s[4], s[5] !== a || s[6] !== i ? (o = (0, t.jsx)("div", {
            className: i,
            ...a
        }), s[5] = a, s[6] = i, s[7] = o) : o = s[7], o
    }

    function w(e) {
        let n, a, i, o, s = (0, r.c)(8);
        return s[0] !== e ? ({
            className: n,
            ...a
        } = e, s[0] = e, s[1] = n, s[2] = a) : (n = s[1], a = s[2]), s[3] !== n ? (i = (0, b.cn)("flex w-full flex-col items-center gap-2", n), s[3] = n, s[4] = i) : i = s[4], s[5] !== a || s[6] !== i ? (o = (0, t.jsx)("div", {
            className: i,
            ...a
        }), s[5] = a, s[6] = i, s[7] = o) : o = s[7], o
    }

    function _(e) {
        let n, a, i, o, s, l, c = (0, r.c)(12);
        c[0] !== e ? ({
            children: n,
            error: i,
            className: a,
            ...o
        } = e, c[0] = e, c[1] = n, c[2] = a, c[3] = i, c[4] = o) : (n = c[1], a = c[2], i = c[3], o = c[4]);
        let u = i && "text-red-500";
        return c[5] !== a || c[6] !== u ? (s = (0, b.cn)("font-semibold text-xl w-full text-center transition-all duration-75", u, a), c[5] = a, c[6] = u, c[7] = s) : s = c[7], c[8] !== n || c[9] !== o || c[10] !== s ? (l = (0, t.jsx)("p", {
            className: s,
            ...o,
            children: n
        }), c[8] = n, c[9] = o, c[10] = s, c[11] = l) : l = c[11], l
    }

    function C(e) {
        let n, a, i, o, s, l = (0, r.c)(10);
        return l[0] !== e ? ({
            children: n,
            className: a,
            ...i
        } = e, l[0] = e, l[1] = n, l[2] = a, l[3] = i) : (n = l[1], a = l[2], i = l[3]), l[4] !== a ? (o = (0, b.cn)("font-light text-base w-full text-center text-gray-400", a), l[4] = a, l[5] = o) : o = l[5], l[6] !== n || l[7] !== i || l[8] !== o ? (s = (0, t.jsx)("p", {
            className: o,
            ...i,
            children: n
        }), l[6] = n, l[7] = i, l[8] = o, l[9] = s) : s = l[9], s
    }
    v.displayName = "AuthenticationPageContent", x.displayName = "AuthenticationModalBody", w.displayName = "AuthenticationModalContent", _.displayName = "AuthenticationModalH1", C.displayName = "AuthenticationModalP", e.s(["AuthenticationModalBody", 0, x, "AuthenticationModalContent", 0, w, "AuthenticationModalH1", 0, _, "AuthenticationModalP", 0, C, "AuthenticationPageContent", 0, v], 708596);
    let E = e => {
        let n, a, s, l, c, u, d, f = (0, r.c)(14),
            {
                logo: p,
                connecting: h,
                unavailable: m
            } = e,
            y = void 0 === h || h,
            g = void 0 !== m && m;
        f[0] === Symbol.for("react.memo_cache_sentinel") ? (n = {
            duration: .5,
            ease: [.175, .885, .32, .98]
        }, f[0] = n) : n = f[0];
        let b = `z-[4] relative overflow-hidden [&>svg]:z-[3] [&>svg]:relative [&>svg]:block ${g?"!overflow-visible":""}`,
            v = `flex z-[2] absolute overflow-hidden inset-[6px] rounded-[22px] bg-[var(--color-background)] items-center justify-center [&_svg]:pointer-events-none [&_svg]:block [&_svg]:w-[60%] [&_svg]:h-[60%] [&_svg]:max-w-full [&_svg]:max-h-full [&_img]:pointer-events-none [&_img]:block [&_img]:w-full [&_img]:h-full [&_img]:max-w-full [&_img]:max-h-full ${g?"!rounded-none !overflow-visible !z-10":""}`;
        return f[1] !== p || f[2] !== v ? (a = (0, t.jsx)("div", {
            className: v,
            children: p
        }), f[1] = p, f[2] = v, f[3] = a) : a = f[3], f[4] !== y ? (s = y && (0, t.jsx)(o.motion.div, {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1
            },
            exit: {
                opacity: 0,
                transition: {
                    duration: 0
                }
            },
            className: "pointer-events-none select-none z-[1] absolute inset-[-25%] before:content-[''] before:absolute before:inset-0 before:animate-[rotate_1200ms_linear_infinite] before:[background:conic-gradient(from_-90deg,transparent,transparent,transparent,transparent,transparent,black)] dark:before:[background:conic-gradient(from_-90deg,transparent,transparent,transparent,transparent,transparent,white)]"
        }, "Spinner"), f[4] = y, f[5] = s) : s = f[5], f[6] !== s ? (l = (0, t.jsx)("div", {
            className: "absolute inset-[1px] overflow-hidden",
            children: (0, t.jsx)(i.AnimatePresence, {
                children: s
            })
        }), f[6] = s, f[7] = l) : l = f[7], f[8] === Symbol.for("react.memo_cache_sentinel") ? (c = (0, t.jsx)("rect", {
            x: "7.57895",
            y: "7.57895",
            width: "86.8421",
            height: "86.8421",
            rx: "19.2211",
            stroke: "currentColor",
            strokeOpacity: "0.05",
            strokeWidth: "1.15789",
            className: "text-black dark:text-white"
        }), f[8] = c) : c = f[8], f[9] === Symbol.for("react.memo_cache_sentinel") ? (u = (0, t.jsxs)("svg", {
            "aria-hidden": "true",
            width: "102",
            height: "102",
            viewBox: "0 0 102 102",
            fill: "none",
            children: [c, (0, t.jsx)("path", {
                fillRule: "evenodd",
                clipRule: "evenodd",
                d: "M0 0H102V102H0V0ZM7 38.284C7 27.5684 7 22.2106 9.01905 18.0892C10.9522 14.1431 14.1431 10.9522 18.0892 9.01905C22.2106 7 27.5684 7 38.284 7H63.716C74.4316 7 79.7894 7 83.9108 9.01905C87.8569 10.9522 91.0478 14.1431 92.9809 18.0892C95 22.2106 95 27.5684 95 38.284V63.716C95 74.4316 95 79.7894 92.9809 83.9108C91.0478 87.8569 87.8569 91.0478 83.9108 92.9809C79.7894 95 74.4316 95 63.716 95H38.284C27.5684 95 22.2106 95 18.0892 92.9809C14.1431 91.0478 10.9522 87.8569 9.01905 83.9108C7 79.7894 7 74.4316 7 63.716V38.284ZM41.5 0.5H41.4325C34.7246 0.499996 29.6023 0.499994 25.5104 0.823325C21.388 1.14906 18.1839 1.80986 15.3416 3.20227C10.0602 5.78959 5.78959 10.0602 3.20227 15.3416C1.80986 18.1839 1.14906 21.388 0.823325 25.5104C0.499994 29.6023 0.499996 34.7246 0.5 41.4325V41.5V55.5938C0.5 55.6808 0.507407 55.766 0.521624 55.849C0.507407 55.9319 0.5 56.0172 0.5 56.1042V60.5V60.5675C0.499996 67.2754 0.499994 72.3977 0.823325 76.4896C1.14906 80.612 1.80986 83.8161 3.20227 86.6584C5.78959 91.9398 10.0602 96.2104 15.3416 98.7977C18.1839 100.19 21.388 100.851 25.5104 101.177C29.6022 101.5 34.7244 101.5 41.432 101.5H41.4324H41.5H43.4227H60.5H60.5675H60.568C67.2756 101.5 72.3977 101.5 76.4896 101.177C80.612 100.851 83.8161 100.19 86.6584 98.7977C91.9398 96.2104 96.2104 91.9398 98.7977 86.6584C100.19 83.8161 100.851 80.612 101.177 76.4896C101.5 72.3978 101.5 67.2756 101.5 60.568V60.5676V60.5V41.5V41.4324V41.432C101.5 34.7244 101.5 29.6022 101.177 25.5104C100.851 21.388 100.19 18.1839 98.7977 15.3416C96.2104 10.0602 91.9398 5.78959 86.6584 3.20227C83.8161 1.80986 80.612 1.14906 76.4896 0.823325C72.3977 0.499994 67.2754 0.499996 60.5675 0.5H60.5H41.5ZM3.5 56.1042C3.5 56.0172 3.49259 55.9319 3.47838 55.849C3.49259 55.766 3.5 55.6808 3.5 55.5938V41.5C3.5 34.7112 3.50109 29.7068 3.814 25.7467C4.1256 21.8032 4.73946 19.0229 5.89635 16.6614C8.19077 11.9779 11.9779 8.19077 16.6614 5.89635C19.0229 4.73946 21.8032 4.1256 25.7467 3.814C29.7068 3.50109 34.7112 3.5 41.5 3.5H60.5C67.2888 3.5 72.2932 3.50109 76.2533 3.814C80.1968 4.1256 82.977 4.73946 85.3386 5.89635C90.022 8.19077 93.8092 11.9779 96.1036 16.6614C97.2605 19.0229 97.8744 21.8032 98.186 25.7467C98.4989 29.7068 98.5 34.7112 98.5 41.5V60.5C98.5 67.2888 98.4989 72.2932 98.186 76.2533C97.8744 80.1968 97.2605 82.9771 96.1036 85.3386C93.8092 90.022 90.022 93.8092 85.3386 96.1036C82.977 97.2605 80.1968 97.8744 76.2533 98.186C72.2932 98.4989 67.2888 98.5 60.5 98.5H43.4227H41.5C34.7112 98.5 29.7068 98.4989 25.7467 98.186C21.8032 97.8744 19.0229 97.2605 16.6614 96.1036C11.9779 93.8092 8.19077 90.022 5.89635 85.3386C4.73946 82.9771 4.1256 80.1968 3.814 76.2533C3.50109 72.2932 3.5 67.2888 3.5 60.5V56.1042Z",
                style: {
                    fill: "var(--color-background)"
                }
            })]
        }), f[9] = u) : u = f[9], f[10] !== b || f[11] !== a || f[12] !== l ? (d = (0, t.jsxs)(o.motion.div, {
            transition: n,
            className: b,
            children: [a, l, u]
        }), f[10] = b, f[11] = a, f[12] = l, f[13] = d) : d = f[13], d
    };
    e.s(["SquircleSpinner", 0, E], 318054);
    let S = {
        initial: {
            willChange: "transform,opacity",
            position: "relative",
            opacity: 0,
            scale: .95
        },
        animate: {
            position: "relative",
            opacity: 1,
            scale: 1,
            transition: {
                ease: [.16, 1, .3, 1],
                duration: .4,
                delay: 0,
                position: {
                    delay: 0
                }
            }
        },
        exit: {
            position: "absolute",
            opacity: 0,
            scale: .95,
            transition: {
                ease: [.16, 1, .3, 1],
                duration: .3
            }
        }
    };
    e.s(["contentVariants", 0, S], 323716);
    var A = e.i(180715);
    let I = ({
        strokeWidth: e = 1.5,
        ...t
    }) => s.default.createElement(A.Icon, {
        size: "12px",
        ...t
    }, s.default.createElement("polyline", {
        points: "4.25 8.25 1.25 8.25 1.25 11.25",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), s.default.createElement("path", {
        d: "m1.282,8.306c.854,1.743,2.646,2.944,4.718,2.944,2.832,0,5.141-2.243,5.246-5.049",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), s.default.createElement("polyline", {
        points: "7.75 3.75 10.75 3.75 10.75 .75",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }), s.default.createElement("path", {
        d: "m10.718,3.694c-.854-1.743-2.646-2.944-4.718-2.944-2.832,0-5.141,2.243-5.246,5.049",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }));

    function T(e) {
        let n, a, i = (0, r.c)(4);
        return i[0] !== e ? ({ ...n
        } = e, i[0] = e, i[1] = n) : n = i[1], i[2] !== n ? (a = (0, t.jsx)(o.motion.div, {
            className: "flex flex-col gap-[6px] relative left-0 right-0 w-full",
            ...n
        }), i[2] = n, i[3] = a) : a = i[3], a
    }

    function k(e) {
        let n, a, i = (0, r.c)(4);
        return i[0] !== e ? ({ ...n
        } = e, i[0] = e, i[1] = n) : n = i[1], i[2] !== n ? (a = (0, t.jsx)("div", {
            className: "flex w-full flex-col gap-4",
            ...n
        }), i[2] = n, i[3] = a) : a = i[3], a
    }

    function O(e) {
        let n, a, i = (0, r.c)(4);
        return i[0] !== e ? ({ ...n
        } = e, i[0] = e, i[1] = n) : n = i[1], i[2] !== n ? (a = (0, t.jsx)("div", {
            className: "flex items-center justify-center mx-auto h-[140px]",
            ...n
        }), i[2] = n, i[3] = a) : a = i[3], a
    }

    function R(e) {
        let n, a, i, o, s, l = (0, r.c)(8);
        l[0] !== e ? ({
            shake: o,
            circle: n,
            className: a,
            ...i
        } = e, l[0] = e, l[1] = n, l[2] = a, l[3] = i, l[4] = o) : (n = l[1], a = l[2], i = l[3], o = l[4]);
        let c = `
                select-none relative
                before:content-[''] before:absolute before:inset-[1px] before:opacity-0 before:bg-red-500
                ${o?"animate-[shake_220ms_ease-out_both] before:animate-[outline-fade_220ms_ease-out_750ms_both]":""}
                ${n?"before:-inset-[5px] before:rounded-full before:bg-none before:shadow-[inset_0_0_0_3.5px_rgb(239_68_68)]":""}
                ${a||""}
            `;
        return l[5] !== i || l[6] !== c ? (s = (0, t.jsx)("div", {
            className: c,
            ...i
        }), l[5] = i, l[6] = c, l[7] = s) : s = l[7], s
    }

    function N(e) {
        let a, i, o, s = (0, r.c)(5);
        return s[0] !== e ? ({ ...a
        } = e, s[0] = e, s[1] = a) : a = s[1], s[2] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)(I, {
            className: "w-4 h-4"
        }), s[2] = i) : i = s[2], s[3] !== a ? (o = (0, t.jsx)(n.Button, {
            variant: "ghost",
            className: "z-[5] absolute right-[2px] bottom-[2px] p-0 w-8 h-8 rounded-full !bg-button-secondary-bg hover:!bg-button-secondary-bg-hover !border-0",
            ...a,
            children: i
        }), s[3] = a, s[4] = o) : o = s[4], o
    }
    e.s(["IconRefreshClockwiseOutline12", 0, I], 257656), e.s(["ConnectingAnimation", 0, R, "ConnectingContainer", 0, O, "Container", 0, k, "Content", 0, T, "RetryButton", 0, N], 670285);
    let M = e => {
        let b, A, I, M, P, D, j, L, F, U, $, z, B, q, W, Z, V, K, H, G, Q, J, Y, X, ee, et, er = (0, r.c)(97),
            en = (0, y.useTranslations)(),
            {
                connector: ea,
                connectorStatus: ei,
                setConnectorStatus: eo,
                options: es,
                authenticationStatus: el
            } = (0, h.useSiwx)(),
            ec = (0, p.useSignIn)(),
            {
                id: eu
            } = ea,
            ed = (0, m.useWallet)(eu),
            {
                address: ef,
                connector: ep,
                chain: eh
            } = (0, u.useAccount)(),
            {
                connect: em
            } = (0, d.useConnect)(),
            ey = (0, c.detectBrowser)(),
            eg = s.default.useRef(!1),
            eb = ed ? .connector,
            ev = ed ? .isInstalled;
        er[0] !== ef || er[1] !== eh || er[2] !== ep || er[3] !== eb || er[4] !== ev ? (b = {
            address: ef,
            connectedConnector: ep,
            chain: eh,
            selectedConnector: eb,
            walletIsInstalled: ev
        }, er[0] = ef, er[1] = eh, er[2] = ep, er[3] = eb, er[4] = ev, er[5] = b) : b = er[5];
        let ex = s.default.useRef(b);
        er[6] !== em || er[7] !== es.initialChainId || er[8] !== eo || er[9] !== ec ? (A = {
            connect: em,
            initialChainId: es.initialChainId,
            setConnectorStatus: eo,
            signIn: ec
        }, er[6] = em, er[7] = es.initialChainId, er[8] = eo, er[9] = ec, er[10] = A) : A = er[10];
        let ew = s.default.useRef(A);
        er[11] !== ef || er[12] !== eh || er[13] !== ep || er[14] !== ed ? .connector || er[15] !== ed ? .isInstalled ? (I = () => {
            ex.current = {
                address: ef,
                connectedConnector: ep,
                chain: eh,
                selectedConnector: ed ? .connector,
                walletIsInstalled: ed ? .isInstalled
            }
        }, er[11] = ef, er[12] = eh, er[13] = ep, er[14] = ed ? .connector, er[15] = ed ? .isInstalled, er[16] = I) : I = er[16];
        let e_ = ed ? .connector,
            eC = ed ? .isInstalled;
        er[17] !== ef || er[18] !== eh || er[19] !== ep || er[20] !== e_ || er[21] !== eC ? (M = [ef, ep, eh, e_, eC], er[17] = ef, er[18] = eh, er[19] = ep, er[20] = e_, er[21] = eC, er[22] = M) : M = er[22], s.default.useEffect(I, M), er[23] !== em || er[24] !== es.initialChainId || er[25] !== eo || er[26] !== ec ? (D = () => {
            ew.current = {
                connect: em,
                initialChainId: es.initialChainId,
                setConnectorStatus: eo,
                signIn: ec
            }
        }, P = [em, es.initialChainId, eo, ec], er[23] = em, er[24] = es.initialChainId, er[25] = eo, er[26] = ec, er[27] = P, er[28] = D) : (P = er[27], D = er[28]), s.default.useEffect(D, P);
        let eE = ed ? .name,
            eS = ed ? .shortName ? ? ed ? .name,
            eA = ed ? .connectorIcon ? ? ed ? .icon,
            eI = ed ? .iconShouldShrink;
        er[29] !== eE || er[30] !== eS || er[31] !== eA || er[32] !== eI ? (j = {
            name: eE,
            shortName: eS,
            icon: eA,
            iconShape: "squircle",
            iconShouldShrink: eI
        }, er[29] = eE, er[30] = eS, er[31] = eA, er[32] = eI, er[33] = j) : j = er[33];
        let eT = j,
            ek = ed ? .downloadUrls ? .[ey];
        er[34] !== ed ? .downloadUrls ? (L = ed ? .downloadUrls ? {
            name: Object.keys(ed ? .downloadUrls)[0],
            label: Object.keys(ed ? .downloadUrls)[0] ? .charAt(0).toUpperCase() + Object.keys(ed ? .downloadUrls)[0] ? .slice(1),
            url: ed ? .downloadUrls[Object.keys(ed ? .downloadUrls)[0]]
        } : void 0, er[34] = ed ? .downloadUrls, er[35] = L) : L = er[35];
        let eO = L,
            eR = eT.shortName ? ? eT.name,
            eN = eO ? .label ? ? "your browser";
        er[36] !== eR || er[37] !== eN || er[38] !== eT.name ? (F = {
            CONNECTORNAME: eT.name,
            CONNECTORSHORTNAME: eR,
            SUGGESTEDEXTENSIONBROWSER: eN
        }, er[36] = eR, er[37] = eN, er[38] = eT.name, er[39] = F) : F = er[39];
        let eM = (0, f.useLocales)(F);
        er[40] === Symbol.for("react.memo_cache_sentinel") ? (U = () => {
            let {
                address: e,
                connectedConnector: t,
                chain: r
            } = ex.current, {
                signIn: n
            } = ew.current;
            e && t && r && n({
                account: e,
                connector: t,
                chainId: r.id
            })
        }, er[40] = U) : U = er[40];
        let eP = U;
        er[41] === Symbol.for("react.memo_cache_sentinel") ? ($ = () => {
            let {
                address: e,
                connectedConnector: t,
                chain: r,
                selectedConnector: n,
                walletIsInstalled: a
            } = ex.current, {
                connect: i,
                initialChainId: o,
                setConnectorStatus: s,
                signIn: c
            } = ew.current;
            if (!a || !n) return void s(l.ConnectorStates.UNAVAILABLE);
            if (e && t && r && t.id === n.id) {
                s(l.ConnectorStates.CONNECTED), c({
                    account: e,
                    connector: t,
                    chainId: r.id
                });
                return
            }
            i({
                connector: n,
                chainId: o ? ? g.MATIC_CONFIG.chainId
            })
        }, er[41] = $) : $ = er[41];
        let eD = $;
        if (er[42] !== ei || er[43] !== ed ? .connector ? (z = () => {
                let e;
                return eg.current || ei !== l.ConnectorStates.DISCONNECTED && ei !== l.ConnectorStates.RECONNECTING && ei !== l.ConnectorStates.CONNECTING || (e = setTimeout(() => {
                    eg.current = !0, eD()
                }, 600 * !(0, a.isMagicOauthConnector)(ed ? .connector.id))), () => {
                    clearTimeout(e)
                }
            }, er[42] = ei, er[43] = ed ? .connector, er[44] = z) : z = er[44], er[45] !== ei ? (B = [ei, eD], er[45] = ei, er[46] = B) : B = er[46], s.default.useEffect(z, B), !ed) {
            let e, r;
            return er[47] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)(_, {
                children: "Invalid State"
            }), er[47] = e) : e = er[47], er[48] === Symbol.for("react.memo_cache_sentinel") ? (r = (0, t.jsx)(v, {
                children: (0, t.jsxs)(k, {
                    children: [e, (0, t.jsx)(w, {
                        children: (0, t.jsx)("p", {
                            children: "No connectors match the id given. This state should never happen."
                        })
                    })]
                })
            }), er[48] = r) : r = er[48], r
        }
        if ((0, a.isWalletConnectConnector)(ed ? .connector.id)) {
            let e, r;
            return er[49] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)(_, {
                children: "Invalid State"
            }), er[49] = e) : e = er[49], er[50] === Symbol.for("react.memo_cache_sentinel") ? (r = (0, t.jsx)(v, {
                children: (0, t.jsxs)(k, {
                    children: [e, (0, t.jsx)(w, {
                        children: (0, t.jsx)("p", {
                            children: "WalletConnect does not have an injection flow. This state should never happen."
                        })
                    })]
                })
            }), er[50] = r) : r = er[50], r
        }
        let ej = ei === l.ConnectorStates.FAILED || ei === l.ConnectorStates.REJECTED || el === l.AuthenticationStatusStates.ERROR || el === l.AuthenticationStatusStates.REJECTED || el === l.AuthenticationStatusStates.ACCOUNT_DELETED;
        er[51] !== el || er[52] !== ei ? (q = (ei === l.ConnectorStates.FAILED || ei === l.ConnectorStates.REJECTED || ei === l.ConnectorStates.CONNECTED && (el === l.AuthenticationStatusStates.ERROR || el === l.AuthenticationStatusStates.REJECTED)) && (0, t.jsx)(N, {
            "aria-label": "Retry",
            onClick: ei === l.ConnectorStates.FAILED || ei === l.ConnectorStates.REJECTED ? eD : eP
        }), er[51] = el, er[52] = ei, er[53] = q) : q = er[53];
        let eL = ei === l.ConnectorStates.UNAVAILABLE ? 1.14 : 1;
        er[54] !== eL ? (W = {
            scale: eL
        }, er[54] = eL, er[55] = W) : W = er[55];
        let eF = ei === l.ConnectorStates.UNAVAILABLE ? 1.14 : 1;
        er[56] !== eF ? (Z = {
            scale: eF
        }, er[56] = eF, er[57] = Z) : Z = er[57], er[58] === Symbol.for("react.memo_cache_sentinel") ? (V = {
            type: "tween",
            duration: .35,
            ease: [.175, .885, .32, .98]
        }, er[58] = V) : V = er[58], er[59] !== W || er[60] !== Z || er[61] !== eT.icon ? (K = (0, t.jsx)(o.motion.div, {
            initial: W,
            animate: Z,
            transition: V,
            className: "relative w-full h-full flex justify-center items-center",
            children: eT.icon
        }), er[59] = W, er[60] = Z, er[61] = eT.icon, er[62] = K) : K = er[62];
        let eU = ei === l.ConnectorStates.CONNECTING || el === l.AuthenticationStatusStates.PENDING,
            e$ = ei === l.ConnectorStates.UNAVAILABLE;
        return er[63] !== K || er[64] !== eU || er[65] !== e$ ? (H = (0, t.jsx)(E, {
            logo: K,
            connecting: eU,
            unavailable: e$
        }), er[63] = K, er[64] = eU, er[65] = e$, er[66] = H) : H = er[66], er[67] !== ej || er[68] !== q || er[69] !== H ? (G = (0, t.jsx)(O, {
            children: (0, t.jsxs)(R, {
                shake: ej,
                children: [q, H]
            })
        }), er[67] = ej, er[68] = q, er[69] = H, er[70] = G) : G = er[70], er[71] !== ei || er[72] !== eM ? (Q = ei === l.ConnectorStates.FAILED && (0, t.jsx)(T, {
            initial: "initial",
            animate: "animate",
            exit: "exit",
            variants: S,
            transition: {
                type: "spring",
                duration: .3,
                bounce: .25
            },
            children: (0, t.jsxs)(w, {
                children: [(0, t.jsx)(_, {
                    children: eM.signIn_failed_h1
                }), (0, t.jsx)(x, {
                    children: (0, t.jsx)(C, {
                        children: eM.signIn_failed_p
                    })
                })]
            })
        }, l.ConnectorStates.FAILED), er[71] = ei, er[72] = eM, er[73] = Q) : Q = er[73], er[74] !== ei || er[75] !== eM ? (J = ei === l.ConnectorStates.REJECTED && (0, t.jsx)(T, {
            initial: "initial",
            animate: "animate",
            exit: "exit",
            variants: S,
            children: (0, t.jsxs)(w, {
                style: {
                    paddingBottom: 10
                },
                children: [(0, t.jsx)(_, {
                    error: !0,
                    children: eM.signIn_rejected_h1
                }), (0, t.jsx)(x, {
                    children: (0, t.jsx)(C, {
                        children: eM.signIn_rejected_p
                    })
                })]
            })
        }, l.ConnectorStates.REJECTED), er[74] = ei, er[75] = eM, er[76] = J) : J = er[76], er[77] !== el || er[78] !== ei || er[79] !== eM || er[80] !== ed ? (Y = (ei === l.ConnectorStates.DISCONNECTED || ei === l.ConnectorStates.CONNECTING || ei === l.ConnectorStates.CONNECTED) && (0, t.jsx)(T, {
            initial: "initial",
            animate: "animate",
            exit: "exit",
            variants: S,
            children: el === l.AuthenticationStatusStates.ACCOUNT_DELETED ? (0, t.jsxs)(w, {
                style: {
                    paddingBottom: 10
                },
                children: [(0, t.jsx)(_, {
                    error: !0,
                    children: eM.signIn_accountDeleted_h1
                }), (0, t.jsx)(x, {
                    children: (0, t.jsx)(C, {
                        children: eM.signIn_accountDeleted_p
                    })
                }), (0, t.jsx)("a", {
                    href: g.POLYMARKET_HELP_CENTER_LINK,
                    target: "_blank",
                    rel: "noopener noreferrer",
                    className: "mt-2",
                    children: (0, t.jsx)(n.Button, {
                        variant: "outline",
                        size: "sm",
                        children: eM.signIn_accountDeleted_helpCenter
                    })
                })]
            }) : el === l.AuthenticationStatusStates.REJECTED || el === l.AuthenticationStatusStates.ERROR ? (0, t.jsxs)(w, {
                style: {
                    paddingBottom: 10
                },
                children: [(0, t.jsx)(_, {
                    error: !0,
                    children: eM.signIn_rejected_h1
                }), (0, t.jsx)(x, {
                    children: (0, t.jsx)(C, {
                        children: eM.signIn_rejected_p
                    })
                })]
            }) : (0, t.jsxs)(w, {
                style: {
                    paddingBottom: 10
                },
                children: [(0, t.jsx)(_, {
                    children: (0, a.isMagicConnector)(ed.connector.id) ? (0, a.isMagicOauthConnector)(ed.connector.id) ? eM.signInWithMagicOauth_h1 : eM.signInWithMagicEmail_h1 : eM.signInWithEthereumScreen_h1
                }), (0, t.jsx)(x, {
                    children: (0, t.jsx)(C, {
                        children: (0, a.isMagicConnector)(ed.connector.id) ? (0, a.isMagicOauthConnector)(ed.connector.id) ? eM.signInWithMagicOauth_p : eM.signInWithMagicEmail_p : eM.signInWithEthereumScreen_p
                    })
                })]
            })
        }, l.ConnectorStates.CONNECTING), er[77] = el, er[78] = ei, er[79] = eM, er[80] = ed, er[81] = Y) : Y = er[81], er[82] !== ei || er[83] !== ek || er[84] !== eM || er[85] !== eO || er[86] !== en || er[87] !== ed ? (X = ei === l.ConnectorStates.UNAVAILABLE && (0, t.jsx)(T, {
            initial: "initial",
            animate: "animate",
            exit: "exit",
            variants: S,
            children: ek ? (0, t.jsxs)(t.Fragment, {
                children: [(0, t.jsxs)(w, {
                    style: {
                        paddingBottom: 18
                    },
                    children: [(0, t.jsx)(_, {
                        children: eM.injectionScreen_install_h1
                    }), (0, t.jsx)(x, {
                        children: (0, t.jsx)(C, {
                            children: eM.injectionScreen_install_p
                        })
                    })]
                }), !ed.isInstalled && ek && (0, t.jsx)("a", {
                    href: ek,
                    target: "_blank",
                    rel: "noopener noreferrer",
                    children: (0, t.jsx)(n.Button, {
                        variant: "link",
                        className: "text-text-secondary",
                        children: eM.installTheExtension
                    })
                })]
            }) : (0, t.jsxs)(t.Fragment, {
                children: [(0, t.jsxs)(w, {
                    style: {
                        paddingBottom: 12
                    },
                    children: [(0, t.jsx)(_, {
                        children: eM.signIn_unavailable_h1
                    }), (0, t.jsx)(x, {
                        children: (0, t.jsx)(C, {
                            children: eM.signIn_unavailable_p
                        })
                    })]
                }), !ed.isInstalled && eO && (0, t.jsxs)("a", {
                    href: eO ? .url,
                    target: "_blank",
                    rel: "noopener noreferrer",
                    className: "font-medium text-base text-blue-600 no-underline cursor-pointer hover:opacity-90 active:opacity-80",
                    children: [en("auth.installOn"), " ", eO ? .label]
                })]
            })
        }, l.ConnectorStates.UNAVAILABLE), er[82] = ei, er[83] = ek, er[84] = eM, er[85] = eO, er[86] = en, er[87] = ed, er[88] = X) : X = er[88], er[89] !== Q || er[90] !== J || er[91] !== Y || er[92] !== X ? (ee = (0, t.jsx)("div", {
            className: "w-full",
            children: (0, t.jsxs)(i.AnimatePresence, {
                initial: !1,
                mode: "popLayout",
                children: [Q, J, Y, X]
            })
        }), er[89] = Q, er[90] = J, er[91] = Y, er[92] = X, er[93] = ee) : ee = er[93], er[94] !== G || er[95] !== ee ? (et = (0, t.jsx)(v, {
            children: (0, t.jsxs)(k, {
                children: [G, ee]
            })
        }), er[94] = G, er[95] = ee, er[96] = et) : et = er[96], et
    };
    var P = e.i(197994);
    e.s(["IconExternalLinkFill18", 0, ({ ...e
    }) => s.default.createElement(P.Icon, {
        size: "18px",
        ...e
    }, s.default.createElement("path", {
        d: "M12.25,1H6.25c-1.517,0-2.75,1.233-2.75,2.75V13.25c0,.059,.014,.114,.017,.172l5.922-5.922h-2.2c-.414,0-.75-.336-.75-.75s.336-.75,.75-.75h4.01c.414,0,.75,.336,.75,.75v4.01c0,.414-.336,.75-.75,.75s-.75-.336-.75-.75v-2.2l-6.392,6.393c.504,.633,1.272,1.047,2.142,1.047h6c1.517,0,2.75-1.233,2.75-2.75V3.75c0-1.517-1.233-2.75-2.75-2.75Z",
        fill: "currentColor"
    }), s.default.createElement("path", {
        d: "M3.517,13.422l-2.298,2.298c-.293,.293-.293,.768,0,1.061,.146,.146,.338,.22,.53,.22s.384-.073,.53-.22l1.827-1.827c-.34-.427-.554-.953-.59-1.531Z",
        fill: "currentColor",
        "data-color": "color-2"
    }))], 550827)
}, 721747, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(416340);
    e.s(["useCopyToClipboard", 0, function() {
        let e, n, a = (0, t.c)(3),
            [i, o] = (0, r.useState)(null);
        a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = async e => {
            if (!navigator ? .clipboard) return console.warn("Clipboard not supported"), !1;
            try {
                return await navigator.clipboard.writeText(e), o(e), !0
            } catch (e) {
                return console.warn("Copy failed", e), o(null), !1
            }
        }, a[0] = e) : e = a[0];
        let s = e;
        return a[1] !== i ? (n = [i, s], a[1] = i, a[2] = n) : n = a[2], n
    }])
}, 939860, (e, t, r) => {
    t.exports = function() {
        return "function" == typeof Promise && Promise.prototype && Promise.prototype.then
    }
}, 420659, (e, t, r) => {
    let n, a = [0, 26, 44, 70, 100, 134, 172, 196, 242, 292, 346, 404, 466, 532, 581, 655, 733, 815, 901, 991, 1085, 1156, 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185, 2323, 2465, 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706];
    r.getSymbolSize = function(e) {
        if (!e) throw Error('"version" cannot be null or undefined');
        if (e < 1 || e > 40) throw Error('"version" should be in range from 1 to 40');
        return 4 * e + 17
    }, r.getSymbolTotalCodewords = function(e) {
        return a[e]
    }, r.getBCHDigit = function(e) {
        let t = 0;
        for (; 0 !== e;) t++, e >>>= 1;
        return t
    }, r.setToSJISFunction = function(e) {
        if ("function" != typeof e) throw Error('"toSJISFunc" is not a valid function.');
        n = e
    }, r.isKanjiModeEnabled = function() {
        return void 0 !== n
    }, r.toSJIS = function(e) {
        return n(e)
    }
}, 478490, (e, t, r) => {
    r.L = {
        bit: 1
    }, r.M = {
        bit: 0
    }, r.Q = {
        bit: 3
    }, r.H = {
        bit: 2
    }, r.isValid = function(e) {
        return e && void 0 !== e.bit && e.bit >= 0 && e.bit < 4
    }, r.from = function(e, t) {
        if (r.isValid(e)) return e;
        try {
            if ("string" != typeof e) throw Error("Param is not a string");
            switch (e.toLowerCase()) {
                case "l":
                case "low":
                    return r.L;
                case "m":
                case "medium":
                    return r.M;
                case "q":
                case "quartile":
                    return r.Q;
                case "h":
                case "high":
                    return r.H;
                default:
                    throw Error("Unknown EC Level: " + e)
            }
        } catch (e) {
            return t
        }
    }
}, 162685, (e, t, r) => {
    function n() {
        this.buffer = [], this.length = 0
    }
    n.prototype = {
        get: function(e) {
            let t = Math.floor(e / 8);
            return (this.buffer[t] >>> 7 - e % 8 & 1) == 1
        },
        put: function(e, t) {
            for (let r = 0; r < t; r++) this.putBit((e >>> t - r - 1 & 1) == 1)
        },
        getLengthInBits: function() {
            return this.length
        },
        putBit: function(e) {
            let t = Math.floor(this.length / 8);
            this.buffer.length <= t && this.buffer.push(0), e && (this.buffer[t] |= 128 >>> this.length % 8), this.length++
        }
    }, t.exports = n
}, 450550, (e, t, r) => {
    function n(e) {
        if (!e || e < 1) throw Error("BitMatrix size must be defined and greater than 0");
        this.size = e, this.data = new Uint8Array(e * e), this.reservedBit = new Uint8Array(e * e)
    }
    n.prototype.set = function(e, t, r, n) {
        let a = e * this.size + t;
        this.data[a] = r, n && (this.reservedBit[a] = !0)
    }, n.prototype.get = function(e, t) {
        return this.data[e * this.size + t]
    }, n.prototype.xor = function(e, t, r) {
        this.data[e * this.size + t] ^= r
    }, n.prototype.isReserved = function(e, t) {
        return this.reservedBit[e * this.size + t]
    }, t.exports = n
}, 487651, (e, t, r) => {
    let n = e.r(420659).getSymbolSize;
    r.getRowColCoords = function(e) {
        if (1 === e) return [];
        let t = Math.floor(e / 7) + 2,
            r = n(e),
            a = 145 === r ? 26 : 2 * Math.ceil((r - 13) / (2 * t - 2)),
            i = [r - 7];
        for (let e = 1; e < t - 1; e++) i[e] = i[e - 1] - a;
        return i.push(6), i.reverse()
    }, r.getPositions = function(e) {
        let t = [],
            n = r.getRowColCoords(e),
            a = n.length;
        for (let e = 0; e < a; e++)
            for (let r = 0; r < a; r++)(0 !== e || 0 !== r) && (0 !== e || r !== a - 1) && (e !== a - 1 || 0 !== r) && t.push([n[e], n[r]]);
        return t
    }
}, 94816, (e, t, r) => {
    let n = e.r(420659).getSymbolSize;
    r.getPositions = function(e) {
        let t = n(e);
        return [
            [0, 0],
            [t - 7, 0],
            [0, t - 7]
        ]
    }
}, 564141, (e, t, r) => {
    r.Patterns = {
        PATTERN000: 0,
        PATTERN001: 1,
        PATTERN010: 2,
        PATTERN011: 3,
        PATTERN100: 4,
        PATTERN101: 5,
        PATTERN110: 6,
        PATTERN111: 7
    };
    r.isValid = function(e) {
        return null != e && "" !== e && !isNaN(e) && e >= 0 && e <= 7
    }, r.from = function(e) {
        return r.isValid(e) ? parseInt(e, 10) : void 0
    }, r.getPenaltyN1 = function(e) {
        let t = e.size,
            r = 0,
            n = 0,
            a = 0,
            i = null,
            o = null;
        for (let s = 0; s < t; s++) {
            n = a = 0, i = o = null;
            for (let l = 0; l < t; l++) {
                let t = e.get(s, l);
                t === i ? n++ : (n >= 5 && (r += 3 + (n - 5)), i = t, n = 1), (t = e.get(l, s)) === o ? a++ : (a >= 5 && (r += 3 + (a - 5)), o = t, a = 1)
            }
            n >= 5 && (r += 3 + (n - 5)), a >= 5 && (r += 3 + (a - 5))
        }
        return r
    }, r.getPenaltyN2 = function(e) {
        let t = e.size,
            r = 0;
        for (let n = 0; n < t - 1; n++)
            for (let a = 0; a < t - 1; a++) {
                let t = e.get(n, a) + e.get(n, a + 1) + e.get(n + 1, a) + e.get(n + 1, a + 1);
                (4 === t || 0 === t) && r++
            }
        return 3 * r
    }, r.getPenaltyN3 = function(e) {
        let t = e.size,
            r = 0,
            n = 0,
            a = 0;
        for (let i = 0; i < t; i++) {
            n = a = 0;
            for (let o = 0; o < t; o++) n = n << 1 & 2047 | e.get(i, o), o >= 10 && (1488 === n || 93 === n) && r++, a = a << 1 & 2047 | e.get(o, i), o >= 10 && (1488 === a || 93 === a) && r++
        }
        return 40 * r
    }, r.getPenaltyN4 = function(e) {
        let t = 0,
            r = e.data.length;
        for (let n = 0; n < r; n++) t += e.data[n];
        return 10 * Math.abs(Math.ceil(100 * t / r / 5) - 10)
    }, r.applyMask = function(e, t) {
        let n = t.size;
        for (let a = 0; a < n; a++)
            for (let i = 0; i < n; i++) t.isReserved(i, a) || t.xor(i, a, function(e, t, n) {
                switch (e) {
                    case r.Patterns.PATTERN000:
                        return (t + n) % 2 == 0;
                    case r.Patterns.PATTERN001:
                        return t % 2 == 0;
                    case r.Patterns.PATTERN010:
                        return n % 3 == 0;
                    case r.Patterns.PATTERN011:
                        return (t + n) % 3 == 0;
                    case r.Patterns.PATTERN100:
                        return (Math.floor(t / 2) + Math.floor(n / 3)) % 2 == 0;
                    case r.Patterns.PATTERN101:
                        return t * n % 2 + t * n % 3 == 0;
                    case r.Patterns.PATTERN110:
                        return (t * n % 2 + t * n % 3) % 2 == 0;
                    case r.Patterns.PATTERN111:
                        return (t * n % 3 + (t + n) % 2) % 2 == 0;
                    default:
                        throw Error("bad maskPattern:" + e)
                }
            }(e, i, a))
    }, r.getBestMask = function(e, t) {
        let n = Object.keys(r.Patterns).length,
            a = 0,
            i = 1 / 0;
        for (let o = 0; o < n; o++) {
            t(o), r.applyMask(o, e);
            let n = r.getPenaltyN1(e) + r.getPenaltyN2(e) + r.getPenaltyN3(e) + r.getPenaltyN4(e);
            r.applyMask(o, e), n < i && (i = n, a = o)
        }
        return a
    }
}, 56418, (e, t, r) => {
    let n = e.r(478490),
        a = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 4, 1, 2, 4, 4, 2, 4, 4, 4, 2, 4, 6, 5, 2, 4, 6, 6, 2, 5, 8, 8, 4, 5, 8, 8, 4, 5, 8, 11, 4, 8, 10, 11, 4, 9, 12, 16, 4, 9, 16, 16, 6, 10, 12, 18, 6, 10, 17, 16, 6, 11, 16, 19, 6, 13, 18, 21, 7, 14, 21, 25, 8, 16, 20, 25, 8, 17, 23, 25, 9, 17, 23, 34, 9, 18, 25, 30, 10, 20, 27, 32, 12, 21, 29, 35, 12, 23, 34, 37, 12, 25, 34, 40, 13, 26, 35, 42, 14, 28, 38, 45, 15, 29, 40, 48, 16, 31, 43, 51, 17, 33, 45, 54, 18, 35, 48, 57, 19, 37, 51, 60, 19, 38, 53, 63, 20, 40, 56, 66, 21, 43, 59, 70, 22, 45, 62, 74, 24, 47, 65, 77, 25, 49, 68, 81],
        i = [7, 10, 13, 17, 10, 16, 22, 28, 15, 26, 36, 44, 20, 36, 52, 64, 26, 48, 72, 88, 36, 64, 96, 112, 40, 72, 108, 130, 48, 88, 132, 156, 60, 110, 160, 192, 72, 130, 192, 224, 80, 150, 224, 264, 96, 176, 260, 308, 104, 198, 288, 352, 120, 216, 320, 384, 132, 240, 360, 432, 144, 280, 408, 480, 168, 308, 448, 532, 180, 338, 504, 588, 196, 364, 546, 650, 224, 416, 600, 700, 224, 442, 644, 750, 252, 476, 690, 816, 270, 504, 750, 900, 300, 560, 810, 960, 312, 588, 870, 1050, 336, 644, 952, 1110, 360, 700, 1020, 1200, 390, 728, 1050, 1260, 420, 784, 1140, 1350, 450, 812, 1200, 1440, 480, 868, 1290, 1530, 510, 924, 1350, 1620, 540, 980, 1440, 1710, 570, 1036, 1530, 1800, 570, 1064, 1590, 1890, 600, 1120, 1680, 1980, 630, 1204, 1770, 2100, 660, 1260, 1860, 2220, 720, 1316, 1950, 2310, 750, 1372, 2040, 2430];
    r.getBlocksCount = function(e, t) {
        switch (t) {
            case n.L:
                return a[(e - 1) * 4 + 0];
            case n.M:
                return a[(e - 1) * 4 + 1];
            case n.Q:
                return a[(e - 1) * 4 + 2];
            case n.H:
                return a[(e - 1) * 4 + 3];
            default:
                return
        }
    }, r.getTotalCodewordsCount = function(e, t) {
        switch (t) {
            case n.L:
                return i[(e - 1) * 4 + 0];
            case n.M:
                return i[(e - 1) * 4 + 1];
            case n.Q:
                return i[(e - 1) * 4 + 2];
            case n.H:
                return i[(e - 1) * 4 + 3];
            default:
                return
        }
    }
}, 488982, (e, t, r) => {
    let n = new Uint8Array(512),
        a = new Uint8Array(256),
        i = 1;
    for (let e = 0; e < 255; e++) n[e] = i, a[i] = e, 256 & (i <<= 1) && (i ^= 285);
    for (let e = 255; e < 512; e++) n[e] = n[e - 255];
    r.log = function(e) {
        if (e < 1) throw Error("log(" + e + ")");
        return a[e]
    }, r.exp = function(e) {
        return n[e]
    }, r.mul = function(e, t) {
        return 0 === e || 0 === t ? 0 : n[a[e] + a[t]]
    }
}, 911821, (e, t, r) => {
    let n = e.r(488982);
    r.mul = function(e, t) {
        let r = new Uint8Array(e.length + t.length - 1);
        for (let a = 0; a < e.length; a++)
            for (let i = 0; i < t.length; i++) r[a + i] ^= n.mul(e[a], t[i]);
        return r
    }, r.mod = function(e, t) {
        let r = new Uint8Array(e);
        for (; r.length - t.length >= 0;) {
            let e = r[0];
            for (let a = 0; a < t.length; a++) r[a] ^= n.mul(t[a], e);
            let a = 0;
            for (; a < r.length && 0 === r[a];) a++;
            r = r.slice(a)
        }
        return r
    }, r.generateECPolynomial = function(e) {
        let t = new Uint8Array([1]);
        for (let a = 0; a < e; a++) t = r.mul(t, new Uint8Array([1, n.exp(a)]));
        return t
    }
}, 202927, (e, t, r) => {
    let n = e.r(911821);

    function a(e) {
        this.genPoly = void 0, this.degree = e, this.degree && this.initialize(this.degree)
    }
    a.prototype.initialize = function(e) {
        this.degree = e, this.genPoly = n.generateECPolynomial(this.degree)
    }, a.prototype.encode = function(e) {
        if (!this.genPoly) throw Error("Encoder not initialized");
        let t = new Uint8Array(e.length + this.degree);
        t.set(e);
        let r = n.mod(t, this.genPoly),
            a = this.degree - r.length;
        if (a > 0) {
            let e = new Uint8Array(this.degree);
            return e.set(r, a), e
        }
        return r
    }, t.exports = a
}, 152203, (e, t, r) => {
    r.isValid = function(e) {
        return !isNaN(e) && e >= 1 && e <= 40
    }
}, 95450, (e, t, r) => {
    let n = "[0-9]+",
        a = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",
        i = "(?:(?![A-Z0-9 $%*+\\-./:]|" + (a = a.replace(/u/g, "\\u")) + ")(?:.|[\r\n]))+";
    r.KANJI = RegExp(a, "g"), r.BYTE_KANJI = RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), r.BYTE = RegExp(i, "g"), r.NUMERIC = RegExp(n, "g"), r.ALPHANUMERIC = RegExp("[A-Z $%*+\\-./:]+", "g");
    let o = RegExp("^" + a + "$"),
        s = RegExp("^" + n + "$"),
        l = RegExp("^[A-Z0-9 $%*+\\-./:]+$");
    r.testKanji = function(e) {
        return o.test(e)
    }, r.testNumeric = function(e) {
        return s.test(e)
    }, r.testAlphanumeric = function(e) {
        return l.test(e)
    }
}, 919050, (e, t, r) => {
    let n = e.r(152203),
        a = e.r(95450);
    r.NUMERIC = {
        id: "Numeric",
        bit: 1,
        ccBits: [10, 12, 14]
    }, r.ALPHANUMERIC = {
        id: "Alphanumeric",
        bit: 2,
        ccBits: [9, 11, 13]
    }, r.BYTE = {
        id: "Byte",
        bit: 4,
        ccBits: [8, 16, 16]
    }, r.KANJI = {
        id: "Kanji",
        bit: 8,
        ccBits: [8, 10, 12]
    }, r.MIXED = {
        bit: -1
    }, r.getCharCountIndicator = function(e, t) {
        if (!e.ccBits) throw Error("Invalid mode: " + e);
        if (!n.isValid(t)) throw Error("Invalid version: " + t);
        return t >= 1 && t < 10 ? e.ccBits[0] : t < 27 ? e.ccBits[1] : e.ccBits[2]
    }, r.getBestModeForData = function(e) {
        return a.testNumeric(e) ? r.NUMERIC : a.testAlphanumeric(e) ? r.ALPHANUMERIC : a.testKanji(e) ? r.KANJI : r.BYTE
    }, r.toString = function(e) {
        if (e && e.id) return e.id;
        throw Error("Invalid mode")
    }, r.isValid = function(e) {
        return e && e.bit && e.ccBits
    }, r.from = function(e, t) {
        if (r.isValid(e)) return e;
        try {
            if ("string" != typeof e) throw Error("Param is not a string");
            switch (e.toLowerCase()) {
                case "numeric":
                    return r.NUMERIC;
                case "alphanumeric":
                    return r.ALPHANUMERIC;
                case "kanji":
                    return r.KANJI;
                case "byte":
                    return r.BYTE;
                default:
                    throw Error("Unknown mode: " + e)
            }
        } catch (e) {
            return t
        }
    }
}, 391049, (e, t, r) => {
    let n = e.r(420659),
        a = e.r(56418),
        i = e.r(478490),
        o = e.r(919050),
        s = e.r(152203),
        l = n.getBCHDigit(7973);

    function c(e, t) {
        return o.getCharCountIndicator(e, t) + 4
    }
    r.from = function(e, t) {
        return s.isValid(e) ? parseInt(e, 10) : t
    }, r.getCapacity = function(e, t, r) {
        if (!s.isValid(e)) throw Error("Invalid QR Code version");
        void 0 === r && (r = o.BYTE);
        let i = (n.getSymbolTotalCodewords(e) - a.getTotalCodewordsCount(e, t)) * 8;
        if (r === o.MIXED) return i;
        let l = i - c(r, e);
        switch (r) {
            case o.NUMERIC:
                return Math.floor(l / 10 * 3);
            case o.ALPHANUMERIC:
                return Math.floor(l / 11 * 2);
            case o.KANJI:
                return Math.floor(l / 13);
            case o.BYTE:
            default:
                return Math.floor(l / 8)
        }
    }, r.getBestVersionForData = function(e, t) {
        let n, a = i.from(t, i.M);
        if (Array.isArray(e)) {
            if (e.length > 1) {
                for (let t = 1; t <= 40; t++)
                    if (function(e, t) {
                            let r = 0;
                            return e.forEach(function(e) {
                                let n = c(e.mode, t);
                                r += n + e.getBitsLength()
                            }), r
                        }(e, t) <= r.getCapacity(t, a, o.MIXED)) return t;
                return
            }
            if (0 === e.length) return 1;
            n = e[0]
        } else n = e;
        return function(e, t, n) {
            for (let a = 1; a <= 40; a++)
                if (t <= r.getCapacity(a, n, e)) return a
        }(n.mode, n.getLength(), a)
    }, r.getEncodedBits = function(e) {
        if (!s.isValid(e) || e < 7) throw Error("Invalid QR Code version");
        let t = e << 12;
        for (; n.getBCHDigit(t) - l >= 0;) t ^= 7973 << n.getBCHDigit(t) - l;
        return e << 12 | t
    }
}, 602710, (e, t, r) => {
    let n = e.r(420659),
        a = n.getBCHDigit(1335);
    r.getEncodedBits = function(e, t) {
        let r = e.bit << 3 | t,
            i = r << 10;
        for (; n.getBCHDigit(i) - a >= 0;) i ^= 1335 << n.getBCHDigit(i) - a;
        return (r << 10 | i) ^ 21522
    }
}, 39230, (e, t, r) => {
    let n = e.r(919050);

    function a(e) {
        this.mode = n.NUMERIC, this.data = e.toString()
    }
    a.getBitsLength = function(e) {
        return 10 * Math.floor(e / 3) + (e % 3 ? e % 3 * 3 + 1 : 0)
    }, a.prototype.getLength = function() {
        return this.data.length
    }, a.prototype.getBitsLength = function() {
        return a.getBitsLength(this.data.length)
    }, a.prototype.write = function(e) {
        let t, r;
        for (t = 0; t + 3 <= this.data.length; t += 3) r = parseInt(this.data.substr(t, 3), 10), e.put(r, 10);
        let n = this.data.length - t;
        n > 0 && (r = parseInt(this.data.substr(t), 10), e.put(r, 3 * n + 1))
    }, t.exports = a
}, 652661, (e, t, r) => {
    let n = e.r(919050),
        a = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", " ", "$", "%", "*", "+", "-", ".", "/", ":"];

    function i(e) {
        this.mode = n.ALPHANUMERIC, this.data = e
    }
    i.getBitsLength = function(e) {
        return 11 * Math.floor(e / 2) + e % 2 * 6
    }, i.prototype.getLength = function() {
        return this.data.length
    }, i.prototype.getBitsLength = function() {
        return i.getBitsLength(this.data.length)
    }, i.prototype.write = function(e) {
        let t;
        for (t = 0; t + 2 <= this.data.length; t += 2) {
            let r = 45 * a.indexOf(this.data[t]);
            r += a.indexOf(this.data[t + 1]), e.put(r, 11)
        }
        this.data.length % 2 && e.put(a.indexOf(this.data[t]), 6)
    }, t.exports = i
}, 842576, (e, t, r) => {
    let n = e.r(919050);

    function a(e) {
        this.mode = n.BYTE, "string" == typeof e ? this.data = new TextEncoder().encode(e) : this.data = new Uint8Array(e)
    }
    a.getBitsLength = function(e) {
        return 8 * e
    }, a.prototype.getLength = function() {
        return this.data.length
    }, a.prototype.getBitsLength = function() {
        return a.getBitsLength(this.data.length)
    }, a.prototype.write = function(e) {
        for (let t = 0, r = this.data.length; t < r; t++) e.put(this.data[t], 8)
    }, t.exports = a
}, 185236, (e, t, r) => {
    let n = e.r(919050),
        a = e.r(420659);

    function i(e) {
        this.mode = n.KANJI, this.data = e
    }
    i.getBitsLength = function(e) {
        return 13 * e
    }, i.prototype.getLength = function() {
        return this.data.length
    }, i.prototype.getBitsLength = function() {
        return i.getBitsLength(this.data.length)
    }, i.prototype.write = function(e) {
        let t;
        for (t = 0; t < this.data.length; t++) {
            let r = a.toSJIS(this.data[t]);
            if (r >= 33088 && r <= 40956) r -= 33088;
            else if (r >= 57408 && r <= 60351) r -= 49472;
            else throw Error("Invalid SJIS character: " + this.data[t] + "\nMake sure your charset is UTF-8");
            r = (r >>> 8 & 255) * 192 + (255 & r), e.put(r, 13)
        }
    }, t.exports = i
}, 9911, (e, t, r) => {
    let n = e.r(919050),
        a = e.r(39230),
        i = e.r(652661),
        o = e.r(842576),
        s = e.r(185236),
        l = e.r(95450),
        c = e.r(420659),
        u = e.r(906328);

    function d(e) {
        return unescape(encodeURIComponent(e)).length
    }

    function f(e, t, r) {
        let n, a = [];
        for (; null !== (n = e.exec(r));) a.push({
            data: n[0],
            index: n.index,
            mode: t,
            length: n[0].length
        });
        return a
    }

    function p(e) {
        let t, r, a = f(l.NUMERIC, n.NUMERIC, e),
            i = f(l.ALPHANUMERIC, n.ALPHANUMERIC, e);
        return c.isKanjiModeEnabled() ? (t = f(l.BYTE, n.BYTE, e), r = f(l.KANJI, n.KANJI, e)) : (t = f(l.BYTE_KANJI, n.BYTE, e), r = []), a.concat(i, t, r).sort(function(e, t) {
            return e.index - t.index
        }).map(function(e) {
            return {
                data: e.data,
                mode: e.mode,
                length: e.length
            }
        })
    }

    function h(e, t) {
        switch (t) {
            case n.NUMERIC:
                return a.getBitsLength(e);
            case n.ALPHANUMERIC:
                return i.getBitsLength(e);
            case n.KANJI:
                return s.getBitsLength(e);
            case n.BYTE:
                return o.getBitsLength(e)
        }
    }

    function m(e, t) {
        let r, l = n.getBestModeForData(e);
        if ((r = n.from(t, l)) !== n.BYTE && r.bit < l.bit) throw Error('"' + e + '" cannot be encoded with mode ' + n.toString(r) + ".\n Suggested mode is: " + n.toString(l));
        switch (r === n.KANJI && !c.isKanjiModeEnabled() && (r = n.BYTE), r) {
            case n.NUMERIC:
                return new a(e);
            case n.ALPHANUMERIC:
                return new i(e);
            case n.KANJI:
                return new s(e);
            case n.BYTE:
                return new o(e)
        }
    }
    r.fromArray = function(e) {
        return e.reduce(function(e, t) {
            return "string" == typeof t ? e.push(m(t, null)) : t.data && e.push(m(t.data, t.mode)), e
        }, [])
    }, r.fromString = function(e, t) {
        let a = function(e, t) {
                let r = {},
                    a = {
                        start: {}
                    },
                    i = ["start"];
                for (let o = 0; o < e.length; o++) {
                    let s = e[o],
                        l = [];
                    for (let e = 0; e < s.length; e++) {
                        let c = s[e],
                            u = "" + o + e;
                        l.push(u), r[u] = {
                            node: c,
                            lastCount: 0
                        }, a[u] = {};
                        for (let e = 0; e < i.length; e++) {
                            let o = i[e];
                            r[o] && r[o].node.mode === c.mode ? (a[o][u] = h(r[o].lastCount + c.length, c.mode) - h(r[o].lastCount, c.mode), r[o].lastCount += c.length) : (r[o] && (r[o].lastCount = c.length), a[o][u] = h(c.length, c.mode) + 4 + n.getCharCountIndicator(c.mode, t))
                        }
                    }
                    i = l
                }
                for (let e = 0; e < i.length; e++) a[i[e]].end = 0;
                return {
                    map: a,
                    table: r
                }
            }(function(e) {
                let t = [];
                for (let r = 0; r < e.length; r++) {
                    let a = e[r];
                    switch (a.mode) {
                        case n.NUMERIC:
                            t.push([a, {
                                data: a.data,
                                mode: n.ALPHANUMERIC,
                                length: a.length
                            }, {
                                data: a.data,
                                mode: n.BYTE,
                                length: a.length
                            }]);
                            break;
                        case n.ALPHANUMERIC:
                            t.push([a, {
                                data: a.data,
                                mode: n.BYTE,
                                length: a.length
                            }]);
                            break;
                        case n.KANJI:
                            t.push([a, {
                                data: a.data,
                                mode: n.BYTE,
                                length: d(a.data)
                            }]);
                            break;
                        case n.BYTE:
                            t.push([{
                                data: a.data,
                                mode: n.BYTE,
                                length: d(a.data)
                            }])
                    }
                }
                return t
            }(p(e, c.isKanjiModeEnabled())), t),
            i = u.find_path(a.map, "start", "end"),
            o = [];
        for (let e = 1; e < i.length - 1; e++) o.push(a.table[i[e]].node);
        return r.fromArray(o.reduce(function(e, t) {
            let r = e.length - 1 >= 0 ? e[e.length - 1] : null;
            return r && r.mode === t.mode ? e[e.length - 1].data += t.data : e.push(t), e
        }, []))
    }, r.rawSplit = function(e) {
        return r.fromArray(p(e, c.isKanjiModeEnabled()))
    }
}, 363650, (e, t, r) => {
    let n = e.r(420659),
        a = e.r(478490),
        i = e.r(162685),
        o = e.r(450550),
        s = e.r(487651),
        l = e.r(94816),
        c = e.r(564141),
        u = e.r(56418),
        d = e.r(202927),
        f = e.r(391049),
        p = e.r(602710),
        h = e.r(919050),
        m = e.r(9911);

    function y(e, t, r) {
        let n, a, i = e.size,
            o = p.getEncodedBits(t, r);
        for (n = 0; n < 15; n++) a = (o >> n & 1) == 1, n < 6 ? e.set(n, 8, a, !0) : n < 8 ? e.set(n + 1, 8, a, !0) : e.set(i - 15 + n, 8, a, !0), n < 8 ? e.set(8, i - n - 1, a, !0) : n < 9 ? e.set(8, 15 - n - 1 + 1, a, !0) : e.set(8, 15 - n - 1, a, !0);
        e.set(i - 8, 8, 1, !0)
    }
    r.create = function(e, t) {
        let r, p;
        if (void 0 === e || "" === e) throw Error("No input text");
        let g = a.M;
        return void 0 !== t && (g = a.from(t.errorCorrectionLevel, a.M), r = f.from(t.version), p = c.from(t.maskPattern), t.toSJISFunc && n.setToSJISFunction(t.toSJISFunc)),
            function(e, t, r, a) {
                let p;
                if (Array.isArray(e)) p = m.fromArray(e);
                else if ("string" == typeof e) {
                    let n = t;
                    if (!n) {
                        let t = m.rawSplit(e);
                        n = f.getBestVersionForData(t, r)
                    }
                    p = m.fromString(e, n || 40)
                } else throw Error("Invalid data");
                let g = f.getBestVersionForData(p, r);
                if (!g) throw Error("The amount of data is too big to be stored in a QR Code");
                if (t) {
                    if (t < g) throw Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: " + g + ".\n")
                } else t = g;
                let b = function(e, t, r) {
                        let a = new i;
                        r.forEach(function(t) {
                            a.put(t.mode.bit, 4), a.put(t.getLength(), h.getCharCountIndicator(t.mode, e)), t.write(a)
                        });
                        let o = (n.getSymbolTotalCodewords(e) - u.getTotalCodewordsCount(e, t)) * 8;
                        for (a.getLengthInBits() + 4 <= o && a.put(0, 4); a.getLengthInBits() % 8 != 0;) a.putBit(0);
                        let s = (o - a.getLengthInBits()) / 8;
                        for (let e = 0; e < s; e++) a.put(e % 2 ? 17 : 236, 8);
                        return function(e, t, r) {
                            let a, i, o = n.getSymbolTotalCodewords(t),
                                s = o - u.getTotalCodewordsCount(t, r),
                                l = u.getBlocksCount(t, r),
                                c = o % l,
                                f = l - c,
                                p = Math.floor(o / l),
                                h = Math.floor(s / l),
                                m = h + 1,
                                y = p - h,
                                g = new d(y),
                                b = 0,
                                v = Array(l),
                                x = Array(l),
                                w = 0,
                                _ = new Uint8Array(e.buffer);
                            for (let e = 0; e < l; e++) {
                                let t = e < f ? h : m;
                                v[e] = _.slice(b, b + t), x[e] = g.encode(v[e]), b += t, w = Math.max(w, t)
                            }
                            let C = new Uint8Array(o),
                                E = 0;
                            for (a = 0; a < w; a++)
                                for (i = 0; i < l; i++) a < v[i].length && (C[E++] = v[i][a]);
                            for (a = 0; a < y; a++)
                                for (i = 0; i < l; i++) C[E++] = x[i][a];
                            return C
                        }(a, e, t)
                    }(t, r, p),
                    v = new o(n.getSymbolSize(t));
                ! function(e, t) {
                    let r = e.size,
                        n = l.getPositions(t);
                    for (let t = 0; t < n.length; t++) {
                        let a = n[t][0],
                            i = n[t][1];
                        for (let t = -1; t <= 7; t++)
                            if (!(a + t <= -1) && !(r <= a + t))
                                for (let n = -1; n <= 7; n++) i + n <= -1 || r <= i + n || (t >= 0 && t <= 6 && (0 === n || 6 === n) || n >= 0 && n <= 6 && (0 === t || 6 === t) || t >= 2 && t <= 4 && n >= 2 && n <= 4 ? e.set(a + t, i + n, !0, !0) : e.set(a + t, i + n, !1, !0))
                    }
                }(v, t);
                let x = v.size;
                for (let e = 8; e < x - 8; e++) {
                    let t = e % 2 == 0;
                    v.set(e, 6, t, !0), v.set(6, e, t, !0)
                }
                return ! function(e, t) {
                    let r = s.getPositions(t);
                    for (let t = 0; t < r.length; t++) {
                        let n = r[t][0],
                            a = r[t][1];
                        for (let t = -2; t <= 2; t++)
                            for (let r = -2; r <= 2; r++) - 2 === t || 2 === t || -2 === r || 2 === r || 0 === t && 0 === r ? e.set(n + t, a + r, !0, !0) : e.set(n + t, a + r, !1, !0)
                    }
                }(v, t), y(v, r, 0), t >= 7 && function(e, t) {
                    let r, n, a, i = e.size,
                        o = f.getEncodedBits(t);
                    for (let t = 0; t < 18; t++) r = Math.floor(t / 3), n = t % 3 + i - 8 - 3, a = (o >> t & 1) == 1, e.set(r, n, a, !0), e.set(n, r, a, !0)
                }(v, t), ! function(e, t) {
                    let r = e.size,
                        n = -1,
                        a = r - 1,
                        i = 7,
                        o = 0;
                    for (let s = r - 1; s > 0; s -= 2)
                        for (6 === s && s--;;) {
                            for (let r = 0; r < 2; r++)
                                if (!e.isReserved(a, s - r)) {
                                    let n = !1;
                                    o < t.length && (n = (t[o] >>> i & 1) == 1), e.set(a, s - r, n), -1 == --i && (o++, i = 7)
                                }
                            if ((a += n) < 0 || r <= a) {
                                a -= n, n = -n;
                                break
                            }
                        }
                }(v, b), isNaN(a) && (a = c.getBestMask(v, y.bind(null, v, r))), c.applyMask(a, v), y(v, r, a), {
                    modules: v,
                    version: t,
                    errorCorrectionLevel: r,
                    maskPattern: a,
                    segments: p
                }
            }(e, r, g, p)
    }
}, 149614, (e, t, r) => {
    function n(e) {
        if ("number" == typeof e && (e = e.toString()), "string" != typeof e) throw Error("Color should be defined as hex string");
        let t = e.slice().replace("#", "").split("");
        if (t.length < 3 || 5 === t.length || t.length > 8) throw Error("Invalid hex color: " + e);
        (3 === t.length || 4 === t.length) && (t = Array.prototype.concat.apply([], t.map(function(e) {
            return [e, e]
        }))), 6 === t.length && t.push("F", "F");
        let r = parseInt(t.join(""), 16);
        return {
            r: r >> 24 & 255,
            g: r >> 16 & 255,
            b: r >> 8 & 255,
            a: 255 & r,
            hex: "#" + t.slice(0, 6).join("")
        }
    }
    r.getOptions = function(e) {
        e || (e = {}), e.color || (e.color = {});
        let t = void 0 === e.margin || null === e.margin || e.margin < 0 ? 4 : e.margin,
            r = e.width && e.width >= 21 ? e.width : void 0,
            a = e.scale || 4;
        return {
            width: r,
            scale: r ? 4 : a,
            margin: t,
            color: {
                dark: n(e.color.dark || "#000000ff"),
                light: n(e.color.light || "#ffffffff")
            },
            type: e.type,
            rendererOpts: e.rendererOpts || {}
        }
    }, r.getScale = function(e, t) {
        return t.width && t.width >= e + 2 * t.margin ? t.width / (e + 2 * t.margin) : t.scale
    }, r.getImageWidth = function(e, t) {
        let n = r.getScale(e, t);
        return Math.floor((e + 2 * t.margin) * n)
    }, r.qrToImageData = function(e, t, n) {
        let a = t.modules.size,
            i = t.modules.data,
            o = r.getScale(a, n),
            s = Math.floor((a + 2 * n.margin) * o),
            l = n.margin * o,
            c = [n.color.light, n.color.dark];
        for (let t = 0; t < s; t++)
            for (let r = 0; r < s; r++) {
                let u = (t * s + r) * 4,
                    d = n.color.light;
                t >= l && r >= l && t < s - l && r < s - l && (d = c[+!!i[Math.floor((t - l) / o) * a + Math.floor((r - l) / o)]]), e[u++] = d.r, e[u++] = d.g, e[u++] = d.b, e[u] = d.a
            }
    }
}, 53003, (e, t, r) => {
    let n = e.r(149614);
    r.render = function(e, t, r) {
        var a;
        let i = r,
            o = t;
        void 0 !== i || t && t.getContext || (i = t, t = void 0), t || (o = function() {
            try {
                return document.createElement("canvas")
            } catch (e) {
                throw Error("You need to specify a canvas element")
            }
        }()), i = n.getOptions(i);
        let s = n.getImageWidth(e.modules.size, i),
            l = o.getContext("2d"),
            c = l.createImageData(s, s);
        return n.qrToImageData(c.data, e, i), a = o, l.clearRect(0, 0, a.width, a.height), a.style || (a.style = {}), a.height = s, a.width = s, a.style.height = s + "px", a.style.width = s + "px", l.putImageData(c, 0, 0), o
    }, r.renderToDataURL = function(e, t, n) {
        let a = n;
        void 0 !== a || t && t.getContext || (a = t, t = void 0), a || (a = {});
        let i = r.render(e, t, a),
            o = a.type || "image/png",
            s = a.rendererOpts || {};
        return i.toDataURL(o, s.quality)
    }
}, 148807, (e, t, r) => {
    let n = e.r(149614);

    function a(e, t) {
        let r = e.a / 255,
            n = t + '="' + e.hex + '"';
        return r < 1 ? n + " " + t + '-opacity="' + r.toFixed(2).slice(1) + '"' : n
    }

    function i(e, t, r) {
        let n = e + t;
        return void 0 !== r && (n += " " + r), n
    }
    r.render = function(e, t, r) {
        let o = n.getOptions(t),
            s = e.modules.size,
            l = e.modules.data,
            c = s + 2 * o.margin,
            u = o.color.light.a ? "<path " + a(o.color.light, "fill") + ' d="M0 0h' + c + "v" + c + 'H0z"/>' : "",
            d = "<path " + a(o.color.dark, "stroke") + ' d="' + function(e, t, r) {
                let n = "",
                    a = 0,
                    o = !1,
                    s = 0;
                for (let l = 0; l < e.length; l++) {
                    let c = Math.floor(l % t),
                        u = Math.floor(l / t);
                    c || o || (o = !0), e[l] ? (s++, l > 0 && c > 0 && e[l - 1] || (n += o ? i("M", c + r, .5 + u + r) : i("m", a, 0), a = 0, o = !1), c + 1 < t && e[l + 1] || (n += i("h", s), s = 0)) : a++
                }
                return n
            }(l, s, o.margin) + '"/>',
            f = '<svg xmlns="http://www.w3.org/2000/svg" ' + (o.width ? 'width="' + o.width + '" height="' + o.width + '" ' : "") + ('viewBox="0 0 ' + c + " ") + c + '" shape-rendering="crispEdges">' + u + d + "</svg>\n";
        return "function" == typeof r && r(null, f), f
    }
}, 514960, (e, t, r) => {
    let n = e.r(939860),
        a = e.r(363650),
        i = e.r(53003),
        o = e.r(148807);

    function s(e, t, r, i, o) {
        let s = [].slice.call(arguments, 1),
            l = s.length,
            c = "function" == typeof s[l - 1];
        if (!c && !n()) throw Error("Callback required as last argument");
        if (c) {
            if (l < 2) throw Error("Too few arguments provided");
            2 === l ? (o = r, r = t, t = i = void 0) : 3 === l && (t.getContext && void 0 === o ? (o = i, i = void 0) : (o = i, i = r, r = t, t = void 0))
        } else {
            if (l < 1) throw Error("Too few arguments provided");
            return 1 === l ? (r = t, t = i = void 0) : 2 !== l || t.getContext || (i = r, r = t, t = void 0), new Promise(function(n, o) {
                try {
                    let o = a.create(r, i);
                    n(e(o, t, i))
                } catch (e) {
                    o(e)
                }
            })
        }
        try {
            let n = a.create(r, i);
            o(null, e(n, t, i))
        } catch (e) {
            o(e)
        }
    }
    r.create = a.create, r.toCanvas = s.bind(null, i.render), r.toDataURL = s.bind(null, i.renderToDataURL), r.toString = s.bind(null, function(e, t, r) {
        return o.render(e, r)
    })
}, 674542, 670118, 889029, 922445, 632567, 499107, e => {
    "use strict";
    let t, r;
    e.s(["Connect", () => U], 674542);
    var n, a, i, o, s, l = e.i(221628),
        c = e.i(999061),
        u = e.i(23128),
        d = e.i(219469),
        f = e.i(215959),
        p = e.i(416340),
        h = e.i(827681),
        m = e.i(246290),
        y = e.i(651278),
        g = e.i(863828),
        b = e.i(281932),
        v = e.i(631626),
        x = e.i(905333),
        w = e.i(550827),
        _ = e.i(805949),
        C = e.i(36964),
        E = e.i(269639),
        S = e.i(721747),
        A = e.i(53950),
        I = e.i(631222),
        T = e.i(708596),
        k = e.i(514960);
    let O = e => {
            let t, r, n, a, i = (0, c.c)(35),
                {
                    ecl: o,
                    size: s,
                    uri: u,
                    clearArea: d,
                    image: f,
                    imageBackground: p
                } = e,
                h = void 0 === o ? "M" : o,
                m = void 0 === p ? "transparent" : p,
                y = 76 * !!(void 0 !== d && d),
                g = (void 0 === s ? 200 : s) - 20;
            if (i[0] !== h || i[1] !== f || i[2] !== m || i[3] !== y || i[4] !== g || i[5] !== u) {
                let e, r;
                t = [];
                let n = (r = Math.sqrt((e = Array.prototype.slice.call(k.default.create(u, {
                        errorCorrectionLevel: h
                    }).modules.data, 0)).length), e.reduce((e, t, n) => (n % r == 0 ? e.push([t]) : e[e.length - 1].push(t)) && e, [])),
                    a = g / n.length;
                if ([{
                        x: 0,
                        y: 0
                    }, {
                        x: 1,
                        y: 0
                    }, {
                        x: 0,
                        y: 1
                    }].forEach(e => {
                        let {
                            x: r,
                            y: i
                        } = e, o = (n.length - 7) * a * r, s = (n.length - 7) * a * i;
                        for (let e = 0; e < 3; e++) t.push((0, l.jsx)("rect", {
                            rx: -((e - 2) * 5) + (0 === e ? 2 : 3),
                            ry: -((e - 2) * 5) + (0 === e ? 2 : 3),
                            width: a * (7 - 2 * e),
                            height: a * (7 - 2 * e),
                            x: o + a * e,
                            y: s + a * e,
                            fill: e % 2 != 0 ? "var(--color-background)" : "currentColor",
                            className: e % 2 == 0 ? "text-black dark:text-white" : ""
                        }, `${e}-${r}-${i}`))
                    }), f) {
                    let e, r, o, s, c, u = (n.length - 7) * a * 1,
                        d = (n.length - 7) * a * 1,
                        p = 7 * a,
                        h = 7 * a;
                    i[7] !== m || i[8] !== p || i[9] !== h || i[10] !== u || i[11] !== d ? (e = (0, l.jsx)("rect", {
                        fill: m,
                        rx: 12,
                        ry: 12,
                        width: p,
                        height: h,
                        x: u,
                        y: d
                    }), i[7] = m, i[8] = p, i[9] = h, i[10] = u, i[11] = d, i[12] = e) : e = i[12];
                    let y = 7 * a,
                        g = 7 * a;
                    i[13] === Symbol.for("react.memo_cache_sentinel") ? (r = {
                        borderRadius: 12,
                        overflow: "hidden"
                    }, i[13] = r) : r = i[13], i[14] !== f ? (o = (0, l.jsx)("div", {
                        style: r,
                        children: f
                    }), i[14] = f, i[15] = o) : o = i[15], i[16] !== g || i[17] !== o || i[18] !== y || i[19] !== u || i[20] !== d ? (s = (0, l.jsx)("foreignObject", {
                        width: y,
                        height: g,
                        x: u,
                        y: d,
                        children: o
                    }), i[16] = g, i[17] = o, i[18] = y, i[19] = u, i[20] = d, i[21] = s) : s = i[21], i[22] !== s || i[23] !== e ? (c = (0, l.jsxs)(l.Fragment, {
                        children: [e, s]
                    }), i[22] = s, i[23] = e, i[24] = c) : c = i[24], t.push(c)
                }
                let o = Math.floor((y + 25) / a),
                    s = n.length / 2 - o / 2,
                    c = n.length / 2 + o / 2 - 1;
                n.forEach((e, r) => {
                    e.forEach((e, i) => {
                        n[r][i] && !(r < 7 && i < 7 || r > n.length - 8 && i < 7 || r < 7 && i > n.length - 8) && (f || !(r > s && r < c && i > s && i < c)) && t.push((0, l.jsx)("circle", {
                            cx: r * a + a / 2,
                            cy: i * a + a / 2,
                            r: a / 3,
                            fill: "currentColor",
                            className: "text-black dark:text-white"
                        }, `circle-${r}-${i}`))
                    })
                }), i[0] = h, i[1] = f, i[2] = m, i[3] = y, i[4] = g, i[5] = u, i[6] = t
            } else t = i[6];
            let b = t,
                v = `0 0 ${g} ${g}`;
            return i[25] !== g ? (r = {
                width: g,
                height: g
            }, i[25] = g, i[26] = r) : r = i[26], i[27] !== g ? (n = (0, l.jsx)("rect", {
                fill: "transparent",
                height: g,
                width: g
            }), i[27] = g, i[28] = n) : n = i[28], i[29] !== b || i[30] !== g || i[31] !== v || i[32] !== r || i[33] !== n ? (a = (0, l.jsxs)("svg", {
                height: g,
                width: g,
                viewBox: v,
                style: r,
                className: "text-black dark:text-white",
                children: [n, b]
            }), i[29] = b, i[30] = g, i[31] = v, i[32] = r, i[33] = n, i[34] = a) : a = i[34], a
        },
        R = e => {
            let t, r, n, a = (0, c.c)(8),
                {
                    value: i,
                    image: o
                } = e;
            return a[0] !== o ? (t = o && (0, l.jsx)("div", {
                className: "z-[6] absolute top-0 left-0 w-full h-full",
                style: {
                    transform: "translateY(50%) scale(0.9999)"
                },
                children: (0, l.jsx)("div", {
                    className: "z-[6] absolute left-1/2 overflow-hidden w-[28%] h-[28%] rounded-[17px] [&_svg]:block [&_svg]:relative [&_svg]:w-full [&_svg]:h-full before:pointer-events-none before:z-[2] before:content-[''] before:absolute before:inset-0 before:rounded-[inherit] before:shadow-[inset_0_0_0_1px_rgba(0,0,0,0.02)]",
                    style: {
                        transform: "translate(-50%, -50%) scale(0.9999)"
                    },
                    children: o
                })
            }), a[0] = o, a[1] = t) : t = a[1], a[2] !== o || a[3] !== i ? (r = (0, l.jsx)(d.AnimatePresence, {
                initial: !1,
                children: i ? (0, l.jsx)(f.motion.div, {
                    initial: {
                        opacity: 0
                    },
                    animate: {
                        opacity: 1
                    },
                    exit: {
                        opacity: 0,
                        position: "absolute",
                        inset: [0, 0]
                    },
                    transition: {
                        duration: .2
                    },
                    children: (0, l.jsx)(O, {
                        uri: i,
                        size: 288,
                        ecl: "M",
                        clearArea: !!o
                    })
                }, i) : (0, l.jsxs)(f.motion.div, {
                    initial: {
                        opacity: .1
                    },
                    animate: {
                        opacity: .1
                    },
                    exit: {
                        opacity: 0,
                        position: "absolute",
                        inset: [0, 0]
                    },
                    transition: {
                        duration: .2
                    },
                    className: "absolute inset-0 flex items-center justify-center",
                    style: {
                        "--qr-color": "var(--color-text)",
                        "--qr-bg": "var(--color-background)"
                    },
                    children: [(0, l.jsx)("span", {
                        className: "z-[4] absolute top-0 left-0 bg-[var(--qr-color)] rounded-xl w-[13.25%] h-[13.25%] shadow-[0_0_0_4px_var(--qr-bg)] before:content-[''] before:absolute before:inset-[9px] before:rounded-[3px] before:shadow-[0_0_0_4px_var(--qr-bg)]"
                    }), (0, l.jsx)("span", {
                        className: "z-[4] absolute top-0 right-0 bg-[var(--qr-color)] rounded-xl w-[13.25%] h-[13.25%] shadow-[0_0_0_4px_var(--qr-bg)] before:content-[''] before:absolute before:inset-[9px] before:rounded-[3px] before:shadow-[0_0_0_4px_var(--qr-bg)]"
                    }), (0, l.jsx)("span", {
                        className: "z-[4] absolute bottom-0 left-0 bg-[var(--qr-color)] rounded-xl w-[13.25%] h-[13.25%] shadow-[0_0_0_4px_var(--qr-bg)] before:content-[''] before:absolute before:inset-[9px] before:rounded-[3px] before:shadow-[0_0_0_4px_var(--qr-bg)]"
                    }), (0, l.jsx)("div", {
                        className: "z-[4] relative w-[28%] h-[28%] rounded-[20px] bg-[var(--qr-bg)] shadow-[0_0_0_7px_var(--qr-bg)]"
                    }), (0, l.jsx)("div", {
                        className: "z-[3] absolute inset-0 pointer-events-none",
                        style: {
                            background: "radial-gradient(var(--qr-color) 41%, transparent 41%)",
                            backgroundSize: "1.888% 1.888%"
                        }
                    }), (0, l.jsx)("div", {
                        className: "z-[5] absolute inset-0 pointer-events-none animate-[placeholder-shimmer_1000ms_linear_infinite_both]",
                        style: {
                            transform: "scale(1.5) rotate(45deg)",
                            backgroundImage: "linear-gradient(90deg, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))",
                            backgroundSize: "200% 100%"
                        }
                    })]
                })
            }), a[2] = o, a[3] = i, a[4] = r) : r = a[4], a[5] !== t || a[6] !== r ? (n = (0, l.jsx)("div", {
                className: "w-[400px] h-[400px] min-h-[400px] max-[600px]:w-[calc(100vw-32px)] max-[600px]:h-[calc(100vw-32px)] max-[600px]:min-h-[calc(100vw-32px)] z-[3] relative overflow-hidden !pb-[100%] flex items-center justify-center my-px mb-[2px] rounded-xl bg-transparent [backface-visibility:hidden] [&_svg]:block [&_svg]:w-full [&_svg]:min-h-full [&_svg]:h-full",
                children: (0, l.jsxs)("div", {
                    className: "absolute inset-[13px] [&_svg]:!w-full [&_svg]:!h-full",
                    children: [t, r]
                })
            }), a[5] = t, a[6] = r, a[7] = n) : n = a[7], n
        };
    R.displayName = "CustomQrCode";
    var N = e.i(318054),
        M = e.i(323716),
        P = e.i(670285);
    let D = e => {
            let t, r, n, a, i, o, s, d, f, m, v, k = (0, c.c)(55),
                {
                    connector: O,
                    options: D,
                    connectorStatus: j,
                    authenticationStatus: L,
                    signIn: F,
                    getUri: U
                } = (0, g.useSiwx)(),
                {
                    openW3M: $,
                    isOpenW3M: z
                } = (0, E.useWalletConnectModal)(),
                {
                    address: B,
                    connector: q
                } = (0, _.useConnection)(),
                [, W] = (0, S.useCopyToClipboard)(),
                [Z, V] = p.default.useState(void 0);
            k[0] !== O.coercedConnector ? .id || k[1] !== O.id || k[2] !== O.name || k[3] !== U ? (t = () => {
                A.logger.info("[connect-with-qr-code] getUri invoked for QR flow", {
                    connectorId: O.id,
                    connectorName: O.name,
                    coercedConnectorId: O.coercedConnector ? .id
                }), U().then(e => {
                    V(e)
                })
            }, k[0] = O.coercedConnector ? .id, k[1] = O.id, k[2] = O.name, k[3] = U, k[4] = t) : t = k[4];
            let K = O.coercedConnector ? .id;
            k[5] !== O.id || k[6] !== O.name || k[7] !== U || k[8] !== K ? (r = [U, O.id, O.name, K], k[5] = O.id, k[6] = O.name, k[7] = U, k[8] = K, k[9] = r) : r = k[9], p.default.useEffect(t, r);
            let {
                id: H
            } = O;
            k[10] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, C.isMobile)(), k[10] = n) : n = k[10];
            let G = n,
                Q = (0, C.detectBrowser)(),
                J = (0, b.useWallet)(O.id),
                Y = (0, b.useWallet)(O.coercedConnector ? .id ? ? ""),
                X = J ? .downloadUrls ? .[Q];
            k[11] !== J ? .downloadUrls ? (a = J ? .downloadUrls ? {
                name: Object.keys(J ? .downloadUrls)[0],
                label: Object.keys(J ? .downloadUrls)[0] ? .charAt(0).toUpperCase() + Object.keys(J ? .downloadUrls)[0] ? .slice(1),
                url: J ? .downloadUrls[Object.keys(J ? .downloadUrls)[0]]
            } : void 0, k[11] = J ? .downloadUrls, k[12] = a) : a = k[12];
            let ee = a,
                et = G && Y && !Y.isInstalled ? Y.name : J ? .name,
                er = ee ? .label ? ? "your browser";
            k[13] !== et || k[14] !== er ? (i = {
                CONNECTORNAME: et,
                SUGGESTEDEXTENSIONBROWSER: er
            }, k[13] = et, k[14] = er, k[15] = i) : i = k[15];
            let en = (0, y.useLocales)(i);
            if (!J) {
                let e;
                return k[16] !== O.id || k[17] !== en.walletNotFound ? (e = (0, l.jsxs)(l.Fragment, {
                    children: [en.walletNotFound, " ", O.id]
                }), k[16] = O.id, k[17] = en.walletNotFound, k[18] = e) : e = k[18], e
            }
            if (!J ? .getWalletConnectDeeplink) {
                let e, t;
                k[19] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, l.jsx)(T.AuthenticationModalH1, {
                    children: "Invalid State"
                }), k[19] = e) : e = k[19];
                let r = J ? .name;
                return k[20] !== r ? (t = (0, l.jsxs)(T.AuthenticationPageContent, {
                    children: [e, (0, l.jsx)(T.AuthenticationModalContent, {
                        children: (0, l.jsxs)("p", {
                            children: [r, " does not have it's own QR Code to scan. This state should never happen"]
                        })
                    })]
                }), k[20] = r, k[21] = t) : t = k[21], t
            }
            k[22] !== H ? (o = (0, x.isWalletConnectConnector)(H), k[22] = H, k[23] = o) : o = k[23];
            let ea = o;
            return k[24] !== B || k[25] !== L || k[26] !== Y || k[27] !== q || k[28] !== j || k[29] !== D || k[30] !== F || k[31] !== J ? (s = j === h.ConnectorStates.CONNECTED && (0, l.jsx)(P.ConnectingContainer, {
                children: (0, l.jsxs)(P.ConnectingAnimation, {
                    shake: L === h.AuthenticationStatusStates.ERROR || L === h.AuthenticationStatusStates.REJECTED || L === h.AuthenticationStatusStates.ACCOUNT_DELETED,
                    children: [(L === h.AuthenticationStatusStates.ERROR || L === h.AuthenticationStatusStates.REJECTED) && !!B && !!q && (0, l.jsx)(P.RetryButton, {
                        "aria-label": "Retry",
                        onClick: () => F({
                            account: B,
                            connector: q,
                            chainId: D.initialChainId ? ? I.MATIC_CONFIG.chainId
                        })
                    }), (0, l.jsx)(N.SquircleSpinner, {
                        logo: (0, l.jsx)("div", {
                            className: "relative w-full h-full flex justify-center items-center",
                            children: Y && !Y.isInstalled && Y.icon ? Y.icon : J.icon
                        }),
                        connecting: L === h.AuthenticationStatusStates.PENDING,
                        unavailable: !1
                    })]
                })
            }), k[24] = B, k[25] = L, k[26] = Y, k[27] = q, k[28] = j, k[29] = D, k[30] = F, k[31] = J, k[32] = s) : s = k[32], k[33] !== L || k[34] !== j || k[35] !== en ? (d = j === h.ConnectorStates.CONNECTED && (0, l.jsx)(P.Content, {
                initial: "initial",
                animate: "animate",
                exit: "exit",
                variants: M.contentVariants,
                children: L === h.AuthenticationStatusStates.ACCOUNT_DELETED ? (0, l.jsxs)(T.AuthenticationModalContent, {
                    className: "pb-[10px]",
                    children: [(0, l.jsx)(T.AuthenticationModalH1, {
                        error: !0,
                        children: en.signIn_accountDeleted_h1
                    }), (0, l.jsx)(T.AuthenticationModalBody, {
                        children: (0, l.jsx)(T.AuthenticationModalP, {
                            children: en.signIn_accountDeleted_p
                        })
                    }), (0, l.jsx)("a", {
                        href: I.POLYMARKET_HELP_CENTER_LINK,
                        target: "_blank",
                        rel: "noopener noreferrer",
                        className: "mt-2",
                        children: (0, l.jsx)(u.Button, {
                            variant: "outline",
                            size: "sm",
                            children: en.signIn_accountDeleted_helpCenter
                        })
                    })]
                }) : (0, l.jsxs)(T.AuthenticationModalContent, {
                    className: "pb-[10px]",
                    children: [(0, l.jsx)(T.AuthenticationModalH1, {
                        children: en.signInWithEthereumScreen_h1
                    }), (0, l.jsx)(T.AuthenticationModalBody, {
                        children: (0, l.jsx)(T.AuthenticationModalP, {
                            children: en.signInWithEthereumScreen_p
                        })
                    })]
                })
            }, h.ConnectorStates.CONNECTING), k[33] = L, k[34] = j, k[35] = en, k[36] = d) : d = k[36], k[37] !== j || k[38] !== W || k[39] !== X || k[40] !== z || k[41] !== en || k[42] !== $ || k[43] !== D ? .walletConnectCTA || k[44] !== ea || k[45] !== ee || k[46] !== J ? .icon || k[47] !== Z ? (f = j !== h.ConnectorStates.CONNECTED && !G && (0, l.jsxs)(l.Fragment, {
                children: [(0, l.jsx)(R, {
                    value: Z,
                    image: J ? .icon
                }), ea && (0, l.jsxs)(l.Fragment, {
                    children: [(0, l.jsxs)("div", {
                        className: "flex w-full items-center mt-4 mb-2 px-4",
                        children: [(0, l.jsx)("div", {
                            className: "flex-1 h-px bg-border"
                        }), (0, l.jsx)("span", {
                            className: "px-4 text-base font-light text-text-secondary",
                            children: en.or
                        }), (0, l.jsx)("div", {
                            className: "flex-1 h-px bg-border"
                        })]
                    }), (0, l.jsxs)("div", {
                        className: "flex items-center justify-center gap-4 mt-3",
                        children: [D ? .walletConnectCTA !== "modal" && (0, l.jsx)(u.Button, {
                            variant: "ghost",
                            className: "h-9 px-4 text-text-primary whitespace-nowrap max-sm:text-sm",
                            onClick: () => W(Z ? ? ""),
                            children: D ? .walletConnectCTA === "link" ? en.copyToClipboard : en.copyCode
                        }), D ? .walletConnectCTA !== "link" && (0, l.jsxs)(u.Button, {
                            onClick: $,
                            disabled: z,
                            variant: "ghost",
                            className: "flex items-center h-9 px-4 text-text-primary whitespace-nowrap gap-2 max-sm:text-sm",
                            children: [(0, l.jsx)("span", {
                                children: D ? .walletConnectCTA === "modal" ? en.useWalletConnectModal : en.useModal
                            }), (0, l.jsx)(w.IconExternalLinkFill18, {
                                className: "w-4 h-4 fill-current"
                            })]
                        })]
                    })]
                }), !ea && (X || ee) && (0, l.jsxs)("div", {
                    className: "flex w-full justify-center",
                    children: [!ea && X && (0, l.jsx)("a", {
                        href: X,
                        target: "_blank",
                        rel: "noopener noreferrer",
                        children: (0, l.jsxs)(u.Button, {
                            variant: "ghost",
                            className: "flex items-center h-9 px-4 text-text-primary whitespace-nowrap gap-2 max-sm:text-sm",
                            children: [(0, l.jsx)("span", {
                                children: en.installTheExtension
                            }), (0, l.jsx)(w.IconExternalLinkFill18, {
                                className: "w-4 h-4 fill-current"
                            })]
                        })
                    }), !ea && ee && !X && (0, l.jsx)("a", {
                        href: ee.url,
                        target: "_blank",
                        rel: "noopener noreferrer",
                        children: (0, l.jsxs)(u.Button, {
                            variant: "ghost",
                            className: "flex items-center h-9 px-4 text-text-primary whitespace-nowrap gap-2 max-sm:text-sm",
                            children: [(0, l.jsx)("span", {
                                children: en.download
                            }), (0, l.jsx)(w.IconExternalLinkFill18, {
                                className: "w-4 h-4 fill-current"
                            })]
                        })
                    })]
                })]
            }), k[37] = j, k[38] = W, k[39] = X, k[40] = z, k[41] = en, k[42] = $, k[43] = D ? .walletConnectCTA, k[44] = ea, k[45] = ee, k[46] = J ? .icon, k[47] = Z, k[48] = f) : f = k[48], k[49] !== d || k[50] !== f ? (m = (0, l.jsxs)(T.AuthenticationModalContent, {
                className: "pb-2 gap-0",
                children: [d, f]
            }), k[49] = d, k[50] = f, k[51] = m) : m = k[51], k[52] !== s || k[53] !== m ? (v = (0, l.jsx)(T.AuthenticationPageContent, {
                children: (0, l.jsxs)(P.Container, {
                    children: [s, m]
                })
            }), k[52] = s, k[53] = m, k[54] = v) : v = k[54], v
        },
        j = "qrcode",
        L = "injector",
        F = {
            initial: {
                zIndex: 2,
                opacity: 0
            },
            animate: {
                opacity: 1,
                scale: 1,
                transition: {
                    duration: .165,
                    delay: .055,
                    ease: [.26, .08, .25, 1]
                }
            },
            exit: {
                zIndex: 1,
                opacity: 0,
                pointerEvents: "none",
                position: "absolute",
                left: ["50%", "50%"],
                x: ["-50%", "-50%"],
                transition: {
                    duration: .22,
                    ease: [.26, .08, .25, 1]
                }
            }
        };

    function U(e) {
        let t, r, n, a, i, o, s, x, w = (0, c.c)(36);
        w[0] !== e ? ({ ...t
        } = e, w[0] = e, w[1] = t) : t = w[1];
        let {
            connector: _,
            triggerResize: C,
            setRoute: E
        } = (0, g.useSiwx)(), S = (0, y.useLocales)(), A = (0, b.useWallet)(_.id), {
            isConnected: I
        } = (0, m.useAccount)(), T = !A ? .isInstalled && A ? .getWalletConnectDeeplink, [k, O] = p.default.useState(T ? j : L);
        w[2] !== I || w[3] !== C ? (r = () => {
            I && C()
        }, n = [I, C], w[2] = I, w[3] = C, w[4] = r, w[5] = n) : (r = w[4], n = w[5]), p.default.useEffect(r, n), w[6] !== k || w[7] !== A ? .connector ? (a = () => {
            let e = async () => {
                await A ? .connector.getProvider() || O(j)
            };
            k === L && e()
        }, w[6] = k, w[7] = A ? .connector, w[8] = a) : a = w[8];
        let R = _ ? .coercedConnector;
        if (w[9] !== k || w[10] !== R ? (i = [k, L, R, O, j], w[9] = k, w[10] = R, w[11] = i) : i = w[11], p.default.useEffect(a, i), !A) {
            let e, t, r, n, a, i;
            return w[12] !== S.connectorNotFound_h1 ? (e = (0, l.jsx)("p", {
                className: "text-base font-semibold text-text",
                children: S.connectorNotFound_h1
            }), w[12] = S.connectorNotFound_h1, w[13] = e) : e = w[13], w[14] !== S.connectorNotFound_p ? (t = (0, l.jsx)("p", {
                className: "text-sm text-text-secondary",
                children: S.connectorNotFound_p
            }), w[14] = S.connectorNotFound_p, w[15] = t) : t = w[15], w[16] !== e || w[17] !== t ? (r = (0, l.jsxs)("div", {
                className: "flex flex-col items-center gap-1 text-center",
                children: [e, t]
            }), w[16] = e, w[17] = t, w[18] = r) : r = w[18], w[19] !== E ? (n = () => E(h.AuthRoute.CONNECTORS), w[19] = E, w[20] = n) : n = w[20], w[21] !== S.tryAgain || w[22] !== n ? (a = (0, l.jsx)(u.Button, {
                variant: "outline",
                size: "sm",
                onClick: n,
                children: S.tryAgain
            }), w[21] = S.tryAgain, w[22] = n, w[23] = a) : a = w[23], w[24] !== a || w[25] !== r ? (i = (0, l.jsxs)("div", {
                className: "flex flex-col items-center gap-4 py-8 px-4",
                children: [r, a]
            }), w[24] = a, w[25] = r, w[26] = i) : i = w[26], i
        }
        return w[27] !== t || w[28] !== k ? (o = k === j && (0, l.jsx)(f.motion.div, {
            initial: "initial",
            animate: "animate",
            exit: "exit",
            variants: F,
            className: "w-full h-fit",
            ...t,
            children: (0, l.jsx)(D, {
                switchConnectMethod: e => {
                    O(L)
                }
            })
        }, j), w[27] = t, w[28] = k, w[29] = o) : o = w[29], w[30] !== t || w[31] !== k ? (s = k === L && (0, l.jsx)(f.motion.div, {
            initial: "initial",
            animate: "animate",
            exit: "exit",
            variants: F,
            className: "w-full h-fit",
            ...t,
            children: (0, l.jsx)(v.default, {
                switchConnectMethod: e => {
                    O(j)
                }
            })
        }, L), w[30] = t, w[31] = k, w[32] = s) : s = w[32], w[33] !== o || w[34] !== s ? (x = (0, l.jsxs)(d.AnimatePresence, {
            mode: "sync",
            children: [o, s]
        }), w[33] = o, w[34] = s, w[35] = x) : x = w[35], x
    }
    e.s(["Connectors", () => tK], 499107);
    var $ = e.i(604777);
    let z = () => {
        let e, t, r, n, a, i = (0, c.c)(8),
            o = (0, $.useTranslations)();
        return i[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, l.jsx)("div", {
            className: "flex-1 h-px bg-border"
        }), i[0] = e) : e = i[0], i[1] !== o ? (t = o("auth.or"), i[1] = o, i[2] = t) : t = i[2], i[3] !== t ? (r = (0, l.jsx)("span", {
            className: "text-sm font-medium text-text-secondary",
            children: t
        }), i[3] = t, i[4] = r) : r = i[4], i[5] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, l.jsx)("div", {
            className: "flex-1 h-px bg-border"
        }), i[5] = n) : n = i[5], i[6] !== r ? (a = (0, l.jsxs)("div", {
            className: "flex w-full justify-center items-center my-1 gap-4",
            children: [e, r, n]
        }), i[6] = r, i[7] = a) : a = i[7], a
    };

    function B(e) {
        let t, r, n, a, i, o, s = (0, c.c)(13),
            u = (0, $.useTranslations)();
        return s[0] !== u ? (t = u("auth.terms"), s[0] = u, s[1] = t) : t = s[1], s[2] !== t ? (r = (0, l.jsx)("a", {
            href: "/tos",
            target: "_blank",
            rel: "noopener noreferrer",
            className: "text-text-secondary text-xs font-medium transition-colors duration-200 hover:text-text-tertiary",
            children: t
        }), s[2] = t, s[3] = r) : r = s[3], s[4] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, l.jsx)("span", {
            className: "select-none text-text-secondary text-xs",
            children: "•"
        }), s[4] = n) : n = s[4], s[5] !== u ? (a = u("auth.privacy"), s[5] = u, s[6] = a) : a = s[6], s[7] !== a ? (i = (0, l.jsx)("a", {
            href: "/privacy",
            target: "_blank",
            rel: "noopener noreferrer",
            className: "text-text-secondary text-xs font-medium transition-colors duration-200 hover:text-text-tertiary",
            children: a
        }), s[7] = a, s[8] = i) : i = s[8], s[9] !== e || s[10] !== r || s[11] !== i ? (o = (0, l.jsxs)("div", {
            className: "w-full flex justify-center items-center gap-1.5",
            ...e,
            children: [r, n, i]
        }), s[9] = e, s[10] = r, s[11] = i, s[12] = o) : o = s[12], o
    }
    z.displayName = "ConnectorDivider";
    let q = () => {
        let e, t, r = (0, c.c)(4),
            n = (0, $.useTranslations)();
        return r[0] !== n ? (e = n("auth.welcomeToPolymarket"), r[0] = n, r[1] = e) : e = r[1], r[2] !== e ? (t = (0, l.jsx)("div", {
            className: "flex flex-col items-center",
            children: (0, l.jsx)("p", {
                className: "font-semibold text-xl",
                children: e
            })
        }), r[2] = e, r[3] = t) : t = r[3], t
    };

    function W(e) {
        let t, r, n = (0, c.c)(3);
        return n[0] === Symbol.for("react.memo_cache_sentinel") ? (t = (0, l.jsx)("path", {
            fill: "currentColor",
            d: "M4.25 8.75a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5m5.75 0a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5m5.75 0a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5"
        }), n[0] = t) : t = n[0], n[1] !== e ? (r = (0, l.jsx)("svg", {
            xmlns: "http://www.w3.org/2000/svg",
            width: 20,
            height: 20,
            fill: "none",
            viewBox: "0 0 20 20",
            "aria-hidden": !0,
            ...e,
            children: t
        }), n[1] = e, n[2] = r) : r = n[2], r
    }
    var Z = e.i(525962),
        V = e.i(449907),
        K = e.i(668122),
        H = e.i(305457);
    let G = e => {
        let t, r, n, a = (0, c.c)(8),
            {
                wallet: i
            } = e;
        a[0] !== i ? (t = {
            wallet: i
        }, a[0] = i, a[1] = t) : t = a[1];
        let {
            hide: o,
            onClick: s,
            buttonProps: d
        } = (e => {
            let t, r, n, a, i, o, s = (0, c.c)(34),
                {
                    wallet: l
                } = e,
                {
                    id: u,
                    name: d,
                    enabled: f,
                    connector: p
                } = l,
                {
                    connect: m
                } = (0, V.useConnect)();
            s[0] === Symbol.for("react.memo_cache_sentinel") ? (t = (0, C.isMobile)(), s[0] = t) : t = s[0];
            let y = t,
                {
                    route: b,
                    setRoute: v,
                    setConnector: w,
                    setConnectorStatus: _,
                    options: S,
                    getUri: T,
                    connectorRoute: k
                } = (0, g.useSiwx)(),
                {
                    openW3M: O
                } = (0, E.useWalletConnectModal)();
            s[1] !== u ? (r = (0, x.isWalletConnectConnector)(u), s[1] = u, s[2] = r) : r = s[2];
            let R = r,
                N = ("safari" === (0, C.detectBrowser)() || "ios" === (0, C.detectBrowser)()) && (0, x.isCoinbaseWalletConnector)(p.id),
                M = (0, H.useAmplitudeAnalytics)(),
                {
                    shouldDeeplink: P,
                    download: D
                } = (({
                    wallet: e,
                    shouldConnectImmediately: t,
                    isMobile: r
                }) => {
                    if (!t && !e.preventDeeplinkIfNotInstalled && !(0, x.isWalletConnectConnector)(e.id) && (!e.isInstalled && r || e.shouldDeeplinkDesktop && !r)) return {
                        shouldDeeplink: !0
                    };
                    if (!t && (e.preventDeeplinkIfNotInstalled || !1 === e.shouldDeeplinkDesktop && !r) && !e.isInstalled) {
                        let t = (0, C.detectBrowser)();
                        if (!r && e ? .downloadUrls ? .[t]) return {
                            shouldDeeplink: !1,
                            download: e ? .downloadUrls ? .[t]
                        };
                        if (r) {
                            if ((0, C.isAndroid)() && e ? .downloadUrls ? .android) return {
                                shouldDeeplink: !1,
                                download: e.downloadUrls.android
                            };
                            if ((0, C.isIOS)() && e ? .downloadUrls ? .ios) return {
                                shouldDeeplink: !1,
                                download: e.downloadUrls.ios
                            }
                        }
                        return {
                            shouldDeeplink: !1,
                            download: e ? .downloadUrls ? .download ? ? e ? .downloadUrls ? .website
                        }
                    }
                    return {
                        shouldDeeplink: !1
                    }
                })({
                    wallet: l,
                    shouldConnectImmediately: N,
                    isMobile: y
                });
            s[3] !== M || s[4] !== m || s[5] !== p || s[6] !== k || s[7] !== D || s[8] !== T || s[9] !== u || s[10] !== R || s[11] !== d || s[12] !== O || s[13] !== S.initialChainId || s[14] !== w || s[15] !== _ || s[16] !== v || s[17] !== N || s[18] !== P || s[19] !== l ? (n = async () => {
                let e, t = u.toLowerCase();
                if (t.includes("metamask") ? e = K.Events.StartMetaMaskFlow : t.includes("phantom") ? e = K.Events.StartPhantomFlow : t.includes("coinbase") ? e = K.Events.StartCoinbaseFlow : t.includes("walletconnect") ? e = K.Events.StartWalletConnectFlow : t.includes("rainbow") && (e = K.Events.StartRainbowFlow), e && M.trackEvent(e, {
                        type: k,
                        error_type: null
                    }), P || !D) {
                    if (y && R) return void O();
                    if (N && m({
                            connector: p,
                            chainId: S.initialChainId ? ? I.MATIC_CONFIG.chainId
                        }), P) {
                        A.logger.info("[useConnectorButton] getUri invoked for deeplink", {
                            walletId: l.id,
                            walletName: l.name,
                            connectorId: p.id,
                            isMobile: y,
                            isWalletConnect: R,
                            shouldConnectImmediately: N
                        });
                        let e = await T();
                        if (e) {
                            let t = l.bypassWalletConnectUri ? l.getWalletConnectDeeplink ? .(e ? ? "") : e.startsWith("wc:") ? e : l.getWalletConnectDeeplink ? .(e ? ? "");
                            t && window.open(t, "_blank")
                        }
                    } else _(h.ConnectorStates.CONNECTING), v(h.AuthRoute.CONNECT);
                    w({
                        id: u,
                        name: d
                    })
                }
            }, s[3] = M, s[4] = m, s[5] = p, s[6] = k, s[7] = D, s[8] = T, s[9] = u, s[10] = R, s[11] = d, s[12] = O, s[13] = S.initialChainId, s[14] = w, s[15] = _, s[16] = v, s[17] = N, s[18] = P, s[19] = l, s[20] = n) : n = s[20];
            let j = n;
            s[21] !== f || s[22] !== u ? (a = (0, x.isInjectedConnector)(u) && !f, s[21] = f, s[22] = u, s[23] = a) : a = s[23];
            let L = b !== h.AuthRoute.CONNECTORS,
                F = D ? "a" : void 0,
                U = D ? ? void 0,
                $ = D ? "_blank" : void 0,
                z = D ? "noopener noreferrer" : void 0;
            return s[24] !== L || s[25] !== F || s[26] !== U || s[27] !== $ || s[28] !== z ? (i = {
                disabled: L,
                as: F,
                href: U,
                target: $,
                rel: z
            }, s[24] = L, s[25] = F, s[26] = U, s[27] = $, s[28] = z, s[29] = i) : i = s[29], s[30] !== j || s[31] !== i || s[32] !== a ? (o = {
                hide: a,
                onClick: j,
                buttonProps: i
            }, s[30] = j, s[31] = i, s[32] = a, s[33] = o) : o = s[33], o
        })(t);
        if (o) return null;
        let f = i.connectorIcon ? ? i.icon;
        return a[2] !== f ? (r = (0, l.jsx)("div", {
            className: "w-8 h-8",
            children: f
        }), a[2] = f, a[3] = r) : r = a[3], a[4] !== d || a[5] !== s || a[6] !== r ? (n = (0, l.jsx)(u.Button, { ...d,
            onClick: s,
            variant: "secondary",
            className: "h-14 w-full p-2 disabled:opacity-50 disabled:cursor-default",
            children: r
        }), a[4] = d, a[5] = s, a[6] = r, a[7] = n) : n = a[7], n
    };
    var Q = e.i(399482),
        J = e.i(846170);

    function Y({
        provider: e,
        event: t,
        translationKey: r,
        children: n
    }) {
        let {
            setConnector: a,
            setPreventClose: i,
            setRoute: o,
            connectorRoute: s,
            connectorStatus: l,
            options: c,
            route: u
        } = (0, g.useSiwx)(), {
            updateLastConnectorId: d
        } = (0, J.useLastConnector)(), f = (0, H.useAmplitudeAnalytics)(), m = (0, b.useWallet)("magic"), {
            connect: y
        } = (0, V.useConnect)(), v = (0, $.useTranslations)(), x = p.default.useRef(!1), w = p.default.useRef(!1), _ = p.default.useCallback(() => {
            x.current && (i(!1), x.current = !1, w.current = !1)
        }, [i]);
        p.default.useEffect(() => {
            if (x.current) {
                if (l === h.ConnectorStates.CONNECTING) {
                    w.current = !0;
                    return
                }
                if (l === h.ConnectorStates.FAILED || l === h.ConnectorStates.REJECTED) {
                    o(h.AuthRoute.CONNECT), _();
                    return
                }(w.current || l === h.ConnectorStates.DISCONNECTED || l === h.ConnectorStates.UNAVAILABLE) && _()
            }
        }, [l, _, o]), p.default.useEffect(() => _, [_]);
        let C = p.default.useCallback(() => {
            if (!m) return;
            f.trackEvent(t, {
                type: s,
                error_type: null
            });
            let r = (0, Q.createWalletCache)();
            r.state.value = {
                type: "magic",
                connectorId: "magic",
                magicAuthType: "oauth",
                oauthProvider: e,
                connectionState: "requesting",
                email: void 0
            }, r.email.clear(), a({
                id: m.connector.id,
                name: m.connector.name
            }), d(m.id), x.current = !0, w.current = !1, i(!0), y({
                connector: m.connector,
                chainId: c.initialChainId ? ? I.MATIC_CONFIG.chainId
            })
        }, [f, y, s, t, c.initialChainId, e, a, i, d, m]);
        return n({
            isDisabled: u !== h.AuthRoute.CONNECTORS || l === h.ConnectorStates.CONNECTING || !m,
            label: v(r),
            onClick: C
        })
    }

    function X() {
        return (X = Object.assign.bind()).apply(null, arguments)
    }
    let ee = function(e) {
        return p.createElement("svg", X({
            xmlns: "http://www.w3.org/2000/svg",
            width: 32,
            height: 32,
            viewBox: "0 0 32 32"
        }, e), n || (n = p.createElement("rect", {
            width: 32,
            height: 32,
            fill: "#1b2838",
            rx: 9
        })), a || (a = p.createElement("path", {
            fill: "#fff",
            d: "M15.979 4C9.678 4 4.511 8.86 4.022 15.037l6.432 2.658a3.4 3.4 0 0 1 1.912-.59q.094.002.188.006l2.861-4.142v-.059a4.53 4.53 0 0 1 4.524-4.524c2.494 0 4.524 2.031 4.524 4.527s-2.03 4.525-4.524 4.525h-.105l-4.076 2.911q.002.078.004.159a3.39 3.39 0 0 1-3.39 3.396 3.41 3.41 0 0 1-3.331-2.727L4.436 19.27C5.862 24.307 10.486 28 15.979 28c6.627 0 11.999-5.373 11.999-12S22.605 4 15.979 4M11.54 22.21l-1.473-.61c.262.543.714.999 1.314 1.25a2.551 2.551 0 0 0 3.337-3.324 2.547 2.547 0 0 0-3.255-1.413l1.523.63a1.878 1.878 0 0 1-1.445 3.468h-.001zm11.415-9.303a3.02 3.02 0 0 0-3.015-3.015 3.015 3.015 0 1 0 3.015 3.015m-5.273-.005a2.264 2.264 0 1 1 4.531 0 2.267 2.267 0 0 1-2.266 2.265 2.264 2.264 0 0 1-2.265-2.265"
        })))
    };

    function et() {
        let e, t = (0, c.c)(1);
        return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, l.jsx)(Y, {
            provider: "steam",
            event: K.Events.StartSteamFlow,
            translationKey: "auth.continueWithSteam",
            children: er
        }), t[0] = e) : e = t[0], e
    }

    function er(e) {
        let {
            onClick: t,
            label: r,
            isDisabled: n
        } = e;
        return (0, l.jsx)(u.Button, {
            onClick: t,
            variant: "secondary",
            disabled: n,
            className: "h-14 w-full p-2 disabled:opacity-50 disabled:cursor-default",
            "aria-label": r,
            children: (0, l.jsx)(ee, {
                className: "w-8 h-8"
            })
        })
    }

    function en() {
        return (en = Object.assign.bind()).apply(null, arguments)
    }
    let ea = function(e) {
        return p.createElement("svg", en({
            xmlns: "http://www.w3.org/2000/svg",
            width: 32,
            height: 32,
            viewBox: "0 0 32 32"
        }, e), i || (i = p.createElement("rect", {
            width: 32,
            height: 32,
            fill: "#229ED9",
            rx: 9
        })), o || (o = p.createElement("path", {
            fill: "#fff",
            d: "M22.94 8.76 20.3 22.03c-.2.88-.72 1.1-1.46.68l-4.03-2.97-1.94 1.87c-.22.22-.4.4-.8.4l.28-4.08 7.43-6.71c.32-.29-.07-.45-.5-.16l-9.18 5.78-3.96-1.24c-.86-.27-.88-.86.18-1.27l15.5-5.98c.72-.27 1.35.16 1.12 1.28Z"
        })))
    };

    function ei() {
        let e, t = (0, c.c)(1);
        return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, l.jsx)(Y, {
            provider: "telegram",
            event: K.Events.StartTelegramFlow,
            translationKey: "auth.continueWithTelegram",
            children: eo
        }), t[0] = e) : e = t[0], e
    }

    function eo(e) {
        let {
            onClick: t,
            label: r,
            isDisabled: n
        } = e;
        return (0, l.jsx)(u.Button, {
            onClick: t,
            variant: "secondary",
            disabled: n,
            className: "h-14 w-full p-2 disabled:opacity-50 disabled:cursor-default",
            "aria-label": r,
            children: (0, l.jsx)(ea, {
                className: "w-8 h-8"
            })
        })
    }

    function es(e) {
        let t, r, n, a, i, o, s, u = (0, c.c)(25);
        u[0] !== e ? ({
            wallets: r,
            ...t
        } = e, u[0] = e, u[1] = t, u[2] = r) : (t = u[1], r = u[2]);
        let {
            isDesktop: d
        } = (0, Z.useModal)(), f = (0, y.useLocales)(), [h, m] = p.default.useState(!1);
        if (d) {
            let e;
            if (u[3] !== h || u[4] !== f || u[5] !== t || u[6] !== r) {
                let n, a, i, o = r.filter(ep),
                    s = o.length > 6,
                    c = s && !h ? 5 : 6,
                    d = o.slice(0, c),
                    p = o.slice(c);
                u[8] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, l.jsx)(ei, {}), a = (0, l.jsx)(et, {}), u[8] = n, u[9] = a) : (n = u[8], a = u[9]), u[10] !== s || u[11] !== h || u[12] !== f ? (i = s && !h && (0, l.jsx)(eh, {
                    onClick: () => m(!0),
                    children: f.moreMethods
                }), u[10] = s, u[11] = h, u[12] = f, u[13] = i) : i = u[13], e = (0, l.jsxs)("div", {
                    className: "flex w-full flex-col items-center gap-[18px]",
                    ...t,
                    children: [(0, l.jsxs)("div", {
                        className: "grid w-full flex-1 grid-cols-4 gap-[18px]",
                        children: [n, a, d.map(ef), i]
                    }), h && p.length > 0 && (0, l.jsx)("div", {
                        className: "grid w-full flex-1 grid-cols-4 gap-[18px]",
                        children: p.map(ed)
                    })]
                }), u[3] = h, u[4] = f, u[5] = t, u[6] = r, u[7] = e
            } else e = u[7];
            return e
        }
        u[14] !== r ? (n = r.find(eu), u[14] = r, u[15] = n) : n = u[15];
        let g = n;
        u[16] !== r ? (a = r.filter(ec).slice(0, 6).map(el), u[16] = r, u[17] = a) : a = u[17];
        let b = a;
        return u[18] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, l.jsx)(et, {}), u[18] = i) : i = u[18], u[19] !== g ? (o = g && (0, l.jsx)(G, {
            wallet: g
        }), u[19] = g, u[20] = o) : o = u[20], u[21] !== t || u[22] !== o || u[23] !== b ? (s = (0, l.jsxs)("div", {
            className: "grid w-full flex-1 grid-cols-4 gap-[18px]",
            ...t,
            children: [i, b, o]
        }), u[21] = t, u[22] = o, u[23] = b, u[24] = s) : s = u[24], s
    }

    function el(e) {
        return (0, l.jsx)(G, {
            wallet: e
        }, e.name)
    }

    function ec(e) {
        return "magic" !== e.id && "io.rabby" !== e.id && "rabby" !== e.id
    }

    function eu(e) {
        return "io.rabby" === e.id || "rabby" === e.id
    }

    function ed(e) {
        return (0, l.jsx)(G, {
            wallet: e
        }, e.name)
    }

    function ef(e) {
        return (0, l.jsx)(G, {
            wallet: e
        }, e.name)
    }

    function ep(e) {
        return "magic" !== e.id
    }

    function eh(e) {
        let t, r, n, a = (0, c.c)(6),
            {
                children: i,
                onClick: o
            } = e;
        return a[0] === Symbol.for("react.memo_cache_sentinel") ? (t = (0, l.jsx)("div", {
            className: "flex h-8 w-8 items-center justify-center rounded-full bg-button-ghost-bg transition-colors duration-200 group-hover:text-text-primary",
            children: (0, l.jsx)(W, {
                className: "size-5"
            })
        }), a[0] = t) : t = a[0], a[1] !== i ? (r = (0, l.jsx)("span", {
            className: "sr-only",
            children: i
        }), a[1] = i, a[2] = r) : r = a[2], a[3] !== o || a[4] !== r ? (n = (0, l.jsxs)(u.Button, {
            type: "button",
            variant: "secondary",
            "aria-expanded": !1,
            onClick: o,
            className: "group h-14 w-full p-2 text-text-secondary disabled:opacity-50 disabled:cursor-default",
            children: [t, r]
        }), a[3] = o, a[4] = r, a[5] = n) : n = a[5], n
    }
    var em = e => e instanceof Date,
        ey = e => null == e,
        eg = e => !ey(e) && !Array.isArray(e) && "object" == typeof e && !em(e),
        eb = e => eg(e) && e.target ? "checkbox" === e.target.type ? e.target.checked : e.target.value : e,
        ev = (e, t) => t.split(".").some((t, r, n) => !isNaN(Number(t)) && e.has(n.slice(0, r).join("."))),
        ex = "u" > typeof window && void 0 !== window.HTMLElement && "u" > typeof document;

    function ew(e) {
        let t;
        if (e instanceof Date) return new Date(e);
        let r = "u" > typeof FileList && e instanceof FileList;
        if (ex && (e instanceof Blob || r)) return e;
        let n = Array.isArray(e);
        if (!n && !(eg(e) && eg(t = e.constructor && e.constructor.prototype) && t.hasOwnProperty("isPrototypeOf"))) return e;
        let a = n ? [] : Object.create(Object.getPrototypeOf(e));
        for (let t in e) Object.prototype.hasOwnProperty.call(e, t) && (a[t] = ew(e[t]));
        return a
    }
    var e_ = e => void 0 === e,
        eC = e => Array.isArray(e) ? e.filter(Boolean) : [],
        eE = e => eC(e.replace(/["|']|\]/g, "").split(/\.|\[/)),
        eS = (e, t, r) => {
            if (!t || !eg(e)) return r;
            let n = (/^\w*$/.test(t) ? [t] : eE(t)).reduce((e, t) => ey(e) ? void 0 : e[t], e);
            return e_(n) || n === e ? e_(e[t]) ? r : e[t] : n
        },
        eA = e => "function" == typeof e,
        eI = (e, t, r) => {
            let n = -1,
                a = /^\w*$/.test(t) ? [t] : eE(t),
                i = a.length,
                o = i - 1;
            for (; ++n < i;) {
                let t = a[n],
                    i = r;
                if (n !== o) {
                    let r = e[t];
                    i = eg(r) || Array.isArray(r) ? r : isNaN(+a[n + 1]) ? {} : []
                }
                if ("__proto__" === t || "constructor" === t || "prototype" === t) return;
                e[t] = i, e = e[t]
            }
        };
    let eT = "blur",
        ek = "trigger",
        eO = "onChange",
        eR = "onSubmit",
        eN = "maxLength",
        eM = "minLength",
        eP = "pattern",
        eD = "required",
        ej = "validate",
        eL = "form",
        eF = "root",
        eU = p.default.createContext(null);
    eU.displayName = "HookFormControlContext";
    var e$ = (e, t, r, n = !0) => {
        let a = {};
        for (let i in e) Object.defineProperty(a, i, {
            get: () => ("all" !== t._proxyFormState[i] && (t._proxyFormState[i] = !n || "all"), r && (r[i] = !0), e[i])
        });
        return a
    };
    let ez = "u" > typeof window ? p.default.useLayoutEffect : p.default.useEffect;
    var eB = e => "string" == typeof e,
        eq = (e, t, r, n, a) => eB(e) ? (n && t.watch.add(e), eS(r, e, a)) : Array.isArray(e) ? e.map(e => (n && t.watch.add(e), eS(r, e))) : (n && (t.watchAll = !0), r),
        eW = e => ey(e) || "object" != typeof e;

    function eZ(e, t, r = new WeakSet) {
        if (e === t) return !0;
        if (eW(e) || eW(t)) return Object.is(e, t);
        if (em(e) && em(t)) return Object.is(e.getTime(), t.getTime());
        let n = Object.keys(e),
            a = Object.keys(t);
        if (n.length !== a.length) return !1;
        if (r.has(e) || r.has(t)) return !0;
        for (let a of (r.add(e), r.add(t), n)) {
            let n = e[a];
            if (!(a in t)) return !1;
            if ("ref" !== a) {
                let e = t[a];
                if (em(n) && em(e) || (eg(n) || Array.isArray(n)) && (eg(e) || Array.isArray(e)) ? !eZ(n, e, r) : !Object.is(n, e)) return !1
            }
        }
        return !0
    }
    let eV = p.default.createContext(null);
    eV.displayName = "HookFormContext";
    var eK = (e, t, r, n, a) => t ? { ...r[e],
            types: { ...r[e] && r[e].types ? r[e].types : {},
                [n]: a || !0
            }
        } : {},
        eH = e => Array.isArray(e) ? e : [e],
        eG = () => {
            let e = [];
            return {
                get observers() {
                    return e
                },
                next: t => {
                    for (let r of e) r.next && r.next(t)
                },
                subscribe: t => (e.push(t), {
                    unsubscribe: () => {
                        e = e.filter(e => e !== t)
                    }
                }),
                unsubscribe: () => {
                    e = []
                }
            }
        },
        eQ = e => eg(e) && !Object.keys(e).length,
        eJ = e => {
            if (!ex) return !1;
            let t = e ? e.ownerDocument : 0;
            return e instanceof(t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement)
        },
        eY = e => eJ(e) && e.isConnected;

    function eX(e, t) {
        if (eB(t) && Object.prototype.hasOwnProperty.call(e, t)) return delete e[t], e;
        let r = Array.isArray(t) ? t : /^\w*$/.test(t) ? [t] : eE(t),
            n = 1 === r.length ? e : function(e, t) {
                let r = t.slice(0, -1).length,
                    n = 0;
                for (; n < r;) {
                    if (ey(e)) {
                        e = void 0;
                        break
                    }
                    e = e[t[n]], n++
                }
                return e
            }(e, r),
            a = r.length - 1,
            i = r[a];
        return n && delete n[i], 0 !== a && (eg(n) && eQ(n) || Array.isArray(n) && function(e) {
            for (let t in e)
                if (e.hasOwnProperty(t) && !e_(e[t])) return !1;
            return !0
        }(n)) && eX(e, r.slice(0, -1)), e
    }

    function e0(e) {
        return Array.isArray(e) || eg(e) && !(e => {
            for (let t in e)
                if (eA(e[t])) return !0;
            return !1
        })(e)
    }

    function e1(e, t = {}) {
        for (let r in e) {
            let n = e[r];
            e0(n) ? (t[r] = Array.isArray(n) ? [] : {}, e1(n, t[r])) : e_(n) || (t[r] = !0)
        }
        return t
    }

    function e2(e, t, r) {
        for (let n in r || (r = e1(t)), e) {
            let a = e[n];
            if (e0(a)) e_(t) || eW(r[n]) ? r[n] = e1(a, Array.isArray(a) ? [] : {}) : e2(a, ey(t) ? {} : t[n], r[n]);
            else {
                let e = t[n];
                r[n] = !eZ(a, e)
            }
        }
        return function e(t) {
            if (!1 !== t) {
                if (!0 === t) return !0;
                if (Array.isArray(t)) {
                    let r = t.map(t => e(t));
                    return r.some(e => void 0 !== e) ? r : void 0
                }
                if (eg(t)) {
                    let r = {};
                    for (let n in t) {
                        let a = e(t[n]);
                        e_(a) || (r[n] = a)
                    }
                    return Object.keys(r).length ? r : void 0
                }
            }
        }(r) || {}
    }
    let e6 = {
            value: !1,
            isValid: !1
        },
        e5 = {
            value: !0,
            isValid: !0
        };
    var e3 = e => {
            if (Array.isArray(e)) {
                if (e.length > 1) {
                    let t = e.filter(e => e && e.checked && !e.disabled).map(e => e.value);
                    return {
                        value: t,
                        isValid: !!t.length
                    }
                }
                return e[0].checked && !e[0].disabled ? e[0].attributes && !e_(e[0].attributes.value) ? e_(e[0].value) || "" === e[0].value ? e5 : {
                    value: e[0].value,
                    isValid: !0
                } : e5 : e6
            }
            return e6
        },
        e4 = (e, {
            valueAsNumber: t,
            valueAsDate: r,
            setValueAs: n
        }) => e_(e) ? e : t ? "" === e ? NaN : e ? +e : e : r && eB(e) ? new Date(e) : n ? n(e) : e;
    let e8 = {
        isValid: !1,
        value: null
    };
    var e7 = e => Array.isArray(e) ? e.reduce((e, t) => t && t.checked && !t.disabled ? {
        isValid: !0,
        value: t.value
    } : e, e8) : e8;

    function e9(e) {
        let t = e.ref;
        return "file" === t.type ? t.files : "radio" === t.type ? e7(e.refs).value : "select-multiple" === t.type ? [...t.selectedOptions].map(({
            value: e
        }) => e) : "checkbox" === t.type ? e3(e.refs).value : e4(e_(t.value) ? e.ref.value : t.value, e)
    }
    var te = e => e_(e) ? e : e instanceof RegExp ? e.source : eg(e) ? e.value instanceof RegExp ? e.value.source : e.value : e,
        tt = e => ({
            isOnSubmit: !e || e === eR,
            isOnBlur: "onBlur" === e,
            isOnChange: e === eO,
            isOnAll: "all" === e,
            isOnTouch: "onTouched" === e
        });
    let tr = "AsyncFunction";
    var tn = e => !!e && !!e.validate && !!(eA(e.validate) && e.validate.constructor.name === tr || eg(e.validate) && Object.values(e.validate).find(e => e.constructor.name === tr)),
        ta = (e, t, r) => !r && (t.watchAll || t.watch.has(e) || [...t.watch].some(t => e.startsWith(t) && /^\.\w+/.test(e.slice(t.length))));
    let ti = (e, t, r, n) => {
        for (let a of r || Object.keys(e)) {
            let r = eS(e, a);
            if (r) {
                let {
                    _f: e,
                    ...i
                } = r;
                if (e) {
                    if (e.refs && e.refs[0] && t(e.refs[0], a) && !n) return !0;
                    else if (e.ref && t(e.ref, e.name) && !n) return !0;
                    else if (ti(i, t)) break
                } else if (eg(i) && ti(i, t)) break
            }
        }
    };

    function to(e, t, r) {
        let n = eS(e, r);
        if (n || /^\w*$/.test(r)) return {
            error: n,
            name: r
        };
        let a = r.split(".");
        for (; a.length;) {
            let n = a.join("."),
                i = eS(t, n),
                o = eS(e, n);
            if (i && !Array.isArray(i) && r !== n) break;
            if (o && o.type) return {
                name: n,
                error: o
            };
            if (o && o.root && o.root.type) return {
                name: `${n}.root`,
                error: o.root
            };
            a.pop()
        }
        return {
            name: r
        }
    }
    var ts = (e, t, r) => {
        let n = eH(eS(e, r));
        return eI(n, eF, t[r]), eI(e, r, n), e
    };

    function tl(e, t, r = "validate") {
        if (eB(e) || Array.isArray(e) && e.every(eB) || "boolean" == typeof e && !e) return {
            type: r,
            message: eB(e) ? e : "",
            ref: t
        }
    }
    var tc = e => !eg(e) || e instanceof RegExp ? {
            value: e,
            message: ""
        } : e,
        tu = async (e, t, r, n, a, i) => {
            let {
                ref: o,
                refs: s,
                required: l,
                maxLength: c,
                minLength: u,
                min: d,
                max: f,
                pattern: p,
                validate: h,
                name: m,
                valueAsNumber: y,
                mount: g
            } = e._f, b = eS(r, m);
            if (!g || t.has(m)) return {};
            let v = s ? s[0] : o,
                x = e => {
                    a && v.reportValidity && (v.setCustomValidity("boolean" == typeof e ? "" : e || ""), v.reportValidity())
                },
                w = {},
                _ = "radio" === o.type,
                C = "checkbox" === o.type,
                E = (y || "file" === o.type) && e_(o.value) && e_(b) || eJ(o) && "" === o.value || "" === b || Array.isArray(b) && !b.length || y && "number" == typeof b && isNaN(b),
                S = eK.bind(null, m, n, w),
                A = (e, t, r, n = eN, a = eM) => {
                    let i = e ? t : r;
                    w[m] = {
                        type: e ? n : a,
                        message: i,
                        ref: o,
                        ...S(e ? n : a, i)
                    }
                };
            if (i ? !Array.isArray(b) || !b.length : l && (!(_ || C) && (E || ey(b)) || "boolean" == typeof b && !b || C && !e3(s).isValid || _ && !e7(s).isValid)) {
                let {
                    value: e,
                    message: t
                } = eB(l) ? {
                    value: !!l,
                    message: l
                } : tc(l);
                if (e && (w[m] = {
                        type: eD,
                        message: t,
                        ref: v,
                        ...S(eD, t)
                    }, !n)) return x(t), w
            }
            if (!E && (!ey(d) || !ey(f))) {
                let e, t, r = tc(f),
                    a = tc(d);
                if (ey(b) || isNaN(b)) {
                    let n = o.valueAsDate || new Date(b),
                        i = e => new Date(new Date().toDateString() + " " + e),
                        s = "time" == o.type,
                        l = "week" == o.type;
                    eB(r.value) && b && (e = s ? i(b) > i(r.value) : l ? b > r.value : n > new Date(r.value)), eB(a.value) && b && (t = s ? i(b) < i(a.value) : l ? b < a.value : n < new Date(a.value))
                } else {
                    let n = o.valueAsNumber || (b ? +b : b);
                    ey(r.value) || (e = n > r.value), ey(a.value) || (t = n < a.value)
                }
                if ((e || t) && (A(!!e, r.message, a.message, "max", "min"), !n)) return x(w[m].message), w
            }
            if ((c || u) && !E && (eB(b) || i && Array.isArray(b))) {
                let e = tc(c),
                    t = tc(u),
                    r = !ey(e.value) && b.length > +e.value,
                    a = !ey(t.value) && b.length < +t.value;
                if ((r || a) && (A(r, e.message, t.message), !n)) return x(w[m].message), w
            }
            if (p && !E && eB(b)) {
                let {
                    value: e,
                    message: t
                } = tc(p);
                if (e instanceof RegExp && !b.match(e) && (w[m] = {
                        type: eP,
                        message: t,
                        ref: o,
                        ...S(eP, t)
                    }, !n)) return x(t), w
            }
            if (h) {
                if (eA(h)) {
                    let e = tl(await h(b, r), v);
                    if (e && (w[m] = { ...e,
                            ...S(ej, e.message)
                        }, !n)) return x(e.message), w
                } else if (eg(h)) {
                    let e = {};
                    for (let t in h) {
                        if (!eQ(e) && !n) break;
                        let a = tl(await h[t](b, r), v, t);
                        a && (e = { ...a,
                            ...S(t, a.message)
                        }, x(a.message), n && (w[m] = e))
                    }
                    if (!eQ(e) && (w[m] = {
                            ref: v,
                            ...e
                        }, !n)) return w
                }
            }
            return x(!0), w
        };
    let td = {
            mode: eR,
            reValidateMode: eO,
            shouldFocusError: !0
        },
        tf = {
            submitCount: 0,
            isDirty: !1,
            isReady: !1,
            isValidating: !1,
            isSubmitted: !1,
            isSubmitting: !1,
            isSubmitSuccessful: !1,
            isValid: !1,
            touchedFields: {},
            dirtyFields: {},
            validatingFields: {}
        };
    var tp = () => {
            if ("u" > typeof crypto && crypto.randomUUID) return crypto.randomUUID();
            let e = "u" < typeof performance ? Date.now() : 1e3 * performance.now();
            return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, t => {
                let r = (16 * Math.random() + e) % 16 | 0;
                return ("x" == t ? r : 3 & r | 8).toString(16)
            })
        },
        th = (e, t, r = {}) => r.shouldFocus || e_(r.shouldFocus) ? r.focusName || `${e}.${e_(r.focusIndex)?t:r.focusIndex}.` : "",
        tm = (e, t) => [...e, ...eH(t)],
        ty = e => Array.isArray(e) ? e.map(() => void 0) : void 0;

    function tg(e, t, r) {
        return [...e.slice(0, t), ...eH(r), ...e.slice(t)]
    }
    var tb = (e, t, r) => Array.isArray(e) ? (e_(e[r]) && (e[r] = void 0), e.splice(r, 0, e.splice(t, 1)[0]), e) : [],
        tv = (e, t) => [...eH(t), ...eH(e)],
        tx = (e, t) => e_(t) ? [] : function(e, t) {
            let r = 0,
                n = [...e];
            for (let e of t) n.splice(e - r, 1), r++;
            return eC(n).length ? n : []
        }(e, eH(t).sort((e, t) => e - t)),
        tw = (e, t, r) => {
            [e[t], e[r]] = [e[r], e[t]]
        },
        t_ = (e, t, r) => (e[t] = r, e);

    function tC(e = {}) {
        let t = p.default.useRef(void 0),
            r = p.default.useRef(void 0),
            [n, a] = p.default.useState(() => ({ ...ew(tf),
                isLoading: eA(e.defaultValues),
                errors: e.errors || {},
                disabled: e.disabled || !1,
                defaultValues: eA(e.defaultValues) ? void 0 : e.defaultValues
            }));
        if (!t.current)
            if (e.formControl) t.current = { ...e.formControl,
                formState: n
            }, e.defaultValues && !eA(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
            else {
                let {
                    formControl: r,
                    ...a
                } = function(e = {}) {
                    let t, r = { ...td,
                            ...e
                        },
                        n = { ...ew(tf),
                            isLoading: eA(r.defaultValues),
                            errors: r.errors || {},
                            disabled: r.disabled || !1
                        },
                        a = {},
                        i = (eg(r.defaultValues) || eg(r.values)) && ew(r.defaultValues || r.values) || {},
                        o = r.shouldUnregister ? {} : ew(i),
                        s = {
                            action: !1,
                            mount: !1,
                            watch: !1,
                            keepIsValid: !1
                        },
                        l = {
                            mount: new Set,
                            disabled: new Set,
                            unMount: new Set,
                            array: new Set,
                            watch: new Set,
                            registerName: new Set
                        },
                        c = 0,
                        u = {
                            isDirty: !1,
                            dirtyFields: !1,
                            validatingFields: !1,
                            touchedFields: !1,
                            isValidating: !1,
                            isValid: !1,
                            errors: !1
                        },
                        d = { ...u
                        },
                        f = { ...d
                        },
                        p = {
                            array: eG(),
                            state: eG()
                        },
                        h = "all" === r.criteriaMode,
                        m = async e => {
                            if (!s.keepIsValid && !r.disabled && (d.isValid || f.isValid || e)) {
                                let e;
                                r.resolver ? (e = eQ((await x()).errors), y()) : e = await C({
                                    fields: a,
                                    onlyCheckValid: !0,
                                    eventType: "valid"
                                }), e !== n.isValid && p.state.next({
                                    isValid: e
                                })
                            }
                        },
                        y = (e, t) => {
                            !r.disabled && (d.isValidating || d.validatingFields || f.isValidating || f.validatingFields) && ((e || Array.from(l.mount)).forEach(e => {
                                e && (t ? eI(n.validatingFields, e, t) : eX(n.validatingFields, e))
                            }), p.state.next({
                                validatingFields: n.validatingFields,
                                isValidating: !eQ(n.validatingFields)
                            }))
                        },
                        g = () => {
                            n.dirtyFields = e2(i, o)
                        },
                        b = (e, t, r, l) => {
                            let c = eS(a, e);
                            if (c) {
                                let a = e_(eS(o, e)),
                                    u = eS(o, e, e_(r) ? eS(i, e) : r);
                                e_(u) || l && l.defaultChecked || t ? eI(o, e, t ? u : e9(c._f)) : A(e, u), s.mount && !s.action && (m(), a && n.isDirty && (d.isDirty || f.isDirty) && (E() || (n.isDirty = !1, p.state.next({ ...n
                                }))))
                            }
                        },
                        v = (e, t, a, o, s) => {
                            let l = !1,
                                c = !1,
                                u = {
                                    name: e
                                };
                            if (!r.disabled) {
                                if (!a || o) {
                                    (d.isDirty || f.isDirty) && (c = n.isDirty, n.isDirty = u.isDirty = E(), l = c !== u.isDirty);
                                    let r = eZ(eS(i, e), t);
                                    c = !!eS(n.dirtyFields, e), r ? eX(n.dirtyFields, e) : eI(n.dirtyFields, e, !0), u.dirtyFields = n.dirtyFields, l = l || (d.dirtyFields || f.dirtyFields) && !r !== c
                                }
                                if (a) {
                                    let t = eS(n.touchedFields, e);
                                    t || (eI(n.touchedFields, e, a), u.touchedFields = n.touchedFields, l = l || (d.touchedFields || f.touchedFields) && t !== a)
                                }
                                l && s && p.state.next(u)
                            }
                            return l ? u : {}
                        },
                        x = async e => (y(e, !0), await r.resolver(o, r.context, ((e, t, r, n) => {
                            let a = {};
                            for (let r of e) {
                                let e = eS(t, r);
                                e && eI(a, r, e._f)
                            }
                            return {
                                criteriaMode: r,
                                names: [...e],
                                fields: a,
                                shouldUseNativeValidation: n
                            }
                        })(e || l.mount, a, r.criteriaMode, r.shouldUseNativeValidation))),
                        w = async e => {
                            let {
                                errors: t
                            } = await x(e);
                            if (y(e), e)
                                for (let r of e) {
                                    let e = eS(t, r);
                                    e ? eI(n.errors, r, e) : eX(n.errors, r)
                                } else n.errors = t;
                            return t
                        },
                        _ = async ({
                            name: t,
                            eventType: r
                        }) => {
                            if (e.validate) {
                                let a = await e.validate({
                                    formValues: o,
                                    formState: n,
                                    name: t,
                                    eventType: r
                                });
                                if (eg(a))
                                    for (let e in a) a[e] && D(`${eL}.${e}`, {
                                        message: eB(a.message) ? a.message : "",
                                        type: ej
                                    });
                                else eB(a) || !a ? D(eL, {
                                    message: a || "",
                                    type: ej
                                }) : P(eL);
                                return a
                            }
                            return !0
                        },
                        C = async ({
                            fields: t,
                            onlyCheckValid: a,
                            name: i,
                            eventType: s,
                            context: c = {
                                valid: !0,
                                runRootValidation: !1
                            }
                        }) => {
                            if (e.validate && (c.runRootValidation = !0, !await _({
                                    name: i,
                                    eventType: s
                                })) && (c.valid = !1, a)) return c.valid;
                            for (let i in t) {
                                let u = t[i];
                                if (u) {
                                    let {
                                        _f: t,
                                        ...f
                                    } = u;
                                    if (t) {
                                        let i = l.array.has(t.name),
                                            s = u._f && tn(u._f);
                                        s && d.validatingFields && y([t.name], !0);
                                        let f = await tu(u, l.disabled, o, h, r.shouldUseNativeValidation && !a, i);
                                        if (s && d.validatingFields && y([t.name]), f[t.name] && (c.valid = !1, a) || (a || (eS(f, t.name) ? i ? ts(n.errors, f, t.name) : eI(n.errors, t.name, f[t.name]) : eX(n.errors, t.name)), e.shouldUseNativeValidation && f[t.name])) break
                                    }
                                    eQ(f) || await C({
                                        context: c,
                                        onlyCheckValid: a,
                                        fields: f,
                                        name: i,
                                        eventType: s
                                    })
                                }
                            }
                            return c.valid
                        },
                        E = (e, t) => !r.disabled && (e && t && eI(o, e, t), !eZ(N(), i)),
                        S = (e, t, r) => eq(e, l, { ...s.mount ? o : e_(t) ? i : eB(e) ? {
                                [e]: t
                            } : t
                        }, r, t),
                        A = (e, t, r = {}) => {
                            let n = eS(a, e),
                                i = t;
                            if (n) {
                                let r = n._f;
                                r && (r.disabled || eI(o, e, e4(t, r)), i = eJ(r.ref) && ey(t) ? "" : t, "select-multiple" === r.ref.type ? [...r.ref.options].forEach(e => e.selected = i.includes(e.value)) : r.refs ? "checkbox" === r.ref.type ? r.refs.forEach(e => {
                                    e.defaultChecked && e.disabled || (Array.isArray(i) ? e.checked = !!i.find(t => t === e.value) : e.checked = i === e.value || !!i)
                                }) : r.refs.forEach(e => e.checked = e.value === i) : "file" === r.ref.type ? r.ref.value = "" : (r.ref.value = i, r.ref.type || p.state.next({
                                    name: e,
                                    values: ew(o)
                                })))
                            }(r.shouldDirty || r.shouldTouch) && v(e, i, r.shouldTouch, r.shouldDirty, !0), r.shouldValidate && R(e)
                        },
                        I = (e, t, r) => {
                            for (let n in t) {
                                if (!t.hasOwnProperty(n)) return;
                                let i = t[n],
                                    o = e + "." + n,
                                    s = eS(a, o);
                                (l.array.has(e) || eg(i) || s && !s._f) && !em(i) ? I(o, i, r) : A(o, i, r)
                            }
                        },
                        T = (e, t, r = {}) => {
                            let i = eS(a, e),
                                c = l.array.has(e),
                                u = ew(t),
                                h = eZ(eS(o, e), u);
                            if (eI(o, e, u), c) p.array.next({
                                name: e,
                                values: ew(o)
                            }), (d.isDirty || d.dirtyFields || f.isDirty || f.dirtyFields) && r.shouldDirty && (g(), p.state.next({
                                name: e,
                                dirtyFields: n.dirtyFields,
                                isDirty: E(e, u)
                            }));
                            else {
                                let t = Array.isArray(u) && !u.length || eQ(u);
                                !i || i._f || ey(u) || t ? A(e, u, r) : I(e, u, r)
                            }
                            if (!h) {
                                let t = ta(e, l);
                                p.state.next({ ...t && n,
                                    name: s.mount || t ? e : void 0,
                                    values: ew(o)
                                })
                            }
                        },
                        k = async i => {
                            s.mount = !0;
                            let u = i.target,
                                g = u.name,
                                b = !0,
                                w = eS(a, g),
                                E = e => {
                                    b = Number.isNaN(e) || em(e) && isNaN(e.getTime()) || eZ(e, eS(o, g, e))
                                },
                                S = tt(r.mode),
                                A = tt(r.reValidateMode);
                            if (w) {
                                var I, T, k, O, N;
                                let s, j, L, F = u.type ? e9(w._f) : eb(i),
                                    U = i.type === eT || "focusout" === i.type,
                                    $ = !((L = w._f).mount && (L.required || L.min || L.max || L.maxLength || L.minLength || L.pattern || L.validate)) && !e.validate && !r.resolver && !eS(n.errors, g) && !w._f.deps || (I = U, T = eS(n.touchedFields, g), k = n.isSubmitted, O = A, !(N = S).isOnAll && (!k && N.isOnTouch ? !(T || I) : (k ? O.isOnBlur : N.isOnBlur) ? !I : (k ? !O.isOnChange : !N.isOnChange) || I)),
                                    z = ta(g, l, U);
                                eI(o, g, F), U ? u && u.readOnly || (w._f.onBlur && w._f.onBlur(i), t && t(0)) : w._f.onChange && w._f.onChange(i);
                                let B = v(g, F, U),
                                    q = !eQ(B) || z;
                                if (U || p.state.next({
                                        name: g,
                                        type: i.type,
                                        values: ew(o)
                                    }), $) return (d.isValid || f.isValid) && ("onBlur" === r.mode ? U && m() : U || m()), q && p.state.next({
                                    name: g,
                                    ...z ? {} : B
                                });
                                if (!r.resolver && e.validate && await _({
                                        name: g,
                                        eventType: i.type
                                    }), !U && z && p.state.next({ ...n
                                    }), r.resolver) {
                                    let {
                                        errors: e
                                    } = await x([g]);
                                    if (y([g]), E(F), b) {
                                        let t = to(n.errors, a, g),
                                            r = to(e, a, t.name || g);
                                        s = r.error, g = r.name, j = eQ(e)
                                    }
                                } else y([g], !0), s = (await tu(w, l.disabled, o, h, r.shouldUseNativeValidation))[g], y([g]), E(F), b && (s ? j = !1 : (d.isValid || f.isValid) && (j = await C({
                                    fields: a,
                                    onlyCheckValid: !0,
                                    name: g,
                                    eventType: i.type
                                })));
                                if (b) {
                                    w._f.deps && (!Array.isArray(w._f.deps) || w._f.deps.length > 0) && R(w._f.deps);
                                    var M = g,
                                        P = j,
                                        D = s;
                                    let e = eS(n.errors, M),
                                        a = (d.isValid || f.isValid) && "boolean" == typeof P && n.isValid !== P;
                                    if (r.delayError && D) {
                                        let e;
                                        e = () => {
                                            eI(n.errors, M, D), p.state.next({
                                                errors: n.errors
                                            })
                                        }, (t = t => {
                                            clearTimeout(c), c = setTimeout(e, t)
                                        })(r.delayError)
                                    } else clearTimeout(c), t = null, D ? eI(n.errors, M, D) : eX(n.errors, M);
                                    if ((D ? !eZ(e, D) : e) || !eQ(B) || a) {
                                        let e = { ...B,
                                            ...a && "boolean" == typeof P ? {
                                                isValid: P
                                            } : {},
                                            errors: n.errors,
                                            name: M
                                        };
                                        n = { ...n,
                                            ...e
                                        }, p.state.next(e)
                                    }
                                }
                            }
                        },
                        O = (e, t) => {
                            if (eS(n.errors, t) && e.focus) return e.focus(), 1
                        },
                        R = async (e, t = {}) => {
                            let i, o, s = eH(e);
                            if (r.resolver) {
                                let t = await w(e_(e) ? e : s);
                                i = eQ(t), o = e ? !s.some(e => eS(t, e)) : i
                            } else e ? ((o = (await Promise.all(s.map(async e => {
                                let t = eS(a, e);
                                return await C({
                                    fields: t && t._f ? {
                                        [e]: t
                                    } : t,
                                    eventType: ek
                                })
                            }))).every(Boolean)) || n.isValid) && m() : o = i = await C({
                                fields: a,
                                name: e,
                                eventType: ek
                            });
                            return p.state.next({ ...!eB(e) || (d.isValid || f.isValid) && i !== n.isValid ? {} : {
                                    name: e
                                },
                                ...r.resolver || !e ? {
                                    isValid: i
                                } : {},
                                errors: n.errors
                            }), t.shouldFocus && !o && ti(a, O, e ? s : l.mount), o
                        },
                        N = (e, t) => {
                            let r = { ...s.mount ? o : i
                            };
                            return t && (r = function e(t, r) {
                                let n = {};
                                for (let a in t)
                                    if (t.hasOwnProperty(a)) {
                                        let i = t[a],
                                            o = r[a];
                                        if (i && eg(i) && o) {
                                            let t = e(i, o);
                                            eg(t) && (n[a] = t)
                                        } else t[a] && (n[a] = o)
                                    }
                                return n
                            }(t.dirtyFields ? n.dirtyFields : n.touchedFields, r)), e_(e) ? r : eB(e) ? eS(r, e) : e.map(e => eS(r, e))
                        },
                        M = (e, t) => ({
                            invalid: !!eS((t || n).errors, e),
                            isDirty: !!eS((t || n).dirtyFields, e),
                            error: eS((t || n).errors, e),
                            isValidating: !!eS(n.validatingFields, e),
                            isTouched: !!eS((t || n).touchedFields, e)
                        }),
                        P = e => {
                            let t = e ? eH(e) : void 0;
                            null == t || t.forEach(e => eX(n.errors, e)), t ? t.forEach(e => {
                                p.state.next({
                                    name: e,
                                    errors: n.errors
                                })
                            }) : p.state.next({
                                errors: {}
                            })
                        },
                        D = (e, t, r) => {
                            let i = (eS(a, e, {
                                    _f: {}
                                })._f || {}).ref,
                                {
                                    ref: o,
                                    message: s,
                                    type: l,
                                    ...c
                                } = eS(n.errors, e) || {};
                            eI(n.errors, e, { ...c,
                                ...t,
                                ref: i
                            }), p.state.next({
                                name: e,
                                errors: n.errors,
                                isValid: !1
                            }), r && r.shouldFocus && i && i.focus && i.focus()
                        },
                        j = e => p.state.subscribe({
                            next: t => {
                                let r, a, s;
                                if (r = e.name, a = t.name, s = e.exact, (!r || !a || r === a || eH(r).some(e => e && (s ? e === a : e.startsWith(a) || a.startsWith(e)))) && ((e, t, r, n) => {
                                        r(e);
                                        let {
                                            name: a,
                                            ...i
                                        } = e;
                                        return eQ(i) || n && Object.keys(i).length >= Object.keys(t).length || Object.keys(i).find(e => t[e] === (!n || "all"))
                                    })(t, e.formState || d, W, e.reRenderRoot)) {
                                    let r = { ...o
                                    };
                                    e.callback({
                                        values: r,
                                        ...n,
                                        ...t,
                                        defaultValues: i
                                    })
                                }
                            }
                        }).unsubscribe,
                        L = (e, t = {}) => {
                            for (let s of e ? eH(e) : l.mount) l.mount.delete(s), l.array.delete(s), t.keepValue || (eX(a, s), eX(o, s)), t.keepError || eX(n.errors, s), t.keepDirty || eX(n.dirtyFields, s), t.keepTouched || eX(n.touchedFields, s), t.keepIsValidating || eX(n.validatingFields, s), r.shouldUnregister || t.keepDefaultValue || eX(i, s);
                            p.state.next({
                                values: ew(o)
                            }), p.state.next({ ...n,
                                ...!t.keepDirty ? {} : {
                                    isDirty: E()
                                }
                            }), t.keepIsValid || m()
                        },
                        F = ({
                            disabled: e,
                            name: t
                        }) => {
                            if ("boolean" == typeof e && s.mount || e || l.disabled.has(t)) {
                                let r = l.disabled.has(t);
                                e ? l.disabled.add(t) : l.disabled.delete(t), !!e !== r && s.mount && !s.action && m()
                            }
                        },
                        U = (e, t = {}) => {
                            let n = eS(a, e),
                                o = "boolean" == typeof t.disabled || "boolean" == typeof r.disabled,
                                c = !l.registerName.has(e) && n && n._f && !n._f.mount;
                            return (eI(a, e, { ...n || {},
                                _f: { ...n && n._f ? n._f : {
                                        ref: {
                                            name: e
                                        }
                                    },
                                    name: e,
                                    mount: !0,
                                    ...t
                                }
                            }), l.mount.add(e), n && !c) ? F({
                                disabled: "boolean" == typeof t.disabled ? t.disabled : r.disabled,
                                name: e
                            }) : b(e, !0, t.value), { ...o ? {
                                    disabled: t.disabled || r.disabled
                                } : {},
                                ...r.progressive ? {
                                    required: !!t.required,
                                    min: te(t.min),
                                    max: te(t.max),
                                    minLength: te(t.minLength),
                                    maxLength: te(t.maxLength),
                                    pattern: te(t.pattern)
                                } : {},
                                name: e,
                                onChange: k,
                                onBlur: k,
                                ref: o => {
                                    if (o) {
                                        let r;
                                        l.registerName.add(e), U(e, t), l.registerName.delete(e), n = eS(a, e);
                                        let s = e_(o.value) && o.querySelectorAll && o.querySelectorAll("input,select,textarea")[0] || o,
                                            c = "radio" === (r = s).type || "checkbox" === r.type,
                                            u = n._f.refs || [];
                                        (c ? u.find(e => e === s) : s === n._f.ref) || (eI(a, e, {
                                            _f: { ...n._f,
                                                ...c ? {
                                                    refs: [...u.filter(eY), s, ...Array.isArray(eS(i, e)) ? [{}] : []],
                                                    ref: {
                                                        type: s.type,
                                                        name: e
                                                    }
                                                } : {
                                                    ref: s
                                                }
                                            }
                                        }), b(e, !1, void 0, s))
                                    } else(n = eS(a, e, {}))._f && (n._f.mount = !1), (r.shouldUnregister || t.shouldUnregister) && !(ev(l.array, e) && s.action) && l.unMount.add(e)
                                }
                            }
                        },
                        $ = () => r.shouldFocusError && ti(a, O, l.mount),
                        z = (e, t) => async i => {
                            let s;
                            i && (i.preventDefault && i.preventDefault(), i.persist && i.persist());
                            let c = ew(o);
                            if (p.state.next({
                                    isSubmitting: !0
                                }), r.resolver) {
                                let {
                                    errors: e,
                                    values: t
                                } = await x();
                                y(), n.errors = e, c = ew(t)
                            } else await C({
                                fields: a,
                                eventType: "submit"
                            });
                            if (l.disabled.size)
                                for (let e of l.disabled) eX(c, e);
                            if (eX(n.errors, eF), eQ(n.errors)) {
                                p.state.next({
                                    errors: {}
                                });
                                try {
                                    await e(c, i)
                                } catch (e) {
                                    s = e
                                }
                            } else t && await t({ ...n.errors
                            }, i), $(), setTimeout($);
                            if (p.state.next({
                                    isSubmitted: !0,
                                    isSubmitting: !1,
                                    isSubmitSuccessful: eQ(n.errors) && !s,
                                    submitCount: n.submitCount + 1,
                                    errors: n.errors
                                }), s) throw s
                        },
                        B = (e, t = {}) => {
                            let c = e ? ew(e) : i,
                                u = ew(c),
                                f = eQ(e),
                                h = f ? i : u;
                            if (t.keepDefaultValues || (i = c), !t.keepValues) {
                                if (t.keepDirtyValues)
                                    for (let e of Array.from(new Set([...l.mount, ...Object.keys(e2(i, o))]))) {
                                        let t = eS(n.dirtyFields, e),
                                            r = eS(o, e),
                                            a = eS(h, e);
                                        t && !e_(r) ? eI(h, e, r) : t || e_(a) || T(e, a)
                                    } else {
                                        if (ex && e_(e))
                                            for (let e of l.mount) {
                                                let t = eS(a, e);
                                                if (t && t._f) {
                                                    let e = Array.isArray(t._f.refs) ? t._f.refs[0] : t._f.ref;
                                                    if (eJ(e)) {
                                                        let t = e.closest("form");
                                                        if (t) {
                                                            t.reset();
                                                            break
                                                        }
                                                    }
                                                }
                                            }
                                        if (t.keepFieldsRef)
                                            for (let e of l.mount) T(e, eS(h, e));
                                        else a = {}
                                    }
                                o = r.shouldUnregister ? t.keepDefaultValues ? ew(i) : {} : ew(h), p.array.next({
                                    values: { ...h
                                    }
                                }), p.state.next({
                                    values: { ...h
                                    }
                                })
                            }
                            l = {
                                mount: t.keepDirtyValues ? l.mount : new Set,
                                unMount: new Set,
                                array: new Set,
                                registerName: new Set,
                                disabled: new Set,
                                watch: new Set,
                                watchAll: !1,
                                focus: ""
                            }, s.mount = !d.isValid || !!t.keepIsValid || !!t.keepDirtyValues || !r.shouldUnregister && !eQ(h), s.watch = !!r.shouldUnregister, s.keepIsValid = !!t.keepIsValid, s.action = !1, t.keepErrors || (n.errors = {}), p.state.next({
                                submitCount: t.keepSubmitCount ? n.submitCount : 0,
                                isDirty: !f && (t.keepDirty ? n.isDirty : !!(t.keepDefaultValues && !eZ(e, i))),
                                isSubmitted: !!t.keepIsSubmitted && n.isSubmitted,
                                dirtyFields: f ? {} : t.keepDirtyValues ? t.keepDefaultValues && o ? e2(i, o) : n.dirtyFields : t.keepDefaultValues && e ? e2(i, e) : t.keepDirty ? n.dirtyFields : {},
                                touchedFields: t.keepTouched ? n.touchedFields : {},
                                errors: t.keepErrors ? n.errors : {},
                                isSubmitSuccessful: !!t.keepIsSubmitSuccessful && n.isSubmitSuccessful,
                                isSubmitting: !1,
                                defaultValues: i
                            })
                        },
                        q = (e, t) => B(eA(e) ? e(o) : e, { ...r.resetOptions,
                            ...t
                        }),
                        W = e => {
                            n = { ...n,
                                ...e
                            }
                        },
                        Z = {
                            control: {
                                register: U,
                                unregister: L,
                                getFieldState: M,
                                handleSubmit: z,
                                setError: D,
                                _subscribe: j,
                                _runSchema: x,
                                _updateIsValidating: y,
                                _focusError: $,
                                _getWatch: S,
                                _getDirty: E,
                                _setValid: m,
                                _setFieldArray: (e, t = [], i, l, c = !0, u = !0) => {
                                    if (l && i && !r.disabled) {
                                        if (s.action = !0, u && Array.isArray(eS(a, e))) {
                                            let t = i(eS(a, e), l.argA, l.argB);
                                            c && eI(a, e, t)
                                        }
                                        if (u && Array.isArray(eS(n.errors, e))) {
                                            let t, r = i(eS(n.errors, e), l.argA, l.argB);
                                            c && eI(n.errors, e, r), eC(eS(t = n.errors, e)).length || eX(t, e)
                                        }
                                        if ((d.touchedFields || f.touchedFields) && u && Array.isArray(eS(n.touchedFields, e))) {
                                            let t = i(eS(n.touchedFields, e), l.argA, l.argB);
                                            c && eI(n.touchedFields, e, t)
                                        }(d.dirtyFields || f.dirtyFields) && g(), p.state.next({
                                            name: e,
                                            isDirty: E(e, t),
                                            dirtyFields: n.dirtyFields,
                                            errors: n.errors,
                                            isValid: n.isValid
                                        })
                                    } else eI(o, e, t)
                                },
                                _setDisabledField: F,
                                _setErrors: e => {
                                    n.errors = e, p.state.next({
                                        errors: n.errors,
                                        isValid: !1
                                    })
                                },
                                _getFieldArray: e => eC(eS(s.mount ? o : i, e, r.shouldUnregister ? eS(i, e, []) : [])),
                                _reset: B,
                                _resetDefaultValues: () => eA(r.defaultValues) && r.defaultValues().then(e => {
                                    q(e, r.resetOptions), p.state.next({
                                        isLoading: !1
                                    })
                                }),
                                _removeUnmounted: () => {
                                    for (let e of l.unMount) {
                                        let t = eS(a, e);
                                        t && (t._f.refs ? t._f.refs.every(e => !eY(e)) : !eY(t._f.ref)) && L(e)
                                    }
                                    l.unMount = new Set
                                },
                                _disableForm: e => {
                                    "boolean" == typeof e && (p.state.next({
                                        disabled: e
                                    }), ti(a, (t, r) => {
                                        let n = eS(a, r);
                                        n && (t.disabled = n._f.disabled || e, Array.isArray(n._f.refs) && n._f.refs.forEach(t => {
                                            t.disabled = n._f.disabled || e
                                        }))
                                    }, 0, !1))
                                },
                                _subjects: p,
                                _proxyFormState: d,
                                get _fields() {
                                    return a
                                },
                                get _formValues() {
                                    return o
                                },
                                get _state() {
                                    return s
                                },
                                set _state(value) {
                                    s = value
                                },
                                get _defaultValues() {
                                    return i
                                },
                                get _names() {
                                    return l
                                },
                                set _names(value) {
                                    l = value
                                },
                                get _formState() {
                                    return n
                                },
                                get _options() {
                                    return r
                                },
                                set _options(value) {
                                    r = { ...r,
                                        ...value
                                    }
                                }
                            },
                            subscribe: e => (s.mount = !0, f = { ...f,
                                ...e.formState
                            }, j({ ...e,
                                formState: { ...u,
                                    ...e.formState
                                }
                            })),
                            trigger: R,
                            register: U,
                            handleSubmit: z,
                            watch: (e, t) => eA(e) ? p.state.subscribe({
                                next: r => "values" in r && e(r.values || S(void 0, t), r)
                            }) : S(e, t, !0),
                            setValue: T,
                            setValues: e => {
                                let t = eA(e) ? e(o) : e;
                                eZ(o, t) || (o = { ...o,
                                    ...t
                                }, p.state.next({ ...n,
                                    values: o
                                }))
                            },
                            getValues: N,
                            reset: q,
                            resetField: (e, t = {}) => {
                                eS(a, e) && (e_(t.defaultValue) ? T(e, ew(eS(i, e))) : (T(e, t.defaultValue), eI(i, e, ew(t.defaultValue))), t.keepTouched || eX(n.touchedFields, e), t.keepDirty || (eX(n.dirtyFields, e), n.isDirty = t.defaultValue ? E(e, ew(eS(i, e))) : E()), !t.keepError && (eX(n.errors, e), d.isValid && m()), p.state.next({ ...n
                                }))
                            },
                            clearErrors: P,
                            unregister: L,
                            setError: D,
                            setFocus: (e, t = {}) => {
                                let r = eS(a, e),
                                    n = r && r._f;
                                if (n) {
                                    let e = n.refs ? n.refs[0] : n.ref;
                                    e.focus && setTimeout(() => {
                                        e.focus(), t.shouldSelect && eA(e.select) && e.select()
                                    })
                                }
                            },
                            getFieldState: M
                        };
                    return { ...Z,
                        formControl: Z
                    }
                }(e);
                t.current = { ...a,
                    formState: n
                }
            }
        let i = t.current.control;
        return i._options = e, ez(() => {
            let e = i._subscribe({
                formState: i._proxyFormState,
                callback: () => a({ ...i._formState
                }),
                reRenderRoot: !0
            });
            return a(e => ({ ...e,
                isReady: !0
            })), i._formState.isReady = !0, e
        }, [i]), p.default.useEffect(() => i._disableForm(e.disabled), [i, e.disabled]), p.default.useEffect(() => {
            e.mode && (i._options.mode = e.mode), e.reValidateMode && (i._options.reValidateMode = e.reValidateMode)
        }, [i, e.mode, e.reValidateMode]), p.default.useEffect(() => {
            e.errors && (i._setErrors(e.errors), i._focusError())
        }, [i, e.errors]), p.default.useEffect(() => {
            e.shouldUnregister && i._subjects.state.next({
                values: i._getWatch()
            })
        }, [i, e.shouldUnregister]), p.default.useEffect(() => {
            if (i._proxyFormState.isDirty) {
                let e = i._getDirty();
                e !== n.isDirty && i._subjects.state.next({
                    isDirty: e
                })
            }
        }, [i, n.isDirty]), p.default.useEffect(() => {
            var t;
            e.values && !eZ(e.values, r.current) ? (i._reset(e.values, {
                keepFieldsRef: !0,
                ...i._options.resetOptions
            }), (null == (t = i._options.resetOptions) ? void 0 : t.keepIsValid) || i._setValid(), r.current = e.values, a(e => ({ ...e
            }))) : i._resetDefaultValues()
        }, [i, e.values]), p.default.useEffect(() => {
            i._state.mount || (i._setValid(), i._state.mount = !0), i._state.watch && (i._state.watch = !1, i._subjects.state.next({ ...i._formState
            })), i._removeUnmounted()
        }), t.current.formState = p.default.useMemo(() => e$(n, i), [i, n]), t.current
    }
    e.s(["Controller", 0, e => e.render(function(e) {
        let t = p.default.useContext(eU),
            {
                name: r,
                disabled: n,
                control: a = t,
                shouldUnregister: i,
                defaultValue: o,
                exact: s = !0
            } = e,
            l = ev(a._names.array, r),
            c = p.default.useMemo(() => eS(a._formValues, r, eS(a._defaultValues, r, o)), [a, r, o]),
            u = function(e) {
                let t = p.default.useContext(eU),
                    {
                        control: r = t,
                        name: n,
                        defaultValue: a,
                        disabled: i,
                        exact: o,
                        compute: s
                    } = e || {},
                    l = p.default.useRef(a),
                    c = p.default.useRef(s),
                    u = p.default.useRef(void 0),
                    d = p.default.useRef(r),
                    f = p.default.useRef(n);
                c.current = s;
                let [h, m] = p.default.useState(() => {
                    let e = r._getWatch(n, l.current);
                    return c.current ? c.current(e) : e
                }), y = p.default.useCallback(e => {
                    let t = eq(n, r._names, e || r._formValues, !1, l.current);
                    return c.current ? c.current(t) : t
                }, [r._formValues, r._names, n]), g = p.default.useCallback(e => {
                    if (!i) {
                        let t = eq(n, r._names, e || r._formValues, !1, l.current);
                        if (c.current) {
                            let e = c.current(t);
                            eZ(e, u.current) || (m(e), u.current = e)
                        } else m(t)
                    }
                }, [r._formValues, r._names, i, n]);
                ez(() => (d.current === r && eZ(f.current, n) || (d.current = r, f.current = n, g()), r._subscribe({
                    name: n,
                    formState: {
                        values: !0
                    },
                    exact: o,
                    callback: e => {
                        g(e.values)
                    }
                })), [r, o, n, g]), p.default.useEffect(() => r._removeUnmounted());
                let b = d.current !== r,
                    v = f.current,
                    x = p.default.useMemo(() => {
                        if (i) return null;
                        let e = !b && !eZ(v, n);
                        return b || e ? y() : null
                    }, [i, b, n, v, y]);
                return null !== x ? x : h
            }({
                control: a,
                name: r,
                defaultValue: c,
                exact: s
            }),
            d = function(e) {
                let t = p.default.useContext(eU),
                    {
                        control: r = t,
                        disabled: n,
                        name: a,
                        exact: i
                    } = e || {},
                    [o, s] = p.default.useState(() => ({ ...r._formState,
                        defaultValues: r._defaultValues
                    })),
                    l = p.default.useRef({
                        isDirty: !1,
                        isLoading: !1,
                        dirtyFields: !1,
                        touchedFields: !1,
                        validatingFields: !1,
                        isValidating: !1,
                        isValid: !1,
                        errors: !1
                    });
                return ez(() => r._subscribe({
                    name: a,
                    formState: l.current,
                    exact: i,
                    callback: e => {
                        n || s({ ...r._formState,
                            ...e,
                            defaultValues: r._defaultValues
                        })
                    }
                }), [a, n, i]), p.default.useEffect(() => {
                    l.current.isValid && r._setValid(!0)
                }, [r]), p.default.useMemo(() => e$(o, r, l.current, !1), [o, r])
            }({
                control: a,
                name: r,
                exact: s
            }),
            f = p.default.useRef(e),
            h = p.default.useRef(a.register(r, { ...e.rules,
                value: u,
                ..."boolean" == typeof e.disabled ? {
                    disabled: e.disabled
                } : {}
            }));
        f.current = e;
        let m = p.default.useMemo(() => Object.defineProperties({}, {
                invalid: {
                    enumerable: !0,
                    get: () => !!eS(d.errors, r)
                },
                isDirty: {
                    enumerable: !0,
                    get: () => !!eS(d.dirtyFields, r)
                },
                isTouched: {
                    enumerable: !0,
                    get: () => !!eS(d.touchedFields, r)
                },
                isValidating: {
                    enumerable: !0,
                    get: () => !!eS(d.validatingFields, r)
                },
                error: {
                    enumerable: !0,
                    get: () => eS(d.errors, r)
                }
            }), [d, r]),
            y = p.default.useCallback(e => h.current.onChange({
                target: {
                    value: eb(e),
                    name: r
                },
                type: "change"
            }), [r]),
            g = p.default.useCallback(() => h.current.onBlur({
                target: {
                    value: eS(a._formValues, r),
                    name: r
                },
                type: eT
            }), [r, a._formValues]),
            b = p.default.useCallback(e => {
                let t = eS(a._fields, r);
                t && t._f && e && (t._f.ref = {
                    focus: () => eA(e.focus) && e.focus(),
                    select: () => eA(e.select) && e.select(),
                    setCustomValidity: t => eA(e.setCustomValidity) && e.setCustomValidity(t),
                    reportValidity: () => eA(e.reportValidity) && e.reportValidity()
                })
            }, [a._fields, r]),
            v = p.default.useMemo(() => ({
                name: r,
                value: u,
                ..."boolean" == typeof n || d.disabled ? {
                    disabled: d.disabled || n
                } : {},
                onChange: y,
                onBlur: g,
                ref: b
            }), [r, n, d.disabled, y, g, b, u]);
        return p.default.useEffect(() => {
            let e = a._options.shouldUnregister || i;
            a.register(r, { ...f.current.rules,
                ..."boolean" == typeof f.current.disabled ? {
                    disabled: f.current.disabled
                } : {}
            });
            let t = (e, t) => {
                let r = eS(a._fields, e);
                r && r._f && (r._f.mount = t)
            };
            if (t(r, !0), e) {
                let e = ew(eS(a._options.defaultValues, r, f.current.defaultValue));
                eI(a._defaultValues, r, e), e_(eS(a._formValues, r)) && eI(a._formValues, r, e)
            }
            return l || a.register(r), () => {
                (l ? e && !a._state.action : e) ? a.unregister(r): t(r, !1)
            }
        }, [r, a, l, i]), p.default.useEffect(() => {
            a._setDisabledField({
                disabled: n,
                name: r
            })
        }, [n, r, a]), p.default.useMemo(() => ({
            field: v,
            formState: d,
            fieldState: m
        }), [v, d, m])
    }(e)), "FormProvider", 0, e => {
        let {
            children: t,
            watch: r,
            getValues: n,
            getFieldState: a,
            setError: i,
            clearErrors: o,
            setValue: s,
            setValues: l,
            trigger: c,
            formState: u,
            resetField: d,
            reset: f,
            handleSubmit: h,
            unregister: m,
            control: y,
            register: g,
            setFocus: b,
            subscribe: v
        } = e, x = p.default.useMemo(() => ({
            watch: r,
            getValues: n,
            getFieldState: a,
            setError: i,
            clearErrors: o,
            setValue: s,
            setValues: l,
            trigger: c,
            formState: u,
            resetField: d,
            reset: f,
            handleSubmit: h,
            unregister: m,
            control: y,
            register: g,
            setFocus: b,
            subscribe: v
        }), [o, y, u, a, n, h, g, f, d, i, b, s, l, v, c, m, r]);
        return p.default.createElement(eV.Provider, {
            value: x
        }, p.default.createElement(eU.Provider, {
            value: x.control
        }, t))
    }, "appendErrors", 0, eK, "get", 0, eS, "set", 0, eI, "useFieldArray", 0, function(e) {
        let t = p.default.useContext(eU),
            {
                control: r = t,
                name: n,
                keyName: a = "id",
                shouldUnregister: i,
                rules: o
            } = e,
            [s, l] = p.default.useState(r._getFieldArray(n)),
            c = p.default.useRef(r._getFieldArray(n).map(tp)),
            u = p.default.useRef(!1);
        r._names.array.add(n), p.default.useMemo(() => o && s.length >= 0 && r.register(n, o), [r, n, s.length, o]), ez(() => r._subjects.array.subscribe({
            next: ({
                values: e,
                name: t
            }) => {
                if (t === n || !t) {
                    let t = eS(e, n);
                    Array.isArray(t) && (l(t), c.current = t.map(tp))
                }
            }
        }).unsubscribe, [r, n]);
        let d = p.default.useCallback(e => {
            u.current = !0, r._setFieldArray(n, e)
        }, [r, n]);
        return p.default.useEffect(() => {
            r._state.action = !1, ta(n, r._names) && r._subjects.state.next({ ...r._formState
            });
            let e = tt(r._options.mode);
            if (u.current && (!e.isOnSubmit || r._formState.isSubmitted) && !tt(r._options.reValidateMode).isOnSubmit && !e.isOnBlur)
                if (r._options.resolver) r._runSchema([n]).then(e => {
                    r._updateIsValidating([n]);
                    let t = eS(e.errors, n),
                        a = eS(r._formState.errors, n);
                    (a ? !t && a.type || t && (a.type !== t.type || a.message !== t.message) : t && t.type) && (t ? eI(r._formState.errors, n, t) : eX(r._formState.errors, n), r._subjects.state.next({
                        errors: r._formState.errors
                    }))
                });
                else {
                    let e = eS(r._fields, n);
                    e && e._f && !(tt(r._options.reValidateMode).isOnSubmit && tt(r._options.mode).isOnSubmit) && tu(e, r._names.disabled, r._formValues, "all" === r._options.criteriaMode, r._options.shouldUseNativeValidation, !0).then(e => !eQ(e) && r._subjects.state.next({
                        errors: ts(r._formState.errors, e, n)
                    }))
                }
            r._subjects.state.next({
                name: n,
                values: ew(r._formValues)
            }), r._names.focus && ti(r._fields, (e, t) => {
                if (r._names.focus && t.startsWith(r._names.focus) && e.focus) return e.focus(), 1
            }), r._names.focus = "", r._setValid(), u.current = !1
        }, [s, n, r]), p.default.useEffect(() => (eS(r._formValues, n) || r._setFieldArray(n), () => {
            let e, t = !(r._options.shouldUnregister || i);
            u.current && t && r._subjects.state.next({
                name: n,
                values: ew(r._formValues)
            }), t ? (e = eS(r._fields, n)) && e._f && (e._f.mount = !1) : r.unregister(n)
        }), [n, r, a, i]), {
            swap: p.default.useCallback((e, t) => {
                let a = r._getFieldArray(n);
                tw(a, e, t), tw(c.current, e, t), d(a), l(a), r._setFieldArray(n, a, tw, {
                    argA: e,
                    argB: t
                }, !1)
            }, [d, n, r]),
            move: p.default.useCallback((e, t) => {
                let a = r._getFieldArray(n);
                tb(a, e, t), tb(c.current, e, t), d(a), l(a), r._setFieldArray(n, a, tb, {
                    argA: e,
                    argB: t
                }, !1)
            }, [d, n, r]),
            prepend: p.default.useCallback((e, t) => {
                let a = eH(ew(e)),
                    i = tv(r._getFieldArray(n), a);
                r._names.focus = th(n, 0, t), c.current = tv(c.current, a.map(tp)), d(i), l(i), r._setFieldArray(n, i, tv, {
                    argA: ty(e)
                })
            }, [d, n, r]),
            append: p.default.useCallback((e, t) => {
                let a = eH(ew(e)),
                    i = tm(r._getFieldArray(n), a);
                r._names.focus = th(n, i.length - 1, t), c.current = tm(c.current, a.map(tp)), d(i), l(i), r._setFieldArray(n, i, tm, {
                    argA: ty(e)
                })
            }, [d, n, r]),
            remove: p.default.useCallback(e => {
                let t = tx(r._getFieldArray(n), e);
                c.current = tx(c.current, e), d(t), l(t), Array.isArray(eS(r._fields, n)) || eI(r._fields, n, void 0), r._setFieldArray(n, t, tx, {
                    argA: e
                })
            }, [d, n, r]),
            insert: p.default.useCallback((e, t, a) => {
                let i = eH(ew(t)),
                    o = tg(r._getFieldArray(n), e, i);
                r._names.focus = th(n, e, a), c.current = tg(c.current, e, i.map(tp)), d(o), l(o), r._setFieldArray(n, o, tg, {
                    argA: e,
                    argB: ty(t)
                })
            }, [d, n, r]),
            update: p.default.useCallback((e, t) => {
                let a = ew(t),
                    i = t_(r._getFieldArray(n), e, a);
                c.current = [...i].map((t, r) => t && r !== e ? c.current[r] : tp()), d(i), l([...i]), r._setFieldArray(n, i, t_, {
                    argA: e,
                    argB: a
                }, !0, !1)
            }, [d, n, r]),
            replace: p.default.useCallback(e => {
                let t = eH(ew(e));
                c.current = t.map(tp), d([...t]), l([...t]), r._setFieldArray(n, [...t], e => e, {}, !0, !1)
            }, [d, n, r]),
            fields: p.default.useMemo(() => s.map((e, t) => ({ ...e,
                [a]: c.current[t] || tp()
            })), [s, a])
        }
    }, "useForm", 0, tC, "useFormContext", 0, () => p.default.useContext(eV)], 670118);
    let tE = (e, t, r) => {
            if (e && "reportValidity" in e) {
                let n = eS(r, t);
                e.setCustomValidity(n && n.message || ""), e.reportValidity()
            }
        },
        tS = (e, t) => {
            for (let r in t.fields) {
                let n = t.fields[r];
                n && n.ref && "reportValidity" in n.ref ? tE(n.ref, r, e) : n && n.refs && n.refs.forEach(t => tE(t, r, e))
            }
        },
        tA = (e, t) => {
            t.shouldUseNativeValidation && tS(e, t);
            let r = {};
            for (let n in e) {
                let a = eS(t.fields, n),
                    i = Object.assign(e[n] || {}, {
                        ref: a && a.ref
                    });
                if (tI(t.names || Object.keys(e), n)) {
                    let e = Object.assign({}, eS(r, n));
                    eI(e, "root", i), eI(r, n, e)
                } else eI(r, n, i)
            }
            return r
        },
        tI = (e, t) => {
            let r = tT(t);
            return e.some(e => tT(e).match(`^${r}\\.\\d+`))
        };

    function tT(e) {
        return e.replace(/\]|\[/g, "")
    }
    var tk = e.i(784357),
        tO = e.i(851271);

    function tR(e, t) {
        try {
            var r = e()
        } catch (e) {
            return t(e)
        }
        return r && r.then ? r.then(void 0, t) : r
    }

    function tN(e, t, r) {
        if (void 0 === r && (r = {}), "_def" in e && "object" == typeof e._def && "typeName" in e._def) return function(n, a, i) {
            try {
                return Promise.resolve(tR(function() {
                    return Promise.resolve(e["sync" === r.mode ? "parse" : "parseAsync"](n, t)).then(function(e) {
                        return i.shouldUseNativeValidation && tS({}, i), {
                            errors: {},
                            values: r.raw ? Object.assign({}, n) : e
                        }
                    })
                }, function(e) {
                    if (Array.isArray(null == e ? void 0 : e.issues)) return {
                        values: {},
                        errors: tA(function(e, t) {
                            for (var r = {}; e.length;) {
                                var n = e[0],
                                    a = n.code,
                                    i = n.message,
                                    o = n.path.join(".");
                                if (!r[o])
                                    if ("unionErrors" in n) {
                                        var s = n.unionErrors[0].errors[0];
                                        r[o] = {
                                            message: s.message,
                                            type: s.code
                                        }
                                    } else r[o] = {
                                        message: i,
                                        type: a
                                    };
                                if ("unionErrors" in n && n.unionErrors.forEach(function(t) {
                                        return t.errors.forEach(function(t) {
                                            return e.push(t)
                                        })
                                    }), t) {
                                    var l = r[o].types,
                                        c = l && l[n.code];
                                    r[o] = eK(o, t, r, a, c ? [].concat(c, n.message) : n.message)
                                }
                                e.shift()
                            }
                            return r
                        }(e.errors, !i.shouldUseNativeValidation && "all" === i.criteriaMode), i)
                    };
                    throw e
                }))
            } catch (e) {
                return Promise.reject(e)
            }
        };
        if ("_zod" in e && "object" == typeof e._zod) return function(n, a, i) {
            try {
                return Promise.resolve(tR(function() {
                    return Promise.resolve(("sync" === r.mode ? tO.parse : tO.parseAsync)(e, n, t)).then(function(e) {
                        return i.shouldUseNativeValidation && tS({}, i), {
                            errors: {},
                            values: r.raw ? Object.assign({}, n) : e
                        }
                    })
                }, function(e) {
                    if (e instanceof tk.$ZodError) return {
                        values: {},
                        errors: tA(function(e, t) {
                            for (var r = {}; e.length;) {
                                var n = e[0],
                                    a = n.code,
                                    i = n.message,
                                    o = n.path.join(".");
                                if (!r[o])
                                    if ("invalid_union" === n.code && n.errors.length > 0) {
                                        var s = n.errors[0][0];
                                        r[o] = {
                                            message: s.message,
                                            type: s.code
                                        }
                                    } else r[o] = {
                                        message: i,
                                        type: a
                                    };
                                if ("invalid_union" === n.code && n.errors.forEach(function(t) {
                                        return t.forEach(function(t) {
                                            return e.push(t)
                                        })
                                    }), t) {
                                    var l = r[o].types,
                                        c = l && l[n.code];
                                    r[o] = eK(o, t, r, a, c ? [].concat(c, n.message) : n.message)
                                }
                                e.shift()
                            }
                            return r
                        }(e.issues, !i.shouldUseNativeValidation && "all" === i.criteriaMode), i)
                    };
                    throw e
                }))
            } catch (e) {
                return Promise.reject(e)
            }
        };
        throw Error("Invalid input: not a Zod schema")
    }
    e.s(["zodResolver", 0, tN], 889029);
    var tM = e.i(435894),
        tP = e.i(573337),
        tD = e.i(655740),
        tj = e.i(285650);

    function tL() {
        return t || (t = window.matchMedia("(width < 1024px)")), t.matches
    }

    function tF() {
        return r || (r = window.matchMedia("(pointer: coarse)")), r.matches
    }
    e.s(["isNarrowViewport", 0, tL, "isTouchScreenOnlyDevice", 0, tF, "useIsNarrowViewport", 0, function(e) {
        let r, n, a, i = (0, c.c)(5);
        i[0] !== e ? (r = () => "client-only" !== e || tL(), i[0] = e, i[1] = r) : r = i[1];
        let [o, s] = (0, p.useState)(r);
        return i[2] !== o ? (n = () => {
            tL() !== o && (0, p.startTransition)(() => {
                s(tL())
            });
            let e = e => {
                (0, p.startTransition)(() => {
                    s(e.matches)
                })
            };
            return t.addEventListener("change", e), () => {
                t.removeEventListener("change", e)
            }
        }, i[2] = o, i[3] = n) : n = i[3], i[4] === Symbol.for("react.memo_cache_sentinel") ? (a = [], i[4] = a) : a = i[4], (0, p.useEffect)(n, a), o
    }], 922445);
    let tU = p.default.createContext({
            listenersEnabled: !1,
            setListenersEnabled: () => null
        }),
        t$ = () => p.default.useContext(tU);
    e.s(["HotkeyContextProvider", 0, e => {
        let t, r, n, a, i, o = (0, c.c)(8),
            {
                children: s
            } = e,
            [u, d] = p.default.useState(!0);
        o[0] === Symbol.for("react.memo_cache_sentinel") ? (t = e => {
            tF() ? d(!1) : d(e)
        }, o[0] = t) : t = o[0];
        let f = t;
        o[1] === Symbol.for("react.memo_cache_sentinel") ? (r = () => {
            tF() && d(!1)
        }, n = [], o[1] = r, o[2] = n) : (r = o[1], n = o[2]), p.default.useEffect(r, n), o[3] !== u ? (a = {
            listenersEnabled: u,
            setListenersEnabled: f
        }, o[3] = u, o[4] = a) : a = o[4];
        let h = a;
        return o[5] !== s || o[6] !== h ? (i = (0, l.jsx)(tU.Provider, {
            value: h,
            children: s
        }), o[5] = s, o[6] = h, o[7] = i) : i = o[7], i
    }, "useHotkeyContext", 0, t$], 632567);
    let tz = tP.z.object({
            email: tP.z.email()
        }),
        tB = () => {
            let {
                setRoute: e,
                setConnector: t,
                route: r,
                connectorStatus: n,
                connector: a,
                connectorRoute: i
            } = (0, g.useSiwx)(), {
                updateLastConnectorId: o
            } = (0, J.useLastConnector)(), {
                setListenersEnabled: s
            } = t$(), c = (0, b.useWallet)("magic"), d = (0, H.useAmplitudeAnalytics)(), f = (0, $.useTranslations)(), [m, y] = p.default.useState(null), v = tC({
                defaultValues: {
                    email: (0, Q.createWalletCache)().email.value ? ? ""
                },
                mode: "onChange",
                resolver: tN(tz)
            });
            p.default.useEffect(() => {
                v.getValues("email") && v.trigger("email")
            }, [v]);
            let x = p.default.useCallback(async ({
                    email: r
                }) => {
                    y(null), d.trackEvent(K.Events.StartMagicFlow, {
                        type: i,
                        error_type: null
                    });
                    try {
                        let {
                            data: e,
                            status: t
                        } = await tD.axios.post("/api/auth/magic-check", {
                            email: r
                        }, {
                            headers: {
                                "Content-Type": "application/json"
                            },
                            validateStatus: () => !0
                        });
                        if (429 === t) {
                            let r = e ? .message || f("auth.pleaseTryAgainLater");
                            (0, tj.logAuthFlowError)({
                                authStatus: "error",
                                authType: "magic-email",
                                connectorId: "magic",
                                errorCode: t,
                                errorMessage: r,
                                errorName: "MagicCheckRateLimitError",
                                errorResponse: "string" == typeof e ? e : JSON.stringify(e ? ? null),
                                trigger: "rate-limit"
                            }), y(r);
                            return
                        }
                    } catch {}
                    let n = (0, Q.createWalletCache)();
                    n.state.value = {
                        type: "magic",
                        connectorId: "magic",
                        magicAuthType: "email",
                        oauthProvider: void 0,
                        connectionState: "requesting",
                        email: r
                    }, n.email.value = r, window.geq && window.geq.identify(r), t({
                        id: c.connector.id,
                        name: c.connector.name
                    }), o(c.id), e(h.AuthRoute.CONNECT)
                }, [d, i, t, e, c, o]),
                w = v.formState.isSubmitting || r === h.AuthRoute.CONNECT && n === h.ConnectorStates.CONNECTING && "magic" === a.id;
            return (0, l.jsxs)(l.Fragment, {
                children: [(0, l.jsxs)("form", {
                    onSubmit: v.handleSubmit(x),
                    noValidate: !0,
                    className: `relative w-full h-14 border border-border-light rounded-lg overflow-hidden transition-colors focus-within:ring-2 ring-brand-500/70 ${m?"!border-red-500":""}`,
                    children: [(0, l.jsx)(tM.Input, { ...v.register("email", {
                            onBlur: () => s(!0),
                            onChange: () => y(null)
                        }),
                        onFocus: () => s(!1),
                        onKeyDown: e => {
                            "Enter" === e.key && (e.preventDefault(), w || v.handleSubmit(x)())
                        },
                        disabled: w,
                        id: "magic-email-input",
                        placeholder: f("auth.emailAddress"),
                        variant: "outlined",
                        className: "w-full h-full !border-0 !rounded-none focus-visible:!ring-0 hover:!bg-transparent !pr-[110px]",
                        type: "email"
                    }), (0, l.jsx)("div", {
                        className: "absolute right-2 w-full max-w-[90px] top-1/2 -translate-y-1/2 z-10",
                        children: (0, l.jsx)(u.Button, {
                            type: "submit",
                            variant: "default",
                            disabled: w || !v.watch("email") || !!v.formState.errors.email,
                            className: "w-full h-9 text-sm font-medium",
                            children: w ? (0, l.jsx)("div", {
                                className: "w-4 h-4 border-2 border-white/20 border-t-white/80 rounded-full animate-spin"
                            }) : f("auth.continue")
                        })
                    })]
                }), m && (0, l.jsx)("p", {
                    className: "text-sm text-red-500 px-1",
                    children: m
                })]
            })
        };

    function tq() {
        return (tq = Object.assign.bind()).apply(null, arguments)
    }
    let tW = function(e) {
        return p.createElement("svg", tq({
            xmlns: "http://www.w3.org/2000/svg",
            width: 32,
            height: 32,
            viewBox: "0 0 32 32"
        }, e), s || (s = p.createElement("g", {
            fill: "currentColor"
        }, p.createElement("path", {
            d: "M29.44 16.318c0-.993-.089-1.947-.255-2.864H16v5.422h7.535c-.331 1.744-1.324 3.22-2.813 4.213v3.525h4.544c2.647-2.444 4.175-6.033 4.175-10.296Z"
        }), p.createElement("path", {
            d: "M16 30c3.78 0 6.949-1.247 9.265-3.385l-4.544-3.525c-1.247.84-2.838 1.349-4.722 1.349-3.64 0-6.733-2.456-7.84-5.765l-2.717 2.09-1.941 1.525c2.304 4.569 7.025 7.713 12.498 7.713Z"
        }), p.createElement("path", {
            d: "M8.16 18.66c-.28-.84-.445-1.731-.445-2.66s.165-1.82.445-2.66V9.725H3.502C2.547 11.609 2 13.734 2 16s.547 4.391 1.502 6.275h3.332z"
        }), p.createElement("path", {
            d: "M16 7.575c2.062 0 3.895.713 5.358 2.087l4.009-4.009C22.936 3.388 19.78 2 16 2 10.527 2 5.805 5.144 3.502 9.725L8.16 13.34c1.107-3.309 4.2-5.765 7.84-5.765"
        }))))
    };

    function tZ() {
        let e, t = (0, c.c)(1);
        return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, l.jsx)(Y, {
            provider: "google",
            event: K.Events.StartGoogleFlow,
            translationKey: "auth.continueWithGoogle",
            children: tV
        }), t[0] = e) : e = t[0], e
    }

    function tV(e) {
        let {
            onClick: t,
            label: r,
            isDisabled: n
        } = e;
        return (0, l.jsxs)(u.Button, {
            onClick: t,
            disabled: n,
            className: "w-full h-[52px] justify-center gap-2.5",
            children: [(0, l.jsx)(tW, {
                className: "size-4 text-white fill-white relative"
            }), (0, l.jsx)("span", {
                children: r
            })]
        })
    }

    function tK(e) {
        let t, r, n, a, i, o, s, u, d = (0, c.c)(12);
        d[0] !== e ? ({ ...t
        } = e, d[0] = e, d[1] = t) : t = d[1];
        let {
            wallets: f
        } = (0, b.useWallets)();
        return d[2] === Symbol.for("react.memo_cache_sentinel") ? (r = (0, l.jsx)(q, {}), n = (0, l.jsx)(tZ, {}), a = (0, l.jsx)(z, {}), i = (0, l.jsx)(tB, {}), d[2] = r, d[3] = n, d[4] = a, d[5] = i) : (r = d[2], n = d[3], a = d[4], i = d[5]), d[6] !== f ? (o = (0, l.jsx)(es, {
            wallets: f
        }), d[6] = f, d[7] = o) : o = d[7], d[8] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, l.jsx)(B, {}), d[8] = s) : s = d[8], d[9] !== t || d[10] !== o ? (u = (0, l.jsxs)("div", {
            className: "flex flex-col items-center w-full gap-[18px]",
            ...t,
            children: [r, n, a, i, o, s]
        }), d[9] = t, d[10] = o, d[11] = u) : u = d[11], u
    }
}, 333114, e => {
    "use strict";
    var t = e.i(805949);
    e.s(["useAccount", () => t.useConnection])
}, 776092, e => {
    "use strict";
    e.i(369761);
    var t = e.i(885370),
        r = e.i(813846);
    e.s(["getCpkOperation", 0, e => {
        switch (e) {
            case t.CallType.Call:
                return r.OperationType.Call;
            case t.CallType.DelegateCall:
                return r.OperationType.DelegateCall;
            default:
                throw Error(`Unsupported CallType ${e} passed into 'getCPKOperation'`)
        }
    }])
}, 631503, e => {
    "use strict";
    e.s(["TransactionMetadata", () => w, "TransactionType", () => g, "default", () => E, "getTransactionType", () => x, "requiresManualTradingSetup", () => v, "requiresWalletDeployment", () => b]);
    var t, r, n = e.i(318594),
        a = e.i(416340),
        i = e.i(73836),
        o = e.i(423708),
        s = e.i(246290),
        l = e.i(620190),
        c = e.i(510954),
        u = e.i(57096),
        d = e.i(776092),
        f = e.i(660006),
        p = e.i(53950),
        h = e.i(631222),
        m = e.i(423582);
    let y = new Map;
    var g = ((t = {})[t.Magic = 0] = "Magic", t[t.EOA = 1] = "EOA", t[t.CustomEOA = 2] = "CustomEOA", t[t.DepositWallet = 3] = "DepositWallet", t);
    let b = e => "safe" === e || "depositWallet" === e,
        v = e => b(e),
        x = (e = "proxy") => "depositWallet" === e ? 3 : +("safe" === e);
    var w = ((r = {}).Approval = "approval", r.Withdraw = "withdraw", r.Split = "split", r.Merge = "merge", r.Redeem = "redeem", r.Convert = "convert", r.AmmTrade = "ammTrade", r.AmmLiquidity = "ammLiquidity", r.Tip = "tip", r.FunWithdraw = "funwithdraw", r.Default = "", r);
    let _ = e => {
            let t = [String(e)];
            e instanceof Error && (t.push(e.name, e.message), e.cause && t.push(String(e.cause)));
            try {
                t.push(JSON.stringify(e))
            } catch {}
            return t.join(" ").toLowerCase()
        },
        C = async (e, t) => {
            let r = t.toLowerCase(),
                n = y.get(r);
            if (n) return n;
            let a = (async () => {
                try {
                    let t = (0, m.getRelayerClient)(e),
                        r = await t.deployDepositWallet();
                    if (!await (0, m.waitTillMined)(r)) throw Error("Deposit wallet recovery deploy was not confirmed on-chain")
                } catch (e) {
                    if (_(e).includes("already deployed")) return;
                    throw e
                }
            })();
            y.set(r, a);
            try {
                return await a
            } finally {
                y.delete(r)
            }
        },
        E = () => {
            let e = (0, n.useQueryClient)(),
                {
                    proxyAddress: t,
                    connector: r,
                    chainId: y,
                    authenticationType: g
                } = (0, s.useAccount)(),
                {
                    switchChainAsync: b
                } = (0, i.useSwitchChain)(),
                {
                    data: v
                } = (0, o.useWalletClient)({
                    chainId: h.MATIC_CONFIG.chainId
                }),
                x = (0, a.useCallback)(async () => {
                    let e = await (0, l.ensurePolygonSigner)(r, v, y, b);
                    if (!e) throw Error("Failed to get signer");
                    return e
                }, [r, v, y, b]),
                w = (0, a.useCallback)(async (e, r, n, a, i) => {
                    try {
                        let t = await x();
                        return (0, m.getRelayerClient)(t).executeProxyTransactions(e, i)
                    } catch (e) {
                        throw (0, f.handleError)(e, "sendMagicTransaction", t), e
                    }
                }, [t, x]),
                E = (0, a.useCallback)(async (e, r, n, a, i, o) => {
                    try {
                        let t = await x(),
                            r = e.map(e => ({
                                to: e.to,
                                data: e.data,
                                value: e.value,
                                operation: (0, d.getCpkOperation)(e.typeCode)
                            }));
                        return (0, m.getRelayerClient)(t).executeSafeTransactions(r, o)
                    } catch (e) {
                        throw (0, f.handleError)(e, "sendEOATransaction", t), e
                    }
                }, [x, t]),
                S = (0, a.useCallback)(async (e, r, n, a) => {
                    try {
                        let t = await x(),
                            r = e.map(e => ({
                                to: e.to,
                                data: e.data,
                                value: e.value,
                                operation: (0, d.getCpkOperation)(e.typeCode)
                            }));
                        return (0, m.getRelayerClient)(t).executeManualTransactions(r, {
                            gasPrice: BigInt(a)
                        })
                    } catch (e) {
                        throw (0, f.handleError)(e, "sendCustomEOATransaction", t), e
                    }
                }, [x, t]),
                A = (0, a.useCallback)(async (r, n) => {
                    try {
                        let a = await x(),
                            i = r.map(e => ({
                                target: e.to,
                                value: e.value ? ? "0",
                                data: e.data
                            })),
                            o = (0, m.getRelayerClient)(a),
                            s = () => o.executeDepositWalletBatch(i, n, String(Math.floor(Date.now() / 1e3) + 1800));
                        try {
                            return await s()
                        } catch (o) {
                            let r;
                            if ("magic" !== g || !((r = _(o)).includes("wallet registry validation failed") && r.includes("is not registered") || r.includes('contract function "nonce" returned no data') || r.includes("address is not a contract")) || !n) throw o;
                            p.logger.info("[sendDepositWalletTransaction] recovering undeployed deposit wallet", {
                                proxyAddress: t,
                                walletAddress: n
                            }), await C(a, n), p.logger.info("[dw] retrying deposit wallet after nonce error");
                            let i = c.queryKeys[u.QueryKey.Auth].depositWalletDeployed(n).queryKey;
                            await e.invalidateQueries({
                                queryKey: i
                            }), e.setQueryData(i, !0);
                            try {
                                let e = await s();
                                return p.logger.info("[dw] deposit wallet retry succeeded", {
                                    proxyAddress: t,
                                    walletAddress: n
                                }), e
                            } catch (e) {
                                throw p.logger.error("[dw] deposit wallet retry failed", {
                                    proxyAddress: t,
                                    walletAddress: n,
                                    error: e
                                }), e
                            }
                        }
                    } catch (e) {
                        throw (0, f.handleError)(e, "sendDepositWalletTransaction", t), e
                    }
                }, [g, x, t, e]);
            return {
                sendTransaction: (0, a.useCallback)(async (e, t, r, n, a, i, o, s, l) => {
                    switch (e) {
                        case 0:
                            return w(t, r, n, a, s);
                        case 1:
                            return E(t, r, n, a, o, s);
                        case 2:
                            if (!i) throw Error("No gasPrice was specified");
                            return S(t, r, n, i);
                        case 3:
                            if (!l) throw Error("No walletAddress was specified for deposit wallet");
                            return A(t, l);
                        default:
                            throw Error("Unknown transaction type.")
                    }
                }, [w, E, S, A]),
                sendMagicTransaction: w,
                sendEOATransaction: E,
                sendCustomEOATransaction: S,
                sendDepositWalletTransaction: A
            }
        }
}, 392566, e => {
    "use strict";
    var t = e.i(53950);

    function r() {
        return "u" > typeof performance && "function" == typeof performance.now ? performance.now() : Date.now()
    }

    function n(e, r, a = {}) {
        t.logger[e](`[ctf_v2] ${r}`, {
            feature: "ctf_v2_migration",
            event: r,
            route: window.location.pathname,
            ...a
        })
    }
    e.s(["amountBucket", 0, function(e) {
        if (void 0 === e) return "unknown";
        let t = "bigint" == typeof e ? Number(e) / 1e6 : "string" == typeof e ? Number(e) : e;
        return !Number.isFinite(t) || t <= 0 ? "zero_or_invalid" : t < .01 ? "<0.01" : t < 1 ? "0.01-1" : t < 10 ? "1-10" : t < 100 ? "10-100" : t < 1e3 ? "100-1000" : "1000+"
    }, "ctfV2Error", 0, (e, t) => n("error", e, t), "ctfV2Info", 0, (e, t) => n("info", e, t), "ctfV2Warn", 0, (e, t) => n("warn", e, t), "durationSince", 0, function(e) {
        return Math.max(0, Math.round(r() - e))
    }, "getErrorTelemetry", 0, function(e) {
        if (e instanceof Error) return {
            errorName: e.name,
            errorMessage: e.message
        };
        if ("string" == typeof e) return {
            errorMessage: e
        };
        try {
            return {
                errorMessage: JSON.stringify(e)
            }
        } catch {
            return {
                errorMessage: String(e)
            }
        }
    }, "startCtfV2Timer", 0, function() {
        return r()
    }])
}, 458164, e => {
    "use strict";
    var t, r, n, a, i, o, s, l = ((t = {}).Market = "Market", t.Limit = "Limit", t.AMM = "AMM", t.RFQ = "RFQ", t),
        c = ((r = {}).ALL_KEYS = "poly_clob_api_key_map", r),
        u = ((n = {}).Approved = "Approved", n.Unapproved = "Unapproved", n),
        d = ((a = {}).Default = "default", a.Pending = "pending", a.Success = "success", a.Failed = "failed", a),
        f = ((i = {}).Market = "Market", i.Limit = "Limit", i),
        p = ((o = {}).SHARES = "shares", o.PRICE = "price", o.GENERIC = "generic", o),
        h = ((s = {}).INSUFFICIENT_BALANCE = "insufficient_balance", s.INSUFFICIENT_SHARES = "insufficient_shares", s.SHARES_ABOVE_MAX = "shares_above_max", s.SHARES_BELOW_MIN = "shares_below_min", s);
    e.s(["AllowanceState", () => d, "AllowanceStatus", () => u, "ClobKey", () => c, "FilledOrderType", () => f, "OrderErrorField", () => p, "OrderErrorType", () => h, "OrderType", () => l])
}, 76579, (e, t, r) => {
    t.exports = [{
        constant: !0,
        inputs: [{
            name: "interfaceId",
            type: "bytes4"
        }],
        name: "supportsInterface",
        outputs: [{
            name: "",
            type: "bool"
        }],
        payable: !1,
        stateMutability: "view",
        type: "function"
    }, {
        inputs: [],
        payable: !1,
        stateMutability: "nonpayable",
        type: "constructor"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !0,
            name: "operator",
            type: "address"
        }, {
            indexed: !0,
            name: "from",
            type: "address"
        }, {
            indexed: !0,
            name: "to",
            type: "address"
        }, {
            indexed: !1,
            name: "id",
            type: "uint256"
        }, {
            indexed: !1,
            name: "value",
            type: "uint256"
        }],
        name: "TransferSingle",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !0,
            name: "operator",
            type: "address"
        }, {
            indexed: !0,
            name: "from",
            type: "address"
        }, {
            indexed: !0,
            name: "to",
            type: "address"
        }, {
            indexed: !1,
            name: "ids",
            type: "uint256[]"
        }, {
            indexed: !1,
            name: "values",
            type: "uint256[]"
        }],
        name: "TransferBatch",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !0,
            name: "owner",
            type: "address"
        }, {
            indexed: !0,
            name: "operator",
            type: "address"
        }, {
            indexed: !1,
            name: "approved",
            type: "bool"
        }],
        name: "ApprovalForAll",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !1,
            name: "value",
            type: "string"
        }, {
            indexed: !0,
            name: "id",
            type: "uint256"
        }],
        name: "URI",
        type: "event"
    }, {
        constant: !0,
        inputs: [{
            name: "owner",
            type: "address"
        }, {
            name: "id",
            type: "uint256"
        }],
        name: "balanceOf",
        outputs: [{
            name: "",
            type: "uint256"
        }],
        payable: !1,
        stateMutability: "view",
        type: "function"
    }, {
        constant: !0,
        inputs: [{
            name: "owners",
            type: "address[]"
        }, {
            name: "ids",
            type: "uint256[]"
        }],
        name: "balanceOfBatch",
        outputs: [{
            name: "",
            type: "uint256[]"
        }],
        payable: !1,
        stateMutability: "view",
        type: "function"
    }, {
        constant: !1,
        inputs: [{
            name: "operator",
            type: "address"
        }, {
            name: "approved",
            type: "bool"
        }],
        name: "setApprovalForAll",
        outputs: [],
        payable: !1,
        stateMutability: "nonpayable",
        type: "function"
    }, {
        constant: !0,
        inputs: [{
            name: "owner",
            type: "address"
        }, {
            name: "operator",
            type: "address"
        }],
        name: "isApprovedForAll",
        outputs: [{
            name: "",
            type: "bool"
        }],
        payable: !1,
        stateMutability: "view",
        type: "function"
    }, {
        constant: !1,
        inputs: [{
            name: "from",
            type: "address"
        }, {
            name: "to",
            type: "address"
        }, {
            name: "id",
            type: "uint256"
        }, {
            name: "value",
            type: "uint256"
        }, {
            name: "data",
            type: "bytes"
        }],
        name: "safeTransferFrom",
        outputs: [],
        payable: !1,
        stateMutability: "nonpayable",
        type: "function"
    }, {
        constant: !1,
        inputs: [{
            name: "from",
            type: "address"
        }, {
            name: "to",
            type: "address"
        }, {
            name: "ids",
            type: "uint256[]"
        }, {
            name: "values",
            type: "uint256[]"
        }, {
            name: "data",
            type: "bytes"
        }],
        name: "safeBatchTransferFrom",
        outputs: [],
        payable: !1,
        stateMutability: "nonpayable",
        type: "function"
    }]
}, 973468, e => {
    "use strict";
    e.i(369761);
    var t = e.i(885370),
        r = e.i(56339),
        n = e.i(866674),
        a = e.i(76579);
    e.s(["erc1155ApprovalTransaction", 0, (e, n, i) => ({
        to: e,
        typeCode: t.CallType.Call,
        data: (0, r.encodeFunctionData)({
            abi: a.default,
            functionName: "setApprovalForAll",
            args: [n, i]
        }),
        value: "0"
    }), "erc20ApprovalTransaction", 0, (e, a, i) => ({
        to: e,
        typeCode: t.CallType.Call,
        data: (0, r.encodeFunctionData)({
            abi: n.erc20Abi,
            functionName: "approve",
            args: [a, i]
        }),
        value: "0"
    })])
}, 455243, 380979, e => {
    "use strict";
    var t = e.i(548133),
        r = e.i(463621);
    async function n(e, n) {
        let {
            allowFailure: a = !0,
            chainId: i,
            contracts: o,
            ...s
        } = n, l = e.getClient({
            chainId: i
        });
        return (0, r.getAction)(l, t.multicall, "multicall")({
            allowFailure: a,
            contracts: o,
            ...s
        })
    }
    e.s(["multicall", 0, n], 455243);
    var a = e.i(167164);
    e.s(["readContract", 0, function(e, t) {
        let {
            chainId: n,
            ...i
        } = t, o = e.getClient({
            chainId: n
        });
        return (0, r.getAction)(o, a.readContract, "readContract")(i)
    }], 380979)
}, 820219, 130278, 675702, 989505, e => {
    "use strict";
    e.s(["default", () => L], 820219);
    var t, r = e.i(416340),
        n = e.i(306243),
        a = e.i(914640),
        i = e.i(333114),
        o = e.i(134850),
        s = e.i(628684),
        l = e.i(635103),
        c = e.i(631503),
        u = e.i(784521),
        d = e.i(305457),
        f = e.i(660006),
        p = e.i(53950),
        h = e.i(423582),
        m = e.i(392566),
        y = e.i(631222),
        g = e.i(458164),
        b = e.i(973468),
        v = e.i(999061),
        x = e.i(866674),
        w = e.i(285510),
        _ = e.i(455243),
        C = e.i(380979);
    async function E(e, t) {
        let {
            allowFailure: r = !0,
            blockNumber: n,
            blockTag: a,
            ...i
        } = t, o = t.contracts;
        try {
            let t = {};
            for (let [r, n] of o.entries()) {
                let a = n.chainId ? ? e.state.chainId;
                t[a] || (t[a] = []), t[a] ? .push({
                    contract: n,
                    index: r
                })
            }
            let s = (await Promise.all(Object.entries(t).map(([t, o]) => (0, _.multicall)(e, { ...i,
                    allowFailure: r,
                    blockNumber: n,
                    blockTag: a,
                    chainId: Number.parseInt(t, 10),
                    contracts: o.map(({
                        contract: e
                    }) => e)
                })))).flat(),
                l = Object.values(t).flatMap(e => e.map(({
                    index: e
                }) => e));
            return s.reduce((e, t, r) => (e && (e[l[r]] = t), e), [])
        } catch (i) {
            if (i instanceof w.ContractFunctionExecutionError) throw i;
            let t = () => o.map(t => (0, C.readContract)(e, { ...t,
                blockNumber: n,
                blockTag: a
            }));
            if (r) return (await Promise.allSettled(t())).map(e => "fulfilled" === e.status ? {
                result: e.value,
                status: "success"
            } : {
                error: e.reason,
                result: void 0,
                status: "failure"
            });
            return await Promise.all(t())
        }
    }
    var S = e.i(645934),
        A = e.i(58794),
        I = e.i(478088),
        T = e.i(912504);

    function k(e = {}) {
        let t = (0, T.useConfig)(e),
            n = (0, I.useChainId)({
                config: t
            }),
            a = (0, r.useMemo)(() => {
                let t = e.contracts ? .[0] ? .chainId;
                if ((e.contracts ? ? []).every(e => e.chainId === t)) return t
            }, [e.contracts]),
            i = function(e, t = {}) {
                return { ...t.query,
                    queryFn: async r => {
                        let n = [],
                            a = r.queryKey[1].contracts.length;
                        for (let e = 0; e < a; e++) {
                            let a = r.queryKey[1].contracts[e],
                                i = (t.contracts ? .[e]).abi;
                            n.push({ ...a,
                                abi: i
                            })
                        }
                        let {
                            scopeKey: i,
                            ...o
                        } = r.queryKey[1];
                        return E(e, { ...o,
                            contracts: n
                        })
                    },
                    queryKey: function(e = {}) {
                        let t = [],
                            r = !1;
                        for (let n of e.contracts ? ? []) {
                            let {
                                abi: a,
                                ...i
                            } = n;
                            void 0 === i.chainId && (r = !0);
                            let o = i.chainId ? ? e.chainId;
                            t.push({ ...i,
                                ...o ? {
                                    chainId: o
                                } : {}
                            })
                        }
                        let {
                            chainId: n,
                            ...a
                        } = e;
                        return ["readContracts", (0, S.filterQueryOptions)({ ...a,
                            ...r && e.chainId ? {
                                chainId: e.chainId
                            } : {},
                            contracts: t
                        })]
                    }(t)
                }
            }(t, { ...e,
                chainId: e.chainId ? ? a ? ? n
            });
        return (0, A.useQuery)(i)
    }
    e.s(["useReadContracts", 0, k], 130278);
    let O = [{
        constant: !0,
        inputs: [{
            name: "owner",
            type: "address"
        }, {
            name: "id",
            type: "uint256"
        }],
        name: "balanceOf",
        outputs: [{
            name: "",
            type: "uint256"
        }],
        payable: !1,
        stateMutability: "view",
        type: "function"
    }, {
        constant: !0,
        inputs: [{
            name: "interfaceId",
            type: "bytes4"
        }],
        name: "supportsInterface",
        outputs: [{
            name: "",
            type: "bool"
        }],
        payable: !1,
        stateMutability: "view",
        type: "function"
    }, {
        constant: !0,
        inputs: [{
            name: "",
            type: "bytes32"
        }, {
            name: "",
            type: "uint256"
        }],
        name: "payoutNumerators",
        outputs: [{
            name: "",
            type: "uint256"
        }],
        payable: !1,
        stateMutability: "view",
        type: "function"
    }, {
        constant: !1,
        inputs: [{
            name: "from",
            type: "address"
        }, {
            name: "to",
            type: "address"
        }, {
            name: "ids",
            type: "uint256[]"
        }, {
            name: "values",
            type: "uint256[]"
        }, {
            name: "data",
            type: "bytes"
        }],
        name: "safeBatchTransferFrom",
        outputs: [],
        payable: !1,
        stateMutability: "nonpayable",
        type: "function"
    }, {
        constant: !0,
        inputs: [{
            name: "owners",
            type: "address[]"
        }, {
            name: "ids",
            type: "uint256[]"
        }],
        name: "balanceOfBatch",
        outputs: [{
            name: "",
            type: "uint256[]"
        }],
        payable: !1,
        stateMutability: "view",
        type: "function"
    }, {
        constant: !1,
        inputs: [{
            name: "operator",
            type: "address"
        }, {
            name: "approved",
            type: "bool"
        }],
        name: "setApprovalForAll",
        outputs: [],
        payable: !1,
        stateMutability: "nonpayable",
        type: "function"
    }, {
        constant: !0,
        inputs: [{
            name: "",
            type: "bytes32"
        }],
        name: "payoutDenominator",
        outputs: [{
            name: "",
            type: "uint256"
        }],
        payable: !1,
        stateMutability: "view",
        type: "function"
    }, {
        constant: !0,
        inputs: [{
            name: "owner",
            type: "address"
        }, {
            name: "operator",
            type: "address"
        }],
        name: "isApprovedForAll",
        outputs: [{
            name: "",
            type: "bool"
        }],
        payable: !1,
        stateMutability: "view",
        type: "function"
    }, {
        constant: !1,
        inputs: [{
            name: "from",
            type: "address"
        }, {
            name: "to",
            type: "address"
        }, {
            name: "id",
            type: "uint256"
        }, {
            name: "value",
            type: "uint256"
        }, {
            name: "data",
            type: "bytes"
        }],
        name: "safeTransferFrom",
        outputs: [],
        payable: !1,
        stateMutability: "nonpayable",
        type: "function"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !0,
            name: "conditionId",
            type: "bytes32"
        }, {
            indexed: !0,
            name: "oracle",
            type: "address"
        }, {
            indexed: !0,
            name: "questionId",
            type: "bytes32"
        }, {
            indexed: !1,
            name: "outcomeSlotCount",
            type: "uint256"
        }],
        name: "ConditionPreparation",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !0,
            name: "conditionId",
            type: "bytes32"
        }, {
            indexed: !0,
            name: "oracle",
            type: "address"
        }, {
            indexed: !0,
            name: "questionId",
            type: "bytes32"
        }, {
            indexed: !1,
            name: "outcomeSlotCount",
            type: "uint256"
        }, {
            indexed: !1,
            name: "payoutNumerators",
            type: "uint256[]"
        }],
        name: "ConditionResolution",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !0,
            name: "stakeholder",
            type: "address"
        }, {
            indexed: !1,
            name: "collateralToken",
            type: "address"
        }, {
            indexed: !0,
            name: "parentCollectionId",
            type: "bytes32"
        }, {
            indexed: !0,
            name: "conditionId",
            type: "bytes32"
        }, {
            indexed: !1,
            name: "partition",
            type: "uint256[]"
        }, {
            indexed: !1,
            name: "amount",
            type: "uint256"
        }],
        name: "PositionSplit",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !0,
            name: "stakeholder",
            type: "address"
        }, {
            indexed: !1,
            name: "collateralToken",
            type: "address"
        }, {
            indexed: !0,
            name: "parentCollectionId",
            type: "bytes32"
        }, {
            indexed: !0,
            name: "conditionId",
            type: "bytes32"
        }, {
            indexed: !1,
            name: "partition",
            type: "uint256[]"
        }, {
            indexed: !1,
            name: "amount",
            type: "uint256"
        }],
        name: "PositionsMerge",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !0,
            name: "redeemer",
            type: "address"
        }, {
            indexed: !0,
            name: "collateralToken",
            type: "address"
        }, {
            indexed: !0,
            name: "parentCollectionId",
            type: "bytes32"
        }, {
            indexed: !1,
            name: "conditionId",
            type: "bytes32"
        }, {
            indexed: !1,
            name: "indexSets",
            type: "uint256[]"
        }, {
            indexed: !1,
            name: "payout",
            type: "uint256"
        }],
        name: "PayoutRedemption",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !0,
            name: "operator",
            type: "address"
        }, {
            indexed: !0,
            name: "from",
            type: "address"
        }, {
            indexed: !0,
            name: "to",
            type: "address"
        }, {
            indexed: !1,
            name: "id",
            type: "uint256"
        }, {
            indexed: !1,
            name: "value",
            type: "uint256"
        }],
        name: "TransferSingle",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !0,
            name: "operator",
            type: "address"
        }, {
            indexed: !0,
            name: "from",
            type: "address"
        }, {
            indexed: !0,
            name: "to",
            type: "address"
        }, {
            indexed: !1,
            name: "ids",
            type: "uint256[]"
        }, {
            indexed: !1,
            name: "values",
            type: "uint256[]"
        }],
        name: "TransferBatch",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !0,
            name: "owner",
            type: "address"
        }, {
            indexed: !0,
            name: "operator",
            type: "address"
        }, {
            indexed: !1,
            name: "approved",
            type: "bool"
        }],
        name: "ApprovalForAll",
        type: "event"
    }, {
        anonymous: !1,
        inputs: [{
            indexed: !1,
            name: "value",
            type: "string"
        }, {
            indexed: !0,
            name: "id",
            type: "uint256"
        }],
        name: "URI",
        type: "event"
    }, {
        constant: !1,
        inputs: [{
            name: "oracle",
            type: "address"
        }, {
            name: "questionId",
            type: "bytes32"
        }, {
            name: "outcomeSlotCount",
            type: "uint256"
        }],
        name: "prepareCondition",
        outputs: [],
        payable: !1,
        stateMutability: "nonpayable",
        type: "function"
    }, {
        constant: !1,
        inputs: [{
            name: "questionId",
            type: "bytes32"
        }, {
            name: "payouts",
            type: "uint256[]"
        }],
        name: "reportPayouts",
        outputs: [],
        payable: !1,
        stateMutability: "nonpayable",
        type: "function"
    }, {
        constant: !1,
        inputs: [{
            name: "collateralToken",
            type: "address"
        }, {
            name: "parentCollectionId",
            type: "bytes32"
        }, {
            name: "conditionId",
            type: "bytes32"
        }, {
            name: "partition",
            type: "uint256[]"
        }, {
            name: "amount",
            type: "uint256"
        }],
        name: "splitPosition",
        outputs: [],
        payable: !1,
        stateMutability: "nonpayable",
        type: "function"
    }, {
        constant: !1,
        inputs: [{
            name: "collateralToken",
            type: "address"
        }, {
            name: "parentCollectionId",
            type: "bytes32"
        }, {
            name: "conditionId",
            type: "bytes32"
        }, {
            name: "partition",
            type: "uint256[]"
        }, {
            name: "amount",
            type: "uint256"
        }],
        name: "mergePositions",
        outputs: [],
        payable: !1,
        stateMutability: "nonpayable",
        type: "function"
    }, {
        constant: !1,
        inputs: [{
            name: "collateralToken",
            type: "address"
        }, {
            name: "parentCollectionId",
            type: "bytes32"
        }, {
            name: "conditionId",
            type: "bytes32"
        }, {
            name: "indexSets",
            type: "uint256[]"
        }],
        name: "redeemPositions",
        outputs: [],
        payable: !1,
        stateMutability: "nonpayable",
        type: "function"
    }, {
        constant: !0,
        inputs: [{
            name: "conditionId",
            type: "bytes32"
        }],
        name: "getOutcomeSlotCount",
        outputs: [{
            name: "",
            type: "uint256"
        }],
        payable: !1,
        stateMutability: "view",
        type: "function"
    }, {
        constant: !0,
        inputs: [{
            name: "oracle",
            type: "address"
        }, {
            name: "questionId",
            type: "bytes32"
        }, {
            name: "outcomeSlotCount",
            type: "uint256"
        }],
        name: "getConditionId",
        outputs: [{
            name: "",
            type: "bytes32"
        }],
        payable: !1,
        stateMutability: "pure",
        type: "function"
    }, {
        constant: !0,
        inputs: [{
            name: "parentCollectionId",
            type: "bytes32"
        }, {
            name: "conditionId",
            type: "bytes32"
        }, {
            name: "indexSet",
            type: "uint256"
        }],
        name: "getCollectionId",
        outputs: [{
            name: "",
            type: "bytes32"
        }],
        payable: !1,
        stateMutability: "view",
        type: "function"
    }, {
        constant: !0,
        inputs: [{
            name: "collateralToken",
            type: "address"
        }, {
            name: "collectionId",
            type: "bytes32"
        }],
        name: "getPositionId",
        outputs: [{
            name: "",
            type: "uint256"
        }],
        payable: !1,
        stateMutability: "pure",
        type: "function"
    }];
    e.s(["ConditionalTokensAbi", 0, O], 675702);
    var R = ((t = R || {}).UsdcCtf = "UsdcCtf", t.UsdcExchange = "UsdcExchange", t.UsdcNegRiskExchange = "UsdcNegRiskExchange", t.UsdcNegRiskAdapter = "UsdcNegRiskAdapter", t.CtfExchangeIsApprovedForAll = "CtfExchangeIsApprovedForAll", t.CtfNegRiskExchangeIsApprovedForAll = "CtfNegRiskExchangeIsApprovedForAll", t.CtfNegRiskAdapterIsApprovedForAll = "CtfNegRiskAdapterIsApprovedForAll", t.UsdceCollateralOnramp = "UsdceCollateralOnramp", t.UsdcCollateralAdapter = "UsdcCollateralAdapter", t.UsdcNegRiskCollateralAdapter = "UsdcNegRiskCollateralAdapter", t.CtfCollateralAdapterIsApprovedForAll = "CtfCollateralAdapterIsApprovedForAll", t.CtfNegRiskCollateralAdapterIsApprovedForAll = "CtfNegRiskCollateralAdapterIsApprovedForAll", t);
    let N = e => {
        let t, n, a, i, o, s, l, c, u, d, f, h, m, b, w, _, C, E, S, A, I, T, R, N, M, L, F, U, $, z, B, q, W = (0, v.c)(127),
            {
                chainId: Z,
                chainConfig: V,
                proxyAddress: K,
                enabled: H,
                gcTime: G
            } = e,
            Q = V[Z],
            J = V[Z];
        W[0] !== K || W[1] !== J.conditional ? (t = [K, J.conditional], W[0] = K, W[1] = J.conditional, W[2] = t) : t = W[2];
        let Y = t;
        W[3] !== Z || W[4] !== Q.collateral || W[5] !== Y ? (n = {
            address: Q.collateral,
            abi: x.erc20Abi,
            functionName: "allowance",
            args: Y,
            chainId: Z
        }, W[3] = Z, W[4] = Q.collateral, W[5] = Y, W[6] = n) : n = W[6];
        let X = V[Z],
            ee = V[Z];
        W[7] !== K || W[8] !== ee.exchange ? (a = [K, ee.exchange], W[7] = K, W[8] = ee.exchange, W[9] = a) : a = W[9];
        let et = a;
        W[10] !== Z || W[11] !== X.collateral || W[12] !== et ? (i = {
            address: X.collateral,
            abi: x.erc20Abi,
            functionName: "allowance",
            args: et,
            chainId: Z
        }, W[10] = Z, W[11] = X.collateral, W[12] = et, W[13] = i) : i = W[13];
        let er = V[Z],
            en = V[Z];
        W[14] !== K || W[15] !== en.exchange ? (o = [K, en.exchange], W[14] = K, W[15] = en.exchange, W[16] = o) : o = W[16];
        let ea = o;
        W[17] !== Z || W[18] !== er.conditional || W[19] !== ea ? (s = {
            address: er.conditional,
            abi: O,
            functionName: "isApprovedForAll",
            args: ea,
            chainId: Z
        }, W[17] = Z, W[18] = er.conditional, W[19] = ea, W[20] = s) : s = W[20];
        let ei = V[Z],
            eo = V[Z];
        W[21] !== K || W[22] !== eo.negRiskExchange ? (l = [K, eo.negRiskExchange], W[21] = K, W[22] = eo.negRiskExchange, W[23] = l) : l = W[23];
        let es = l;
        W[24] !== Z || W[25] !== ei.collateral || W[26] !== es ? (c = {
            address: ei.collateral,
            abi: x.erc20Abi,
            functionName: "allowance",
            args: es,
            chainId: Z
        }, W[24] = Z, W[25] = ei.collateral, W[26] = es, W[27] = c) : c = W[27];
        let el = V[Z],
            ec = V[Z];
        W[28] !== K || W[29] !== ec.negRiskAdapter ? (u = [K, ec.negRiskAdapter], W[28] = K, W[29] = ec.negRiskAdapter, W[30] = u) : u = W[30];
        let eu = u;
        W[31] !== Z || W[32] !== el.collateral || W[33] !== eu ? (d = {
            address: el.collateral,
            abi: x.erc20Abi,
            functionName: "allowance",
            args: eu,
            chainId: Z
        }, W[31] = Z, W[32] = el.collateral, W[33] = eu, W[34] = d) : d = W[34];
        let ed = V[Z],
            ef = V[Z];
        W[35] !== K || W[36] !== ef.negRiskExchange ? (f = [K, ef.negRiskExchange], W[35] = K, W[36] = ef.negRiskExchange, W[37] = f) : f = W[37];
        let ep = f;
        W[38] !== Z || W[39] !== ed.conditional || W[40] !== ep ? (h = {
            address: ed.conditional,
            abi: O,
            functionName: "isApprovedForAll",
            args: ep,
            chainId: Z
        }, W[38] = Z, W[39] = ed.conditional, W[40] = ep, W[41] = h) : h = W[41];
        let eh = V[Z],
            em = V[Z];
        W[42] !== K || W[43] !== em.negRiskAdapter ? (m = [K, em.negRiskAdapter], W[42] = K, W[43] = em.negRiskAdapter, W[44] = m) : m = W[44];
        let ey = m;
        W[45] !== Z || W[46] !== eh.conditional || W[47] !== ey ? (b = {
            address: eh.conditional,
            abi: O,
            functionName: "isApprovedForAll",
            args: ey,
            chainId: Z
        }, W[45] = Z, W[46] = eh.conditional, W[47] = ey, W[48] = b) : b = W[48], W[49] !== K ? (w = [K, y.COLLATERAL_ONRAMP_ADDRESS], W[49] = K, W[50] = w) : w = W[50];
        let eg = w;
        W[51] !== Z || W[52] !== eg ? (_ = {
            address: y.USDCE_ADDRESS,
            abi: x.erc20Abi,
            functionName: "allowance",
            args: eg,
            chainId: Z
        }, W[51] = Z, W[52] = eg, W[53] = _) : _ = W[53];
        let eb = V[Z];
        W[54] !== K ? (C = [K, y.COLLATERAL_ADAPTER_ADDRESS], W[54] = K, W[55] = C) : C = W[55];
        let ev = C;
        W[56] !== Z || W[57] !== eb.collateral || W[58] !== ev ? (E = {
            address: eb.collateral,
            abi: x.erc20Abi,
            functionName: "allowance",
            args: ev,
            chainId: Z
        }, W[56] = Z, W[57] = eb.collateral, W[58] = ev, W[59] = E) : E = W[59];
        let ex = V[Z];
        W[60] !== K ? (S = [K, y.NEG_RISK_COLLATERAL_ADAPTER_ADDRESS], W[60] = K, W[61] = S) : S = W[61];
        let ew = S;
        W[62] !== Z || W[63] !== ex.collateral || W[64] !== ew ? (A = {
            address: ex.collateral,
            abi: x.erc20Abi,
            functionName: "allowance",
            args: ew,
            chainId: Z
        }, W[62] = Z, W[63] = ex.collateral, W[64] = ew, W[65] = A) : A = W[65];
        let e_ = V[Z];
        W[66] !== K ? (I = [K, y.COLLATERAL_ADAPTER_ADDRESS], W[66] = K, W[67] = I) : I = W[67];
        let eC = I;
        W[68] !== Z || W[69] !== e_.conditional || W[70] !== eC ? (T = {
            address: e_.conditional,
            abi: O,
            functionName: "isApprovedForAll",
            args: eC,
            chainId: Z
        }, W[68] = Z, W[69] = e_.conditional, W[70] = eC, W[71] = T) : T = W[71];
        let eE = V[Z];
        W[72] !== K ? (R = [K, y.NEG_RISK_COLLATERAL_ADAPTER_ADDRESS], W[72] = K, W[73] = R) : R = W[73];
        let eS = R;
        W[74] !== Z || W[75] !== eE.conditional || W[76] !== eS ? (N = {
            address: eE.conditional,
            abi: O,
            functionName: "isApprovedForAll",
            args: eS,
            chainId: Z
        }, W[74] = Z, W[75] = eE.conditional, W[76] = eS, W[77] = N) : N = W[77], W[78] !== i || W[79] !== s || W[80] !== c || W[81] !== d || W[82] !== h || W[83] !== b || W[84] !== _ || W[85] !== E || W[86] !== A || W[87] !== n || W[88] !== T || W[89] !== N ? (M = [n, i, s, c, d, h, b, _, E, A, T, N], W[78] = i, W[79] = s, W[80] = c, W[81] = d, W[82] = h, W[83] = b, W[84] = _, W[85] = E, W[86] = A, W[87] = n, W[88] = T, W[89] = N, W[90] = M) : M = W[90];
        let eA = M;
        W[91] !== H || W[92] !== G ? (L = {
            enabled: H,
            gcTime: G,
            select: P
        }, W[91] = H, W[92] = G, W[93] = L) : L = W[93], W[94] !== eA || W[95] !== L ? (F = {
            contracts: eA,
            query: L
        }, W[94] = eA, W[95] = L, W[96] = F) : F = W[96];
        let {
            data: eI,
            isFetched: eT,
            isFetching: ek,
            isRefetching: eO,
            refetch: eR,
            isError: eN,
            error: eM
        } = k(F);
        W[97] !== eM ? .message || W[98] !== eN ? (U = () => {
            eN && p.logger.error("[useAllowanceReads]", {
                error: eM ? .message
            })
        }, W[97] = eM ? .message, W[98] = eN, W[99] = U) : U = W[99], W[100] !== eM || W[101] !== eN ? ($ = [eN, eM], W[100] = eM, W[101] = eN, W[102] = $) : $ = W[102], r.default.useEffect(U, $);
        e: {
            let e, t, r, n;
            if (!eT || eN || !eI) {
                let e;
                eN && p.logger.error("[useAllowanceReads] error: ", {
                    address: K,
                    chainId: Z,
                    error: eM ? .message
                }), W[103] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                    allowances: [],
                    areAllAllowancesApproved: !1,
                    areSomeAllowancesApproved: !1,
                    hasCtfExchangeV2Approval: !1
                }, W[103] = e) : e = W[103], z = e;
                break e
            }
            if (W[104] !== V || W[105] !== Z || W[106] !== eI) e = (t = [{
                name: "UsdcCtf",
                type: "USDC",
                address: V[Z].conditional,
                token: V[Z].collateral,
                status: eI[0]
            }, {
                name: "UsdcExchange",
                type: "USDC",
                address: V[Z].exchange,
                token: V[Z].collateral,
                status: eI[1]
            }, {
                name: "CtfExchangeIsApprovedForAll",
                type: "CTF",
                address: V[Z].exchange,
                token: V[Z].conditional,
                status: eI[2]
            }, {
                name: "UsdcNegRiskExchange",
                type: "USDC",
                address: V[Z].negRiskExchange,
                token: V[Z].collateral,
                status: eI[3]
            }, {
                name: "UsdcNegRiskAdapter",
                type: "USDC",
                address: V[Z].negRiskAdapter,
                token: V[Z].collateral,
                status: eI[4]
            }, {
                name: "CtfNegRiskExchangeIsApprovedForAll",
                type: "CTF",
                address: V[Z].negRiskExchange,
                token: V[Z].conditional,
                status: eI[5]
            }, {
                name: "CtfNegRiskAdapterIsApprovedForAll",
                type: "CTF",
                address: V[Z].negRiskAdapter,
                token: V[Z].conditional,
                status: eI[6]
            }, {
                name: "UsdceCollateralOnramp",
                type: "USDC",
                address: y.COLLATERAL_ONRAMP_ADDRESS,
                token: y.USDCE_ADDRESS,
                status: eI[7]
            }, {
                name: "UsdcCollateralAdapter",
                type: "USDC",
                address: y.COLLATERAL_ADAPTER_ADDRESS,
                token: V[Z].collateral,
                status: eI[8]
            }, {
                name: "UsdcNegRiskCollateralAdapter",
                type: "USDC",
                address: y.NEG_RISK_COLLATERAL_ADAPTER_ADDRESS,
                token: V[Z].collateral,
                status: eI[9]
            }, {
                name: "CtfCollateralAdapterIsApprovedForAll",
                type: "CTF",
                address: y.COLLATERAL_ADAPTER_ADDRESS,
                token: V[Z].conditional,
                status: eI[10]
            }, {
                name: "CtfNegRiskCollateralAdapterIsApprovedForAll",
                type: "CTF",
                address: y.NEG_RISK_COLLATERAL_ADAPTER_ADDRESS,
                token: V[Z].conditional,
                status: eI[11]
            }]).every(D),
            r = t.some(j),
            W[104] = V,
            W[105] = Z,
            W[106] = eI,
            W[107] = e,
            W[108] = t,
            W[109] = r;
            else e = W[107],
            t = W[108],
            r = W[109];
            let a = r,
                i = eI[2] === g.AllowanceStatus.Approved;W[110] !== e || W[111] !== i || W[112] !== t || W[113] !== a ? (n = {
                allowances: t,
                areAllAllowancesApproved: e,
                areSomeAllowancesApproved: a,
                hasCtfExchangeV2Approval: i
            }, W[110] = e, W[111] = i, W[112] = t, W[113] = a, W[114] = n) : n = W[114],
            z = n
        }
        let {
            allowances: eP,
            areAllAllowancesApproved: eD,
            areSomeAllowancesApproved: ej,
            hasCtfExchangeV2Approval: eL
        } = z;
        W[115] !== H || W[116] !== eR ? (B = async () => {
            H && await eR()
        }, W[115] = H, W[116] = eR, W[117] = B) : B = W[117];
        let eF = B;
        return W[118] !== eP || W[119] !== eD || W[120] !== ej || W[121] !== eL || W[122] !== eT || W[123] !== ek || W[124] !== eO || W[125] !== eF ? (q = {
            allowances: eP,
            hasLoadedAllowances: eT,
            areAllAllowancesApproved: eD,
            areSomeAllowancesApproved: ej,
            hasCtfExchangeV2Approval: eL,
            loadAllowanceMap: eF,
            isFetching: ek,
            isRefetching: eO
        }, W[118] = eP, W[119] = eD, W[120] = ej, W[121] = eL, W[122] = eT, W[123] = ek, W[124] = eO, W[125] = eF, W[126] = q) : q = W[126], q
    };

    function M(e) {
        let {
            result: t
        } = e;
        return t ? g.AllowanceStatus.Approved : g.AllowanceStatus.Unapproved
    }

    function P(e) {
        return e.map(M)
    }

    function D(e) {
        return e.status === g.AllowanceStatus.Approved
    }

    function j(e) {
        return e.status === g.AllowanceStatus.Approved
    }
    e.s(["useAllowanceReads", 0, N], 989505);
    let L = function() {
        let e = (0, d.useGoogleAnalytics)(),
            {
                connector: t
            } = (0, i.useAccount)(),
            {
                authenticated: v,
                authenticationType: x,
                proxyAddress: w,
                walletMode: _
            } = (0, u.useAccountContext)(["authenticated", "authenticationType", "proxyAddress", "walletMode"]),
            {
                nonce: C,
                incrementNonce: E,
                refreshNonce: S
            } = (0, s.useSafe)(),
            {
                nonce: A,
                incrementNonce: I,
                refreshNonce: T,
                isDepositWallet: k
            } = (0, l.useDepositWallet)(),
            {
                sendTransaction: O
            } = (0, c.default)(),
            [R, M] = (0, r.useState)(null),
            [P, D] = (0, r.useState)(),
            [j, L] = (0, r.useState)(g.AllowanceState.Default),
            [F, U] = (0, r.useState)(6e5),
            {
                chainId: $
            } = y.MATIC_CONFIG,
            z = (0, r.useMemo)(() => !!t && !!w && w !== a.zeroAddress && !!$, [t, w, $]),
            {
                allowances: B,
                areAllAllowancesApproved: q,
                areSomeAllowancesApproved: W,
                hasLoadedAllowances: Z,
                loadAllowanceMap: V
            } = N({
                chainId: $,
                chainConfig: y.chainConfig,
                proxyAddress: w || a.zeroAddress,
                enabled: z,
                gcTime: F
            }),
            [K, H] = (0, r.useState)(!1),
            G = (0, r.useCallback)(async (t, r, a) => {
                M(null), D(void 0);
                let i = t.filter(e => !0 === r ? e.status === g.AllowanceStatus.Approved : e.status === g.AllowanceStatus.Unapproved),
                    s = i.map(e => e.name);
                (0, m.ctfV2Info)("allowance_update_prepared", {
                    where: a,
                    authType: x,
                    hasProxyAddress: !!w,
                    shouldRevoke: !!r,
                    allowanceCount: i.length,
                    allowanceNames: s
                });
                let l = [];
                for (let e of i) "USDC" === e.type ? l.push((0, b.erc20ApprovalTransaction)(e.token, e.address, r ? 0 n : n.maxUint256)) : l.push((0, b.erc1155ApprovalTransaction)(e.token, e.address, !r));
                if (0 === l.length) return void(0, m.ctfV2Info)("allowance_update_skipped_no_transactions", {
                    where: a,
                    authType: x,
                    hasProxyAddress: !!w,
                    shouldRevoke: !!r
                });
                L(g.AllowanceState.Pending), H(!0);
                try {
                    let t = (0, c.getTransactionType)(_),
                        n = t === c.TransactionType.DepositWallet ? A : t === c.TransactionType.EOA ? C : void 0;
                    if (t === c.TransactionType.DepositWallet && null == n) {
                        (0, m.ctfV2Info)("allowance_update_deposit_wallet_nonce_refetch_started", {
                            where: a,
                            authType: x,
                            hasProxyAddress: !!w
                        });
                        let {
                            data: e
                        } = await T();
                        n = e, (0, m.ctfV2Info)("allowance_update_deposit_wallet_nonce_refetch_completed", {
                            where: a,
                            authType: x,
                            hasProxyAddress: !!w,
                            hasDepositWalletNonce: null != e
                        })
                    }
                    let u = await O(t, l, 0, y.Network.Matic, 0, void 0, n, c.TransactionMetadata.Approval.valueOf(), t === c.TransactionType.DepositWallet ? w : void 0);
                    t === c.TransactionType.EOA ? E() : t === c.TransactionType.DepositWallet && await I();
                    let d = await (0, h.waitTillMined)(u);
                    (0, m.ctfV2Info)("allowance_update_mined", {
                        where: a,
                        authType: x,
                        hasProxyAddress: !!w,
                        allowanceCount: i.length,
                        allowanceNames: s,
                        mined: d
                    });
                    let f = {
                        type: "allowance",
                        allowance_names: JSON.stringify(i.map(e => e.name)),
                        allowance_should_revoke: !!r,
                        event_status: "success"
                    };
                    if (e.trackEvent(o.GAEventAction.TRANSACTION, f), d) return L(g.AllowanceState.Success), M(null), D(void 0), U(1e3), setTimeout(() => V().then(() => (H(!1), L(g.AllowanceState.Default))), 3e3)
                } catch (l) {
                    (0, m.ctfV2Error)("allowance_update_failed", {
                        where: a,
                        authType: x,
                        hasProxyAddress: !!w,
                        allowanceCount: i.length,
                        allowanceNames: s,
                        proxyAddress: w,
                        walletMode: _,
                        ...(0, m.getErrorTelemetry)(l)
                    }), (0, f.handleError)(l, "[useAllowances > updateProxyAllowances]", w);
                    let t = String(l);
                    try {
                        l ? .code === "ACTION_REJECTED" || t.toLowerCase().includes("user denied message signature") ? M("The signature was rejected. Please try again!") : t.toLowerCase().includes("connection error") ? M("Something went wrong. Please try again!") : M(`Try Again! ${"{}"!==t?t:""}`)
                    } catch {
                        M(`Try Again! ${"{}"!==t?t:""}`)
                    }
                    let n = {
                        type: "allowance",
                        allowance_names: JSON.stringify(i.map(e => e.name)),
                        allowance_should_revoke: !!r,
                        event_status: "error",
                        event_error_msg: t
                    };
                    return e.trackEvent(o.GAEventAction.TRANSACTION, n), V().then(() => (H(!1), L(g.AllowanceState.Default)))
                } finally {
                    H(!1), k ? T() : S()
                }
            }, [O, V, x, _, w, S, e, C, E, A, k, I, T]),
            Q = (0, r.useCallback)(async (e, r) => {
                p.logger.info("useAllowances - triggerAllApprovals - isUpdatingAllowances", {
                    isUpdatingAllowances: K,
                    shouldRevoke: e,
                    authenticated: v,
                    proxyAddress: w,
                    connector: t,
                    allowances: B,
                    where: r
                }), v && t && !K && await G(B, e, r)
            }, [G, t, v, w, B, K]);
        return (0, r.useEffect)(() => {
            1e3 === F && setTimeout(() => {
                U(6e5)
            }, 1e4)
        }, [F]), {
            allowanceErrorMsg: R,
            allowanceState: j,
            areAllAllowancesApproved: q,
            areSomeAllowancesApproved: W,
            hasLoadedAllowances: Z,
            isUpdatingAllowances: K,
            loadAllowanceMap: V,
            triggerAllApprovals: Q
        }
    }
}, 461327, e => {
    "use strict";
    let t = {
            get url() {
                return `file://${e.P("node_modules/.pnpm/zustand@5.0.13_@types+react@19.2.14_immer@11.1.8_react@19.2.6_use-sync-external-store@1.6.0_react@19.2.6_/node_modules/zustand/esm/middleware.mjs")}`
            }
        },
        r = e => !!e.dispatchFromDevtools && "function" == typeof e.dispatch,
        n = new Map,
        a = e => {
            let t = n.get(e);
            return t ? Object.fromEntries(Object.entries(t.stores).map(([e, t]) => [e, t.getState()])) : {}
        },
        i = /.+ (.+) .+/,
        o = /^([^@]+)@/,
        s = (e, t) => {
            let r;
            try {
                r = JSON.parse(e)
            } catch (e) {
                console.error("[zustand devtools middleware] Could not parse the received json", e)
            }
            void 0 !== r && t(r)
        },
        l = e => t => {
            try {
                let r = e(t);
                if (r instanceof Promise) return r;
                return {
                    then: e => l(e)(r),
                    catch (e) {
                        return this
                    }
                }
            } catch (e) {
                return {
                    then(e) {
                        return this
                    },
                    catch: t => l(t)(e)
                }
            }
        };
    e.s(["devtools", 0, (e, l = {}) => (c, u, d) => {
        let f, {
            enabled: p,
            anonymousActionType: h,
            store: m,
            ...y
        } = l;
        try {
            f = (null != p ? p : (t.env ? t.env.MODE : void 0) !== "production") && window.__REDUX_DEVTOOLS_EXTENSION__
        } catch (e) {}
        if (!f) return e(c, u, d);
        let {
            connection: g,
            ...b
        } = ((e, t, r) => {
            if (void 0 === e) return {
                type: "untracked",
                connection: t.connect(r)
            };
            let a = n.get(r.name);
            if (a) return {
                type: "tracked",
                store: e,
                ...a
            };
            let i = {
                connection: t.connect(r),
                stores: {}
            };
            return n.set(r.name, i), {
                type: "tracked",
                store: e,
                ...i
            }
        })(m, f, y), v = !0;
        d.setState = (e, t, r) => {
            let n = c(e, t);
            if (!v) return n;
            let s = void 0 === r ? {
                type: h || function(e) {
                    var t, r, n;
                    if (!e) return;
                    let a = e.split("\n"),
                        s = a.findIndex(e => e.includes("api.setState"));
                    if (s < 0) return;
                    let l = (null == (t = a[s + 1]) ? void 0 : t.trim()) || "";
                    return (null == (r = i.exec(l)) ? void 0 : r[1]) || (null == (n = o.exec(l)) ? void 0 : n[1])
                }(Error().stack) || "anonymous"
            } : "string" == typeof r ? {
                type: r
            } : r;
            return void 0 === m ? null == g || g.send(s, u()) : null == g || g.send({ ...s,
                type: `${m}/${s.type}`
            }, { ...a(y.name),
                [m]: d.getState()
            }), n
        }, d.devtools = {
            cleanup: () => {
                g && "function" == typeof g.unsubscribe && g.unsubscribe(), ((e, t) => {
                    if (void 0 === t) return;
                    let r = n.get(e);
                    r && (delete r.stores[t], 0 === Object.keys(r.stores).length && n.delete(e))
                })(y.name, m)
            }
        };
        let x = (...e) => {
                let t = v;
                v = !1, c(...e), v = t
            },
            w = e(d.setState, u, d);
        if ("untracked" === b.type ? null == g || g.init(w) : (b.stores[b.store] = d, null == g || g.init(Object.fromEntries(Object.entries(b.stores).map(([e, t]) => [e, e === b.store ? w : t.getState()])))), r(d)) {
            let e = !1,
                r = d.dispatch;
            d.dispatch = (...n) => {
                (t.env ? t.env.MODE : void 0) === "production" || "__setState" !== n[0].type || e || (console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'), e = !0), r(...n)
            }
        }
        return g.subscribe(e => {
            var t;
            switch (e.type) {
                case "ACTION":
                    if ("string" != typeof e.payload) return void console.error("[zustand devtools middleware] Unsupported action format");
                    return s(e.payload, e => {
                        if ("__setState" === e.type) {
                            if (void 0 === m) return void x(e.state);
                            1 !== Object.keys(e.state).length && console.error(`
                    [zustand devtools middleware] Unsupported __setState action format.
                    When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
                    and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
                    `);
                            let t = e.state[m];
                            return void(null == t || JSON.stringify(d.getState()) !== JSON.stringify(t) && x(t))
                        }
                        r(d) && d.dispatch(e)
                    });
                case "DISPATCH":
                    switch (e.payload.type) {
                        case "RESET":
                            if (x(w), void 0 === m) return null == g ? void 0 : g.init(d.getState());
                            return null == g ? void 0 : g.init(a(y.name));
                        case "COMMIT":
                            if (void 0 === m) {
                                null == g || g.init(d.getState());
                                break
                            }
                            return null == g ? void 0 : g.init(a(y.name));
                        case "ROLLBACK":
                            return s(e.state, e => {
                                if (void 0 === m) {
                                    x(e), null == g || g.init(d.getState());
                                    return
                                }
                                x(e[m]), null == g || g.init(a(y.name))
                            });
                        case "JUMP_TO_STATE":
                        case "JUMP_TO_ACTION":
                            return s(e.state, e => {
                                void 0 === m ? x(e) : JSON.stringify(d.getState()) !== JSON.stringify(e[m]) && x(e[m])
                            });
                        case "IMPORT_STATE":
                            {
                                let {
                                    nextLiftedState: r
                                } = e.payload,
                                n = null == (t = r.computedStates.slice(-1)[0]) ? void 0 : t.state;
                                if (!n) return;void 0 === m ? x(n) : x(n[m]),
                                null == g || g.send(null, r);
                                break
                            }
                        case "PAUSE_RECORDING":
                            return v = !v
                    }
                    return
            }
        }), w
    }, "persist", 0, (e, t) => (r, n, a) => {
        let i, o = {
                storage: function(e) {
                    let t;
                    try {
                        t = e()
                    } catch (e) {
                        return
                    }
                    return {
                        getItem: e => {
                            var r;
                            let n = e => null === e ? null : JSON.parse(e, void 0),
                                a = null != (r = t.getItem(e)) ? r : null;
                            return a instanceof Promise ? a.then(n) : n(a)
                        },
                        setItem: (e, r) => t.setItem(e, JSON.stringify(r, void 0)),
                        removeItem: e => t.removeItem(e)
                    }
                }(() => window.localStorage),
                partialize: e => e,
                version: 0,
                merge: (e, t) => ({ ...t,
                    ...e
                }),
                ...t
            },
            s = !1,
            c = 0,
            u = new Set,
            d = new Set,
            f = o.storage;
        if (!f) return e((...e) => {
            console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`), r(...e)
        }, n, a);
        let p = () => {
                let e = o.partialize({ ...n()
                });
                return f.setItem(o.name, {
                    state: e,
                    version: o.version
                })
            },
            h = a.setState;
        a.setState = (e, t) => (h(e, t), p());
        let m = e((...e) => (r(...e), p()), n, a);
        a.getInitialState = () => m;
        let y = () => {
            var e, t;
            if (!f) return;
            let a = ++c;
            s = !1, u.forEach(e => {
                var t;
                return e(null != (t = n()) ? t : m)
            });
            let h = (null == (t = o.onRehydrateStorage) ? void 0 : t.call(o, null != (e = n()) ? e : m)) || void 0;
            return l(f.getItem.bind(f))(o.name).then(e => {
                if (e)
                    if ("number" != typeof e.version || e.version === o.version) return [!1, e.state];
                    else {
                        if (o.migrate) {
                            let t = o.migrate(e.state, e.version);
                            return t instanceof Promise ? t.then(e => [!0, e]) : [!0, t]
                        }
                        console.error("State loaded from storage couldn't be migrated since no migrate function was provided")
                    }
                return [!1, void 0]
            }).then(e => {
                var t;
                if (a !== c) return;
                let [s, l] = e;
                if (r(i = o.merge(l, null != (t = n()) ? t : m), !0), s) return p()
            }).then(() => {
                a === c && (null == h || h(n(), void 0), i = n(), s = !0, d.forEach(e => e(i)))
            }).catch(e => {
                a === c && (null == h || h(void 0, e))
            })
        };
        return a.persist = {
            setOptions: e => {
                o = { ...o,
                    ...e
                }, e.storage && (f = e.storage)
            },
            clearStorage: () => {
                null == f || f.removeItem(o.name)
            },
            getOptions: () => o,
            rehydrate: () => y(),
            hasHydrated: () => s,
            onHydrate: e => (u.add(e), () => {
                u.delete(e)
            }),
            onFinishHydration: e => (d.add(e), () => {
                d.delete(e)
            })
        }, o.skipHydration || y(), i || m
    }])
}, 138537, 213264, 873054, 405377, 353114, e => {
    "use strict";
    e.s(["ApproveTrading", () => H], 138537);
    var t, r, n, a = e.i(221628),
        i = e.i(999061),
        o = e.i(23128),
        s = e.i(604777),
        l = e.i(416340),
        c = e.i(820219),
        u = e.i(322324),
        d = e.i(461327),
        f = e.i(165974);
    let p = (0, u.create)()((0, d.persist)((0, f.immer)((e, t) => ({
        usersMigrationData: [],
        completedUsers: [],
        reopenCounter: 0,
        isUpgradeModalShown: !1,
        addUser: t => {
            e(e => {
                let r = t.toLowerCase();
                e.usersMigrationData.includes(r) || e.usersMigrationData.push(r)
            })
        },
        removeUser: t => {
            e(e => {
                let r = t.toLowerCase();
                e.usersMigrationData.includes(r) && (e.usersMigrationData = e.usersMigrationData.filter(e => e !== r))
            })
        },
        addCompletedUser: t => {
            e(e => {
                let r = t.toLowerCase();
                e.completedUsers.includes(r) || e.completedUsers.push(r)
            })
        },
        hasCompletedMigration: e => !!e && t().completedUsers.includes(e.toLowerCase()),
        reopenModal: () => {
            e(e => {
                e.reopenCounter += 1
            })
        },
        setUpgradeModalShown: t => {
            e(e => {
                e.isUpgradeModalShown = t
            })
        }
    })), {
        name: "polymarket.store.upgrade-modal",
        version: 10,
        migrate: (e, t) => {
            let r = e ? ? {};
            return t < 10 ? {
                usersMigrationData: r.usersMigrationData ? ? [],
                completedUsers: r.completedUsers ? ? []
            } : r
        },
        partialize: e => ({
            usersMigrationData: e.usersMigrationData,
            completedUsers: e.completedUsers
        })
    }));
    e.s(["default", 0, p], 213264), e.s(["useAutoRedeemApproval", () => R], 405377);
    var h = e.i(914640),
        m = e.i(333114),
        y = e.i(380979),
        g = e.i(645934),
        b = e.i(58794),
        v = e.i(478088),
        x = e.i(912504);

    function w(e = {}) {
        let t = (0, x.useConfig)(e),
            r = (0, v.useChainId)({
                config: t
            }),
            n = function(e, t = {}) {
                return { ...t.query,
                    enabled: !!((t.address || "code" in t && t.code) && t.abi && t.functionName && (t.query ? .enabled ? ? !0)),
                    queryFn: async r => {
                        if (!t.abi) throw Error("abi is required");
                        let [, {
                            scopeKey: n,
                            ...a
                        }] = r.queryKey;
                        if (!a.functionName) throw Error("functionName is required");
                        return await (0, y.readContract)(e, { ...a,
                            abi: t.abi,
                            address: a.address,
                            code: "code" in a && a.code ? a.code : void 0,
                            functionName: a.functionName
                        })
                    },
                    queryKey: function(e = {}) {
                        return ["readContract", (0, g.filterQueryOptions)(e)]
                    }(t),
                    structuralSharing: g.structuralSharing
                }
            }(t, { ...e,
                chainId: e.chainId ? ? r
            });
        return (0, b.useQuery)(n)
    }
    e.s(["useReadContract", 0, w], 873054);
    var _ = e.i(628684),
        C = e.i(635103),
        E = e.i(675702),
        S = e.i(973468),
        A = e.i(631503),
        I = e.i(784521),
        T = e.i(660006),
        k = e.i(631222),
        O = e.i(423582);

    function R() {
        let {
            connector: e
        } = (0, m.useAccount)(), {
            authenticated: t,
            proxyAddress: r,
            walletMode: n
        } = (0, I.useAccountContext)(["authenticated", "proxyAddress", "walletMode"]), {
            incrementNonce: a,
            refreshNonce: i
        } = (0, _.useSafe)(), {
            nonce: o,
            incrementNonce: c,
            refreshNonce: u
        } = (0, C.useDepositWallet)(), {
            sendTransaction: d
        } = (0, A.default)(), f = (0, s.useTranslations)(), [p, y] = (0, l.useState)("idle"), [g, b] = (0, l.useState)(null), [v, x] = (0, l.useState)(null), R = (0, l.useRef)(null);
        (0, l.useEffect)(() => () => {
            R.current && clearTimeout(R.current)
        }, []);
        let N = !!t && !!r && r !== h.zeroAddress && !!e,
            {
                data: M,
                refetch: P,
                isFetching: D
            } = w({
                address: k.CONDITIONAL_TOKENS_ADDRESS,
                abi: E.ConditionalTokensAbi,
                functionName: "isApprovedForAll",
                args: [r, k.AUTO_REDEEM_OPERATOR],
                chainId: k.MATIC_CONFIG.chainId,
                query: {
                    enabled: N
                }
            }),
            j = (0, l.useCallback)(async s => {
                if (!t || !e || !r) return;
                y("pending"), b(null), R.current && (clearTimeout(R.current), R.current = null);
                let l = (0, S.erc1155ApprovalTransaction)(k.CONDITIONAL_TOKENS_ADDRESS, k.AUTO_REDEEM_OPERATOR, s);
                try {
                    let e = (0, A.getTransactionType)(n),
                        {
                            data: t
                        } = e === A.TransactionType.EOA ? await i() : {
                            data: void 0
                        },
                        {
                            data: p
                        } = e === A.TransactionType.DepositWallet ? await u() : {
                            data: void 0
                        },
                        h = e === A.TransactionType.DepositWallet ? p ? ? o : e === A.TransactionType.EOA ? t : void 0,
                        m = await d(e, [l], 0, k.Network.Matic, 0, void 0, h, A.TransactionMetadata.Approval.valueOf(), e === A.TransactionType.DepositWallet ? r : void 0);
                    if (e === A.TransactionType.EOA ? a() : e === A.TransactionType.DepositWallet && await c(), await (0, O.waitTillMined)(m)) return x(s), y("success"), R.current = setTimeout(async () => {
                        R.current = null, await P(), x(null)
                    }, 3e3), "success";
                    return b(f("portfolio.autoRedeem.txFailedError")), y("error"), "error"
                } catch (t) {
                    (0, T.handleError)(t, "[useAutoRedeemApproval > setApproval]", r);
                    let e = String(t);
                    return t ? .code === "ACTION_REJECTED" || e.toLowerCase().includes("user denied message signature") ? b(f("portfolio.autoRedeem.signatureRejectedError")) : b(f("portfolio.autoRedeem.genericError")), y("error"), "error"
                } finally {
                    "depositWallet" === n ? u() : "safe" === n && i()
                }
            }, [t, n, e, r, d, a, i, o, c, u, P, f]);
        return {
            isApproved: v ? ? !!M,
            isFetching: D,
            state: p,
            errorMsg: g,
            approve: (0, l.useCallback)(() => j(!0), [j]),
            revoke: (0, l.useCallback)(() => j(!1), [j]),
            isEnabled: N
        }
    }
    var N = e.i(827681),
        M = e.i(863828),
        P = e.i(98191),
        D = e.i(392566);
    e.s(["EnableTrading", () => V, "EnableTradingIcon", () => q], 353114);
    var j = e.i(8998),
        L = e.i(73836),
        F = e.i(246290),
        U = e.i(668122),
        $ = e.i(305457),
        z = ((t = z || {}).PromptSwitchNetwork = "prompt_switch_network", t.PromptDeploySafe = "prompt_deploy_safe", t.PendingWalletAction = "pending_wallet_action", t),
        B = ((r = B || {}).Rejection = "rejection", r.Unknown = "unknown", r);
    let q = () => {
            let e, t = (0, i.c)(1);
            return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, a.jsxs)("svg", {
                width: "80",
                height: "81",
                viewBox: "0 0 80 81",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg",
                children: [(0, a.jsx)("mask", {
                    id: "path-2-inside-1_232_72",
                    fill: "white",
                    children: (0, a.jsx)("path", {
                        d: "M8 23.6289C8 15.3446 14.7157 8.62891 23 8.62891H57C65.2843 8.62891 72 15.3446 72 23.6289V57.6289C72 65.9132 65.2843 72.6289 57 72.6289H23C14.7157 72.6289 8 65.9132 8 57.6289V23.6289Z"
                    })
                }), (0, a.jsx)("path", {
                    d: "M8 23.6289C8 15.3446 14.7157 8.62891 23 8.62891H57C65.2843 8.62891 72 15.3446 72 23.6289V57.6289C72 65.9132 65.2843 72.6289 57 72.6289H23C14.7157 72.6289 8 65.9132 8 57.6289V23.6289Z",
                    fill: "#0060FF"
                }), (0, a.jsx)("path", {
                    d: "M8 8.62891H72H8ZM72 57.6289C72 68.1223 63.4934 76.6289 53 76.6289H27C16.5066 76.6289 8 68.1223 8 57.6289C8 63.704 14.7157 68.6289 23 68.6289H57C65.2843 68.6289 72 63.704 72 57.6289ZM8 72.6289V8.62891V72.6289ZM72 8.62891V72.6289V8.62891Z",
                    fill: "black",
                    fillOpacity: "0.4",
                    mask: "url(#path-2-inside-1_232_72)"
                }), (0, a.jsx)("path", {
                    d: "M46.7222 55.9064H54.0556C55.4049 55.9064 56.5 54.8113 56.5 53.462V37.5731C56.5 36.2237 55.4049 35.1286 54.0556 35.1286H28.3889C25.6878 35.1286 23.5 32.9409 23.5 30.2397V41.2397",
                    stroke: "white",
                    strokeWidth: "3",
                    strokeLinecap: "round",
                    strokeLinejoin: "round"
                }), (0, a.jsx)("path", {
                    d: "M23.5 30.24C23.5 27.5389 25.6878 25.3511 28.3889 25.3511H49.1667C50.516 25.3511 51.6111 26.4462 51.6111 27.7955V29.0177",
                    stroke: "white",
                    strokeWidth: "3",
                    strokeLinecap: "round",
                    strokeLinejoin: "round"
                }), (0, a.jsx)("path", {
                    d: "M50.7222 45.518C50.7222 46.3771 50.0257 47.0735 49.1666 47.0735C48.3075 47.0735 47.6111 46.3771 47.6111 45.518C47.6111 44.6588 48.3075 43.9624 49.1666 43.9624C50.0257 43.9624 50.7222 44.6588 50.7222 45.518Z",
                    fill: "#212121",
                    stroke: "white",
                    strokeWidth: "3"
                }), (0, a.jsx)("path", {
                    d: "M25.3333 56.518C27.6959 56.518 29.6111 54.6027 29.6111 52.2402C29.6111 49.8776 27.6959 47.9624 25.3333 47.9624C22.9708 47.9624 21.0555 49.8776 21.0555 52.2402C21.0555 54.6027 22.9708 56.518 25.3333 56.518Z",
                    stroke: "white",
                    strokeWidth: "3",
                    strokeLinecap: "round",
                    strokeLinejoin: "round"
                }), (0, a.jsx)("path", {
                    d: "M29.6111 52.2397H40.6111",
                    stroke: "white",
                    strokeWidth: "3",
                    strokeLinecap: "round",
                    strokeLinejoin: "round"
                }), (0, a.jsx)("path", {
                    d: "M36.9445 52.2397V56.5175",
                    stroke: "white",
                    strokeWidth: "3",
                    strokeLinecap: "round",
                    strokeLinejoin: "round"
                })]
            }), t[0] = e) : e = t[0], e
        },
        W = e => {
            let t, r, n = (0, i.c)(21),
                {
                    enableTradingState: s,
                    onSwitchToPolygon: l,
                    onDeploySafe: c,
                    t: u
                } = e;
            n[0] !== s || n[1] !== c || n[2] !== l ? (t = () => {
                switch (s) {
                    case "prompt_switch_network":
                        l();
                        break;
                    case "prompt_deploy_safe":
                        c()
                }
            }, n[0] = s, n[1] = c, n[2] = l, n[3] = t) : t = n[3];
            let d = t,
                f = null;
            switch (s) {
                case "prompt_switch_network":
                    {
                        let e, t;n[4] !== u ? (e = u("auth.switchToPolygon"), n[4] = u, n[5] = e) : e = n[5],
                        n[6] !== e ? (t = (0, a.jsx)("span", {
                            children: e
                        }), n[6] = e, n[7] = t) : t = n[7],
                        f = t;
                        break
                    }
                case "prompt_deploy_safe":
                    {
                        let e, t;n[8] !== u ? (e = u("auth.enableTrading"), n[8] = u, n[9] = e) : e = n[9],
                        n[10] !== e ? (t = (0, a.jsx)("span", {
                            children: e
                        }), n[10] = e, n[11] = t) : t = n[11],
                        f = t;
                        break
                    }
                case "pending_wallet_action":
                    {
                        let e, t, r;n[12] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, a.jsx)(P.default, {
                            color: "white",
                            className: "h-6 w-6"
                        }), n[12] = e) : e = n[12],
                        n[13] !== u ? (t = u("auth.checkYourWallet"), n[13] = u, n[14] = t) : t = n[14],
                        n[15] !== t ? (r = (0, a.jsxs)(a.Fragment, {
                            children: [e, (0, a.jsx)("span", {
                                children: t
                            })]
                        }), n[15] = t, n[16] = r) : r = n[16],
                        f = r
                    }
            }
            let p = "pending_wallet_action" === s;
            return n[17] !== f || n[18] !== d || n[19] !== p ? (r = (0, a.jsx)(o.Button, {
                variant: "default",
                onClick: d,
                disabled: p,
                className: "h-[52px] w-full text-base bg-brand-500 hover:bg-brand-500/90 text-white disabled:opacity-50 disabled:cursor-wait flex items-center justify-center gap-2",
                children: f
            }), n[17] = f, n[18] = d, n[19] = p, n[20] = r) : r = n[20], r
        },
        Z = e => {
            let t, r = (0, i.c)(7),
                {
                    deploySafeError: n,
                    t: o
                } = e,
                s = null;
            switch (n) {
                case "rejection":
                    {
                        let e;r[0] !== o ? (e = o("auth.signatureRejected"), r[0] = o, r[1] = e) : e = r[1],
                        s = e;
                        break
                    }
                case "unknown":
                    {
                        let e;r[2] !== o ? (e = o("auth.unknownError"), r[2] = o, r[3] = e) : e = r[3],
                        s = e
                    }
            }
            if (!s) {
                let e;
                return r[4] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, a.jsx)("div", {
                    className: "h-[18px]"
                }), r[4] = e) : e = r[4], e
            }
            return r[5] !== s ? (t = (0, a.jsx)("p", {
                className: "font-normal text-base text-center text-red-500",
                children: s
            }), r[5] = s, r[6] = t) : t = r[6], t
        },
        V = () => {
            let e = (0, s.useTranslations)(),
                {
                    chain: t,
                    address: r,
                    connector: n
                } = (0, F.useAccount)(),
                {
                    switchChainAsync: i
                } = (0, L.useSwitchChain)(),
                o = (0, j.useChains)(),
                c = (0, $.useAmplitudeAnalytics)(),
                {
                    deploySafe: u
                } = (0, _.useSafe)(),
                {
                    setOnboardingRoute: d
                } = (0, M.useSiwx)(),
                [f, p] = (0, l.useState)(t ? .id !== o[k.WAGMI_CHAIN_INDICES.polygon].id ? "prompt_switch_network" : "prompt_deploy_safe");
            (0, l.useEffect)(() => {
                t ? .id !== o[k.WAGMI_CHAIN_INDICES.polygon].id ? p("prompt_switch_network") : "prompt_switch_network" === f && p("prompt_deploy_safe")
            }, [t, f, o]);
            let [h, m] = (0, l.useState)(null), y = (0, l.useCallback)(async () => {
                try {
                    p("pending_wallet_action"), await i({
                        chainId: o[k.WAGMI_CHAIN_INDICES.polygon].id
                    }), p("prompt_deploy_safe")
                } catch (e) {
                    (0, T.handleError)(e, "[Onboarding > EnableTrading > handleSwitchToPolygon]"), p("prompt_switch_network")
                }
            }, [i, o]), g = (0, l.useCallback)(async () => {
                c.trackEvent(U.Events.AttemptingProxyWalletCreation), p("pending_wallet_action"), m(null);
                try {
                    if (!r) throw Error("No address");
                    if (!n) throw Error("No connector");
                    let e = await u();
                    if (200 === e.status) {
                        d(N.OnboardingRoute.APPROVETRADING), c.trackEvent(U.Events.ProxyWalletCreationSuccess);
                        return
                    }
                    401 === e.status && m("rejection"), 400 === e.status && (m("unknown"), c.trackEvent(U.Events.ProxyWalletCreationError, {
                        error: e.message
                    }))
                } catch (e) {
                    (0, T.handleError)(e, "[Onboarding > EnableTrading > handleDeploySafe]"), m("unknown"), p("prompt_deploy_safe"), c.trackEvent(U.Events.ProxyWalletCreationError, {
                        error: e
                    })
                }
            }, [r, n, u, d, c]);
            return (0, a.jsxs)("div", {
                className: "flex flex-col items-center w-full gap-[18px]",
                children: [(0, a.jsx)(q, {}), (0, a.jsxs)("div", {
                    className: "flex flex-col gap-1",
                    children: [(0, a.jsx)("p", {
                        className: "font-bold text-xl text-text-primary text-center leading-6",
                        children: e("auth.enableTrading")
                    }), (0, a.jsx)("p", {
                        className: "text-base text-text-secondary text-center leading-9",
                        children: e("auth.setupWallet")
                    }), (0, a.jsx)(Z, {
                        deploySafeError: h,
                        t: e
                    })]
                }), (0, a.jsx)(W, {
                    enableTradingState: f,
                    onSwitchToPolygon: y,
                    onDeploySafe: g,
                    t: e
                })]
            }, N.OnboardingRoute.ENABLEEOATRADING)
        };
    var K = ((n = K || {}).Initial = "initial", n.PendingWalletAction = "pending_wallet_action", n.Confirming = "confirming", n.Checking = "checking", n.Error = "error", n);
    let H = () => {
        let e, t, r, n, u, d, f, h, m, y, g, b, v, x, w, _, C, E, S, A, k, O, j = (0, i.c)(86),
            L = (0, s.useTranslations)(),
            {
                setOnboardingRoute: F
            } = (0, M.useSiwx)();
        j[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticationType", "baseAddress"], j[0] = e) : e = j[0];
        let {
            authenticationType: U,
            baseAddress: $
        } = (0, I.useAccountContext)(e), z = p(G), B = p(Q), {
            approve: W
        } = R(), {
            allowanceErrorMsg: Z,
            areAllAllowancesApproved: V,
            hasLoadedAllowances: K,
            isUpdatingAllowances: H,
            loadAllowanceMap: J,
            triggerAllApprovals: Y
        } = (0, c.default)(), [X, ee] = (0, l.useState)("initial"), et = (0, l.useRef)(!1), er = (0, l.useRef)(!1), en = "magic" === U, ea = !K || !$ || H || "pending_wallet_action" === X || "confirming" === X || "checking" === X;
        j[1] !== z || j[2] !== W || j[3] !== V || j[4] !== U || j[5] !== $ || j[6] !== K || j[7] !== en || j[8] !== H || j[9] !== B || j[10] !== F ? (t = () => {
            if (!et.current) {
                if (!$) return void(0, D.ctfV2Warn)("onboarding_approve_trading_waiting_for_base_address", {
                    authType: U,
                    hasLoadedAllowances: K,
                    areAllAllowancesApproved: V,
                    isUpdatingAllowances: H
                });
                if (et.current = !0, z($), B($), (0, D.ctfV2Info)("onboarding_approve_trading_completed", {
                        authType: U,
                        baseAddress: $,
                        isMagic: en
                    }), en) {
                    W().catch(e => {
                        (0, D.ctfV2Error)("onboarding_magic_auto_redeem_failed", {
                            authType: U,
                            baseAddress: $,
                            ...(0, D.getErrorTelemetry)(e)
                        }), (0, T.handleError)(e, "[ApproveTrading > magic auto-redeem approve]")
                    }), F(N.OnboardingRoute.FUNDACCOUNT);
                    return
                }
                F(N.OnboardingRoute.AUTOREDEEM)
            }
        }, j[1] = z, j[2] = W, j[3] = V, j[4] = U, j[5] = $, j[6] = K, j[7] = en, j[8] = H, j[9] = B, j[10] = F, j[11] = t) : t = j[11];
        let ei = t;
        j[12] !== V || j[13] !== U || j[14] !== $ || j[15] !== ei || j[16] !== K || j[17] !== H ? (r = () => {
            K && !H && V && ((0, D.ctfV2Info)("onboarding_approve_trading_already_approved", {
                authType: U,
                baseAddress: $,
                hasBaseAddress: !!$
            }), ei())
        }, n = [V, U, $, ei, K, H], j[12] = V, j[13] = U, j[14] = $, j[15] = ei, j[16] = K, j[17] = H, j[18] = r, j[19] = n) : (r = j[18], n = j[19]), (0, l.useEffect)(r, n), j[20] !== Z || j[21] !== X || j[22] !== V || j[23] !== U || j[24] !== $ || j[25] !== ei || j[26] !== K || j[27] !== H ? (u = () => {
            if ("checking" === X && !H) {
                if (V) {
                    (0, D.ctfV2Info)("onboarding_approve_trading_refetch_approved", {
                        authType: U,
                        baseAddress: $,
                        hasBaseAddress: !!$
                    }), ei();
                    return
                }(0, D.ctfV2Warn)("onboarding_approve_trading_refetch_unapproved", {
                    authType: U,
                    baseAddress: $,
                    hasBaseAddress: !!$,
                    hasLoadedAllowances: K,
                    allowanceErrorMsg: Z
                }), ee("error")
            }
        }, d = [Z, X, V, U, $, ei, K, H], j[20] = Z, j[21] = X, j[22] = V, j[23] = U, j[24] = $, j[25] = ei, j[26] = K, j[27] = H, j[28] = u, j[29] = d) : (u = j[28], d = j[29]), (0, l.useEffect)(u, d), j[30] !== V || j[31] !== U || j[32] !== $ || j[33] !== ei || j[34] !== K || j[35] !== en || j[36] !== H || j[37] !== J || j[38] !== Y ? (f = async () => {
            if (!K || H) return void(0, D.ctfV2Info)("onboarding_approve_trading_blocked", {
                authType: U,
                baseAddress: $,
                hasBaseAddress: !!$,
                hasLoadedAllowances: K,
                isUpdatingAllowances: H,
                areAllAllowancesApproved: V
            });
            if (V) return void ei();
            try {
                (0, D.ctfV2Info)("onboarding_approve_trading_started", {
                    authType: U,
                    baseAddress: $,
                    hasBaseAddress: !!$,
                    isMagic: en
                }), ee("pending_wallet_action"), await Y(!1, "OnboardingApproveTrading"), (0, D.ctfV2Info)("onboarding_approve_trading_submitted", {
                    authType: U,
                    baseAddress: $,
                    hasBaseAddress: !!$,
                    isMagic: en
                }), ee("confirming"), await new Promise(e => setTimeout(e, 3500)), await J(), (0, D.ctfV2Info)("onboarding_approve_trading_refetched", {
                    authType: U,
                    baseAddress: $,
                    hasBaseAddress: !!$,
                    isMagic: en
                }), ee("checking")
            } catch (e) {
                (0, D.ctfV2Error)("onboarding_approve_trading_failed", {
                    authType: U,
                    baseAddress: $,
                    hasBaseAddress: !!$,
                    isMagic: en,
                    ...(0, D.getErrorTelemetry)(e)
                }), (0, T.handleError)(e, "[ApproveTrading > handleApproveTrading]"), ee("error")
            }
        }, j[30] = V, j[31] = U, j[32] = $, j[33] = ei, j[34] = K, j[35] = en, j[36] = H, j[37] = J, j[38] = Y, j[39] = f) : f = j[39];
        let eo = f;
        j[40] !== V || j[41] !== U || j[42] !== $ || j[43] !== eo || j[44] !== K || j[45] !== ea || j[46] !== en || j[47] !== H ? (h = () => {
            !en || !K || V || ea || er.current || ((0, D.ctfV2Info)("onboarding_magic_auto_approve_triggered", {
                authType: U,
                baseAddress: $,
                hasBaseAddress: !!$,
                hasLoadedAllowances: K,
                areAllAllowancesApproved: V,
                isUpdatingAllowances: H
            }), er.current = !0, eo())
        }, m = [V, U, $, eo, K, ea, en, H], j[40] = V, j[41] = U, j[42] = $, j[43] = eo, j[44] = K, j[45] = ea, j[46] = en, j[47] = H, j[48] = h, j[49] = m) : (h = j[48], m = j[49]), (0, l.useEffect)(h, m), j[50] !== L ? (y = L("approvalModal.sign"), j[50] = L, j[51] = y) : y = j[51];
        let es = y;
        if (ea) {
            let e;
            j[52] !== en || j[53] !== L ? (e = L(en ? "upgradeModal.success.loading" : "auth.checkYourWallet"), j[52] = en, j[53] = L, j[54] = e) : e = j[54], es = e
        }
        return j[55] === Symbol.for("react.memo_cache_sentinel") ? (g = (0, a.jsx)(q, {}), j[55] = g) : g = j[55], j[56] !== L ? (b = L("approvalModal.approveTokens"), j[56] = L, j[57] = b) : b = j[57], j[58] !== b ? (v = (0, a.jsx)("p", {
            className: "font-bold text-xl text-text-primary text-center leading-6",
            children: b
        }), j[58] = b, j[59] = v) : v = j[59], j[60] !== L ? (x = L("approvalModal.approveTokensSubtitle"), j[60] = L, j[61] = x) : x = j[61], j[62] !== x ? (w = (0, a.jsx)("p", {
            className: "text-base text-text-secondary text-center leading-6",
            children: x
        }), j[62] = x, j[63] = w) : w = j[63], j[64] !== Z || j[65] !== X || j[66] !== L ? (_ = "error" === X && (0, a.jsx)("p", {
            className: "font-normal text-base text-center text-red-500",
            children: Z ? ? L("approvalModal.unknownError")
        }), j[64] = Z, j[65] = X, j[66] = L, j[67] = _) : _ = j[67], j[68] !== _ ? (C = (0, a.jsx)("div", {
            className: "h-[18px]",
            children: _
        }), j[68] = _, j[69] = C) : C = j[69], j[70] !== v || j[71] !== w || j[72] !== C ? (E = (0, a.jsxs)("div", {
            className: "flex flex-col gap-1",
            children: [v, w, C]
        }), j[70] = v, j[71] = w, j[72] = C, j[73] = E) : E = j[73], j[74] !== ea ? (S = ea && (0, a.jsx)(P.default, {
            color: "white",
            className: "h-6 w-6"
        }), j[74] = ea, j[75] = S) : S = j[75], j[76] !== es ? (A = (0, a.jsx)("span", {
            children: es
        }), j[76] = es, j[77] = A) : A = j[77], j[78] !== eo || j[79] !== ea || j[80] !== S || j[81] !== A ? (k = (0, a.jsxs)(o.Button, {
            variant: "default",
            onClick: eo,
            disabled: ea,
            className: "h-[52px] w-full text-base bg-brand-500 hover:bg-brand-500/90 text-white disabled:opacity-50 disabled:cursor-wait flex items-center justify-center gap-2",
            children: [S, A]
        }), j[78] = eo, j[79] = ea, j[80] = S, j[81] = A, j[82] = k) : k = j[82], j[83] !== E || j[84] !== k ? (O = (0, a.jsxs)("div", {
            className: "flex flex-col items-center w-full gap-[18px]",
            children: [g, E, k]
        }, N.OnboardingRoute.APPROVETRADING), j[83] = E, j[84] = k, j[85] = O) : O = j[85], O
    };

    function G(e) {
        return e.addCompletedUser
    }

    function Q(e) {
        return e.removeUser
    }
}, 706261, 137918, 849222, 81377, 952753, e => {
    "use strict";
    e.s(["EnableAutoRedeem", () => g], 706261);
    var t = e.i(221628),
        r = e.i(999061),
        n = e.i(23128),
        a = e.i(604777),
        i = e.i(416340),
        o = e.i(827681),
        s = e.i(863828),
        l = e.i(249792),
        c = e.i(606572);

    function u(e) {
        let n, a, i = (0, r.c)(3);
        return i[0] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, t.jsx)("path", {
            fill: "currentColor",
            d: "M10 1.875a8.125 8.125 0 1 1 0 16.25 8.125 8.125 0 0 1 0-16.25m0 1.75a6.375 6.375 0 1 0 0 12.75 6.375 6.375 0 0 0 0-12.75m0 1.25c.483 0 .875.392.875.875v3.791l2.873 1.99a.875.875 0 0 1-.996 1.439l-3.25-2.25a.88.88 0 0 1-.377-.72V5.75c0-.483.392-.875.875-.875"
        }), i[0] = n) : n = i[0], i[1] !== e ? (a = (0, t.jsx)("svg", {
            xmlns: "http://www.w3.org/2000/svg",
            width: 20,
            height: 20,
            fill: "none",
            viewBox: "0 0 20 20",
            "aria-hidden": !0,
            ...e,
            children: n
        }), i[1] = e, i[2] = a) : a = i[2], a
    }

    function d(e) {
        let n, a, i = (0, r.c)(3);
        return i[0] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, t.jsx)("path", {
            fill: "currentColor",
            fillRule: "evenodd",
            d: "M9.722 2.32c.649-.866 2.025-.36 1.962.718l-.257 4.337h4.323c.927 0 1.456 1.058.9 1.8l-6.372 8.505c-.65.866-2.026.36-1.962-.718l.256-4.337H4.25a1.125 1.125 0 0 1-.9-1.8zm-4.223 8.555h4.002a.876.876 0 0 1 .873.927l-.182 3.073 4.31-5.75h-4.003a.876.876 0 0 1-.874-.927l.182-3.074z",
            clipRule: "evenodd"
        }), i[0] = n) : n = i[0], i[1] !== e ? (a = (0, t.jsx)("svg", {
            xmlns: "http://www.w3.org/2000/svg",
            width: 20,
            height: 20,
            fill: "none",
            viewBox: "0 0 20 20",
            "aria-hidden": !0,
            ...e,
            children: n
        }), i[1] = e, i[2] = a) : a = i[2], a
    }

    function f(e) {
        let n, a, i = (0, r.c)(3);
        return i[0] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, t.jsx)("path", {
            fill: "currentColor",
            d: "M10 1.875A4.125 4.125 0 0 1 14.125 6v2.401a2.874 2.874 0 0 1 2.5 2.849v4a2.875 2.875 0 0 1-2.875 2.875h-7.5a2.875 2.875 0 0 1-2.875-2.875v-4c0-1.46 1.09-2.665 2.5-2.849V6A4.125 4.125 0 0 1 10 1.875m-3.75 8.25c-.621 0-1.125.504-1.125 1.125v4c0 .621.504 1.125 1.125 1.125h7.5c.621 0 1.125-.504 1.125-1.125v-4c0-.621-.504-1.125-1.125-1.125zm3.75 1.75c.483 0 .875.392.875.875v1a.875.875 0 0 1-1.75 0v-1c0-.483.392-.875.875-.875m0-8.25A2.375 2.375 0 0 0 7.625 6v2.375h4.75V6A2.375 2.375 0 0 0 10 3.625"
        }), i[0] = n) : n = i[0], i[1] !== e ? (a = (0, t.jsx)("svg", {
            xmlns: "http://www.w3.org/2000/svg",
            width: 20,
            height: 20,
            fill: "none",
            viewBox: "0 0 20 20",
            "aria-hidden": !0,
            ...e,
            children: n
        }), i[1] = e, i[2] = a) : a = i[2], a
    }

    function p() {
        let e, n, i, o, s, l, c, p, h, m, y, g, b, v, x, w, _ = (0, r.c)(34),
            C = (0, a.useTranslations)();
        return _[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)(d, {
            className: "mt-px size-5 shrink-0 text-text-secondary"
        }), _[0] = e) : e = _[0], _[1] !== C ? (n = C("portfolio.autoRedeem.oneTimeApprovalLabel"), _[1] = C, _[2] = n) : n = _[2], _[3] !== n ? (i = (0, t.jsx)("span", {
            className: "font-semibold text-text-primary",
            children: n
        }), _[3] = n, _[4] = i) : i = _[4], _[5] !== C ? (o = C("portfolio.autoRedeem.oneTimeApprovalDesc"), _[5] = C, _[6] = o) : o = _[6], _[7] !== i || _[8] !== o ? (s = (0, t.jsxs)("div", {
            className: "flex gap-3",
            children: [e, (0, t.jsxs)("p", {
                className: "text-body-base font-medium text-text-secondary",
                children: [i, " ", "- ", o]
            })]
        }), _[7] = i, _[8] = o, _[9] = s) : s = _[9], _[10] === Symbol.for("react.memo_cache_sentinel") ? (l = (0, t.jsx)(u, {
            className: "mt-px size-5 shrink-0 text-text-secondary"
        }), _[10] = l) : l = _[10], _[11] !== C ? (c = C("portfolio.autoRedeem.startsAfterNextTradeLabel"), _[11] = C, _[12] = c) : c = _[12], _[13] !== c ? (p = (0, t.jsx)("span", {
            className: "font-semibold text-text-primary",
            children: c
        }), _[13] = c, _[14] = p) : p = _[14], _[15] !== C ? (h = C("portfolio.autoRedeem.startsAfterNextTradeDesc"), _[15] = C, _[16] = h) : h = _[16], _[17] !== p || _[18] !== h ? (m = (0, t.jsxs)("div", {
            className: "flex gap-3",
            children: [l, (0, t.jsxs)("p", {
                className: "text-body-base font-medium text-text-secondary",
                children: [p, " ", "- ", h]
            })]
        }), _[17] = p, _[18] = h, _[19] = m) : m = _[19], _[20] === Symbol.for("react.memo_cache_sentinel") ? (y = (0, t.jsx)(f, {
            className: "mt-px size-5 shrink-0 text-text-secondary"
        }), _[20] = y) : y = _[20], _[21] !== C ? (g = C("portfolio.autoRedeem.alwaysOnLabel"), _[21] = C, _[22] = g) : g = _[22], _[23] !== g ? (b = (0, t.jsx)("span", {
            className: "font-semibold text-text-primary",
            children: g
        }), _[23] = g, _[24] = b) : b = _[24], _[25] !== C ? (v = C("portfolio.autoRedeem.alwaysOnDesc"), _[25] = C, _[26] = v) : v = _[26], _[27] !== b || _[28] !== v ? (x = (0, t.jsxs)("div", {
            className: "flex gap-3",
            children: [y, (0, t.jsxs)("p", {
                className: "text-body-base font-medium text-text-secondary",
                children: [b, " ", "- ", v]
            })]
        }), _[27] = b, _[28] = v, _[29] = x) : x = _[29], _[30] !== x || _[31] !== s || _[32] !== m ? (w = (0, t.jsxs)("div", {
            className: "flex flex-col gap-3",
            children: [s, m, x]
        }), _[30] = x, _[31] = s, _[32] = m, _[33] = w) : w = _[33], w
    }
    e.s(["ClockIcon20", 0, u], 137918), e.s(["AutoRedeemBenefits", 0, p], 849222);
    let h = () => {
        let e, n = (0, r.c)(1);
        return n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsxs)("svg", {
            width: "80",
            height: "81",
            viewBox: "0 0 80 81",
            fill: "none",
            xmlns: "http://www.w3.org/2000/svg",
            children: [(0, t.jsx)("mask", {
                id: "path-2-inside-1_autoredeem",
                fill: "white",
                children: (0, t.jsx)("path", {
                    d: "M8 23.6289C8 15.3446 14.7157 8.62891 23 8.62891H57C65.2843 8.62891 72 15.3446 72 23.6289V57.6289C72 65.9132 65.2843 72.6289 57 72.6289H23C14.7157 72.6289 8 65.9132 8 57.6289V23.6289Z"
                })
            }), (0, t.jsx)("path", {
                d: "M8 23.6289C8 15.3446 14.7157 8.62891 23 8.62891H57C65.2843 8.62891 72 15.3446 72 23.6289V57.6289C72 65.9132 65.2843 72.6289 57 72.6289H23C14.7157 72.6289 8 65.9132 8 57.6289V23.6289Z",
                fill: "#0060FF"
            }), (0, t.jsx)("path", {
                d: "M8 8.62891H72H8ZM72 57.6289C72 68.1223 63.4934 76.6289 53 76.6289H27C16.5066 76.6289 8 68.1223 8 57.6289C8 63.704 14.7157 68.6289 23 68.6289H57C65.2843 68.6289 72 63.704 72 57.6289ZM8 72.6289V8.62891V72.6289ZM72 8.62891V72.6289V8.62891Z",
                fill: "black",
                fillOpacity: "0.4",
                mask: "url(#path-2-inside-1_autoredeem)"
            }), (0, t.jsx)("path", {
                d: "M44 24L29 44H40L36 56L51 36H40L44 24Z",
                fill: "white",
                stroke: "white",
                strokeWidth: "2",
                strokeLinecap: "round",
                strokeLinejoin: "round"
            })]
        }), n[0] = e) : e = n[0], e
    };
    e.s(["AutoRedeemIcon", 0, h], 81377);
    var m = e.i(405377),
        y = e.i(98191);
    let g = () => {
        let e, i, u, d, f, g, b, v, x, w, _, C, E, S = (0, r.c)(33),
            A = (0, a.useTranslations)(),
            {
                setOnboardingRoute: I
            } = (0, s.useSiwx)(),
            {
                state: T,
                errorMsg: k,
                approve: O
            } = (0, m.useAutoRedeemApproval)(),
            R = (0, l.useToast)();
        S[0] !== I ? (e = () => {
            I(o.OnboardingRoute.FUNDACCOUNT)
        }, S[0] = I, S[1] = e) : e = S[1];
        let N = e;
        S[2] !== O || S[3] !== N || S[4] !== A || S[5] !== R ? (i = async () => {
            let e = await O();
            "success" === e ? (R.success(new c.ToastBuilder().title(A("portfolio.autoRedeem.enabledToastTitle")).description(A("portfolio.autoRedeem.enabledToastDesc"))), N()) : "error" === e && R.error(new c.ToastBuilder().title(A("portfolio.autoRedeem.failedToastTitle")).description(A("portfolio.autoRedeem.failedToastDesc")))
        }, S[2] = O, S[3] = N, S[4] = A, S[5] = R, S[6] = i) : i = S[6];
        let M = i;
        S[7] === Symbol.for("react.memo_cache_sentinel") ? (u = (0, t.jsx)(h, {}), S[7] = u) : u = S[7], S[8] !== A ? (d = A("portfolio.autoRedeem.title"), S[8] = A, S[9] = d) : d = S[9], S[10] !== d ? (f = (0, t.jsx)("p", {
            className: "font-bold text-xl text-text-primary text-center leading-6",
            children: d
        }), S[10] = d, S[11] = f) : f = S[11], S[12] !== A ? (g = A("portfolio.autoRedeem.description"), S[12] = A, S[13] = g) : g = S[13], S[14] !== g ? (b = (0, t.jsx)("p", {
            className: "text-base text-text-secondary text-center",
            children: g
        }), S[14] = g, S[15] = b) : b = S[15], S[16] !== f || S[17] !== b ? (v = (0, t.jsxs)("div", {
            className: "flex flex-col gap-1",
            children: [f, b]
        }), S[16] = f, S[17] = b, S[18] = v) : v = S[18], S[19] === Symbol.for("react.memo_cache_sentinel") ? (x = (0, t.jsx)("div", {
            className: "w-full",
            children: (0, t.jsx)(p, {})
        }), S[19] = x) : x = S[19], S[20] !== k ? (w = k && (0, t.jsx)("p", {
            className: "text-body-sm text-red-500 text-center w-full",
            children: k
        }), S[20] = k, S[21] = w) : w = S[21];
        let P = "pending" === T;
        return S[22] !== T || S[23] !== A ? (_ = "pending" === T ? (0, t.jsxs)(t.Fragment, {
            children: [(0, t.jsx)(y.default, {
                color: "white",
                className: "h-6 w-6"
            }), (0, t.jsx)("span", {
                children: A("portfolio.autoRedeem.approving")
            })]
        }) : (0, t.jsx)("span", {
            children: A("portfolio.autoRedeem.enableAutoRedeem")
        }), S[22] = T, S[23] = A, S[24] = _) : _ = S[24], S[25] !== M || S[26] !== P || S[27] !== _ ? (C = (0, t.jsx)("div", {
            className: "flex flex-col w-full gap-1",
            children: (0, t.jsx)(n.Button, {
                variant: "default",
                onClick: M,
                disabled: P,
                className: "h-[52px] w-full text-base bg-brand-500 hover:bg-brand-500/90 text-white disabled:opacity-50 disabled:cursor-wait flex items-center justify-center gap-2",
                children: _
            })
        }), S[25] = M, S[26] = P, S[27] = _, S[28] = C) : C = S[28], S[29] !== C || S[30] !== v || S[31] !== w ? (E = (0, t.jsxs)("div", {
            className: "flex flex-col items-center w-full gap-[18px]",
            children: [u, v, x, w, C]
        }, o.OnboardingRoute.AUTOREDEEM), S[29] = C, S[30] = v, S[31] = w, S[32] = E) : E = S[32], E
    };
    var b = e.i(197994);
    e.s(["IconEnvelopeFill18", 0, ({ ...e
    }) => i.default.createElement(b.Icon, {
        size: "18px",
        ...e
    }, i.default.createElement("path", {
        d: "M8.88,8.827c.074,.042,.166,.042,.24,0l7.777-4.283c-.314-1.173-1.376-2.044-2.647-2.044H3.75c-1.267,0-2.326,.865-2.643,2.033l7.773,4.293Z",
        fill: "currentColor",
        "data-color": "color-2"
    }), i.default.createElement("path", {
        d: "M9.845,10.14c-.264,.146-.554,.219-.844,.219s-.582-.073-.846-.22L1,6.188v6.562c0,1.517,1.233,2.75,2.75,2.75H14.25c1.517,0,2.75-1.233,2.75-2.75V6.2l-7.155,3.94Z",
        fill: "currentColor"
    }))], 952753)
}, 869438, e => {
    "use strict";
    var t = e.i(192842);
    e.s(["compareDesc", 0, function(e, r) {
        let n = (0, t.toDate)(e) - (0, t.toDate)(r);
        return n > 0 ? -1 : n < 0 ? 1 : n
    }])
}, 549889, 654446, e => {
    "use strict";
    var t = e.i(122538),
        r = e.i(796112),
        n = e.i(289780),
        a = e.i(698576),
        i = class extends a.Subscribable {
            constructor(e = {}) {
                super(), this.config = e, this.#g = new Map
            }#
            g;
            build(e, n, a) {
                let i = n.queryKey,
                    o = n.queryHash ? ? (0, t.hashQueryKeyByOptions)(i, n),
                    s = this.get(o);
                return s || (s = new r.Query({
                    client: e,
                    queryKey: i,
                    queryHash: o,
                    options: e.defaultQueryOptions(n),
                    state: a,
                    defaultOptions: e.getQueryDefaults(i)
                }), this.add(s)), s
            }
            add(e) {
                this.#g.has(e.queryHash) || (this.#g.set(e.queryHash, e), this.notify({
                    type: "added",
                    query: e
                }))
            }
            remove(e) {
                let t = this.#g.get(e.queryHash);
                t && (e.destroy(), t === e && this.#g.delete(e.queryHash), this.notify({
                    type: "removed",
                    query: e
                }))
            }
            clear() {
                n.notifyManager.batch(() => {
                    this.getAll().forEach(e => {
                        this.remove(e)
                    })
                })
            }
            get(e) {
                return this.#g.get(e)
            }
            getAll() {
                return [...this.#g.values()]
            }
            find(e) {
                let r = {
                    exact: !0,
                    ...e
                };
                return this.getAll().find(e => (0, t.matchQuery)(r, e))
            }
            findAll(e = {}) {
                let r = this.getAll();
                return Object.keys(e).length > 0 ? r.filter(r => (0, t.matchQuery)(e, r)) : r
            }
            notify(e) {
                n.notifyManager.batch(() => {
                    this.listeners.forEach(t => {
                        t(e)
                    })
                })
            }
            onFocus() {
                n.notifyManager.batch(() => {
                    this.getAll().forEach(e => {
                        e.onFocus()
                    })
                })
            }
            onOnline() {
                n.notifyManager.batch(() => {
                    this.getAll().forEach(e => {
                        e.onOnline()
                    })
                })
            }
        };
    e.s(["QueryCache", 0, i], 654446);
    var o = e.i(68126),
        s = a,
        l = class extends s.Subscribable {
            constructor(e = {}) {
                super(), this.config = e, this.#b = new Set, this.#v = new Map, this.#x = 0
            }#
            b;#
            v;#
            x;
            build(e, t, r) {
                let n = new o.Mutation({
                    client: e,
                    mutationCache: this,
                    mutationId: ++this.#x,
                    options: e.defaultMutationOptions(t),
                    state: r
                });
                return this.add(n), n
            }
            add(e) {
                this.#b.add(e);
                let t = c(e);
                if ("string" == typeof t) {
                    let r = this.#v.get(t);
                    r ? r.push(e) : this.#v.set(t, [e])
                }
                this.notify({
                    type: "added",
                    mutation: e
                })
            }
            remove(e) {
                if (this.#b.delete(e)) {
                    let t = c(e);
                    if ("string" == typeof t) {
                        let r = this.#v.get(t);
                        if (r)
                            if (r.length > 1) {
                                let t = r.indexOf(e); - 1 !== t && r.splice(t, 1)
                            } else r[0] === e && this.#v.delete(t)
                    }
                }
                this.notify({
                    type: "removed",
                    mutation: e
                })
            }
            canRun(e) {
                let t = c(e);
                if ("string" != typeof t) return !0; {
                    let r = this.#v.get(t),
                        n = r ? .find(e => "pending" === e.state.status);
                    return !n || n === e
                }
            }
            runNext(e) {
                let t = c(e);
                if ("string" != typeof t) return Promise.resolve(); {
                    let r = this.#v.get(t) ? .find(t => t !== e && t.state.isPaused);
                    return r ? .continue() ? ? Promise.resolve()
                }
            }
            clear() {
                n.notifyManager.batch(() => {
                    this.#b.forEach(e => {
                        this.notify({
                            type: "removed",
                            mutation: e
                        })
                    }), this.#b.clear(), this.#v.clear()
                })
            }
            getAll() {
                return Array.from(this.#b)
            }
            find(e) {
                let r = {
                    exact: !0,
                    ...e
                };
                return this.getAll().find(e => (0, t.matchMutation)(r, e))
            }
            findAll(e = {}) {
                return this.getAll().filter(r => (0, t.matchMutation)(e, r))
            }
            notify(e) {
                n.notifyManager.batch(() => {
                    this.listeners.forEach(t => {
                        t(e)
                    })
                })
            }
            resumePausedMutations() {
                let e = this.getAll().filter(e => e.state.isPaused);
                return n.notifyManager.batch(() => Promise.all(e.map(e => e.continue().catch(t.noop))))
            }
        };

    function c(e) {
        return e.options.scope ? .id
    }
    var u = e.i(351117),
        d = e.i(721570),
        f = class {#
            w;#
            n;#
            _;#
            C;#
            E;#
            S;#
            A;#
            I;
            constructor(e = {}) {
                this.#w = e.queryCache || new i, this.#n = e.mutationCache || new l, this.#_ = e.defaultOptions || {}, this.#C = new Map, this.#E = new Map, this.#S = 0
            }
            mount() {
                this.#S++, 1 === this.#S && (this.#A = u.focusManager.subscribe(async e => {
                    e && (await this.resumePausedMutations(), this.#w.onFocus())
                }), this.#I = d.onlineManager.subscribe(async e => {
                    e && (await this.resumePausedMutations(), this.#w.onOnline())
                }))
            }
            unmount() {
                this.#S--, 0 === this.#S && (this.#A ? .(), this.#A = void 0, this.#I ? .(), this.#I = void 0)
            }
            isFetching(e) {
                return this.#w.findAll({ ...e,
                    fetchStatus: "fetching"
                }).length
            }
            isMutating(e) {
                return this.#n.findAll({ ...e,
                    status: "pending"
                }).length
            }
            getQueryData(e) {
                let t = this.defaultQueryOptions({
                    queryKey: e
                });
                return this.#w.get(t.queryHash) ? .state.data
            }
            ensureQueryData(e) {
                let r = this.defaultQueryOptions(e),
                    n = this.#w.build(this, r),
                    a = n.state.data;
                return void 0 === a ? this.fetchQuery(e) : (e.revalidateIfStale && n.isStaleByTime((0, t.resolveStaleTime)(r.staleTime, n)) && this.prefetchQuery(r), Promise.resolve(a))
            }
            getQueriesData(e) {
                return this.#w.findAll(e).map(({
                    queryKey: e,
                    state: t
                }) => [e, t.data])
            }
            setQueryData(e, r, n) {
                let a = this.defaultQueryOptions({
                        queryKey: e
                    }),
                    i = this.#w.get(a.queryHash),
                    o = i ? .state.data,
                    s = (0, t.functionalUpdate)(r, o);
                if (void 0 !== s) return this.#w.build(this, a).setData(s, { ...n,
                    manual: !0
                })
            }
            setQueriesData(e, t, r) {
                return n.notifyManager.batch(() => this.#w.findAll(e).map(({
                    queryKey: e
                }) => [e, this.setQueryData(e, t, r)]))
            }
            getQueryState(e) {
                let t = this.defaultQueryOptions({
                    queryKey: e
                });
                return this.#w.get(t.queryHash) ? .state
            }
            removeQueries(e) {
                let t = this.#w;
                n.notifyManager.batch(() => {
                    t.findAll(e).forEach(e => {
                        t.remove(e)
                    })
                })
            }
            resetQueries(e, t) {
                let r = this.#w;
                return n.notifyManager.batch(() => (r.findAll(e).forEach(e => {
                    e.reset()
                }), this.refetchQueries({
                    type: "active",
                    ...e
                }, t)))
            }
            cancelQueries(e, r = {}) {
                let a = {
                    revert: !0,
                    ...r
                };
                return Promise.all(n.notifyManager.batch(() => this.#w.findAll(e).map(e => e.cancel(a)))).then(t.noop).catch(t.noop)
            }
            invalidateQueries(e, t = {}) {
                return n.notifyManager.batch(() => (this.#w.findAll(e).forEach(e => {
                    e.invalidate()
                }), e ? .refetchType === "none") ? Promise.resolve() : this.refetchQueries({ ...e,
                    type: e ? .refetchType ? ? e ? .type ? ? "active"
                }, t))
            }
            refetchQueries(e, r = {}) {
                let a = { ...r,
                    cancelRefetch: r.cancelRefetch ? ? !0
                };
                return Promise.all(n.notifyManager.batch(() => this.#w.findAll(e).filter(e => !e.isDisabled() && !e.isStatic()).map(e => {
                    let r = e.fetch(void 0, a);
                    return a.throwOnError || (r = r.catch(t.noop)), "paused" === e.state.fetchStatus ? Promise.resolve() : r
                }))).then(t.noop)
            }
            fetchQuery(e) {
                let r = this.defaultQueryOptions(e);
                void 0 === r.retry && (r.retry = !1);
                let n = this.#w.build(this, r);
                return n.isStaleByTime((0, t.resolveStaleTime)(r.staleTime, n)) ? n.fetch(r) : Promise.resolve(n.state.data)
            }
            prefetchQuery(e) {
                return this.fetchQuery(e).then(t.noop).catch(t.noop)
            }
            fetchInfiniteQuery(e) {
                return e._type = "infinite", this.fetchQuery(e)
            }
            prefetchInfiniteQuery(e) {
                return this.fetchInfiniteQuery(e).then(t.noop).catch(t.noop)
            }
            ensureInfiniteQueryData(e) {
                return e._type = "infinite", this.ensureQueryData(e)
            }
            resumePausedMutations() {
                return d.onlineManager.isOnline() ? this.#n.resumePausedMutations() : Promise.resolve()
            }
            getQueryCache() {
                return this.#w
            }
            getMutationCache() {
                return this.#n
            }
            getDefaultOptions() {
                return this.#_
            }
            setDefaultOptions(e) {
                this.#_ = e
            }
            setQueryDefaults(e, r) {
                this.#C.set((0, t.hashKey)(e), {
                    queryKey: e,
                    defaultOptions: r
                })
            }
            getQueryDefaults(e) {
                let r = [...this.#C.values()],
                    n = {};
                return r.forEach(r => {
                    (0, t.partialMatchKey)(e, r.queryKey) && Object.assign(n, r.defaultOptions)
                }), n
            }
            setMutationDefaults(e, r) {
                this.#E.set((0, t.hashKey)(e), {
                    mutationKey: e,
                    defaultOptions: r
                })
            }
            getMutationDefaults(e) {
                let r = [...this.#E.values()],
                    n = {};
                return r.forEach(r => {
                    (0, t.partialMatchKey)(e, r.mutationKey) && Object.assign(n, r.defaultOptions)
                }), n
            }
            defaultQueryOptions(e) {
                if (e._defaulted) return e;
                let r = { ...this.#_.queries,
                    ...this.getQueryDefaults(e.queryKey),
                    ...e,
                    _defaulted: !0
                };
                return r.queryHash || (r.queryHash = (0, t.hashQueryKeyByOptions)(r.queryKey, r)), void 0 === r.refetchOnReconnect && (r.refetchOnReconnect = "always" !== r.networkMode), void 0 === r.throwOnError && (r.throwOnError = !!r.suspense), !r.networkMode && r.persister && (r.networkMode = "offlineFirst"), r.queryFn === t.skipToken && (r.enabled = !1), r
            }
            defaultMutationOptions(e) {
                return e ? ._defaulted ? e : { ...this.#_.mutations,
                    ...e ? .mutationKey && this.getMutationDefaults(e.mutationKey),
                    ...e,
                    _defaulted : !0
                }
            }
            clear() {
                this.#w.clear(), this.#n.clear()
            }
        };
    e.s(["QueryClient", 0, f], 549889)
}, 978216, e => {
    "use strict";
    e.s(["parseGammaProfile", () => a, "parseGammaProfileAfterCreation", () => n]);
    var t = e.i(333223),
        r = e.i(693116);
    let n = e => {
            let n = Date.now(),
                {
                    profile: a,
                    user: i,
                    authenticationType: o,
                    magicUser: s
                } = e;
            return {
                username: a.name,
                pseudonym: a ? .pseudonym ? ? "",
                email: i ? .email ? ? "",
                displayUsernamePublic: !!a ? .displayUsernamePublic,
                profile: a.id,
                blocked: !1,
                address: i ? .address,
                proxyWallet: a.proxyWallet,
                userTag: "",
                profile_image: a ? .profileImage ? ? void 0,
                bio: a ? .bio ? ? "",
                created_at: a.createdAt,
                loggedIn: !0,
                authType: o,
                walletActivated: t.WalletState.Active,
                profileCreationTime: a ? .createdAt ? new Date(a.createdAt).getTime() : Date.now(),
                userId: i.id,
                isOnboarding: !0,
                lastSeen: n,
                lastRefreshed: n,
                xUsername: a ? .xUsername,
                termsAcceptedAt: a ? .termsAcceptedAt,
                viewOnlyAcknowledgedAt: a ? .viewOnlyAcknowledgedAt,
                ..."magic" === o && !!s && { ...s.oauthProvider && {
                        oauthProvider: r.MagicOauthTypesEnum.parse(s.oauthProvider)
                    },
                    ...!!s.email && !s.oauthProvider && {
                        email: s.email
                    },
                    ...!!s.email && !!s.oauthProvider && {
                        email: `${r.OAUTH_EMAIL_PREFIX}${s.email}`
                    }
                }
            }
        },
        a = (e, n, a) => {
            let i = Date.now(),
                {
                    profile: o,
                    ...s
                } = e;
            return {
                username: o.name,
                pseudonym: o ? .pseudonym ? ? "",
                email: s ? .email ? ? "",
                displayUsernamePublic: !!o ? .displayUsernamePublic,
                profile: o.id,
                blocked: !!s ? .blocked,
                address: s ? .address,
                proxyWallet: o.proxyWallet,
                userTag: "",
                profile_image: o ? .profileImage ? ? void 0,
                profile_image_optimized: o ? .profileImageOptimized,
                bio: o ? .bio ? ? "",
                created_at: o ? .createdAt ? ? new Date().toISOString(),
                loggedIn: !0,
                authType: n,
                walletActivated: o ? .walletActivated ? t.WalletState.Active : t.WalletState.Inactive,
                profileCreationTime: o ? .createdAt ? new Date(o.createdAt).getTime() : Date.now(),
                userId: s.id,
                lastSeen: i,
                lastRefreshed: i,
                xUsername: o ? .xUsername,
                verifiedBadge: o ? .verifiedBadge,
                termsAcceptedAt: o ? .termsAcceptedAt,
                viewOnlyAcknowledgedAt: o ? .viewOnlyAcknowledgedAt,
                ..."magic" === n && !!a && { ...a.oauthProvider && {
                        oauthProvider: r.MagicOauthTypesEnum.parse(a.oauthProvider)
                    },
                    ...!!a.email && !a.oauthProvider && {
                        email: a.email
                    },
                    ...!!a.email && !!a.oauthProvider && {
                        email: `${r.OAUTH_EMAIL_PREFIX}${a.email}`
                    }
                },
                isCloseOnly: o ? .isCloseOnly,
                isCertReq: o ? .isCertReq
            }
        }
}, 333223, 116164, e => {
    "use strict";
    e.s(["WalletState", () => C, "default", () => T, "updateComplianceTimestamps", () => S], 333223);
    var t, r = e.i(999061),
        n = e.i(122538),
        a = e.i(549889),
        i = e.i(601550),
        o = e.i(964974),
        s = e.i(416340),
        l = e.i(978216),
        c = e.i(510954),
        u = e.i(57096),
        d = e.i(305292),
        f = e.i(784521),
        p = e.i(660006),
        h = e.i(53950),
        m = e.i(655740);
    let y = e => {
        m.axios.post("/api/account/profile/invalidate", {
            previousUsername: e
        }).catch(e => h.logger.warn("Failed to invalidate profile cache", {
            error: e
        }))
    };
    e.s(["invalidateProfileCache", 0, y], 116164);
    var g = e.i(318594),
        b = e.i(330104),
        v = e.i(194484),
        x = e.i(344020);
    let w = function(e, t, r) {
            var n;
            return null == e ? e : (n = "function" == typeof r ? r : x.default, (0, v.default)(e, t, n((0, b.default)(e, t)), void 0))
        },
        _ = "polymarket.account.metadataMap";
    var C = ((t = {}).Inactive = "notActive", t.Active = "active", t);
    let E = async () => {
            let e = await (0, d.getGammaClient)().users.get();
            if ("failure" === e.status) throw h.logger.error("[useAccountProfile > accountProfileFetcher]", {
                error: e.error
            }), e.error;
            let {
                user: t
            } = e.data, r = t.isExternalAuth ? "eoa" : "magic", n = (0, l.parseGammaProfile)(t, r);
            return { ...n,
                walletActivated: "active" === n.walletActivated ? "active" : "notActive"
            }
        },
        S = async e => {
            let t = await (0, d.getGammaClient)().profiles.update({
                id: e.profileId,
                userId: e.userId,
                ...e.termsAcceptedAt && {
                    termsAcceptedAt: e.termsAcceptedAt
                },
                ...e.viewOnlyAcknowledgedAt && {
                    viewOnlyAcknowledgedAt: e.viewOnlyAcknowledgedAt
                }
            });
            if ("failure" === t.status) throw h.logger.error("[useAccountProfile > updateComplianceTimestamps]", {
                error: t.error,
                variables: e
            }), t.error
        },
        A = async e => {
            let t = await fetch("/api/account/profile/image", {
                method: "PUT",
                body: e,
                credentials: "same-origin"
            });
            if (!t.ok) {
                let e = Error(`Request failed with status code ${t.status}`);
                throw e.status = t.status, e
            }
            return (await t.json()).profileImage
        },
        I = async e => {
            let {
                profileId: t,
                userId: r,
                username: n,
                bio: a,
                hasPhotoToUpload: i,
                formData: o
            } = e, s = i ? await A(o) : void 0, l = await (0, d.getGammaClient)().profiles.update({
                id: t,
                userId: r,
                ...!!n && {
                    name: n
                },
                ...void 0 !== a && {
                    bio: a
                },
                ...s && {
                    profileImage: s
                }
            });
            if ("failure" === l.status) throw h.logger.error("[useAccountProfile > updateAccountProfileFull]", {
                error: l.error,
                variables: e
            }), l.error;
            return {
                profile_image: s,
                username: n,
                bio: a
            }
        },
        T = (e, t) => {
            let l, d, h, m, b, v, x, C, S, A, T, R, N, M, P, D, j, L = (0, r.c)(41);
            L[0] === Symbol.for("react.memo_cache_sentinel") ? (l = new a.QueryClient, L[0] = l) : l = L[0];
            let F = l,
                {
                    mutateAccountMetadataMap: U
                } = (() => {
                    let e = (0, g.useQueryClient)(),
                        {
                            data: t
                        } = (0, o.useQuery)({
                            queryKey: c.queryKeys[u.QueryKey.Tracking].metadataMap().queryKey,
                            queryFn: async () => {
                                let e = localStorage.getItem(_);
                                return e ? JSON.parse(e) : {}
                            },
                            refetchOnWindowFocus: !1,
                            refetchOnReconnect: !1,
                            staleTime: 1e4
                        }),
                        {
                            mutate: r
                        } = (0, i.useMutation)({
                            mutationFn: async t => {
                                let r = e.getQueryData(c.queryKeys[u.QueryKey.Tracking].metadataMap().queryKey),
                                    n = Date.now(),
                                    a = r ? w(r, t.address.toLowerCase(), e => {
                                        let r = Date.now();
                                        return { ...e,
                                            lastSeen: t.injectedTimestamps ? .lastSeen !== void 0 ? t.injectedTimestamps.lastSeen : e.lastSeen ? ? r,
                                            lastRefreshed: t.injectedTimestamps ? .lastRefreshed !== void 0 ? t.injectedTimestamps.lastRefreshed : e.lastRefreshed ? ? r
                                        }
                                    }) : {
                                        [t.address.toLowerCase()]: {
                                            lastSeen: t.injectedTimestamps ? .lastSeen ? ? n,
                                            lastRefreshed: t.injectedTimestamps ? .lastRefreshed ? ? n
                                        }
                                    };
                                return localStorage.setItem(_, JSON.stringify(a)), e.invalidateQueries({
                                    queryKey: c.queryKeys[u.QueryKey.Tracking].metadataMap._def
                                }), a
                            }
                        }),
                        n = (0, s.useCallback)(t => {
                            let r = e.getQueryData(c.queryKeys[u.QueryKey.Tracking].metadataMap().queryKey),
                                n = r ? .[t.toLowerCase()];
                            return !n || Date.now() - n.lastRefreshed > 864e5
                        }, [e]);
                    return (0, s.useMemo)(() => ({
                        accountMetadataMap: t,
                        mutateAccountMetadataMap: r,
                        shouldRevalidateProfile: n
                    }), [t, r, n])
                })();
            L[1] === Symbol.for("react.memo_cache_sentinel") ? (d = ["isSessionLoading", "authenticated", "proxyAddress", "isUserOnboarding"], L[1] = d) : d = L[1];
            let {
                isSessionLoading: $,
                authenticated: z,
                proxyAddress: B,
                isUserOnboarding: q
            } = (0, f.useAccountContext)(d);
            e ? .isSessionLoading;
            let W = e ? .isSessionLoading !== void 0 ? e ? .isSessionLoading : $;
            L[2] !== z || L[3] !== e ? .authenticated ? (h = () => e ? .authenticated !== void 0 ? e ? .authenticated : z, L[2] = z, L[3] = e ? .authenticated, L[4] = h) : h = L[4], e ? .authenticated, L[5] !== h ? (m = h(), L[5] = h, L[6] = m) : m = L[6];
            let Z = m;
            e ? .proxyAddress;
            let V = e ? .proxyAddress !== void 0 ? e ? .proxyAddress : B;
            L[7] !== e ? .isOnboarding || L[8] !== q ? (b = () => e ? .isOnboarding !== void 0 ? e ? .isOnboarding : q, L[7] = e ? .isOnboarding, L[8] = q, L[9] = b) : b = L[9], e ? .isOnboarding, L[10] !== b ? (v = b(), L[10] = b, L[11] = v) : v = L[11];
            let K = v;
            t ? .enabled;
            let H = t ? .enabled || !W && !K && Z && !!V;
            L[12] === Symbol.for("react.memo_cache_sentinel") ? (x = c.queryKeys[u.QueryKey.Account].profile(), L[12] = x) : x = L[12], L[13] !== t ? .enableCallbacks || L[14] !== U ? (C = async () => {
                let e = await E();
                return t ? .enableCallbacks && (e.lastRefreshed || e.lastSeen) && U({
                    address: e.address,
                    injectedTimestamps: {
                        lastSeen: e.lastSeen,
                        lastRefreshed: e.lastRefreshed
                    }
                }), e
            }, L[13] = t ? .enableCallbacks, L[14] = U, L[15] = C) : C = L[15], L[16] === Symbol.for("react.memo_cache_sentinel") ? (S = {
                persist: !0,
                errorContext: {
                    tag: "[useAccountProfile] /api/account/profile"
                }
            }, L[16] = S) : S = L[16], L[17] !== H || L[18] !== C ? (A = {
                queryKey: x.queryKey,
                queryFn: C,
                enabled: H,
                refetchOnWindowFocus: !1,
                refetchOnReconnect: !1,
                placeholderData: n.keepPreviousData,
                retry: 3,
                retryDelay: k,
                gcTime: 6e5,
                staleTime: 6e5,
                meta: S
            }, L[17] = H, L[18] = C, L[19] = A) : A = L[19];
            let {
                data: G,
                refetch: Q,
                isLoading: J,
                isPending: Y
            } = (0, o.useQuery)(A);
            L[20] === Symbol.for("react.memo_cache_sentinel") ? (T = c.queryKeys[u.QueryKey.Account].profile(), L[20] = T) : T = L[20], L[21] !== G ? .profile || L[22] !== G ? .userId ? (R = e => I({
                profileId: G ? .profile ? .toString() || "",
                userId: G ? .userId || "",
                ...e
            }), L[21] = G ? .profile, L[22] = G ? .userId, L[23] = R) : R = L[23], L[24] === Symbol.for("react.memo_cache_sentinel") ? (N = e => {
                let t = F.getQueryData(c.queryKeys[u.QueryKey.Account].profile().queryKey),
                    r = { ...t,
                        ...e
                    };
                return F.setQueryData(c.queryKeys[u.QueryKey.Account].profile().queryKey, r), {
                    previousProfile: t
                }
            }, L[24] = N) : N = L[24], L[25] !== Q ? (M = async (e, t, r) => {
                let n = r ? .previousProfile ? .username;
                y(t.username && n && t.username !== n ? n : void 0), await Q()
            }, L[25] = Q, L[26] = M) : M = L[26], L[27] !== V ? (P = (e, t, r) => (F.setQueryData(c.queryKeys[u.QueryKey.Account].profile().queryKey, r ? .previousProfile), (0, p.handleError)(e, "updateAccountUsernamePublic", V), e), L[27] = V, L[28] = P) : P = L[28], L[29] !== R || L[30] !== M || L[31] !== P ? (D = {
                mutationKey: T.queryKey,
                mutationFn: R,
                retry: 1,
                retryDelay: O,
                onMutate: N,
                onSuccess: M,
                onError: P
            }, L[29] = R, L[30] = M, L[31] = P, L[32] = D) : D = L[32];
            let {
                mutateAsync: X,
                isPending: ee
            } = (0, i.useMutation)(D), et = !!G ? .loggedIn;
            return L[33] !== Q || L[34] !== J || L[35] !== Y || L[36] !== ee || L[37] !== G || L[38] !== et || L[39] !== X ? (j = {
                accountProfile: G,
                getAccountProfile: Q,
                isAccountProfileLoading: J,
                isAccountProfilePending: Y,
                updateProfile: X,
                isPendingUpdateProfile: ee,
                loggedIn: et
            }, L[33] = Q, L[34] = J, L[35] = Y, L[36] = ee, L[37] = G, L[38] = et, L[39] = X, L[40] = j) : j = L[40], j
        };

    function k(e) {
        return Math.min(e > 1 ? 2 ** e * 1e3 : 4e3, 3e4)
    }

    function O(e) {
        return Math.min(e > 1 ? 2 ** e * 1e3 : 1e3, 3e4)
    }
}, 717886, e => {
    "use strict";
    e.s(["default", () => _]);
    var t = e.i(999061),
        r = e.i(601550),
        n = e.i(964974),
        a = e.i(318594),
        i = e.i(869438);
    e.i(416340);
    var o = e.i(601676),
        s = e.i(305292),
        l = e.i(510954),
        c = e.i(57096),
        u = e.i(668122),
        d = e.i(655740),
        f = e.i(784521),
        p = e.i(660006),
        h = e.i(53950),
        m = e.i(631222),
        y = e.i(333223);
    let g = async e => {
            let t = new o.BrowserAmplitudeAnalyticsAdapter;
            await t.initializeAdapter(), await t.trackEvent(u.Events.VerifyEmail, {
                email: e.email
            });
            let r = await d.axios.post("/api/account/verify-emails/create", {
                email: e.email
            });
            return {
                message: r.data.message,
                statusCode: r.status
            }
        },
        b = async e => {
            let t = await (0, s.getGammaClient)().verifications.delete({
                id: e.id
            });
            if ("failure" === t.status) throw h.logger.error("[userVerifyEmails > deleteEmailVerificationFetcher]", {
                error: t.error,
                variables: e
            }), t.error;
            return {
                message: `Verification record deleted with id: ${e.id}`
            }
        },
        v = async e => d.axios.post("/api/account/verify-emails/check", {
            verifyToken: e.verifyToken
        }),
        x = async () => {
            let {
                data: e
            } = await d.axios.get(`${m.GAMMA_API_URL}/verification_emails`, {
                withCredentials: !0
            }), t = e.toSorted((e, t) => (0, i.compareDesc)(new Date(e.timestamp.split("+")[0]).getTime(), new Date(t.timestamp.split("+")[0]).getTime()));
            if (t ? .length) {
                let {
                    email: e,
                    timestamp: r,
                    verified: n,
                    id: a
                } = t[0];
                return {
                    email: e,
                    timestamp: r,
                    verified: n,
                    id: a
                }
            }
            return null
        },
        w = async () => {
            let {
                data: e
            } = await d.axios.get(`${m.GAMMA_API_URL}/verification_emails`, {
                withCredentials: !0
            }), t = e.toSorted((e, t) => (0, i.compareDesc)(new Date(e.timestamp.split("+")[0]).getTime(), new Date(t.timestamp.split("+")[0]).getTime())).filter(e => e.verified);
            if (t.length) {
                let {
                    email: e,
                    timestamp: r,
                    verified: n,
                    id: a
                } = t[0];
                return {
                    email: e,
                    timestamp: r,
                    verified: n,
                    id: a
                }
            }
            return null
        },
        _ = () => {
            let e, i, o, s, u, d, h, m, x, w, _, S, A, I, T, k, O, R, N, M, P, D, j = (0, t.c)(69),
                L = (0, a.useQueryClient)();
            j[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["proxyAddress", "authenticationType", "authenticated", "isUserOnboarding"], j[0] = e) : e = j[0];
            let {
                proxyAddress: F,
                authenticationType: U,
                authenticated: $,
                isUserOnboarding: z
            } = (0, f.useAccountContext)(e), {
                accountProfile: B
            } = (0, y.default)(), q = $ && "eoa" === U && !!F && !z;
            j[1] !== $ || j[2] !== F ? (i = ["/api/account/verify-emails/last", $, F], j[1] = $, j[2] = F, j[3] = i) : i = j[3], j[4] !== F ? (o = {
                errorContext: {
                    tag: "[useVerifyEmails] /api/account/verify-emails/last last verification error",
                    proxyAddress: F
                }
            }, j[4] = F, j[5] = o) : o = j[5], j[6] !== q || j[7] !== i || j[8] !== o ? (s = {
                queryKey: i,
                queryFn: C,
                enabled: q,
                staleTime: 1e4,
                retry: !1,
                meta: o
            }, j[6] = q, j[7] = i, j[8] = o, j[9] = s) : s = j[9];
            let W = (0, n.useQuery)(s),
                {
                    data: Z,
                    refetch: V
                } = W;
            j[10] !== $ || j[11] !== U || j[12] !== F ? (u = ["/api/account/verify-emails/last-verified", $, U, F], j[10] = $, j[11] = U, j[12] = F, j[13] = u) : u = j[13], j[14] !== F ? (d = {
                errorContext: {
                    tag: "[useVerifyEmails] /api/account/verify-emails/last-verified last-verified verification error",
                    proxyAddress: F
                }
            }, j[14] = F, j[15] = d) : d = j[15], j[16] !== q || j[17] !== u || j[18] !== d ? (h = {
                queryKey: u,
                queryFn: E,
                enabled: q,
                staleTime: 1e4,
                retry: !1,
                meta: d
            }, j[16] = q, j[17] = u, j[18] = d, j[19] = h) : h = j[19];
            let K = (0, n.useQuery)(h),
                {
                    data: H,
                    refetch: G
                } = K;
            j[20] !== $ || j[21] !== U || j[22] !== F ? (m = ["/api/account/verify-emails/create", $, U, F], j[20] = $, j[21] = U, j[22] = F, j[23] = m) : m = j[23], j[24] !== L ? (x = () => {
                L.invalidateQueries({
                    queryKey: [
                        ["/api/account/verify-emails/last"]
                    ]
                })
            }, j[24] = L, j[25] = x) : x = j[25], j[26] !== F ? (w = e => {
                (0, p.handleError)(e, "[useVerifyEmails] /api/account/verify-emails/create create verification mutation error", F)
            }, j[26] = F, j[27] = w) : w = j[27], j[28] !== m || j[29] !== x || j[30] !== w ? (_ = {
                mutationKey: m,
                mutationFn: g,
                retry: !1,
                onSuccess: x,
                onError: w
            }, j[28] = m, j[29] = x, j[30] = w, j[31] = _) : _ = j[31];
            let {
                mutateAsync: Q
            } = (0, r.useMutation)(_);
            j[32] !== $ || j[33] !== U || j[34] !== F ? (S = ["/api/account/verify-emails/delete", $, U, F], j[32] = $, j[33] = U, j[34] = F, j[35] = S) : S = j[35], j[36] !== F ? (A = e => {
                (0, p.handleError)(e, "[useVerifyEmails] /api/account/verify-emails/delete delete verification mutation error", F)
            }, j[36] = F, j[37] = A) : A = j[37], j[38] !== S || j[39] !== A ? (I = {
                mutationKey: S,
                mutationFn: b,
                retry: !1,
                onError: A
            }, j[38] = S, j[39] = A, j[40] = I) : I = j[40];
            let {
                mutateAsync: J
            } = (0, r.useMutation)(I);
            j[41] !== $ || j[42] !== U || j[43] !== F ? (T = ["/api/account/verify-emails/verify", $, U, F], j[41] = $, j[42] = U, j[43] = F, j[44] = T) : T = j[44], j[45] !== L ? (k = () => Promise.all([L.invalidateQueries({
                queryKey: ["/api/account/verify-emails/last"]
            }), L.invalidateQueries({
                queryKey: ["/api/account/verify-emails/last-verified"]
            }), L.invalidateQueries({
                queryKey: l.queryKeys[c.QueryKey.Account].profile().queryKey
            })]), j[45] = L, j[46] = k) : k = j[46], j[47] !== F ? (O = e => {
                (0, p.handleError)(e, "[useVerifyEmails] /api/account/verify-emails/verify verify verification mutation error", F)
            }, j[47] = F, j[48] = O) : O = j[48], j[49] !== T || j[50] !== k || j[51] !== O ? (R = {
                mutationKey: T,
                mutationFn: v,
                retry: !1,
                onSettled: k,
                onError: O
            }, j[49] = T, j[50] = k, j[51] = O, j[52] = R) : R = j[52];
            let {
                mutateAsync: Y
            } = (0, r.useMutation)(R);
            j[53] !== B || j[54] !== Q ? (N = e => Q({
                email: e,
                userId: B.userId
            }), j[53] = B, j[54] = Q, j[55] = N) : N = j[55];
            let X = N;
            j[56] !== J ? (M = e => J({
                id: e
            }), j[56] = J, j[57] = M) : M = j[57];
            let ee = M;
            j[58] !== Y ? (P = e => Y({
                verifyToken: e
            }), j[58] = Y, j[59] = P) : P = j[59];
            let et = P,
                er = !q || !W.isPending && !K.isPending;
            return j[60] !== X || j[61] !== ee || j[62] !== V || j[63] !== G || j[64] !== Z || j[65] !== H || j[66] !== er || j[67] !== et ? (D = {
                createEmailVerification: X,
                deleteEmailVerification: ee,
                verifyEmail: et,
                getLastEmail: V,
                getLastVerifiedEmail: G,
                lastEmail: Z,
                lastVerifiedEmail: H,
                verificationQueriesReady: er
            }, j[60] = X, j[61] = ee, j[62] = V, j[63] = G, j[64] = Z, j[65] = H, j[66] = er, j[67] = et, j[68] = D) : D = j[68], D
        };

    function C() {
        return x()
    }

    function E() {
        return w()
    }
}, 759926, e => {
    "use strict";
    e.s(["shouldShowViewOnly", 0, ({
        isUsa: e,
        isFrance: t,
        isUk: r,
        isOntario: n,
        isCloseOnlyCountry: a
    }) => e || t || n || r || a])
}, 841231, e => {
    "use strict";
    var t = e.i(322324),
        r = e.i(165974);
    let n = "polymarket.cert.nonusip",
        a = (0, t.create)()((0, r.immer)(e => ({
            requiresTermsAcceptance: !1,
            hasSyncedTermsAcceptance: !1,
            showNonUsIpModal: !1,
            showUsIpModal: !1,
            showProofOfResidenceModal: !1,
            setRequiresTermsAcceptance: t => {
                e(e => {
                    e.requiresTermsAcceptance = t
                })
            },
            setHasSyncedTermsAcceptance: t => {
                e(e => {
                    e.hasSyncedTermsAcceptance = t
                })
            },
            setShowNonUsIpModal: t => {
                e(e => {
                    e.showNonUsIpModal = t
                })
            },
            setShowUsIpModal: t => {
                e(e => {
                    e.showUsIpModal = t
                })
            },
            setShowProofOfResidenceModal: t => {
                e(e => {
                    e.showProofOfResidenceModal = t
                })
            },
            checkCompliance: () => {
                let t = !!window.localStorage.getItem(n),
                    {
                        requiresTermsAcceptance: r,
                        hasSyncedTermsAcceptance: i
                    } = a.getState();
                return !!t || !r && !!i || (e(e => {
                    e.showNonUsIpModal = !0
                }), !1)
            }
        })));
    e.s(["NON_US_IP_LS", 0, n, "PROOF_OF_RESIDENCE_LS", 0, "polymarket.cert.por", "US_IP_VIEW_ONLY_LS", 0, "polymarket.cert.usip", "useComplianceStore", 0, a])
}, 123386, 220222, 684686, e => {
    "use strict";
    e.s(["CaptureEmail", () => L], 123386);
    var t, r = e.i(221628),
        n = e.i(889029),
        a = e.i(23128),
        i = e.i(435894),
        o = e.i(604777),
        s = e.i(952753),
        l = e.i(416340),
        c = e.i(670118),
        u = e.i(573337),
        d = e.i(827681),
        f = e.i(863828),
        p = e.i(717886),
        h = e.i(784521),
        m = e.i(759926),
        y = e.i(841231),
        g = e.i(322324),
        b = e.i(165974);
    let v = ["BE", "BY", "BI", "CF", "CD", "CU", "ET", "FR", "IR", "IQ", "KP", "LB", "LY", "MM", "NI", "RU", "SO", "SS", "SD", "SY", "GB", "UM", "US", "VE", "YE", "ZW", "SG", "PL", "TH", "TW", "AU", "IT", "DE", "NL", "JP"],
        x = e => "GB" === e.country,
        w = e => "FR" === e.country,
        _ = e => "SG" === e.country || "PL" === e.country || "TH" === e.country || "TW" === e.country || v.includes(e.country ? .toUpperCase() ? ? ""),
        C = e => "CA" === e.country && ("ON" === e.countryRegion || "Ontario" === e.countryRegion),
        E = e => "TR" === e.country,
        S = e => "CA" === e.country,
        A = e => "US" === e.country,
        I = e => !!e && (v.includes(e.country ? .toUpperCase() ? ? "") || C(e) || "UA" === e.country && "43" === e.countryRegion || "UA" === e.country && "14" === e.countryRegion || "UA" === e.country && "09" === e.countryRegion);
    e.s(["convertGeoApiResponseToGeo", 0, e => ({
        country: e.location.country,
        countryRegion: e.location.region
    }), "getIsRestricted", 0, I, "isCanada", 0, S, "isCloseOnlyCountry", 0, _, "isFrance", 0, w, "isOntario", 0, C, "isTurkey", 0, E, "isUk", 0, x, "isUsa", 0, A], 220222);
    let T = e => ({
            canBuy: !e,
            canSell: !e,
            canDeposit: !e,
            canWithdraw: !e,
            canSplit: !e,
            canMerge: !e,
            canRedeem: !e,
            canAddLiquidity: !e,
            canRemoveLiquidity: !e,
            canCreateApiKey: !e,
            canApprove: !e,
            canCancelOrders: !e
        }),
        k = {
            block: [],
            closeOnly: [],
            allow: []
        },
        O = {
            hasFetchedLocation: !1,
            isRestrictedLocation: !1,
            permissions: T(!1),
            isTurkey: !1,
            isUk: !1,
            isCanada: !1,
            isUsa: !1,
            isFrance: !1,
            isOntario: !1,
            isCloseOnlyCountry: !1,
            rawCountry: void 0,
            rawRegion: void 0
        },
        R = (0, g.create)()((0, b.immer)(e => ({ ...O,
            walletLists: k,
            setGeolocation: ({
                geolocation: t,
                disabled: r = !1
            }) => {
                e(e => {
                    if (!t || r) return void Object.assign(e, { ...O,
                        hasFetchedLocation: !0
                    });
                    let n = I(t),
                        a = C(t) || x(t) || w(t) || _(t);
                    Object.assign(e, {
                        hasFetchedLocation: !0,
                        isRestrictedLocation: n,
                        permissions: { ...T(n),
                            ...a && {
                                canSell: !0,
                                canWithdraw: !0,
                                canMerge: !0,
                                canRedeem: !0,
                                canRemoveLiquidity: !0,
                                canCreateApiKey: !0,
                                canApprove: !0,
                                canCancelOrders: !0
                            }
                        },
                        isTurkey: E(t),
                        isUk: x(t),
                        isCanada: S(t),
                        isUsa: A(t),
                        isFrance: w(t),
                        isOntario: C(t),
                        isCloseOnlyCountry: _(t),
                        rawCountry: t.country,
                        rawRegion: t.countryRegion
                    })
                })
            },
            setFetchFailed: () => {
                e(e => {
                    e.hasFetchedLocation = !0, e.isRestrictedLocation = !0, e.permissions = T(!0)
                })
            },
            setWalletLists: t => {
                e(e => {
                    e.walletLists = {
                        block: t.block.map(e => e.toLowerCase()),
                        closeOnly: t.closeOnly.map(e => e.toLowerCase()),
                        allow: t.allow.map(e => e.toLowerCase())
                    }, e.permissions = { ...e.permissions
                    }
                })
            }
        })));
    e.s(["getDefaultPermissions", 0, T, "useGeoStore", 0, R], 684686);
    var N = e.i(632567),
        M = e.i(98191),
        P = e.i(660006),
        D = e.i(53950),
        j = ((t = {})[t.Initial = 0] = "Initial", t[t.Pending = 1] = "Pending", t[t.EmailTaken = 2] = "EmailTaken", t[t.UnknownError = 3] = "UnknownError", t[t.Success = 4] = "Success", t);
    let L = ({
        onClose: e
    }) => {
        let {
            setListenersEnabled: t
        } = (0, N.useHotkeyContext)(), g = (0, y.useComplianceStore)(e => e.setShowUsIpModal), b = (0, o.useTranslations)(), {
            proxyAddress: v
        } = (0, h.useAccountContext)(["proxyAddress"]), x = R(e => e.hasFetchedLocation), w = R(e => e.isUsa), _ = R(e => e.isFrance), C = R(e => e.isUk), E = R(e => e.isOntario), S = R(e => e.isCloseOnlyCountry), {
            setOnboardingRoute: A
        } = (0, f.useSiwx)(), {
            createEmailVerification: I
        } = (0, p.default)(), [T, k] = (0, l.useState)(j.Initial), {
            control: O,
            handleSubmit: L,
            clearErrors: F,
            formState: {
                errors: U
            },
            watch: $
        } = (0, c.useForm)({
            defaultValues: {
                email: ""
            },
            mode: "onSubmit",
            resolver: (0, n.zodResolver)(u.z.object({
                email: u.z.email()
            }))
        }), {
            email: z
        } = $(), B = (0, l.useCallback)(async e => {
            try {
                k(j.Pending);
                let {
                    statusCode: t,
                    message: r
                } = await I(e);
                if (D.logger.debug("[CaptureEmail > handleSubmitEmail]", {
                        message: r
                    }), 208 === t) return void k(j.EmailTaken);
                if (200 === t || void 0 === t) {
                    k(j.Success), window.geq && window.geq.identify(e);
                    return
                }
            } catch (e) {
                k(j.UnknownError), (0, P.handleError)(e, "handleSubmitEmail", v)
            }
        }, [I, v]), q = (0, l.useCallback)(async e => {
            B(e.email)
        }, [B]), W = (0, l.useCallback)(() => {
            x && ((0, m.shouldShowViewOnly)({
                isUsa: w,
                isFrance: _,
                isUk: C,
                isOntario: E,
                isCloseOnlyCountry: S
            }) ? (e(), g(!0)) : A(d.OnboardingRoute.ENABLEEOATRADING))
        }, [A, x, w, _, C, E, S, e, g]);
        return (0, r.jsxs)(r.Fragment, {
            children: [(T === j.Initial || T === j.Pending) && (0, r.jsxs)("div", {
                className: "flex flex-col items-center w-full gap-[18px]",
                children: [(0, r.jsxs)("div", {
                    className: "h-[86px] max-w-[300px]",
                    children: [(0, r.jsx)("p", {
                        className: "font-semibold text-xl text-center",
                        children: b("auth.whatsYourEmail")
                    }), (0, r.jsx)("p", {
                        className: "text-base text-text-secondary text-center",
                        children: b("auth.emailNotifications")
                    })]
                }), (0, r.jsx)("div", {
                    className: "flex flex-col w-full gap-2",
                    children: (0, r.jsx)(c.Controller, {
                        name: "email",
                        control: O,
                        render: ({
                            field: e
                        }) => (0, r.jsx)("div", {
                            className: `relative w-full h-14 border border-border-light rounded-lg overflow-hidden transition-colors focus-within:ring-2 ring-brand-500/70 ${U.email?"!border-red-500":""}`,
                            children: (0, r.jsx)(i.Input, { ...e,
                                id: "email",
                                placeholder: b("auth.emailAddress"),
                                type: "email",
                                autoComplete: "off",
                                variant: "outlined",
                                onFocus: () => {
                                    t(!1)
                                },
                                onBlur: () => {
                                    t(!0)
                                },
                                onChange: t => {
                                    U.email && F(), e.onChange(t)
                                },
                                onKeyPress: e => {
                                    if ("Enter" === e.key) try {
                                        L(q)(e)
                                    } catch {}
                                },
                                className: "w-full h-full !border-0 !rounded-none focus-visible:!ring-0 hover:!bg-transparent px-4"
                            })
                        })
                    })
                }), (0, r.jsxs)("div", {
                    className: "flex flex-col w-full gap-2",
                    children: [(0, r.jsxs)(a.Button, {
                        variant: "default",
                        onClick: L(q),
                        disabled: !!U.email || T === j.Pending,
                        className: "h-[52px] w-full text-base font-medium relative disabled:cursor-wait",
                        children: [b("auth.continue"), T === j.Pending && (0, r.jsx)("div", {
                            className: "flex flex-row items-center justify-end opacity-50 absolute top-0 right-5 bottom-0 left-0",
                            children: (0, r.jsx)(M.default, {
                                className: "h-[2.85rem] w-[2.85rem] translate-x-[17px] lg:translate-x-[22px]"
                            })
                        })]
                    }), (0, r.jsx)(a.Button, {
                        variant: "ghost",
                        disabled: T === j.Pending,
                        onClick: () => W(),
                        className: "mt-1 w-full text-base text-text-secondary hover:text-text-secondary hover:underline hover:bg-transparent",
                        children: b("auth.doThisLater")
                    })]
                })]
            }, `${d.OnboardingRoute.CAPTUREEOAEMAIL}-${j.Initial}-${j.Pending}`), (T === j.EmailTaken || T === j.UnknownError) && (0, r.jsxs)("div", {
                className: "flex flex-col items-center w-full gap-4",
                children: [(0, r.jsx)("div", {
                    className: "flex w-16 h-16 justify-center items-center rounded-full border border-gray-200 mb-2 transition-all duration-[2000ms]",
                    children: (0, r.jsx)(s.IconEnvelopeFill18, {
                        className: "size-8 text-[#6851FF]"
                    })
                }), T === j.EmailTaken && (0, r.jsxs)(r.Fragment, {
                    children: [(0, r.jsx)("p", {
                        className: "text-base text-center lg:mx-10",
                        children: b("auth.emailInUse")
                    }), (0, r.jsxs)("div", {
                        className: "flex flex-col w-full gap-2",
                        children: [(0, r.jsx)(a.Button, {
                            variant: "default",
                            onClick: () => k(j.Initial),
                            className: "mt-2 h-[45px] w-full text-base",
                            children: b("auth.back")
                        }), (0, r.jsx)(a.Button, {
                            variant: "ghost",
                            onClick: () => W(),
                            className: "mt-1 h-[45px] w-full text-base text-text-secondary hover:text-text-secondary hover:underline hover:bg-transparent",
                            children: b("auth.skipForNow")
                        })]
                    })]
                }), T === j.UnknownError && (0, r.jsxs)(r.Fragment, {
                    children: [(0, r.jsx)("p", {
                        className: "text-base text-center lg:mx-10",
                        children: b("auth.emailError")
                    }), (0, r.jsxs)("div", {
                        className: "flex flex-col w-full gap-2",
                        children: [(0, r.jsx)(a.Button, {
                            variant: "default",
                            onClick: L(q),
                            className: "mt-2 h-[45px] w-full text-base",
                            children: b("auth.tryAgain")
                        }), (0, r.jsx)(a.Button, {
                            variant: "ghost",
                            onClick: () => W(),
                            className: "mt-3 h-[45px] w-full text-base text-text-secondary hover:text-text-secondary hover:underline hover:bg-transparent",
                            children: b("auth.skipForNow")
                        })]
                    })]
                })]
            }, `${d.OnboardingRoute.CAPTUREEOAEMAIL}-${j.EmailTaken}-${j.UnknownError}`), T === j.Success && (0, r.jsxs)("div", {
                className: "flex flex-col items-center w-full gap-4",
                children: [(0, r.jsx)("div", {
                    className: "flex w-16 h-16 justify-center items-center rounded-full border border-gray-200 mb-2 transition-all duration-[2000ms]",
                    children: (0, r.jsx)(s.IconEnvelopeFill18, {
                        className: "size-8 text-[#6851FF]"
                    })
                }), (0, r.jsxs)("p", {
                    className: "text-base text-center",
                    children: [b("auth.sendingVerification"), " ", (0, r.jsx)("strong", {
                        children: z
                    }), "."]
                }), (0, r.jsxs)("span", {
                    className: "text-base",
                    children: [b("auth.didntGetEmail"), " ", (0, r.jsx)("a", {
                        onClick: L(q),
                        className: "font-medium text-blue-600 no-underline cursor-pointer hover:opacity-90 active:opacity-80",
                        children: b("auth.sendAgain")
                    })]
                }), (0, r.jsx)(a.Button, {
                    variant: "default",
                    onClick: () => W(),
                    className: "mt-3 h-[45px] w-full text-base",
                    children: b("auth.close")
                })]
            }, `${d.OnboardingRoute.CAPTUREEOAEMAIL}-${j.Success}`)]
        })
    }
}, 11408, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(197994);
    e.s(["IconCircleCheckFill18", 0, ({ ...e
    }) => t.default.createElement(r.Icon, {
        size: "18px",
        ...e
    }, t.default.createElement("path", {
        d: "M9,1C4.589,1,1,4.589,1,9s3.589,8,8,8,8-3.589,8-8S13.411,1,9,1Zm3.843,5.708l-4.25,5.5c-.136,.176-.343,.283-.565,.291-.01,0-.019,0-.028,0-.212,0-.415-.09-.558-.248l-2.25-2.5c-.277-.308-.252-.782,.056-1.06,.309-.276,.781-.252,1.06,.056l1.648,1.832,3.701-4.789c.253-.328,.725-.388,1.052-.135,.328,.253,.388,.724,.135,1.052Z",
        fill: "currentColor"
    }))])
}, 430433, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(149534);
    e.s(["IconChevronDownOutline18", 0, ({
        strokeWidth: e = 1.5,
        ...n
    }) => t.default.createElement(r.Icon, {
        size: "18px",
        ...n
    }, t.default.createElement("polyline", {
        points: "15.25 6.5 9 12.75 2.75 6.5",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }))])
}, 463875, e => {
    "use strict";
    let t = e => {
            let t = e.toLowerCase().match(/.{1,7}/g) ? .slice(0, 5);
            return t ? t.map(e => {
                let t = 0;
                for (let r = 0; r < e.length; r += 1) t = e.charCodeAt(r) + ((t << 5) - t), t &= t;
                let r = [0, 1, 2].map(e => t >> 8 * e & 255);
                return `rgb(${r[0]}, ${r[1]}, ${r[2]})`
            }) : []
        },
        r = e => {
            let [, t, r, n, a] = e;
            return `radial-gradient(at 66% 77%, ${t} 0px, transparent 50%), radial-gradient(at 29% 97%, ${r} 0px, transparent 50%), radial-gradient(at 99% 86%, ${n} 0px, transparent 50%), radial-gradient(at 29% 88%, ${a} 0px, transparent 50%)`
        },
        n = "#9CA3AF";
    e.s(["getCircleAvatarStyles", 0, e => {
        let a = t(e);
        return 0 === a.length ? {
            borderRadius: "50%",
            backgroundColor: n
        } : {
            borderRadius: "50%",
            backgroundColor: a[0],
            backgroundImage: r(a)
        }
    }, "getSquareAvatarStyles", 0, e => {
        let a = t(e);
        return 0 === a.length ? {
            backgroundColor: n
        } : {
            backgroundColor: a[0],
            backgroundImage: r(a)
        }
    }])
}, 363966, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        n = e.i(184612),
        a = e.i(416340),
        i = e.i(870555),
        o = e.i(463875);
    let s = "https://polymarket-upload.s3.us-east-2.amazonaws.com/fallback-image.png";
    e.s(["FALLBACK_AVATAR", 0, s, "default", 0, e => {
        let l, c, u, d, f, p = (0, r.c)(26),
            {
                height: h,
                width: m,
                quality: y,
                sizes: g,
                address: b,
                profileImage: v,
                className: x,
                alt: w
            } = e,
            _ = void 0 === g ? "96px" : g,
            C = void 0 === w ? "" : w,
            [E, S] = (0, a.useState)(null);
        if (!v && b) {
            let e, r, n, a;
            return p[0] !== x ? (e = (0, i.cn)("rounded-full", x), p[0] = x, p[1] = e) : e = p[1], p[2] !== b ? (r = (0, o.getCircleAvatarStyles)(b), p[2] = b, p[3] = r) : r = p[3], p[4] !== h || p[5] !== r || p[6] !== m ? (n = { ...r,
                height: h,
                width: m
            }, p[4] = h, p[5] = r, p[6] = m, p[7] = n) : n = p[7], p[8] !== e || p[9] !== n ? (a = (0, t.jsx)("div", {
                className: e,
                style: n
            }), p[8] = e, p[9] = n, p[10] = a) : a = p[10], a
        }
        p[11] !== x ? (l = (0, i.cn)("relative rounded-full overflow-hidden", x), p[11] = x, p[12] = l) : l = p[12], p[13] !== h || p[14] !== m ? (c = {
            width: m,
            height: h
        }, p[13] = h, p[14] = m, p[15] = c) : c = p[15];
        let A = E || v || s;
        return p[16] === Symbol.for("react.memo_cache_sentinel") ? (u = e => {
            e.preventDefault ? .(), S(s)
        }, p[16] = u) : u = p[16], p[17] !== C || p[18] !== y || p[19] !== _ || p[20] !== A ? (d = (0, t.jsx)(n.default, {
            alt: C,
            src: A,
            className: "object-cover",
            fill: !0,
            sizes: _,
            quality: y,
            onError: u
        }), p[17] = C, p[18] = y, p[19] = _, p[20] = A, p[21] = d) : d = p[21], p[22] !== l || p[23] !== c || p[24] !== d ? (f = (0, t.jsx)("div", {
            className: l,
            style: c,
            children: d
        }), p[22] = l, p[23] = c, p[24] = d, p[25] = f) : f = p[25], f
    }])
}, 378930, 347225, 894610, 649480, 301713, 499217, 148716, e => {
    "use strict";
    e.s(["useSignUp", () => _], 378930);
    var t = e.i(399482),
        r = e.i(601550),
        n = e.i(318594),
        a = e.i(305292),
        i = e.i(655740),
        o = e.i(51800),
        s = e.i(363966),
        l = e.i(333223),
        c = e.i(510954),
        u = e.i(57096),
        d = e.i(867487),
        f = e.i(684686),
        p = e.i(631222),
        h = e.i(53950);
    let m = "expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/",
        y = async ({
            eventName: e,
            externalId: t,
            customerName: r,
            customerEmail: n,
            customerAvatar: a,
            metadata: o,
            mode: s = "async"
        }) => {
            try {
                let l = (() => {
                    if ("u" < typeof document) return;
                    let e = document.cookie.split(";").reduce((e, t) => {
                        let [r, n] = t.trim().split("=");
                        return e[r] = n, e
                    }, {});
                    return e.dub_id || e.dclid
                })();
                if (!l) return;
                if (await i.axios.post("/api/affiliate/dub/lead", {
                        dubParams: {
                            clickId: l,
                            eventName: e,
                            externalId: t,
                            customerName: r,
                            customerEmail: n,
                            customerAvatar: a,
                            metadata: o,
                            mode: s
                        }
                    }, {
                        headers: {
                            "Content-Type": "application/json"
                        }
                    }), "u" > typeof document)
                    for (let e of ["dub_id", "dclid"]) document.cookie = `${e}=; ${m};`, document.cookie = `${e}=; ${m}; domain=polymarket.com`, document.cookie = `${e}=; ${m}; domain=.polymarket.com`
            } catch (a) {
                h.logger.error("[trackDubLead] Failed to track conversion", {
                    error: a,
                    eventName: e,
                    externalId: t,
                    customerName: r,
                    customerEmail: n,
                    metadata: o
                })
            }
        };
    e.s(["trackDubLead", 0, y], 347225);
    var g = e.i(660006),
        b = e.i(222550);
    let v = /^[a-zA-Z0-9]{3,30}$/,
        x = async e => {
            if (!p.GAMMA_API_URL) return void h.logger.info("[useSignUp > createSignupPromoCode] missing gamma url");
            let t = (e => {
                if (v.test(e)) return e;
                let t = e.replace(/[^a-zA-Z0-9]/g, "");
                return v.test(t) ? t : null
            })(e);
            if (!t) return void h.logger.info("[useSignUp > createSignupPromoCode] username cannot map to referral code", {
                username: e
            });
            try {
                await i.axios.post(`${p.GAMMA_API_URL}/referral-codes`, {
                    code: t
                }, {
                    withCredentials: !0
                })
            } catch (e) {
                if ((0, i.isAxiosError)(e)) {
                    let r = e.response ? .status,
                        n = "string" == typeof e.response ? .data ? .error ? e.response.data.error : e.message,
                        a = n.toLowerCase();
                    if (422 === r && (a.includes("referral code already exists") || a.includes("maximum number of active referral codes reached"))) return void h.logger.info("[useSignUp > createSignupPromoCode] skipped promo code create", {
                        code: t,
                        statusCode: r,
                        errorMessage: n
                    })
                }
                h.logger.error("[useSignUp > createSignupPromoCode]", {
                    error: e,
                    code: t
                })
            }
        },
        w = async e => {
            let t = (0, b.getLSUTMParameters)(),
                r = {
                    id: e.profileId,
                    userId: e.userId,
                    name: e.name,
                    referral: e.referral,
                    emailOptIn: e.emailOptIn,
                    displayUsernamePublic: e.displayUsernamePublic || !0,
                    utmCampaign: t.utm_campaign,
                    utmContent: t.utm_content,
                    utmMedium: t.utm_medium,
                    utmSource: t.utm_source,
                    utmTerm: t.utm_term
                },
                n = {
                    id: parseInt(e.preferencesId, 10),
                    emailNotificationPreferences: {
                        generalEmail: {
                            sendEmails: e.emailOptIn
                        },
                        marketEmails: {
                            sendEmails: e.emailOptIn
                        },
                        newsletterEmails: {
                            sendEmails: e.emailOptIn
                        },
                        promotionalEmails: {
                            sendEmails: e.emailOptIn
                        },
                        eventEmails: {
                            sendEmails: e.emailOptIn,
                            tagIds: o.EVENT_TAG_PREFERENCES.map(({
                                id: e
                            }) => e)
                        },
                        orderFillEmails: {
                            sendEmails: e.emailOptIn,
                            hideSmallFills: !0
                        },
                        resolutionEmails: {
                            sendEmails: e.emailOptIn
                        }
                    },
                    marketInterests: []
                },
                i = e.referral,
                s = await (0, a.getGammaClient)().profiles.update(r);
            if ("failure" === s.status && "attributed" === e.referralSource && "referral_invalid" === (0, g.parseProfileError)(s.error) && (i = "", s = await (0, a.getGammaClient)().profiles.update({ ...r,
                    referral: ""
                })), "failure" === s.status) throw h.logger.error("[useSignUp > signUp > profileResponse]", {
                error: s.error,
                variables: e
            }), s.error;
            let l = e.preferencesId ? await (0, a.getGammaClient)().preferences.update(n) : void 0;
            if (l && "failure" === l.status) throw h.logger.error("[useSignUp > signUp > preferencesResponse]", {
                error: l.error,
                variables: e
            }), l.error;
            return await x(e.name), { ...r,
                referral: i
            }
        },
        _ = () => {
            let {
                getAccountProfile: e
            } = (0, l.default)(), a = (0, n.useQueryClient)(), i = (0, f.useGeoStore)(e => e.rawCountry), o = (0, f.useGeoStore)(e => e.rawRegion);
            return (0, r.useMutation)({
                mutationKey: c.queryKeys[u.QueryKey.Account].profile._def,
                mutationFn: w,
                retry: !1,
                onSettled: (e, t, r, n) => {
                    let i = a.getQueryData(c.queryKeys[u.QueryKey.Account].profile().queryKey);
                    i && e ? .name && a.setQueryData(c.queryKeys[u.QueryKey.Account].profile().queryKey, { ...i,
                        username: e.name
                    })
                },
                onSuccess: async (r, n) => {
                    await e().then(async e => {
                        if (e ? .data) {
                            h.logger.info("[useSignUp] tracking Dub lead", {
                                email: (0, h.redactEmail)(e.data.email)
                            }), await y({
                                eventName: "Sign Up",
                                externalId: e.data.proxyWallet,
                                customerName: e.data.username,
                                customerEmail: e.data.email,
                                customerAvatar: e.data.profile_image || s.FALLBACK_AVATAR,
                                metadata: {
                                    authType: e.data.authType,
                                    walletActivated: e.data.walletActivated,
                                    emailOptIn: n ? .emailOptIn,
                                    referral: n ? .referral
                                }
                            });
                            try {
                                if (h.logger.info("[useSignUp] identifying user", {
                                        email: (0, h.redactEmail)(e.data.email),
                                        proxyWallet: e.data.proxyWallet
                                    }), e.data.proxyWallet) {
                                    let r = (0, t.createWalletCache)(),
                                        n = r.state.getMagicState() ? .email;
                                    h.logger.info("[useSignUp] identify user data", {
                                        cachedEmail: (0, h.redactEmail)(n),
                                        email: (0, h.redactEmail)(e.data.email)
                                    }), await (0, d.identifyUser)(e.data.proxyWallet, {
                                        email: e.data.email || n || void 0,
                                        username: e.data.username,
                                        created_at: Math.floor(Date.now() / 1e3),
                                        country: i,
                                        region: o
                                    })
                                }
                            } catch (e) {
                                h.logger.error("[useSignUp > identifyUser]", {
                                    error: e
                                })
                            }
                        }
                    })
                },
                onError: (e, t) => {
                    h.logger.error("[useSignUp > onError]", {
                        error: e,
                        variables: t
                    })
                }
            })
        },
        C = {
            CompleteRegistration: "tw-ogbhb-pba7c",
            USWaitlistSignup: "tw-ogbhb-q728e",
            ViewContent: "tw-ogbhb-r9lt5",
            InitiateCheckout: "tw-ogbhb-rakfb",
            AddPaymentInfo: "tw-ogbhb-rake5",
            Purchase: "tw-ogbhb-r9lu2",
            Subscribe: "tw-ogbhb-raf0w"
        };
    e.s(["trackTwitterEvent", 0, function({
        eventName: e,
        params: t = {},
        sendCAPI: r = !0,
        eventId: n,
        email: a,
        phone: i,
        externalId: o
    }) {
        let s = n ? ? crypto.randomUUID(),
            l = C[e];
        if (!l) return s;
        if (window.twq) {
            let e = {
                conversion_id: s
            };
            "number" == typeof t.value && Number.isFinite(t.value) && (e.value = t.value), "string" == typeof t.currency && (e.currency = t.currency), window.twq("event", l, e)
        }
        if (r) {
            let e = function() {
                    try {
                        return new URLSearchParams(window.location.search).get("twclid") || void 0
                    } catch {
                        return
                    }
                }(),
                r = {
                    event_id: l,
                    conversion_time: new Date().toISOString(),
                    conversion_id: s,
                    client_user_agent: navigator.userAgent
                };
            e && (r.twclid = e), "number" == typeof t.value && Number.isFinite(t.value) && (r.value = String(t.value)), "string" == typeof t.currency && (r.price_currency = t.currency), a && (r.email = a), i && (r.phone = i), o && (r.external_id = o), fetch("/api/twitter/capi", {
                method: "POST",
                headers: {
                    "Content-Type": "application/json"
                },
                body: JSON.stringify(r)
            }).catch(() => {})
        }
        return s
    }], 894610);
    var E = e.i(636357);
    e.s(["trackMetaEvent", 0, function({
        eventName: e,
        params: t = {},
        isCustom: r = !1,
        sendCAPI: n = !0,
        capiOnly: a = !1,
        eventId: i,
        email: o,
        externalId: s
    }) {
        let l = i ? ? crypto.randomUUID(),
            c = Math.floor(Date.now() / 1e3);
        if (!a && window.fbq && (r ? window.fbq("trackCustom", e, t, {
                eventID: l
            }) : window.fbq("track", e, t, {
                eventID: l
            })), n) {
            let r = function(e) {
                    let t = {};
                    for (let [r, n] of Object.entries(e))
                        if ("string" == typeof n || "number" == typeof n) t[r] = n;
                        else Array.isArray(n) && n.every(e => "string" == typeof e) && (t[r] = n);
                    return t
                }(t),
                {
                    fbp: n,
                    fbc: a
                } = (0, E.getMetaPixelCookies)(),
                {
                    fbclid: i
                } = (0, b.getLSUTMParameters)();
            fetch("/api/meta/capi", {
                method: "POST",
                headers: {
                    "Content-Type": "application/json"
                },
                body: JSON.stringify({
                    event_name: e,
                    event_time: c,
                    event_id: l,
                    custom_data: Object.keys(r).length > 0 ? r : void 0,
                    fbp: n ? ? void 0,
                    fbc: a ? ? void 0,
                    fbclid: i ? ? void 0,
                    event_source_url: window.location.href,
                    client_user_agent: navigator.userAgent,
                    email: o || void 0,
                    external_id: s || void 0
                })
            }).catch(() => {})
        }
        return l
    }], 649480);
    let S = {
        Purchase: "Purchase",
        CompleteRegistration: "SignUp",
        ViewContent: "ViewContent",
        InitiateCheckout: "Lead",
        Lead: "Lead",
        Search: "Search",
        SignUp: "SignUp",
        PageVisit: "PageVisit",
        USWaitlistSignup: "SignUp",
        AddToWishlist: "AddToWishlist"
    };
    e.s(["trackRedditEvent", 0, function({
        eventName: e,
        params: t = {},
        sendCAPI: r = !0,
        eventId: n,
        email: a,
        externalId: i
    }) {
        let o, s = n ? ? crypto.randomUUID();
        if (!r) return s;
        let l = new Date().toISOString(),
            {
                tracking_type: c,
                custom_event_name: u
            } = (o = S[e]) ? {
                tracking_type: o
            } : {
                tracking_type: "Custom",
                custom_event_name: e
            },
            {
                uuid: d
            } = (0, E.getRedditPixelCookies)(),
            f = function() {
                try {
                    return new URLSearchParams(window.location.search).get("rdt_cid") || void 0
                } catch {
                    return
                }
            }();
        return fetch("/api/reddit/capi", {
            method: "POST",
            headers: {
                "Content-Type": "application/json"
            },
            body: JSON.stringify({
                tracking_type: c,
                custom_event_name: u || void 0,
                event_at: l,
                event_id: s,
                click_id: f,
                currency: "string" == typeof t.currency ? t.currency : void 0,
                value: "number" == typeof t.value && Number.isFinite(t.value) ? t.value : void 0,
                client_user_agent: navigator.userAgent,
                uuid: d || void 0,
                email: a || void 0,
                external_id: i || void 0
            })
        }).catch(() => {}), s
    }], 301713);
    let A = {
        ViewContent: "VIEW_CONTENT",
        Purchase: "PURCHASE",
        AddPaymentInfo: "ADD_BILLING",
        CompleteRegistration: "SIGN_UP",
        InitiateCheckout: "START_CHECKOUT",
        Subscribe: "SUBSCRIBE",
        AddToWishlist: "ADD_TO_WISHLIST"
    };
    e.s(["trackSnapchatEvent", 0, function({
        eventName: e,
        params: t = {},
        sendCAPI: r = !0,
        eventId: n,
        email: a,
        externalId: i
    }) {
        let o = n ? ? crypto.randomUUID(),
            s = A[e];
        if (!s) return o;
        let l = Math.floor(Date.now() / 1e3);
        if (window.snaptr) {
            let e, r = (e = {}, "PURCHASE" === s ? e.transaction_id = o : e.client_dedup_id = o, "string" == typeof t.currency && (e.currency = t.currency), "number" == typeof t.value && Number.isFinite(t.value) && (e.price = t.value), e);
            window.snaptr("track", s, r)
        }
        if (r) {
            let e, {
                sc_cookie1: r
            } = (0, E.getSnapchatPixelCookies)();
            fetch("/api/snapchat/capi", {
                method: "POST",
                headers: {
                    "Content-Type": "application/json"
                },
                body: JSON.stringify({
                    event: s,
                    event_time: l,
                    event_id: o,
                    sc_click_id: function() {
                        try {
                            return new URLSearchParams(window.location.search).get("ScCid") || void 0
                        } catch {
                            return
                        }
                    }() || void 0,
                    sc_cookie1: r || void 0,
                    custom_data: (e = {}, "string" == typeof t.currency && (e.currency = t.currency), "number" == typeof t.value && Number.isFinite(t.value) && (e.value = String(t.value)), Array.isArray(t.content_ids) && (e.contents = t.content_ids.map(e => ({
                        id: e,
                        quantity: "1"
                    }))), (Object.keys(e).length > 0 ? e : void 0) || void 0),
                    event_source_url: window.location.href,
                    client_user_agent: navigator.userAgent,
                    email: a || void 0,
                    external_id: i || void 0
                })
            }).catch(() => {})
        }
        return o
    }], 499217);
    let I = {
        ViewContent: "ViewContent",
        AddPaymentInfo: "AddPaymentInfo",
        AddToWishlist: "AddToWishlist",
        InitiateCheckout: "InitiateCheckout",
        CompleteRegistration: "CompleteRegistration",
        Purchase: "CompletePayment",
        Subscribe: "Subscribe"
    };
    e.s(["trackTikTokEvent", 0, function({
        eventName: e,
        params: t = {},
        sendCAPI: r = !0,
        eventId: n,
        email: a,
        externalId: i
    }) {
        let o = n ? ? crypto.randomUUID(),
            s = I[e];
        if (!s) return o;
        let l = Math.floor(Date.now() / 1e3);
        if (r) {
            let e, {
                ttp: r
            } = (0, E.getTikTokPixelCookies)();
            fetch("/api/tiktok/capi", {
                method: "POST",
                headers: {
                    "Content-Type": "application/json"
                },
                body: JSON.stringify({
                    event: s,
                    event_time: l,
                    event_id: o,
                    ttclid: function() {
                        try {
                            return new URLSearchParams(window.location.search).get("ttclid") || void 0
                        } catch {
                            return
                        }
                    }() || void 0,
                    ttp: r || void 0,
                    properties: (e = {}, "string" == typeof t.currency && (e.currency = t.currency), "number" == typeof t.value && Number.isFinite(t.value) && (e.value = t.value), Array.isArray(t.content_ids) && (e.contents = t.content_ids.map(e => ({
                        content_id: e,
                        content_type: "product"
                    })), e.content_type = "product"), (Object.keys(e).length > 0 ? e : void 0) || void 0),
                    page_url: window.location.href,
                    client_user_agent: navigator.userAgent,
                    email: a || void 0,
                    external_id: i || void 0
                })
            }).catch(() => {})
        }
        return o
    }], 148716)
}, 722762, e => {
    "use strict";
    let t = RegExp(String.raw `[\s\u{0000}-\u{001F}\u{00A0}\u{007F}-\u{009F}\u{061C}\u{2000}-\u{200A}\u{202A}-\u{202E}\u{2028}\u{205F}\u{2066}-\u{2069}\u{3000}\u{200E}\u{200F}]`, "gu");
    e.s(["stripInvisibleCharacters", 0, (e, r) => !e && r ? e : e.replace(t, "")])
}, 484809, e => {
    "use strict";
    var t, r = ((t = {})[t.Initial = 0] = "Initial", t[t.Pending = 1] = "Pending", t[t.Error = 2] = "Error", t[t.Success = 3] = "Success", t);
    e.s(["CreateProfileFlowState", () => r])
}, 964002, e => {
    "use strict";
    e.s(["default", 0, function(e, t, r, n) {
        for (var a = -1, i = null == e ? 0 : e.length; ++a < i;) {
            var o = e[a];
            t(n, o, r(o), e)
        }
        return n
    }])
}, 967958, 191197, 406878, 261112, 183887, e => {
    "use strict";
    let t = function(e, t, r) {
            for (var n = -1, a = Object(e), i = r(e), o = i.length; o--;) {
                var s = i[++n];
                if (!1 === t(a[s], s, a)) break
            }
            return e
        },
        r = function(e, t) {
            for (var r = -1, n = Array(e); ++r < e;) n[r] = t(r);
            return n
        };
    var n, a, i = e.i(340504),
        o = e.i(660154);
    let s = function() {
        return !1
    };
    e.s(["default", 0, s], 191197);
    var l = e.i(682832),
        c = e.i(796755),
        u = e.i(523305),
        d = e.i(6251),
        f = {};
    f["[object Float32Array]"] = f["[object Float64Array]"] = f["[object Int8Array]"] = f["[object Int16Array]"] = f["[object Int32Array]"] = f["[object Uint8Array]"] = f["[object Uint8ClampedArray]"] = f["[object Uint16Array]"] = f["[object Uint32Array]"] = !0, f["[object Arguments]"] = f["[object Array]"] = f["[object ArrayBuffer]"] = f["[object Boolean]"] = f["[object DataView]"] = f["[object Date]"] = f["[object Error]"] = f["[object Function]"] = f["[object Map]"] = f["[object Number]"] = f["[object Object]"] = f["[object RegExp]"] = f["[object Set]"] = f["[object String]"] = f["[object WeakMap]"] = !1;
    var p = e.i(540143),
        h = (e.i(972727), function() {
            try {
                return !1
            } catch (e) {}
        }());
    e.s(["default", 0, h], 406878);
    var m = h && h.isTypedArray,
        y = m ? (0, p.default)(m) : function(e) {
            return (0, d.default)(e) && (0, u.default)(e.length) && !!f[(0, c.default)(e)]
        };
    e.s(["default", 0, y], 261112);
    var g = Object.prototype.hasOwnProperty;
    let b = function(e, t) {
        var n = (0, o.default)(e),
            a = !n && (0, i.default)(e),
            c = !n && !a && s(e),
            u = !n && !a && !c && y(e),
            d = n || a || c || u,
            f = d ? r(e.length, String) : [],
            p = f.length;
        for (var h in e)(t || g.call(e, h)) && !(d && ("length" == h || c && ("offset" == h || "parent" == h) || u && ("buffer" == h || "byteLength" == h || "byteOffset" == h) || (0, l.default)(h, p))) && f.push(h);
        return f
    };
    var v = Object.prototype;
    let x = function(e) {
        var t = e && e.constructor;
        return e === ("function" == typeof t && t.prototype || v)
    };
    var w = (n = Object.keys, a = Object, function(e) {
            return n(a(e))
        }),
        _ = Object.prototype.hasOwnProperty;
    let C = function(e) {
        if (!x(e)) return w(e);
        var t = [];
        for (var r in Object(e)) _.call(e, r) && "constructor" != r && t.push(r);
        return t
    };
    var E = e.i(150379);
    let S = function(e) {
        return (0, E.default)(e) ? b(e) : C(e)
    };
    e.s(["default", 0, S], 183887), e.s(["default", 0, function(e, r) {
        return e && t(e, r, S)
    }], 967958)
}, 356753, e => {
    "use strict";
    var t, r = e.i(967958),
        n = e.i(150379),
        a = (t = r.default, function(e, r) {
            if (null == e) return e;
            if (!(0, n.default)(e)) return t(e, r);
            for (var a = e.length, i = -1, o = Object(e); ++i < a && !1 !== r(o[i], i, o););
            return e
        });
    e.s(["default", 0, function(e, t, r, n) {
        return a(e, function(e, a, i) {
            t(n, e, r(e), i)
        }), n
    }], 356753)
}, 164454, 442431, 183874, 965572, 820440, e => {
    "use strict";
    var t = e.i(165445),
        r = e.i(508596),
        n = e.i(82611);

    function a(e) {
        var r = this.__data__ = new t.default(e);
        this.size = r.size
    }
    a.prototype.clear = function() {
        this.__data__ = new t.default, this.size = 0
    }, a.prototype.delete = function(e) {
        var t = this.__data__,
            r = t.delete(e);
        return this.size = t.size, r
    }, a.prototype.get = function(e) {
        return this.__data__.get(e)
    }, a.prototype.has = function(e) {
        return this.__data__.has(e)
    }, a.prototype.set = function(e, a) {
        var i = this.__data__;
        if (i instanceof t.default) {
            var o = i.__data__;
            if (!r.default || o.length < 199) return o.push([e, a]), this.size = ++i.size, this;
            i = this.__data__ = new n.default(o)
        }
        return i.set(e, a), this.size = i.size, this
    };
    var i = e.i(871780);
    let o = function(e, t) {
        for (var r = -1, n = null == e ? 0 : e.length; ++r < n;)
            if (t(e[r], r, e)) return !0;
        return !1
    };
    var s = e.i(752882);
    let l = function(e, t, r, n, a, l) {
        var c = 1 & r,
            u = e.length,
            d = t.length;
        if (u != d && !(c && d > u)) return !1;
        var f = l.get(e),
            p = l.get(t);
        if (f && p) return f == t && p == e;
        var h = -1,
            m = !0,
            y = 2 & r ? new i.default : void 0;
        for (l.set(e, t), l.set(t, e); ++h < u;) {
            var g = e[h],
                b = t[h];
            if (n) var v = c ? n(b, g, h, t, e, l) : n(g, b, h, e, t, l);
            if (void 0 !== v) {
                if (v) continue;
                m = !1;
                break
            }
            if (y) {
                if (!o(t, function(e, t) {
                        if (!(0, s.default)(y, t) && (g === e || a(g, e, r, n, l))) return y.push(t)
                    })) {
                    m = !1;
                    break
                }
            } else if (!(g === b || a(g, b, r, n, l))) {
                m = !1;
                break
            }
        }
        return l.delete(e), l.delete(t), m
    };
    var c = e.i(785364),
        u = e.i(26148),
        d = u.default.Uint8Array,
        f = e.i(376327);
    let p = function(e) {
            var t = -1,
                r = Array(e.size);
            return e.forEach(function(e, n) {
                r[++t] = [n, e]
            }), r
        },
        h = function(e) {
            var t = -1,
                r = Array(e.size);
            return e.forEach(function(e) {
                r[++t] = e
            }), r
        };
    e.s(["default", 0, h], 442431);
    var m = c.default ? c.default.prototype : void 0,
        y = m ? m.valueOf : void 0;
    let g = function(e, t, r, n, a, i, o) {
        switch (r) {
            case "[object DataView]":
                if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset) break;
                e = e.buffer, t = t.buffer;
            case "[object ArrayBuffer]":
                if (e.byteLength != t.byteLength || !i(new d(e), new d(t))) break;
                return !0;
            case "[object Boolean]":
            case "[object Date]":
            case "[object Number]":
                return (0, f.default)(+e, +t);
            case "[object Error]":
                return e.name == t.name && e.message == t.message;
            case "[object RegExp]":
            case "[object String]":
                return e == t + "";
            case "[object Map]":
                var s = p;
            case "[object Set]":
                var c = 1 & n;
                if (s || (s = h), e.size != t.size && !c) break;
                var u = o.get(e);
                if (u) return u == t;
                n |= 2, o.set(e, t);
                var m = l(s(e), s(t), n, a, i, o);
                return o.delete(e), m;
            case "[object Symbol]":
                if (y) return y.call(e) == y.call(t)
        }
        return !1
    };
    var b = e.i(122137),
        v = e.i(660154);
    let x = function(e, t, r) {
            var n = t(e);
            return (0, v.default)(e) ? n : (0, b.default)(n, r(e))
        },
        w = function(e, t) {
            for (var r = -1, n = null == e ? 0 : e.length, a = 0, i = []; ++r < n;) {
                var o = e[r];
                t(o, r, e) && (i[a++] = o)
            }
            return i
        };
    var _ = Object.prototype.propertyIsEnumerable,
        C = Object.getOwnPropertySymbols,
        E = C ? function(e) {
            return null == e ? [] : w(C(e = Object(e)), function(t) {
                return _.call(e, t)
            })
        } : function() {
            return []
        },
        S = e.i(183887);
    let A = function(e) {
        return x(e, S.default, E)
    };
    var I = Object.prototype.hasOwnProperty;
    let T = function(e, t, r, n, a, i) {
        var o = 1 & r,
            s = A(e),
            l = s.length;
        if (l != A(t).length && !o) return !1;
        for (var c = l; c--;) {
            var u = s[c];
            if (!(o ? u in t : I.call(t, u))) return !1
        }
        var d = i.get(e),
            f = i.get(t);
        if (d && f) return d == t && f == e;
        var p = !0;
        i.set(e, t), i.set(t, e);
        for (var h = o; ++c < l;) {
            var m = e[u = s[c]],
                y = t[u];
            if (n) var g = o ? n(y, m, u, t, e, i) : n(m, y, u, e, t, i);
            if (!(void 0 === g ? m === y || a(m, y, r, n, i) : g)) {
                p = !1;
                break
            }
            h || (h = "constructor" == u)
        }
        if (p && !h) {
            var b = e.constructor,
                v = t.constructor;
            b != v && "constructor" in e && "constructor" in t && !("function" == typeof b && b instanceof b && "function" == typeof v && v instanceof v) && (p = !1)
        }
        return i.delete(e), i.delete(t), p
    };
    var k = e.i(97955),
        O = (0, k.default)(u.default, "DataView"),
        R = (0, k.default)(u.default, "Promise"),
        N = (0, k.default)(u.default, "Set");
    e.s(["default", 0, N], 183874);
    var M = (0, k.default)(u.default, "WeakMap"),
        P = e.i(796755),
        D = e.i(12156),
        j = "[object Map]",
        L = "[object Promise]",
        F = "[object Set]",
        U = "[object WeakMap]",
        $ = "[object DataView]",
        z = (0, D.default)(O),
        B = (0, D.default)(r.default),
        q = (0, D.default)(R),
        W = (0, D.default)(N),
        Z = (0, D.default)(M),
        V = P.default;
    (O && V(new O(new ArrayBuffer(1))) != $ || r.default && V(new r.default) != j || R && V(R.resolve()) != L || N && V(new N) != F || M && V(new M) != U) && (V = function(e) {
        var t = (0, P.default)(e),
            r = "[object Object]" == t ? e.constructor : void 0,
            n = r ? (0, D.default)(r) : "";
        if (n) switch (n) {
            case z:
                return $;
            case B:
                return j;
            case q:
                return L;
            case W:
                return F;
            case Z:
                return U
        }
        return t
    });
    let K = V;
    var H = e.i(191197),
        G = e.i(261112),
        Q = "[object Arguments]",
        J = "[object Array]",
        Y = "[object Object]",
        X = Object.prototype.hasOwnProperty;
    let ee = function(e, t, r, n, i, o) {
        var s = (0, v.default)(e),
            c = (0, v.default)(t),
            u = s ? J : K(e),
            d = c ? J : K(t);
        u = u == Q ? Y : u, d = d == Q ? Y : d;
        var f = u == Y,
            p = d == Y,
            h = u == d;
        if (h && (0, H.default)(e)) {
            if (!(0, H.default)(t)) return !1;
            s = !0, f = !1
        }
        if (h && !f) return o || (o = new a), s || (0, G.default)(e) ? l(e, t, r, n, i, o) : g(e, t, u, r, n, i, o);
        if (!(1 & r)) {
            var m = f && X.call(e, "__wrapped__"),
                y = p && X.call(t, "__wrapped__");
            if (m || y) {
                var b = m ? e.value() : e,
                    x = y ? t.value() : t;
                return o || (o = new a), i(b, x, r, n, o)
            }
        }
        return !!h && (o || (o = new a), T(e, t, r, n, i, o))
    };
    var et = e.i(6251);
    let er = function e(t, r, n, a, i) {
        return t === r || (null != t && null != r && ((0, et.default)(t) || (0, et.default)(r)) ? ee(t, r, n, a, e, i) : t != t && r != r)
    };
    e.s(["default", 0, er], 965572);
    let en = function(e, t, r, n) {
        var i = r.length,
            o = i,
            s = !n;
        if (null == e) return !o;
        for (e = Object(e); i--;) {
            var l = r[i];
            if (s && l[2] ? l[1] !== e[l[0]] : !(l[0] in e)) return !1
        }
        for (; ++i < o;) {
            var c = (l = r[i])[0],
                u = e[c],
                d = l[1];
            if (s && l[2]) {
                if (void 0 === u && !(c in e)) return !1
            } else {
                var f = new a;
                if (n) var p = n(u, d, c, e, t, f);
                if (!(void 0 === p ? er(d, u, 3, n, f) : p)) return !1
            }
        }
        return !0
    };
    var ea = e.i(556800);
    let ei = function(e) {
            return e == e && !(0, ea.default)(e)
        },
        eo = function(e) {
            for (var t = (0, S.default)(e), r = t.length; r--;) {
                var n = t[r],
                    a = e[n];
                t[r] = [n, a, ei(a)]
            }
            return t
        },
        es = function(e, t) {
            return function(r) {
                return null != r && r[e] === t && (void 0 !== t || e in Object(r))
            }
        },
        el = function(e) {
            var t = eo(e);
            return 1 == t.length && t[0][2] ? es(t[0][0], t[0][1]) : function(r) {
                return r === e || en(r, e, t)
            }
        };
    var ec = e.i(330104);
    let eu = function(e, t, r) {
        var n = null == e ? void 0 : (0, ec.default)(e, t);
        return void 0 === n ? r : n
    };
    var ed = e.i(829289),
        ef = e.i(675737),
        ep = e.i(596593),
        eh = e.i(344020);
    let em = function(e) {
        return function(t) {
            return null == t ? void 0 : t[e]
        }
    };
    e.s(["default", 0, em], 820440);
    let ey = function(e) {
        return (0, ef.default)(e) ? em((0, ep.default)(e)) : function(t) {
            return (0, ec.default)(t, e)
        }
    };
    e.s(["default", 0, function(e) {
        if ("function" == typeof e) return e;
        if (null == e) return eh.default;
        if ("object" == typeof e) {
            var t, r;
            return (0, v.default)(e) ? (t = e[0], r = e[1], (0, ef.default)(t) && ei(r) ? es((0, ep.default)(t), r) : function(e) {
                var n = eu(e, t);
                return void 0 === n && n === r ? (0, ed.default)(e, t) : er(r, n, 3)
            }) : el(e)
        }
        return ey(e)
    }], 164454)
}, 448697, e => {
    "use strict";
    var t, r = e.i(752725),
        n = e.i(964002),
        a = e.i(356753),
        i = e.i(164454),
        o = e.i(660154),
        s = Object.prototype.hasOwnProperty,
        l = (t = function(e, t, n) {
            s.call(e, n) ? e[n].push(t) : (0, r.default)(e, n, [t])
        }, function(e, r) {
            return ((0, o.default)(e) ? n.default : a.default)(e, t, (0, i.default)(r, 2), {})
        });
    e.s(["groupBy", 0, l], 448697)
}, 195453, e => {
    "use strict";
    var t = e.i(164454),
        r = e.i(871780),
        n = e.i(507595),
        a = e.i(105754),
        i = e.i(752882),
        o = e.i(183874),
        s = e.i(442431),
        l = o.default && 1 / (0, s.default)(new o.default([, -0]))[1] == 1 / 0 ? function(e) {
            return new o.default(e)
        } : function() {};
    let c = function(e, t, o) {
        var c = -1,
            u = n.default,
            d = e.length,
            f = !0,
            p = [],
            h = p;
        if (o) f = !1, u = a.default;
        else if (d >= 200) {
            var m = t ? null : l(e);
            if (m) return (0, s.default)(m);
            f = !1, u = i.default, h = new r.default
        } else h = t ? [] : p;
        t: for (; ++c < d;) {
            var y = e[c],
                g = t ? t(y) : y;
            if (y = o || 0 !== y ? y : 0, f && g == g) {
                for (var b = h.length; b--;)
                    if (h[b] === g) continue t;
                t && h.push(g), p.push(y)
            } else u(h, g, o) || (h !== p && h.push(g), p.push(y))
        }
        return p
    };
    e.s(["uniqBy", 0, function(e, r) {
        return e && e.length ? c(e, (0, t.default)(r, 2)) : []
    }], 195453)
}, 499390, 474157, e => {
    "use strict";
    var t, r = e.i(448697),
        n = e.i(195453),
        a = e.i(196593),
        i = e.i(722762);
    e.i(284553);
    var o = e.i(305292),
        s = e.i(655740),
        l = e.i(660006),
        c = ((t = {}).Newest = "newest", t.Likes = "likes", t);
    let u = async e => {
            let [t, r, n, a, i = "newest", o, c] = e.queryKey, {
                pageParam: u
            } = e, d = "https://gamma-api.polymarket.com", f = c ? `${d}/comments/${c}` : `${d}/comments`;
            try {
                let e = new URLSearchParams({
                        get_positions: "true",
                        get_reports: "true",
                        parent_entity_type: n,
                        parent_entity_id: a.toString(),
                        ascending: "false",
                        holders_only: o ? "true" : "false",
                        order: "likes" === i ? "reactionCount" : "createdAt",
                        limit: "10",
                        offset: (("number" == typeof u ? u : 0) * 10).toString()
                    }),
                    t = `${f}?${e}`,
                    r = await s.axios.get(t).then(({
                        data: e
                    }) => e);
                if (Array.isArray(r)) return r.map(e => (e => {
                    if (!Array.isArray(e.reactions)) return e;
                    let t = {},
                        r = e.reactions.filter(e => "HEART" === e.reactionType && "string" == typeof e.profile ? .proxyWallet && !t[e.profile.proxyWallet] && (t[e.profile.proxyWallet] = !0, !0));
                    return { ...e,
                        reactions: r
                    }
                })(e));
                return r
            } catch (e) {
                return (0, l.handleError)(e, "getEventsCommentsFetcher"), []
            }
        },
        d = async e => {
            let {
                commentID: t
            } = e;
            return await s.axios.post("https://gamma-api.polymarket.com/reports", {
                comment_id: Number(t)
            }, {
                withCredentials: !0,
                headers: {
                    "Content-Type": "application/json"
                }
            }).then(({
                data: e
            }) => ({ ...e
            }))
        },
        f = async ({
            commentBody: e,
            parentEntityType: t,
            parentEntityId: r,
            parentCommentId: n,
            replyAddress: a,
            media: i
        }) => s.axios.post("https://gamma-api.polymarket.com/comments", {
            body: e || void 0,
            parentEntityId: Number(r),
            parentEntityType: t,
            parentCommentId: n,
            replyAddress: a,
            media: i
        }, {
            withCredentials: !0,
            headers: {
                "Content-Type": "application/json"
            }
        }).then(({
            data: e
        }) => e),
        p = async ({
            id: e
        }) => s.axios.delete(`https://gamma-api.polymarket.com/comments/${e}`, {
            withCredentials: !0,
            headers: {
                "Content-Type": "application/json"
            }
        }).then(({
            data: e
        }) => ({ ...e
        })),
        h = async e => {
            let {
                reactionType: t,
                commentID: r,
                reactionID: n,
                commentProxyWallet: a,
                userProxyWallet: i
            } = e;
            if (!r || !a || !i) throw Error("Missing Comment Info!");
            if (a.toLowerCase() === i.toLowerCase()) throw Error("You cannot like your own comment");
            let o = Number(r);
            if (!Number.isFinite(o)) throw Error("Error parsing comment ID");
            if ("string" == typeof t) return s.axios.post("https://gamma-api.polymarket.com/reactions", {
                commentID: o,
                reactionType: t
            }, {
                withCredentials: !0,
                headers: {
                    "Content-Type": "application/json"
                }
            }).then(({
                data: e
            }) => e);
            if (void 0 === n) throw Error("Missing Reaction ID");
            return s.axios.delete(`https://gamma-api.polymarket.com/reactions/${n}`, {
                withCredentials: !0,
                headers: {
                    "Content-Type": "application/json"
                }
            }).then(({
                data: e
            }) => ({ ...e
            }))
        },
        m = async () => {
            let e = await (0, o.getGammaClient)().profiles.get();
            return "success" === e.status && (e.data ? .user ? .mod ? ? !1)
        };
    e.s(["CommentsSortBy", () => c, "createCommentFetcher", 0, f, "deleteCommentFetcher", 0, p, "getEventCommentsFetcher", 0, u, "getIsMod", 0, m, "mutateReactionsFetcher", 0, h, "mutateReportsFetcher", 0, d], 474157);
    let y = "100000",
        g = (e, t, r) => r === c.Likes ? (t ? .reactions ? .length ? ? 0) - (e ? .reactions ? .length ? ? 0) : r === c.Newest ? new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime() : 0,
        b = ["abcnews.go.com", "accuweather.com", "aljazeera.com", "allrecipes.com", "apnews.com", "axios.com", "bbc.com", "bleacherreport.com", "bloomberg.com", "bonappetit.com", "booking.com", "businessinsider.com", "buzzfeed.com", "cbsnews.com", "cnbc.com", "cnet.com", "cnn.com", "deadspin.com", "economist.com", "engadget.com", "eonline.com", "epicurious.com", "espn.com", "expedia.com", "facebook.com", "finance.yahoo.com", "fivethirtyeight.com", "foodnetwork.com", "forbes.com", "foxnews.com", "gizmodo.com", "healthline.com", "hollywoodreporter.com", "huffpost.com", "instagram.com", "investopedia.com", "latimes.com", "linkedin.com", "lonelyplanet.com", "marketwatch.com", "mashable.com", "mayoclinic.org", "medicalnewstoday.com", "metacritic.com", "nationalgeographic.com", "nature.com", "nbcnews.com", "newsweek.com", "newyorker.com", "npr.org", "nytimes.com", "polymarket.com", "pinterest.com", "pitchfork.com", "politico.com", "popsci.com", "quora.com", "reddit.com", "reuters.com", "rollingstone.com", "rottentomatoes.com", "sciencemag.org", "scientificamerican.com", "si.com", "slate.com", "space.com", "techcrunch.com", "theatlantic.com", "thedailybeast.com", "theguardian.com", "thehill.com", "theverge.com", "tiktok.com", "time.com", "tmz.com", "travelandleisure.com", "tripadvisor.com", "truthsocial.com", "tumblr.com", "twitch.tv", "twitter.com", "usatoday.com", "variety.com", "vice.com", "vox.com", "washingtonpost.com", "weather.com", "webmd.com", "wikipedia.org", "wired.com", "wsj.com", "wunderground.com", "x.com", "youtube.com", "zdnet.com"].map(e => e.replace(".", "\\.")).join("|"),
        v = RegExp(`(https:\\/\\/)?(www\\.)?(${b})`, "i"),
        x = /^(https?:\/\/)?(www\.)?([\w-]+\.)*polymarket\.(com|us)(\/|$)/i,
        w = e => {
            if (!e || !Array.isArray(e)) return [];
            let t = e.filter(e => !!e && !!e.id && !!e.userAddress);
            return (0, n.uniqBy)(t, e => `${e.id}-${e.userAddress}`)
        };
    e.s(["addPositionsToUser", 0, (e, t, r) => {
        if (!e ? .profile || !Array.isArray(e ? .profile ? .positions) || 0 === e.profile.positions.length) return { ...e
        };
        try {
            let n = e.profile.positions,
                i = n.filter(e => {
                    try {
                        let t = BigInt(e.positionSize),
                            r = BigInt(y);
                        return t > r
                    } catch {
                        return !1
                    }
                }).filter(e => !!t[e.tokenId]);
            if (!i || 0 === i.length) return { ...e,
                profile: { ...e.profile
                }
            };
            let o = i.map(e => ({ ...e,
                oppositeAssetId: t[e.tokenId].oppositeAssetId
            })).sort((e, t) => {
                try {
                    return Number(BigInt(t.positionSize) - BigInt(e.positionSize))
                } catch {
                    return 0
                }
            }).slice(0, 8).map(e => {
                let i = t[e.tokenId],
                    o = n.find(e => e.tokenId === i.oppositeAssetId),
                    s = o ? .positionSize ? ? "0",
                    l = BigInt(e.positionSize) - BigInt(s),
                    c = (0, a.formatNumbers)((0, a.formatUSDCUnits)(l)),
                    u = r ? "blue" : 0 === i.outcomeIndex ? "green" : "red";
                return {
                    TokenId: e.tokenId,
                    PositionSize: l,
                    PositionSizeFormatted: c,
                    Outcome: i.outcome,
                    Color: u,
                    OutcomeIdx: i.outcomeIndex,
                    GroupItemTitle: i.groupItemTitle
                }
            }).filter(e => e.PositionSize > BigInt(y));
            if (!o || 0 === o.length) return { ...e,
                profile: { ...e.profile
                }
            };
            return { ...e,
                profile: { ...e.profile,
                    cleanedPositions: o
                }
            }
        } catch {
            return { ...e,
                profile: { ...e.profile
                }
            }
        }
    }, "areCharactersInvalid", 0, e => !!e && "string" == typeof e && RegExp(String.raw `[^\u{0000}-\u{007F}\u{1F600}-\u{1F64F}\u{1F300}-\u{1F5FF}\u{1F680}-\u{1F6FF}\u{1F700}-\u{1F77F}\u{1F780}-\u{1F7FF}\u{1F800}-\u{1F8FF}\u{1F900}-\u{1F9FF}\u{1FA00}-\u{1FA6F}\u{1FA70}-\u{1FAFF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}\u2018\u2019\u201C\u201D\u2026]`, "gu").test(e), "cleanAndSortReplies", 0, (e, t) => {
        if (Array.isArray(e)) return e.filter(e => e.profile).map(e => {
            let r = t[e ? .replyAddress ? .toLowerCase() ? ? ""];
            return r ? { ...e,
                profileUserIsReplyingTo: r
            } : { ...e
            }
        }).sort((e, t) => g(t, e, c.Newest))
    }, "getDisplayName", 0, e => {
        let t = (0, i.stripInvisibleCharacters)(e ? .name ? ? "");
        return e.name && t ? t : e.proxyWallet && e.proxyWallet.length >= 6 ? e.proxyWallet.slice(0, 6) : "Anon"
    }, "getExternalLinkRel", 0, e => x.test(e) ? "noopener noreferrer" : "noopener noreferrer nofollow ugc", "handleDoesCommentAlreadyExist", 0, (e, t) => !!e && !!Array.isArray(e ? .pages) && !!Array.isArray(e ? .pages ? .[0]) && !!t && e.pages.some(e => !!e.find(e => e.id === t.id)), "handleOptimisticCommentCreate", 0, (e, t) => e && Array.isArray(e ? .pages) && Array.isArray(e ? .pages ? .[0]) ? t ? [w([t, ...e.pages[0]]), ...e.pages.slice(1)] : e.pages : [], "handleOptimisticCommentDelete", 0, (e, t) => e && t && Array.isArray(e.pages) ? e.pages.reduce((e, r) => {
        let n = r.filter(e => e.id !== t.id);
        return e.push(n), e
    }, []) : [], "handleOptimisticDeleteReaction", 0, (e, t) => e && t && Array.isArray(e.pages) ? e.pages.reduce((e, r) => {
        let n = r.map(e => {
            if (e.id !== t.commentID.toString()) return e;
            let r = Array.isArray(e.reactions) ? e.reactions.filter(e => e.id !== t.reactionID) : [];
            return { ...e,
                reactions: w(r)
            }
        });
        return e.push(n), e
    }, []) : [], "handleOptimisticDeleteReactionWS", 0, (e, t) => e && t && Array.isArray(e.pages) ? e.pages.reduce((e, r) => {
        let n = r.map(e => {
            if (e.id !== t.commentID.toString()) return e;
            let r = Array.isArray(e.reactions) ? e.reactions.filter(e => e.id !== t.id) : [];
            return { ...e,
                reactions: w(r)
            }
        });
        return e.push(n), e
    }, []) : [], "handleOptimisticPostReaction", 0, (e, t, n) => e && Array.isArray(e.pages) && t ? n ? e.pages.reduce((e, a) => {
        let i = a.map(e => {
            if (e.id === t.commentID.toString()) {
                let t = w((e => {
                    if (e.length <= 1) return e;
                    let t = e.map(e => ({ ...e,
                            userAddress: e.userAddress.toLowerCase()
                        })),
                        n = Object.values((0, r.groupBy)(t, "userAddress")),
                        a = n.filter(e => 1 === e.length),
                        i = n.filter(e => e.length > 1);
                    if (0 === i.length) return a.flat();
                    let o = i.reduce((e, t) => {
                        let r = t.filter(e => !e.isOptimistic);
                        if (1 === r.length) {
                            let t = r[0];
                            e.push(t)
                        } else {
                            let r = t.sort((e, t) => new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime());
                            r.length > 0 && e.push(r[0])
                        }
                        return e
                    }, []);
                    return a.flat().concat(o)
                })(Array.isArray(e.reactions) ? [...e.reactions, n] : [n]));
                return { ...e,
                    reactions: t
                }
            }
            return e
        });
        return e.push(i), e
    }, []) : e.pages : [], "sortComments", 0, g, "validDomainRegex", 0, v], 499390)
}, 377882, (e, t, r) => {
    t.exports = function(e) {
        var t = typeof e;
        return null != e && ("object" == t || "function" == t)
    }
}, 186231, (e, t, r) => {
    t.exports = e.g && e.g.Object === Object && e.g
}, 971640, (e, t, r) => {
    var n = e.r(186231),
        a = "object" == typeof self && self && self.Object === Object && self;
    t.exports = n || a || Function("return this")()
}, 850154, (e, t, r) => {
    var n = e.r(971640);
    t.exports = function() {
        return n.Date.now()
    }
}, 653957, (e, t, r) => {
    var n = /\s/;
    t.exports = function(e) {
        for (var t = e.length; t-- && n.test(e.charAt(t)););
        return t
    }
}, 593460, (e, t, r) => {
    var n = e.r(653957),
        a = /^\s+/;
    t.exports = function(e) {
        return e ? e.slice(0, n(e) + 1).replace(a, "") : e
    }
}, 151193, (e, t, r) => {
    t.exports = e.r(971640).Symbol
}, 381803, (e, t, r) => {
    var n = e.r(151193),
        a = Object.prototype,
        i = a.hasOwnProperty,
        o = a.toString,
        s = n ? n.toStringTag : void 0;
    t.exports = function(e) {
        var t = i.call(e, s),
            r = e[s];
        try {
            e[s] = void 0;
            var n = !0
        } catch (e) {}
        var a = o.call(e);
        return n && (t ? e[s] = r : delete e[s]), a
    }
}, 862749, (e, t, r) => {
    var n = Object.prototype.toString;
    t.exports = function(e) {
        return n.call(e)
    }
}, 474507, (e, t, r) => {
    var n = e.r(151193),
        a = e.r(381803),
        i = e.r(862749),
        o = n ? n.toStringTag : void 0;
    t.exports = function(e) {
        return null == e ? void 0 === e ? "[object Undefined]" : "[object Null]" : o && o in Object(e) ? a(e) : i(e)
    }
}, 460779, (e, t, r) => {
    t.exports = function(e) {
        return null != e && "object" == typeof e
    }
}, 983631, (e, t, r) => {
    var n = e.r(474507),
        a = e.r(460779);
    t.exports = function(e) {
        return "symbol" == typeof e || a(e) && "[object Symbol]" == n(e)
    }
}, 889695, (e, t, r) => {
    var n = e.r(593460),
        a = e.r(377882),
        i = e.r(983631),
        o = 0 / 0,
        s = /^[-+]0x[0-9a-f]+$/i,
        l = /^0b[01]+$/i,
        c = /^0o[0-7]+$/i,
        u = parseInt;
    t.exports = function(e) {
        if ("number" == typeof e) return e;
        if (i(e)) return o;
        if (a(e)) {
            var t = "function" == typeof e.valueOf ? e.valueOf() : e;
            e = a(t) ? t + "" : t
        }
        if ("string" != typeof e) return 0 === e ? e : +e;
        e = n(e);
        var r = l.test(e);
        return r || c.test(e) ? u(e.slice(2), r ? 2 : 8) : s.test(e) ? o : +e
    }
}, 533066, (e, t, r) => {
    var n = e.r(377882),
        a = e.r(850154),
        i = e.r(889695),
        o = Math.max,
        s = Math.min;
    t.exports = function(e, t, r) {
        var l, c, u, d, f, p, h = 0,
            m = !1,
            y = !1,
            g = !0;
        if ("function" != typeof e) throw TypeError("Expected a function");

        function b(t) {
            var r = l,
                n = c;
            return l = c = void 0, h = t, d = e.apply(n, r)
        }

        function v(e) {
            var r = e - p,
                n = e - h;
            return void 0 === p || r >= t || r < 0 || y && n >= u
        }

        function x() {
            var e, r, n, i = a();
            if (v(i)) return w(i);
            f = setTimeout(x, (e = i - p, r = i - h, n = t - e, y ? s(n, u - r) : n))
        }

        function w(e) {
            return (f = void 0, g && l) ? b(e) : (l = c = void 0, d)
        }

        function _() {
            var e, r = a(),
                n = v(r);
            if (l = arguments, c = this, p = r, n) {
                if (void 0 === f) return h = e = p, f = setTimeout(x, t), m ? b(e) : d;
                if (y) return clearTimeout(f), f = setTimeout(x, t), b(p)
            }
            return void 0 === f && (f = setTimeout(x, t)), d
        }
        return t = i(t) || 0, n(r) && (m = !!r.leading, u = (y = "maxWait" in r) ? o(i(r.maxWait) || 0, t) : u, g = "trailing" in r ? !!r.trailing : g), _.cancel = function() {
            void 0 !== f && clearTimeout(f), h = 0, l = p = c = f = void 0
        }, _.flush = function() {
            return void 0 === f ? d : w(a())
        }, _
    }
}, 838904, (e, t, r) => {
    var n = e.r(533066),
        a = e.r(377882);
    t.exports = function(e, t, r) {
        var i = !0,
            o = !0;
        if ("function" != typeof e) throw TypeError("Expected a function");
        return a(r) && (i = "leading" in r ? !!r.leading : i, o = "trailing" in r ? !!r.trailing : o), n(e, t, {
            leading: i,
            maxWait: t,
            trailing: o
        })
    }
}, 83713, 525457, 767074, 31360, 317193, 825556, 90026, 348394, 138567, e => {
    "use strict";
    let t;
    e.s(["AuthenticationFlow", () => eF], 83713);
    var r, n, a = e.i(221628),
        i = e.i(999061),
        o = e.i(525962),
        s = e.i(415142),
        l = e.i(827681),
        c = e.i(863828),
        u = e.i(269639),
        d = e.i(604777),
        f = e.i(399482),
        p = e.i(905333),
        h = e.i(160809),
        m = e.i(416340),
        y = e.i(805949),
        g = e.i(9291),
        b = e.i(36964),
        v = e.i(651278),
        x = e.i(281932),
        w = e.i(674542),
        _ = e.i(499107),
        C = e.i(138537),
        E = e.i(706261),
        S = e.i(123386),
        A = e.i(889029),
        I = e.i(23128),
        T = e.i(417493),
        k = e.i(435894),
        O = e.i(318594),
        R = e.i(831337),
        N = e.i(11408),
        M = e.i(430433),
        P = e.i(670118),
        D = e.i(628684),
        j = e.i(378930),
        L = e.i(894610),
        F = e.i(213264),
        U = e.i(405377),
        $ = e.i(510954),
        z = e.i(57096),
        B = e.i(668122),
        q = e.i(655740),
        W = e.i(867487),
        Z = e.i(649480),
        V = e.i(301713),
        K = e.i(499217),
        H = e.i(79075),
        G = e.i(148716),
        Q = e.i(784521),
        J = e.i(305457),
        Y = e.i(392566),
        X = e.i(759926),
        ee = e.i(841231),
        et = e.i(684686),
        er = e.i(632567),
        en = e.i(98191),
        ea = e.i(636357),
        ei = e.i(660006),
        eo = e.i(748852),
        es = e.i(722762),
        el = e.i(484809),
        ec = e.i(571333),
        eu = e.i(573337),
        ed = e.i(499390),
        ef = e.i(313582);
    let ep = (t = ["polymarket", "poly", "poiymarket", "poiy", "p0ly", "p0lymarket", "polym4rket", "polymarkt", "p0lym4rket", "polymark3t", "poIymarket", "pol1market", "moderator", "m0derator", "mod3rator", "m0d3rator", "$poly", "mod", "admin", "adm1n", "4dmin", "official", "0fficial", "staff", "helpdesk", "custserv", "kalshi", "kalsh1", "k4lshi", "k4lsh1", "kalsh", "predictit", "pred1ctit", "manifold", "robinhood", "r0binhood", "✅", "☑️", "✔", `🔵`, "⭐", `🏆`, "scam", "sc4m", "support", "supp0rt", "phishing", "ph1shing", "verified", "ver1fied", "v3rified", "fuck", "nigga", "niggar", "nigger", "n1gga", "n1gger", "n1gg3r", "nigg4", "www.", ":", "/", "&", "bitch", "bastard", "cock", "dick", "pussy", "tits", "boobs", "sex", "porn", "xxx", "nude", "naked", "cunt", "fag", "faggot", "gay", "homo", "retard", "r3tard", "ret4rd", "slut", "whore", "wh0re", "asshole", "assh0le", "a$$hole", "sh1t", "shit", "sh!t", "piss", "twat", "kill", "die", "death", "murder", "rape", "hate", "nazi", "hitler", "h1tler", "hitl3r", "terrorist", "terr0rist", "bomb", "gun", "weapon", "genocide", "gen0cide", "supremacy", "supremacist", "jihad", "j1had", "kkk", "ku klux", "suicide", "suic1de", "cocaine", "heroin", "her0in", "c0caine", "fentanyl", "fent4nyl", "crack", "opioid", "opi0id", "f*ck", "f**k", "f0ck", "fck", "fuk", "fu*k", "phuck", "phuk", "b*tch", "b1tch", "bi+ch", "d*ck", "d1ck", "di*k", "p*rn", "p0rn", "pr0n", "s*x", "s3x", "c0ck", "c*ck", "c*nt", "cu*t", "n*gga", "n*gger"].map(e => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"), RegExp(`(${t})`, "i")),
        eh = eu.z.string().trim().min(ef.USERNAME_MIN_LENGTH, {
            message: `Min ${ef.USERNAME_MIN_LENGTH} chars`
        }).max(ef.USERNAME_MAX_LENGTH, {
            message: `Max ${ef.USERNAME_MAX_LENGTH} chars`
        }).refine(e => /^[A-Za-z0-9\-.]+$/.test(e), "Username must be alphanumeric with .- only").refine(e => !(0, ed.areCharactersInvalid)(e), "ASCII or emojis only").refine(e => !ep.test(e), "Not allowed").refine(e => !(0, ec.isAddress)(e), "No addresses").refine(e => !/\s+/.test(e), "No spaces"),
        em = eu.z.object({
            username: eh,
            emailOptIn: eu.z.boolean(),
            termsOptIn: eu.z.boolean(),
            referral: eu.z.string().optional()
        });
    e.s(["CreateProfileSchema", 0, em, "UsernameValidation", 0, eh], 525457);
    var ey = ((r = ey || {})[r.Magic = 0] = "Magic", r[r.EOA = 1] = "EOA", r),
        eg = ((n = eg || {})[n.Available = 0] = "Available", n[n.Unavailable = 1] = "Unavailable", n[n.Pending = 2] = "Pending", n);
    let eb = {
            tries: 3,
            startMs: 750,
            pow: 2,
            maxMs: 3e3,
            jitter: .2
        },
        ev = e => {
            let t = (0, i.c)(2),
                {
                    username: r,
                    usernameAvailability: n,
                    hasValidationError: o
                } = e;
            if (r.length && 2 === n) {
                let e;
                return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, a.jsx)("div", {
                    className: "flex absolute items-center justify-center right-3 top-1/2 -translate-y-1/2 z-10",
                    children: (0, a.jsx)(en.default, {
                        className: "h-10 w-10"
                    })
                }), t[0] = e) : e = t[0], e
            }
            if (0 === n && !o) {
                let e;
                return t[1] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, a.jsx)("div", {
                    className: "flex absolute items-center justify-center right-3 top-1/2 -translate-y-1/2 z-10",
                    children: (0, a.jsx)(N.IconCircleCheckFill18, {
                        size: 24,
                        className: "text-green-600 dark:text-green-500"
                    })
                }), t[1] = e) : e = t[1], e
            }
            return null
        },
        ex = e => {
            let t, r, n = (0, i.c)(6),
                {
                    username: o,
                    usernameAvailability: s,
                    usernameValidationErrorMessage: l,
                    t: c
                } = e,
                u = "";
            if (o.length && 1 === s) {
                let e;
                n[0] !== c ? (e = c("auth.usernameTaken"), n[0] = c, n[1] = e) : e = n[1], u = e
            } else l && (u = l);
            return n[2] !== u ? (t = u && (0, a.jsx)("p", {
                className: "text-xs text-[#D89571]",
                children: u
            }), n[2] = u, n[3] = t) : t = n[3], n[4] !== t ? (r = (0, a.jsx)("div", {
                className: "h-4 mt-0.5",
                children: t
            }), n[4] = t, n[5] = r) : r = n[5], r
        },
        ew = e => {
            let t, r, n, o, s, l, c, u, d = (0, i.c)(22),
                {
                    field: f,
                    placeholder: p,
                    label: h,
                    errorMessage: y,
                    onFocus: g,
                    onBlur: b,
                    onChange: v
                } = e,
                [x, w] = (0, m.useState)(!1);
            d[0] !== y ? (t = () => {
                y && w(!0)
            }, r = [y], d[0] = y, d[1] = t, d[2] = r) : (t = d[1], r = d[2]), (0, m.useEffect)(t, r), d[3] === Symbol.for("react.memo_cache_sentinel") ? (n = () => w(eC), d[3] = n) : n = d[3], d[4] !== h ? (o = (0, a.jsx)("span", {
                className: "text-body-sm font-medium text-text-secondary",
                children: h
            }), d[4] = h, d[5] = o) : o = d[5];
            let _ = `size-3.5 text-text-tertiary transition-transform duration-200 ${x?"rotate-180":""}`;
            return d[6] !== _ ? (s = (0, a.jsx)(M.IconChevronDownOutline18, {
                className: _
            }), d[6] = _, d[7] = s) : s = d[7], d[8] !== o || d[9] !== s ? (l = (0, a.jsxs)("button", {
                type: "button",
                onClick: n,
                className: "flex w-full items-center justify-between pt-1.5 pb-1 cursor-pointer",
                children: [o, s]
            }), d[8] = o, d[9] = s, d[10] = l) : l = d[10], d[11] !== y || d[12] !== f || d[13] !== b || d[14] !== v || d[15] !== g || d[16] !== x || d[17] !== p ? (c = x ? (0, a.jsxs)("div", {
                className: "pt-1 pb-1",
                children: [(0, a.jsx)(k.Input, {
                    name: f.name,
                    value: f.value ? ? "",
                    placeholder: p,
                    autoComplete: "off",
                    variant: "filled",
                    error: !!y,
                    onFocus: g,
                    onBlur: b,
                    onChange: v,
                    className: "w-full"
                }), y ? (0, a.jsx)("p", {
                    className: "text-xs text-red-500 mt-1",
                    children: y
                }) : null]
            }) : null, d[11] = y, d[12] = f, d[13] = b, d[14] = v, d[15] = g, d[16] = x, d[17] = p, d[18] = c) : c = d[18], d[19] !== l || d[20] !== c ? (u = (0, a.jsxs)("div", {
                className: "w-full mb-2",
                children: [l, c]
            }), d[19] = l, d[20] = c, d[21] = u) : u = d[21], u
        },
        e_ = ({
            onClose: e
        }) => {
            let t = (0, O.useQueryClient)(),
                {
                    setListenersEnabled: r
                } = (0, er.useHotkeyContext)(),
                {
                    mutateAsync: n
                } = (0, j.useSignUp)(),
                {
                    baseAddress: i,
                    proxyAddress: o,
                    authenticationType: s,
                    walletMode: u
                } = (0, Q.useAccountContext)(["baseAddress", "proxyAddress", "authenticationType", "walletMode"]),
                p = (0, F.default)(e => e.addCompletedUser),
                h = (0, F.default)(e => e.removeUser),
                {
                    setOnboardingRoute: y
                } = (0, c.useSiwx)(),
                {
                    deploySafe: g
                } = (0, D.useSafe)(),
                b = (0, ee.useComplianceStore)(e => e.setShowUsIpModal),
                v = (0, et.useGeoStore)(e => e.hasFetchedLocation),
                x = (0, et.useGeoStore)(e => e.isUsa),
                w = (0, et.useGeoStore)(e => e.isFrance),
                _ = (0, et.useGeoStore)(e => e.isUk),
                C = (0, et.useGeoStore)(e => e.isOntario),
                E = (0, et.useGeoStore)(e => e.isCloseOnlyCountry),
                {
                    approve: S
                } = (0, U.useAutoRedeemApproval)(),
                N = (0, d.useTranslations)(),
                M = +("eoa" === s),
                ec = (0, J.useAmplitudeAnalytics)(),
                [eu, ed] = (0, m.useState)(el.CreateProfileFlowState.Initial),
                [ef, ep] = (0, m.useState)(2),
                {
                    control: eh,
                    handleSubmit: ey,
                    clearErrors: eg,
                    setError: e_,
                    setValue: eC,
                    formState: {
                        errors: eE
                    },
                    watch: eS
                } = (0, P.useForm)({
                    defaultValues: {
                        username: "",
                        termsOptIn: !1,
                        emailOptIn: !0,
                        referral: ""
                    },
                    mode: "onChange",
                    resolver: (0, A.zodResolver)(em)
                }),
                {
                    username: eA,
                    emailOptIn: eI,
                    termsOptIn: eT
                } = eS(),
                ek = (0, m.useCallback)(async (r, a, c, d) => {
                    try {
                        let m = (0, H.getSignupPromptTrackingProperties)();
                        ec.trackEvent(B.Events.AttemptingAccountCreation, {
                            user: o,
                            wasEOAQ: 1 === M,
                            ...m
                        }), ed(el.CreateProfileFlowState.Pending);
                        let A = t.getQueryData($.queryKeys[z.QueryKey.Account].profile().queryKey),
                            I = A ? .profile ? .toString() || "",
                            T = A ? .userId || "",
                            k = t.getQueryData($.queryKeys[z.QueryKey.Account].preferences().queryKey) ? .preferences ? .id ? .toString() || "";
                        await n({
                            profileId: I,
                            userId: T,
                            preferencesId: k,
                            name: r,
                            displayUsernamePublic: !0,
                            referral: c ? ? "",
                            referralSource: d,
                            emailOptIn: a
                        }), ec.trackEvent(B.Events.AccountCreated, {
                            user: o,
                            wasEOAQ: 1 === M,
                            ...m
                        }), (0, H.clearSignupPromptAttribution)(), (0, W.trackEvent)("account_created");
                        let O = (0, f.createWalletCache)().email.value;
                        (0, Z.trackMetaEvent)({
                            eventName: "CompleteRegistration",
                            email: O || void 0,
                            externalId: o || void 0
                        }), (0, V.trackRedditEvent)({
                            eventName: "CompleteRegistration",
                            email: O || void 0,
                            externalId: o || void 0
                        }), (0, G.trackTikTokEvent)({
                            eventName: "CompleteRegistration",
                            email: O || void 0,
                            externalId: o || void 0
                        }), (0, K.trackSnapchatEvent)({
                            eventName: "CompleteRegistration",
                            email: O || void 0,
                            externalId: o || void 0
                        }), (0, L.trackTwitterEvent)({
                            eventName: "CompleteRegistration",
                            email: O || void 0,
                            externalId: o || void 0
                        }); {
                            let e = {
                                method: s || "unknown",
                                platform: "web",
                                email: O || void 0,
                                user_id: o || void 0
                            };
                            window.dataLayer ? .push({
                                event: "sign_up",
                                ...e
                            }), window.gtag && window.gtag("event", "sign_up", e)
                        }
                        window.geq && window.geq.suppress(), "safe" === u || "depositWallet" === u && "magic" !== s ? y(l.OnboardingRoute.CAPTUREEOAEMAIL) : v && (0, X.shouldShowViewOnly)({
                            isUsa: x,
                            isFrance: w,
                            isUk: _,
                            isOntario: C,
                            isCloseOnlyCountry: E
                        }) ? (e(), b(!0)) : (i ? (p(i), h(i), (0, Y.ctfV2Info)("magic_signup_migration_completed_locally", {
                            authType: s,
                            baseAddress: i,
                            hasProxyAddress: !!o
                        })) : (0, Y.ctfV2Warn)("magic_signup_missing_base_address_for_migration_completion", {
                            authType: s,
                            hasProxyAddress: !!o
                        }), "depositWallet" === u && "magic" === s ? (0, eo.retryWithBackoff)(eb, g)().then(() => S()).catch(e => {
                            (0, ei.handleError)(e, "[CreateAccount > magic deposit wallet setup]")
                        }) : S().catch(e => {
                            (0, ei.handleError)(e, "[CreateAccount > magic auto-redeem approve]")
                        }), y(l.OnboardingRoute.FUNDACCOUNT))
                    } catch (t) {
                        let e = (0, ei.parseProfileError)(t);
                        ed(el.CreateProfileFlowState.Error), "username_taken" === e ? e_("username", {
                            message: N("auth.usernameTaken")
                        }) : "username_unprocessable" === e ? (e_("username", {
                            message: N("auth.usernameNotAccepted")
                        }), (0, ei.handleError)(t, "[CreateAccount > handleCreateProfile > usernameUnprocessable]", o)) : "referral_invalid" === e ? e_("referral", {
                            message: N("auth.invalidReferralCode")
                        }) : (e_("username", {
                            message: N("auth.usernameError")
                        }), (0, ei.handleError)(t, "[CreateAccount > handleCreateProfile]", o))
                    } finally {
                        t.invalidateQueries({
                            queryKey: $.queryKeys[z.QueryKey.Account].preferences().queryKey
                        })
                    }
                }, [n, M, i, o, s, u, ed, t, v, x, w, _, C, E, e, b, p, h, g, S]),
                eO = (0, m.useCallback)(async e => {
                    ec.trackEvent(B.Events.PickUserNameContinueClick, {
                        username: (0, es.stripInvisibleCharacters)(e.username) || "None",
                        tos: e.termsOptIn ? "Yes" : "No",
                        send_update: e.emailOptIn ? "Yes" : "No"
                    });
                    let t = (e.referral || "").trim(),
                        r = ((0, ea.getReferralAttributionCookie)() || "").trim();
                    ek((0, es.stripInvisibleCharacters)(e.username) || "Anon", e.emailOptIn, t || r || "", t ? "manual" : r ? "attributed" : "none")
                }, [ec, ek]),
                eR = (0, m.useRef)(null),
                eN = (0, m.useCallback)((0, R.debounce)(async e => {
                    eR.current = e, ep(2);
                    try {
                        let {
                            data: t
                        } = await q.axios.get(`/api/profile/username-available?username=${encodeURIComponent(e)}`);
                        if (e !== eR.current) return;
                        ep(+!t.isAvailable)
                    } catch (e) {
                        (0, ei.handleError)(e, "[CreateAccount > debouncedValidateUsernameAvailable]"), ep(0)
                    }
                }, 250, {
                    trailing: !0
                }), [ep]);
            return (0, m.useEffect)(() => {
                eA ? eN(eA) : ep(2)
            }, [eA, eN]), (0, a.jsxs)("div", {
                className: "flex flex-col items-center w-full gap-2",
                children: [(0, a.jsxs)("div", {
                    className: "flex flex-col w-full gap-2 relative",
                    children: [(0, a.jsxs)("div", {
                        children: [(0, a.jsx)("p", {
                            className: "font-bold text-xl text-center",
                            children: N("auth.chooseUsername")
                        }), (0, a.jsx)("p", {
                            className: "text-base text-text-secondary text-center",
                            children: N("auth.updateLater")
                        })]
                    }), (0, a.jsx)(P.Controller, {
                        name: "username",
                        control: eh,
                        render: ({
                            field: e
                        }) => (0, a.jsxs)("div", {
                            className: "mb-0 mt-6",
                            children: [(0, a.jsxs)("div", {
                                className: `relative w-full h-14 border border-border-light rounded-lg overflow-hidden transition-colors focus-within:border-border-brand ${eE.username||1===ef&&eA.length?"!border-[#D89571]":""}`,
                                children: [(0, a.jsx)("p", {
                                    className: "text-base text-text-secondary absolute left-3 top-1/2 -translate-y-1/2 z-10",
                                    children: "@"
                                }), (0, a.jsx)(ev, {
                                    username: eA,
                                    usernameAvailability: ef,
                                    hasValidationError: !!eE.username
                                }), (0, a.jsx)(k.Input, { ...e,
                                    placeholder: N("auth.username"),
                                    autoComplete: "off",
                                    variant: "outlined",
                                    onFocus: () => {
                                        r(!1)
                                    },
                                    onBlur: () => {
                                        r(!0)
                                    },
                                    onChange: t => {
                                        eg("username"), ed(el.CreateProfileFlowState.Initial), eC("username", (0, es.stripInvisibleCharacters)(t.target.value), {
                                            shouldValidate: !0
                                        }), e.onChange(t)
                                    },
                                    onKeyPress: e => {
                                        if ("Enter" === e.key) try {
                                            if (!eT || eA.length < 3 || eE.username || eE.referral || eu === el.CreateProfileFlowState.Pending) return;
                                            ey(eO)(e)
                                        } catch {}
                                    },
                                    className: `w-full h-full !border-0 !rounded-none focus-visible:!ring-0 hover:!bg-transparent !pl-[31px] !pr-32 ${eE.username||1===ef&&eA.length?"!text-[#D89571]":""}`
                                })]
                            }), (0, a.jsx)(ex, {
                                username: eA,
                                usernameAvailability: ef,
                                usernameValidationErrorMessage: eE ? .username ? .message,
                                t: N
                            })]
                        })
                    })]
                }), (0, a.jsx)(P.Controller, {
                    name: "referral",
                    control: eh,
                    render: ({
                        field: e
                    }) => (0, a.jsx)(ew, {
                        field: e,
                        placeholder: N("auth.enterReferralCode"),
                        label: N("auth.referralCodeOptional"),
                        errorMessage: eE ? .referral ? .message,
                        onFocus: () => r(!1),
                        onBlur: () => r(!0),
                        onChange: t => {
                            eg("referral"), eC("referral", t.target.value), e.onChange(t)
                        }
                    })
                }), (0, a.jsxs)("div", {
                    className: "flex flex-col w-full gap-3",
                    children: [(0, a.jsxs)("div", {
                        className: "flex gap-3 items-start pt-2 pb-2",
                        children: [(0, a.jsx)(T.Checkbox, {
                            id: "termsOptIn",
                            checked: eT,
                            onCheckedChange: e => {
                                eC("termsOptIn", !!e)
                            },
                            className: "cursor-pointer"
                        }), (0, a.jsxs)("label", {
                            htmlFor: "termsOptIn",
                            className: "text-sm text-text-secondary p-0 cursor-pointer",
                            children: [N("auth.termsAgreement"), " ", (0, a.jsx)("a", {
                                href: "/tos",
                                target: "_blank",
                                rel: "noopener noreferrer",
                                className: "text-sm font-medium text-blue-600 no-underline cursor-pointer hover:opacity-90 active:opacity-80",
                                children: N("auth.termsOfUse")
                            }), " ", N("auth.termsAttestation"), (0, a.jsx)("span", {
                                className: "text-red-500",
                                children: "*"
                            })]
                        })]
                    }), "magic" === s && (0, a.jsxs)("div", {
                        className: "flex gap-3 items-start pt-2 pb-2",
                        children: [(0, a.jsx)(T.Checkbox, {
                            id: "emailOptIn",
                            checked: eI,
                            onCheckedChange: e => {
                                eC("emailOptIn", !!e, {
                                    shouldValidate: !1
                                })
                            },
                            className: "cursor-pointer"
                        }), (0, a.jsx)("label", {
                            htmlFor: "emailOptIn",
                            className: "text-sm p-0 self-center cursor-pointer",
                            children: N("auth.emailUpdates")
                        })]
                    })]
                }), (0, a.jsxs)(I.Button, {
                    variant: "default",
                    onClick: ey(eO),
                    disabled: !eT || eA.length < 3 || !!eE.username || !!eE.referral || eu === el.CreateProfileFlowState.Pending || 1 === ef,
                    className: "h-[52px] w-full text-base font-medium relative",
                    children: [N("auth.continue"), eu === el.CreateProfileFlowState.Pending ? (0, a.jsx)("div", {
                        className: "flex flex-row items-center justify-end opacity-50 absolute top-0 right-5 bottom-0 left-0",
                        children: (0, a.jsx)(en.default, {
                            color: "white",
                            className: "h-[2.85rem] w-[2.85rem] translate-x-[17px] lg:translate-x-[22px]"
                        })
                    }) : null]
                })]
            }, l.OnboardingRoute.CREATEACCOUNT)
        };

    function eC(e) {
        return !e
    }
    var eE = e.i(353114);
    e.s(["FunkitContextProvider", () => ek, "useFunkitContext", () => eO], 767074);
    var eS = e.i(97271),
        eA = e.i(53950);
    let eI = (0, eS.default)(() => e.A(329159).then(e => e.FunkitCheckout), {
            loadableGenerated: {
                modules: [273170]
            },
            ssr: !1
        }),
        eT = (0, m.createContext)({
            onBeginCheckout: async () => {
                throw Error("FunkitContext must export an `onBeginCheckout` function.")
            },
            onBeginWithdrawal: async () => {
                throw Error("FunkitContext must export an `onBeginWithdrawal` function.")
            }
        }),
        ek = e => {
            let t, r, n, o, s, l, c = (0, i.c)(14),
                {
                    children: u
                } = e;
            c[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["authenticated"], c[0] = t) : t = c[0];
            let {
                authenticated: d
            } = (0, Q.useAccountContext)(t), [f, p] = (0, m.useState)(d), [h, y] = (0, m.useState)(eR), [g, b] = (0, m.useState)(eM);
            c[1] !== h || c[2] !== g ? (r = {
                onBeginCheckout: h,
                onBeginWithdrawal: g
            }, c[1] = h, c[2] = g, c[3] = r) : r = c[3];
            let v = r;
            return c[4] !== d || c[5] !== f ? (n = () => {
                d && !f && p(!0)
            }, o = [d, f], c[4] = d, c[5] = f, c[6] = n, c[7] = o) : (n = c[6], o = c[7]), (0, m.useEffect)(n, o), c[8] !== f ? (s = f ? (0, a.jsx)(eI, {
                onSetBeginCheckout: e => {
                    y(() => e)
                },
                onSetBeginWithdrawal: e => {
                    b(() => e)
                }
            }) : null, c[8] = f, c[9] = s) : s = c[9], c[10] !== u || c[11] !== s || c[12] !== v ? (l = (0, a.jsxs)(eT.Provider, {
                value: v,
                children: [s, u]
            }), c[10] = u, c[11] = s, c[12] = v, c[13] = l) : l = c[13], l
        },
        eO = () => (0, m.useContext)(eT);

    function eR() {
        eA.logger.info("[FunkitContextProvider] beginCheckout not set")
    }

    function eN(e) {
        eA.logger.info("[FunkitContextProvider] beginWithdrawal not set")
    }

    function eM() {
        return eN
    }
    let eP = () => {
            let e, t = (0, i.c)(1);
            return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, a.jsxs)("svg", {
                width: "81",
                height: "81",
                viewBox: "0 0 81 81",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg",
                children: [(0, a.jsx)("mask", {
                    id: "path-2-inside-1_126_186",
                    fill: "white",
                    children: (0, a.jsx)("path", {
                        d: "M8.30664 23.2744C8.30664 14.9901 15.0224 8.27441 23.3066 8.27441H57.3066C65.5909 8.27441 72.3066 14.9901 72.3066 23.2744V57.2744C72.3066 65.5587 65.5909 72.2744 57.3066 72.2744H23.3066C15.0224 72.2744 8.30664 65.5587 8.30664 57.2744V23.2744Z"
                    })
                }), (0, a.jsx)("path", {
                    d: "M8.30664 23.2744C8.30664 14.9901 15.0224 8.27441 23.3066 8.27441H57.3066C65.5909 8.27441 72.3066 14.9901 72.3066 23.2744V57.2744C72.3066 65.5587 65.5909 72.2744 57.3066 72.2744H23.3066C15.0224 72.2744 8.30664 65.5587 8.30664 57.2744V23.2744Z",
                    fill: "#0060FF"
                }), (0, a.jsx)("path", {
                    d: "M8.30664 8.27441H72.3066H8.30664ZM72.3066 57.2744C72.3066 67.7678 63.8001 76.2744 53.3066 76.2744H27.3066C16.8132 76.2744 8.30664 67.7678 8.30664 57.2744C8.30664 63.3495 15.0224 68.2744 23.3066 68.2744H57.3066C65.5909 68.2744 72.3066 63.3495 72.3066 57.2744ZM8.30664 72.2744V8.27441V72.2744ZM72.3066 8.27441V72.2744V8.27441Z",
                    fill: "black",
                    fillOpacity: "0.4",
                    mask: "url(#path-2-inside-1_126_186)"
                }), (0, a.jsx)("path", {
                    d: "M40.3067 57.9967C50.0944 57.9967 58.0289 50.0622 58.0289 40.2745C58.0289 30.4868 50.0944 22.5522 40.3067 22.5522C30.519 22.5522 22.5845 30.4868 22.5845 40.2745C22.5845 50.0622 30.519 57.9967 40.3067 57.9967Z",
                    stroke: "white",
                    strokeWidth: "3",
                    strokeLinecap: "round",
                    strokeLinejoin: "round"
                }), (0, a.jsx)("path", {
                    d: "M44.7482 35.2657C43.7851 32.985 41.8564 32.4692 40.3995 32.4692C39.0453 32.4692 35.4862 33.1903 35.8162 36.6052C36.0459 39.0032 38.3071 39.8955 40.2822 40.2475C42.2573 40.5995 45.1246 41.3523 45.1955 44.2441C45.2542 46.6886 43.0566 48.3581 40.3995 48.3581C37.8622 48.3581 36.0973 47.3706 35.4177 45.1388",
                    stroke: "white",
                    strokeWidth: "3",
                    strokeLinecap: "round",
                    strokeLinejoin: "round"
                }), (0, a.jsx)("path", {
                    d: "M40.3066 29.8857V32.4695",
                    stroke: "white",
                    strokeWidth: "3",
                    strokeLinecap: "round",
                    strokeLinejoin: "round"
                }), (0, a.jsx)("path", {
                    d: "M40.3066 48.3584V50.6635",
                    stroke: "white",
                    strokeWidth: "3",
                    strokeLinecap: "round",
                    strokeLinejoin: "round"
                })]
            }), t[0] = e) : e = t[0], e
        },
        eD = e => {
            let t, r, n, o, s, c, u, f = (0, i.c)(17),
                {
                    onClose: p
                } = e,
                h = (0, d.useTranslations)(),
                m = (0, J.useAmplitudeAnalytics)(),
                {
                    onBeginCheckout: y
                } = eO();
            f[0] !== m || f[1] !== y || f[2] !== p ? (t = () => {
                m.trackEvent(B.Events.OnboardingDepositFundsButtonClicked), p(), setTimeout(() => {
                    y()
                }, 500)
            }, f[0] = m, f[1] = y, f[2] = p, f[3] = t) : t = f[3];
            let g = t;
            return f[4] === Symbol.for("react.memo_cache_sentinel") ? (r = (0, a.jsx)(eP, {}), f[4] = r) : r = f[4], f[5] !== h ? (n = h("auth.fundYourAccount"), f[5] = h, f[6] = n) : n = f[6], f[7] !== n ? (o = (0, a.jsx)("p", {
                className: "font-bold text-xl text-center",
                children: n
            }), f[7] = n, f[8] = o) : o = f[8], f[9] !== h ? (s = h("auth.depositFunds"), f[9] = h, f[10] = s) : s = f[10], f[11] !== g || f[12] !== s ? (c = (0, a.jsx)("div", {
                className: "flex flex-col flex-1 self-stretch gap-1",
                children: (0, a.jsx)(I.Button, {
                    variant: "default",
                    onClick: g,
                    className: "h-[52px] w-full text-base font-medium disabled:cursor-wait",
                    children: s
                })
            }), f[11] = g, f[12] = s, f[13] = c) : c = f[13], f[14] !== o || f[15] !== c ? (u = (0, a.jsxs)("div", {
                className: "flex flex-col items-center w-full gap-[18px]",
                children: [r, o, c]
            }, l.OnboardingRoute.FUNDACCOUNT), f[14] = o, f[15] = c, f[16] = u) : u = f[16], u
        };

    function ej(e) {
        let t, r, n, o, s, u, d, f, p = (0, i.c)(25),
            {
                onClose: h
            } = e,
            {
                onboardingRoute: m,
                setOnboardingRoute: y
            } = (0, c.useSiwx)();
        p[0] !== h || p[1] !== y ? (t = () => {
            h(), setTimeout(() => {
                y(l.OnboardingRoute.CREATEACCOUNT)
            }, 500)
        }, p[0] = h, p[1] = y, p[2] = t) : t = p[2];
        let g = t;
        return p[3] !== g || p[4] !== m ? (r = m === l.OnboardingRoute.CREATEACCOUNT && (0, a.jsx)(e_, {
            onClose: g
        }), p[3] = g, p[4] = m, p[5] = r) : r = p[5], p[6] !== g || p[7] !== m ? (n = m === l.OnboardingRoute.CAPTUREEOAEMAIL && (0, a.jsx)(S.CaptureEmail, {
            onClose: g
        }), p[6] = g, p[7] = m, p[8] = n) : n = p[8], p[9] !== m ? (o = m === l.OnboardingRoute.ENABLEEOATRADING && (0, a.jsx)(eE.EnableTrading, {}), p[9] = m, p[10] = o) : o = p[10], p[11] !== m ? (s = m === l.OnboardingRoute.APPROVETRADING && (0, a.jsx)(C.ApproveTrading, {}), p[11] = m, p[12] = s) : s = p[12], p[13] !== m ? (u = m === l.OnboardingRoute.AUTOREDEEM && (0, a.jsx)(E.EnableAutoRedeem, {}), p[13] = m, p[14] = u) : u = p[14], p[15] !== g || p[16] !== m ? (d = m === l.OnboardingRoute.FUNDACCOUNT && (0, a.jsx)(eD, {
            onClose: g
        }), p[15] = g, p[16] = m, p[17] = d) : d = p[17], p[18] !== r || p[19] !== n || p[20] !== o || p[21] !== s || p[22] !== u || p[23] !== d ? (f = (0, a.jsxs)("div", {
            className: "flex flex-col items-center w-full gap-4 h-fit",
            children: [r, n, o, s, u, d]
        }), p[18] = r, p[19] = n, p[20] = o, p[21] = s, p[22] = u, p[23] = d, p[24] = f) : f = p[24], f
    }

    function eL(e) {
        let t, r, n, o, s, u, d, m, C, E, S, A, I, T = (0, i.c)(40),
            {
                onClose: k
            } = e,
            {
                route: O,
                setRoute: R,
                connector: N,
                setConnectorStatus: M,
                connectorRoute: P,
                setAuthenticationStatus: D
            } = (0, c.useSiwx)(),
            {
                status: j
            } = (0, y.useConnection)(),
            L = "connected" === j,
            {
                disconnect: F
            } = (0, g.useDisconnect)();
        T[0] === Symbol.for("react.memo_cache_sentinel") ? (t = (0, b.isMobile)(), T[0] = t) : t = T[0];
        let U = t,
            $ = (0, x.useWallet)(N ? .id),
            z = $ ? .name,
            B = $ ? .shortName ? ? $ ? .name,
            q = $ ? .connectorIcon ? ? $ ? .icon,
            W = $ ? .iconShape ? ? "circle",
            Z = $ ? .iconShouldShrink;
        T[1] !== z || T[2] !== B || T[3] !== q || T[4] !== W || T[5] !== Z ? (r = {
            name: z,
            shortName: B,
            icon: q,
            iconShape: W,
            iconShouldShrink: Z
        }, T[1] = z, T[2] = B, T[3] = q, T[4] = W, T[5] = Z, T[6] = r) : r = T[6];
        let V = $ ? .name;
        T[7] !== V ? (n = {
            CONNECTORNAME: V
        }, T[7] = V, T[8] = n) : n = T[8], T[9] !== r || T[10] !== n ? (o = {
            walletInfo: r,
            localeReplacements: n
        }, T[9] = r, T[10] = n, T[11] = o) : o = T[11];
        let {
            walletInfo: K,
            localeReplacements: H
        } = o;
        T[12] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, a.jsx)(_.Connectors, {}), T[12] = s) : s = T[12], T[13] === Symbol.for("react.memo_cache_sentinel") ? (u = (0, a.jsx)(w.Connect, {}), T[13] = u) : u = T[13], T[14] !== k ? (d = {
            [l.AuthRoute.CONNECTORS]: s,
            [l.AuthRoute.CONNECT]: u,
            [l.AuthRoute.ONBOARDING]: (0, a.jsx)(ej, {
                onClose: k
            })
        }, T[14] = k, T[15] = d) : d = T[15];
        let G = d,
            Q = (0, v.useLocales)(H);
        T[16] !== $ ? (m = () => !!$ && !(!$.getWalletConnectDeeplink || $.isInstalled), T[16] = $, T[17] = m) : m = T[17];
        let J = m;
        T[18] !== P || T[19] !== Q || T[20] !== O || T[21] !== J || T[22] !== $ ? .connector ? .id || T[23] !== K ? .name ? (C = () => {
            switch (O) {
                case l.AuthRoute.CONNECT:
                    if (J()) return (0, p.isWalletConnectConnector)($ ? .connector ? .id) || U ? Q.scanScreen_heading : Q.scanScreen_heading_withConnector;
                    return K ? .name;
                case l.AuthRoute.CONNECTORS:
                    return P === l.ConnectorRoute.LOGIN ? Q.connectorsScreen_loginHeading : Q.connectorsScreen_signupHeading;
                case l.AuthRoute.ONBOARDING:
                default:
                    return ""
            }
        }, T[18] = P, T[19] = Q, T[20] = O, T[21] = J, T[22] = $ ? .connector ? .id, T[23] = K ? .name, T[24] = C) : C = T[24];
        let Y = C;
        T[25] !== F || T[26] !== L || T[27] !== D || T[28] !== M || T[29] !== R ? (E = () => {
            (0, f.createWalletCache)().state.clear(), R(l.AuthRoute.CONNECTORS), D(l.AuthenticationStatusStates.IDLE), setTimeout(() => {
                M(l.ConnectorStates.DISCONNECTED), L && F()
            }, 500)
        }, T[25] = F, T[26] = L, T[27] = D, T[28] = M, T[29] = R, T[30] = E) : E = T[30];
        let X = E,
            ee = O !== l.AuthRoute.CONNECTORS && O !== l.AuthRoute.ONBOARDING;
        T[31] !== Y ? (S = Y(), T[31] = Y, T[32] = S) : S = T[32];
        let et = S;
        T[33] !== et || T[34] !== X || T[35] !== ee ? (A = ee && (0, a.jsxs)("div", {
            className: "flex items-center h-12",
            children: [(0, a.jsx)("button", {
                type: "button",
                onClick: X,
                className: "shrink-0 cursor-pointer rounded-sm p-1 text-text-secondary hover:text-text-tertiary transition-colors duration-200",
                "aria-label": "Back",
                children: (0, a.jsx)(h.IconChevronLeftOutline18, {})
            }), et && (0, a.jsx)("p", {
                className: "flex-1 text-center font-bold text-xl text-text-primary",
                children: et
            }), (0, a.jsx)("div", {
                className: "w-5 shrink-0"
            })]
        }), T[33] = et, T[34] = X, T[35] = ee, T[36] = A) : A = T[36];
        let er = G[O];
        return T[37] !== A || T[38] !== er ? (I = (0, a.jsxs)("div", {
            className: "flex flex-col",
            children: [A, er]
        }), T[37] = A, T[38] = er, T[39] = I) : I = T[39], I
    }
    eL.displayName = "AuthenticationFlowContent";
    let eF = e => {
        let t, r, n, f, p, h, m, y, g, b = (0, i.c)(28),
            {
                onClose: v
            } = e,
            x = (0, d.useTranslations)(),
            {
                open: w,
                setOpen: _,
                connectorStatus: C,
                route: E,
                connector: S,
                preventClose: A,
                setPreventClose: I,
                setRoute: T,
                setConnectorStatus: k
            } = (0, c.useSiwx)(),
            {
                isOpenW3M: O
            } = (0, u.useWalletConnectModal)(),
            R = "magic" === S.id && E === l.AuthRoute.CONNECT && C === l.ConnectorStates.CONNECTING || E === l.AuthRoute.ONBOARDING || O || A;
        return b[0] !== C || b[1] !== v || b[2] !== R || b[3] !== k || b[4] !== _ || b[5] !== I || b[6] !== T ? (t = e => {
            e || R || (_(!1), I(!1), setTimeout(() => {
                C !== l.ConnectorStates.CONNECTED && (T(l.AuthRoute.CONNECTORS), k(l.ConnectorStates.CONNECTING))
            }, 500), v())
        }, b[0] = C, b[1] = v, b[2] = R, b[3] = k, b[4] = _, b[5] = I, b[6] = T, b[7] = t) : t = b[7], b[8] !== x ? (r = x("auth.authentication"), b[8] = x, b[9] = r) : r = b[9], b[10] !== r ? (n = (0, a.jsx)(o.ModalTitle, {
            children: r
        }), b[10] = r, b[11] = n) : n = b[11], b[12] !== x ? (f = x("auth.authentication"), b[12] = x, b[13] = f) : f = b[13], b[14] !== f ? (p = (0, a.jsx)(o.ModalDescription, {
            children: f
        }), b[14] = f, b[15] = p) : p = b[15], b[16] !== n || b[17] !== p ? (h = (0, a.jsxs)(s.VisuallyHidden.Root, {
            children: [n, p]
        }), b[16] = n, b[17] = p, b[18] = h) : h = b[18], b[19] !== v ? (m = (0, a.jsx)(eL, {
            onClose: v
        }), b[19] = v, b[20] = m) : m = b[20], b[21] !== h || b[22] !== m ? (y = (0, a.jsxs)(o.ModalContent, {
            onOpenAutoFocus: eU,
            children: [h, m]
        }), b[21] = h, b[22] = m, b[23] = y) : y = b[23], b[24] !== w || b[25] !== t || b[26] !== y ? (g = (0, a.jsx)(o.Modal, {
            open: w,
            onOpenChange: t,
            children: y
        }), b[24] = w, b[25] = t, b[26] = y, b[27] = g) : g = b[27], g
    };

    function eU(e) {
        e.preventDefault()
    }
    e.s(["TradingRestricteDialog", () => eB], 317193);
    let e$ = () => {
        let e, t, r = (0, i.c)(5),
            [n, a] = (0, m.useState)(!1);
        r[0] !== n ? (e = () => {
            a(!n)
        }, r[0] = n, r[1] = e) : e = r[1];
        let o = e;
        return r[2] !== n || r[3] !== o ? (t = {
            showModal: n,
            setShowModal: a,
            toggleModal: o
        }, r[2] = n, r[3] = o, r[4] = t) : t = r[4], t
    };
    e.s(["default", 0, e$], 31360);
    let ez = "mailto:support@polymarket.com",
        eB = () => {
            let e, t, r, n, s, l, u, f, p, h, y, g, b, v = (0, i.c)(34),
                x = (0, d.useTranslations)();
            v[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["closedDynamic", "authenticated"], v[0] = e) : e = v[0];
            let {
                closedDynamic: w,
                authenticated: _
            } = (0, Q.useAccountContext)(e), {
                wasSessionPersisted: C
            } = (0, c.useSiwx)(), {
                showModal: E,
                setShowModal: S
            } = e$(), A = m.default.useRef(!1);
            return v[1] !== _ || v[2] !== w || v[3] !== S || v[4] !== C ? (t = () => {
                void 0 !== C && !C && _ && w && !A.current && (A.current = !0, S(!0))
            }, v[1] = _, v[2] = w, v[3] = S, v[4] = C, v[5] = t) : t = v[5], v[6] !== _ || v[7] !== w || v[8] !== C ? (r = [w, _, C], v[6] = _, v[7] = w, v[8] = C, v[9] = r) : r = v[9], m.default.useEffect(t, r), v[10] !== x ? (n = x("modals.tradingRestricted.title"), v[10] = x, v[11] = n) : n = v[11], v[12] !== n ? (s = (0, a.jsx)(o.ModalHeader, {
                children: (0, a.jsx)(o.ModalTitle, {
                    children: n
                })
            }), v[12] = n, v[13] = s) : s = v[13], v[14] !== x ? (l = x("modals.tradingRestricted.descriptionBefore"), v[14] = x, v[15] = l) : l = v[15], v[16] === Symbol.for("react.memo_cache_sentinel") ? (u = (0, a.jsx)("a", {
                href: ez,
                children: "support@polymarket.com"
            }), v[16] = u) : u = v[16], v[17] !== x ? (f = x("modals.tradingRestricted.descriptionAfter"), v[17] = x, v[18] = f) : f = v[18], v[19] !== l || v[20] !== f ? (p = (0, a.jsxs)(o.ModalDescription, {
                children: [l, " ", u, " ", f]
            }), v[19] = l, v[20] = f, v[21] = p) : p = v[21], v[22] !== x ? (h = x("modals.tradingRestricted.emailSupport"), v[22] = x, v[23] = h) : h = v[23], v[24] !== h ? (y = (0, a.jsx)(o.ModalFooter, {
                children: (0, a.jsx)(I.Button, {
                    asChild: !0,
                    children: (0, a.jsx)("a", {
                        href: ez,
                        target: "_blank",
                        rel: "noopener noreferrer",
                        children: h
                    })
                })
            }), v[24] = h, v[25] = y) : y = v[25], v[26] !== y || v[27] !== s || v[28] !== p ? (g = (0, a.jsxs)(o.ModalContent, {
                children: [s, p, y]
            }), v[26] = y, v[27] = s, v[28] = p, v[29] = g) : g = v[29], v[30] !== S || v[31] !== E || v[32] !== g ? (b = (0, a.jsx)(o.Modal, {
                open: E,
                onOpenChange: S,
                size: "sm",
                children: g
            }), v[30] = S, v[31] = E, v[32] = g, v[33] = b) : b = v[33], b
        };
    e.s(["default", () => e7, "useIsFavoriteEvent", () => e8], 90026);
    var eq = e.i(122538),
        eW = e.i(601550),
        eZ = e.i(964974),
        eV = e.i(274466),
        eK = e.i(838904),
        eH = e.i(262614),
        eG = e.i(687112),
        eQ = e.i(797055),
        eJ = e.i(563423);
    let eY = function(e, t) {
        eJ.default && !(0, eQ.isFunction)(e) && console.error("useThrottleFn expected parameter is a function, got ".concat(typeof e));
        var r, n = (0, eH.default)(e),
            a = null != (r = null == t ? void 0 : t.wait) ? r : 1e3,
            i = (0, m.useMemo)(function() {
                return (0, eK.default)(function() {
                    for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
                    return n.current.apply(n, (0, eV.__spreadArray)([], (0, eV.__read)(e), !1))
                }, a, t)
            }, []);
        return (0, eG.default)(function() {
            i.cancel()
        }), {
            run: i,
            cancel: i.cancel,
            flush: i.flush
        }
    };
    e.s(["useThrottleFn", 0, eY], 825556);
    var eX = e.i(305292);
    let e0 = $.queryKeys[z.QueryKey.Account].favoriteEvents().queryKey,
        e1 = async () => {
            try {
                let e = [],
                    t = 0;
                for (;;) {
                    let r = await (0, eX.getGammaClient)().favorites.events.list({
                        limit: 20,
                        page: t
                    });
                    if ("failure" === r.status) throw eA.logger.error("[useFavoriteEvents > getFavoriteEventsFetcher]", {
                        error: r.error,
                        page: t
                    }), r.error;
                    let n = r.data ? ? [];
                    if (e.push(...n), n.length < 20) break;
                    t += 1
                }
                return e.reduce((e, t) => (e[t.eventId] || (e[t.eventId] = {
                    favoriteId: parseInt(t.id, 10)
                }), e), {})
            } catch (e) {
                return eA.logger.error("[useFavoriteEvents > getFavoriteEventsFetcher] Caught error", {
                    error: e
                }), {}
            }
        },
        e2 = async e => {
            try {
                let t = await (0, eX.getGammaClient)().favorites.events.create({
                    id: e.eventId
                });
                if ("failure" === t.status) throw eA.logger.error("[useFavoriteEvents > addFavoriteEventFetcher]", {
                    error: t.error,
                    variables: e
                }), t.error;
                return t.data
            } catch (t) {
                throw eA.logger.error("[useFavoriteEvents > addFavoriteEventFetcher] Caught error", {
                    error: t,
                    variables: e
                }), t
            }
        },
        e6 = async e => {
            try {
                let t = await (0, eX.getGammaClient)().favorites.events.delete({
                    id: e.id
                });
                if ("failure" === t.status) throw eA.logger.error("[useFavoriteEvents > removeFavoriteEventFetcher]", {
                    error: t.error,
                    variables: e
                }), t.error;
                return t.data
            } catch (t) {
                throw eA.logger.error("[useFavoriteEvents > removeFavoriteEventFetcher] Caught error", {
                    error: t,
                    variables: e
                }), t
            }
        };

    function e5(e, t, r, n) {
        let a, o, s = (0, i.c)(6);
        s[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["authenticated", "proxyAddress", "isSessionLoading", "isUserOnboarding"], s[0] = a) : a = s[0];
        let {
            authenticated: l,
            proxyAddress: c,
            isSessionLoading: u,
            isUserOnboarding: d
        } = (0, Q.useAccountContext)(a), f = e ? ? l, p = t ? ? c, h = r ? ? u, m = n ? ? d;
        return s[1] !== f || s[2] !== p || s[3] !== h || s[4] !== m ? (o = {
            authenticated: f,
            proxyAddress: p,
            isSessionLoading: h,
            isUserOnboarding: m
        }, s[1] = f, s[2] = p, s[3] = h, s[4] = m, s[5] = o) : o = s[5], o
    }

    function e3(e, t, r, n, a) {
        let o, s, l = (0, i.c)(6),
            {
                authenticated: c,
                proxyAddress: u,
                isSessionLoading: d,
                isUserOnboarding: f
            } = e5(e, t, r, n),
            p = !d && c && !!u && !f;
        return l[0] !== u ? (o = {
            persist: !0,
            errorContext: {
                tag: "getFavoriteEvents",
                proxyAddress: u
            }
        }, l[0] = u, l[1] = o) : o = l[1], l[2] !== a || l[3] !== p || l[4] !== o ? (s = {
            queryKey: e0,
            queryFn: e1,
            enabled: p,
            refetchOnWindowFocus: !1,
            gcTime: 6e5,
            staleTime: 6e5,
            placeholderData: eq.keepPreviousData,
            retry: 3,
            meta: o,
            retryDelay: e4,
            select: a
        }, l[2] = a, l[3] = p, l[4] = o, l[5] = s) : s = l[5], (0, eZ.useQuery)(s)
    }

    function e4(e) {
        return Math.min(e > 1 ? 2 ** e * 1e3 : 1e3, 3e4)
    }

    function e8(e, t, r, n, a) {
        let o, s = (0, i.c)(2);
        s[0] !== e ? (o = t => !!(e && void 0 !== t[e]), s[0] = e, s[1] = o) : o = s[1];
        let {
            data: l
        } = e3(t, r, n, a, o);
        return void 0 !== l && l
    }
    let e7 = (e, t, r, n) => {
        let a, o, s = (0, i.c)(7),
            {
                data: u,
                refetch: d
            } = e3(e, t, r, n),
            f = function(e, t, r, n) {
                let a = (0, O.useQueryClient)(),
                    {
                        setOpen: i,
                        setConnectorRoute: o
                    } = (0, c.useSiwx)(),
                    s = (0, J.useAmplitudeAnalytics)(),
                    {
                        authenticated: u,
                        proxyAddress: d
                    } = e5(e, t, r, n),
                    f = (0, m.useCallback)(() => a.getQueryData(e0), [a]),
                    {
                        mutateAsync: p
                    } = (0, eW.useMutation)({
                        mutationKey: $.queryKeys[z.QueryKey.Account].favoriteEvents._def,
                        mutationFn: e2,
                        retry: 3,
                        retryDelay: e => Math.min(e > 1 ? 2 ** e * 1e3 : 1e3, 3e4),
                        onMutate: async e => {
                            let t;
                            await a.cancelQueries({
                                queryKey: $.queryKeys[z.QueryKey.Account].favoriteEvents._def
                            });
                            let r = f(),
                                n = 0;
                            return r ? (Object.keys(r).forEach(e => {
                                n = Math.max(r[e].favoriteId, n)
                            }), t = { ...r,
                                [e.eventId]: {
                                    eventId: e.eventId,
                                    favoriteId: n + 1
                                }
                            }) : t = {
                                [e.eventId]: {
                                    eventId: e.eventId,
                                    favoriteId: n + 1
                                }
                            }, a.setQueryData(e0, t), {
                                previousFavoriteEvents: r
                            }
                        },
                        onSettled: () => (a.invalidateQueries({
                            queryKey: ["events", "homepageFilters", !0]
                        }), a.invalidateQueries({
                            queryKey: $.queryKeys[z.QueryKey.Account].favoriteEvents._def
                        })),
                        onError: (e, t, r) => {
                            a.setQueryData(e0, r ? .previousFavoriteEvents), (0, ei.handleError)(e, "addFavoriteEvent", d)
                        }
                    }),
                    {
                        mutateAsync: h
                    } = (0, eW.useMutation)({
                        mutationKey: $.queryKeys[z.QueryKey.Account].favoriteEvents._def,
                        mutationFn: e6,
                        retry: 3,
                        retryDelay: e => Math.min(e > 1 ? 2 ** e * 1e3 : 1e3, 3e4),
                        onMutate: async e => {
                            await a.cancelQueries({
                                queryKey: $.queryKeys[z.QueryKey.Account].favoriteEvents._def
                            });
                            let t = f(),
                                r = { ...t
                                };
                            delete r[e.eventId], a.setQueryData(e0, r);
                            let n = a.getQueriesData({
                                    queryKey: [z.QueryKey.Events, "filters"],
                                    predicate: e => {
                                        let t = e.queryKey;
                                        return !0 === t[t.length - 1]
                                    }
                                }),
                                i = [];
                            return n.forEach(([t, r]) => {
                                let n = -1,
                                    o = -1;
                                for (let a = 0; a < r.pages.length; a++) {
                                    let s = r.pages[a],
                                        l = s ? .events.findIndex(t => String(t.id) === e.eventId) ? ? -1;
                                    if (-1 !== l) {
                                        n = a, o = l, i.push([t, r]);
                                        break
                                    }
                                } - 1 !== n && -1 !== o && a.setQueryData(t, e => {
                                    let t = [...e.pages],
                                        r = { ...t[n]
                                        };
                                    return r.events = [...r.events], r.events.splice(o, 1), t[n] = r, { ...e,
                                        pages: t
                                    }
                                })
                            }), {
                                previousFavoriteEvents: t,
                                previousFilteredEvents: i
                            }
                        },
                        onSettled: () => (a.invalidateQueries({
                            queryKey: ["events", "homepageFilters", !0]
                        }), a.invalidateQueries({
                            queryKey: $.queryKeys[z.QueryKey.Account].favoriteEvents._def
                        })),
                        onError: (e, t, r) => {
                            r ? .previousFavoriteEvents && a.setQueryData(e0, r.previousFavoriteEvents), r ? .previousFilteredEvents && r.previousFilteredEvents.forEach(([e, t]) => {
                                a.setQueryData(e, t)
                            }), (0, ei.handleError)(e, "removeFavoriteEvent", d)
                        }
                    }),
                    y = (0, m.useCallback)(async e => {
                        try {
                            return await p({
                                eventId: e
                            })
                        } catch (t) {
                            return eA.logger.error("[useFavoriteEvents > addFavoriteEventWrapper] Caught error", {
                                error: t,
                                eventId: e
                            }), null
                        }
                    }, [p]),
                    g = (0, m.useCallback)(async (e, t) => {
                        try {
                            return await h({
                                id: e,
                                eventId: t
                            })
                        } catch (r) {
                            return eA.logger.error("[useFavoriteEvents > removeFavoriteEventWrapper] Caught error", {
                                error: r,
                                id: e,
                                eventId: t
                            }), null
                        }
                    }, [h]),
                    {
                        run: b
                    } = eY(async ({
                        willBeFav: e,
                        eventId: t
                    }) => {
                        try {
                            if (u && d) {
                                if (e) return void await y(t);
                                let r = f() ? .[t];
                                if (!r) return;
                                await g(r.favoriteId.toString(), t)
                            }
                        } catch (r) {
                            eA.logger.error("[useFavoriteEvents > throttledToggleFavoriteEvent] Caught error", {
                                error: r,
                                willBeFav: e,
                                eventId: t
                            })
                        }
                    }, {
                        wait: 500
                    });
                return (0, m.useCallback)(e => {
                    try {
                        if (!u) {
                            let e = Date.now();
                            (0, H.markSignupPromptOpened)("favorite", {
                                now: e,
                                route: "signup"
                            }), s.trackEvent(B.Events.SignupPromptOpened, (0, H.getSignupPromptOpenedEventProperties)({
                                source: "favorite",
                                route: "signup"
                            })), o(l.ConnectorRoute.SIGNUP), i(!0);
                            return
                        }
                        let t = f();
                        if (void 0 === t) return;
                        b({
                            eventId: e,
                            willBeFav: void 0 === t[e]
                        })
                    } catch (t) {
                        eA.logger.error("[useFavoriteEvents > toggleFavoriteEvent] Caught error", {
                            error: t,
                            eventId: e
                        })
                    }
                }, [u, s, b, i, o, f])
            }(e, t, r, n);
        s[0] !== u ? (a = e => !!(e && u ? .[e] !== void 0), s[0] = u, s[1] = a) : a = s[1];
        let p = a;
        return s[2] !== u || s[3] !== d || s[4] !== p || s[5] !== f ? (o = {
            favoriteEvents: u,
            toggleFavoriteEvent: f,
            isFavoriteEvent: p,
            getFavoriteEvents: d
        }, s[2] = u, s[3] = d, s[4] = p, s[5] = f, s[6] = o) : o = s[6], o
    };
    e.s(["default", () => tr], 348394);
    var e9 = e.i(789608),
        te = e.i(945930),
        tt = e.i(730474);
    let tr = function() {
        let e, t, r, n, s, l, c, u, f, p, h, m, y = (0, i.c)(31),
            g = (0, d.useTranslations)(),
            {
                showLogoutConnectionErrorModal: b,
                setShowLogoutConnectionErrorModal: v
            } = (0, tt.useModalStore)(),
            {
                disconnect: x
            } = (0, e9.useDisconnect)();
        y[0] !== x || y[1] !== v ? (e = async () => {
            (0, te.setLogoutTrigger)({
                reason: "connection_error_reset",
                initiator: "system",
                trigger: "connection_error_modal_logout"
            }), x(), v(!1)
        }, y[0] = x, y[1] = v, y[2] = e) : e = y[2];
        let w = e;
        return y[3] !== g ? (t = g("modals.connectionError.title"), y[3] = g, y[4] = t) : t = y[4], y[5] !== t ? (r = (0, a.jsx)(o.ModalHeader, {
            showClose: !1,
            children: (0, a.jsx)(o.ModalTitle, {
                children: t
            })
        }), y[5] = t, y[6] = r) : r = y[6], y[7] !== g ? (n = g("modals.connectionError.description"), y[7] = g, y[8] = n) : n = y[8], y[9] !== n ? (s = (0, a.jsx)(o.ModalDescription, {
            children: n
        }), y[9] = n, y[10] = s) : s = y[10], y[11] !== g ? (l = g("modals.connectionError.dismiss"), y[11] = g, y[12] = l) : l = y[12], y[13] !== l ? (c = (0, a.jsx)(o.ModalClose, {
            asChild: !0,
            children: (0, a.jsx)(I.Button, {
                variant: "outline",
                children: l
            })
        }), y[13] = l, y[14] = c) : c = y[14], y[15] !== g ? (u = g("modals.connectionError.logOut"), y[15] = g, y[16] = u) : u = y[16], y[17] !== w || y[18] !== u ? (f = (0, a.jsx)(I.Button, {
            onClick: w,
            children: u
        }), y[17] = w, y[18] = u, y[19] = f) : f = y[19], y[20] !== c || y[21] !== f ? (p = (0, a.jsxs)(o.ModalFooter, {
            children: [c, f]
        }), y[20] = c, y[21] = f, y[22] = p) : p = y[22], y[23] !== r || y[24] !== s || y[25] !== p ? (h = (0, a.jsxs)(o.ModalContent, {
            children: [r, s, p]
        }), y[23] = r, y[24] = s, y[25] = p, y[26] = h) : h = y[26], y[27] !== v || y[28] !== b || y[29] !== h ? (m = (0, a.jsx)(o.Modal, {
            open: b,
            onOpenChange: v,
            size: "sm",
            children: h
        }), y[27] = v, y[28] = b, y[29] = h, y[30] = m) : m = y[30], m
    };
    var tn = e.i(149534);
    e.s(["IconCheckOutline18", 0, ({
        strokeWidth: e = 1.5,
        ...t
    }) => m.default.createElement(tn.Icon, {
        size: "18px",
        ...t
    }, m.default.createElement("polyline", {
        points: "2.75 9.25 6.75 14.25 15.25 3.75",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }))], 138567)
}, 598440, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(149534);
    e.s(["IconCopyOutline18", 0, ({
        strokeWidth: e = 1.5,
        ...n
    }) => t.default.createElement(r.Icon, {
        size: "18px",
        ...n
    }, t.default.createElement("path", {
        d: "M2.25 6.75V13.25C2.25 14.355 3.145 15.25 4.25 15.25H11.75",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        "data-color": "color-2",
        fill: "none"
    }), t.default.createElement("path", {
        d: "M7.25 12.25H13.75C14.8546 12.25 15.75 11.355 15.75 10.25V4.75C15.75 3.645 14.8546 2.75 13.75 2.75H7.25C6.1454 2.75 5.25 3.645 5.25 4.75V10.25C5.25 11.355 6.1454 12.25 7.25 12.25Z",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        fill: "none"
    }))])
}, 783198, 843783, 848872, 93259, 189595, 757613, 762769, 799471, 911716, 304826, e => {
    "use strict";
    e.s(["DepositWalletMigrationModal", () => Y], 783198);
    var t = e.i(221628),
        r = e.i(23128),
        n = e.i(525962),
        a = e.i(964974),
        i = e.i(138567),
        o = e.i(598440),
        s = e.i(604777),
        l = e.i(416340),
        c = e.i(882860),
        u = e.i(914640),
        d = e.i(249792),
        f = e.i(606572),
        p = e.i(113967),
        h = e.i(289241),
        m = e.i(631222);
    let y = {
            address: (0, p.getAddress)(m.USDC_ADDRESS),
            chainId: m.MATIC_CONFIG.chainId,
            symbol: "pUSD",
            icon: "https://sdk-cdn.fun.xyz/images/pusd.svg"
        },
        g = {
            address: m.USDCE_ADDRESS.toLowerCase(),
            chainId: m.MATIC_CONFIG.chainId,
            symbol: "USDC.E"
        },
        b = {
            [h.polygon.id]: (0, p.getAddress)("0xC8A6871D4eC4DaE64f605db0f8a0B3D9ef928D64")
        };
    e.s(["POLYGON_USDCE_TOKEN", 0, g, "PUSD_ONRAMP_ABI", 0, [{
        name: "wrap",
        type: "function",
        inputs: [{
            name: "_asset",
            type: "address"
        }, {
            name: "_to",
            type: "address"
        }, {
            name: "_amount",
            type: "uint256"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }], "PUSD_TOKEN", 0, y, "VAULT_DEPOSITOR_ABI", 0, [{
        name: "deposit",
        type: "function",
        stateMutability: "nonpayable",
        inputs: [{
            name: "token",
            type: "address"
        }, {
            name: "vault",
            type: "address"
        }, {
            name: "callData",
            type: "bytes"
        }, {
            name: "minAmountOut",
            type: "uint256"
        }],
        outputs: [{
            name: "returnData",
            type: "bytes"
        }]
    }], "VAULT_DEPOSITOR_ADDRESS", 0, b, "VAULT_DEPOSITOR_AMOUNT_PLACEHOLDER", 0, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffdeadbeef n], 843783);
    var v = e.i(510954),
        x = e.i(57096),
        w = e.i(784521),
        _ = e.i(730474),
        C = e.i(322324),
        E = e.i(461327),
        S = e.i(165974);
    let A = (0, C.create)()((0, E.persist)((0, S.immer)((e, t) => ({
        stuckEoas: {},
        setStuck: (t, r) => {
            t && e(e => {
                e.stuckEoas[t.toLowerCase()] = r
            })
        },
        isStuck: e => !!e && !!t().stuckEoas[e.toLowerCase()]
    })), {
        name: "polymarket.store.stuck-safe-migration",
        version: 1,
        partialize: e => ({
            stuckEoas: e.stuckEoas
        })
    }));
    e.s(["useStuckSafeMigrationStore", 0, A], 848872);
    var I = e.i(721270),
        T = e.i(200036),
        k = e.i(999061),
        O = e.i(601550),
        R = e.i(318594),
        N = e.i(423708),
        M = e.i(246290),
        P = e.i(305457),
        D = e.i(306941),
        j = e.i(660006),
        L = e.i(53950),
        F = e.i(423582);
    let U = async e => {
        try {
            let t = (0, F.getRelayerClient)(e),
                r = await t.deployDepositWallet();
            if (!await (0, F.waitTillMined)(r)) return {
                status: 400,
                message: "Deploy not confirmed on-chain (relayer timed out before STATE_MINED)"
            };
            return {
                status: 200
            }
        } catch (e) {
            if ((0, D.isUserRejection)(e)) return {
                status: 401,
                message: e instanceof Error ? e.message : String(e)
            };
            return {
                status: 400,
                message: e instanceof Error ? e.message : String(e)
            }
        }
    };
    var $ = e.i(230097),
        z = e.i(56339),
        B = e.i(866674),
        q = e.i(631503);
    let W = "DEPOSIT_WALLET_NOT_DEPLOYED",
        Z = "STUCK_SAFE_LEGACY_FUNDS",
        V = "STUCK_SAFE_ZERO_BALANCE",
        K = "STUCK_SAFE_TRANSFER_NOT_CONFIRMED",
        H = (0, p.getAddress)("0x3c499c542cef5e3811e1192ce70d8cc03d5c3359");
    var G = e.i(399482),
        Q = e.i(333223);

    function J(e) {
        return e.setStuck
    }
    let Y = () => {
        let e = (0, s.useTranslations)(),
            h = (0, d.useToast)(),
            g = (0, _.useModalStore)(e => e.showDepositWalletMigrationModal),
            b = (0, _.useModalStore)(e => e.setShowDepositWalletMigrationModal),
            {
                baseAddress: C
            } = (0, w.useAccountContext)(["baseAddress"]),
            E = A(e => e.isStuck(C)),
            S = (() => {
                let e, t, r, n, a = (0, k.c)(11),
                    i = (0, P.useGoogleAnalytics)(),
                    o = (0, R.useQueryClient)(),
                    {
                        address: s
                    } = (0, M.useAccount)();
                a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                    chainId: m.MATIC_CONFIG.chainId
                }, a[0] = e) : e = a[0];
                let {
                    data: l
                } = (0, N.useWalletClient)(e);
                return a[1] !== s || a[2] !== i || a[3] !== o || a[4] !== l ? (t = async () => {
                    if (!s) throw Error(D.UNAUTHENTICATED);
                    let e = (0, I.getProxyAddress)(s, "depositWallet");
                    if (!l) throw i.trackEvent("stuck_safe_deploy_deposit_wallet", {
                        event_status: "error",
                        event_value: -1,
                        event_error_msg: D.UNAUTHENTICATED
                    }), L.logger.error("[stuck-safe-dw-deploy] failed", {
                        reason: "unauthenticated",
                        address: s,
                        depositWalletAddress: e
                    }), Error(D.UNAUTHENTICATED);
                    let t = await U(l);
                    if (401 === t.status) throw i.trackEvent("stuck_safe_deploy_deposit_wallet", {
                        event_status: "error",
                        event_value: t.status,
                        event_error_msg: t.message
                    }), L.logger.error("[stuck-safe-dw-deploy] failed", {
                        reason: "rejected_signature",
                        address: s,
                        depositWalletAddress: e,
                        errorMessage: t.message
                    }), Error(D.REJECTED_SIGNATURE);
                    if (400 === t.status) throw i.trackEvent("stuck_safe_deploy_deposit_wallet", {
                        event_status: "error",
                        event_value: t.status,
                        event_error_msg: t.message
                    }), L.logger.error("[stuck-safe-dw-deploy] failed", {
                        reason: t.message ? .includes("STATE_MINED") ? "not_mined" : "execution_reverted",
                        address: s,
                        depositWalletAddress: e,
                        errorMessage: t.message
                    }), Error(D.EXECUTION_REVERTED);
                    let r = v.queryKeys[x.QueryKey.Auth].depositWalletDeployed(e).queryKey;
                    return await o.invalidateQueries({
                        queryKey: r
                    }), o.setQueryData(r, !0), i.trackEvent("stuck_safe_deploy_deposit_wallet", {
                        event_status: "success",
                        event_value: t.status
                    }), L.logger.info("[stuck-safe-dw-deploy] succeeded", {
                        address: s,
                        depositWalletAddress: e
                    }), { ...t,
                        depositWalletAddress: e
                    }
                }, a[1] = s, a[2] = i, a[3] = o, a[4] = l, a[5] = t) : t = a[5], a[6] !== s ? (r = e => {
                    (0, j.handleError)(e, "useDeployDepositWalletForStuckUser", s)
                }, a[6] = s, a[7] = r) : r = a[7], a[8] !== t || a[9] !== r ? (n = {
                    mutationFn: t,
                    onError: r
                }, a[8] = t, a[9] = r, a[10] = n) : n = a[10], (0, O.useMutation)(n)
            })(),
            F = (() => {
                let {
                    address: e,
                    proxyAddress: t,
                    walletMode: r,
                    authenticationType: n
                } = (0, M.useAccount)(), {
                    sendTransaction: a
                } = (0, q.default)(), i = (0, R.useQueryClient)(), o = (0, l.useCallback)(async e => {
                    let t = (0, T.createChainAwarePublicClient)({
                        chainId: m.MATIC_CONFIG.chainId
                    });
                    if (!t) return !1;
                    try {
                        let r = await t.getCode({
                            address: e
                        });
                        return !!r && "0x" !== r
                    } catch (t) {
                        return L.logger.warn("[stuck-safe-dw-transfer] getCode preflight failed", {
                            dwAddress: e,
                            errorMessage: t instanceof Error ? t.message : String(t)
                        }), !1
                    }
                }, []), s = (0, l.useCallback)(async (e, t) => {
                    let r = (0, T.createChainAwarePublicClient)({
                        chainId: m.MATIC_CONFIG.chainId
                    });
                    return r ? await r.readContract({
                        address: e,
                        abi: B.erc20Abi,
                        functionName: "balanceOf",
                        args: [t]
                    }) : 0 n
                }, []);
                return (0, O.useMutation)({
                    mutationFn: async () => {
                        if (!e) throw Error("No connected EOA address");
                        if (!t || t === u.zeroAddress) throw Error("Missing source proxy address");
                        let l = (0, I.getProxyAddress)(e, "depositWallet"),
                            c = (0, q.getTransactionType)(r);
                        if (c === q.TransactionType.DepositWallet) {
                            L.logger.warn("[stuck-safe-dw-transfer] unexpected depositWallet mode for stuck user", {
                                address: e,
                                sourceProxyAddress: t,
                                depositWalletAddress: l,
                                walletMode: r,
                                authenticationType: n
                            });
                            let a = Error(W);
                            throw a.name = W, a
                        }
                        if (!await o(l)) {
                            let e = Error(W);
                            throw e.name = W, e
                        }
                        let [d, f, p] = await Promise.all([s(y.address, t), s(H, t), s(m.USDCE_ADDRESS, t)]);
                        if (f > 0 n || p > 0 n) {
                            L.logger.info("[stuck-safe-dw-transfer] legacy USDC/USDC.e funds detected in source proxy", {
                                sourceProxyAddress: t,
                                authenticationType: n,
                                walletMode: r,
                                nativeUsdc: f.toString(),
                                usdce: p.toString()
                            });
                            let e = Error(Z);
                            throw e.name = Z, e
                        }
                        if (0 n === d) {
                            L.logger.info("[stuck-safe-dw-transfer] zero pUSD balance in source proxy", {
                                sourceProxyAddress: t,
                                authenticationType: n,
                                walletMode: r,
                                depositWalletAddress: l
                            });
                            let e = Error(V);
                            throw e.name = V, e
                        }
                        let h = (0, z.encodeFunctionData)({
                            abi: B.erc20Abi,
                            functionName: "transfer",
                            args: [l, d]
                        });
                        L.logger.info("[stuck-safe-dw-transfer] dispatching transfer", {
                            sourceProxyAddress: t,
                            depositWalletAddress: l,
                            amount: d.toString(),
                            authenticationType: n,
                            walletMode: r,
                            transactionType: c
                        });
                        let g = await a(c, [{
                            to: y.address,
                            typeCode: $.CallType.Call,
                            value: "0",
                            data: h
                        }], 0, m.Network.Matic, 0, void 0, void 0, q.TransactionMetadata.Default.valueOf(), void 0);
                        if (!await g.wait()) {
                            L.logger.error("[stuck-safe-dw-transfer] transfer not confirmed (relayer timeout or failure)", {
                                sourceProxyAddress: t,
                                depositWalletAddress: l,
                                amount: d.toString(),
                                authenticationType: n,
                                walletMode: r,
                                transactionHash: "hash" in g ? g.hash : void 0,
                                transactionId: "transactionID" in g ? g.transactionID : void 0
                            });
                            let e = Error(K);
                            throw e.name = K, e
                        }
                        let b = await s(y.address, t);
                        if (b > 0 n) {
                            L.logger.error("[stuck-safe-dw-transfer] source proxy still holds pUSD after transfer", {
                                sourceProxyAddress: t,
                                depositWalletAddress: l,
                                authenticationType: n,
                                walletMode: r,
                                balanceBefore: d.toString(),
                                balanceAfter: b.toString()
                            });
                            let e = Error(K);
                            throw e.name = K, e
                        }
                        return await i.invalidateQueries({
                            queryKey: v.queryKeys[x.QueryKey.TokenBalance].token(t, y.address, m.MATIC_CONFIG.chainId).queryKey
                        }), L.logger.info("[stuck-safe-dw-transfer] succeeded", {
                            sourceProxyAddress: t,
                            depositWalletAddress: l,
                            amount: d.toString(),
                            authenticationType: n,
                            walletMode: r
                        }), {
                            amount: d,
                            from: t,
                            to: l
                        }
                    },
                    onError: e => {
                        e instanceof Error && (e.name === W || e.name === Z || e.name === V || e.name === K) || (0, j.handleError)(e, "useTransferSafeToDepositWallet", t)
                    }
                })
            })(),
            Y = (() => {
                let e, t, r, n = (0, k.c)(10),
                    a = (0, R.useQueryClient)(),
                    {
                        address: i
                    } = (0, M.useAccount)(),
                    {
                        getAccountProfile: o
                    } = (0, Q.default)(),
                    s = A(J);
                return n[0] !== i || n[1] !== o || n[2] !== a || n[3] !== s ? (e = async () => {
                    let e;
                    if (!i) throw Error("No connected EOA address");
                    let t = (0, I.getProxyAddress)(i, "depositWallet"),
                        r = await fetch("/api/account/migrate-deposit-wallet", {
                            method: "POST",
                            credentials: "same-origin",
                            headers: {
                                "Content-Type": "application/json"
                            },
                            body: JSON.stringify({})
                        });
                    try {
                        e = await r.json()
                    } catch {
                        e = void 0
                    }
                    if (!r.ok || !e ? .success || !e.proxyWallet) throw L.logger.error("[stuck-safe-dw-finalize] migrate api failed", {
                        address: i,
                        status: r.status,
                        body: e
                    }), Error(e ? .error || `Migration request failed (${r.status})`);
                    let n = (0, p.getAddress)(e.proxyWallet);
                    n.toLowerCase() !== t.toLowerCase() && L.logger.warn("[stuck-safe-dw-finalize] server returned unexpected DW address", {
                        address: i,
                        expectedDepositWalletAddress: t,
                        depositWalletAddress: n
                    }), s(i, !1);
                    try {
                        (0, G.createWalletCache)().wallets.clear()
                    } catch (e) {
                        L.logger.warn("[stuck-safe-dw-finalize] failed to clear wallet cache", {
                            errorMessage: e instanceof Error ? e.message : String(e)
                        })
                    }
                    await a.invalidateQueries({
                        queryKey: v.queryKeys[x.QueryKey.Account].profile().queryKey
                    });
                    try {
                        await o()
                    } catch (e) {
                        L.logger.warn("[stuck-safe-dw-finalize] profile refetch failed", {
                            errorMessage: e instanceof Error ? e.message : String(e)
                        })
                    }
                    return L.logger.info("[stuck-safe-dw-finalize] succeeded", {
                        address: i,
                        depositWalletAddress: n,
                        alreadyMigrated: e.alreadyMigrated
                    }), {
                        depositWalletAddress: n
                    }
                }, n[0] = i, n[1] = o, n[2] = a, n[3] = s, n[4] = e) : e = n[4], n[5] !== i ? (t = e => {
                    (0, j.handleError)(e, "useFinalizeDwMigration", i)
                }, n[5] = i, n[6] = t) : t = n[6], n[7] !== e || n[8] !== t ? (r = {
                    mutationFn: e,
                    onError: t
                }, n[7] = e, n[8] = t, n[9] = r) : r = n[9], (0, O.useMutation)(r)
            })(),
            [X, ee] = (0, l.useState)("idle"),
            [et, er] = (0, l.useState)(void 0),
            [en, ea] = (0, l.useState)(!1),
            ei = (0, l.useMemo)(() => {
                if (C) try {
                    return (0, I.getProxyAddress)(C, "depositWallet")
                } catch {
                    return
                }
            }, [C]),
            {
                data: eo = !1
            } = (0, a.useQuery)({
                queryKey: v.queryKeys[x.QueryKey.Auth].depositWalletDeployed(ei).queryKey,
                queryFn: async () => {
                    if (!ei || ei === u.zeroAddress) return !1;
                    let e = (0, T.createChainAwarePublicClient)({
                        chainId: m.MATIC_CONFIG.chainId
                    });
                    if (!e) return !1;
                    try {
                        let t = await e.getCode({
                            address: ei
                        });
                        return !!t && "0x" !== t
                    } catch {
                        return !1
                    }
                },
                enabled: !!g && !!ei && ei !== u.zeroAddress,
                staleTime: 0,
                refetchOnMount: "always",
                refetchOnWindowFocus: !0,
                meta: {
                    persist: !1
                }
            });
        (0, l.useEffect)(() => {
            g || (ee("idle"), er(void 0), S.reset(), F.reset(), Y.reset())
        }, [g]);
        let es = (0, l.useCallback)(() => {
                "legacyFunds" === X && b(!1)
            }, [b, X]),
            el = (0, l.useCallback)(async () => {
                if (ei) try {
                    await navigator.clipboard.writeText(ei), ea(!0), setTimeout(() => ea(!1), 1500)
                } catch {}
            }, [ei]),
            ec = (0, l.useCallback)(async () => {
                if (er(void 0), !eo) {
                    ee("deploying");
                    try {
                        await S.mutateAsync()
                    } catch (e) {
                        er(e instanceof Error ? e.message : String(e)), ee("idle");
                        return
                    }
                }
                ee("transferring");
                try {
                    await F.mutateAsync()
                } catch (t) {
                    if (t instanceof Error && t.name === V);
                    else if (t instanceof Error && t.name === W) {
                        h.info(new f.ToastBuilder().title(e("depositWalletMigration.toast.stillDeployingTitle")).description(e("depositWalletMigration.toast.stillDeploying"))), ee("idle");
                        return
                    } else if (t instanceof Error && t.name === Z) {
                        h.info(new f.ToastBuilder().title(e("depositWalletMigration.toast.legacyFundsTitle")).description(e("depositWalletMigration.toast.legacyFunds"))), ee("legacyFunds");
                        return
                    } else {
                        h.error(new f.ToastBuilder().title(e("depositWalletMigration.toast.transferNotConfirmedTitle"))), ee("idle");
                        return
                    }
                }
                ee("patching");
                try {
                    await Y.mutateAsync()
                } catch (e) {
                    er(e instanceof Error ? e.message : String(e)), ee("idle");
                    return
                }
                ee("done"), h.success(new f.ToastBuilder().title(e("depositWalletMigration.toast.migrationCompleteTitle")).description(e("depositWalletMigration.toast.migrationComplete"))), setTimeout(() => {
                    window.location.reload()
                }, 2e3)
            }, [eo, S, F, Y, e, h]),
            eu = (0, l.useMemo)(() => {
                switch (X) {
                    case "deploying":
                        return e("depositWalletMigration.migrate.deploying");
                    case "transferring":
                        return e("depositWalletMigration.migrate.transferring");
                    case "patching":
                        return e("depositWalletMigration.migrate.patching");
                    case "done":
                        return e("depositWalletMigration.migrate.done");
                    default:
                        return e("depositWalletMigration.migrate.cta")
                }
            }, [X, e]),
            ed = "deploying" === X || "transferring" === X || "patching" === X || "done" === X,
            ef = "legacyFunds" === X;
        return E || g ? (0, t.jsx)(n.Modal, {
            open: g,
            onOpenChange: e => {
                e || es()
            },
            children: (0, t.jsxs)(n.ModalContent, {
                className: "!max-w-md",
                onPointerDownOutside: e => e.preventDefault(),
                onInteractOutside: e => e.preventDefault(),
                onEscapeKeyDown: e => e.preventDefault(),
                children: [(0, t.jsx)(n.ModalHeader, {
                    showClose: ef,
                    onClose: es,
                    children: (0, t.jsx)(n.ModalTitle, {
                        children: e("depositWalletMigration.title")
                    })
                }), (0, t.jsx)(n.ModalDescription, {
                    children: e("depositWalletMigration.description")
                }), (0, t.jsxs)("div", {
                    className: "flex flex-col gap-3 pt-2",
                    children: [ei && (0, t.jsxs)("div", {
                        className: "bg-surface-secondary flex items-center justify-between gap-2 rounded-md px-3 py-2",
                        children: [(0, t.jsxs)("div", {
                            className: "flex min-w-0 flex-col",
                            children: [(0, t.jsx)("span", {
                                className: "text-text-tertiary text-[10px] uppercase tracking-wide",
                                children: e("depositWalletMigration.transferRow.destination")
                            }), (0, t.jsx)("span", {
                                className: "text-text-primary truncate font-mono text-xs",
                                children: ((e, t = 8, r = 6) => e.length <= t + r + 3 ? e : `${e.slice(0,t)}...${e.slice(-r)}`)(ei, 10, 8)
                            })]
                        }), (0, t.jsx)("button", {
                            type: "button",
                            onClick: el,
                            className: "text-text-secondary hover:text-text-primary flex h-7 w-7 items-center justify-center rounded transition-colors",
                            "aria-label": e("depositWalletMigration.transferRow.copyAddress"),
                            children: en ? (0, t.jsx)(i.IconCheckOutline18, {
                                size: 14
                            }) : (0, t.jsx)(o.IconCopyOutline18, {
                                size: 14
                            })
                        })]
                    }), F.data && F.data.amount > 0 n && (0, t.jsx)("div", {
                        className: "text-text-secondary text-xs",
                        children: e("depositWalletMigration.transferRow.transferredAmount", {
                            amount: (0, c.formatUnits)(F.data.amount, 6),
                            symbol: y.symbol
                        })
                    }), et && (0, t.jsx)("p", {
                        className: "text-xs text-red-500",
                        children: et
                    }), (0, t.jsx)(r.Button, {
                        variant: "default",
                        onClick: ec,
                        disabled: ed,
                        className: "w-full",
                        children: eu
                    })]
                })]
            })
        }) : null
    };
    e.s(["NonUsIpModal", () => et], 93259);
    var X = e.i(208956),
        ee = e.i(841231);

    function et() {
        let e = (0, s.useTranslations)(),
            a = (0, ee.useComplianceStore)(e => e.showNonUsIpModal),
            i = (0, ee.useComplianceStore)(e => e.setShowNonUsIpModal),
            o = (0, ee.useComplianceStore)(e => e.setRequiresTermsAcceptance),
            {
                accountProfile: c,
                getAccountProfile: u
            } = (0, Q.default)(),
            d = l.default.useCallback(async () => {
                let e = new Date().toISOString();
                try {
                    window.localStorage.setItem(ee.NON_US_IP_LS, "true")
                } catch {}
                if (c ? .profile) try {
                    await (0, Q.updateComplianceTimestamps)({
                        profileId: c.profile.toString(),
                        userId: c.userId,
                        termsAcceptedAt: e
                    }), await u()
                } catch (e) {
                    L.logger.error("[NonUsIpModal] Failed to persist termsAcceptedAt to gamma", {
                        error: e
                    })
                }
                o(!1), i(!1)
            }, [i, o, c ? .profile, u]);
        return (0, t.jsx)(n.Modal, {
            open: a,
            onOpenChange: i,
            size: "sm",
            children: (0, t.jsxs)(n.ModalContent, {
                onEscapeKeyDown: e => e.preventDefault(),
                onPointerDownOutside: e => e.preventDefault(),
                onInteractOutside: e => e.preventDefault(),
                children: [(0, t.jsx)(n.ModalHeader, {
                    showClose: !1,
                    children: (0, t.jsx)(n.ModalTitle, {
                        children: e("modals.nonUsIp.title")
                    })
                }), (0, t.jsxs)(n.ModalDescription, {
                    children: [e("modals.nonUsIp.descriptionBefore"), " ", (0, t.jsx)(X.default, {
                        href: "/tos",
                        target: "_blank",
                        rel: "noopener noreferrer",
                        children: e("modals.viewOnlyMode.termsOfUse")
                    }), " ", e("modals.nonUsIp.descriptionAfter")]
                }), (0, t.jsxs)(n.ModalFooter, {
                    children: [(0, t.jsx)(r.Button, {
                        variant: "outline",
                        onClick: () => i(!1),
                        children: e("modals.cancel")
                    }), (0, t.jsx)(r.Button, {
                        onClick: d,
                        children: e("modals.nonUsIp.accept")
                    })]
                })]
            })
        })
    }
    var er = e.i(149534);
    let en = ({
            strokeWidth: e = 1.5,
            ...t
        }) => l.default.createElement(er.Icon, {
            size: "18px",
            ...t
        }, l.default.createElement("line", {
            x1: "5.75",
            y1: "6.75",
            x2: "7.75",
            y2: "6.75",
            fill: "none",
            stroke: "currentColor",
            strokeLinecap: "round",
            strokeLinejoin: "round",
            strokeWidth: e,
            "data-color": "color-2"
        }), l.default.createElement("line", {
            x1: "5.75",
            y1: "9.75",
            x2: "12.25",
            y2: "9.75",
            fill: "none",
            stroke: "currentColor",
            strokeLinecap: "round",
            strokeLinejoin: "round",
            strokeWidth: e,
            "data-color": "color-2"
        }), l.default.createElement("line", {
            x1: "5.75",
            y1: "12.75",
            x2: "12.25",
            y2: "12.75",
            fill: "none",
            stroke: "currentColor",
            strokeLinecap: "round",
            strokeLinejoin: "round",
            strokeWidth: e,
            "data-color": "color-2"
        }), l.default.createElement("path", {
            d: "M2.75,14.25V3.75c0-1.105,.895-2,2-2h5.586c.265,0,.52,.105,.707,.293l3.914,3.914c.188,.188,.293,.442,.293,.707v7.586c0,1.105-.895,2-2,2H4.75c-1.105,0-2-.895-2-2Z",
            fill: "none",
            stroke: "currentColor",
            strokeLinecap: "round",
            strokeLinejoin: "round",
            strokeWidth: e
        }), l.default.createElement("path", {
            d: "M15.16,6.25h-3.41c-.552,0-1-.448-1-1V1.852",
            fill: "none",
            stroke: "currentColor",
            strokeLinecap: "round",
            strokeLinejoin: "round",
            strokeWidth: e
        })),
        ea = ({
            strokeWidth: e = 1.5,
            ...t
        }) => l.default.createElement(er.Icon, {
            size: "18px",
            ...t
        }, l.default.createElement("circle", {
            cx: "9",
            cy: "6.5",
            r: "2",
            fill: "none",
            stroke: "currentColor",
            strokeLinecap: "round",
            strokeLinejoin: "round",
            strokeWidth: e,
            "data-color": "color-2"
        }), l.default.createElement("path", {
            d: "M5.402,13.25c.649-1.332,2.016-2.25,3.598-2.25s2.949,.918,3.598,2.25",
            fill: "none",
            stroke: "currentColor",
            strokeLinecap: "round",
            strokeLinejoin: "round",
            strokeWidth: e,
            "data-color": "color-2"
        }), l.default.createElement("path", {
            d: "M15.75,11.75v2c0,1.105-.895,2-2,2h-2",
            fill: "none",
            stroke: "currentColor",
            strokeLinecap: "round",
            strokeLinejoin: "round",
            strokeWidth: e
        }), l.default.createElement("path", {
            d: "M6.25,15.75h-2c-1.105,0-2-.895-2-2v-2",
            fill: "none",
            stroke: "currentColor",
            strokeLinecap: "round",
            strokeLinejoin: "round",
            strokeWidth: e
        }), l.default.createElement("path", {
            d: "M2.25,6.25v-2c0-1.105,.895-2,2-2h2",
            fill: "none",
            stroke: "currentColor",
            strokeLinecap: "round",
            strokeLinejoin: "round",
            strokeWidth: e
        }), l.default.createElement("path", {
            d: "M11.75,2.25h2c1.105,0,2,.895,2,2v2",
            fill: "none",
            stroke: "currentColor",
            strokeLinecap: "round",
            strokeLinejoin: "round",
            strokeWidth: e
        }));

    function ei(e) {
        return e.setShowProofOfResidenceModal
    }

    function eo(e) {
        return e.showProofOfResidenceModal
    }
    e.s(["IconUserFocusOutline18", 0, ea], 189595), e.s(["ProofOfResidenceModal", 0, function() {
        let e, a, i, o, l, c, u, d, f, p, h, m, y, g, b, v, x, w, _, C, E, S, A, I = (0, k.c)(53),
            T = (0, s.useTranslations)(),
            O = (0, ee.useComplianceStore)(eo),
            R = (0, ee.useComplianceStore)(ei);
        return I[0] !== T ? (e = T("modals.proofOfResidence.title"), I[0] = T, I[1] = e) : e = I[1], I[2] !== e ? (a = (0, t.jsx)(n.ModalHeader, {
            children: (0, t.jsx)(n.ModalTitle, {
                children: e
            })
        }), I[2] = e, I[3] = a) : a = I[3], I[4] !== T ? (i = T("modals.proofOfResidence.description"), I[4] = T, I[5] = i) : i = I[5], I[6] !== i ? (o = (0, t.jsx)(n.ModalDescription, {
            children: i
        }), I[6] = i, I[7] = o) : o = I[7], I[8] === Symbol.for("react.memo_cache_sentinel") ? (l = (0, t.jsx)(ea, {
            className: "size-4 shrink-0 mt-0.5 text-text-secondary"
        }), I[8] = l) : l = I[8], I[9] !== T ? (c = T("modals.proofOfResidence.formOfId"), I[9] = T, I[10] = c) : c = I[10], I[11] !== c ? (u = (0, t.jsx)("span", {
            className: "font-medium text-text-primary",
            children: c
        }), I[11] = c, I[12] = u) : u = I[12], I[13] !== T ? (d = T("modals.proofOfResidence.formOfIdDetails"), I[13] = T, I[14] = d) : d = I[14], I[15] !== u || I[16] !== d ? (f = (0, t.jsxs)("div", {
            className: "flex items-start gap-2",
            children: [l, (0, t.jsxs)("p", {
                className: "text-sm",
                children: [u, " ", d]
            })]
        }), I[15] = u, I[16] = d, I[17] = f) : f = I[17], I[18] === Symbol.for("react.memo_cache_sentinel") ? (p = (0, t.jsx)(en, {
            className: "size-4 shrink-0 mt-0.5 text-text-secondary"
        }), I[18] = p) : p = I[18], I[19] !== T ? (h = T("modals.proofOfResidence.proofOfResidence"), I[19] = T, I[20] = h) : h = I[20], I[21] !== h ? (m = (0, t.jsx)("span", {
            className: "font-medium text-text-primary",
            children: h
        }), I[21] = h, I[22] = m) : m = I[22], I[23] !== T ? (y = T("modals.proofOfResidence.proofOfResidenceDetails"), I[23] = T, I[24] = y) : y = I[24], I[25] !== T ? (g = T("modals.proofOfResidence.restrictedRegionsDocsLead"), I[25] = T, I[26] = g) : g = I[26], I[27] === Symbol.for("react.memo_cache_sentinel") ? (b = (0, t.jsx)("a", {
            href: "https://polymarket.com/tos",
            target: "_blank",
            rel: "noopener noreferrer",
            className: "text-button-link-text hover:text-button-link-text-hover hover:underline",
            children: "https://polymarket.com/tos"
        }), I[27] = b) : b = I[27], I[28] !== m || I[29] !== y || I[30] !== g ? (v = (0, t.jsxs)("div", {
            className: "flex items-start gap-2",
            children: [p, (0, t.jsxs)("p", {
                className: "text-sm",
                children: [m, " ", y, " ", g, b]
            })]
        }), I[28] = m, I[29] = y, I[30] = g, I[31] = v) : v = I[31], I[32] !== v || I[33] !== f ? (x = (0, t.jsxs)("div", {
            className: "flex flex-col gap-3",
            children: [f, v]
        }), I[32] = v, I[33] = f, I[34] = x) : x = I[34], I[35] !== T ? (w = T("modals.proofOfResidence.certificationNotice"), I[35] = T, I[36] = w) : w = I[36], I[37] !== w ? (_ = (0, t.jsx)(n.ModalDescription, {
            children: w
        }), I[37] = w, I[38] = _) : _ = I[38], I[39] !== T ? (C = T("modals.proofOfResidence.completeForm"), I[39] = T, I[40] = C) : C = I[40], I[41] !== C ? (E = (0, t.jsx)(n.ModalFooter, {
            children: (0, t.jsx)(r.Button, {
                asChild: !0,
                children: (0, t.jsx)("a", {
                    href: "https://forms.gle/iHEdk342N3CfgGqu8",
                    target: "_blank",
                    rel: "noopener noreferrer",
                    children: C
                })
            })
        }), I[41] = C, I[42] = E) : E = I[42], I[43] !== a || I[44] !== x || I[45] !== _ || I[46] !== E || I[47] !== o ? (S = (0, t.jsxs)(n.ModalContent, {
            children: [a, o, x, _, E]
        }), I[43] = a, I[44] = x, I[45] = _, I[46] = E, I[47] = o, I[48] = S) : S = I[48], I[49] !== O || I[50] !== R || I[51] !== S ? (A = (0, t.jsx)(n.Modal, {
            open: O,
            onOpenChange: R,
            size: "sm",
            children: S
        }), I[49] = O, I[50] = R, I[51] = S, I[52] = A) : A = I[52], A
    }], 757613);
    var es = e.i(213264);
    e.s(["useMigrationStore", () => es.default], 762769), e.s(["ViewOnlyModeModal", () => ep], 911716);
    var el = e.i(684686);
    let ec = ["0x39ea25c016a3e90e8e72dbbe215a1ab62429f66f", "0xa614588cbf7a0ba6b2d82d674cb237e6e35cffc4", "0x0a11c86b56f18decb25c1ba4c2be07a1a1fc3794", "0xbfa034a4fd3be5d5611feff507799426f23df65d", "0x428ab2ba90eba0a4be7af34c9ac451ab061ac010", "0x2cab3defed9cc52827ecf37536a131c7da6cd5aa", "0x8462e77e0c0068d603ffebb7f21e579f0119f1fc", "0xcb328ec728b1c664e352cc0b7407dfcaa7e84dfb", "0xe5dcada7985d5907544b119a92e8d7f395dcfd19", "0x07ae8551be970cb1cca11dd7a11f47ae82e70e67", "0x3eb9845b9c8f835ad130456f8dab6aef79af5272", "0x760dce7ea6e8ba224bffbeb8a7ff4dd1ef122bff", "0x70e30cb0f5845fd04bb462931b3af98425d30deb", "0x555ce236c0220695b68341bc48c68d52210cc35b", "0xe86f3aaa57f63b2afeca68178182a91bc3909962", "0xb1253378536231741b001a711ee66ab5e1f218ca", "0x131f4fe17d44d236593e9f800f0a1f906a19e7ad", "0xa61377ad01e26ca5a370bf3b4e3eb52165619e13", "0x41ee28ee05341e7fdddc8d433ba66054cd302ca1", "0xcb39c5b0db9c5b6bd1d9273dccc2f98f532a8bc6", "0x3be3c0530cfaf944a9e004288a654f424c717c88", "0x8c70623f0488295f6f39fe8bcbe13f0760771baf", "0x799319c3c7f25f763ed03f307d3a025700e5f1b0", "0xd65448affe1475f101378a744a62c00f04cf50d6", "0xe8fd9718eff1b9e7d805906640609eaa9678bd71", "0x442e71efefa947cdf426e8cc92e58ad84bbec85e", "0xf791da446d04282f921f38fbf954ad5caee899a3", "0x900556716d63c6370b8dd9c43fb6703d25e87a72", "0xa1fd6676e6e404f6dc86e2947f2663bd6727c277", "0x2a410f11a6f520398447bf423dcedd25dfd3a568", "0xddc58f7839a71787eb94211bc922e0ae2bfb5501", "0x9abb2ec2c4483fa70db2410a92d1ada9d1c12840", "0x0d09adbae5864468b56e58de46ce08b5b3b3b9d5", "0x3d9cf15404ec9e1a40b7678b92f59ffee931a35c", "0x17f52a50227ea7aa6042eaae44c84a9a9d59d092", "0xe251e71647f9cf551210bb2358a68d0dbdeca20b", "0xc44730c6e22f7cff397e56d145aeb9e43b2158f8", "0xd0615721936478e5963d1422d622a10d288770f5", "0xb949558a617bc970929a37c516716b6ef2df5560", "0x60cf8d5b6d706edf50201e8e496057ced55ca226", "0xb560058c5542311fda18ac596eb9ebf6450437e7", "0x639a36c4ea3895f46eb4c92a50ffcee75fdbda64", "0xa03b7ed82639e7a1aef7c7f7e214c8abdaae86aa", "0x615baa9dd5c8eed0d3a800d6835df07e453db47e", "0x08b00ceee2fb66029b53d76110b19eeaabfd1e65", "0x2be6e0b0b1f2c0432887163d229cc00a2991037b", "0x3470798a68ccc4edf32b01c076550620ba66d8cf", "0x0094e73369f6508d53f4c71024ed93993c807430", "0xbdfa4f4492dd7b7cf211209c4791af8d52bf5c50", "0xb0fa34c866e1e1e7030820b4f846bb58d6f75b04", "0x2e6ad265d7a63ebea4f877b78f65b7512c63eacd", "0x619489245089649412478e5018a84068026f40c2", "0x6bd9abad2fb1d4b8292ed2d8d7cb0610a9cd1c0f", "0x8d7b2b74ad866c0e1958bcabcdffaa9bec4096e1", "0xf9a799bc71224831d7aef9859cc93a65d2345039", "0xf0675af76cc32542239c6fb3d1ddbfd881b98e47", "0x2fc617e933a52713247ce25730f6695920b3befe", "0x24aee57bee69d076fedec0f6396dcc011d2daeb4", "0x8148808562db1a636ebf465d74d8aed81917814b", "0x0d24f692c05036602076b3f51242b5a34c55ee38", "0x82ca345c167bdcad56fbedc7cc85a488885bdadc", "0x94465a1ea992a4e1a37fbce8fc2f687156b8b79f", "0xd5c08681719445a5fdce2bda98b341a49050d821", "0x65fe89a480bdb998f4116daf2a9360632554092c", "0x019d0706d65c4768ec8081ed7ce41f59eef9b86c", "0xe06bc5fcfd0e1d7521edc0dc6766b2daf367e769", "0xb83a6475422d74ae1695caa567b443ae0477eabf", "0xb052db7a004b7ca9f274e2d065a3477e7e059319", "0x89fcd53f450cfaca21611c4f12affc3346852777", "0xe32b988ef4a5bdd6ba97fd7eb56f6e9eb702de7f", "0x5e809a85aa182a9921edd10a4163745bb3e36284", "0x432dcbda06e8b296ca29705572d7cb6315ed8bed", "0xcd0d4cdb238eec15fcf4ff9d13d5a59051e507d7", "0x35d5a50378ef756e03d53c93b84f480c48fd3b60", "0xae74d4af5310170f8b2c0227b0c8ca70c8e2c78f", "0x717974d9067fbc31b1f56673d6451a85a5e6c6be", "0xb25bd866e0e3830ac96d620cc1e11c2f3a43f56e", "0x63a391b7185facf0a8eab560e5701a318a60d2a2", "0x0e386c1d4e310713758a885d8f5d7d15868c1215", "0xdcd408ed325760640a44cb3bbae7c5380d217e4d", "0xfb40932271fc9db9dbf048e80697e2da4aa57250", "0x46e6651cd50e1a0556a9d689dc46b3c51419b03a", "0x57933aad42da25703cf8bb86de611d2bcce038d6", "0x39ad3c18e569c16f86eca31f6eded16eba506301", "0x009905bf008cca637185eeafe8f51bb56dd2aca7", "0x89266ad57b0745e7b612f056528c0d34ef941e47", "0x97a6b2f935b8f0bd61675a0d1e90afd39651c205", "0x3f8e41ba3867ae0c92a916b6ab909e34d243f0de", "0xbb13e2852d79ba1c58d001ddd245893928b213a4", "0xc62785b58724d744b843e479d76d47897e61ca7e", "0x1c034aa33c5a1bef0a741ca0761379cf982ede39", "0x313a83cdfc75f6d1aafa739ed1acaffd45103b73", "0x3625b26b0e08f80f722610cec4139ade86c4ae9b", "0x3b22621a2b0e1f8dd3056975efc2150d5fbee980", "0x65fcdde3af3859bbf7f93f02b6deb5f1287c0a5d", "0xc1e42f862d202b4a0ed552c1145735ee088f6ccf", "0x9c24bf4f2fdbaa70aee2c90582383d10d95d26fc", "0xe448f9a1f7e0174514420bd48f3d79a39aa1d00e", "0x641fb555527b9108a1f58ea24e0c04ff86c4ed0d", "0xac7e04b9b3757cd94eaeec4abaa5b754ec2c0f88", "0x161e720f6fe46a142acada378c4a555fb9e47335", "0x3e9395b6fddaeeec6cbe22ee642be0e9eddc0f6c", "0x2b30deb59bb2271f30ef4552cd21bfd32a5c263e", "0x2a03fa477ee8ef71320209453d8a828f427b6a6d", "0xd40cbc216c642e958be777d4f230102a5d4492a6", "0x758be77a3ee14e7193730560daa07dd3fcbfd200", "0x71ed106ab6357cc7bc4cef1e94d03972359edf51", "0x2a812626c2838dccb53fde027fd4d6fc3f6d7ce7", "0x4e29c9f2eddadf3197ed62ad6a7a2b28ccb3dc97", "0x70ffb1f081dd6184bf706094f27db048e1836ae2", "0xae1704ea3747e4861fb7283a9eaa8c70b925295c", "0xe7ee701bdaa5b446c985bfecc8933f3e5eeed867", "0xd35f913034885b3219a4e54e9cf62df6b548f0f6", "0xefc464eb7cb2d5477bffa11b2b942610e985909e", "0x2d3bb1d687da64ed0704b4cf7d52742a04a6fac6", "0x25fd363c7fbb23dedb31e84e9ac1f3a093e6e508", "0x302afb89449b8ddac58993f72072e6ec5ac3f720", "0xe214f4936dcd3413ce9b5f49a3f06aab64a686b4", "0x0bacbf192159f9162ac692a3152c666998951e87", "0x3ee6ed7ee96a5901426963b8a756dc7ca33c6191", "0xec3124f5d4161c3db98cc0c31b3ff5a1e3472a25", "0x72a519bfdc922be98db0d6b7f1d2a5a42359fdd4", "0x925fe9df719925c3864c4c17bf7f3fee8047c938", "0x92a4f58009df9eac5f2af6d05977683639f0060e", "0xc8d5660dbbbcac150c5a9969ac6334c0ba06d05c", "0x52539ccdb0ff2fa0528f41ea6c3628e92d96d812", "0x03f34816b0260e465440559afb624e902b61a54e", "0x519db92f9db437a75a6cc1733e451ae0bd39b0ac", "0xd5ce0720af07a4d31c4b11d85aa6fa3b1c4b3d63", "0x1d5e65a087ebc3d03a294412e46ce5d6882969f4", "0x6d718cb31490f76fca4bd878fef70325003d52c1", "0x66258457350213863edf4f59c8fc7bcd5cdfae53", "0x71cf30ee4ffea27f8239c09497f4f33786e674f1", "0xf748879edbe8cca140940788163d7be4d2a2e46a", "0x852dc1c875f0117ea0808610010893e4c576b6a9", "0xdc7412df4167429382aeaf45cd329ad608280cfb", "0xfa9d5d77c05d8d759921cd7177ee1489ff199f6f", "0xf2463396c3a4d8c48f01effb11e8f6217c16879d", "0x85c7d244c6057d42c770ad85ae198fc5f47957fc", "0x15551b41e61f017c89bfdc2d073881b6e3f9af97", "0x51a7db10b6181459860d178c5d6788c54cf01efc", "0xa8cbf4200595efcd94b7526d04deafe0f284af2d", "0x89c6c5566c7c3963d2af2143d17b28d9b5725c07", "0x5446021ff557dd9abe2845647afa251aec147811", "0xae46766f5332463d3a27ee9d7bfe7ebeb25c91f6", "0xdb2b1dce4fff3ad180627020d7ebeae17977d7c1", "0xfb9361b36cb84e83190dbb0683f3822d5630092c", "0xb976dbfcbaeca1a31e570780abd624b8708f6d4a", "0x213877b60dc8b1d55a743557760e8dabf7fe167a", "0x0ee951bc9d1b10afbf073bf246cce7d14346f652", "0xaf8ae6955d07776ab690e565ba6fbc79b8de3a5d", "0x2b28c08c79b86f1bb874476f5ac5e4e131d05be2", "0x2cef036e948859eb7383386eb589ebd8480b6ff1", "0x753ff86dac8069ea3b5ad3b21fb0b405b6f2b0af", "0x2ff339a7a3d310d0fa950aa36459ef31610f4cf0", "0xe4eb310389c6d68483bc3373f455a452ad193c75", "0x76b4b27b47f211448964ed2cf92f731412602700", "0x8358e0f54179ec00736411244489c60c0c14436b", "0x188c4a07f7ee433b3106f0359ac5c5e9cdb4d4a7", "0x0af3ca86aedb50220c04db37ce5a79b6d17eca4d", "0xa9f710e0711122b95301ba81b860cb5fbdff0b45", "0x6bcfb1f96a3d270f00deab39fd50e78096576113"].map(e => e.toLowerCase()),
        eu = { ...(0, el.getDefaultPermissions)(!0),
            canSell: !0,
            canWithdraw: !0,
            canMerge: !0,
            canRedeem: !0,
            canRemoveLiquidity: !0,
            canCreateApiKey: !0,
            canApprove: !0,
            canCancelOrders: !0
        },
        ed = [{
            code: "AU",
            name: "Australia"
        }, {
            code: "BE",
            name: "Belgium"
        }, {
            code: "BY",
            name: "Belarus"
        }, {
            code: "BI",
            name: "Burundi"
        }, {
            code: "CF",
            name: "Central African Republic"
        }, {
            code: "CD",
            name: "Congo (Kinshasa)"
        }, {
            code: "CU",
            name: "Cuba"
        }, {
            code: "DE",
            name: "Germany"
        }, {
            code: "ET",
            name: "Ethiopia"
        }, {
            code: "FR",
            name: "France"
        }, {
            code: "GB",
            name: "United Kingdom"
        }, {
            code: "IR",
            name: "Iran"
        }, {
            code: "IQ",
            name: "Iraq"
        }, {
            code: "IT",
            name: "Italy"
        }, {
            code: "JP",
            name: "Japan"
        }, {
            code: "KP",
            name: "North Korea"
        }, {
            code: "LB",
            name: "Lebanon"
        }, {
            code: "LY",
            name: "Libya"
        }, {
            code: "MM",
            name: "Myanmar"
        }, {
            code: "NI",
            name: "Nicaragua"
        }, {
            code: "PL",
            name: "Poland"
        }, {
            code: "RU",
            name: "Russia"
        }, {
            code: "SG",
            name: "Singapore"
        }, {
            code: "SO",
            name: "Somalia"
        }, {
            code: "SS",
            name: "South Sudan"
        }, {
            code: "SD",
            name: "Sudan"
        }, {
            code: "SY",
            name: "Syria"
        }, {
            code: "TH",
            name: "Thailand"
        }, {
            code: "TW",
            name: "Taiwan"
        }, {
            code: "UM",
            name: "United States Minor Outlying Islands"
        }, {
            code: "US",
            name: "United States"
        }, {
            code: "VE",
            name: "Venezuela"
        }, {
            code: "YE",
            name: "Yemen"
        }, {
            code: "ZW",
            name: "Zimbabwe"
        }, {
            code: "NL",
            name: "Netherlands"
        }],
        ef = [{
            country: "CA",
            countryName: "Canada",
            region: "Ontario",
            regionCode: "ON"
        }, {
            country: "UA",
            countryName: "Ukraine",
            region: "Crimea",
            regionCode: "43"
        }, {
            country: "UA",
            countryName: "Ukraine",
            region: "Donetsk",
            regionCode: "14"
        }, {
            country: "UA",
            countryName: "Ukraine",
            region: "Luhansk",
            regionCode: "09"
        }];
    e.s(["GEOBLOCKED_COUNTRIES", 0, ed, "GEOBLOCKED_REGIONS", 0, ef, "META_HOMEPAGE_OG_TITLE", 0, "Polymarket | The World's Largest Prediction Market™", "modifyPermissionsToMatchCloseOnlyBlockAndAllowLists", 0, (e, t, r = !1) => {
        if (!e) return (0, el.getDefaultPermissions)(!0);
        if (r) return eu;
        let n = e.toLowerCase(),
            a = (() => {
                let {
                    walletLists: e
                } = el.useGeoStore.getState();
                return {
                    block: new Set([...ec, ...e ? .block ? ? []]),
                    closeOnly: new Set(e ? .closeOnly ? ? []),
                    allow: new Set(e ? .allow ? ? [])
                }
            })();
        if (t.canBuy) {
            if (a.block.has(n)) return (0, el.getDefaultPermissions)(!0);
            if (a.closeOnly.has(n)) return eu
        } else if (a.allow.has(n)) return (0, el.getDefaultPermissions)(!1);
        else if (a.block.has(n)) return (0, el.getDefaultPermissions)(!0);
        return t
    }], 799471);
    let ep = () => {
        let e = (0, s.useTranslations)(),
            a = (0, ee.useComplianceStore)(e => e.showUsIpModal),
            i = (0, ee.useComplianceStore)(e => e.setShowUsIpModal),
            {
                accountProfile: o,
                getAccountProfile: c
            } = (0, Q.default)(),
            u = l.default.useMemo(() => [...ed.map(e => e.name), ...ef.map(e => e.region)].sort(), []),
            d = l.default.useCallback(async () => {
                let e = new Date().toISOString();
                try {
                    window.localStorage.setItem(ee.US_IP_VIEW_ONLY_LS, "true")
                } catch {}
                if (o ? .profile) try {
                    await (0, Q.updateComplianceTimestamps)({
                        profileId: o.profile.toString(),
                        userId: o.userId,
                        viewOnlyAcknowledgedAt: e
                    }), await c()
                } catch (e) {
                    L.logger.error("[ViewOnlyModeModal] Failed to persist viewOnlyAcknowledgedAt to gamma", {
                        error: e
                    })
                }
                i(!1)
            }, [i, o ? .profile, o ? .userId, c]);
        return (0, t.jsx)(n.Modal, {
            open: a,
            onOpenChange: i,
            size: "sm",
            children: (0, t.jsxs)(n.ModalContent, {
                onEscapeKeyDown: e => e.preventDefault(),
                onPointerDownOutside: e => e.preventDefault(),
                onInteractOutside: e => e.preventDefault(),
                children: [(0, t.jsx)(n.ModalHeader, {
                    children: (0, t.jsx)(n.ModalTitle, {
                        children: e("modals.viewOnlyMode.title")
                    })
                }), (0, t.jsxs)(n.ModalDescription, {
                    children: [e("modals.viewOnlyMode.descriptionBeforeLink"), " ", (0, t.jsx)(X.default, {
                        href: "/tos",
                        target: "_blank",
                        rel: "noopener noreferrer",
                        children: e("modals.viewOnlyMode.termsOfUse")
                    })]
                }), (0, t.jsxs)("p", {
                    className: "text-xs text-text-tertiary",
                    children: [e("modals.viewOnlyMode.blockedRegions"), " ", u.join(", ")]
                }), (0, t.jsx)(n.ModalFooter, {
                    children: (0, t.jsx)(r.Button, {
                        onClick: d,
                        children: e("modals.viewOnlyMode.gotIt")
                    })
                })]
            })
        })
    };
    e.s(["ComplianceEffects", () => ey], 304826);
    var eh = e.i(863828),
        em = e.i(759926);

    function ey() {
        let e, t, r, n, a, i, o, s, c, u, d = (0, k.c)(41),
            {
                accountProfile: f
            } = (0, Q.default)(),
            p = (0, el.useGeoStore)(eT),
            h = (0, el.useGeoStore)(eI),
            m = (0, el.useGeoStore)(eA),
            y = (0, el.useGeoStore)(eS),
            g = (0, el.useGeoStore)(eE),
            b = (0, el.useGeoStore)(eC),
            {
                open: v
            } = (0, eh.useSiwx)(),
            x = (0, ee.useComplianceStore)(e_),
            w = (0, ee.useComplianceStore)(ew),
            _ = (0, ee.useComplianceStore)(ex),
            C = (0, ee.useComplianceStore)(ev),
            E = (0, ee.useComplianceStore)(eb),
            S = (0, ee.useComplianceStore)(eg),
            A = l.default.useRef(!1),
            I = l.default.useRef(!1),
            [T, O] = l.default.useState(!1),
            [R, N] = l.default.useState(!1),
            [M, P] = l.default.useState(!1);
        d[0] === Symbol.for("react.memo_cache_sentinel") ? (e = () => {
            N(!!window.localStorage.getItem(ee.NON_US_IP_LS)), P(!!window.localStorage.getItem(ee.US_IP_VIEW_ONLY_LS))
        }, t = [], d[0] = e, d[1] = t) : (e = d[0], t = d[1]), l.default.useEffect(e, t);
        let D = !!f ? .termsAcceptedAt || R,
            j = !!f ? .viewOnlyAcknowledgedAt || M;
        d[2] !== D || d[3] !== w || d[4] !== x ? (r = () => {
            x(!D), w(!0)
        }, n = [D, x, w], d[2] = D, d[3] = w, d[4] = x, d[5] = r, d[6] = n) : (r = d[5], n = d[6]), l.default.useEffect(r, n), d[7] !== f || d[8] !== _ ? (a = () => {
            window.localStorage.getItem(ee.PROOF_OF_RESIDENCE_LS) && (I.current = !0, O(!0)), f && !I.current && (I.current = !0, f.isCertReq && (window.localStorage.setItem(ee.PROOF_OF_RESIDENCE_LS, "true"), _(!0)), O(!0))
        }, i = [f, _], d[7] = f, d[8] = _, d[9] = a, d[10] = i) : (a = d[9], i = d[10]), l.default.useEffect(a, i), d[11] === Symbol.for("react.memo_cache_sentinel") ? (o = () => {
            P(!!window.localStorage.getItem(ee.US_IP_VIEW_ONLY_LS))
        }, d[11] = o) : o = d[11], d[12] !== S ? (s = [S], d[12] = S, d[13] = s) : s = d[13], l.default.useEffect(o, s), d[14] !== f || d[15] !== T || d[16] !== j || d[17] !== p || d[18] !== b || d[19] !== m || d[20] !== g || d[21] !== v || d[22] !== y || d[23] !== h || d[24] !== C || d[25] !== E ? (c = () => {
            if (p && f ? .address && !v && T && !A.current) {
                if (E) return;
                let e = !!f ? .profileCreationTime && Date.now() - f.profileCreationTime > 864e5;
                if (j || e || !(0, em.shouldShowViewOnly)({
                        isUsa: h,
                        isFrance: m,
                        isUk: y,
                        isOntario: g,
                        isCloseOnlyCountry: b
                    })) {
                    A.current = !0;
                    return
                }
                A.current = !0, C(!0)
            }
        }, d[14] = f, d[15] = T, d[16] = j, d[17] = p, d[18] = b, d[19] = m, d[20] = g, d[21] = v, d[22] = y, d[23] = h, d[24] = C, d[25] = E, d[26] = c) : c = d[26];
        let L = f ? .address,
            F = f ? .profileCreationTime;
        return d[27] !== T || d[28] !== j || d[29] !== p || d[30] !== b || d[31] !== m || d[32] !== g || d[33] !== v || d[34] !== y || d[35] !== h || d[36] !== C || d[37] !== E || d[38] !== F || d[39] !== L ? (u = [T, p, h, m, y, g, b, v, L, F, j, E, C], d[27] = T, d[28] = j, d[29] = p, d[30] = b, d[31] = m, d[32] = g, d[33] = v, d[34] = y, d[35] = h, d[36] = C, d[37] = E, d[38] = F, d[39] = L, d[40] = u) : u = d[40], l.default.useEffect(c, u), null
    }

    function eg(e) {
        return e.showUsIpModal
    }

    function eb(e) {
        return e.showProofOfResidenceModal
    }

    function ev(e) {
        return e.setShowUsIpModal
    }

    function ex(e) {
        return e.setShowProofOfResidenceModal
    }

    function ew(e) {
        return e.setHasSyncedTermsAcceptance
    }

    function e_(e) {
        return e.setRequiresTermsAcceptance
    }

    function eC(e) {
        return e.isCloseOnlyCountry
    }

    function eE(e) {
        return e.isOntario
    }

    function eS(e) {
        return e.isUk
    }

    function eA(e) {
        return e.isFrance
    }

    function eI(e) {
        return e.isUsa
    }

    function eT(e) {
        return e.hasFetchedLocation
    }
}, 462787, e => {
    "use strict";
    var t, r = e.i(416340);
    let n = (t = r.useEffect, function(e, n) {
        var a = (0, r.useRef)(!1);
        t(function() {
            return function() {
                a.current = !1
            }
        }, []), t(function() {
            if (a.current) return e();
            a.current = !0
        }, n)
    });
    e.s(["default", 0, n], 462787)
}, 400819, 66199, 549254, e => {
    "use strict";
    var t, r = e.i(221628),
        n = e.i(914640),
        a = e.i(67385),
        i = e.i(274466),
        o = e.i(416340),
        s = e.i(138894),
        l = e.i(188734),
        c = e.i(462787),
        u = e.i(797055),
        d = "AHOOKS_SYNC_STORAGE_EVENT_NAME",
        f = e.i(343881),
        p = (t = function() {
            return f.default ? localStorage : void 0
        }, function(e, r) {
            void 0 === r && (r = {});
            var n, a = r.listenStorageChange,
                f = void 0 !== a && a,
                p = (0, u.isFunction)(r.serializer) ? r.serializer : JSON.stringify,
                h = (0, u.isFunction)(r.deserializer) ? r.deserializer : JSON.parse,
                m = (0, u.isFunction)(r.onError) ? r.onError : console.error;
            try {
                n = t()
            } catch (e) {
                m(e)
            }
            var y = function() {
                    try {
                        var t = null == n ? void 0 : n.getItem(e);
                        if (t) return h(t)
                    } catch (e) {
                        m(e)
                    }
                    return (0, u.isFunction)(r.defaultValue) ? r.defaultValue() : r.defaultValue
                },
                g = (0, i.__read)((0, o.useState)(y), 2),
                b = g[0],
                v = g[1],
                x = (0, o.useRef)(b);
            x.current = b, (0, c.default)(function() {
                var e = y();
                Object.is(e, x.current) || (x.current = e, v(e))
            }, [e]);
            var w = function(t) {
                if (t.key === e && t.storageArea === n) {
                    var r = y();
                    Object.is(r, x.current) || (x.current = r, v(r))
                }
            };
            return (0, s.default)("storage", w, {
                enable: f
            }), (0, s.default)(d, function(e) {
                w(e.detail)
            }, {
                enable: f
            }), [b, (0, l.default)(function(t) {
                var r = x.current,
                    a = (0, u.isFunction)(t) ? t(r) : t;
                if (!Object.is(a, r)) {
                    f || (x.current = a, v(a));
                    try {
                        var i = void 0,
                            o = null == n ? void 0 : n.getItem(e);
                        (0, u.isUndef)(a) ? (i = null, null == n || n.removeItem(e)) : (i = p(a), null == n || n.setItem(e, i)), dispatchEvent(new CustomEvent(d, {
                            detail: {
                                key: e,
                                newValue: i,
                                oldValue: o,
                                storageArea: n
                            }
                        }))
                    } catch (e) {
                        m(e)
                    }
                }
            })]
        });
    e.s(["useLocalStorageState", 0, p], 66199);
    var h = e.i(53950),
        m = e.i(631222),
        y = e.i(458164);
    let g = (0, o.createContext)({
        getApiCredential: e => void 0,
        clearApiCredential: e => void 0,
        clob: null,
        setClob: () => null,
        apiErrorMessage: null,
        setApiErrorMessage: () => null,
        generateApiCreds: (e, t, r) => null,
        localTimeOk: !0
    });
    e.s(["ClobCredentialContextProvider", 0, ({
        children: e
    }) => {
        let [t, i] = p(y.ClobKey.ALL_KEYS, {
            defaultValue: void 0
        }), [s, l] = (0, o.useState)(null), [c, u] = (0, o.useState)(null), [d, f] = (0, o.useState)(!0), b = (0, o.useCallback)((e, t, r) => {
            let n = { ...e,
                baseAddress: t
            };
            return i(e => ({ ...e,
                [r]: n
            })), u(null), n
        }, [i, u]), v = (0, o.useCallback)(e => t ? .[e], [t]), x = (0, o.useCallback)(e => {
            e && i(t => {
                if (!t ? .[e]) return t ? ? {};
                let r = { ...t
                };
                return delete r[e], r
            })
        }, [i]), w = (0, o.useCallback)(async (e, t, r, i) => {
            if (!r) {
                h.logger.error("[ClobCredentialContext > generateApiCreds]", {
                    message: "no signer",
                    address: e,
                    proxyAddress: t
                }), u("Must Log In!");
                return
            }
            if (!e || e === n.zeroAddress || !t) return void h.logger.error("[ClobCredentialContext > generateApiCreds]", {
                message: "no address",
                address: e,
                proxyAddress: t,
                reason: "no_address"
            });
            let {
                chainId: o
            } = m.MATIC_CONFIG, s = new a.ClobClient({
                host: m.CLOB_API_URL,
                chain: o,
                signer: r,
                retryOnError: !0,
                feeSlippage: m.CLOB_FEE_SLIPPAGE
            });
            h.logger.debug("[ClobCredentialContext > generateApiCreds]", {
                proxyAddress: t,
                chainId: o
            }), Math.abs(Date.now() / 1e3 - await s.getServerTime()) > 300 ? f(!1) : f(!0);
            try {
                let r = await s.deriveApiKey(i ? .nonce);
                if (r ? .secret) return b(r, e, t)
            } catch (r) {
                h.logger.error("[ClobCredentialContext > generateApiCreds]", {
                    error: r,
                    address: e,
                    proxyAddress: t,
                    errorMessage: r instanceof Error ? r.message : String(r)
                })
            }
            try {
                let r = await s.createApiKey(i ? .nonce);
                if (r ? .secret) return b(r, e, t)
            } catch (r) {
                h.logger.error("[ClobCredentialContext > generateApiCreds]", {
                    error: r,
                    address: e,
                    proxyAddress: t,
                    reason: "create_api_key_threw",
                    errorMessage: r instanceof Error ? r.message : String(r)
                })
            }
            u("Unable to generate API credentials")
        }, [b, u, f]), _ = (0, o.useMemo)(() => ({
            clob: s,
            setClob: l,
            apiErrorMessage: c,
            setApiErrorMessage: u,
            generateApiCreds: w,
            getApiCredential: v,
            clearApiCredential: x,
            localTimeOk: d
        }), [s, l, c, u, w, v, x, d]);
        return (0, r.jsx)(g.Provider, {
            value: _,
            children: e
        })
    }, "useClob", 0, () => (0, o.useContext)(g).clob, "useClobCredentialContext", 0, () => (0, o.useContext)(g)], 400819);
    var b = e.i(744788),
        v = e.i(922445);
    e.s(["useIntercomBubble", 0, () => {
        let e = !!window.Intercom,
            t = e && !0 === window.Intercom.booted;
        !e || t || (0, v.isNarrowViewport)() || (window.intercomSettings = {
            app_id: b.INTERCOM_APP_ID,
            hide_default_launcher: !0
        }, window.Intercom("boot", {
            app_id: b.INTERCOM_APP_ID
        }))
    }], 549254)
}, 558470, 264975, 141661, e => {
    "use strict";
    var t = e.i(57096),
        r = e.i(655740),
        n = e.i(313582),
        a = e.i(631222);
    let i = e => e.map(e => ({ ...e,
        profileImage: e.profileImage || e.profileImageOptimized || void 0
    }));
    e.s(["parseLeaderboardProfileImages", 0, i], 264975);
    let o = e => {
            switch (e) {
                case t.LeaderboardRange.OneDay:
                    return "day";
                case t.LeaderboardRange.SevenDay:
                    return "week";
                case t.LeaderboardRange.ThirtyDay:
                    return "month";
                case t.LeaderboardRange.All:
                default:
                    return "all"
            }
        },
        s = (e, t, r, n) => e ? e.map((e, a) => {
            let i = parseInt(e.rank);
            return {
                rank: !isNaN(i) && i > 0 ? i : (r - 1) * n + a + 1,
                proxyWallet: e.proxyWallet,
                name: e.userName,
                pseudonym: e.userName,
                amount: "profit" === t ? e.pnl || 0 : e.vol || 0,
                pnl: e.pnl || 0,
                volume: e.vol || 0,
                realized: 0,
                unrealized: 0,
                profileImage: e.profileImage || void 0,
                profileImageOptimized: e.profileImage || void 0,
                xUsername: e.xUsername || void 0,
                verifiedBadge: e.verifiedBadge || void 0
            }
        }) : [];
    e.s(["getTimePeriodFromRange", 0, o, "transformLeaderboardListData", 0, s, "transformLeaderboardUserData", 0, (e, t) => {
        if (!e) return [];
        let r = parseInt(e.rank);
        return [{
            rank: !isNaN(r) && r > 0 ? r : 1,
            proxyWallet: e.proxyWallet,
            name: e.userName,
            pseudonym: e.userName,
            amount: "profit" === t ? e.pnl || 0 : e.vol || 0,
            pnl: e.pnl || 0,
            volume: e.vol || 0,
            realized: "profit" === t && e.pnl || 0,
            unrealized: 0,
            profileImage: e.profileImage || void 0,
            profileImageOptimized: e.profileImage || void 0,
            xUsername: e.xUsername || void 0,
            verifiedBadge: e.verifiedBadge || void 0
        }]
    }], 141661);
    let l = (e, t, r, i = n.LEADERBOARD_LIST_LENGTH, s = 1, l = "overall", c) => {
            let u = `${a.DATA_API}/v1/leaderboard`,
                d = {
                    timePeriod: o(t),
                    orderBy: "profit" === e ? "PNL" : "VOL",
                    limit: i,
                    offset: (s - 1) * i,
                    category: l
                };
            return r && (d.user = r), c && (d.userName = c), {
                url: u,
                params: d
            }
        },
        c = async e => {
            let [a, o, c = t.LeaderboardRange.All, u = 1, d = "overall", f] = e.queryKey;
            return i(s((await r.axios.request(l("profit", c, void 0, n.LEADERBOARD_LIST_LENGTH, u, d, f))).data, "profit", u, n.LEADERBOARD_LIST_LENGTH))
        };
    e.s(["getLeaderboardAxiosInfo", 0, l, "getLeaderboardProfit", 0, c], 558470)
}, 645352, e => {
    "use strict";
    var t = e.i(344558),
        r = e.i(57096),
        n = e.i(655740),
        a = e.i(558470);
    let i = (...e) => {
            for (let t of e)
                if ("string" == typeof t && t.length > 0) return t;
            return ""
        },
        o = async e => t.EXCLUDED_WALLETS.has(e) ? null : n.axios.request((0, a.getLeaderboardAxiosInfo)("volume", r.LeaderboardRange.All, e, 1)).then(e => {
            if (!Array.isArray(e.data) || 0 === e.data.length) return null;
            let t = e.data[0];
            return {
                proxyWallet: i(t.user_id, t.proxyWallet),
                name: i(t.user_name, t.userName),
                pseudonym: i(t.user_name, t.userName),
                amount: t.vol || 0,
                pnl: t.pnl || 0,
                realized: t.realized || 0,
                unrealized: t.unrealized || 0,
                profileImage: t.profile_image ? ? t.profileImage ? ? void 0,
                profileImageOptimized: t.profile_image ? ? t.profileImage ? ? void 0
            }
        }),
        s = async e => {
            let t = [],
                r = new Set;
            for (let n of e) {
                if (!n) continue;
                let e = n.toLowerCase();
                r.has(e) || (r.add(e), t.push(n))
            }
            return 0 === t.length ? null : (await Promise.all(t.map(e => o(e)))).reduce((e, t) => t && (!e || (t.amount ? ? 0) > (e.amount ? ? 0)) ? t : e, null)
        };
    e.s(["getProfileVolume", 0, o, "getProfileVolumeForAddresses", 0, s])
}, 67670, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(964974),
        n = e.i(778983),
        a = e.i(510954),
        i = e.i(57096);
    e.s(["useMarketPositionsValue", 0, (e, o) => {
        let s, l, c, u, d, f = (0, t.c)(15),
            p = void 0 === o ? 15e3 : o,
            h = !!e;
        f[0] !== e ? (s = a.queryKeys[i.QueryKey.Positions].value(e), f[0] = e, f[1] = s) : s = f[1], f[2] !== e ? (l = () => e ? (0, n.positionsValueFetcher)(e) : Promise.resolve(void 0), f[2] = e, f[3] = l) : l = f[3], f[4] === Symbol.for("react.memo_cache_sentinel") ? (c = {
            persist: !0
        }, f[4] = c) : c = f[4], f[5] !== h || f[6] !== p || f[7] !== s.queryKey || f[8] !== l ? (u = {
            queryKey: s.queryKey,
            queryFn: l,
            enabled: h,
            staleTime: p,
            refetchOnWindowFocus: !0,
            refetchOnReconnect: !0,
            refetchInterval: 1e4,
            meta: c
        }, f[5] = h, f[6] = p, f[7] = s.queryKey, f[8] = l, f[9] = u) : u = f[9];
        let {
            data: m,
            isLoading: y,
            isPending: g,
            refetch: b
        } = (0, r.useQuery)(u);
        return f[10] !== m || f[11] !== y || f[12] !== g || f[13] !== b ? (d = {
            marketPositionsValue: m,
            isMarketPositionsValueLoading: y,
            isMarketPositionsValuePending: g,
            refetchMarketPositionsValue: b
        }, f[10] = m, f[11] = y, f[12] = g, f[13] = b, f[14] = d) : d = f[14], d
    }])
}, 656264, 512186, e => {
    "use strict";
    e.s(["IntercomUserDataUpdater", () => h], 656264);
    var t = e.i(549254),
        r = e.i(399482),
        n = e.i(964974),
        a = e.i(416340),
        i = e.i(693116),
        o = e.i(645352),
        s = e.i(67670),
        l = e.i(5146),
        c = e.i(784521),
        u = e.i(53950),
        d = e.i(333223),
        f = e.i(717886);
    let p = async e => {
            try {
                let t = await fetch(`/api/intercom/jwt?user_id=${encodeURIComponent(e)}`);
                if (!t.ok) return null;
                return (await t.json()).token ? ? null
            } catch {
                return null
            }
        },
        h = () => ((0, t.useIntercomBubble)(), (() => {
            let {
                proxyAddress: e,
                authenticationType: t,
                authenticated: h
            } = (0, c.useAccountContext)(["proxyAddress", "authenticationType", "authenticated"]), {
                accountProfile: m
            } = (0, d.default)(), {
                lastEmail: y,
                lastVerifiedEmail: g
            } = (0, f.default)(), b = (0, a.useRef)(null), {
                data: v
            } = (0, n.useQuery)({
                queryKey: ["/api/intercom/jwt", e],
                queryFn: () => p(e),
                enabled: !!e && h,
                staleTime: 3e6,
                gcTime: 3e6,
                refetchInterval: 3e6,
                refetchOnWindowFocus: !1,
                refetchOnReconnect: !1
            }), {
                data: x,
                isFetched: w
            } = (0, n.useQuery)({
                queryKey: ["/api/profile/volume", e],
                queryFn: () => (0, o.getProfileVolume)(e),
                enabled: !!e && h,
                staleTime: 3e5,
                gcTime: 3e5,
                refetchOnWindowFocus: !1,
                refetchOnReconnect: !1
            }), {
                marketPositionsValue: _,
                isMarketPositionsValueLoading: C,
                isMarketPositionsValuePending: E
            } = (0, s.useMarketPositionsValue)(e), {
                trackedProxyUsdcBalance: S,
                isProxyUsdcBalanceFetching: A
            } = (0, l.default)(e), I = w && !(C || E || A);
            (0, a.useEffect)(() => {
                let n = (0, r.createWalletCache)();
                if (h && e && v) {
                    let r = () => {
                        if (!window.Intercom) return;
                        let r = "";
                        if (g ? .email) r = g.email;
                        else if (y ? .email) r = y.email;
                        else if ("magic" === t) {
                            let e = n.state.oauth,
                                t = n.state.email;
                            e ? .email ? r = e.email : t ? .email && (r = t.email)
                        } else m ? .email && (r = m.email.startsWith(i.OAUTH_EMAIL_PREFIX) ? m.email.substring(i.OAUTH_EMAIL_PREFIX.length) : m.email);
                        let a = m ? .username,
                            o = {
                                user_id: e,
                                proxy_wallet: e
                            };
                        v && (o.intercom_user_jwt = v), r && (o.email = r), a && (o.name = a), t && (o.auth_type = t), window.Intercom("update", o), u.logger.info("[useIntercomUserData] Updated Intercom user data", {
                            proxyWallet: e,
                            hasEmail: !!r,
                            hasUsername: !!a,
                            hasJwt: !!v
                        })
                    };
                    return r(), window.Intercom && window.Intercom("onShow", r), () => {
                        window.Intercom && window.Intercom("onHide", () => {})
                    }
                }
                return () => {
                    window.Intercom && window.Intercom("onHide", () => {})
                }
            }, [h, e, t, m, y, g, v]), (0, a.useEffect)(() => {
                (() => {
                    try {
                        if (!window.Intercom || !h || !e || !v) {
                            b.current = null;
                            return
                        }
                        if (b.current === e || !I) return;
                        let t = {
                            lifetime_volume: Math.round(x ? .amount ? ? 0),
                            cash_balance: Math.round(S.current),
                            portfolio_balance: Math.round((_ ? ? 0) + S.current)
                        };
                        v && (t.intercom_user_jwt = v), window.Intercom("update", t), b.current = e;
                        let {
                            intercom_user_jwt: r,
                            ...n
                        } = t;
                        u.logger.info("[useIntercomUserData] Updated Intercom positions data", {
                            proxyWallet: e,
                            ...n
                        })
                    } catch (t) {
                        b.current = e ? ? null, u.logger.error("[useIntercomUserData] Failed to update Intercom positions", {
                            error: t
                        })
                    }
                })()
            }, [h, e, I, x ? .amount, _, S ? .current, v])
        })(), null);
    var m = e.i(284553),
        y = e.i(26128),
        g = e.i(205780),
        b = e.i(186921),
        v = e.i(289241),
        x = e.i(631222);
    e.s(["getPublicClient", 0, e => {
        let t = e === x.Network.Mainnet ? b.mainnet : v.polygon,
            r = "";
        return e === x.Network.Mainnet ? r = "https://eth-mainnet.g.alchemy.com/v2/" : e === x.Network.Matic && (r = "https://polygon-mainnet.g.alchemy.com/v2/"), (0, y.createPublicClient)({
            chain: t,
            transport: (0, g.http)(r, {
                fetchOptions: {
                    headers: {
                        Authorization: `Bearer ${m.default.env.NEXT_PUBLIC_ALCHEMY_DEV_KEY_POLYGON||"mewmTuTYExTSI0lZisD2szwmi35fZY-r"}`
                    }
                }
            })
        })
    }], 512186)
}, 354712, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        n = e.i(752725),
        a = e.i(967958),
        i = e.i(164454);
    let o = function(e, t) {
        var r = {};
        return t = (0, i.default)(t, 3), (0, a.default)(e, function(e, a, i) {
            (0, n.default)(r, a, t(e, a, i))
        }), r
    };
    var s = e.i(416340);
    e.s(["createSplitContext", 0, function(e, n) {
        let a = o(n, (t, r) => {
                let n = (0, s.createContext)(t);
                return n.displayName = `SplitContext(${e}).${r}`, n
            }),
            i = (0, s.createContext)(void 0);

        function l(e) {
            let n, o, l, c, u = (0, r.c)(10),
                {
                    children: d,
                    values: f
                } = e,
                p = (0, s.useRef)(f);
            if (u[0] !== f ? (n = () => {
                    p.current = f
                }, o = [f], u[0] = f, u[1] = n, u[2] = o) : (n = u[1], o = u[2]), (0, s.useInsertionEffect)(n, o), u[3] !== d || u[4] !== f) {
                let e;
                u[6] !== f ? (e = (e, r) => {
                    let n = a[r],
                        i = f[r];
                    return (0, t.jsx)(n.Provider, {
                        value: i,
                        children: e
                    })
                }, u[6] = f, u[7] = e) : e = u[7], l = Object.keys(a).reduceRight(e, d), u[3] = d, u[4] = f, u[5] = l
            } else l = u[5];
            let h = l;
            return u[8] !== h ? (c = (0, t.jsx)(i.Provider, {
                value: p,
                children: h
            }), u[8] = h, u[9] = c) : c = u[9], c
        }
        return i.displayName = `SplitContext(${e}).ValueRef`, l.displayName = `SplitContext(${e}).Provider`, {
            Provider: l,
            _contexts: a,
            _valueRefContext: i
        }
    }, "useSplitContext", 0, function(e, t) {
        return Object.fromEntries(t.map(t => [t, (0, s.use)(e._contexts[t])]))
    }, "useSplitContextValue", 0, function(e) {
        let t = (0, s.use)(e._valueRefContext);
        if (!t) throw Error("useSplitContextValue must be used within a SplitContext.Provider");
        return t
    }], 354712)
}, 784521, e => {
    "use strict";
    e.s(["AccountContextProvider", () => J, "useAccountContext", () => Y]);
    var t = e.i(221628),
        r = e.i(67385),
        n = e.i(907360),
        a = e.i(318594),
        i = e.i(722045),
        o = e.i(416340),
        s = e.i(914640),
        l = e.i(439013),
        c = e.i(73836),
        u = e.i(423708),
        d = e.i(90275),
        f = e.i(751669),
        p = e.i(827681),
        h = e.i(246290),
        m = e.i(752794),
        y = e.i(863828),
        g = e.i(620190),
        b = e.i(17025),
        v = e.i(83713),
        x = e.i(317193),
        w = e.i(767074),
        _ = e.i(51800),
        C = e.i(333223),
        E = e.i(90026),
        S = e.i(348394),
        A = e.i(783198),
        I = e.i(93259),
        T = e.i(757613),
        k = e.i(762769),
        O = e.i(989505),
        R = e.i(911716),
        N = e.i(304826),
        M = e.i(668122),
        P = e.i(867487),
        D = e.i(348320),
        j = e.i(400819),
        L = e.i(730474),
        F = e.i(53950),
        U = e.i(631222),
        $ = e.i(392566),
        z = e.i(721270),
        B = e.i(656264),
        q = e.i(5146),
        W = e.i(510954),
        Z = e.i(57096),
        V = e.i(512186),
        K = e.i(305457),
        H = e.i(354712),
        G = e.i(294781);
    let Q = (0, H.createSplitContext)("AccountContext", {
        isSessionLoading: !1,
        authenticated: !1,
        isUserOnboarding: !1,
        baseAddress: void 0,
        proxyAddress: void 0,
        authenticationType: void 0,
        walletMode: void 0,
        preventModalClose: !1,
        closedDynamic: !1,
        isMigrationActive: !1,
        setPreventModalClose: () => {
            throw Error("AccountContext must export an `setPreventModalClose` function.")
        },
        handleAddClaimTxnListener: e => {
            throw Error("AccountContext must export a `handleAddClaimTxnListener` function.")
        },
        toggleFavoriteEvent: e => {
            throw Error("AccountContext must export a `toggleFavoriteEvent` function.")
        }
    });

    function J({
        children: e
    }) {
        let H = (0, a.useQueryClient)(),
            {
                clob: Y,
                setClob: X,
                generateApiCreds: ee,
                getApiCredential: et,
                localTimeOk: er
            } = (0, j.useClobCredentialContext)(),
            {
                initializeUserSession: en,
                adapters: ea
            } = (0, K.useAnalyticsContext)(),
            ei = (0, K.useAmplitudeAnalytics)(),
            {
                switchChainAsync: eo
            } = (0, c.useSwitchChain)(),
            es = (0, G.useRouter)(),
            {
                connector: el,
                status: ec,
                chainId: eu
            } = (0, h.useAccount)({
                optimisticMagic: !0
            });
        (0, l.useConnectionEffect)({
            onDisconnect: () => {
                X(null)
            }
        });
        let {
            showDeploySafeModal: ed,
            setShowDeploySafeModal: ef
        } = (0, L.useModalStore)(), [ep, eh] = (0, o.useState)(!1), {
            setOpen: em,
            route: ey,
            connectorRoute: eg
        } = (0, y.useSiwx)(), {
            baseAddress: eb,
            proxyAddress: ev,
            authenticated: ex,
            isSessionLoading: ew,
            authenticationType: e_,
            walletMode: eC
        } = (0, m.useAccountState)(), eE = !!ev && ev !== s.zeroAddress && !!U.MATIC_CONFIG.chainId, {
            hasCtfExchangeV2Approval: eS,
            hasLoadedAllowances: eA
        } = (0, O.useAllowanceReads)({
            chainId: U.MATIC_CONFIG.chainId,
            chainConfig: U.chainConfig,
            proxyAddress: ev ? ? s.zeroAddress,
            enabled: eE,
            gcTime: 6e5
        }), eI = (0, k.useMigrationStore)(e => e.addUser), eT = (0, k.useMigrationStore)(e => e.removeUser), ek = (0, k.useMigrationStore)(e => e.usersMigrationData), eO = (0, k.useMigrationStore)(e => e.completedUsers), eR = (0, o.useRef)(null), eN = (0, o.useRef)(null), eM = (0, o.useRef)(null), eP = (0, o.useRef)(ex);
        (0, o.useEffect)(() => {
            if (!eP.current && ex) {
                let e = "u" > typeof navigator ? /Mobi|Android/i.test(navigator.userAgent) ? "mobile" : "desktop" : void 0;
                ei.trackEvent(M.Events.SuccessfulLogin), (0, P.trackEvent)("session_started", {
                    device: e
                }), ea ? .[d.BrowserAnalyticsAdapterEnum.GoogleAnalytics] && ea[d.BrowserAnalyticsAdapterEnum.GoogleAnalytics].trackGA4Event("login", {
                    method: e_ || "unknown",
                    platform: "web",
                    device: e
                }), (0, D.sendGroundcoverEvent)("auth_login", {
                    method: e_ || "unknown",
                    platform: "web",
                    device: e
                });
                try {
                    let e = i.default.get("pm_return_to");
                    e && "string" == typeof e && (i.default.remove("pm_return_to", {
                        path: "/"
                    }), e.startsWith("/") && function(e, t) {
                        try {
                            if (e) return void e.replace(t).catch(() => {
                                window.location.assign(t)
                            })
                        } catch {}
                        window.location.assign(t)
                    }(es, e))
                } catch {}
            }
            eP.current = ex
        }, [ex, ei, ea, e_, es]);
        let eD = (0, o.useMemo)(() => {
                if (ev) return et(ev)
            }, [ev, et]),
            ej = (0, o.useMemo)(() => ex && ey === p.AuthRoute.ONBOARDING, [ex, ey]),
            {
                accountProfile: eL
            } = (0, C.default)({
                isSessionLoading: ew,
                authenticated: ex,
                proxyAddress: ev ? ? s.zeroAddress,
                isOnboarding: ej
            }, {
                enableCallbacks: !0
            }),
            eF = (0, o.useMemo)(() => !!eb && eO.includes(eb.toLowerCase()), [eb, eO]),
            eU = (0, o.useMemo)(() => !!eb && !!eL ? .address && eL.address.toLowerCase() === eb.toLowerCase(), [eb, eL ? .address]),
            e$ = eU ? eL : void 0,
            ez = ej || !!e$ ? .isOnboarding,
            eB = (0, o.useMemo)(() => !!eb && !!e$ ? .proxyWallet && e$.proxyWallet.toLowerCase() === (0, z.getProxyAddress)(eb, "depositWallet").toLowerCase(), [eb, e$ ? .proxyWallet]),
            eq = "depositWallet" === eC || eB;
        (0, o.useEffect)(() => {
            let e = eb ? .toLowerCase(),
                t = !!e && ek.includes(e),
                r = eA ? eb ? eq ? "remove_deposit_wallet" : e$ ? ez ? "skip_while_onboarding" : eF ? "remove_completed_local" : eS ? "remove_approved_on_chain" : "queue_missing_ctf_exchange_v2_approval" : "waiting_for_account_profile" : "waiting_for_base_address" : "waiting_for_allowances",
                n = [e ? ? "no_base", r, eA, !!eL, eU, eq, eS, eF, ez, t].join(":");
            if (eN.current !== n && (eN.current = n, (0, $.ctfV2Info)("migration_gate_evaluated", {
                    decision: r,
                    hasBaseAddress: !!eb,
                    hasProxyAddress: !!ev,
                    hasAccountProfile: !!eL,
                    hasMatchingAccountProfile: !!e$,
                    accountProfileAddress: eL ? .address,
                    walletMode: eC,
                    hasDepositWalletProfile: eB,
                    usesDepositWallet: eq,
                    hasLoadedAllowances: eA,
                    hasCtfExchangeV2Approval: eS,
                    hasCompletedPostMigration: eF,
                    isUserOnboarding: ez,
                    isAuthRouteOnboarding: ej,
                    isAccountProfileOnboarding: !!e$ ? .isOnboarding,
                    authType: e_,
                    alreadyQueued: t
                })), !eA || !eb) return;
            if (eq) return void eT(eb);
            if (!e$ || ez) return;
            if (eF || eS) return void eT(eb);
            let a = `${eb.toLowerCase()}:missing_ctf_exchange_v2_approval:${t}`;
            eR.current !== a && (eR.current = a, (0, $.ctfV2Info)("migration_detected", {
                reason: "missing_ctf_exchange_v2_approval",
                hasCtfExchangeV2Approval: eS,
                hasLoadedAllowances: eA,
                authType: e_,
                alreadyQueued: t
            })), eI(eb)
        }, [eA, eb, eL, e$, eU, ez, eq, eC, eB, eS, eF, ev, eI, eT, ek, e_, ej]);
        let eW = eA && !ej && !ez && !eS && !eF && !eq && !!eb && !!e$ && ek.includes(eb.toLowerCase());
        (0, o.useEffect)(() => {
            if (!eW || !eb) return;
            let e = eb.toLowerCase(),
                t = [e, ev ? .toLowerCase() ? ? "no_proxy", eA, eS, eF, ej, ez, ek.includes(e), eO.includes(e)].join(":");
            eM.current !== t && (eM.current = t, F.logger.info("[AccountContext] migration modal shown", {
                reason: "missing_ctf_exchange_v2_approval",
                baseAddress: eb,
                proxyAddress: ev,
                authType: e_,
                walletMode: eC,
                hasDepositWalletProfile: eB,
                usesDepositWallet: eq,
                hasLoadedAllowances: eA,
                hasCtfExchangeV2Approval: eS,
                hasCompletedPostMigration: eF,
                isUserOnboarding: ez,
                isAuthRouteOnboarding: ej,
                isAccountProfileOnboarding: !!e$ ? .isOnboarding,
                hasAccountProfile: !!eL,
                hasMatchingAccountProfile: !!e$,
                accountProfileAddress: eL ? .address,
                accountProfileProxyWallet: e$ ? .proxyWallet,
                accountProfileAuthType: e$ ? .authType,
                isInMigrationQueue: ek.includes(e),
                isInCompletedUsers: eO.includes(e),
                usersMigrationDataCount: ek.length,
                completedUsersCount: eO.length,
                localStorage: {
                    authParams: window.localStorage.getItem("polymarket.auth.params"),
                    proxyWallet: window.localStorage.getItem("polymarket.auth.proxyWallet"),
                    accountCache: window.localStorage.getItem("polymarket.auth.cache.account"),
                    migrationStore: window.localStorage.getItem("polymarket.store.upgrade-modal")
                }
            }))
        }, [eW, eb, ev, e_, eC, eB, eq, e$, ez, eA, eS, eF, ej, eL, ek, eO]), (0, _.default)(ex, e_, ev, ew, ej);
        let {
            toggleFavoriteEvent: eZ
        } = (0, E.default)(ex, ev, ew, ej), {
            data: eV
        } = (0, u.useWalletClient)({
            chainId: U.MATIC_CONFIG.chainId
        }), eK = (0, o.useCallback)(async () => {
            if (eV && eD && e_) {
                let e = n.SignatureTypeV2.POLY_PROXY;
                if ("depositWallet" === eC ? e = 3 : "eoa" === e_ ? e = n.SignatureTypeV2.POLY_GNOSIS_SAFE : "magic" === e_ && (e = n.SignatureTypeV2.POLY_PROXY), 3 !== e && !Object.values(n.SignatureTypeV2).includes(e)) throw Error("MUST SET A SIGNATURE TYPE");
                let t = async () => {
                    let e = await (0, g.ensurePolygonSigner)(el, eV, eu, eo);
                    if (!e) throw Error("Failed to get signer");
                    return e
                };
                X(new r.ClobClient({
                    host: U.CLOB_API_URL,
                    chain: U.MATIC_CONFIG.chainId,
                    signer: eV,
                    creds: eD,
                    signatureType: e,
                    funderAddress: ev,
                    useServerTime: !er,
                    getSigner: t,
                    retryOnError: !0,
                    feeSlippage: U.CLOB_FEE_SLIPPAGE
                }))
            }
        }, [eV, eD, e_, eC, ev, X, er, el, eu, eo]), eH = (0, o.useMemo)(() => (0, V.getPublicClient)(U.Network.Matic), []), eG = (0, o.useCallback)(async e => {
            F.logger.info("[AccountContext > handleAddClaimTxnListener > waitForTransaction]", {
                hash: e
            });
            let t = await eH.waitForTransactionReceipt({
                hash: e
            });
            F.logger.info("[AccountContext > handleAddClaimTxnListener > txnConfirmed]", {
                hash: e,
                txnConfirmed: t
            }), await H.invalidateQueries({
                queryKey: W.queryKeys[Z.QueryKey.TokenBalance].token(ev ? ? s.zeroAddress, (0, q.getChainSpecificUsdcAddress)(U.MATIC_CONFIG.chainId), U.MATIC_CONFIG.chainId).queryKey
            })
        }, [eH, ev, H]), eQ = (0, o.useCallback)(() => {
            ei.trackEvent(M.Events.LeaveFlow, {
                type: eg,
                error_type: null
            }), em(!1)
        }, [ei, eg, em]);
        (0, o.useEffect)(() => {
            "connected" === ec && (eD && null === Y && eK(), Y ? .creds && eD && (Y.creds.key !== eD.key || Y.creds.secret !== eD.secret || Y.creds.passphrase !== eD.passphrase) && eK())
        }, [eD, Y, eK, ec]), (0, o.useEffect)(() => {
            ew || "connected" !== ec || (ex && e_ === f.AuthenticationTypesEnum.magic && el && ev && "string" == typeof eb && eD && (eD ? .baseAddress ? .toLowerCase() ? ? void 0) !== (eb ? .toLowerCase() ? ? "") && (X(null), ee(eb, ev, eV)), !ex && eD && X(null))
        }, [ex, e_, eC, eb, eD, eV, ev, X, ew, ec, el, ee]), (0, o.useEffect)(() => {
            ev && en(ev, e_)
        }, [e_, en, ev]);
        let eJ = (0, o.useMemo)(() => ({
            isSessionLoading: ew,
            authenticated: ex,
            isUserOnboarding: ej,
            authenticationType: e_,
            walletMode: eC,
            baseAddress: eb,
            proxyAddress: ev,
            preventModalClose: ep,
            setPreventModalClose: eh,
            handleAddClaimTxnListener: eG,
            toggleFavoriteEvent: eZ,
            closedDynamic: eL ? .isCloseOnly ? ? !1,
            isMigrationActive: eW
        }), [ew, ex, ej, e_, eC, eb, ev, ep, eG, eZ, eL ? .isCloseOnly, eW]);
        return (0, t.jsx)(Q.Provider, {
            values: eJ,
            children: (0, t.jsxs)(w.FunkitContextProvider, {
                children: [(0, t.jsx)(N.ComplianceEffects, {}), (0, t.jsx)(v.AuthenticationFlow, {
                    onClose: eQ
                }), ex && (0, t.jsx)(T.ProofOfResidenceModal, {}), ex && (0, t.jsx)(I.NonUsIpModal, {}), ex && (0, t.jsx)(R.ViewOnlyModeModal, {}), ed && !eW && (0, t.jsx)(b.default, {
                    onClose: () => {
                        ef(!1), eh(!1)
                    }
                }), ex && (0, t.jsx)(A.DepositWalletMigrationModal, {}), (0, t.jsx)(S.default, {}), (0, t.jsx)(x.TradingRestricteDialog, {}), (0, t.jsx)(B.IntercomUserDataUpdater, {}), e]
            })
        })
    }
    let Y = e => (0, H.useSplitContext)(Q, e)
}, 51800, e => {
    "use strict";
    e.s(["EVENT_TAG_PREFERENCES", () => p, "default", () => g]);
    var t = e.i(999061),
        r = e.i(399482),
        n = e.i(601550),
        a = e.i(964974),
        i = e.i(318594);
    e.i(416340);
    var o = e.i(305292),
        s = e.i(510954),
        l = e.i(57096),
        c = e.i(784521),
        u = e.i(660006),
        d = e.i(53950),
        f = e.i(134709);
    let p = [{
            id: "2",
            label: "Politics"
        }, {
            id: "21",
            label: "Crypto"
        }, {
            id: "1",
            label: "Sports"
        }, {
            id: "107",
            label: "Business"
        }, {
            id: "596",
            label: "Pop Culture"
        }, {
            id: "74",
            label: "Science"
        }, {
            id: "101110",
            label: "Creators"
        }],
        h = async () => {
            let e = (0, r.createWalletCache)().state.value,
                [t, n] = await Promise.all([(0, o.getGammaClient)().preferences.get(), e ? .type === "eoa" ? (0, o.getGammaClient)().walletPreferences.get() : void 0]);
            if ("failure" === t.status) throw d.logger.error("[useAccountPreferences > getAccountPreferencesFetcher > preferences]", {
                error: t.error
            }), t.error;
            if (n ? .status === "failure") throw d.logger.error("[useAccountPreferences > getAccountPreferencesFetcher > walletPreferences]", {
                error: n.error
            }), n.error;
            return {
                preferences: {
                    id: parseInt(t.data.id, 10),
                    marketInterests: t.data.marketInterests,
                    emailNotificationPreferences: t.data.emailNotificationPreferences,
                    appNotificationPreferences: t.data.appNotificationPreferences,
                    subscriptionStatus: t.data.subscriptionStatus
                },
                ...e ? .type === "eoa" && n ? .status === "success" && {
                    walletPreferences: { ...n.data,
                        id: parseInt(n.data.id, 10)
                    }
                }
            }
        },
        m = async e => {
            let {
                id: t,
                marketInterests: r,
                emailNotificationPreferences: n,
                appNotificationPreferences: a,
                subscriptionStatus: i
            } = e, s = r ? JSON.parse(r) : void 0, l = n ? JSON.parse(n) : void 0, c = a ? JSON.parse(a) : void 0, u = await (0, o.getGammaClient)().preferences.update({
                id: parseInt(t, 10),
                ...!!s && {
                    marketInterests: s
                },
                ...!!l && {
                    emailNotificationPreferences: l
                },
                ...!!c && {
                    appNotificationPreferences: c
                },
                ...void 0 !== i && {
                    subscriptionStatus: i
                }
            });
            if ("failure" === u.status) throw d.logger.error("[useAccountPreferences > updateAccountPreferencesFetcher]", {
                error: u.error,
                variables: e
            }), u.error;
            return {
                marketInterests: s,
                emailNotificationPreferences: l,
                subscriptionStatus: i
            }
        },
        y = async e => {
            let {
                id: t,
                gasPreference: r,
                customGasPrice: n,
                advancedMode: a
            } = e, i = await (0, o.getGammaClient)().walletPreferences.update({
                id: t,
                ...!!r && {
                    gasPreference: r
                },
                ...!!n && {
                    customGasPrice: n
                },
                ...void 0 !== a && {
                    advancedMode: a
                }
            });
            if ("failure" === i.status) throw d.logger.error("[useAccountPreferences > updateAccountWalletPreferencesFetcher]", {
                error: i.error,
                variables: e
            }), i.error;
            return {
                gasPreference: r,
                customGasPrice: n,
                advancedMode: a
            }
        },
        g = (e, r, o, d, p) => {
            let h, g, _, C, E, S, A, I, T, k, O, R, N, M, P = (0, t.c)(35),
                D = (0, i.useQueryClient)();
            P[0] === Symbol.for("react.memo_cache_sentinel") ? (h = ["authenticated", "authenticationType", "proxyAddress", "isSessionLoading", "isUserOnboarding"], P[0] = h) : h = P[0];
            let {
                authenticated: j,
                authenticationType: L,
                proxyAddress: F,
                isSessionLoading: U,
                isUserOnboarding: $
            } = (0, c.useAccountContext)(h), z = o ? ? F, B = (0, f.default)();
            P[1] === Symbol.for("react.memo_cache_sentinel") ? (g = s.queryKeys[l.QueryKey.Account].preferences(), P[1] = g) : g = P[1];
            let q = B && !(d ? ? U) && (e ? ? j) && !!(r ? ? L) && !!z && !(p ? ? $);
            P[2] !== z ? (_ = {
                persist: !0,
                errorContext: {
                    proxyAddress: z,
                    tag: "getAccountPreferences"
                }
            }, P[2] = z, P[3] = _) : _ = P[3], P[4] !== q || P[5] !== _ ? (C = {
                queryKey: g.queryKey,
                queryFn: b,
                enabled: q,
                refetchOnWindowFocus: !1,
                gcTime: 6e5,
                staleTime: 6e5,
                retry: 2,
                meta: _,
                retryDelay: v
            }, P[4] = q, P[5] = _, P[6] = C) : C = P[6];
            let {
                data: W,
                refetch: Z
            } = (0, a.useQuery)(C), V = W ? .preferences, K = W ? .walletPreferences;
            P[7] !== D ? (E = async e => {
                await D.cancelQueries({
                    queryKey: s.queryKeys[l.QueryKey.Account].preferences._def
                });
                let t = D.getQueryData(s.queryKeys[l.QueryKey.Account].preferences().queryKey),
                    r = { ...t,
                        preferences: { ...t ? .preferences,
                            ...e,
                            ...e.marketInterests && {
                                marketInterests: JSON.parse(e.marketInterests)
                            },
                            ...e.emailNotificationPreferences && {
                                emailNotificationPreferences: JSON.parse(e.emailNotificationPreferences)
                            },
                            ...e.appNotificationPreferences && {
                                appNotificationPreferences: JSON.parse(e.appNotificationPreferences)
                            }
                        }
                    };
                return D.setQueryData(s.queryKeys[l.QueryKey.Account].preferences().queryKey, r), {
                    previousPreferences: t
                }
            }, S = () => D.invalidateQueries({
                queryKey: s.queryKeys[l.QueryKey.Account].preferences._def
            }), P[7] = D, P[8] = E, P[9] = S) : (E = P[8], S = P[9]), P[10] !== z || P[11] !== D ? (A = (e, t, r) => {
                D.setQueryData(s.queryKeys[l.QueryKey.Account].preferences().queryKey, r ? .previousPreferences), (0, u.handleError)(e, "updateAccountPreferences", z)
            }, P[10] = z, P[11] = D, P[12] = A) : A = P[12], P[13] !== E || P[14] !== S || P[15] !== A ? (I = {
                mutationKey: s.queryKeys[l.QueryKey.Account].preferences._def,
                mutationFn: m,
                retry: 3,
                retryDelay: x,
                onMutate: E,
                onSettled: S,
                onError: A
            }, P[13] = E, P[14] = S, P[15] = A, P[16] = I) : I = P[16];
            let {
                mutateAsync: H
            } = (0, n.useMutation)(I);
            P[17] !== D ? (k = async e => {
                await D.cancelQueries({
                    queryKey: s.queryKeys[l.QueryKey.Account].preferences._def
                });
                let t = D.getQueryData(s.queryKeys[l.QueryKey.Account].preferences().queryKey),
                    r = { ...t,
                        walletPreferences: { ...t ? .walletPreferences,
                            ...e
                        }
                    };
                return D.setQueryData(s.queryKeys[l.QueryKey.Account].preferences().queryKey, r), {
                    previousPreferences: t
                }
            }, T = () => D.invalidateQueries({
                queryKey: s.queryKeys[l.QueryKey.Account].preferences._def
            }), P[17] = D, P[18] = T, P[19] = k) : (T = P[18], k = P[19]), P[20] !== z || P[21] !== D ? (O = (e, t, r) => {
                D.setQueryData(s.queryKeys[l.QueryKey.Account].preferences().queryKey, r ? .previousPreferences), (0, u.handleError)(e, "updateWalletPreferences", z)
            }, P[20] = z, P[21] = D, P[22] = O) : O = P[22], P[23] !== T || P[24] !== O || P[25] !== k ? (R = {
                mutationKey: s.queryKeys[l.QueryKey.Account].walletPreferences._def,
                mutationFn: y,
                retry: 3,
                retryDelay: w,
                onMutate: k,
                onSettled: T,
                onError: O
            }, P[23] = T, P[24] = O, P[25] = k, P[26] = R) : R = P[26];
            let {
                mutateAsync: G
            } = (0, n.useMutation)(R);
            P[27] !== G ? (N = (e, t, r, n) => G({
                id: e,
                gasPreference: t,
                customGasPrice: r,
                advancedMode: n
            }), P[27] = G, P[28] = N) : N = P[28];
            let Q = N;
            return P[29] !== V || P[30] !== K || P[31] !== Z || P[32] !== H || P[33] !== Q ? (M = {
                accountPreferences: V,
                getAccountPreferences: Z,
                updateAccountPreferences: H,
                accountWalletPreferences: K,
                updateAccountWalletPreferences: Q
            }, P[29] = V, P[30] = K, P[31] = Z, P[32] = H, P[33] = Q, P[34] = M) : M = P[34], M
        };

    function b() {
        return h()
    }

    function v(e) {
        return Math.min(e > 1 ? 2 ** e * 1e3 : 1e3, 3e4)
    }

    function x(e) {
        return Math.min(e > 1 ? 2 ** e * 1e3 : 1e3, 3e4)
    }

    function w(e) {
        return Math.min(e > 1 ? 2 ** e * 1e3 : 1e3, 3e4)
    }
}, 838713, e => {
    "use strict";
    e.s(["useSignIn", () => p]);
    var t = e.i(999061),
        r = e.i(399482),
        n = e.i(601550),
        a = e.i(318594),
        i = e.i(305292),
        o = e.i(51800),
        s = e.i(510954),
        l = e.i(57096),
        c = e.i(53950),
        u = e.i(978216),
        d = e.i(721270);
    let f = async e => {
            let t = await (0, i.getGammaClient)().auth.login({
                token: `Bearer ${e}`
            });
            return "success" === t.status ? {
                status: "success",
                type: t.data.type,
                address: t.data.address
            } : {
                status: "failure",
                error: t.error
            }
        },
        p = () => {
            let e, p = (0, t.c)(2),
                y = (0, a.useQueryClient)();
            return p[0] !== y ? (e = {
                mutationFn: async e => {
                    let {
                        token: t,
                        authenticatedUser: n
                    } = e, a = (0, r.createWalletCache)();
                    if (!t && !n) return {
                        status: "failure",
                        error: Error("no token or authenticatedUser")
                    };
                    let p = n;
                    if (t) {
                        let e = await f(t);
                        if ("failure" === e.status) return {
                            status: "failure",
                            error: e.error
                        };
                        p = {
                            type: e.type,
                            address: e.address
                        }, a.state.update({
                            address: p.address.toLowerCase(),
                            type: p.type
                        }), c.logger.debug("[useSignIn > mutateAsync]", {
                            signInResponse: e
                        })
                    }
                    if (!p) return {
                        status: "failure",
                        error: Error("no user")
                    };
                    let g = (0, d.getProxyAddress)(p.address, p.type);
                    a.wallets.value = g;
                    let b = await (0, i.getGammaClient)().users.get();
                    if (c.logger.debug("[useSignIn > mutateAsync]", {
                            result: b
                        }), "success" === b.status) {
                        let e = b.data.user,
                            t = (0, u.parseGammaProfile)(e, p.type);
                        return y.setQueryData(s.queryKeys[l.QueryKey.Account].profile().queryKey, t), a.wallets.value = t.proxyWallet, c.logger.debug("[useSignIn > mutateAsync > existing]", {
                            result: b,
                            parsedProfile: t
                        }), {
                            status: "success",
                            data: t,
                            isNew: !1
                        }
                    }
                    if ("failure" === b.status && "code" in b.error && 404 === b.error.code) {
                        let e = p.type,
                            t = (0, d.getProxyAddress)(p.address, "depositWallet");
                        if ("eoa" === e) {
                            let r, n = (0, d.getProxyAddress)(p.address, "eoa");
                            try {
                                r = await (0, d.isSafeDeployedOnChain)(n)
                            } catch (r) {
                                return c.logger.error("[useSignIn] safe-deployment precheck failed; refusing to create deposit wallet profile", {
                                    eoa: p.address,
                                    safeAddress: n,
                                    depositWallet: t,
                                    authType: e,
                                    errorMessage: r instanceof Error ? r.message : String(r)
                                }), a.wallets.clear(), {
                                    status: "failure",
                                    error: Error("SAFE_CHECK_FAILED")
                                }
                            }
                            if (r) return c.logger.error("[useSignIn] refusing to create deposit wallet profile: EOA has Safe deployed on-chain", {
                                eoa: p.address,
                                safeAddress: n,
                                depositWallet: t,
                                authType: e
                            }), a.wallets.clear(), {
                                status: "failure",
                                error: Error("SAFE_ALREADY_DEPLOYED")
                            }
                        }
                        let r = `${t}-${Date.now()}`,
                            n = {
                                generalEmail: {
                                    sendEmails: !1
                                },
                                marketEmails: {
                                    sendEmails: !1
                                },
                                newsletterEmails: {
                                    sendEmails: !1
                                },
                                promotionalEmails: {
                                    sendEmails: !1
                                },
                                eventEmails: {
                                    sendEmails: !1,
                                    tagIds: o.EVENT_TAG_PREFERENCES.map(h)
                                },
                                orderFillEmails: {
                                    sendEmails: !1,
                                    hideSmallFills: !0
                                },
                                resolutionEmails: {
                                    sendEmails: !1
                                }
                            },
                            f = {
                                eventApp: {
                                    sendApp: !0,
                                    tagIds: o.EVENT_TAG_PREFERENCES.map(m)
                                },
                                marketPriceChangeApp: {
                                    sendApp: !0
                                },
                                orderFillApp: {
                                    sendApp: !0,
                                    hideSmallFills: !0
                                },
                                resolutionApp: {
                                    sendApp: !0
                                }
                            },
                            g = [],
                            b = await (0, i.getGammaClient)().profiles.create({
                                authenticationType: e,
                                name: r,
                                pseudonym: t,
                                proxyWallet: t,
                                emailOptIn: !1,
                                user: {
                                    address: p.address,
                                    ..."magic" === p.type && {
                                        email: a.state.magic ? .email
                                    },
                                    proxyWallet: t,
                                    username: r,
                                    ..."eoa" === p.type && {
                                        provider: "metamask"
                                    }
                                },
                                preferences: {
                                    subscriptionStatus: !1,
                                    marketInterests: g,
                                    emailNotificationPreferences: n,
                                    appNotificationPreferences: f
                                }
                            });
                        if (c.logger.debug("[useSignIn > mutateAsync]", {
                                profileCreationRes: b
                            }), "failure" === b.status) return {
                            status: "failure",
                            error: b.error
                        };
                        let {
                            user: v,
                            preference: x,
                            walletPreference: w,
                            ..._
                        } = b.data;
                        if (!v) return {
                            status: "failure",
                            error: Error(`failed to create user (authType: ${e})`)
                        };
                        if (!x) return {
                            status: "failure",
                            error: Error(`failed to create all preference entities (authType: ${e})`)
                        };
                        let C = (0, u.parseGammaProfileAfterCreation)({
                            profile: _,
                            user: v,
                            authenticationType: e
                        });
                        y.setQueryData(s.queryKeys[l.QueryKey.Account].profile().queryKey, C), a.wallets.value = t;
                        let E = {
                            preferences: { ...x,
                                id: parseInt(x.id, 10),
                                chartPreferences: void 0,
                                emailNotificationPreferences: x.emailNotificationPreferences ? ? n,
                                appNotificationPreferences: x.appNotificationPreferences ? ? f,
                                marketInterests: x.marketInterests ? ? g
                            },
                            walletPreferences: void 0
                        };
                        return y.setQueryData(s.queryKeys[l.QueryKey.Account].preferences().queryKey, E), c.logger.debug("[useSignIn > mutateAsync > new]", {
                            profile: _,
                            user: v,
                            preference: x,
                            walletPreference: w,
                            parsedProfile: C,
                            parsedPreferences: E
                        }), {
                            status: "success",
                            data: C,
                            isNew: !0
                        }
                    }
                    return {
                        status: "failure",
                        error: b.error
                    }
                }
            }, p[0] = y, p[1] = e) : e = p[1], (0, n.useMutation)(e)
        };

    function h(e) {
        let {
            id: t
        } = e;
        return t
    }

    function m(e) {
        let {
            id: t
        } = e;
        return t
    }
}, 566515, 909084, e => {
    "use strict";
    e.s(["AuthenticationContextProvider", () => z, "useAuthenticationContext", () => B, "useSignIn", () => q], 566515);
    var t = e.i(221628),
        r = e.i(999061),
        n = e.i(447660),
        a = e.i(399482),
        i = e.i(905333),
        o = e.i(601550),
        s = e.i(318594),
        l = e.i(416340),
        c = e.i(923095),
        u = e.i(660006),
        d = e.i(631222),
        f = e.i(912504),
        p = e.i(805949),
        h = e.i(510954),
        m = e.i(57096),
        y = e.i(668122),
        g = e.i(945930),
        b = e.i(79075),
        v = e.i(305457),
        x = e.i(53950),
        w = e.i(618931),
        _ = e.i(827681),
        C = e.i(191010),
        E = e.i(838713),
        S = e.i(294781),
        A = e.i(305292),
        I = e.i(248131),
        T = e.i(635672),
        k = e.i(841231);

    function O(e) {
        return e.queryKey[0] === m.QueryKey.Account || e.queryKey[0] === m.QueryKey.Deposit || e.queryKey[0] === m.QueryKey.OpenOrders || e.queryKey[0] === m.QueryKey.Positions || e.queryKey[0] === m.QueryKey.Notifications
    }

    function R(e) {
        return e.queryKey[0] === m.QueryKey.Account || e.queryKey[0] === m.QueryKey.Notifications
    }

    function N() {
        window.localStorage.removeItem(k.PROOF_OF_RESIDENCE_LS), window.localStorage.removeItem(k.NON_US_IP_LS), window.localStorage.removeItem(k.US_IP_VIEW_ONLY_LS)
    }
    let M = async () => {
            await (0, A.getGammaClient)().auth.logout()
        },
        P = () => {
            let e, t, n, a, i = (0, r.c)(13),
                l = (0, s.useQueryClient)(),
                c = (0, S.useRouter)(),
                {
                    cancelAuthenticatedQueries: u,
                    clearAuthenticatedCache: d,
                    removeAuthenticatedQueries: f,
                    clearComplianceCredentials: p
                } = (() => {
                    let e, t, n, a, i, o, l, c, u, d, f, p, y, g, b, v, x, w, _, C, E, S, A, I, T, k, M = (0, r.c)(5),
                        {
                            clearAuthenticatedCache: P
                        } = (c = (0, r.c)(15), u = (0, s.useQueryClient)(), c[0] !== u ? (t = () => {
                            u.removeQueries({
                                queryKey: h.queryKeys[m.QueryKey.Account].favoriteEvents().queryKey,
                                exact: !0
                            }), u.removeQueries({
                                queryKey: h.queryKeys[m.QueryKey.Account].preferences().queryKey,
                                exact: !0
                            }), u.removeQueries({
                                queryKey: h.queryKeys[m.QueryKey.Account].profile().queryKey,
                                exact: !0
                            })
                        }, c[0] = u, c[1] = t) : t = c[1], d = t, c[2] !== u ? (n = () => {
                            u.setQueryData(h.queryKeys[m.QueryKey.Notifications].cachedClob().queryKey, []), u.removeQueries({
                                queryKey: h.queryKeys[m.QueryKey.Notifications].clob().queryKey,
                                exact: !0
                            }), u.setQueryData(h.queryKeys[m.QueryKey.Notifications].watermark().queryKey, Date.now())
                        }, c[2] = u, c[3] = n) : n = c[3], f = n, c[4] !== u ? (a = () => {
                            u.removeQueries({
                                queryKey: h.queryKeys[m.QueryKey.OpenOrders]._def,
                                exact: !0
                            }), u.removeQueries({
                                queryKey: h.queryKeys[m.QueryKey.Positions]._def,
                                exact: !0
                            })
                        }, c[4] = u, c[5] = a) : a = c[5], p = a, c[6] !== u ? (i = () => {
                            u.removeQueries({
                                queryKey: h.queryKeys[m.QueryKey.Deposit].transactions().queryKey,
                                exact: !0
                            }), u.removeQueries({
                                queryKey: h.queryKeys[m.QueryKey.Deposit].quotes().queryKey,
                                exact: !0
                            }), u.removeQueries({
                                queryKey: h.queryKeys[m.QueryKey.Deposit].copied().queryKey,
                                exact: !0
                            }), u.removeQueries({
                                queryKey: h.queryKeys[m.QueryKey.Deposit].chains().queryKey,
                                exact: !0
                            }), u.removeQueries({
                                queryKey: h.queryKeys[m.QueryKey.Deposit].lastSeenT2bSourceBlock().queryKey,
                                exact: !0
                            })
                        }, c[6] = u, c[7] = i) : i = c[7], y = i, c[8] !== d || c[9] !== y || c[10] !== f || c[11] !== p ? (o = () => {
                            d(), f(), p(), y()
                        }, c[8] = d, c[9] = y, c[10] = f, c[11] = p, c[12] = o) : o = c[12], g = o, c[13] !== g ? (l = {
                            clearAuthenticatedCache: g
                        }, c[13] = g, c[14] = l) : l = c[14], l),
                        {
                            removeAuthenticatedQueries: D
                        } = (x = (0, r.c)(4), w = (0, s.useQueryClient)(), x[0] !== w ? (b = () => {
                            w.removeQueries({
                                predicate: O
                            })
                        }, x[0] = w, x[1] = b) : b = x[1], _ = b, x[2] !== _ ? (v = {
                            removeAuthenticatedQueries: _
                        }, x[2] = _, x[3] = v) : v = x[3], v),
                        {
                            cancelAuthenticatedQueries: j
                        } = (S = (0, r.c)(4), A = (0, s.useQueryClient)(), S[0] !== A ? (C = async () => {
                            await A.cancelQueries({
                                predicate: R
                            })
                        }, S[0] = A, S[1] = C) : C = S[1], I = C, S[2] !== I ? (E = {
                            cancelAuthenticatedQueries: I
                        }, S[2] = I, S[3] = E) : E = S[3], E),
                        {
                            clearComplianceCredentials: L
                        } = ((k = (0, r.c)(1))[0] === Symbol.for("react.memo_cache_sentinel") ? (T = {
                            clearComplianceCredentials: N
                        }, k[0] = T) : T = k[0], T);
                    return M[0] !== j || M[1] !== P || M[2] !== L || M[3] !== D ? (e = {
                        clearAuthenticatedCache: P,
                        removeAuthenticatedQueries: D,
                        cancelAuthenticatedQueries: j,
                        clearComplianceCredentials: L
                    }, M[0] = j, M[1] = P, M[2] = L, M[3] = D, M[4] = e) : e = M[4], e
                })();
            return i[0] !== u || i[1] !== d || i[2] !== p ? (e = async () => {
                (0, T.clearSessionHint)(), p(), await u(), d()
            }, i[0] = u, i[1] = d, i[2] = p, i[3] = e) : e = i[3], i[4] !== f ? (t = () => f(), i[4] = f, i[5] = t) : t = i[5], i[6] !== l || i[7] !== c ? (n = async () => {
                l.setQueryData(h.queryKeys[m.QueryKey.Auth].isLoggedIn().queryKey, {
                    status: "logged-out"
                }), c && (c.pathname.startsWith(I.Location.Portfolio) || c.pathname.startsWith(I.Location.Settings)) && await c.push("/")
            }, i[6] = l, i[7] = c, i[8] = n) : n = i[8], i[9] !== e || i[10] !== t || i[11] !== n ? (a = {
                mutationFn: D,
                onMutate: e,
                onSettled: t,
                onSuccess: n,
                onError: j
            }, i[9] = e, i[10] = t, i[11] = n, i[12] = a) : a = i[12], (0, o.useMutation)(a)
        };
    async function D() {
        return M()
    }
    async function j(e) {
        x.logger.error("[useSignOutOfGamma > onError]", {
            error: e
        })
    }
    e.s(["useSignOut", 0, P], 909084);
    let L = async () => {
        let e = await (0, A.getGammaClient)().auth.nonce();
        return "success" === e.status ? {
            status: "success",
            nonce: e.data
        } : {
            status: "failure",
            error: e.error
        }
    };
    var F = e.i(285650),
        U = e.i(603580);
    let $ = l.default.createContext(null),
        z = e => {
            let S, A, I, T, k, O, R, N, M, D, j, z, B, q, W, Z, V = (0, r.c)(69),
                {
                    children: K
                } = e,
                H = (0, s.useQueryClient)(),
                G = (0, v.useAmplitudeAnalytics)(),
                Q = l.default.useRef(!1),
                J = l.default.useRef(void 0),
                Y = l.default.useRef(void 0),
                {
                    setOpen: X,
                    setRoute: ee,
                    setConnectorRoute: et,
                    options: er,
                    open: en,
                    setPreventClose: ea,
                    connector: ei,
                    magicOauthRedirectTimeout: eo,
                    magicOauthPendingTimeout: es,
                    setAuthenticationStatus: el,
                    authenticationStatus: ec
                } = (0, U.useSiwxContext)(),
                eu = (0, f.useConfig)(),
                {
                    address: ed,
                    connector: ef,
                    chainId: ep,
                    status: eh
                } = (0, p.useConnection)(),
                {
                    mutateAsync: em
                } = (0, E.useSignIn)(),
                {
                    mutateAsync: ey
                } = P(),
                [eg, eb] = l.default.useState(),
                {
                    data: ev
                } = (0, C.useIsLoggedIn)();
            V[0] !== G || V[1] !== ei.id || V[2] !== ev || V[3] !== er.nonceRefetchInterval || V[4] !== eg ? (S = () => {
                if (Q.current || ev.isLoggedInPending || (Q.current = !0, ev.isLoggedIn)) return;
                (0, g.setLogoutTrigger)({
                    reason: "session_invalidated",
                    initiator: "system",
                    trigger: "detected_on_load"
                }, {
                    mode: "overwrite"
                });
                let e = (0, g.consumeLogoutTrigger)();
                if (!e ? .proxyAddress) return;
                let t = Date.now(),
                    r = (0, g.getLastTradeContext)(),
                    n = r && "number" == typeof r.at ? Math.max(0, t - r.at) : void 0,
                    a = e ? .extra ? .id ? ? e ? .extra ? .auth_type ? ? (ei.id || void 0),
                    i = {
                        logout_reason: e.reason,
                        initiator: e.initiator,
                        trigger: e.trigger,
                        id: a,
                        detected_on_load: !0,
                        trigger_age_ms: Math.max(0, t - e.at),
                        was_session_persisted: eg,
                        nonce_refetch_interval_ms: er.nonceRefetchInterval,
                        gamma_status: ev.gamma.status,
                        ..."failure" === ev.gamma.status && {
                            gamma_failure_code: ev.gamma.code
                        },
                        time_since_last_trade_ms: n,
                        last_trade_type: r ? .event,
                        last_trade_market_id: r ? .market_id,
                        last_trade_market_slug: r ? .market_slug,
                        last_trade_token_id: r ? .token_id,
                        ...{
                            pathname: window.location.pathname,
                            href: window.location.href
                        }
                    };
                G.trackEvent(y.Events.Logout, i, e.proxyAddress), x.logger.info("[AuthenticationContext] Tracked logout event (detected_on_load)", {
                    logout_reason: i.logout_reason,
                    trigger: i.trigger,
                    gamma_status: i.gamma_status,
                    gamma_failure_code: i.gamma_failure_code,
                    initiator: i.initiator,
                    id: i.id
                })
            }, A = [G, ei.id, ev, er.nonceRefetchInterval, eg], V[0] = G, V[1] = ei.id, V[2] = ev, V[3] = er.nonceRefetchInterval, V[4] = eg, V[5] = S, V[6] = A) : (S = V[5], A = V[6]), l.default.useEffect(S, A), V[7] !== G || V[8] !== ei.id || V[9] !== ev || V[10] !== er.nonceRefetchInterval || V[11] !== eg ? (I = () => {
                if (ev.isLoggedInPending) return;
                let e = J.current,
                    t = ev.isLoggedIn;
                if (J.current = t, !0 !== e || !1 !== t) return;
                let r = Date.now(),
                    n = (0, g.consumeLogoutTrigger)(r),
                    a = ev.gamma,
                    i = (0, g.getLastTradeContext)(),
                    o = i && "number" == typeof i.at ? Math.max(0, r - i.at) : void 0,
                    s = n ? .extra ? .id ? ? n ? .extra ? .auth_type ? ? (ei.id || void 0),
                    l = "logged-out" === a.status || "failure" === a.status && 401 === a.code ? "session_invalidated" : "unknown",
                    c = {
                        logout_reason: n ? .reason ? ? l,
                        initiator: n ? .initiator ? ? "system",
                        trigger: n ? .trigger ? ? "isLoggedIn_transition",
                        id: s,
                        trigger_age_ms: n ? Math.max(0, r - n.at) : void 0,
                        was_session_persisted: eg,
                        nonce_refetch_interval_ms: er.nonceRefetchInterval,
                        gamma_status: a.status,
                        ..."failure" === a.status && {
                            gamma_failure_code: a.code
                        },
                        time_since_last_trade_ms: o,
                        last_trade_type: i ? .event,
                        last_trade_market_id: i ? .market_id,
                        last_trade_market_slug: i ? .market_slug,
                        last_trade_token_id: i ? .token_id,
                        ...{
                            pathname: window.location.pathname,
                            href: window.location.href
                        }
                    };
                G.trackEvent(y.Events.Logout, c, n ? .proxyAddress), x.logger.info("[AuthenticationContext] Tracked logout event (isLoggedIn transition)", {
                    logout_reason: c.logout_reason,
                    trigger: c.trigger,
                    gamma_status: c.gamma_status,
                    gamma_failure_code: c.gamma_failure_code,
                    initiator: c.initiator,
                    id: c.id
                })
            }, T = [G, ei.id, ev, er.nonceRefetchInterval, eg], V[7] = G, V[8] = ei.id, V[9] = ev, V[10] = er.nonceRefetchInterval, V[11] = eg, V[12] = I, V[13] = T) : (I = V[12], T = V[13]), l.default.useEffect(I, T), V[14] !== ey ? (k = async () => {
                let e = (0, a.createWalletCache)();
                e.state.clear(), e.wallets.clear(), await ey()
            }, V[14] = ey, V[15] = k) : k = V[15], V[16] !== el ? (O = () => {
                (0, g.setLogoutTrigger)({
                    reason: "unknown",
                    initiator: "system",
                    trigger: "signOut"
                }, {
                    mode: "if_unset"
                }), el(_.AuthenticationStatusStates.IDLE)
            }, V[16] = el, V[17] = O) : O = V[17], V[18] !== k || V[19] !== O ? (R = {
                mutationFn: k,
                onMutate: O
            }, V[18] = k, V[19] = O, V[20] = R) : R = V[20];
            let {
                mutateAsync: ex
            } = (0, o.useMutation)(R);
            V[21] !== G || V[22] !== eu || V[23] !== ev || V[24] !== el || V[25] !== em || V[26] !== ey ? (N = async e => {
                let t, r = (0, a.createWalletCache)(),
                    {
                        account: o,
                        connector: s,
                        token: l,
                        chainId: c
                    } = e,
                    f = e.authenticatedUser ? .address.toLowerCase() === o.toLowerCase() ? e.authenticatedUser : void 0,
                    p = (0, i.isMagicConnector)(s ? .id),
                    h = e.authenticatedUser ? ? (ev.isLoggedIn ? ev.authenticatedUser : void 0),
                    m = !l && !!h ? .address && h.address.toLowerCase() !== o.toLowerCase();
                if ((0, F.logAuthFlowStep)({
                        connectorId: s.id,
                        data: {
                            chainId: c,
                            hasAuthenticatedUser: !!f,
                            hasToken: !!l
                        },
                        step: "sign_in_started",
                        walletAddress: o
                    }), m && (x.logger.info("[AuthenticationContext] Signing out stale Gamma session before nonce", {
                        connectorId: s.id,
                        previousAddress: h.address,
                        nextAddress: o
                    }), r.state.clear(), r.wallets.clear(), await ey()), !p) {
                    let e = await L();
                    if ("failure" === e.status) throw (0, u.handleError)(e.error, "[getEoaNonce]", o), (0, F.logAuthFlowError)({
                        authStatus: "error",
                        connectorId: s.id,
                        error: e.error,
                        trigger: "gamma-login",
                        walletAddress: o
                    }), e.error;
                    let r = (({
                        nonce: e,
                        authenticatedUser: t
                    }) => t || e ? {
                        success: !0
                    } : {
                        success: !1,
                        error: Error("Could not fetch nonce")
                    })({
                        nonce: t = e.nonce,
                        authenticatedUser: f
                    });
                    if (!l && !r.success) throw (0, F.logAuthFlowError)({
                        authStatus: "error",
                        connectorId: s.id,
                        error: r.error,
                        trigger: "gamma-login",
                        walletAddress: o
                    }), r.error
                }
                let y = await (0, n.getToken)({
                    account: o,
                    chainId: c,
                    connector: s,
                    nonce: t ? ? "",
                    uri: d.CURRENT_ORIGIN,
                    config: eu
                });
                if ("failure" === y.status) throw p ? (0, F.logAuthFlowError)({
                    authStatus: "error",
                    connectorId: s.id,
                    error: y.error,
                    trigger: "signMessage",
                    walletAddress: o
                }) : "UserRejectedRequestError" === y.error.name ? ((0, F.logAuthFlowError)({
                    authStatus: "rejected",
                    connectorId: s.id,
                    error: y.error,
                    trigger: "signMessage",
                    walletAddress: o
                }), el(_.AuthenticationStatusStates.REJECTED)) : (x.logger.error("[AuthenticationContext > signMessageAsync > onError]", {
                    error: y.error,
                    account: o
                }), (0, F.logAuthFlowError)({
                    authStatus: "error",
                    connectorId: s.id,
                    error: y.error,
                    trigger: "signMessage",
                    walletAddress: o
                }), el(_.AuthenticationStatusStates.ERROR)), y.error;
                if ((0, F.logAuthFlowStep)({
                        connectorId: s.id,
                        data: {
                            chainId: c
                        },
                        step: p ? "magic_token_received" : "eoa_token_received",
                        walletAddress: o
                    }), !p) {
                    let e = r.state.exists;
                    r.state.value = {
                        address: o,
                        type: "eoa",
                        connectorId: s.id
                    }, x.logger.info("[AuthenticationContext] Set EOA auth cache state", {
                        source: "token_success",
                        hadState: e,
                        connectorId: s.id,
                        address: o
                    })
                }(0, w.getMobileAuthMode)() && await (0, w.handleMobileAuthFlow)(y.data, s.id, G);
                let g = await em({
                    token: y.data,
                    authenticatedUser: f
                });
                if ("failure" === g.status) throw (0, F.logAuthFlowError)({
                    authStatus: "error",
                    connectorId: s.id,
                    error: g.error,
                    trigger: "gamma-login",
                    walletAddress: o
                }), g.error;
                return (0, F.logAuthFlowStep)({
                    connectorId: s.id,
                    data: {
                        isNew: g.isNew
                    },
                    step: "gamma_login_succeeded",
                    walletAddress: o
                }), {
                    isNew: g.isNew,
                    accountProfile: g.data
                }
            }, V[21] = G, V[22] = eu, V[23] = ev, V[24] = el, V[25] = em, V[26] = ey, V[27] = N) : N = V[27], V[28] !== H || V[29] !== el ? (M = async e => {
                await H.cancelQueries({
                    exact: !0,
                    queryKey: h.queryKeys[m.QueryKey.Auth].isLoggedIn().queryKey
                });
                let t = (0, a.createWalletCache)();
                t.state.oauthRedirected || el(_.AuthenticationStatusStates.PENDING), (0, F.logAuthFlowStep)({
                    connectorId: e.connector.id,
                    data: {
                        canceledSessionProbe: !0,
                        hasAuthenticatedUser: !!e.authenticatedUser,
                        hasToken: !!e.token,
                        oauthRedirected: t.state.oauthRedirected
                    },
                    step: "sign_in_mutating",
                    walletAddress: e.account
                })
            }, V[28] = H, V[29] = el, V[30] = M) : M = V[30], V[31] !== es || V[32] !== eo || V[33] !== H || V[34] !== el || V[35] !== X || V[36] !== ea || V[37] !== ee ? (D = (e, t) => {
                let r = (0, a.createWalletCache)();
                eo.current && clearTimeout(eo.current), es.current && clearTimeout(es.current);
                let n = t.connector ? .id === "magic" ? "magic" : "eoa";
                if (t.authenticatedUser ? .address.toLowerCase() !== t.account.toLowerCase() && H.setQueryData(h.queryKeys[m.QueryKey.Auth].isLoggedIn().queryKey, {
                        status: "success",
                        address: t.account,
                        type: n
                    }), r.wallets.value = e.accountProfile.proxyWallet, !(0, i.isMagicConnector)(t.connector.id)) {
                    let e = r.state.exists;
                    r.state.value = {
                        type: "eoa",
                        connectorId: t.connector.id,
                        address: t.account
                    }, x.logger.info("[AuthenticationContext] Set EOA auth cache state", {
                        source: "sign_in_success",
                        hadState: e,
                        connectorId: t.connector.id,
                        address: t.account
                    })
                }
                e.isNew ? (X(!0), ee(_.AuthRoute.ONBOARDING), ea(!0)) : ((0, b.clearSignupPromptAttribution)(), X(!1)), el(_.AuthenticationStatusStates.SUCCESS), "magic" === t.connector.id && r.state.update({
                    connectionState: "ready"
                }), (0, c.handlePerpsEarlyAccessAuthSuccess)({
                    userId: e.accountProfile.proxyWallet,
                    gammaUserId: e.accountProfile.userId,
                    email: (0, c.normalizePerpsEmail)(e.accountProfile.email),
                    username: e.accountProfile.username
                }), eb(!1), (0, F.logAuthFlowStep)({
                    connectorId: t.connector.id,
                    data: {
                        authenticationStatus: _.AuthenticationStatusStates.SUCCESS,
                        isNew: e.isNew,
                        openedOnboarding: e.isNew
                    },
                    step: "sign_in_completed",
                    walletAddress: t.account
                })
            }, V[31] = es, V[32] = eo, V[33] = H, V[34] = el, V[35] = X, V[36] = ea, V[37] = ee, V[38] = D) : D = V[38], V[39] !== G || V[40] !== el ? (j = (e, t) => {
                if ("UserRejectedRequestError" === e.name)(0, F.logAuthFlowError)({
                    authStatus: "rejected",
                    connectorId: t.connector ? .id,
                    error: e,
                    trigger: "onError",
                    walletAddress: t.account
                }), el(_.AuthenticationStatusStates.REJECTED);
                else {
                    x.logger.error("[AuthenticationContext > onError]", {
                        error: e,
                        address: t.account,
                        connectorId: t.connector ? .id
                    }), G.trackEvent(y.Events.GammaSignInError, {
                        error: e,
                        address: t.account,
                        connectorId: t.connector ? .id
                    });
                    let r = "code" in e && 403 === e.code && "response" in e && "object" == typeof e.response && null !== e.response && "error" in e.response && "account deleted" === e.response.error;
                    (0, F.logAuthFlowError)({
                        authStatus: r ? "account_deleted" : "error",
                        connectorId: t.connector ? .id,
                        error: e,
                        trigger: "onError",
                        walletAddress: t.account
                    }), el(r ? _.AuthenticationStatusStates.ACCOUNT_DELETED : _.AuthenticationStatusStates.ERROR)
                }
            }, V[39] = G, V[40] = el, V[41] = j) : j = V[41], V[42] !== D || V[43] !== j || V[44] !== N || V[45] !== M ? (z = {
                mutationFn: N,
                onMutate: M,
                onSuccess: D,
                onError: j
            }, V[42] = D, V[43] = j, V[44] = N, V[45] = M, V[46] = z) : z = V[46];
            let {
                mutate: ew
            } = (0, o.useMutation)(z);
            V[47] !== ec || V[48] !== ed || V[49] !== ep || V[50] !== ef || V[51] !== eh || V[52] !== ev || V[53] !== en || V[54] !== et || V[55] !== X || V[56] !== ea || V[57] !== ee || V[58] !== ew ? (B = () => {
                if (en || "connected" !== eh || !ed || !ef || !ep || (0, i.isMagicConnector)(ef.id) || ev.isLoggedInPending || !ev.isLoggedIn || "eoa" !== ev.authenticatedUser.type || ec !== _.AuthenticationStatusStates.SUCCESS) return;
                let e = ed.toLowerCase();
                if (e === ev.authenticatedUser.address.toLowerCase()) {
                    Y.current = void 0;
                    return
                }
                let t = `${ef.id}:${e}`;
                Y.current !== t && (Y.current = t, x.logger.info("[AuthenticationContext] Signing in connected account switch", {
                    connectorId: ef.id,
                    authenticatedAddress: ev.authenticatedUser.address,
                    connectedAddress: ed
                }), ew({
                    account: ed,
                    connector: ef,
                    chainId: ep
                }, {
                    onError: () => {
                        et(_.ConnectorRoute.SIGNUP), ee(_.AuthRoute.CONNECTORS), ea(!1), X(!0)
                    }
                }))
            }, q = [ec, ed, ep, ef, eh, ev, en, et, X, ea, ee, ew], V[47] = ec, V[48] = ed, V[49] = ep, V[50] = ef, V[51] = eh, V[52] = ev, V[53] = en, V[54] = et, V[55] = X, V[56] = ea, V[57] = ee, V[58] = ew, V[59] = B, V[60] = q) : (B = V[59], q = V[60]), l.default.useEffect(B, q), V[61] !== ev || V[62] !== ew || V[63] !== ex || V[64] !== eg ? (W = { ...ev,
                signIn: ew,
                signOut: ex,
                wasSessionPersisted: eg,
                setWasSessionPersisted: eb
            }, V[61] = ev, V[62] = ew, V[63] = ex, V[64] = eg, V[65] = W) : W = V[65];
            let e_ = W;
            return V[66] !== K || V[67] !== e_ ? (Z = (0, t.jsx)($.Provider, {
                value: e_,
                children: K
            }), V[66] = K, V[67] = e_, V[68] = Z) : Z = V[68], Z
        },
        B = () => {
            let e = l.default.useContext($);
            if (!e) throw Error("useAuthenticationContext Hook must be inside a Provider.");
            return e
        },
        q = () => {
            let e = l.default.useContext($);
            if (!e) throw Error("useSignIn Hook must be inside a Provider.");
            return e.signIn
        }
}, 863828, e => {
    "use strict";
    e.s(["useSiwx", () => i]);
    var t = e.i(999061),
        r = e.i(566515),
        n = e.i(44071),
        a = e.i(603580);
    let i = () => {
        let e, i = (0, t.c)(29),
            {
                authenticationStatus: o,
                connector: s,
                connectorRoute: l,
                connectorStatus: c,
                onboardingRoute: u,
                open: d,
                options: f,
                preventClose: p,
                ready: h,
                resize: m,
                route: y,
                setAuthenticationStatus: g,
                setConnector: b,
                setConnectorRoute: v,
                setConnectorStatus: x,
                setOnboardingRoute: w,
                setOpen: _,
                setPreventClose: C,
                setRoute: E,
                triggerResize: S
            } = (0, a.useSiwxContext)(),
            {
                authenticatedUser: A,
                isLoggedIn: I,
                signIn: T,
                signOut: k,
                wasSessionPersisted: O
            } = (0, r.useAuthenticationContext)(),
            {
                getUri: R,
                openW3M: N,
                isOpenW3M: M
            } = (0, n.useConnectorContext)();
        return i[0] !== A || i[1] !== o || i[2] !== s || i[3] !== l || i[4] !== c || i[5] !== R || i[6] !== I || i[7] !== M || i[8] !== u || i[9] !== d || i[10] !== N || i[11] !== f || i[12] !== p || i[13] !== h || i[14] !== m || i[15] !== y || i[16] !== g || i[17] !== b || i[18] !== v || i[19] !== x || i[20] !== w || i[21] !== _ || i[22] !== C || i[23] !== E || i[24] !== T || i[25] !== k || i[26] !== S || i[27] !== O ? (e = {
            authenticationStatus: o,
            connector: s,
            connectorRoute: l,
            connectorStatus: c,
            onboardingRoute: u,
            open: d,
            options: f,
            preventClose: p,
            ready: h,
            resize: m,
            route: y,
            setAuthenticationStatus: g,
            setConnector: b,
            setConnectorRoute: v,
            setConnectorStatus: x,
            setOnboardingRoute: w,
            setOpen: _,
            setPreventClose: C,
            setRoute: E,
            triggerResize: S,
            authenticatedUser: A,
            isLoggedIn: I,
            signIn: T,
            signOut: k,
            wasSessionPersisted: O,
            getUri: R,
            openW3M: N,
            isOpenW3M: M
        }, i[0] = A, i[1] = o, i[2] = s, i[3] = l, i[4] = c, i[5] = R, i[6] = I, i[7] = M, i[8] = u, i[9] = d, i[10] = N, i[11] = f, i[12] = p, i[13] = h, i[14] = m, i[15] = y, i[16] = g, i[17] = b, i[18] = v, i[19] = x, i[20] = w, i[21] = _, i[22] = C, i[23] = E, i[24] = T, i[25] = k, i[26] = S, i[27] = O, i[28] = e) : e = i[28], e
    }
}]);

//# debugId=df1d0581-1c54-cbeb-6fb9-371d6c264815