;
! 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] = "17325cd3-f864-2360-2487-19505acb9219")
    } catch (e) {}
}();
(globalThis.TURBOPACK || (globalThis.TURBOPACK = [])).push(["object" == typeof document ? document.currentScript : void 0, 863134, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061);
    e.s(["EditIcon20", 0, function(e) {
        let a, s, n = (0, r.c)(3);
        return n[0] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsx)("path", {
            fill: "currentColor",
            d: "M16.25 15.375a.875.875 0 0 1 0 1.75H11a.875.875 0 0 1 0-1.75zM11.974 3.76a3.02 3.02 0 0 1 4.269 0h-.001a3.02 3.02 0 0 1 0 4.267h-.001l-.003.005-7.323 7.322c-.37.37-.914.636-1.406.83-.518.206-1.096.377-1.624.512a24 24 0 0 1-1.829.39q-.078.015-.122.02l-.017.003-.029.005a.874.874 0 0 1-.995-1.031l.002-.015.02-.123c.019-.105.045-.255.08-.437.07-.363.175-.86.311-1.391.135-.528.305-1.106.51-1.625.196-.491.462-1.036.832-1.406l7.322-7.322zm3.03 1.236a1.267 1.267 0 0 0-1.695-.087l-.097.087v.002l-.005.003-7.322 7.322c-.103.104-.263.365-.441.814A12 12 0 0 0 5 14.55a21 21 0 0 0-.14.589c.187-.042.387-.087.59-.139.491-.125.99-.275 1.414-.442.449-.178.71-.338.813-.441l4.019-4.019 2.296-2.297.736-.735.271-.272.003-.004h.001l.088-.097a1.27 1.27 0 0 0-.087-1.696"
        }), n[0] = a) : a = n[0], n[1] !== e ? (s = (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: a
        }), n[1] = e, n[2] = s) : s = n[2], s
    }])
}, 141438, e => {
    "use strict";
    var t, r = e.i(221628),
        a = e.i(999061),
        s = e.i(215959),
        n = e.i(416340),
        i = e.i(88240),
        o = e.i(628684),
        l = e.i(631503),
        c = e.i(784521),
        d = e.i(730474),
        u = e.i(848872),
        m = e.i(98191),
        x = e.i(178918);
    let p = {
            checked: {
                pathLength: 1,
                transition: {
                    delay: .1,
                    duration: .2
                }
            },
            unchecked: {
                pathLength: 0
            }
        },
        h = {
            checked: {
                strokeDashoffset: [-4, -4, -7.9, -7.9],
                opacity: [1, 1, 1, 0],
                transition: {
                    delay: .25,
                    duration: .3,
                    times: [0, 0, .5, 1]
                }
            },
            unchecked: {
                strokeDashoffset: 0,
                opacity: 0
            }
        },
        f = {
            checked: {
                strokeDashoffset: [-4, -4, -7.9, -7.9],
                opacity: [1, 1, 1, 0],
                transition: {
                    delay: .3,
                    duration: .15,
                    times: [0, 0, .5, 1]
                }
            },
            unchecked: {
                strokeDashoffset: 0,
                opacity: 0
            }
        },
        g = {
            checked: {
                scale: 1,
                fill: "transparent",
                stroke: "transparent",
                transition: {
                    duration: .15
                }
            },
            unchecked: {
                scale: 1,
                fill: "transparent",
                stroke: "transparent"
            }
        },
        y = e => {
            let t, n, i, o, l, c, d, u = (0, a.c)(19),
                {
                    start: m
                } = e,
                y = (0, x.useMotionValue)(0),
                b = m ? "checked" : "unchecked",
                S = m ? "checked" : "unchecked";
            u[0] !== S ? (t = (0, r.jsx)(s.motion.circle, {
                cx: "16",
                cy: "16",
                r: "7.5",
                animate: S,
                variants: g
            }), u[0] = S, u[1] = t) : t = u[1];
            let v = m ? "checked" : "unchecked";
            u[2] !== v ? (n = (0, r.jsx)(s.motion.path, {
                fill: "none",
                stroke: "#fff",
                strokeLinecap: "round",
                strokeLinejoin: "round",
                strokeWidth: "1",
                strokeDasharray: "1 8",
                strokeDashoffset: "0",
                d: "M20 16H28M16 20V28M12 16H4M16 12V4",
                animate: v,
                variants: h
            }), u[2] = v, u[3] = n) : n = u[3];
            let j = m ? "checked" : "unchecked";
            u[4] === Symbol.for("react.memo_cache_sentinel") ? (i = {
                transformOrigin: "center center"
            }, u[4] = i) : i = u[4], u[5] !== j ? (o = (0, r.jsx)(s.motion.path, {
                fill: "none",
                stroke: "#fff",
                strokeLinecap: "round",
                strokeLinejoin: "round",
                strokeWidth: "1",
                strokeDasharray: "1 8",
                strokeDashoffset: "0",
                d: "M20 16H28M16 20V28M12 16H4M16 12V4",
                animate: j,
                variants: f,
                transform: "rotate(45)",
                style: i
            }), u[5] = j, u[6] = o) : o = u[6];
            let C = m ? "checked" : "unchecked";
            return u[7] !== y ? (l = {
                pathLength: y
            }, u[7] = y, u[8] = l) : l = u[8], u[9] !== m || u[10] !== l || u[11] !== C ? (c = (0, r.jsx)(s.motion.path, {
                fill: "none",
                stroke: "#fff",
                strokeLinecap: "round",
                strokeLinejoin: "round",
                strokeWidth: "1",
                d: "M13 16l2 2 4-4",
                animate: C,
                variants: p,
                style: l,
                custom: m
            }), u[9] = m, u[10] = l, u[11] = C, u[12] = c) : c = u[12], u[13] !== b || u[14] !== c || u[15] !== t || u[16] !== n || u[17] !== o ? (d = (0, r.jsxs)(s.motion.svg, {
                initial: !1,
                animate: b,
                viewBox: "0 0 32 32",
                width: "28",
                height: "28",
                transform: "scale(2)",
                children: [t, n, o, c]
            }), u[13] = b, u[14] = c, u[15] = t, u[16] = n, u[17] = o, u[18] = d) : d = u[18], d
        };
    var b = ((t = b || {}).Resting = "resting", t.RestingDisabled = "resting_disabled", t.Loading = "loading", t.Success = "success", t);
    let S = {
        resting: {
            backgroundColor: "var(--color-brand-500)",
            opacity: 1,
            cursor: "pointer",
            transition: {
                duration: .2
            }
        },
        resting_disabled: {
            backgroundColor: "var(--color-brand-500)",
            opacity: .5,
            cursor: "not-allowed",
            transition: {
                duration: .2
            }
        },
        loading: {
            backgroundColor: "var(--color-brand-500)",
            opacity: 1,
            cursor: "wait",
            transition: {
                duration: .2
            }
        },
        success: {
            backgroundColor: "var(--green-500)",
            opacity: 1,
            cursor: "default",
            transition: {
                duration: .2
            }
        }
    };
    e.s(["default", 0, e => {
        let t, x, p, h, f, g, b, v, j, C, T, k, _, N, w, M, I, O, R, E = (0, a.c)(62),
            {
                restingCopy: q,
                setHasClickedButton: B,
                onClick: P,
                transaction: A,
                afterTransactionPromise: D,
                failFast: F,
                disabled: U
            } = e,
            {
                setShowDeploySafeModal: L,
                setShowDepositWalletMigrationModal: $
            } = (0, d.useModalStore)();
        E[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["authenticationType", "walletMode", "baseAddress"], E[0] = t) : t = E[0];
        let {
            authenticationType: G,
            walletMode: Q,
            baseAddress: z
        } = (0, c.useAccountContext)(t), {
            isSafeDeployed: W
        } = (0, o.useSafe)();
        E[1] !== z ? (x = e => e.isStuck(z), E[1] = z, E[2] = x) : x = E[2];
        let H = (0, u.useStuckSafeMigrationStore)(x),
            [Y, K] = (0, n.useState)(!1),
            [V, J] = (0, n.useState)("resting"),
            [X, Z] = (0, n.useState)(!1);
        E[3] !== A ? (p = async () => {
            if (A) {
                J("loading");
                let e = await A;
                console.log("TransactionButton", {
                    response: e
                }), e === i.TransactionResponseState.Success ? (J("success"), Z(!0)) : J("resting")
            }
        }, E[3] = A, E[4] = p) : p = E[4];
        let ee = p;
        E[5] !== D || E[6] !== ee || E[7] !== U || E[8] !== F || E[9] !== B ? (h = async () => {
            B(!0), U || F || (K(!0), await ee(), K(!1), D())
        }, E[5] = D, E[6] = ee, E[7] = U, E[8] = F, E[9] = B, E[10] = h) : h = E[10];
        let et = h;
        E[11] !== V || E[12] !== U ? (f = () => {
            U && "resting" === V ? J("resting_disabled") : U || "resting_disabled" !== V || J("resting")
        }, g = [U, V], E[11] = V, E[12] = U, E[13] = f, E[14] = g) : (f = E[13], g = E[14]), (0, n.useEffect)(f, g), E[15] !== X ? (b = () => {
            let e;
            return X && (e = setTimeout(() => {
                J("resting"), Z(!1)
            }, 1500)), () => clearTimeout(e)
        }, v = [X], E[15] = X, E[16] = b, E[17] = v) : (b = E[16], v = E[17]), (0, n.useEffect)(b, v), E[18] !== et || E[19] !== A ? (j = () => {
            A && et()
        }, E[18] = et, E[19] = A, E[20] = j) : j = E[20], E[21] !== A ? (C = [A], E[21] = A, E[22] = C) : C = E[22], (0, n.useEffect)(j, C);
        let er = "resting_disabled" === V || "loading" === V,
            ea = "loading" === V;
        return E[23] !== G || E[24] !== U || E[25] !== F || E[26] !== Y || E[27] !== W || E[28] !== H || E[29] !== P || E[30] !== B || E[31] !== L || E[32] !== $ || E[33] !== Q ? (T = () => {
            if (B(!0), !U && !F) {
                if (H) return void $(!0);
                if ("magic" !== G && (0, l.requiresWalletDeployment)(Q) && !W) return void L(!0);
                Y || P()
            }
        }, E[23] = G, E[24] = U, E[25] = F, E[26] = Y, E[27] = W, E[28] = H, E[29] = P, E[30] = B, E[31] = L, E[32] = $, E[33] = Q, E[34] = T) : T = E[34], E[35] !== V ? (k = ("resting" === V || "resting_disabled" === V) && {
            backgroundColor: "var(--color-brand-500)",
            cursor: "pointer"
        }, E[35] = V, E[36] = k) : k = E[36], E[37] !== V ? (_ = ("resting_disabled" === V || "loading" === V) && {
            opacity: .5,
            cursor: "not-allowed"
        }, E[37] = V, E[38] = _) : _ = E[38], E[39] !== k || E[40] !== _ ? (N = {
            opacity: .8,
            ...k,
            ..._
        }, E[39] = k, E[40] = _, E[41] = N) : N = E[41], E[42] !== V || E[43] !== q ? (w = ("resting" === V || "resting_disabled" === V) && (0, r.jsx)(s.motion.div, {
            className: "flex justify-center items-center gap-0.5",
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1,
                transition: {
                    duration: .2
                }
            },
            exit: {
                opacity: 0,
                transition: {
                    duration: .2
                }
            },
            children: q
        }), E[42] = V, E[43] = q, E[44] = w) : w = E[44], E[45] !== V ? (M = "loading" === V && (0, r.jsxs)(s.motion.div, {
            className: "flex justify-center items-center gap-0.5",
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1,
                transition: {
                    duration: .2
                }
            },
            exit: {
                opacity: 0,
                transition: {
                    duration: .2
                }
            },
            children: [(0, r.jsx)(m.default, {
                color: "white",
                className: "h-7 w-7 items-center"
            }), "Confirming"]
        }), E[45] = V, E[46] = M) : M = E[46], E[47] !== V || E[48] !== X ? (I = "success" === V && (0, r.jsxs)(s.motion.div, {
            className: "flex justify-center items-center gap-0.5",
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1,
                transition: {
                    duration: .2
                }
            },
            exit: {
                opacity: 0,
                transition: {
                    duration: .2
                }
            },
            children: ["Success", (0, r.jsx)(y, {
                start: X
            })]
        }), E[47] = V, E[48] = X, E[49] = I) : I = E[49], E[50] !== V || E[51] !== N || E[52] !== w || E[53] !== M || E[54] !== I ? (O = (0, r.jsxs)(s.motion.div, {
            className: "absolute inset-0 rounded-lg flex justify-center items-center overflow-hidden text-sm font-sans font-medium text-white",
            initial: !1,
            animate: V,
            variants: S,
            whileHover: N,
            children: [w, M, I]
        }), E[50] = V, E[51] = N, E[52] = w, E[53] = M, E[54] = I, E[55] = O) : O = E[55], E[56] !== q || E[57] !== er || E[58] !== ea || E[59] !== T || E[60] !== O ? (R = (0, r.jsx)(s.motion.button, {
            type: "button",
            className: "relative block h-11 w-full overflow-hidden cursor-pointer appearance-none border-0 bg-transparent p-0 m-0",
            "aria-disabled": er,
            "aria-busy": ea,
            "aria-label": q,
            onClick: T,
            children: O
        }), E[56] = q, E[57] = er, E[58] = ea, E[59] = T, E[60] = O, E[61] = R) : R = E[61], R
    }], 141438)
}, 541523, 769761, 974224, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(86831);

    function s(e) {
        let s, n, i, o, l = (0, r.c)(8);
        return l[0] !== e ? ({
            className: s,
            ...n
        } = e, l[0] = e, l[1] = s, l[2] = n) : (s = l[1], n = l[2]), l[3] !== s ? (i = (0, a.cn)("rounded-[2px] bg-[rgba(244,69,69,0.1)] p-2.5 text-sm leading-[21px] text-[#e04545]", s), l[3] = s, l[4] = i) : i = l[4], l[5] !== n || l[6] !== i ? (o = (0, t.jsx)("h3", {
            className: i,
            ...n
        }), l[5] = n, l[6] = i, l[7] = o) : o = l[7], o
    }
    e.s(["default", 0, () => {
        let e, a = (0, r.c)(1);
        return a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)(s, {
            children: "Transaction rejected."
        }), a[0] = e) : e = a[0], e
    }], 541523);
    var n = e.i(744788);
    e.s(["default", 0, () => {
        let e, a, i = (0, r.c)(2);
        return i[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)("a", {
            id: n.INTERCOM_LAUNCHER_ID,
            children: "Intercom"
        }), i[0] = e) : e = i[0], i[1] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsxs)(s, {
            children: ["Transaction failed. Please try again or contact us on", " ", e, " or", " ", (0, t.jsx)("a", {
                href: "https://discord.gg/hGYPGru",
                target: "_blank",
                rel: "noopener noreferrer",
                children: "Discord"
            }), " ", "for assistance."]
        }), i[1] = a) : a = i[1], a
    }], 769761), e.s(["default", 0, e => {
        let a, s = (0, r.c)(3),
            {
                shouldShowError: n,
                errorText: i
            } = e;
        return s[0] !== i || s[1] !== n ? (a = n && (0, t.jsx)("p", {
            className: "text-xs font-normal text-red-500 leading-[1.3]",
            children: i
        }), s[0] = i, s[1] = n, s[2] = a) : a = s[2], a
    }], 974224)
}, 107090, 329523, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(525962),
        s = e.i(435894),
        n = e.i(416340),
        i = e.i(306243),
        o = e.i(88240),
        l = e.i(249792),
        c = e.i(606572),
        d = e.i(430849),
        u = e.i(460649),
        m = e.i(99417),
        x = e.i(600326),
        p = e.i(502980),
        h = e.i(604777),
        f = e.i(399336),
        g = e.i(921807),
        y = e.i(974603),
        b = e.i(632227),
        S = e.i(541523),
        v = e.i(769761),
        j = e.i(974224),
        C = e.i(784521),
        T = e.i(684686),
        k = e.i(730474),
        _ = e.i(885092),
        N = e.i(113788),
        w = e.i(799471),
        M = e.i(306941),
        I = e.i(660006),
        O = e.i(324277),
        R = e.i(196593),
        E = e.i(631222),
        q = e.i(51800),
        B = e.i(82056),
        P = e.i(141438);
    let A = ({
        market: e,
        onComplete: r,
        onClose: f
    }) => {
        let A = (0, h.useTranslations)(),
            D = (0, l.useToast)(),
            F = (0, T.useGeoStore)(e => e.hasFetchedLocation),
            U = (0, T.useGeoStore)(e => e.permissions),
            {
                authenticated: L,
                authenticationType: $,
                proxyAddress: G,
                closedDynamic: Q
            } = (0, C.useAccountContext)(["authenticated", "authenticationType", "proxyAddress", "closedDynamic"]),
            {
                accountWalletPreferences: z
            } = (0, q.default)(),
            {
                setShowLogoutConnectionErrorModal: W
            } = (0, k.useModalStore)(),
            {
                enqueueTransaction: H
            } = (0, _.useTransactionContext)(),
            Y = (0, u.default)(),
            K = (0, g.useTransactionStore)(),
            V = (0, m.useInvalidatePositions)(),
            J = (0, n.useRef)(null),
            X = (0, w.modifyPermissionsToMatchCloseOnlyBlockAndAllowLists)(G, U, Q),
            Z = (0, n.useMemo)(() => e.conditionId, [e.conditionId]),
            ee = (0, d.default)(Z),
            et = (0, n.useMemo)(() => ee.map(e => (0, R.parseUSDCUnits)(e.toFixed(6))).reduce((e, t) => e > t ? t : e, i.maxUint256), [ee]),
            [er, ea] = (0, n.useState)(),
            [es, en] = (0, n.useState)(!1),
            [ei, eo] = (0, n.useState)(!1),
            [el, ec] = (0, n.useState)(!1),
            [ed, eu] = (0, n.useState)(() => (0, R.formatUSDCUnits)(et)),
            em = (0, R.parseUSDCUnits)(ed || "0"),
            ex = e => {
                eo(!1), ec(!1), "" === e && eu(e);
                try {
                    (0, R.parseUSDCUnits)(e), eu(e)
                } catch {
                    eu(e.slice(0, e.indexOf(".") + E.USDC_DECIMALS + 1))
                }
            },
            ep = (0, n.useCallback)((e, t) => {
                D.error(new c.ToastBuilder().title(A("trading.mergeShares.failed")).description(e).subtext(t === o.TransactionResponseState.GeneralError ? A("trading.mergeShares.errorOccurred") : A("trading.mergeShares.signatureRejected")))
            }, [D, A]),
            eh = "magic" === $,
            ef = (0, n.useCallback)(async () => {
                if (!L) return (0, I.handleError)("[MergeSharesWidgetContent > unauthenticated]", N.PolyError.MagicLinkMissing, G), ep(e.question, o.TransactionResponseState.GeneralError), o.TransactionResponseState.GeneralError;
                try {
                    let {
                        chainId: t
                    } = E.MATIC_CONFIG, r = (0, y.getMergePositionsTransaction)({
                        chainId: t,
                        chainConfig: E.chainConfig,
                        conditionId: e.conditionId ? ? "",
                        outcomeCount: e.outcomes.length ? ? 0,
                        negRisk: !!e.negRisk,
                        amount: em
                    });
                    if (eh && G) {
                        let t = (0, y.formatSyntheticMergeTransaction)({
                            conditionId: e.conditionId ? ? "",
                            amount: em,
                            outcomePrices: e.outcomePrices,
                            proxyAddress: G
                        });
                        return J.current = t, await Y(t, e), V(G), D.success(new c.ToastBuilder().position({
                            side: (0, p.getOrderToastPosition)()
                        }).title(A("trading.mergeShares.title")).description(e.question)), (0, O.executeOptimisticCTFTransaction)({
                            syntheticTxn: t,
                            syntheticTxnRef: J,
                            transaction: r,
                            market: e,
                            txnType: x.CTFTxnType.Merge,
                            outcome: "",
                            quantity: em,
                            usdc: 0 n,
                            impact: (0, p.computeMergeImpact)(em, e.outcomePrices),
                            errorTag: "Merge Shares (background)",
                            proxyAddress: G,
                            transactionStore: K,
                            enqueueTransaction: H,
                            gasPreference: z ? .advancedMode ? z.gasPreference : null,
                            customGasPrice: z ? .advancedMode ? z.customGasPrice : null,
                            onFailure: () => D.error(new c.ToastBuilder().position({
                                side: (0, p.getOrderToastPosition)()
                            }).title(A("trading.mergeShares.failed")).description(A("comments.pleaseTryAgain")))
                        }), o.TransactionResponseState.Success
                    }
                    return await H(r, E.Network.Matic, x.CTFTxnType.Merge, "", em, 0 n, e, (0, p.computeMergeImpact)(em, e.outcomePrices), z ? .advancedMode ? z.gasPreference : null, z ? .advancedMode ? z.customGasPrice : null), o.TransactionResponseState.Success
                } catch (t) {
                    return t.message.toLowerCase().includes(M.REJECTED_SIGNATURE) ? ec(!0) : eo(!0), (0, I.handleError)(t, "Merge Shares", G, I.BUG_CATEGORIES.MISSION_CRITICAL), ep(e.question, o.TransactionResponseState.GeneralError), o.TransactionResponseState.GeneralError
                }
            }, [z ? .advancedMode, z ? .gasPreference, z ? .customGasPrice, e, L, H, em, G, ep, eh, Y, K, V]),
            {
                hasError: eg,
                errorText: ey
            } = (0, B.useTxUnprocessableError)({
                units: "shares",
                isTradeLargerThanBalance: em > et,
                hasTooFewShares: em <= 0 n
            }),
            eb = (0, n.useCallback)(async () => {
                (es || en(!0), L) ? eg || (ea(ef()), ec(!1), eo(!1)): W(!0)
            }, [L, es, eg, W, ef]),
            eS = (0, n.useCallback)(async () => {
                eu(""), en(!1), ea(void 0), eo(!1), ec(!1), r(), f ? .()
            }, [r, f, ea, eu, en, ec, eo]);
        return (0, t.jsxs)(t.Fragment, {
            children: [(0, t.jsx)(a.ModalHeader, {
                children: (0, t.jsx)(a.ModalTitle, {
                    children: A("trading.mergeShares.title")
                })
            }), (0, t.jsx)(a.ModalDescription, {
                children: A("trading.mergeShares.description")
            }), (0, t.jsxs)("div", {
                className: "flex flex-col",
                children: [(0, t.jsxs)("div", {
                    className: "flex justify-between items-center mb-2",
                    children: [(0, t.jsx)("span", {
                        className: "text-sm text-text-secondary",
                        children: A("trading.mergeShares.amount")
                    }), et > 0 n && et !== i.maxUint256 && (0, t.jsxs)("div", {
                        className: "flex items-center gap-1.5",
                        children: [(0, t.jsxs)("span", {
                            className: "text-sm font-medium text-text-secondary",
                            children: [(0, R.formatUSDCUnits)(et), " ", A("topHolders.shares")]
                        }), (0, t.jsx)("button", {
                            type: "button",
                            onClick: () => ex((0, R.formatUSDCUnits)(et)),
                            className: "cursor-pointer bg-transparent border-none p-0 text-xs font-medium text-neutral-500 underline underline-offset-2 decoration-1 decoration-neutral-500/40 hover:decoration-neutral-500",
                            children: A("trading.max")
                        })]
                    })]
                }), (0, t.jsx)(s.Input, {
                    type: "number",
                    step: "any",
                    min: 0,
                    placeholder: A("events.convertPositions.enterAmount"),
                    value: ed,
                    onChange: e => ex(e.target.value)
                }), (0, t.jsx)(j.default, {
                    shouldShowError: eg && es && !er,
                    errorText: ey
                }), ei && (0, t.jsx)(v.default, {}), el && (0, t.jsx)(S.default, {})]
            }), F && !X.canMerge ? (0, t.jsx)(b.default, {
                shouldLeftAlign: !0
            }) : (0, t.jsx)(P.default, {
                restingCopy: A("trading.mergeShares.button"),
                setHasClickedButton: () => null,
                onClick: eb,
                transaction: er,
                afterTransactionPromise: eS,
                failFast: !1,
                disabled: 0 n === et || et === i.maxUint256 || eg || "" === ed || 0 >= parseFloat(ed)
            })]
        })
    };
    e.s(["default", 0, e => {
        let s, n, i = (0, r.c)(5),
            {
                onComplete: o,
                onClose: l
            } = e;
        i[0] === Symbol.for("react.memo_cache_sentinel") ? (s = ["activeMarket"], i[0] = s) : s = i[0];
        let {
            activeMarket: c
        } = (0, f.useEventActiveMarketContext)(s);
        return c ? (i[1] !== c || i[2] !== l || i[3] !== o ? (n = (0, t.jsx)(a.ModalContent, {
            children: (0, t.jsx)(A, {
                market: c,
                onComplete: o,
                onClose: l
            })
        }), i[1] = c, i[2] = l, i[3] = o, i[4] = n) : n = i[4], n) : null
    }], 107090);
    var D = e.i(23128),
        F = e.i(900519),
        U = e.i(333114),
        L = e.i(5146),
        $ = e.i(631503),
        G = e.i(767074),
        Q = e.i(679892);
    let z = ({
        onComplete: e,
        onClose: r,
        market: i
    }) => {
        let d = (0, h.useTranslations)(),
            f = (0, l.useToast)(),
            {
                authenticated: y,
                authenticationType: M,
                proxyAddress: A,
                walletMode: z,
                closedDynamic: W
            } = (0, C.useAccountContext)(["authenticated", "authenticationType", "proxyAddress", "walletMode", "closedDynamic"]),
            H = (0, T.useGeoStore)(e => e.hasFetchedLocation),
            Y = (0, T.useGeoStore)(e => e.permissions),
            {
                setShowLogoutConnectionErrorModal: K
            } = (0, k.useModalStore)(),
            {
                chain: V
            } = (0, U.useAccount)(),
            {
                trackedProxyUsdcBalance: J
            } = (0, L.default)(),
            {
                enqueueTransaction: X
            } = (0, _.useTransactionContext)(),
            Z = (0, u.default)(),
            ee = (0, g.useTransactionStore)(),
            et = (0, m.useInvalidatePositions)(),
            {
                accountWalletPreferences: er
            } = (0, q.default)(),
            {
                onBeginCheckout: ea
            } = (0, G.useFunkitContext)(),
            es = (0, n.useRef)(null),
            en = (0, w.modifyPermissionsToMatchCloseOnlyBlockAndAllowLists)(A, Y, W),
            [ei, eo] = (0, n.useState)(!1),
            [el, ec] = (0, n.useState)(!1),
            [ed, eu] = (0, n.useState)(),
            [em, ex] = (0, n.useState)(!1),
            [ep, eh] = (0, n.useState)(""),
            ef = (0, R.parseUSDCUnits)(ep || "0"),
            {
                hasError: eg,
                errorText: ey
            } = (0, B.useTxUnprocessableError)({
                units: "USDC",
                isTradeLargerThanBalance: parseFloat(ep) > J.current,
                hasTooFewShares: ef <= 0 n
            }),
            eb = (0, R.parseUSDCUnits)(ep || "0"),
            eS = e => {
                ex(!1), eo(!1), ec(!1), "" === e && eh(e);
                try {
                    (0, R.parseUSDCUnits)(e), eh(e)
                } catch {
                    eh(e.slice(0, e.indexOf(".") + E.USDC_DECIMALS + 1))
                }
            },
            ev = (0, n.useCallback)((e, t) => {
                f.error(new c.ToastBuilder().title(d("trading.splitShares.failed")).description(e).subtext(t === o.TransactionResponseState.GeneralError ? d("trading.splitShares.errorOccurred") : d("trading.splitShares.signatureRejected")))
            }, [f, d]),
            ej = "magic" === M,
            eC = (0, n.useCallback)(async () => {
                if (!y) return (0, I.handleError)("[SplitSharesWidgetContent > Neither Magiclink nor Metamask is present]", N.PolyError.MagicLinkMissing, A), ev(i.question, o.TransactionResponseState.GeneralError), o.TransactionResponseState.GeneralError;
                try {
                    let {
                        chainId: e
                    } = E.MATIC_CONFIG, t = (0, Q.getSplitPositionTransaction)({
                        chainId: e,
                        chainConfig: E.chainConfig,
                        conditionId: i.conditionId ? ? "",
                        outcomeCount: i.outcomes.length ? ? 0,
                        negRisk: i.negRisk,
                        amount: ef
                    });
                    if (ej && A) {
                        let e = (0, Q.formatSyntheticSplitTransaction)({
                            conditionId: i.conditionId ? ? "",
                            amount: ef,
                            outcomePrices: i.outcomePrices,
                            proxyAddress: A
                        });
                        return es.current = e, await Z(e, i), et(A), f.success(new c.ToastBuilder().position({
                            side: (0, p.getOrderToastPosition)()
                        }).title(d("trading.splitShares.title")).description(i.question)), (0, O.executeOptimisticCTFTransaction)({
                            syntheticTxn: e,
                            syntheticTxnRef: es,
                            transaction: t,
                            market: i,
                            txnType: x.CTFTxnType.Split,
                            outcome: "",
                            quantity: 0 n,
                            usdc: eb,
                            impact: (0, p.computeSplitImpact)(ef, i.outcomePrices),
                            errorTag: "Split Shares (background)",
                            proxyAddress: A,
                            transactionStore: ee,
                            enqueueTransaction: X,
                            gasPreference: er ? .advancedMode ? er.gasPreference : null,
                            customGasPrice: er ? .advancedMode ? er.customGasPrice : null,
                            onFailure: () => f.error(new c.ToastBuilder().position({
                                side: (0, p.getOrderToastPosition)()
                            }).title(d("trading.splitShares.failed")).description(d("comments.pleaseTryAgain")))
                        }), o.TransactionResponseState.Success
                    }
                    return await X(t, E.Network.Matic, x.CTFTxnType.Split, "", 0 n, eb, i, (0, p.computeSplitImpact)(ef, i.outcomePrices), er ? .advancedMode ? er.gasPreference : null, er ? .advancedMode ? er.customGasPrice : null), o.TransactionResponseState.Success
                } catch (e) {
                    return (0, I.handleError)(e, "Split Shares", A, I.BUG_CATEGORIES.MISSION_CRITICAL), ev(i.question, o.TransactionResponseState.GeneralError), o.TransactionResponseState.GeneralError
                }
            }, [er ? .advancedMode, er ? .customGasPrice, er ? .gasPreference, i, y, X, A, ef, eb, ev, ej, Z, ee, et]),
            eT = (0, n.useCallback)(async () => {
                (em || ex(!0), y) ? eg || (eu(eC()), ec(!1), eo(!1)): K(!0)
            }, [y, em, eg, K, eC]),
            ek = (0, n.useCallback)(async () => {
                eh(""), ex(!1), eu(void 0), eo(!1), ec(!1), e(), r ? .()
            }, [eh, ex, eu, e, r, ec, eo]);
        return (0, t.jsxs)(t.Fragment, {
            children: [(0, t.jsx)(a.ModalHeader, {
                children: (0, t.jsx)(a.ModalTitle, {
                    children: d("trading.splitShares.title")
                })
            }), J.current < .01 || (0, $.requiresManualTradingSetup)(z) && (!V || V.id !== E.MATIC_CONFIG.chainId) ? (0, t.jsxs)(t.Fragment, {
                children: [(0, t.jsx)(a.ModalDescription, {
                    children: d("trading.splitShares.mustHaveUsdc")
                }), (0, t.jsx)(D.Button, {
                    className: "w-full h-12 -top-2 rounded",
                    onClick: () => ea(),
                    children: (0, t.jsx)("span", {
                        className: "text-sm font-medium text-white",
                        children: d("trading.deposit")
                    })
                })]
            }) : (0, t.jsxs)(t.Fragment, {
                children: [(0, t.jsx)(a.ModalDescription, {
                    children: d("trading.splitShares.description")
                }), (0, t.jsxs)("div", {
                    className: "flex flex-col",
                    children: [(0, t.jsxs)("div", {
                        className: "flex justify-between items-center mb-2",
                        children: [(0, t.jsx)("span", {
                            className: "text-sm text-text-secondary",
                            children: d("trading.splitShares.amount")
                        }), (0, t.jsxs)("div", {
                            className: "flex items-center gap-1.5",
                            children: [(0, t.jsx)("span", {
                                className: "text-sm font-medium text-text-secondary",
                                children: (0, F.cashBalanceFormatter)({
                                    balance: J.current,
                                    cashLabel: d("trading.cash")
                                })
                            }), (0, t.jsx)("button", {
                                type: "button",
                                onClick: () => eS(J.current.toFixed(2)),
                                className: "cursor-pointer bg-transparent border-none p-0 text-xs font-medium text-neutral-500 underline underline-offset-2 decoration-1 decoration-neutral-500/40 hover:decoration-neutral-500",
                                children: d("trading.max")
                            })]
                        })]
                    }), (0, t.jsx)(s.Input, {
                        type: "number",
                        step: "any",
                        min: 0,
                        placeholder: d("events.convertPositions.enterAmount"),
                        value: ep,
                        onChange: e => eS(e.target.value)
                    }), (0, t.jsx)(j.default, {
                        shouldShowError: eg && em && !ed,
                        errorText: ey
                    }), ei && (0, t.jsx)(v.default, {}), el && (0, t.jsx)(S.default, {})]
                }), H && !en.canSplit ? (0, t.jsx)(b.default, {
                    shouldLeftAlign: !0
                }) : H && en.canSplit ? (0, t.jsx)(P.default, {
                    restingCopy: d("trading.splitShares.button"),
                    setHasClickedButton: () => null,
                    onClick: eT,
                    transaction: ed,
                    afterTransactionPromise: ek,
                    failFast: !1,
                    disabled: eg || "" === ep || 0 >= parseFloat(ep)
                }) : null]
            })]
        })
    };
    e.s(["default", 0, e => {
        let s, n, i = (0, r.c)(5),
            {
                onComplete: o,
                onClose: l
            } = e;
        i[0] === Symbol.for("react.memo_cache_sentinel") ? (s = ["activeMarket"], i[0] = s) : s = i[0];
        let {
            activeMarket: c
        } = (0, f.useEventActiveMarketContext)(s);
        return c ? (i[1] !== c || i[2] !== l || i[3] !== o ? (n = (0, t.jsx)(a.ModalContent, {
            children: (0, t.jsx)(z, {
                market: c,
                onComplete: o,
                onClose: l
            })
        }), i[1] = c, i[2] = l, i[3] = o, i[4] = n) : n = i[4], n) : null
    }], 329523)
}, 893680, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(328113),
        a = e.i(397456),
        s = e.i(606231),
        n = e.i(416340),
        i = e.i(53950);
    let o = (0, n.createContext)({}),
        l = e => e instanceof Error ? {
            stack: e.stack,
            ...e
        } : "object" == typeof e && null !== e ? e : {
            message: String(e)
        };
    e.s(["LiveDataWebsocketContextProvider", 0, ({
        subscriptionMessage: e,
        wsUrl: c,
        isDisabled: d,
        eventHandlers: u,
        children: m
    }) => {
        let x = (0, r.useLatest)(u),
            {
                readyState: p,
                sendMessage: h
            } = (0, s.useWebSocket)({
                url: d ? null : c ? ? "wss://ws-live-data.polymarket.com",
                onOpen: () => {
                    try {
                        h(JSON.stringify({
                            action: "subscribe",
                            ...e
                        }))
                    } catch (e) {
                        i.logger.error("useWebsocketContext > onOpen", l(e))
                    }
                },
                onMessage: e => {
                    if (e.data) try {
                        let t = JSON.parse(e.data);
                        if (t.type in u && x.current) {
                            let e = x.current[t.type];
                            t.payload && e && e(t.payload)
                        }
                    } catch (e) {
                        i.logger.error("useWebsocketContext > onMessage", l(e))
                    }
                },
                maxReconnectAttempts: 5,
                reconnectInterval: 1e4
            }),
            f = {
                [a.ReadyState.CONNECTING]: "Connecting",
                [a.ReadyState.OPEN]: "Open",
                [a.ReadyState.CLOSING]: "Closing",
                [a.ReadyState.CLOSED]: "Closed",
                [a.ReadyState.UNINSTANTIATED]: "Uninstantiated"
            }[p];
        (0, n.useEffect)(() => {
            let e;
            return "Open" === f ? (e && clearInterval(e), e = setInterval(() => {
                h("PING")
            }, 3e4)) : e && clearInterval(e), () => {
                e && clearInterval(e)
            }
        }, [f]);
        let g = (0, n.useMemo)(() => ({
            connectionStatus: f
        }), [f]);
        return (0, t.jsx)(o.Provider, {
            value: g,
            children: m
        })
    }])
}, 472149, e => {
    "use strict";
    e.s(["RFQ_SUBSCRIPTION_MESSAGE", 0, {
        subscriptions: [{
            topic: "rfq",
            type: "*"
        }]
    }])
}, 423529, 969034, e => {
    "use strict";
    var t = e.i(655740),
        r = e.i(631222),
        a = e.i(860106);
    let s = "/rfq/data/requests",
        n = "/rfq/data/quotes";
    e.s(["RFQ_QUOTE_PATH", 0, n, "RFQ_REQUEST_PATH", 0, s], 969034);
    let i = async e => {
            let a = `${r.GAMMA_API_URL}/users/rfq`;
            return await t.axios.post(a, {
                addresses: e
            }).then(({
                data: e
            }) => e)
        },
        o = async e => {
            let s = `${r.GAMMA_API_URL}/markets/rfq`;
            return await t.axios.post(s, {
                conditionIds: e
            }).then(({
                data: e
            }) => e.map(e => ({ ...e,
                outcomes: (0, a.parseJsonFromStrapi)(e.outcomes),
                clobTokenIds: (0, a.parseJsonFromStrapi)(e.clobTokenIds)
            })))
        },
        l = async (e, a, n) => {
            let i = new URLSearchParams(n ? { ...e,
                    offset: n
                } : { ...e
                }),
                o = i.toString().length > 0 ? `${r.CLOB_API_URL}${s}?${i.toString()}` : `${r.CLOB_API_URL}${s}`;
            return await t.axios.get(o, {
                headers: {
                    Accept: "application/json",
                    "Content-Type": "application/json",
                    ...a
                }
            }).then(({
                data: e
            }) => e)
        },
        c = async (e, a) => {
            let s = new URLSearchParams(e),
                i = s.toString().length > 0 ? `${r.CLOB_API_URL}${n}?${s.toString()}` : `${r.CLOB_API_URL}${n}`;
            return await t.axios.get(i, {
                headers: {
                    Accept: "application/json",
                    "Content-Type": "application/json",
                    ...a
                }
            }).then(({
                data: e
            }) => e)
        };
    e.s(["getMultipleMarketsDataFetcher", 0, o, "getMultipleUsersDataFetcher", 0, i, "getQuotesFetcher", 0, c, "getRequestsForQuotesFetcher", 0, l], 423529)
}, 732525, e => {
    "use strict";
    var t = e.i(999061);
    let r = (0, e.i(575339).createWithEqualityFn)(e => ({
        quoteMap: {},
        addNewQuote: t => e(e => t.requestId && t ? {
            quoteMap: { ...e.quoteMap,
                [t.requestId]: t
            }
        } : e),
        removeQuote: t => {
            e(e => {
                let r = { ...e.quoteMap
                };
                return delete r[t.requestId], {
                    quoteMap: r
                }
            })
        },
        chooseBestQuote: t => {
            e(e => {
                if (!e.quoteMap[t.requestId]) return {
                    quoteMap: { ...e.quoteMap,
                        [t.requestId]: t
                    }
                };
                let r = "BUY" === t.side ? e.quoteMap[t.requestId].price < t.price ? e.quoteMap[t.requestId] : t : e.quoteMap[t.requestId].price > t.price ? e.quoteMap[t.requestId] : t;
                return {
                    quoteMap: { ...e.quoteMap,
                        [t.requestId]: r
                    }
                }
            })
        },
        updateQuote: t => e(e => {
            let r;
            return (r = e.quoteMap[t.requestId], r && t.quoteId && t.condition === r.condition) ? {
                quoteMap: { ...e.quoteMap,
                    [t.requestId]: t
                }
            } : e
        })
    }));
    e.s(["useRfqQuoteState", 0, e => {
        let a, s = (0, t.c)(2);
        return s[0] !== e ? (a = t => ({
            quote: t ? .quoteMap ? .[e ? ? ""]
        }), s[0] = e, s[1] = a) : a = s[1], r(a)
    }, "useRfqQuoteStore", 0, r])
}, 738108, 368208, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(964974),
        a = e.i(416340),
        s = e.i(468462),
        n = e.i(510954),
        i = e.i(57096),
        o = e.i(784521),
        l = e.i(399841),
        c = e.i(423529),
        d = e.i(732525),
        u = e.i(969034);

    function m(e) {
        return e.addNewQuote
    }
    e.s(["useLoadQuote", 0, e => {
        let x, p, h, f, g, y, b, S, v, j = (0, t.c)(25),
            {
                generateL2Headers: C,
                apiCredential: T,
                signer: k
            } = (0, s.useL2Headers)(),
            {
                quote: _
            } = (0, d.useRfqQuoteState)(e ? .requestId),
            N = (0, d.useRfqQuoteStore)(m);
        j[0] === Symbol.for("react.memo_cache_sentinel") ? (x = ["proxyAddress"], j[0] = x) : x = j[0];
        let {
            proxyAddress: w
        } = (0, o.useAccountContext)(x), M = (0, l.useFeatureFlag)("rfq"), I = !!w && !!T ? .key && !!k, O = e ? .market;
        j[1] !== w || j[2] !== O ? (p = {
            state: "active",
            markets: O
        }, f = r.useQuery, h = n.queryKeys[i.QueryKey.Rfq].quotes(w, p), j[1] = w, j[2] = O, j[3] = p, j[4] = h, j[5] = f) : (p = j[3], h = j[4], f = j[5]), j[6] !== C || j[7] !== p ? (g = async () => {
            let e = {
                    method: "GET",
                    requestPath: u.RFQ_QUOTE_PATH
                },
                t = await C(e);
            return (0, c.getQuotesFetcher)(p, t)
        }, j[6] = C, j[7] = p, j[8] = g) : g = j[8];
        let R = M && I && !!e ? .requestId;
        j[9] !== h.queryKey || j[10] !== g || j[11] !== R ? (y = {
            queryKey: h.queryKey,
            queryFn: g,
            enabled: R,
            refetchOnWindowFocus: !1,
            refetchOnReconnect: !1,
            refetchOnMount: !1,
            gcTime: 3e5,
            staleTime: 3e5
        }, j[9] = h.queryKey, j[10] = g, j[11] = R, j[12] = y) : y = j[12];
        let {
            data: E
        } = f(y);
        j[13] === Symbol.for("react.memo_cache_sentinel") ? (b = new Set, j[13] = b) : b = j[13];
        let q = (0, a.useRef)(b);
        j[14] !== N || j[15] !== _ || j[16] !== E || j[17] !== e ? (S = () => {
            if (!_ && E && Array.isArray(E ? .data) && !_ && e ? .market) {
                let t = E.data.find(t => t.requestId === e.requestId),
                    r = q.current.has(e.requestId);
                t && !r && (N(t), q.current.add(e.requestId))
            }
        }, j[14] = N, j[15] = _, j[16] = E, j[17] = e, j[18] = S) : S = j[18], j[19] !== N || j[20] !== w || j[21] !== _ || j[22] !== E || j[23] !== e ? (v = [E, e, N, _, w], j[19] = N, j[20] = w, j[21] = _, j[22] = E, j[23] = e, j[24] = v) : v = j[24], (0, a.useEffect)(S, v)
    }], 738108);
    var x = e.i(221628);
    e.s(["Stopwatch", 0, e => {
        let r, a, s, n, i, o, l, c, d, u, m, p, h, f, g = (0, t.c)(25);
        g[0] !== e ? ({
            size: a,
            title: s,
            color: n,
            progress: i,
            ...r
        } = e, g[0] = e, g[1] = r, g[2] = a, g[3] = s, g[4] = n, g[5] = i) : (r = g[1], a = g[2], s = g[3], n = g[4], i = g[5]);
        let y = void 0 === a ? 18 : a,
            b = void 0 === s ? "sliders" : s,
            S = void 0 === n ? "currentColor" : n,
            v = -(2 * (void 0 === i ? 0 : i)) * Math.PI - Math.PI / 2,
            j = 9 + 3.25 * Math.cos(v),
            C = 10 + 3.25 * Math.sin(v);
        return g[6] !== b ? (o = (0, x.jsx)("title", {
            children: b
        }), g[6] = b, g[7] = o) : o = g[7], g[8] === Symbol.for("react.memo_cache_sentinel") ? (l = (0, x.jsx)("line", {
            x1: "6.75",
            y1: "1.25",
            x2: "11.25",
            y2: "1.25"
        }), c = (0, x.jsx)("line", {
            x1: "9",
            y1: "1.25",
            x2: "9",
            y2: "3.75"
        }), d = (0, x.jsx)("circle", {
            cx: "9",
            cy: "10",
            r: "6.25"
        }), g[8] = l, g[9] = c, g[10] = d) : (l = g[8], c = g[9], d = g[10]), g[11] !== j || g[12] !== C ? (u = (0, x.jsx)("line", {
            x1: j,
            y1: C,
            x2: 9,
            y2: 10
        }), g[11] = j, g[12] = C, g[13] = u) : u = g[13], g[14] === Symbol.for("react.memo_cache_sentinel") ? (m = (0, x.jsx)("line", {
            x1: "14.25",
            y1: "2.75",
            x2: "16.25",
            y2: "4.75"
        }), g[14] = m) : m = g[14], g[15] !== S || g[16] !== u ? (p = (0, x.jsxs)("g", {
            fill: "none",
            strokeLinecap: "round",
            strokeLinejoin: "round",
            strokeWidth: "1.5",
            stroke: S,
            children: [l, c, d, u, m]
        }), g[15] = S, g[16] = u, g[17] = p) : p = g[17], g[18] !== y || g[19] !== p || g[20] !== o ? (h = (0, x.jsxs)("svg", {
            xmlns: "http://www.w3.org/2000/svg",
            width: y,
            height: y,
            viewBox: "0 0 18 18",
            fill: "none",
            stroke: "currentColor",
            strokeWidth: "1.5",
            strokeLinecap: "round",
            strokeLinejoin: "round",
            children: [o, p]
        }), g[18] = y, g[19] = p, g[20] = o, g[21] = h) : h = g[21], g[22] !== r || g[23] !== h ? (f = (0, x.jsx)("div", {
            className: "select-none rounded-md flex items-center justify-center",
            ...r,
            children: h
        }), g[22] = r, g[23] = h, g[24] = f) : f = g[24], f
    }], 368208)
}, 113927, 610162, e => {
    "use strict";
    let t = {
        january: 0,
        february: 1,
        march: 2,
        april: 3,
        may: 4,
        june: 5,
        july: 6,
        august: 7,
        september: 8,
        october: 9,
        november: 10,
        december: 11
    };
    e.s(["MONTH_TO_INDEX", 0, t, "isWeatherEvent", 0, e => (e ? ? []).some(e => {
        let t = e ? .slug ? .toLowerCase ? .() ? ? "",
            r = e ? .label ? .toLowerCase ? .() ? ? "";
        return "weather" === t || "weather" === r
    })], 610162);
    var r = e.i(446789);
    let a = e => e.toString().padStart(2, "0"),
        s = [-1, 0, 1, 2, 3, 4],
        n = e => {
            if (!e) return null;
            let t = Date.parse(e);
            return Number.isNaN(t) ? null : t
        },
        i = e => `${e.getFullYear()}-${a(e.getMonth()+1)}-${a(e.getDate())}`,
        o = (e, t) => {
            let r = new Date(e);
            return r.setHours(12, 0, 0, 0), r.setDate(r.getDate() + t), r
        };
    e.s(["buildSelectableDates", 0, (e, t = "en") => s.map(a => {
        let s = o(e, a);
        return {
            key: i(s),
            label: ((e, t = "en") => new Intl.DateTimeFormat((0, r.getIntlLocale)(t), {
                month: "short",
                day: "numeric"
            }).format(e))(s, t)
        }
    }), "getDefaultSelectableDateKey", 0, e => i(o(e, 1)), "getEventDateKey", 0, e => {
        let r = (e.slug || "").match(/on-([a-z]+)-(\d{1,2})-(\d{4})/i);
        if (r) {
            let e = t[r[1].toLowerCase()];
            if (void 0 !== e) return `${r[3]}-${a(e+1)}-${a(Number(r[2]))}`
        }
        let s = n(e.endDate || e.end_date);
        return s ? i(new Date(s)) : null
    }, "getOffsetDate", 0, o, "toDateKey", 0, i, "toTimestamp", 0, n], 113927)
}, 26402, 886690, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(294781),
        s = e.i(416340),
        n = e.i(784521),
        i = e.i(399841),
        o = e.i(893680),
        l = e.i(472149),
        c = e.i(738108),
        d = e.i(964974),
        u = e.i(468462),
        m = e.i(510954),
        x = e.i(57096),
        p = e.i(399336),
        h = e.i(423529);
    let f = (e, t) => !!e && !!t && (e ? .state === "STATE_ACCEPTING_QUOTES" || e ? .state === "STATE_REQUEST_QUOTED") && e.proxyAddress.toLowerCase() === t ? .toLowerCase(),
        g = (0, e.i(575339).createWithEqualityFn)(e => ({
            request: null,
            addRequest: (t, r) => e(e => f(t, r) ? {
                request: t
            } : {
                request: null
            }),
            removeRequest: t => {
                e(e => e.request && e.request.requestId === t.requestId ? {
                    request: null
                } : e)
            }
        })),
        y = () => g(b);

    function b(e) {
        return {
            request: e.request
        }
    }
    e.s(["useRfqRequestState", 0, y, "useRfqRequestStore", 0, g], 886690);
    var S = e.i(969034);

    function v(e) {
        return e.addRequest
    }
    var j = e.i(732525);

    function C(e) {
        return e.addRequest
    }

    function T(e) {
        return e.removeRequest
    }

    function k(e) {
        return e.removeQuote
    }

    function _(e) {
        return e.updateQuote
    }

    function N(e) {
        return e.chooseBestQuote
    }
    e.s(["default", 0, e => {
        let b, w, M, I, O, R, E = (0, r.c)(20),
            {
                children: q
            } = e,
            B = (0, a.useRouter)();
        E[0] !== B ? (b = !!B ? .isReady && B.asPath.includes("us-recession-in-2025"), E[0] = B, E[1] = b) : b = E[1];
        let P = b,
            A = (0, i.useFeatureFlag)("rfq");
        E[2] === Symbol.for("react.memo_cache_sentinel") ? (w = ["proxyAddress"], E[2] = w) : w = E[2];
        let {
            proxyAddress: D
        } = (0, n.useAccountContext)(w);
        (() => {
            let e, t, a, o, l, c, b, j, C, T, k = (0, r.c)(28);
            k[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["activeMarket"], k[0] = e) : e = k[0];
            let {
                activeMarket: _
            } = (0, p.useEventActiveMarketContext)(e), {
                generateL2Headers: N,
                apiCredential: w,
                signer: M
            } = (0, u.useL2Headers)(), I = g(v), {
                request: O
            } = y();
            k[1] === Symbol.for("react.memo_cache_sentinel") ? (t = ["proxyAddress"], k[1] = t) : t = k[1];
            let {
                proxyAddress: R
            } = (0, n.useAccountContext)(t), E = (0, i.useFeatureFlag)("rfq"), q = !!R && !!w ? .key && !!M;
            k[2] !== _.conditionId || k[3] !== R ? (a = {
                state: "active",
                markets: _.conditionId
            }, l = d.useQuery, o = m.queryKeys[x.QueryKey.Rfq].requests(R, a), k[2] = _.conditionId, k[3] = R, k[4] = a, k[5] = o, k[6] = l) : (a = k[4], o = k[5], l = k[6]), k[7] !== N || k[8] !== a ? (c = async e => {
                let t = {
                        method: "GET",
                        requestPath: S.RFQ_REQUEST_PATH
                    },
                    r = await N(t);
                return (0, h.getRequestsForQuotesFetcher)(a, r)
            }, k[7] = N, k[8] = a, k[9] = c) : c = k[9];
            let B = E && q && !!_.conditionId;
            k[10] !== o.queryKey || k[11] !== c || k[12] !== B ? (b = {
                queryKey: o.queryKey,
                queryFn: c,
                enabled: B,
                refetchOnWindowFocus: !1,
                refetchOnReconnect: !1,
                refetchOnMount: !1,
                gcTime: 3e5,
                staleTime: 3e5
            }, k[10] = o.queryKey, k[11] = c, k[12] = B, k[13] = b) : b = k[13];
            let {
                data: P
            } = l(b), A = (0, s.useRef)(!1);
            k[14] !== R || k[15] !== P ? .data ? (j = P ? .data ? .filter(e => f(e, R)), k[14] = R, k[15] = P ? .data, k[16] = j) : j = k[16];
            let D = j;
            k[17] !== I || k[18] !== R || k[19] !== O || k[20] !== D ? (C = () => {
                !A.current && Array.isArray(D) && D.length > 0 && !O && (I(D[0], R), A.current = !0)
            }, k[17] = I, k[18] = R, k[19] = O, k[20] = D, k[21] = C) : C = k[21], k[22] !== I || k[23] !== R || k[24] !== O || k[25] !== P || k[26] !== D ? (T = [I, O, P, R, D], k[22] = I, k[23] = R, k[24] = O, k[25] = P, k[26] = D, k[27] = T) : T = k[27], (0, s.useEffect)(C, T)
        })();
        let {
            request: F
        } = g(), U = g(C), L = g(T);
        (0, c.useLoadQuote)(F);
        let $ = (0, j.useRfqQuoteStore)(k),
            G = (0, j.useRfqQuoteStore)(_),
            Q = (0, j.useRfqQuoteStore)(N);
        E[3] !== U || E[4] !== D ? (M = e => U(e, D), E[3] = U, E[4] = D, E[5] = M) : M = E[5], E[6] !== U || E[7] !== D ? (I = e => U(e, D), E[6] = U, E[7] = D, E[8] = I) : I = E[8], E[9] !== Q || E[10] !== $ || E[11] !== L || E[12] !== M || E[13] !== I || E[14] !== G ? (O = {
            request_created: M,
            request_canceled: L,
            request_expired: L,
            request_edited: I,
            quote_created: Q,
            quote_edited: G,
            quote_canceled: $,
            quote_expired: $
        }, E[9] = Q, E[10] = $, E[11] = L, E[12] = M, E[13] = I, E[14] = G, E[15] = O) : O = E[15];
        let z = O,
            W = !(P && A);
        return E[16] !== q || E[17] !== z || E[18] !== W ? (R = (0, t.jsx)(o.LiveDataWebsocketContextProvider, {
            isDisabled: W,
            eventHandlers: z,
            subscriptionMessage: l.RFQ_SUBSCRIPTION_MESSAGE,
            children: q
        }), E[16] = q, E[17] = z, E[18] = W, E[19] = R) : R = E[19], R
    }], 26402)
}, 130041, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(169010),
        s = e.i(208956),
        n = e.i(44326),
        i = e.i(416340),
        o = e.i(922445),
        l = e.i(604777),
        c = e.i(870555);

    function d() {
        let e, a, n = (0, r.c)(4),
            i = (0, l.useTranslations)();
        return n[0] !== i ? (e = i("navbar.termsOfUse"), n[0] = i, n[1] = e) : e = n[1], n[2] !== e ? (a = (0, t.jsx)(s.default, {
            href: "/tos",
            target: "_blank",
            rel: "noopener noreferrer",
            className: "underline text-inherit [-webkit-tap-highlight-color:rgba(0,0,0,0.2)]",
            children: e
        }), n[2] = e, n[3] = a) : a = n[3], a
    }
    let u = (0, i.memo)(function(e) {
        let s, i, u, m, x, p, h, f = (0, r.c)(15),
            {
                className: g
            } = e,
            y = (0, l.useTranslations)();
        return f[0] !== g ? (s = (0, c.cn)("bg-transparent text-body-sm text-neutral-500 outline-none focus:outline-none active:outline-none", g), f[0] = g, f[1] = s) : s = f[1], f[2] !== y ? (i = y("trading.termsOfService.byTradingYouAgree"), f[2] = y, f[3] = i) : i = f[3], f[4] === Symbol.for("react.memo_cache_sentinel") ? (u = (0, t.jsx)(d, {}), f[4] = u) : u = f[4], f[5] !== s || f[6] !== i ? (m = (0, t.jsxs)(a.TooltipTrigger, {
            className: s,
            children: [i, " ", u, "."]
        }), f[5] = s, f[6] = i, f[7] = m) : m = f[7], f[8] !== y ? (x = y("trading.termsOfService.tooltipText"), f[8] = y, f[9] = x) : x = f[9], f[10] !== x ? (p = (0, t.jsx)(a.TooltipContent, {
            side: "top",
            align: "center",
            sideOffset: 12,
            className: "w-[calc(100vw-2rem)] lg:max-w-[300px]",
            children: x
        }), f[10] = x, f[11] = p) : p = f[11], f[12] !== m || f[13] !== p ? (h = (0, t.jsx)(a.TooltipProvider, {
            delayDuration: 500 * !(0, o.isNarrowViewport)(),
            children: (0, t.jsxs)(n.Tooltip.Root, {
                children: [m, p]
            })
        }), f[12] = m, f[13] = p, f[14] = h) : h = f[14], h
    });
    e.s(["TermsOfService", 0, u])
}, 364917, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(740594),
        s = e.i(525962),
        n = e.i(169010),
        i = e.i(336846),
        o = e.i(86831);

    function l(e) {
        let a, s, n, i, l, c, d = (0, r.c)(12);
        d[0] !== e ? ({
            asChild: a,
            className: n,
            children: s,
            ...i
        } = e, d[0] = e, d[1] = a, d[2] = s, d[3] = n, d[4] = i) : (a = d[1], s = d[2], n = d[3], i = d[4]);
        let u = a ? "rounded-none border-none" : "rounded-xl border border-border";
        return d[5] !== n || d[6] !== u ? (l = (0, o.cn)("flex h-full relative shadow-md flex-col gap-5 bg-surface-1 px-4 py-4 overflow-visible", u, n), d[5] = n, d[6] = u, d[7] = l) : l = d[7], d[8] !== s || d[9] !== i || d[10] !== l ? (c = (0, t.jsx)("div", {
            className: l,
            ...i,
            children: s
        }), d[8] = s, d[9] = i, d[10] = l, d[11] = c) : c = d[11], c
    }
    var c = e.i(604777),
        d = e.i(213567),
        u = e.i(107090),
        m = e.i(458164),
        x = e.i(329523),
        p = e.i(938),
        h = e.i(660635),
        f = e.i(399336),
        g = e.i(891685),
        y = e.i(880809),
        b = e.i(467126),
        S = e.i(288576),
        v = e.i(870555),
        j = e.i(723823),
        C = e.i(328113),
        T = e.i(140527),
        k = e.i(219469),
        _ = e.i(44326),
        N = e.i(416340),
        w = e.i(333114),
        M = e.i(73836),
        I = e.i(88240),
        O = e.i(827681),
        R = e.i(863828),
        E = e.i(100825),
        q = e.i(112014),
        B = e.i(369038),
        P = e.i(101008),
        A = e.i(928810),
        D = e.i(983707),
        F = e.i(43286),
        U = e.i(102881),
        L = e.i(185291),
        $ = e.i(6204),
        G = e.i(688608),
        Q = e.i(909420),
        z = e.i(554637),
        W = e.i(202187),
        H = e.i(767592),
        Y = e.i(593332),
        K = e.i(349488),
        V = e.i(5146),
        J = e.i(780641),
        X = e.i(631503),
        Z = e.i(514687),
        ee = e.i(762769),
        et = e.i(400819),
        er = e.i(732525),
        ea = e.i(886690),
        es = e.i(668122),
        en = e.i(79075),
        ei = e.i(848872),
        eo = e.i(730474),
        el = e.i(784521),
        ec = e.i(305457),
        ed = e.i(841231),
        eu = e.i(767074),
        em = e.i(684686),
        ex = e.i(660006),
        ep = e.i(196593),
        eh = e.i(53950),
        ef = e.i(631222),
        eg = e.i(156591),
        ey = e.i(215959),
        eb = e.i(484864),
        eS = e.i(507909);
    let ev = {
            opacity: 0
        },
        ej = {
            opacity: 1
        },
        eC = {
            opacity: 0
        },
        eT = { ...eS.opacityTransition
        };

    function ek(e) {
        let a, s, n, i = (0, r.c)(6),
            {
                onTap: o
            } = e;
        i[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["setShouldShowSlippageWarning"], i[0] = a) : a = i[0];
        let {
            setShouldShowSlippageWarning: l
        } = (0, y.useTradeContext)(a);
        return i[1] !== l ? (s = () => {
            l(!1)
        }, i[1] = l, i[2] = s) : s = i[2], i[3] !== o || i[4] !== s ? (n = (0, t.jsx)(ey.motion.div, {
            initial: ev,
            animate: ej,
            exit: eC,
            transition: eT,
            className: "absolute inset-0 z-1 backdrop-blur bg-white/90 dark:bg-neutral-0/90 overflow-hidden rounded-xl flex flex-col",
            children: (0, t.jsx)("div", {
                className: "w-full h-full overflow-y-auto box-border flex items-center",
                children: (0, t.jsx)(eb.default, {
                    onConfirm: o,
                    hideWarning: s
                })
            })
        }), i[3] = o, i[4] = s, i[5] = n) : n = i[5], n
    }
    ek.displayName = "SlippageWarning";
    var e_ = e.i(208956),
        eN = e.i(501527);
    let ew = () => {
            let e, a, s, i, o, l, d, u, m, x = (0, r.c)(19),
                p = (0, c.useTranslations)();
            return x[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)(eN.IconGlobe2Fill18, {
                className: "size-4"
            }), x[0] = e) : e = x[0], x[1] !== p ? (a = p("trading.geoRestrictions.restrictedRegion"), x[1] = p, x[2] = a) : a = x[2], x[3] !== a ? (s = (0, t.jsx)(n.TooltipTrigger, {
                asChild: !0,
                children: (0, t.jsx)(D.TradingButton, {
                    color: "gray",
                    hoverHeightOffset: 0,
                    height: 48,
                    shadowHeight: 5,
                    className: "opacity-50",
                    softDisable: !0,
                    children: (0, t.jsxs)("span", {
                        className: "flex items-center gap-2 text-sm font-semibold text-text-secondary",
                        children: [e, a]
                    })
                })
            }), x[3] = a, x[4] = s) : s = x[4], x[5] !== p ? (i = p("trading.geoRestrictions.tradingUnavailableInRegion"), x[5] = p, x[6] = i) : i = x[6], x[7] !== i ? (o = (0, t.jsx)("p", {
                children: i
            }), x[7] = i, x[8] = o) : o = x[8], x[9] !== p ? (l = p("trading.geoRestrictions.availableRegions"), x[9] = p, x[10] = l) : l = x[10], x[11] !== l ? (d = (0, t.jsx)(e_.default, {
                href: `${ef.POLYMARKET_DOCS_LINK}/api-reference/geoblock#blocked-countries`,
                target: "_blank",
                rel: "noopener noreferrer",
                className: "underline text-brand-500 hover:opacity-80",
                children: l
            }), x[11] = l, x[12] = d) : d = x[12], x[13] !== o || x[14] !== d ? (u = (0, t.jsxs)(n.TooltipContent, {
                side: "top",
                align: "center",
                sideOffset: 12,
                className: "w-[calc(100vw-2rem)] lg:w-[calc(338px-3rem)] py-2",
                children: [o, d]
            }), x[13] = o, x[14] = d, x[15] = u) : u = x[15], x[16] !== s || x[17] !== u ? (m = (0, t.jsx)(n.TooltipProvider, {
                children: (0, t.jsxs)(_.Tooltip.Root, {
                    children: [s, u]
                })
            }), x[16] = s, x[17] = u, x[18] = m) : m = x[18], m
        },
        eM = ["gameState"],
        eI = ({
            enableOrderToasts: e = !0,
            onClose: i,
            onSuccess: o,
            onError: l,
            gameState: d,
            trackingPage: u = "events",
            trackingViewMode: x
        }) => {
            let p, h, {
                    switchChainAsync: b
                } = (0, M.useSwitchChain)(),
                {
                    chain: S
                } = (0, w.useAccount)(),
                {
                    isNegRiskSportsEvent: ey
                } = (0, g.useEventContext)(["isNegRiskSportsEvent"]),
                {
                    activeMarket: eb
                } = (0, f.useEventActiveMarketContext)(["activeMarket"]),
                {
                    side: eS,
                    setShares: ev,
                    shares: ej,
                    handleResetPriceState: eC,
                    price: eT,
                    orderType: e_,
                    hasTouchedAllFields: eN,
                    setHasTouchedPrice: eM,
                    setHasTouchedShares: eI,
                    selectedOutcome: eO,
                    setAmountUpdateLocation: eR,
                    selectedOutcomeIdx: eE,
                    shouldShowSlippageWarning: eq,
                    setShouldShowSlippageWarning: eB
                } = (0, y.useTradeContext)(["side", "setShares", "shares", "handleResetPriceState", "price", "orderType", "hasTouchedAllFields", "setHasTouchedPrice", "setHasTouchedShares", "selectedOutcome", "setAmountUpdateLocation", "selectedOutcomeIdx", "shouldShowSlippageWarning", "setShouldShowSlippageWarning"]),
                {
                    trackedProxyUsdcBalance: eP
                } = (0, V.default)(),
                eA = (0, ec.useAmplitudeAnalytics)(),
                {
                    onBeginCheckout: eD
                } = (0, eu.useFunkitContext)(),
                eF = (h = (0, H.useSlippage)(), (0, C.useLatest)(h)),
                eU = (0, j.useBestPrice)(eb, eE, "ask"),
                eL = (0, j.useBestPrice)(eb, eE, "bid"),
                {
                    allowanceErrorMsg: e$,
                    areAllAllowancesApproved: eG,
                    hasLoadedAllowances: eQ,
                    isUpdatingAllowances: ez,
                    loadAllowanceMap: eW
                } = (0, q.useAllowanceContext)(),
                {
                    clob: eH,
                    apiErrorMessage: eY
                } = (0, et.useClobCredentialContext)(),
                eK = (0, I.useCreateOrder)(),
                eV = (() => {
                    let e = (0, et.useClob)(),
                        {
                            activeMarket: t
                        } = (0, f.useEventActiveMarketContext)(["activeMarket"]),
                        {
                            selectedOutcomeIdx: r
                        } = (0, y.useTradeContext)(["selectedOutcomeIdx"]);
                    return (0, N.useCallback)(async () => {
                        if (!e || !t.clobTokenIds) return I.TransactionResponseState.SignatureError;
                        let s = a.Side.BUY,
                            n = {
                                tokenID: t.clobTokenIds[r],
                                side: s,
                                size: 12,
                                price: .5
                            };
                        console.log("RfqRequestContext payload", n);
                        try {
                            let t = await e.createRfqRequest(n, {
                                tickSize: "0.01",
                                negRisk: !1
                            });
                            console.log("RfqRequestContext request", t);
                            let r = await e.postRfqRequest(t);
                            if (console.log("RfqRequestContext resp", r), r.requestId && r.expiry) return I.TransactionResponseState.Success;
                            return I.TransactionResponseState.GeneralError
                        } catch {
                            return I.TransactionResponseState.GeneralError
                        }
                    }, [e, r, t])
                })(),
                {
                    request: eJ
                } = (0, ea.useRfqRequestState)(),
                {
                    quote: eX
                } = (0, er.useRfqQuoteState)(eJ ? .requestId),
                {
                    hasQuote: eZ,
                    waitingForQuote: e0
                } = (0, N.useMemo)(() => e_ !== m.OrderType.RFQ ? {
                    hasQuote: !1,
                    waitingForQuote: !1
                } : {
                    hasQuote: !!eJ && !!eX,
                    waitingForQuote: !!eJ && !eX
                }, [e_, eJ, eX]),
                e1 = (0, ed.useComplianceStore)(e => e.checkCompliance),
                e2 = (0, ed.useComplianceStore)(e => e.requiresTermsAcceptance),
                e3 = (0, ee.useMigrationStore)(e => e.reopenModal),
                {
                    isOrderInvalid: e4,
                    orderError: e5,
                    setHasClicked: e6,
                    hasClicked: e8
                } = (0, B.useOrderValidationWithPendingSell)(),
                e9 = (0, em.useGeoStore)(e => e.hasFetchedLocation),
                {
                    setOpen: e7,
                    setConnectorRoute: te
                } = (0, R.useSiwx)(),
                {
                    proxyAddress: tt,
                    authenticated: tr,
                    authenticationType: ta,
                    walletMode: ts,
                    isMigrationActive: tn,
                    baseAddress: ti
                } = (0, el.useAccountContext)(["proxyAddress", "authenticated", "authenticationType", "walletMode", "isMigrationActive", "baseAddress"]),
                to = (0, eo.useModalStore)(e => e.setShowDepositWalletMigrationModal),
                tl = (0, ei.useStuckSafeMigrationStore)(e => e.isStuck(ti)),
                tc = (0, J.usePermissions)(),
                td = N.default.useRef(null),
                tu = ((e, t, a) => {
                    let s, n, i = (0, r.c)(10);
                    i[0] === Symbol.for("react.memo_cache_sentinel") ? (s = ["isSportsPage"], i[0] = s) : s = i[0];
                    let {
                        isSportsPage: o
                    } = (0, $.useSportsContext)(s);
                    e: {
                        let r;
                        if (!o) {
                            let e;
                            i[1] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                                color: void 0,
                                customColors: void 0
                            }, i[1] = e) : e = i[1], n = e;
                            break e
                        }
                        if (a && !G.ENABLE_NEG_RISK_COLORS) {
                            let e;
                            i[2] !== a || i[3] !== t ? (e = (0, z.getDefaultButtonColors)({
                                outcomeIdx: t,
                                isNegRisk: a
                            }), i[2] = a, i[3] = t, i[4] = e) : e = i[4], n = e;
                            break e
                        }
                        if (a) {
                            let t;
                            if (i[5] !== e) {
                                let r = (0, Q.getTeam)({
                                    market: e
                                });
                                t = (0, z.getSportsButtonColor)({
                                    team: r
                                }), i[5] = e, i[6] = t
                            } else t = i[6];
                            n = t;
                            break e
                        }
                        if (i[7] !== e || i[8] !== t) {
                            let a = (0, Q.getTeam)({
                                market: e,
                                outcomeIndex: t
                            });
                            r = (0, z.getSportsButtonColor)({
                                team: a
                            }), i[7] = e, i[8] = t, i[9] = r
                        } else r = i[9];n = r
                    }
                    return n
                })(eb, eE, ey),
                {
                    isSportsPage: tm
                } = (0, $.useSportsContext)(["isSportsPage"]),
                tx = (0, E.useSportSlug)(),
                tp = (0, L.useNeedsBalanceUpgrade)(),
                [th, tf] = N.default.useState(!1),
                {
                    color: tg,
                    customColors: ty
                } = N.default.useMemo(() => "nrfi" === eb.sportsMarketType || "both_teams_to_score" === eb.sportsMarketType ? {
                    color: "blue",
                    customColors: void 0
                } : !ey && "totals" !== eb.sportsMarketType || tu.color || tu.customColors ? tu : {
                    color: 0 === eE ? "green" : "red",
                    customColors: void 0
                }, [tu, ey, eb, eE]),
                [tb, tS] = N.default.useState("rest"),
                tv = (0, N.useMemo)(() => (0, eg.getPrecisionFromTickSize)(eb ? .orderPriceMinTickSize), [eb ? .orderPriceMinTickSize]),
                tj = (0, N.useMemo)(() => "" !== eT && parseFloat(eT) > 0 ? {
                    shouldReset: !1,
                    value: eT
                } : eS === a.Side.BUY ? {
                    shouldReset: !0,
                    value: (0, ep.showPaddedCentsOnly)(eU.value.toString(), tv)
                } : {
                    shouldReset: !0,
                    value: (0, ep.showPaddedCentsOnly)(eL.value.toString(), tv)
                }, [eU, eL, tv, eS, eT]),
                tC = (0, N.useCallback)(() => {
                    e_ === m.OrderType.Market && ev(""), eR("click"), eM(!1), eI(!1), e6(!1);
                    let {
                        shouldReset: e,
                        value: t
                    } = tj;
                    e && eC(t)
                }, [ev, eM, eI, eC, e6, tj, eR, e_]),
                tT = (0, N.useCallback)(async (e = 137) => {
                    try {
                        tS("switching-networks");
                        let t = await b ? .({
                            chainId: e
                        });
                        t ? .id === e && await eW()
                    } catch (e) {
                        tS("rest"), (0, ex.handleError)(e, "[BuySellWidget > BuySellButton > handleNetworkSwitch]", tt)
                    }
                }, [eW, tt, b]),
                {
                    confetti: tk
                } = (0, W.useOnTapConfetti)(),
                t_ = N.default.useRef(!1);
            N.default.useEffect(() => {
                eq || (t_.current = !1)
            }, [eq]);
            let tN = N.default.useCallback(async (t, r) => {
                    if (eh.logger.debug("[BuySellButton > handleClick]", {
                            areAllAllowancesApproved: eG,
                            authenticated: tr,
                            authenticationType: ta,
                            walletMode: ts,
                            clob: eH,
                            hasFetchedLocation: e9,
                            hasLoadedAllowances: eQ,
                            isUpdatingAllowances: ez,
                            proxyAddress: tt
                        }), e6(!0), tl) return to(!0), I.TransactionResponseState.Break; {
                        let e = {
                            content_ids: [eb.slug],
                            content_type: "market",
                            content_name: eb.question,
                            currency: "USD",
                            value: parseFloat(ej) || 0,
                            order_type: e_ === m.OrderType.Market ? "market" : e_ === m.OrderType.RFQ ? "rfq" : "limit",
                            side: eS === a.Side.BUY ? "buy" : "sell"
                        };
                        window.dataLayer ? .push({
                            event: "initiate_checkout",
                            ...e
                        })
                    }
                    if (e4) return I.TransactionResponseState.Break;
                    if (!t_.current && (eF.current ? ? 0) >= ef.PRICE_CHANGE_WARNING_CLOB && e_ === m.OrderType.Market) return eB(!0), t_.current = !0, I.TransactionResponseState.Break;
                    t_.current || (t_.current = !1, eB(!1)), Date.now();
                    let s = "magic" === ta,
                        n = !0;
                    if (!e4) try {
                        let i;
                        (!S || S.id && ef.MATIC_CONFIG.chainId !== S.id) && await tT(), (0, X.requiresManualTradingSetup)(ts) && tS("submitting"), e_ === m.OrderType.RFQ ? (console.log("inside orderType === OrderType.RFQ"), i = eV()) : i = eK({
                            options: {
                                successToast: e,
                                errorToast: e
                            },
                            values: {
                                side: eS,
                                selectedOutcomeIdx: eE
                            },
                            tracking: {
                                page: u,
                                source: "buy-sell-widget",
                                viewMode: x
                            }
                        }, {
                            limit: {
                                onSuccess: e => o ? .(e.transaction)
                            },
                            market: {
                                onSuccess: e => o ? .(e.transaction)
                            }
                        }), s && (tS("success"), tC(), e_ === m.OrderType.Market && eS === a.Side.BUY && tk({
                            e: t,
                            info: r,
                            mode: {
                                type: "event",
                                location: "center"
                            }
                        }), td.current && clearTimeout(td.current), td.current = setTimeout(() => {
                            tS("rest"), tC()
                        }, 2e3));
                        let l = await i;
                        return s || (l === I.TransactionResponseState.Success ? (tS("success"), e_ === m.OrderType.Market && eS === a.Side.BUY && tk({
                            e: t,
                            info: r,
                            mode: {
                                type: "event",
                                location: "center"
                            }
                        })) : (n = !1, tS("rest"))), l
                    } catch (e) {
                        n = !1, (0, ex.handleError)(e, "[BuySellWidget > BuySellButton > handleClick]", tt), l ? .(I.TransactionResponseState.GeneralError)
                    } finally {
                        i ? .(), s || (td.current && clearTimeout(td.current), td.current = setTimeout(() => {
                            tS("rest"), n && tC()
                        }, 2e3))
                    }
                    return I.TransactionResponseState.GeneralError
                }, [eK, e4, tC, e6, i, o, l, e, e_, tt, eS, tk, ta, ts, d, eb.slug, eb.question, eb.secondsDelay, u, x, tl, to]),
                tw = (0, c.useTranslations)(),
                {
                    label: tM,
                    depositOverride: tI
                } = N.default.useMemo(() => {
                    if (tr && eS === a.Side.BUY && e_ === m.OrderType.Market) {
                        if (0 === eP.current) return {
                            depositOverride: !0,
                            label: tw("trading.deposit")
                        };
                        let e = parseFloat(ej);
                        if (!Number.isNaN(e) && e > 0 && e > eP.current) return {
                            depositOverride: !0,
                            label: tw("trading.deposit")
                        }
                    }
                    if (eZ) return {
                        label: `${tw("trading.acceptOfferAndBuy")} ${eO}`,
                        depositOverride: !1
                    };
                    if (e_ === m.OrderType.RFQ) return {
                        label: tw("trading.requestQuote"),
                        depositOverride: !1
                    };
                    if (e_ === m.OrderType.Limit) return {
                        label: eS === a.Side.BUY ? tw("trading.placeBuyOrder") : tw("trading.placeSellOrder"),
                        depositOverride: !1
                    };
                    if (tm) {
                        if (tx === Y.SportSlug.MLB) {
                            let e = K.mlbNameToAliasMap[eO];
                            if (e) {
                                let t = eS === a.Side.BUY ? tw("trading.buy") : tw("trading.sell");
                                return {
                                    label: `${t} ${e}`,
                                    depositOverride: !1
                                }
                            }
                        }
                        let e = (0, Q.getOutcomeWithLine)({
                                market: eb,
                                outcomeIndex: eE,
                                includeNegRiskOutcome: !1,
                                isNegRisk: ey
                            }),
                            t = eS === a.Side.BUY ? tw("trading.buy") : tw("trading.sell");
                        return {
                            label: `${t} ${e}`,
                            depositOverride: !1
                        }
                    }
                    let e = eS === a.Side.BUY ? tw("trading.buy") : tw("trading.sell");
                    return {
                        label: `${e} ${eO}`,
                        depositOverride: !1
                    }
                }, [eS, e_, eO, ej, eP, tr, tm, tx, eb.slug, tw, eE, eZ]),
                tO = (0, N.useCallback)(() => {
                    tI ? (eA.trackEvent(es.Events.DepositBuySellButtonClicked), eD()) : e1()
                }, [e1, tI, eA]),
                tR = (0, N.useMemo)(() => eN && !!eY || !!e$, [e$, eY, eN]);
            if (N.default.useEffect(() => () => {
                    td.current && clearTimeout(td.current)
                }, []), e0) return null;
            let tE = e4 && !e5,
                tq = tp || !tI && e8 && tR,
                tB = e => (0, t.jsx)(A.AnimatedButton, {
                    textKey: tm ? `${eS}-${eE}-${eb.slug}-${e_}` : `${eS}-${eE}-${tI}-${e_}`,
                    label: tM,
                    color: tI ? "blue" : tg ? ? "blue",
                    customColors: tI ? void 0 : ty,
                    onTap: e2 || tI ? tO : tN,
                    orderCreationState: tb,
                    disabled: tq,
                    softDisable: tE,
                    hoverHeightOffset: 1.5 * !tE,
                    clickDampingOffset: 2 * !tE,
                    height: 48,
                    shadowHeight: 5,
                    orderType: e_,
                    successColor: "green",
                    orderCreationDelay: eb.secondsDelay,
                    className: e
                }, tm ? void 0 : `${eS}-${eE}`),
                tP = e9 && (eS === a.Side.BUY && !tc.canBuy || eS === a.Side.SELL && !tc.canSell),
                tA = "magic" !== ta && ((0, P.mustGenerateApiKeys)(eH, ts) || (0, P.mustApproveAllowances)({
                    walletMode: ts,
                    areAllAllowancesApproved: eG,
                    isUpdatingAllowances: ez
                }));
            return p = tr ? tP ? (0, t.jsx)(ew, {}) : e_ !== m.OrderType.Market || eS !== a.Side.BUY || eU.valid ? e_ !== m.OrderType.Market || eS !== a.Side.SELL || eL.valid ? tn ? (0, t.jsx)(D.TradingButton, {
                color: tg ? ? "blue",
                customColors: ty,
                hoverHeightOffset: 1.5,
                clickDampingOffset: 2,
                height: 48,
                shadowHeight: 5,
                onClick: e3,
                children: `${(0,T.capitalize)(eS)} ${eO}`
            }) : tA ? (0, t.jsxs)(s.Modal, {
                children: [(0, t.jsx)(s.ModalTrigger, {
                    asChild: !0,
                    children: (0, t.jsx)(D.TradingButton, {
                        animationOptions: {
                            repeat: "infinite",
                            type: "shimmer"
                        },
                        color: tg ? ? "blue",
                        customColors: ty,
                        hoverHeightOffset: 1.5,
                        clickDampingOffset: 2,
                        height: 48,
                        shadowHeight: 5,
                        children: `${(0,T.capitalize)(eS)} ${eO}`
                    })
                }), (0, t.jsx)(Z.default, {})]
            }) : tp ? (0, t.jsx)(n.TooltipProvider, {
                children: (0, t.jsxs)(_.Tooltip.Root, {
                    children: [(0, t.jsx)(n.TooltipTrigger, {
                        asChild: !0,
                        children: (0, t.jsx)("span", {
                            className: "flex flex-1",
                            children: tB("pointer-events-none")
                        })
                    }), (0, t.jsx)(n.TooltipContent, {
                        side: "top",
                        align: "center",
                        sideOffset: 12,
                        className: "!bg-transparent !border-0 !p-0 !text-left !leading-normal !shadow-none max-w-none",
                        children: (0, t.jsx)(U.UpgradeBalanceTooltipContent, {
                            onUpgrade: () => tf(!0)
                        })
                    })]
                })
            }) : tB() : (0, t.jsx)(D.TradingButton, {
                color: "gray",
                hoverHeightOffset: 0,
                height: 48,
                shadowHeight: 5,
                className: "opacity-50",
                softDisable: !0,
                "aria-disabled": "true",
                children: (0, t.jsx)("span", {
                    className: "text-sm font-semibold text-text-secondary",
                    children: tw("trading.orderBook.noBids")
                })
            }) : (0, t.jsx)(D.TradingButton, {
                color: "gray",
                hoverHeightOffset: 0,
                height: 48,
                shadowHeight: 5,
                className: "opacity-50",
                softDisable: !0,
                "aria-disabled": "true",
                children: (0, t.jsx)("span", {
                    className: "text-sm font-semibold text-text-secondary",
                    children: tw("trading.orderBook.noAsks")
                })
            }) : (0, t.jsx)(A.AnimatedButton, {
                color: "blue",
                onTap: () => {
                    let e = Date.now();
                    (0, en.markSignupPromptOpened)("trade", {
                        now: e,
                        route: "login"
                    }), eA.trackEvent(es.Events.SignupPromptOpened, (0, en.getSignupPromptOpenedEventProperties)({
                        source: "trade",
                        route: "login"
                    })), te(O.ConnectorRoute.LOGIN), e7(!0)
                },
                orderCreationState: "rest",
                label: tw("trading.trade"),
                hoverHeightOffset: 1.5,
                clickDampingOffset: 2,
                height: 48,
                shadowHeight: 5
            }), (0, t.jsxs)("div", {
                className: "flex flex-col gap-2 w-full",
                children: [(0, t.jsx)(k.AnimatePresence, {
                    children: eq && (0, t.jsx)(ek, {
                        onTap: tN
                    })
                }), (0, t.jsx)("div", {
                    className: (0, v.cn)("flex overflow-hidden h-full flex-1", tE && "opacity-80"),
                    children: p
                }), tR ? (0, t.jsx)("p", {
                    className: "text-xs font-medium text-amber-500 leading-[1.3] overflow-hidden text-ellipsis max-w-[270px]",
                    children: eY || e$ || e5 ? .message
                }) : null, (0, t.jsx)(F.UpgradeBalanceModal, {
                    open: th,
                    onOpenChange: tf
                })]
            })
        },
        eO = e => {
            let a, s, n = (0, r.c)(4);
            n[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["event"], n[0] = a) : a = n[0];
            let {
                event: i
            } = (0, g.useEventContext)(a), {
                slug: o
            } = i, {
                gameState: l
            } = (0, E.useSportsGameSelector)(o, eM);
            return n[1] !== l || n[2] !== e ? (s = (0, t.jsx)(eI, { ...e,
                gameState: l
            }), n[1] = l, n[2] = e, n[3] = s) : s = n[3], s
        },
        eR = e => {
            let a, s, n = (0, r.c)(5);
            n[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["isSportsPage"], n[0] = a) : a = n[0];
            let {
                isSportsPage: i
            } = (0, $.useSportsContext)(a);
            if (i) {
                let r;
                return n[1] !== e ? (r = (0, t.jsx)(eO, { ...e
                }), n[1] = e, n[2] = r) : r = n[2], r
            }
            return n[3] !== e ? (s = (0, t.jsx)(eI, { ...e
            }), n[3] = e, n[4] = s) : s = n[4], s
        };
    var eE = e.i(260259);

    function eq(e) {
        let a, s, n, i, l, c = (0, r.c)(14),
            {
                header: d,
                subheader: u,
                subheaderColor: m,
                image: x
            } = e,
            p = u ? "font-medium text-sm text-text-secondary" : "font-semibold text-heading-lg";
        return c[0] !== p ? (a = (0, o.cn)("truncate", p), c[0] = p, c[1] = a) : a = c[1], c[2] !== d || c[3] !== a ? (s = (0, t.jsx)("span", {
            className: a,
            children: d
        }), c[2] = d, c[3] = a, c[4] = s) : s = c[4], c[5] !== u || c[6] !== m ? (n = !!u && (0, t.jsx)("span", {
            className: (0, o.cn)("text-base font-semibold flex items-center min-w-0", m ? "dark:brightness-150" : "text-text-primary"),
            style: m ? {
                color: m
            } : void 0,
            children: u
        }), c[5] = u, c[6] = m, c[7] = n) : n = c[7], c[8] !== s || c[9] !== n ? (i = (0, t.jsxs)("div", {
            className: "flex w-full min-w-0 flex-col",
            children: [s, n]
        }), c[8] = s, c[9] = n, c[10] = i) : i = c[10], c[11] !== x || c[12] !== i ? (l = (0, t.jsxs)("div", {
            className: "flex w-full items-center gap-3",
            children: [x, i]
        }), c[11] = x, c[12] = i, c[13] = l) : l = c[13], l
    }
    var eB = e.i(896414),
        eP = e.i(276918),
        eA = e.i(960334),
        eD = e.i(987222),
        eF = e.i(629141);
    let eU = {
        containerClassName: "overflow-hidden bg-transparent flex justify-center items-center",
        style: {
            width: "auto",
            height: 40
        }
    };

    function eL(e) {
        let a, s, n, i, o, l, c, d, u, m, x, p, h = (0, r.c)(27),
            {
                selectedOutcomeIdx: f,
                sportsMarketType: g
            } = e,
            y = "nrfi" === g || "both_teams_to_score" === g,
            b = 1 === f && "opacity-35";
        h[0] !== b ? (a = (0, v.cn)("absolute inset-0 bg-green-600 dark:bg-green-400 opacity-100 transition-opacity", b), h[0] = b, h[1] = a) : a = h[1], h[2] === Symbol.for("react.memo_cache_sentinel") ? (s = {
            clipPath: "polygon(0 0, 100% 0, 0 100%)"
        }, h[2] = s) : s = h[2], h[3] !== a ? (n = (0, t.jsx)("div", {
            className: a,
            style: s
        }), h[3] = a, h[4] = n) : n = h[4];
        let S = 0 === f && "opacity-35";
        h[5] !== S ? (i = (0, v.cn)("absolute inset-0 bg-red-500 opacity-100 transition-opacity", S), h[5] = S, h[6] = i) : i = h[6], h[7] === Symbol.for("react.memo_cache_sentinel") ? (o = {
            clipPath: "polygon(100% 0, 0 100%, 100% 100%)"
        }, h[7] = o) : o = h[7], h[8] !== i ? (l = (0, t.jsx)("div", {
            className: i,
            style: o
        }), h[8] = i, h[9] = l) : l = h[9], h[10] !== n || h[11] !== l ? (c = (0, t.jsxs)("div", {
            className: "absolute w-[40px] h-[40px] left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2 overflow-hidden",
            children: [n, l]
        }), h[10] = n, h[11] = l, h[12] = c) : c = h[12];
        let j = 0 !== f && "opacity-90 dark:opacity-60";
        h[13] !== j ? (d = (0, v.cn)("text-[white] text-xs font-medium opacity-100 transition-opacity", j), h[13] = j, h[14] = d) : d = h[14];
        let C = y ? "Y" : "O";
        h[15] !== d || h[16] !== C ? (u = (0, t.jsx)("div", {
            className: "absolute left-1.5 top-1 z-1",
            children: (0, t.jsx)("p", {
                className: d,
                children: C
            })
        }), h[15] = d, h[16] = C, h[17] = u) : u = h[17];
        let T = 1 !== f && "opacity-90 dark:opacity-60";
        h[18] !== T ? (m = (0, v.cn)("text-[white] text-xs font-medium opacity-100 transition-opacity", T), h[18] = T, h[19] = m) : m = h[19];
        let k = y ? "N" : "U";
        return h[20] !== m || h[21] !== k ? (x = (0, t.jsx)("div", {
            className: "absolute right-1.5 bottom-1 z-1",
            children: (0, t.jsx)("p", {
                className: m,
                children: k
            })
        }), h[20] = m, h[21] = k, h[22] = x) : x = h[22], h[23] !== u || h[24] !== x || h[25] !== c ? (p = (0, t.jsxs)("div", {
            className: "relative min-w-[40px] w-[40px] min-h-[40px] h-[40px] rounded-md bg-neutral-50 justify-center items-center overflow-hidden",
            children: [c, u, x]
        }), h[23] = u, h[24] = x, h[25] = c, h[26] = p) : p = h[26], p
    }

    function e$() {
        let e, a, s, n, i, o, l = (0, r.c)(49),
            c = (0, eA.useSportsV2Enabled)();
        l[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["event", "isNegRiskSportsEvent"], l[0] = e) : e = l[0];
        let {
            event: d,
            isNegRiskSportsEvent: u
        } = (0, g.useEventContext)(e);
        l[1] === Symbol.for("react.memo_cache_sentinel") ? (a = ["activeMarket"], l[1] = a) : a = l[1];
        let {
            activeMarket: m
        } = (0, f.useEventActiveMarketContext)(a);
        l[2] === Symbol.for("react.memo_cache_sentinel") ? (s = ["selectedOutcomeIdx"], l[2] = s) : s = l[2];
        let {
            selectedOutcomeIdx: x
        } = (0, y.useTradeContext)(s);
        e: {
            let e, r, a;
            if (c) {
                let e, r, a;
                l[3] !== m || l[4] !== u || l[5] !== x ? (e = (0, Q.getSportsHeaders)({
                    market: m,
                    outcomeIndex: x,
                    isNegRisk: u
                }), l[3] = m, l[4] = u, l[5] = x, l[6] = e) : e = l[6];
                let s = e;
                l[7] !== s.subheader ? (r = s.subheader ? (0, t.jsx)("span", {
                    className: "truncate min-w-0",
                    children: s.subheader
                }) : s.subheader, l[7] = s.subheader, l[8] = r) : r = l[8], l[9] !== s || l[10] !== r ? (a = { ...s,
                    subheader: r
                }, l[9] = s, l[10] = r, l[11] = a) : a = l[11], n = a;
                break e
            }
            let s = m.outcomes ? .[x];l[12] !== s || l[13] !== x ? (e = s ? (0, t.jsx)("span", {
                className: (0, v.cn)("shrink-0", 0 === x ? "text-green-600" : "text-red-500"),
                children: s
            }) : null, l[12] = s, l[13] = x, l[14] = e) : e = l[14];
            let i = e;l[15] !== d.series ? .[0] ? .title || l[16] !== d.slug || l[17] !== d.title ? (r = (0, eD.isUpDownSlug)(d.slug) && d.series ? .[0] ? .title || d.title, l[15] = d.series ? .[0] ? .title, l[16] = d.slug, l[17] = d.title, l[18] = r) : r = l[18];
            let o = r;
            if (d.markets.length > 1) {
                let e, r, a, s = m.groupItemTitle ? ? m.question;
                l[19] !== s ? (e = !!s && (0, t.jsxs)(t.Fragment, {
                    children: [(0, t.jsx)("span", {
                        className: "text-text-primary truncate min-w-0",
                        children: s
                    }), (0, t.jsx)("span", {
                        className: "text-text-tertiary mx-1.5 shrink-0",
                        children: "·"
                    })]
                }), l[19] = s, l[20] = e) : e = l[20], l[21] !== i || l[22] !== e ? (r = (0, t.jsxs)(t.Fragment, {
                    children: [e, i]
                }), l[21] = i, l[22] = e, l[23] = r) : r = l[23], l[24] !== m.image || l[25] !== o || l[26] !== r ? (a = {
                    header: o,
                    subheader: r,
                    image: m.image,
                    imageMode: "default",
                    color: void 0
                }, l[24] = m.image, l[25] = o, l[26] = r, l[27] = a) : a = l[27], n = a;
                break e
            }
            l[28] !== m.image || l[29] !== o || l[30] !== i ? (a = {
                header: o,
                subheader: i,
                image: m.image,
                imageMode: "default",
                color: void 0
            }, l[28] = m.image, l[29] = o, l[30] = i, l[31] = a) : a = l[31],
            n = a
        }
        let {
            header: p,
            image: h,
            imageMode: b,
            subheader: S,
            color: j
        } = n;
        t: {
            if (c && "totals" === b) {
                let e;
                l[32] !== m.sportsMarketType || l[33] !== x ? (e = (0, t.jsx)(eL, {
                    selectedOutcomeIdx: x,
                    sportsMarketType: m.sportsMarketType
                }), l[32] = m.sportsMarketType, l[33] = x, l[34] = e) : e = l[34], i = e;
                break t
            }
            if (c && h && "default" === b) {
                let e, r;
                l[35] !== p ? (e = (0, eP.getMarketImageAlt)(p), l[35] = p, l[36] = e) : e = l[36], l[37] !== h || l[38] !== e ? (r = (0, t.jsx)(eF.SportsMarketImage, {
                    src: h,
                    alt: e,
                    borderRadius: "4px",
                    ...eU
                }, h), l[37] = h, l[38] = e, l[39] = r) : r = l[39], i = r;
                break t
            }
            if (!c && h) {
                let e;
                l[40] !== p || l[41] !== h ? (e = (0, t.jsx)(eB.MarketImage, {
                    image: h,
                    marketName: p,
                    containerClassName: "rounded-[7px]",
                    size: 48
                }, h), l[40] = p, l[41] = h, l[42] = e) : e = l[42], i = e;
                break t
            }
            if (u && "draw" === b && !h) {
                let e;
                l[43] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)(eE.DrawIcon, {
                    size: 40
                }), l[43] = e) : e = l[43], i = e;
                break t
            }
            i = null
        }
        let C = i;
        return l[44] !== j || l[45] !== p || l[46] !== C || l[47] !== S ? (o = (0, t.jsx)(eq, {
            header: p,
            subheader: S,
            subheaderColor: j,
            image: C
        }), l[44] = j, l[45] = p, l[46] = C, l[47] = S, l[48] = o) : o = l[48], o
    }
    var eG = e.i(158789),
        eQ = e.i(798631);

    function ez(e) {
        let a, s, n, i, l, c, d, u, m, x, p, h, f, g, y, b, S, v, j = (0, r.c)(44),
            {
                value: C,
                onValueChange: T,
                options: k,
                menuExtra: _,
                className: w,
                openOnTriggerClick: M
            } = e,
            I = void 0 !== M && M,
            [O, R] = N.default.useState(!1),
            E = N.default.useRef(null);
        j[0] !== k || j[1] !== C ? (a = k.find(e => e.value === C) ? .label ? ? C, j[0] = k, j[1] = C, j[2] = a) : a = j[2];
        let q = a;
        j[3] === Symbol.for("react.memo_cache_sentinel") ? (s = e => {
            E.current && clearTimeout(E.current), e ? R(e) : E.current = setTimeout(() => R(e), 100)
        }, j[3] = s) : s = j[3];
        let B = s;
        j[4] !== T || j[5] !== k[0] ? .value || j[6] !== k[1] ? .value || j[7] !== C ? (n = () => {
            R(!1);
            let e = k[0] ? .value,
                t = k[1] ? .value;
            e && t && T(C === e ? t : e)
        }, j[4] = T, j[5] = k[0] ? .value, j[6] = k[1] ? .value, j[7] = C, j[8] = n) : n = j[8];
        let P = n;
        j[9] === Symbol.for("react.memo_cache_sentinel") ? (i = () => () => {
            E.current && clearTimeout(E.current)
        }, l = [], j[9] = i, j[10] = l) : (i = j[9], l = j[10]), N.default.useEffect(i, l), j[11] === Symbol.for("react.memo_cache_sentinel") ? (c = {
            pointerEvents: "auto"
        }, j[11] = c) : c = j[11], j[12] !== I || j[13] !== P ? (d = () => {
            I ? B(!0) : P()
        }, j[12] = I, j[13] = P, j[14] = d) : d = j[14], j[15] === Symbol.for("react.memo_cache_sentinel") ? (m = e => {
            "mouse" === e.pointerType && B(!0)
        }, u = () => B(!1), j[15] = u, j[16] = m) : (u = j[15], m = j[16]), j[17] !== w ? (x = (0, o.cn)("flex cursor-pointer items-center justify-end w-[90px] gap-1 capitalize font-medium text-text-primary text-body-base", w), j[17] = w, j[18] = x) : x = j[18];
        let A = O && "rotate-180";
        if (j[19] !== A ? (p = (0, o.cn)("ml-1 text-text-primary transition-transform duration-200", A), j[19] = A, j[20] = p) : p = j[20], j[21] !== p ? (h = (0, t.jsx)(eQ.IconChevronDownOutline12, {
                className: p
            }), j[21] = p, j[22] = h) : h = j[22], j[23] !== q || j[24] !== x || j[25] !== h || j[26] !== d ? (f = (0, t.jsx)(eG.DropdownMenuTrigger, {
                asChild: !0,
                className: "outline-none cursor-pointer",
                children: (0, t.jsxs)("button", {
                    type: "button",
                    style: c,
                    onPointerDown: eW,
                    onClick: d,
                    onPointerEnter: m,
                    onPointerLeave: u,
                    className: x,
                    children: [q, h]
                })
            }), j[23] = q, j[24] = x, j[25] = h, j[26] = d, j[27] = f) : f = j[27], j[28] === Symbol.for("react.memo_cache_sentinel") ? (g = () => B(!0), y = () => B(!1), j[28] = g, j[29] = y) : (g = j[28], y = j[29]), j[30] !== T || j[31] !== k) {
            let e;
            j[33] !== T ? (e = e => (0, t.jsx)(eG.DropdownMenuRadioItem, {
                hideIndicator: !0,
                value: e.value,
                disabled: e.disabled,
                className: "py-1.5 px-3 text-sm",
                onPointerUp: () => R(!1),
                onClick: t => {
                    t.preventDefault(), T(e.value)
                },
                children: e.label
            }, e.value), j[33] = T, j[34] = e) : e = j[34], b = k.map(e), j[30] = T, j[31] = k, j[32] = b
        } else b = j[32];
        return j[35] !== _ || j[36] !== T || j[37] !== b || j[38] !== C ? (S = (0, t.jsx)(eG.DropdownMenuContent, {
            align: "end",
            side: "bottom",
            className: "min-w-[120px]",
            onPointerEnter: g,
            onPointerLeave: y,
            children: (0, t.jsxs)(eG.DropdownMenuRadioGroup, {
                value: C,
                onValueChange: T,
                children: [b, _]
            })
        }), j[35] = _, j[36] = T, j[37] = b, j[38] = C, j[39] = S) : S = j[39], j[40] !== O || j[41] !== f || j[42] !== S ? (v = (0, t.jsxs)(eG.DropdownMenu, {
            open: O,
            onOpenChange: B,
            modal: !0,
            children: [f, S]
        }), j[40] = O, j[41] = f, j[42] = S, j[43] = v) : v = j[43], v
    }

    function eW(e) {
        return e.preventDefault()
    }
    var eH = e.i(269101),
        eY = e.i(399841);
    let eK = "one-tap",
        eV = () => {
            let e, s, n, i, o, l, d, u, x, p, h, g, S, v, j, C = (0, r.c)(45);
            C[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated"], C[0] = e) : e = C[0];
            let {
                authenticated: T
            } = (0, el.useAccountContext)(e);
            C[1] === Symbol.for("react.memo_cache_sentinel") ? (s = ["activeMarket"], C[1] = s) : s = C[1];
            let {
                activeMarket: k
            } = (0, f.useEventActiveMarketContext)(s);
            C[2] === Symbol.for("react.memo_cache_sentinel") ? (n = ["orderType", "setOrderType", "setSplitDialogOpen", "setMergeDialogOpen", "side"], C[2] = n) : n = C[2];
            let {
                orderType: _,
                setOrderType: N,
                setSplitDialogOpen: w,
                setMergeDialogOpen: M,
                side: I
            } = (0, y.useTradeContext)(n);
            C[3] === Symbol.for("react.memo_cache_sentinel") ? (i = ["positions"], C[3] = i) : i = C[3];
            let {
                positions: O
            } = (0, eH.useEventPositionsContext)(i);
            e: {
                let e, t;
                if (!O) {
                    o = !1;
                    break e
                }
                C[4] !== k.conditionId ? (e = k.conditionId ? .toLowerCase(), C[4] = k.conditionId, C[5] = e) : e = C[5];
                let r = e;
                if (!r) {
                    o = !1;
                    break e
                }
                if (C[6] !== r || C[7] !== O) {
                    let e;
                    C[9] !== r ? (e = e => e.market ? .id ? .toLowerCase() === r, C[9] = r, C[10] = e) : e = C[10];
                    let a = O.filter(e);
                    t = a.length >= 2 && a.every(eJ), C[6] = r, C[7] = O, C[8] = t
                } else t = C[8];o = t
            }
            let R = o,
                E = (0, c.useTranslations)(),
                q = (0, eY.useFeatureFlag)("rfq") && "0xfa48a99317daef1654d5b03e30557c4222f276657275628d9475e141c64b545d" === k.conditionId,
                B = (0, b.useOneClickEligible)(),
                [P, A, D] = (0, b.useOneClickEnabled)(),
                F = B && D && I === a.Side.BUY;
            C[11] !== F ? (l = F ? {
                value: eK,
                label: "1-Tap"
            } : null, C[11] = F, C[12] = l) : l = C[12], C[13] !== E ? (d = E("trading.market"), C[13] = E, C[14] = d) : d = C[14], C[15] !== d ? (u = {
                value: m.OrderType.Market,
                label: d
            }, C[15] = d, C[16] = u) : u = C[16], C[17] !== E ? (x = E("trading.limit"), C[17] = E, C[18] = x) : x = C[18], C[19] !== x ? (p = {
                value: m.OrderType.Limit,
                label: x
            }, C[19] = x, C[20] = p) : p = C[20], C[21] !== q || C[22] !== E ? (h = q ? {
                value: m.OrderType.RFQ,
                label: E("trading.rfq")
            } : null, C[21] = q, C[22] = E, C[23] = h) : h = C[23], C[24] !== h || C[25] !== l || C[26] !== u || C[27] !== p ? (g = [l, u, p, h].filter(Boolean), C[24] = h, C[25] = l, C[26] = u, C[27] = p, C[28] = g) : g = C[28];
            let U = g,
                L = F && P ? eK : _;
            C[29] !== F || C[30] !== M || C[31] !== A || C[32] !== N || C[33] !== w ? (S = e => {
                switch (e) {
                    case eK:
                        A(!0), N(m.OrderType.Market);
                        break;
                    case m.OrderType.Market:
                        F && A(!1), N(m.OrderType.Market);
                        break;
                    case m.OrderType.Limit:
                        F && A(!1), N(m.OrderType.Limit);
                        break;
                    case m.OrderType.RFQ:
                        F && A(!1), N(m.OrderType.RFQ);
                        break;
                    case "merge":
                        M(!0);
                        break;
                    case "split":
                        w(!0)
                }
            }, C[29] = F, C[30] = M, C[31] = A, C[32] = N, C[33] = w, C[34] = S) : S = C[34];
            let $ = S;
            C[35] !== T || C[36] !== R || C[37] !== E ? (v = T ? (0, t.jsxs)(t.Fragment, {
                children: [(0, t.jsx)(eG.DropdownMenuSeparator, {
                    className: "-mx-1.5"
                }), R && (0, t.jsx)(eG.DropdownMenuRadioItem, {
                    hideIndicator: !0,
                    value: "merge",
                    children: (0, t.jsx)("span", {
                        className: "text-text-secondary",
                        children: E("trading.merge")
                    })
                }), (0, t.jsx)(eG.DropdownMenuRadioItem, {
                    hideIndicator: !0,
                    value: "split",
                    children: (0, t.jsx)("span", {
                        className: "text-text-secondary",
                        children: E("trading.split")
                    })
                })]
            }) : null, C[35] = T, C[36] = R, C[37] = E, C[38] = v) : v = C[38];
            let G = v;
            return C[39] !== F || C[40] !== L || C[41] !== G || C[42] !== $ || C[43] !== U ? (j = (0, t.jsx)(ez, {
                value: L,
                onValueChange: $,
                options: U,
                menuExtra: G,
                openOnTriggerClick: F
            }), C[39] = F, C[40] = L, C[41] = G, C[42] = $, C[43] = U, C[44] = j) : j = C[44], j
        };

    function eJ(e) {
        return (e.trackedPositionMetadata ? e.trackedPositionMetadata.netQuantity.optimistic : parseFloat(e.netQuantity ? ? "0") / 1e6) > .01
    }
    var eX = e.i(81940),
        eZ = e.i(588264);
    let e0 = {
            ease: [.26, .08, .25, 1],
            duration: .2025
        },
        e1 = {
            initial: {
                width: "100%"
            },
            animate: {
                width: "100%"
            },
            exit: {
                width: "100%"
            }
        };

    function e2(e) {
        let a, s, n, i, l = (0, r.c)(17),
            {
                value: c,
                onValueChange: d,
                options: u,
                className: m
            } = e,
            [x] = N.default.useState(e3);
        if (l[0] !== m ? (a = (0, o.cn)("flex gap-3", m), l[0] = m, l[1] = a) : a = l[1], l[2] !== x || l[3] !== u || l[4] !== c) {
            let e;
            l[6] !== x || l[7] !== c ? (e = e => (0, t.jsxs)(eZ.RadioGroup.Item, {
                value: e.value,
                className: "relative bg-transparent text-text-primary font-semibold text-heading-lg cursor-pointer data-[state=unchecked]:text-text-secondary data-[state=unchecked]:hover:text-text-tertiary focus:outline-none active:outline-none",
                children: [e.label, (0, t.jsx)(k.AnimatePresence, {
                    initial: !1,
                    children: c === e.value && (0, t.jsx)(ey.motion.div, {
                        layoutId: x,
                        variants: e1,
                        initial: "initial",
                        animate: "animate",
                        exit: "exit",
                        transition: e0,
                        className: "h-0.5 bg-text-primary absolute -bottom-[9px] left-0"
                    }, `side-toggle-indicator-${e.value}`)
                })]
            }, `side-toggle-item-${e.value}`), l[6] = x, l[7] = c, l[8] = e) : e = l[8], s = u.map(e), l[2] = x, l[3] = u, l[4] = c, l[5] = s
        } else s = l[5];
        return l[9] !== d || l[10] !== a || l[11] !== s || l[12] !== c ? (n = (0, t.jsx)(eZ.RadioGroup.Root, {
            value: c,
            onValueChange: d,
            className: a,
            children: s
        }), l[9] = d, l[10] = a, l[11] = s, l[12] = c, l[13] = n) : n = l[13], l[14] !== x || l[15] !== n ? (i = (0, t.jsx)(eX.LayoutGroup, {
            id: x,
            children: n
        }), l[14] = x, l[15] = n, l[16] = i) : i = l[16], i
    }

    function e3() {
        return crypto.randomUUID()
    }

    function e4() {
        let e, s, n, i, o, l, d, u, m = (0, r.c)(18),
            x = (0, c.useTranslations)();
        m[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["side", "setSide"], m[0] = e) : e = m[0];
        let {
            side: p,
            setSide: h
        } = (0, y.useTradeContext)(e);
        m[1] !== x ? (s = x("trading.buy"), m[1] = x, m[2] = s) : s = m[2], m[3] !== s ? (n = {
            value: a.Side.BUY,
            label: s
        }, m[3] = s, m[4] = n) : n = m[4], m[5] !== x ? (i = x("trading.sell"), m[5] = x, m[6] = i) : i = m[6], m[7] !== i ? (o = {
            value: a.Side.SELL,
            label: i
        }, m[7] = i, m[8] = o) : o = m[8], m[9] !== n || m[10] !== o ? (l = [n, o], m[9] = n, m[10] = o, m[11] = l) : l = m[11];
        let f = l;
        return m[12] !== h ? (d = e => h(e), m[12] = h, m[13] = d) : d = m[13], m[14] !== f || m[15] !== p || m[16] !== d ? (u = (0, t.jsx)(e2, {
            value: p,
            onValueChange: d,
            options: f
        }), m[14] = f, m[15] = p, m[16] = d, m[17] = u) : u = m[17], u
    }

    function e5() {
        let e, a, s = (0, r.c)(2);
        return s[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)(e$, {}), s[0] = e) : e = s[0], s[1] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsxs)("div", {
            className: "flex w-full flex-col gap-5",
            children: [e, (0, t.jsxs)("div", {
                className: "flex w-[calc(100%+32px)] px-4 -ml-4 pb-2 justify-between items-end border-b border-b-border",
                children: [(0, t.jsx)(e4, {}), (0, t.jsx)(eV, {})]
            })]
        }), s[1] = a) : a = s[1], a
    }
    e5.displayName = "TradeWidgetHeader";
    var e6 = e.i(863134);

    function e8(e) {
        let a, s, n = (0, r.c)(3);
        return n[0] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsx)("path", {
            fill: "currentColor",
            d: "M10 4.29c.536 0 1.026.27 1.313.722l4.466 7.044a1.557 1.557 0 0 1-1.313 2.388H5.533a1.554 1.554 0 0 1-1.314-2.388l4.467-7.044A1.55 1.55 0 0 1 10 4.291"
        }), n[0] = a) : a = n[0], n[1] !== e ? (s = (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: a
        }), n[1] = e, n[2] = s) : s = n[2], s
    }
    e.i(686518);
    var e9 = e.i(907855),
        e7 = e.i(66199),
        te = e.i(30704),
        tt = e.i(430849),
        tr = e.i(986558),
        ta = e.i(484275),
        ts = e.i(476603),
        tn = e.i(36561),
        ti = e.i(309256);

    function to(e) {
        let a, s, i, o, l, d, u, m = (0, r.c)(16),
            {
                children: x
            } = e,
            p = (0, c.useTranslations)();
        return m[0] !== p ? (a = p("trading.geoRestrictions.tradingUnavailableInRegion"), m[0] = p, m[1] = a) : a = m[1], m[2] !== a ? (s = (0, t.jsx)("p", {
            children: a
        }), m[2] = a, m[3] = s) : s = m[3], m[4] !== p ? (i = p("trading.geoRestrictions.availableRegions"), m[4] = p, m[5] = i) : i = m[5], m[6] !== i ? (o = (0, t.jsx)(e_.default, {
            href: `${ef.POLYMARKET_DOCS_LINK}/api-reference/geoblock#blocked-countries`,
            target: "_blank",
            rel: "noopener noreferrer",
            className: "underline text-brand-500 hover:opacity-80",
            children: i
        }), m[6] = i, m[7] = o) : o = m[7], m[8] !== s || m[9] !== o ? (l = (0, t.jsxs)(t.Fragment, {
            children: [s, o]
        }), m[8] = s, m[9] = o, m[10] = l) : l = m[10], m[11] !== x ? (d = (0, t.jsx)("span", {
            className: "block w-full",
            children: x
        }), m[11] = x, m[12] = d) : d = m[12], m[13] !== l || m[14] !== d ? (u = (0, t.jsx)(n.Tooltip, {
            side: "top",
            sideOffset: 12,
            className: "w-[calc(100vw-2rem)] lg:w-[calc(338px-3rem)] py-2",
            content: l,
            children: d
        }), m[13] = l, m[14] = d, m[15] = u) : u = m[15], u
    }

    function tl(e) {
        let a, s, i = (0, r.c)(3),
            {
                children: o
            } = e;
        return i[0] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsx)("p", {
            children: "No asks on the book yet"
        }), i[0] = a) : a = i[0], i[1] !== o ? (s = (0, t.jsx)(n.Tooltip, {
            side: "top",
            sideOffset: 12,
            className: "py-2",
            content: a,
            children: (0, t.jsx)("span", {
                className: "block w-full",
                children: o
            })
        }), i[1] = o, i[2] = s) : s = i[2], s
    }

    function tc(e) {
        let t = e.trackedPositionMetadata ? .netQuantity ? .optimistic,
            r = e.trackedPositionMetadata ? .valueBought ? .optimistic,
            a = e.trackedPositionMetadata ? .quantityBought ? .optimistic;
        if ("number" == typeof t && Number.isFinite(t) && "number" == typeof r && Number.isFinite(r) && "number" == typeof a && Number.isFinite(a)) return {
            qty: t,
            costBasis: t * (a > 0 ? r / a : 0)
        };
        try {
            let t = parseFloat((0, ep.formatUSDCUnits)(BigInt(e.netQuantity))),
                r = parseFloat((0, ep.formatUSDCUnits)(BigInt(e.valueBought))),
                a = parseFloat((0, ep.formatUSDCUnits)(BigInt(e.quantityBought))),
                s = a > 0 ? r / a : 0;
            return {
                qty: Number.isFinite(t) ? t : 0,
                costBasis: Number.isFinite(t) && Number.isFinite(s) ? t * s : 0
            }
        } catch {
            return {
                qty: 0,
                costBasis: 0
            }
        }
    }

    function td(e) {
        return !Number.isFinite(e) || e <= 0 ? 0 n : BigInt(Math.floor(1e6 * e))
    }
    let tu = BigInt(Math.round(ef.SELL_MAX_DUST * ef.DUST_DISPLAY_FACTOR)),
        tm = {
            style: "currency",
            currency: "USD",
            minimumFractionDigits: 2,
            maximumFractionDigits: 2
        };

    function tx({
        sellMaxUsdc: e,
        needsApproval: r,
        onApprovalRequired: s,
        position: n
    }) {
        let {
            activeMarket: i
        } = (0, f.useEventActiveMarketContext)(["activeMarket"]), o = parseInt(n.outcomeIndex, 10), l = (0, j.usePositionValuationPrice)(i, o), c = (0, j.useBestPrice)(i, o, "bid"), d = (0, I.useCreateOrder)(), u = (0, ec.useAmplitudeAnalytics)(), {
            qty: x,
            costBasis: p
        } = tc(n), h = BigInt(n.netQuantity), g = h < e ? h : e, y = (0, ep.formatUSDCUnits)(g), b = parseFloat(y), S = l > 0, C = S ? x * l : 0, T = S ? C - p : 0, k = T >= 0, _ = 0 === o, w = c.valid && c.value > 0, M = w ? b * c.value : 0, O = g > 0 n && w, R = (0, N.useCallback)(async () => {
            if (O) {
                if (r) return void s();
                u.trackEvent(es.Events.OneClickTradeClicked, {
                    type: "cashout",
                    amount: M,
                    market_slug: i.slug,
                    outcome_index: o,
                    position_shares: x,
                    sellable_shares: b
                }), await d({
                    values: {
                        orderType: m.OrderType.Market,
                        shares: y,
                        side: a.Side.SELL,
                        selectedOutcomeIdx: o,
                        isSellAmountPrefilled: !0
                    },
                    options: {
                        successToast: !0,
                        errorToast: !0
                    },
                    tracking: {
                        page: "events",
                        source: "buy-sell-widget"
                    }
                })
            }
        }, [u, d, M, i.slug, o, x, b, r, s, y, O]);
        return h < tu ? null : (0, t.jsxs)("div", {
            className: "flex items-center gap-3 rounded-xl bg-surface-2 p-2.5",
            children: [(0, t.jsx)("div", {
                className: (0, v.cn)("flex items-center justify-center w-9 h-9 rounded-full shrink-0", _ ? "bg-green-600/10 dark:bg-green-400/15 text-green-600 dark:text-green-400" : "bg-red-500/10 dark:bg-red-400/15 text-red-500 dark:text-red-400"),
                children: (0, t.jsx)(e8, {
                    className: (0, v.cn)("w-4 h-4", !_ && "rotate-180")
                })
            }), (0, t.jsxs)("div", {
                className: "flex flex-col min-w-0 flex-1",
                children: [(0, t.jsxs)("span", {
                    className: "text-[10px] font-semibold uppercase tracking-wide text-text-secondary",
                    children: [x.toLocaleString("en-US", {
                        minimumFractionDigits: 0,
                        maximumFractionDigits: 0
                    }), " Shares"]
                }), (0, t.jsx)("div", {
                    className: "flex items-baseline gap-1.5",
                    children: S ? (0, t.jsxs)(t.Fragment, {
                        children: [(0, t.jsx)(e9.default, {
                            value: C,
                            format: tm,
                            trend: 0,
                            transformTiming: ta.WIN_NUMBER_FLOW_TIMING,
                            className: "text-body-base font-bold text-text-primary normal-nums!"
                        }), (0, t.jsx)(e9.default, {
                            value: T,
                            format: { ...tm,
                                signDisplay: "always"
                            },
                            trend: 0,
                            transformTiming: ta.WIN_NUMBER_FLOW_TIMING,
                            className: (0, v.cn)("text-body-xs font-semibold normal-nums!", k ? "text-green-600" : "text-red-500")
                        })]
                    }) : (0, t.jsx)("span", {
                        className: "text-body-base font-bold text-text-secondary",
                        children: "--"
                    })
                })]
            }), (0, t.jsx)("button", {
                type: "button",
                disabled: !O,
                onClick: () => {
                    R()
                },
                className: (0, v.cn)("shrink-0 rounded-xl bg-text-primary text-background px-4 py-2 text-body-base font-semibold shadow-sm hover:opacity-90 transition-opacity cursor-pointer", !O && "cursor-not-allowed opacity-50 hover:opacity-50"),
                children: "Cash out"
            })]
        })
    }

    function tp({
        needsApproval: e,
        onApprovalRequired: r
    }) {
        let {
            activeMarket: a
        } = (0, f.useEventActiveMarketContext)(["activeMarket"]), {
            positions: s
        } = (0, eH.useEventPositionsContext)(["positions"]), {
            authenticated: n
        } = (0, el.useAccountContext)(["authenticated"]), i = function(e) {
            let t = (0, tt.default)(e.conditionId),
                {
                    pendingBuys: r
                } = (0, tr.default)(e.conditionId),
                {
                    userOpenSellsSizeMap: a
                } = (0, te.default)({
                    clobTokenIds: e.clobTokenIds,
                    orderPriceMinTickSize: e.orderPriceMinTickSize ? ? .01,
                    conditionId: e.conditionId
                });
            return N.default.useMemo(() => [0, 1].map(s => {
                let n = e.clobTokenIds ? .[s] ? ? "",
                    i = td(t[s] ? ? 0),
                    o = td(r ? .[s] ? ? 0),
                    l = a ? .[n] ? ? 0 n,
                    c = i > o ? i - o : 0 n;
                return c > l ? c - l : 0 n
            }), [e.clobTokenIds, t, r, a])
        }(a), o = N.default.useMemo(() => {
            if (!n || !s) return [];
            let e = a.conditionId.toLowerCase(),
                t = new Set;
            return s.filter(r => {
                if (r.market.id.toLowerCase() !== e) return !1;
                let a = parseInt(r.outcomeIndex, 10);
                if (!Number.isFinite(a) || t.has(a)) return !1;
                let {
                    qty: s
                } = tc(r);
                return !(td(s) < tu) && (t.add(a), !0)
            })
        }, [n, s, a.conditionId]);
        return o.length ? (0, t.jsx)("div", {
            className: "flex flex-col gap-2",
            children: o.map(a => {
                let s = parseInt(a.outcomeIndex, 10);
                return (0, t.jsx)(tx, {
                    position: a,
                    sellMaxUsdc: i[s] ? ? 0 n,
                    needsApproval: e,
                    onApprovalRequired: r
                }, `${a.market.id}-${a.outcomeIndex}`)
            })
        }) : null
    }

    function th() {
        let e, a, n, i, o, l, c, d, u, m, x, p, h, f, g, y, b, S, v, j, C = (0, r.c)(52);
        C[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated"], C[0] = e) : e = C[0];
        let {
            authenticated: T
        } = (0, el.useAccountContext)(e), [k, _] = (0, N.useState)(!1);
        C[1] === Symbol.for("react.memo_cache_sentinel") ? (a = {
            defaultValue: ta.DEFAULT_PRESETS,
            listenStorageChange: !0
        }, C[1] = a) : a = C[1];
        let [w, M] = (0, e7.useLocalStorageState)(ta.PRESETS_LS_KEY, a), I = w ? ? ta.DEFAULT_PRESETS, [O, R] = (0, N.useState)(!1);
        C[2] !== I ? (n = () => I.map(String), C[2] = I, C[3] = n) : n = C[3];
        let [E, q] = (0, N.useState)(n);
        C[4] !== I ? (i = () => {
            q(I.map(String)), R(!0)
        }, C[4] = I, C[5] = i) : i = C[5];
        let B = i;
        C[6] === Symbol.for("react.memo_cache_sentinel") ? (o = () => {
            R(!1)
        }, C[6] = o) : o = C[6];
        let P = o;
        C[7] !== E || C[8] !== M ? (l = () => {
            M(E.map(tf)), R(!1)
        }, C[7] = E, C[8] = M, C[9] = l) : l = C[9];
        let A = l;
        C[10] === Symbol.for("react.memo_cache_sentinel") ? (c = () => {
            _(!0)
        }, C[10] = c) : c = C[10];
        let D = c;
        C[11] === Symbol.for("react.memo_cache_sentinel") ? (d = {
            onApprovalRequired: D
        }, C[11] = d) : d = C[11];
        let {
            handlePresetTap: F,
            geoblocked: U,
            cashOutGeoblocked: L,
            noAsks: $,
            needsApproval: G,
            bestAsk: Q
        } = (0, ts.useOneTapPresetTap)(d), z = T && U, W = T && $;
        return C[12] === Symbol.for("react.memo_cache_sentinel") ? (u = (0, t.jsx)("p", {
            className: "font-medium text-heading-lg text-text-primary",
            children: "One-tap buy"
        }), C[12] = u) : u = C[12], C[13] !== T ? (m = T && (0, t.jsx)("div", {
            className: "h-[18px]",
            children: (0, t.jsx)(ti.BalanceSection, {
                variant: "usdc"
            })
        }), C[13] = T, C[14] = m) : m = C[14], C[15] !== m ? (x = (0, t.jsxs)("div", {
            className: "flex flex-col gap-0.5",
            children: [u, m]
        }), C[15] = m, C[16] = x) : x = C[16], C[17] !== T || C[18] !== O || C[19] !== A || C[20] !== B ? (p = T && (O ? (0, t.jsxs)("div", {
            className: "flex items-center gap-0.5",
            children: [(0, t.jsx)("button", {
                type: "button",
                onClick: P,
                className: "rounded-full px-2.5 py-1 text-[11px] font-semibold text-text-secondary hover:bg-surface-2 transition-colors cursor-pointer",
                children: "Cancel"
            }), (0, t.jsx)("button", {
                type: "button",
                onClick: A,
                className: "rounded-full bg-bg-brand px-3 py-1 text-[11px] font-semibold text-white hover:opacity-90 transition-opacity cursor-pointer",
                children: "Save"
            })]
        }) : (0, t.jsxs)("button", {
            type: "button",
            onClick: B,
            className: "flex items-center gap-1 text-[11px] font-semibold text-text-secondary hover:text-text-primary transition-colors cursor-pointer",
            children: [(0, t.jsx)(e6.EditIcon20, {
                className: "w-3.5 h-3.5"
            }), "Edit"]
        })), C[17] = T, C[18] = O, C[19] = A, C[20] = B, C[21] = p) : p = C[21], C[22] !== x || C[23] !== p ? (h = (0, t.jsxs)("div", {
            className: "flex items-end justify-between",
            children: [x, p]
        }), C[22] = x, C[23] = p, C[24] = h) : h = C[24], C[25] !== Q || C[26] !== E || C[27] !== O || C[28] !== F || C[29] !== I || C[30] !== A || C[31] !== z || C[32] !== W ? (f = O ? E.map((e, r) => (0, t.jsx)(tn.PresetEditCard, {
            value: e,
            autoFocus: 0 === r,
            onChange: e => q(t => {
                let a = [...t];
                return a[r] = e, a
            }),
            onSubmit: A
        }, r)) : I.map((e, r) => {
            let a = Q.valid && Q.value > 0 ? Math.max(e / Q.value, 0) : 0,
                s = (0, t.jsx)(tn.PresetCard, {
                    amount: e,
                    win: a,
                    disabled: z || W,
                    onClick: () => F(e)
                }, `${r}-${e}`);
            return z ? (0, t.jsx)(to, {
                children: s
            }, `${r}-${e}`) : W ? (0, t.jsx)(tl, {
                children: s
            }, `${r}-${e}`) : s
        }), C[25] = Q, C[26] = E, C[27] = O, C[28] = F, C[29] = I, C[30] = A, C[31] = z, C[32] = W, C[33] = f) : f = C[33], C[34] !== f ? (g = (0, t.jsx)("div", {
            className: "grid grid-cols-3 gap-2",
            children: f
        }), C[34] = f, C[35] = g) : g = C[35], C[36] !== O || C[37] !== z ? (y = !O && z && (0, t.jsx)(ew, {}), C[36] = O, C[37] = z, C[38] = y) : y = C[38], C[39] !== L || C[40] !== O || C[41] !== G ? (b = !O && !L && (0, t.jsx)(tp, {
            needsApproval: G,
            onApprovalRequired: D
        }), C[39] = L, C[40] = O, C[41] = G, C[42] = b) : b = C[42], C[43] === Symbol.for("react.memo_cache_sentinel") ? (S = (0, t.jsx)(Z.default, {}), C[43] = S) : S = C[43], C[44] !== k ? (v = (0, t.jsx)(s.Modal, {
            open: k,
            onOpenChange: _,
            children: S
        }), C[44] = k, C[45] = v) : v = C[45], C[46] !== h || C[47] !== g || C[48] !== y || C[49] !== b || C[50] !== v ? (j = (0, t.jsxs)(t.Fragment, {
            children: [h, g, y, b, v]
        }), C[46] = h, C[47] = g, C[48] = y, C[49] = b, C[50] = v, C[51] = j) : j = C[51], j
    }

    function tf(e) {
        let t = Number.parseInt(e, 10);
        return !Number.isFinite(t) || t < ta.MIN_PRESET ? ta.MIN_PRESET : Math.min(t, ta.MAX_PRESET)
    }
    th.displayName = "OneClickContent";
    var tg = e.i(111706),
        ty = e.i(145429),
        tb = e.i(410988),
        tS = e.i(797159),
        tv = e.i(63782),
        tj = e.i(900519),
        tC = e.i(652333),
        tT = e.i(820203),
        tk = e.i(176902);
    let t_ = N.default.memo(function(e) {
        let s, i, o, l, d, u, m, x, p, h, f, g, b, v, j, C, T, k, _, w, M = (0, r.c)(52),
            I = (0, c.useTranslations)();
        M[0] === Symbol.for("react.memo_cache_sentinel") ? (s = ["authenticated"], M[0] = s) : s = M[0];
        let {
            authenticated: O
        } = (0, el.useAccountContext)(s);
        M[1] === Symbol.for("react.memo_cache_sentinel") ? (i = ["side"], M[1] = i) : i = M[1];
        let {
            side: R
        } = (0, y.useTradeContext)(i), {
            shakeAmount: E,
            setShakeAmount: q
        } = (0, S.useTradeAnimationContext)(), B = (0, L.useNeedsBalanceUpgrade)(), [P, A] = N.default.useState(!1);
        M[2] !== I ? (o = e => {
            let {
                balance: t
            } = e;
            return (0, tj.cashBalanceFormatter)({
                balance: t,
                cashLabel: I("trading.cash")
            })
        }, M[2] = I, M[3] = o) : o = M[3];
        let D = o,
            {
                ref: $,
                value: G
            } = (0, tb.useAmountFieldMask)(),
            Q = (0, tS.useOnBlur)();
        M[4] !== q ? (l = {
            duration: .5,
            onComplete: () => {
                q(!1)
            }
        }, M[4] = q, M[5] = l) : l = M[5], M[6] !== E || M[7] !== l ? (d = {
            enabled: E,
            animationOptions: l
        }, M[6] = E, M[7] = l, M[8] = d) : d = M[8];
        let {
            ref: z
        } = (0, tv.useShake)(d);
        M[9] !== $ || M[10] !== q ? (u = e => {
            (0, tC.validateAmountKeyPress)($.current, e) || q(!0)
        }, M[9] = $, M[10] = q, M[11] = u) : u = M[11];
        let W = u;
        M[12] !== R || M[13] !== I ? (m = R === a.Side.BUY ? I("trading.amount") : I("trading.shares"), M[12] = R, M[13] = I, M[14] = m) : m = M[14], M[15] !== m ? (x = (0, t.jsx)("p", {
            className: "font-medium text-heading-lg text-text-primary",
            children: m
        }), M[15] = m, M[16] = x) : x = M[16], M[17] !== B || M[18] !== R ? (p = B && R === a.Side.BUY && (0, t.jsx)(n.Tooltip, {
            content: (0, t.jsx)(U.UpgradeBalanceTooltipContent, {
                onUpgrade: () => A(!0)
            }),
            side: "top",
            sideOffset: 8,
            children: (0, t.jsx)("span", {
                className: "inline-flex",
                children: (0, t.jsx)(ty.IconTriangleWarningOutline18, {
                    className: "text-text-secondary size-[18px]"
                })
            })
        }), M[17] = B, M[18] = R, M[19] = p) : p = M[19], M[20] !== x || M[21] !== p ? (h = (0, t.jsxs)("div", {
            className: "flex items-center gap-1.5",
            children: [x, p]
        }), M[20] = x, M[21] = p, M[22] = h) : h = M[22], M[23] !== O || M[24] !== D || M[25] !== R ? (f = O && R === a.Side.BUY && (0, t.jsx)("div", {
            className: "h-[18px]",
            children: (0, t.jsx)(ti.BalanceSection, {
                variant: "usdc",
                formatter: D
            })
        }), M[23] = O, M[24] = D, M[25] = R, M[26] = f) : f = M[26], M[27] !== f || M[28] !== h ? (g = (0, t.jsxs)("div", {
            className: "flex flex-col gap-0.5",
            children: [h, f]
        }), M[27] = f, M[28] = h, M[29] = g) : g = M[29];
        let H = R === a.Side.BUY ? "$0" : "0";
        M[30] === Symbol.for("react.memo_cache_sentinel") ? (b = {
            mode: "stretch"
        }, M[30] = b) : b = M[30];
        let Y = R === a.Side.BUY ? "$" : "";
        return M[31] === Symbol.for("react.memo_cache_sentinel") ? (v = {
            enabled: !0
        }, M[31] = v) : v = M[31], M[32] !== $ || M[33] !== G || M[34] !== Q || M[35] !== W || M[36] !== H || M[37] !== Y ? (j = (0, t.jsx)("div", {
            className: "flex items-center w-full justify-end",
            children: (0, t.jsx)(tT.AutosizableInput, {
                ref: $,
                id: "market-order-amount-input",
                inputMode: "decimal",
                type: "text",
                placeholder: H,
                autoComplete: "off",
                onBlur: Q,
                value: G,
                autosizeOptions: b,
                align: "right",
                prefix: Y,
                autoscaleFontOptions: v,
                onKeyDown: W,
                autoFocus: !0
            })
        }), M[32] = $, M[33] = G, M[34] = Q, M[35] = W, M[36] = H, M[37] = Y, M[38] = j) : j = M[38], M[39] !== z || M[40] !== g || M[41] !== j ? (C = (0, t.jsxs)("div", {
            ref: z,
            className: "flex items-center w-full gap-3 justify-between",
            children: [g, j]
        }), M[39] = z, M[40] = g, M[41] = j, M[42] = C) : C = M[42], M[43] === Symbol.for("react.memo_cache_sentinel") ? (T = (0, t.jsx)("div", {
            className: "flex flex-1 justify-end mt-2 relative",
            children: (0, t.jsx)(tk.QuickActionGroup, {
                color: "grey",
                clamp: !1
            })
        }), M[43] = T) : T = M[43], M[44] !== C ? (k = (0, t.jsxs)("div", {
            className: "flex flex-col w-full gap-2 mt-3",
            children: [C, T]
        }), M[44] = C, M[45] = k) : k = M[45], M[46] !== P ? (_ = (0, t.jsx)(F.UpgradeBalanceModal, {
            open: P,
            onOpenChange: A
        }), M[46] = P, M[47] = _) : _ = M[47], M[48] !== e || M[49] !== k || M[50] !== _ ? (w = (0, t.jsxs)("div", {
            className: "size-full",
            ...e,
            children: [k, _]
        }), M[48] = e, M[49] = k, M[50] = _, M[51] = w) : w = M[51], w
    });
    var tN = e.i(467943),
        tw = e.i(839156);
    let tM = [.26, .08, .25, 1],
        tI = [.26, .08, .25, 1],
        tO = {
            hidden: {
                height: 0
            },
            visible: {
                height: "auto"
            }
        },
        tR = {
            hidden: {
                opacity: 0
            },
            visible: {
                opacity: 1,
                transition: {
                    ease: tI,
                    duration: .2,
                    delay: .15
                }
            }
        };

    function tE(e) {
        let a, s, n, i, o = (0, r.c)(15),
            {
                visible: l,
                title: c,
                titleExtra: d,
                subtitle: u,
                subtitleExtra: m,
                value: x
            } = e,
            p = l ? "visible" : "hidden",
            h = l ? "visible" : "hidden",
            f = l ? "visible" : "hidden";
        return o[0] === Symbol.for("react.memo_cache_sentinel") ? (a = {
            ease: tM,
            duration: .27
        }, o[0] = a) : a = o[0], o[1] !== u || o[2] !== m || o[3] !== c || o[4] !== d || o[5] !== x || o[6] !== l ? (s = l && (0, t.jsx)(ey.motion.div, {
            variants: tR,
            initial: "hidden",
            animate: "visible",
            exit: "hidden",
            transition: {
                duration: .15,
                ease: tI
            },
            children: (0, t.jsxs)("div", {
                className: "flex flex-col gap-4 w-full justify-center items-center",
                children: [(0, t.jsx)("div", {
                    className: "self-stretch -mx-4 mt-6 mb-3 border-b border-b-border"
                }), (0, t.jsx)("div", {
                    className: "w-full",
                    children: (0, t.jsxs)("div", {
                        className: "flex w-full items-center mb-3 gap-2 justify-between",
                        children: [(0, t.jsxs)("div", {
                            className: "flex flex-col",
                            children: [(0, t.jsxs)("div", {
                                className: "flex items-center gap-1.5",
                                children: [(0, t.jsx)("p", {
                                    className: "font-medium text-base truncate leading-[21px] text-text-primary",
                                    children: c
                                }), d ? ? (0, t.jsx)(tw.CashBalanceIcon, {
                                    className: "size-5"
                                })]
                            }), (u || m) && (0, t.jsxs)("div", {
                                className: "flex h-[18px] items-center gap-1 mt-1",
                                children: [u && (0, t.jsx)("p", {
                                    className: "text-body-xs font-medium truncate text-text-secondary leading-[18px]",
                                    children: u
                                }), m]
                            })]
                        }), (0, t.jsx)("div", {
                            className: "flex items-center flex-1 min-w-0 justify-end",
                            children: (0, t.jsx)(tT.AutosizableInput, {
                                readOnly: !0,
                                inputMode: "decimal",
                                type: "text",
                                autoComplete: "off",
                                autosizeOptions: {
                                    mode: "stretch"
                                },
                                align: "right",
                                autoscaleFontOptions: {
                                    enabled: !0,
                                    minFontSize: 12
                                },
                                prefix: "$",
                                fontColor: "var(--green-500)",
                                value: x
                            })
                        })]
                    })
                })]
            })
        }, "market-order-to-win"), o[1] = u, o[2] = m, o[3] = c, o[4] = d, o[5] = x, o[6] = l, o[7] = s) : s = o[7], o[8] !== s ? (n = (0, t.jsx)(k.AnimatePresence, {
            initial: !1,
            mode: "sync",
            children: s
        }), o[8] = s, o[9] = n) : n = o[9], o[10] !== p || o[11] !== h || o[12] !== f || o[13] !== n ? (i = (0, t.jsx)(ey.motion.div, {
            className: "w-full relative",
            variants: tO,
            initial: p,
            animate: h,
            exit: f,
            transition: a,
            children: n
        }), o[10] = p, o[11] = h, o[12] = f, o[13] = n, o[14] = i) : i = o[14], i
    }
    var tq = e.i(702550),
        tB = e.i(718882),
        tP = e.i(454619),
        tA = e.i(684656);
    let tD = e => {
        let a, s, n, i, o, l, d, u, m, x, p, h, f, g, b, S = (0, r.c)(36),
            {
                shares: v,
                averagePrice: j
            } = e,
            C = (0, c.useTranslations)();
        S[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["sharesUsdc"], S[0] = a) : a = S[0];
        let {
            sharesUsdc: T
        } = (0, y.useTradeContext)(a);
        S[1] !== j || S[2] !== v || S[3] !== T ? (s = (({
            shares: e,
            averagePrice: t,
            sharesUsdc: r
        }) => ({
            roi: ((e, t) => {
                let r = (0, tA.calculateMarketROI)(e, t);
                if (Number.isNaN(r) || 0 === r) return "+0%";
                let a = `+${r.toLocaleString("en-US",{minimumFractionDigits:2*(r<10),maximumFractionDigits:2*(r<10)})}`;
                return `${a.endsWith(".00")?a.slice(0,-3):a}%`
            })(r, e),
            profit: ((e, t) => {
                if (0 === t) return "+$0";
                let r = `+$${((1-e)*t).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`;
                return r.endsWith(".00") ? r.slice(0, -3) : r
            })(t, e),
            multiplier: (e => {
                if (0 === e) return "0x";
                let t = `${(1/e).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`;
                return `${t.endsWith(".00")?t.slice(0,-3):t}x`
            })(t)
        }))({
            shares: v,
            averagePrice: j,
            sharesUsdc: T
        }), S[1] = j, S[2] = v, S[3] = T, S[4] = s) : s = S[4];
        let {
            roi: k,
            profit: _,
            multiplier: N
        } = s;
        return S[5] !== C ? (n = C("trading.profit"), S[5] = C, S[6] = n) : n = S[6], S[7] !== n ? (i = (0, t.jsx)("p", {
            className: "text-sm font-normal text-text-secondary",
            children: n
        }), S[7] = n, S[8] = i) : i = S[8], S[9] !== _ ? (o = (0, t.jsx)("p", {
            className: "text-[15px] font-medium text-green-600 dark:text-green-500",
            children: _
        }), S[9] = _, S[10] = o) : o = S[10], S[11] !== i || S[12] !== o ? (l = (0, t.jsxs)("div", {
            className: "flex justify-between items-center gap-10",
            children: [i, o]
        }), S[11] = i, S[12] = o, S[13] = l) : l = S[13], S[14] !== C ? (d = C("trading.change"), S[14] = C, S[15] = d) : d = S[15], S[16] !== d ? (u = (0, t.jsx)("p", {
            className: "text-sm font-normal text-text-secondary",
            children: d
        }), S[16] = d, S[17] = u) : u = S[17], S[18] !== k ? (m = (0, t.jsx)("p", {
            className: "text-[15px] font-medium text-green-600 dark:text-green-500",
            children: k
        }), S[18] = k, S[19] = m) : m = S[19], S[20] !== u || S[21] !== m ? (x = (0, t.jsxs)("div", {
            className: "flex justify-between items-center gap-10",
            children: [u, m]
        }), S[20] = u, S[21] = m, S[22] = x) : x = S[22], S[23] !== C ? (p = C("trading.multiplier"), S[23] = C, S[24] = p) : p = S[24], S[25] !== p ? (h = (0, t.jsx)("p", {
            className: "text-sm font-normal text-text-secondary",
            children: p
        }), S[25] = p, S[26] = h) : h = S[26], S[27] !== N ? (f = (0, t.jsx)("p", {
            className: "text-[15px] font-medium text-green-600 dark:text-green-500",
            children: N
        }), S[27] = N, S[28] = f) : f = S[28], S[29] !== h || S[30] !== f ? (g = (0, t.jsxs)("div", {
            className: "flex justify-between items-center gap-10",
            children: [h, f]
        }), S[29] = h, S[30] = f, S[31] = g) : g = S[31], S[32] !== x || S[33] !== g || S[34] !== l ? (b = (0, t.jsx)("div", {
            className: "flex flex-col gap-2 p-1",
            children: (0, t.jsxs)("div", {
                className: "flex flex-col gap-2",
                children: [l, x, g]
            })
        }), S[32] = x, S[33] = g, S[34] = l, S[35] = b) : b = S[35], b
    };
    tD.displayName = "MarketInfoTooltipContent";
    let tF = e => {
        let s, i, o, l, u, m, x, p, h, f = (0, r.c)(29),
            {
                visible: g,
                shares: b,
                averagePrice: S,
                usdcReceived: v,
                feeEnabled: j,
                feeValue: C
            } = e,
            T = (0, c.useTranslations)();
        f[0] === Symbol.for("react.memo_cache_sentinel") ? (s = ["side"], f[0] = s) : s = f[0];
        let {
            side: k
        } = (0, y.useTradeContext)(s), {
            toWinValue: _,
            toWinMaxDecimals: w,
            avgPrice: M,
            avgPriceLabel: I,
            fee: O,
            feeEnabled: R
        } = ((e, t, s, n, i) => {
            let o, l, c, d, u, m = (0, r.c)(22),
                x = (0, tP.usePrecision)();
            m[0] === Symbol.for("react.memo_cache_sentinel") ? (o = ["side"], m[0] = o) : o = m[0];
            let {
                side: p
            } = (0, y.useTradeContext)(o);
            m[1] !== t || m[2] !== n || m[3] !== i || m[4] !== x || m[5] !== e || m[6] !== p || m[7] !== s ? (l = {
                shares: e,
                averagePrice: t,
                usdcReceived: s,
                precision: x,
                side: p,
                feeEnabled: n,
                feeValue: i
            }, m[1] = t, m[2] = n, m[3] = i, m[4] = x, m[5] = e, m[6] = p, m[7] = s, m[8] = l) : l = m[8];
            let {
                shares: h,
                averagePrice: f,
                usdcReceived: g,
                precision: b,
                side: S,
                feeValue: v,
                feeEnabled: j
            } = N.default.useDeferredValue(l);
            if (m[9] !== f || m[10] !== b) c = `${(100*f).toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:b>2?b-2:0})}\xa2`, m[9] = f, m[10] = b, m[11] = c;
            else c = m[11];
            let C = `Avg. Price ${c}`,
                T = `${f}`;
            m[12] !== C || m[13] !== T ? (d = {
                avgPriceLabel: C,
                avgPrice: T
            }, m[12] = C, m[13] = T, m[14] = d) : d = m[14];
            let {
                avgPrice: k,
                avgPriceLabel: _
            } = d, w = S === a.Side.BUY ? h : g, M = w > 1e8, I = M ? Math.floor(w) : w, O = 2 * !M;
            return m[15] !== k || m[16] !== _ || m[17] !== j || m[18] !== v || m[19] !== O || m[20] !== I ? (u = {
                avgPrice: k,
                avgPriceLabel: _,
                toWinValue: I,
                toWinMaxDecimals: O,
                fee: v,
                feeEnabled: j
            }, m[15] = k, m[16] = _, m[17] = j, m[18] = v, m[19] = O, m[20] = I, m[21] = u) : u = m[21], u
        })(b, S ? ? 0, v ? ? 0, j, C), E = k === a.Side.SELL, q = S ? ? 0;
        f[1] !== b || f[2] !== q ? (i = (0, t.jsx)(tD, {
            shares: b,
            averagePrice: q
        }), f[1] = b, f[2] = q, f[3] = i) : i = f[3], f[4] === Symbol.for("react.memo_cache_sentinel") ? (o = (0, t.jsx)(tw.CashBalanceIcon, {
            className: "size-5"
        }), f[4] = o) : o = f[4], f[5] !== E || f[6] !== i ? (l = (0, t.jsx)(n.Tooltip, {
            collisionPadding: 12,
            disabled: E,
            delayDuration: 500,
            content: i,
            children: o
        }), f[5] = E, f[6] = i, f[7] = l) : l = f[7];
        let B = l;
        f[8] !== R || f[9] !== O ? (u = R && O > 0 ? (0, t.jsx)(tq.IconCircleDollarOutline18, {
            size: 14,
            className: "text-text-secondary"
        }) : (0, t.jsx)(d.IconCircleInfoOutline12, {
            className: "text-text-secondary"
        }), f[8] = R, f[9] = O, f[10] = u) : u = f[10], f[11] !== M || f[12] !== R || f[13] !== O || f[14] !== u ? (m = (0, t.jsx)(tB.OddsConverterTooltip, {
            price: M,
            feeEnabled: R,
            feeValue: O,
            children: u
        }), f[11] = M, f[12] = R, f[13] = O, f[14] = u, f[15] = m) : m = f[15];
        let P = m;
        return f[16] !== k || f[17] !== T ? (x = T(k === a.Side.BUY ? "trading.toWin" : "trading.youllReceive"), f[16] = k, f[17] = T, f[18] = x) : x = f[18], f[19] !== w || f[20] !== _ ? (p = _.toLocaleString("en-US", {
            minimumFractionDigits: 2 * (w > 0),
            maximumFractionDigits: w
        }), f[19] = w, f[20] = _, f[21] = p) : p = f[21], f[22] !== I || f[23] !== P || f[24] !== p || f[25] !== x || f[26] !== B || f[27] !== g ? (h = (0, t.jsx)(tE, {
            visible: g,
            title: x,
            titleExtra: B,
            subtitle: I,
            subtitleExtra: P,
            value: p
        }), f[22] = I, f[23] = P, f[24] = p, f[25] = x, f[26] = B, f[27] = g, f[28] = h) : h = f[28], h
    };
    tF.displayName = "MarketOrderToWinSection";
    var tU = e.i(373230);
    let tL = N.default.memo(function() {
            let e, a = (0, r.c)(7),
                s = (0, tN.useMarketOrderContext)();
            return a[0] !== s.averagePrice || a[1] !== s.canRender || a[2] !== s.feeEnabled || a[3] !== s.feeValue || a[4] !== s.sharesReceived || a[5] !== s.usdcReceived ? (e = (0, t.jsx)(tF, {
                visible: s.canRender,
                shares: s.sharesReceived,
                averagePrice: s.averagePrice,
                usdcReceived: s.usdcReceived,
                feeEnabled: s.feeEnabled,
                feeValue: s.feeValue
            }), a[0] = s.averagePrice, a[1] = s.canRender, a[2] = s.feeEnabled, a[3] = s.feeValue, a[4] = s.sharesReceived, a[5] = s.usdcReceived, a[6] = e) : e = a[6], e
        }),
        t$ = e => {
            let a, s, n, i, o, l, c, d = (0, r.c)(11);
            return d[0] !== e ? ({
                className: a,
                ...s
            } = e, d[0] = e, d[1] = a, d[2] = s) : (a = d[1], s = d[2]), d[3] !== a ? (n = (0, v.cn)("flex flex-col w-full", a), d[3] = a, d[4] = n) : n = d[4], d[5] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)(t_, {}), o = (0, t.jsx)(tL, {}), l = (0, t.jsx)(tU.TradeError, {}), d[5] = i, d[6] = o, d[7] = l) : (i = d[5], o = d[6], l = d[7]), d[8] !== s || d[9] !== n ? (c = (0, t.jsxs)("div", {
                className: n,
                ...s,
                children: [i, o, l]
            }), d[8] = s, d[9] = n, d[10] = c) : c = d[10], c
        };
    t$.displayName = "MarketOrderContentInternals";
    let tG = N.default.memo(t$),
        tQ = N.default.memo(function(e) {
            let a, s = (0, r.c)(2);
            return s[0] !== e ? (a = (0, t.jsx)(tN.MarketOrderContextProvider, {
                children: (0, t.jsx)(tG, { ...e
                })
            }), s[0] = e, s[1] = a) : a = s[1], a
        });
    tQ.displayName = "MarketOrderContent";
    var tz = e.i(211721);
    let tW = () => {
            let e, s, n, i, o, l, d, u, m, x, p, h, f = (0, r.c)(34),
                g = (0, c.useTranslations)();
            f[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated"], f[0] = e) : e = f[0];
            let {
                authenticated: b
            } = (0, el.useAccountContext)(e);
            f[1] === Symbol.for("react.memo_cache_sentinel") ? (s = ["side"], f[1] = s) : s = f[1];
            let {
                side: v
            } = (0, y.useTradeContext)(s), {
                setShakeAmount: j
            } = (0, S.useTradeAnimationContext)(), {
                request: C
            } = (0, ea.useRfqRequestState)();
            f[2] !== g ? (n = e => {
                let {
                    balance: t
                } = e;
                return (0, tj.cashBalanceFormatter)({
                    balance: t,
                    cashLabel: g("trading.cash")
                })
            }, f[2] = g, f[3] = n) : n = f[3];
            let T = n,
                {
                    ref: k,
                    value: _
                } = (0, tb.useAmountFieldMask)(),
                N = (0, tS.useOnBlur)();
            f[4] !== k || f[5] !== j ? (i = e => {
                (0, tC.validateAmountKeyPress)(k.current, e) || j(!0)
            }, f[4] = k, f[5] = j, f[6] = i) : i = f[6];
            let w = i,
                M = !!C;
            f[7] !== v || f[8] !== g ? (o = v === a.Side.BUY ? g("trading.amount") : g("trading.shares"), f[7] = v, f[8] = g, f[9] = o) : o = f[9], f[10] !== M || f[11] !== o ? (l = (0, t.jsx)("span", {
                "data-submitted": M,
                className: "font-medium text-lg text-text-primary data-[submitted=true]:text-text-secondary",
                children: o
            }), f[10] = M, f[11] = o, f[12] = l) : l = f[12], f[13] !== b || f[14] !== C || f[15] !== v || f[16] !== T ? (d = !C && b && v === a.Side.BUY && (0, t.jsx)("div", {
                className: "h-4",
                children: (0, t.jsx)(ti.BalanceSection, {
                    variant: "usdc",
                    formatter: T
                })
            }), f[13] = b, f[14] = C, f[15] = v, f[16] = T, f[17] = d) : d = f[17], f[18] !== l || f[19] !== d ? (u = (0, t.jsxs)("div", {
                className: "flex flex-col gap-0.5",
                children: [l, d]
            }), f[18] = l, f[19] = d, f[20] = u) : u = f[20];
            let I = v === a.Side.BUY ? "$0" : "0";
            f[21] === Symbol.for("react.memo_cache_sentinel") ? (m = {
                mode: "stretch"
            }, f[21] = m) : m = f[21];
            let O = v === a.Side.BUY ? "$" : "";
            f[22] === Symbol.for("react.memo_cache_sentinel") ? (x = {
                enabled: !0
            }, f[22] = x) : x = f[22];
            let R = !!C;
            return f[23] !== k || f[24] !== _ || f[25] !== N || f[26] !== w || f[27] !== O || f[28] !== R || f[29] !== I ? (p = (0, t.jsx)("div", {
                className: "flex items-center w-full justify-end",
                children: (0, t.jsx)(tT.AutosizableInput, {
                    ref: k,
                    id: "rfq-amount-input",
                    inputMode: "decimal",
                    type: "text",
                    placeholder: I,
                    autoComplete: "off",
                    onBlur: N,
                    value: _,
                    autosizeOptions: m,
                    align: "right",
                    prefix: O,
                    autoscaleFontOptions: x,
                    onKeyDown: w,
                    autoFocus: !0,
                    disabled: R
                })
            }), f[23] = k, f[24] = _, f[25] = N, f[26] = w, f[27] = O, f[28] = R, f[29] = I, f[30] = p) : p = f[30], f[31] !== p || f[32] !== u ? (h = (0, t.jsx)("div", {
                className: "w-full h-full",
                children: (0, t.jsx)("div", {
                    className: "flex flex-col w-full gap-2 mt-3",
                    children: (0, t.jsxs)("div", {
                        className: "flex items-center w-full gap-3 justify-between",
                        children: [u, p]
                    })
                })
            }), f[31] = p, f[32] = u, f[33] = h) : h = f[33], h
        },
        tH = e => {
            let a, s, n, i, o, l = (0, r.c)(12),
                {
                    request: d
                } = e,
                u = (0, c.useTranslations)(),
                m = d ? .expiry ? 1e3 * d.expiry : 0;
            l[0] !== d || l[1] !== m ? (a = { ...d,
                expiry: m
            }, l[0] = d, l[1] = m, l[2] = a) : a = l[2];
            let x = a,
                [p, h] = (0, N.useState)(0);
            l[3] !== x ? .expiry ? (s = () => {
                let e = () => {
                    let e = Date.now();
                    return Math.max(0, (x ? .expiry || 0) - e)
                };
                h(e());
                let t = setInterval(() => {
                    let r = e();
                    h(r), r <= 0 && clearInterval(t)
                }, 1e3);
                return () => clearInterval(t)
            }, l[3] = x ? .expiry, l[4] = s) : s = l[4];
            let f = x ? .expiry;
            return (l[5] !== f ? (n = [f], l[5] = f, l[6] = n) : n = l[6], (0, N.useEffect)(s, n), !x || p <= 0) ? null : (l[7] !== u || l[8] !== p ? (i = u("trading.remaining", {
                time: function(e) {
                    if (e <= 0) return "";
                    let t = Math.floor(e / 1e3),
                        r = Math.floor(t / 60);
                    return `${r}:${(t%60).toString().padStart(2,"0")}`
                }(p)
            }), l[7] = u, l[8] = p, l[9] = i) : i = l[9], l[10] !== i ? (o = (0, t.jsx)("div", {
                className: "flex justify-center text-xs p-2 text-text-primary bg-neutral-100 rounded-b-sm",
                children: i
            }), l[10] = i, l[11] = o) : o = l[11], o)
        };
    var tY = e.i(90783),
        tK = e.i(897765),
        tV = e.i(368208);
    let tJ = e => e.toString().padStart(2, "0"),
        tX = e => {
            let a, s, n, i, o, l, d, u, m = (0, r.c)(15),
                {
                    expiry: x
                } = e,
                p = (0, c.useTranslations)();
            m[0] !== x ? (a = () => x - Date.now(), m[0] = x, m[1] = a) : a = m[1];
            let [h, f] = (0, N.useState)(a);
            m[2] !== x ? (s = () => {
                let e = setInterval(() => {
                    let t = x - Date.now();
                    f(t), t <= 0 && clearInterval(e)
                }, 1e3);
                return () => clearInterval(e)
            }, n = [x], m[2] = x, m[3] = s, m[4] = n) : (s = m[3], n = m[4]), (0, N.useEffect)(s, n);
            let g = Math.floor(h / 6e4),
                y = Math.floor(h % 6e4 / 1e3);
            m[5] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)(tV.Stopwatch, {}), m[5] = i) : i = m[5], m[6] !== g ? (o = tJ(g), m[6] = g, m[7] = o) : o = m[7], m[8] !== y ? (l = tJ(y), m[8] = y, m[9] = l) : l = m[9];
            let b = `${o}:${l}`;
            return m[10] !== p || m[11] !== b ? (d = p("trading.leftToAccept", {
                time: b
            }), m[10] = p, m[11] = b, m[12] = d) : d = m[12], m[13] !== d ? (u = (0, t.jsxs)("span", {
                className: "flex items-center gap-1 text-text-brand text-sm bg-blue-50 rounded px-2 py-0.5",
                children: [i, d]
            }), m[13] = d, m[14] = u) : u = m[14], u
        },
        tZ = () => {
            let e, a, s, n, i, o, l, d, u, m, x, p, h, f, g, y, b, S, v, j, C, T = (0, r.c)(64),
                k = (0, c.useTranslations)(),
                {
                    request: _
                } = (0, ea.useRfqRequestState)(),
                {
                    quote: N
                } = (0, er.useRfqQuoteState)(_ ? .requestId);
            T[0] !== _ ? (e = (e => {
                if (!e ? .expiry) return !0;
                let t = new Date(1e3 * e.expiry),
                    r = new Date;
                return (0, tY.isBefore)(r, t)
            })(_), T[0] = _, T[1] = e) : e = T[1];
            let w = e;
            if (N && _ && ("STATE_REQUEST_EXPIRED" === _.state || "STATE_USER_CANCELLED" === _.state)) {
                let e, r;
                return T[2] !== k ? (e = k("trading.requestExpired"), T[2] = k, T[3] = e) : e = T[3], T[4] !== e ? (r = (0, t.jsx)("div", {
                    className: "flex flex-col gap-4 w-full items-center justify-center h-20",
                    children: (0, t.jsx)("div", {
                        className: "text-lg text-text-brand",
                        children: e
                    })
                }), T[4] = e, T[5] = r) : r = T[5], r
            }
            if (!N) {
                let e, r, a, s;
                return T[6] !== k ? (e = k("trading.collectingQuotes"), T[6] = k, T[7] = e) : e = T[7], T[8] !== k ? (r = k("trading.bestOfferAppearHere"), T[8] = k, T[9] = r) : r = T[9], T[10] !== r ? (a = (0, t.jsx)("div", {
                    className: "text-xs text-text-disabled",
                    children: r
                }), T[10] = r, T[11] = a) : a = T[11], T[12] !== e || T[13] !== a ? (s = (0, t.jsx)("div", {
                    className: "flex flex-col gap-4 w-full items-center justify-center text-center h-30",
                    children: (0, t.jsxs)("div", {
                        className: "text-lg font-medium text-text-brand",
                        children: [e, a]
                    })
                }), T[12] = e, T[13] = a, T[14] = s) : s = T[14], s
            }
            T[15] !== w || T[16] !== k ? (a = (0, t.jsx)("div", {
                className: "flex items-center justify-center mb-2",
                children: w ? (0, t.jsx)("span", {
                    className: "text-text-secondary text-lg",
                    children: k("trading.bestOffer")
                }) : (0, t.jsxs)(t.Fragment, {
                    children: [(0, t.jsx)("span", {
                        className: "h-2 w-2 bg-green-500 rounded-full inline-block mr-2"
                    }), (0, t.jsx)("span", {
                        className: "text-text-secondary font-medium text-base",
                        children: k("trading.currentBestOffer")
                    })]
                })
            }), T[15] = w, T[16] = k, T[17] = a) : a = T[17], T[18] !== k ? (s = k("trading.avgPrice"), T[18] = k, T[19] = s) : s = T[19], T[20] !== s ? (n = (0, t.jsx)("span", {
                className: "text-text-secondary font-medium",
                children: s
            }), T[20] = s, T[21] = n) : n = T[21], T[22] !== N.price ? (i = (0, ep.showCentsOnly)(N.price), T[22] = N.price, T[23] = i) : i = T[23], T[24] !== i ? (o = (0, t.jsxs)("span", {
                className: "text-text-brand text-lg",
                children: [i, "¢"]
            }), T[24] = i, T[25] = o) : o = T[25], T[26] !== n || T[27] !== o ? (l = (0, t.jsxs)("div", {
                className: "flex justify-between items-center px-6 pt-6",
                children: [n, o]
            }), T[26] = n, T[27] = o, T[28] = l) : l = T[28], T[29] !== k ? (d = k("trading.shares"), T[29] = k, T[30] = d) : d = T[30], T[31] !== d ? (u = (0, t.jsx)("span", {
                className: "text-neutral-500 font-medium",
                children: d
            }), T[31] = d, T[32] = u) : u = T[32], T[33] !== N.sizeIn ? (m = (0, ep.numberStringWithCommas)(N.sizeIn.toString() || "0"), T[33] = N.sizeIn, T[34] = m) : m = T[34], T[35] !== m ? (x = (0, t.jsx)("span", {
                className: "text-text-primary text-lg",
                children: m
            }), T[35] = m, T[36] = x) : x = T[36], T[37] !== x || T[38] !== u ? (p = (0, t.jsxs)("div", {
                className: "flex justify-between items-center border-b border-neutral-100 w-full pb-4 px-6",
                children: [u, x]
            }), T[37] = x, T[38] = u, T[39] = p) : p = T[39], T[40] !== k ? (h = k("trading.toWin"), T[40] = k, T[41] = h) : h = T[41], T[42] !== h ? (f = (0, t.jsx)("span", {
                className: "text-text-secondary",
                children: h
            }), T[42] = h, T[43] = f) : f = T[43], T[44] === Symbol.for("react.memo_cache_sentinel") ? (g = (0, t.jsx)(tw.CashBalanceIcon, {}), T[44] = g) : g = T[44];
            let M = Number(N.sizeIn) || 0;
            return T[45] !== M ? (y = (0, t.jsxs)("span", {
                className: "text-green-500 text-lg flex items-center gap-1",
                children: [g, (0, t.jsx)(tK.AnimatedAmount, {
                    value: M
                })]
            }), T[45] = M, T[46] = y) : y = T[46], T[47] !== f || T[48] !== y ? (b = (0, t.jsxs)("div", {
                className: "flex justify-between items-center mt-2 px-6 pb-6",
                children: [f, y]
            }), T[47] = f, T[48] = y, T[49] = b) : b = T[49], T[50] !== p || T[51] !== b || T[52] !== l ? (S = (0, t.jsx)("div", {
                className: "border border-neutral-100 rounded-xl shadow w-full",
                children: (0, t.jsxs)("div", {
                    className: "flex flex-col gap-4",
                    children: [l, p, b]
                })
            }), T[50] = p, T[51] = b, T[52] = l, T[53] = S) : S = T[53], T[54] !== w || T[55] !== _ || T[56] !== k ? (v = w && _ ? .expiry ? (0, t.jsx)(tX, {
                expiry: 1e3 * _.expiry
            }) : k("trading.acceptOrWait"), T[54] = w, T[55] = _, T[56] = k, T[57] = v) : v = T[57], T[58] !== v ? (j = (0, t.jsx)("div", {
                className: "text-center text-xs text-text-secondary mt-4 max-w-sm",
                children: v
            }), T[58] = v, T[59] = j) : j = T[59], T[60] !== a || T[61] !== S || T[62] !== j ? (C = (0, t.jsxs)("div", {
                className: "flex flex-col items-center w-full pt-4",
                children: [a, S, j]
            }), T[60] = a, T[61] = S, T[62] = j, T[63] = C) : C = T[63], C
        },
        t0 = {
            hidden: {
                height: 0
            },
            visible: {
                height: "auto"
            }
        },
        t1 = {
            hidden: {
                opacity: 0
            },
            visible: {
                opacity: 1,
                transition: {
                    ease: eS.opacityTransition.ease,
                    duration: .2,
                    delay: .15
                }
            }
        },
        t2 = () => {
            let e, a, s, n, i, o, l, c = (0, r.c)(15),
                {
                    request: d
                } = (0, ea.useRfqRequestState)(),
                u = (() => {
                    let e, t = (0, r.c)(3),
                        {
                            request: a
                        } = (0, ea.useRfqRequestState)(),
                        s = (0, et.useClob)();
                    return t[0] !== s || t[1] !== a ? (e = async () => {
                        a ? .requestId && s && await s.cancelRfqRequest({
                            requestId: a.requestId
                        })
                    }, t[0] = s, t[1] = a, t[2] = e) : e = t[2], e
                })();
            c[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)(tW, {}), c[0] = e) : e = c[0];
            let m = d ? "visible" : "hidden",
                x = d ? "visible" : "hidden",
                h = d ? "visible" : "hidden";
            return c[1] === Symbol.for("react.memo_cache_sentinel") ? (a = { ...eS.transition
            }, c[1] = a) : a = c[1], c[2] !== u || c[3] !== d ? (s = !!d && (0, t.jsx)(ey.motion.div, {
                variants: t1,
                initial: "hidden",
                animate: "visible",
                exit: "hidden",
                transition: { ...eS.opacityTransition
                },
                children: (0, t.jsxs)("div", {
                    className: "flex flex-col w-full items-center justify-center",
                    children: [(0, t.jsx)("div", {
                        className: "bg-neutral-100 h-[3px] mt-4 border",
                        style: {
                            width: `${p.EVENT_LAYOUT_BUY_SELL_WIDGET_WIDTH}px`
                        }
                    }), (0, t.jsxs)("div", {
                        className: "flex items-center w-full",
                        children: [(0, t.jsx)("div", {
                            className: "flex-1"
                        }), (0, t.jsx)(tH, {
                            request: d
                        }), (0, t.jsx)("div", {
                            className: "flex-1 flex justify-end",
                            children: (0, t.jsx)("button", {
                                type: "button",
                                className: "cursor-pointer",
                                onClick: u,
                                "aria-label": "Cancel RFQ request",
                                children: (0, t.jsx)(tz.IconXmarkOutline12, {
                                    "aria-hidden": "true"
                                })
                            })
                        })]
                    }), (0, t.jsx)(tZ, {})]
                })
            }, "rfq-order"), c[2] = u, c[3] = d, c[4] = s) : s = c[4], c[5] !== s ? (n = (0, t.jsx)(k.AnimatePresence, {
                initial: !1,
                mode: "sync",
                children: s
            }), c[5] = s, c[6] = n) : n = c[6], c[7] !== m || c[8] !== x || c[9] !== h || c[10] !== n ? (i = (0, t.jsx)(ey.motion.div, {
                variants: t0,
                initial: m,
                animate: x,
                exit: h,
                transition: a,
                className: "w-full relative",
                children: n
            }), c[7] = m, c[8] = x, c[9] = h, c[10] = n, c[11] = i) : i = c[11], c[12] === Symbol.for("react.memo_cache_sentinel") ? (o = (0, t.jsx)(tU.TradeError, {}), c[12] = o) : o = c[12], c[13] !== i ? (l = (0, t.jsxs)("div", {
                className: "flex flex-col w-full",
                children: [e, i, o]
            }), c[13] = i, c[14] = l) : l = c[14], l
        };

    function t3() {
        let e, a, s = (0, r.c)(7),
            n = (() => {
                let e, t = (0, r.c)(1);
                t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["orderType"], t[0] = e) : e = t[0];
                let {
                    orderType: a
                } = (0, y.useTradeContext)(e);
                return a
            })();
        switch (n) {
            case m.OrderType.Market:
                {
                    let r;s[0] === Symbol.for("react.memo_cache_sentinel") ? (r = (0, t.jsx)(tQ, {}), s[0] = r) : r = s[0],
                    e = r;
                    break
                }
            case m.OrderType.Limit:
                {
                    let r;s[1] === Symbol.for("react.memo_cache_sentinel") ? (r = (0, t.jsx)(tg.LimitOrderContent, {}), s[1] = r) : r = s[1],
                    e = r;
                    break
                }
            case m.OrderType.RFQ:
                {
                    let r;s[2] === Symbol.for("react.memo_cache_sentinel") ? (r = (0, t.jsx)(t2, {}), s[2] = r) : r = s[2],
                    e = r;
                    break
                }
            default:
                {
                    let r;s[3] === Symbol.for("react.memo_cache_sentinel") ? (r = (0, t.jsx)(tQ, {}), s[3] = r) : r = s[3],
                    e = r
                }
        }
        let o = e;
        return s[4] !== o || s[5] !== n ? (a = (0, t.jsx)(i.OrderContentAnimator, {
            contentKey: n,
            children: o
        }), s[4] = o, s[5] = n, s[6] = a) : a = s[6], a
    }
    var t4 = e.i(289981),
        t5 = e.i(215885),
        t6 = e.i(779584),
        t8 = e.i(91817);

    function t9(e) {
        let a, s, n, i, o, l, c, d, u, m, x = (0, r.c)(46),
            {
                className: p,
                colors: h,
                oddsFormat: g,
                sportSlug: b
            } = e,
            S = void 0 === g ? "price" : g;
        x[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["selectedOutcomeIdx", "setSelectedOutcomeIdx"], x[0] = a) : a = x[0];
        let {
            selectedOutcomeIdx: v,
            setSelectedOutcomeIdx: j
        } = (0, y.useTradeContext)(a);
        x[1] === Symbol.for("react.memo_cache_sentinel") ? (s = ["activeMarket"], x[1] = s) : s = x[1];
        let {
            activeMarket: C
        } = (0, f.useEventActiveMarketContext)(s), {
            request: T
        } = (0, ea.useRfqRequestState)(), {
            quote: k
        } = (0, er.useRfqQuoteState)(T ? .requestId), _ = !!T && !k;
        if (x[2] !== C.outcomes || x[3] !== C.teams) {
            e: {
                let e = C.teams && 2 === C.teams.length ? C.teams : [void 0, void 0];
                if (!e[0] || !e[1] || !C.outcomes || C.outcomes.length < 2) {
                    n = e;
                    break e
                }
                let t = t7,
                    r = (e, r) => {
                        let a = 0;
                        for (let s of [r.alias, r.name, r.abbreviation]) {
                            let r = t(s);
                            if (r) {
                                if (r === e) return 100;
                                e.includes(r) ? a = Math.max(a, r.length) : r.includes(e) && (a = Math.max(a, e.length))
                            }
                        }
                        return a
                    },
                    a = t(C.outcomes[0]),
                    s = t(C.outcomes[1]);
                if (!a || !s) {
                    n = e;
                    break e
                }
                let i = r(a, e[0]) + r(s, e[1]);n = r(a, e[1]) + r(s, e[0]) > i ? [e[1], e[0]] : [e[0], e[1]]
            }
            x[2] = C.outcomes,
            x[3] = C.teams,
            x[4] = n
        }
        else n = x[4];
        let N = n;
        t: {
            let e, t, r;
            if ("spreads" !== C.sportsMarketType) {
                i = h;
                break t
            }
            x[5] !== h || x[6] !== N[0] ? (e = N[0] ? (0, z.getSportsButtonColor)({
                team: N[0]
            }) : h.zeroButtonColor, x[5] = h, x[6] = N[0], x[7] = e) : e = x[7];
            let a = e;x[8] !== h || x[9] !== N[1] ? (t = N[1] ? (0, z.getSportsButtonColor)({
                team: N[1]
            }) : h.oneButtonColor, x[8] = h, x[9] = N[1], x[10] = t) : t = x[10];
            let s = t;x[11] !== s || x[12] !== a ? (r = {
                zeroButtonColor: a,
                oneButtonColor: s
            }, x[11] = s, x[12] = a, x[13] = r) : r = x[13],
            i = r
        }
        let w = i,
            M = (0, t8.useOutcomeButtonData)(0, N[0], w.zeroButtonColor, S, b),
            I = (0, t8.useOutcomeButtonData)(1, N[1], w.oneButtonColor, S, b),
            O = M.buttonColor.color;
        x[14] !== O || x[15] !== M.buttonColor.customColors || x[16] !== M.formattedPrice || x[17] !== M.label ? (o = {
            value: "0",
            label: M.label,
            price: M.formattedPrice,
            color: O,
            customColors: M.buttonColor.customColors
        }, x[14] = O, x[15] = M.buttonColor.customColors, x[16] = M.formattedPrice, x[17] = M.label, x[18] = o) : o = x[18];
        let R = I.buttonColor.color;
        x[19] !== I.buttonColor.customColors || x[20] !== I.formattedPrice || x[21] !== I.label || x[22] !== R ? (l = {
            value: "1",
            label: I.label,
            price: I.formattedPrice,
            color: R,
            customColors: I.buttonColor.customColors
        }, x[19] = I.buttonColor.customColors, x[20] = I.formattedPrice, x[21] = I.label, x[22] = R, x[23] = l) : l = x[23], x[24] !== o || x[25] !== l ? (c = [o, l], x[24] = o, x[25] = l, x[26] = c) : c = x[26];
        let E = c;
        x[27] !== I || x[28] !== j || x[29] !== M ? (d = e => {
            let t = parseInt(e, 10);
            j(t);
            let r = 0 === t ? M : I;
            r.onSelect && r.onSelect()
        }, x[27] = I, x[28] = j, x[29] = M, x[30] = d) : d = x[30];
        let q = d;
        x[31] !== C.conditionId || x[32] !== I || x[33] !== M ? (u = e => {
            let r = "0" === e.value ? M : I;
            return (0, t.jsx)(t6.AnimatedPrice, {
                className: "ml-1 text-base",
                value: r.priceValue,
                format: r.priceFormat,
                formatted: r.formattedPrice,
                decimals: r.priceDecimals,
                dependency: r.formattedPrice
            }, C.conditionId)
        }, x[31] = C.conditionId, x[32] = I, x[33] = M, x[34] = u) : u = x[34];
        let B = u,
            P = `${v}`,
            A = !!k || _;
        return x[35] !== C.invertOutcomesVisually || x[36] !== p || x[37] !== q || x[38] !== E || x[39] !== B || x[40] !== P || x[41] !== A || x[42] !== M.buttonSpacing || x[43] !== M.isThreeDee || x[44] !== M.uppercase ? (m = (0, t.jsx)(t5.OutcomeButtonGroup, {
            value: P,
            onValueChange: q,
            options: E,
            isThreeDee: M.isThreeDee,
            layout: M.buttonSpacing,
            invertVisually: C.invertOutcomesVisually,
            uppercase: M.uppercase,
            disabled: A,
            renderPrice: B,
            className: p
        }), x[35] = C.invertOutcomesVisually, x[36] = p, x[37] = q, x[38] = E, x[39] = B, x[40] = P, x[41] = A, x[42] = M.buttonSpacing, x[43] = M.isThreeDee, x[44] = M.uppercase, x[45] = m) : m = x[45], m
    }

    function t7(e) {
        return (e || "").toUpperCase().replace(/[^A-Z0-9]/g, "")
    }
    var re = e.i(449372);
    let rt = {
            duration: .75 * eS.transition.duration,
            ease: eS.transition.ease
        },
        rr = {
            duration: .75 * eS.opacityTransition.duration,
            ease: eS.opacityTransition.ease
        },
        ra = {
            hidden: {
                height: 0,
                opacity: 0,
                transition: { ...rt,
                    opacity: {
                        ease: rr.ease,
                        duration: rr.duration
                    }
                }
            },
            visible: {
                height: "24px",
                opacity: 1,
                transition: { ...rt,
                    opacity: {
                        ease: rr.ease,
                        duration: rr.duration,
                        delay: rt.duration - rr.duration
                    }
                }
            }
        },
        rs = {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1
            },
            exit: {
                opacity: 0
            }
        },
        rn = ({
            positions: e,
            outcomeIndex: t,
            market: r,
            sharesLabel: a
        }) => {
            let s = (0, re.getSharesForMarket)({
                positions: e,
                outcomeIndex: t,
                market: r
            });
            return s ? .qty ? {
                hasShares: !0,
                formatted: `${s.qty.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:2*(s.qty<100)})} ${a}`
            } : {
                hasShares: !1
            }
        };

    function ri(e) {
        let s, n, i, o, l, d, u, m, x, p, h, g = (0, r.c)(44);
        if (g[0] !== e) {
            let {
                ref: t,
                teams: r,
                colors: a,
                className: l,
                ...c
            } = e;
            i = t, n = a, s = l, o = c, g[0] = e, g[1] = s, g[2] = n, g[3] = i, g[4] = o
        } else s = g[1], n = g[2], i = g[3], o = g[4];
        let b = (0, c.useTranslations)();
        g[5] === Symbol.for("react.memo_cache_sentinel") ? (l = ["authenticated"], g[5] = l) : l = g[5];
        let {
            authenticated: S
        } = (0, el.useAccountContext)(l);
        g[6] === Symbol.for("react.memo_cache_sentinel") ? (d = ["activeMarket"], g[6] = d) : d = g[6];
        let {
            activeMarket: j
        } = (0, f.useEventActiveMarketContext)(d);
        g[7] === Symbol.for("react.memo_cache_sentinel") ? (u = ["positions"], g[7] = u) : u = g[7];
        let {
            positions: C
        } = (0, eH.useEventPositionsContext)(u);
        g[8] === Symbol.for("react.memo_cache_sentinel") ? (m = ["selectedOutcomeIdx", "side"], g[8] = m) : m = g[8];
        let {
            selectedOutcomeIdx: T,
            side: _
        } = (0, y.useTradeContext)(m), w = N.default.useDeferredValue(_);
        if (g[9] !== j || g[10] !== S || g[11] !== n || g[12] !== C || g[13] !== b) {
            e: {
                let e, t, r, a, s;
                if (!S) {
                    let e;
                    g[15] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                        canShow: !1,
                        zeroShares: void 0,
                        oneShares: void 0
                    }, g[15] = e) : e = g[15], x = e;
                    break e
                }
                let i = (0, re.getPositionsForMarket)({
                    market: j,
                    positions: C ? ? []
                });
                if (!i.length) {
                    let e;
                    g[16] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                        canShow: !1,
                        zeroShares: void 0,
                        oneShares: void 0
                    }, g[16] = e) : e = g[16], x = e;
                    break e
                }
                let o = b("topHolders.shares"),
                    l = rn({
                        positions: i,
                        outcomeIndex: 0,
                        sharesLabel: o
                    }),
                    c = rn({
                        positions: i,
                        outcomeIndex: 1,
                        sharesLabel: o
                    });
                if (!l.hasShares && !c.hasShares) {
                    let e;
                    g[17] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                        canShow: !1,
                        zeroShares: void 0,
                        oneShares: void 0
                    }, g[17] = e) : e = g[17], x = e;
                    break e
                }
                g[18] !== n.zeroButtonColor.color || g[19] !== n.zeroButtonColor.customColors ? (e = n.zeroButtonColor.color && n.zeroButtonColor.customColors ? {
                    color: n.zeroButtonColor.customColors.backgroundColor
                } : void 0, g[18] = n.zeroButtonColor.color, g[19] = n.zeroButtonColor.customColors, g[20] = e) : e = g[20],
                g[21] !== e || g[22] !== l ? (t = { ...l,
                    colorStyle: e
                }, g[21] = e, g[22] = l, g[23] = t) : t = g[23],
                g[24] !== n.oneButtonColor.color || g[25] !== n.oneButtonColor.customColors ? (r = n.oneButtonColor.color && n.oneButtonColor.customColors ? {
                    color: n.oneButtonColor.customColors.backgroundColor
                } : void 0, g[24] = n.oneButtonColor.color, g[25] = n.oneButtonColor.customColors, g[26] = r) : r = g[26],
                g[27] !== c || g[28] !== r ? (a = { ...c,
                    colorStyle: r
                }, g[27] = c, g[28] = r, g[29] = a) : a = g[29],
                g[30] !== t || g[31] !== a ? (s = {
                    canShow: !0,
                    zeroShares: t,
                    oneShares: a
                }, g[30] = t, g[31] = a, g[32] = s) : s = g[32],
                x = s
            }
            g[9] = j,
            g[10] = S,
            g[11] = n,
            g[12] = C,
            g[13] = b,
            g[14] = x
        }
        else x = g[14];
        let M = x;
        return g[33] !== s || g[34] !== i || g[35] !== o || g[36] !== M.canShow || g[37] !== M.oneShares || g[38] !== M.zeroShares || g[39] !== T || g[40] !== w ? (p = M.canShow && w === a.Side.SELL && (0, t.jsxs)(ey.motion.div, {
            ref: i,
            variants: ra,
            initial: "hidden",
            animate: "visible",
            exit: "hidden",
            className: (0, v.cn)("flex w-full gap-3", s),
            ...o,
            children: [(0, t.jsx)("div", {
                className: "flex flex-1 justify-center items-end",
                children: (0, t.jsx)(k.AnimatePresence, {
                    initial: !1,
                    mode: "sync",
                    children: M.zeroShares.hasShares && (0, t.jsx)(ey.motion.div, {
                        variants: rs,
                        initial: "initial",
                        animate: "animate",
                        exit: "exit",
                        transition: rr,
                        children: (0, t.jsx)("span", {
                            className: (0, v.cn)("text-xs font-semibold leading-5", 0 === T ? "text-green-600" : "text-neutral-500"),
                            style: 0 === T ? M.zeroShares.colorStyle : void 0,
                            children: M.zeroShares.formatted
                        })
                    })
                })
            }), (0, t.jsx)("div", {
                className: "flex flex-1 justify-center items-end",
                children: (0, t.jsx)(k.AnimatePresence, {
                    initial: !1,
                    mode: "sync",
                    children: M.oneShares.hasShares && (0, t.jsx)(ey.motion.div, {
                        variants: rs,
                        initial: "initial",
                        animate: "animate",
                        exit: "exit",
                        transition: rr,
                        children: (0, t.jsx)("span", {
                            className: (0, v.cn)("text-xs font-semibold leading-5", 1 === T ? "text-red-500" : "text-neutral-500"),
                            style: 1 === T ? M.oneShares.colorStyle : void 0,
                            children: M.oneShares.formatted
                        })
                    })
                })
            })]
        }), g[33] = s, g[34] = i, g[35] = o, g[36] = M.canShow, g[37] = M.oneShares, g[38] = M.zeroShares, g[39] = T, g[40] = w, g[41] = p) : p = g[41], g[42] !== p ? (h = (0, t.jsx)("div", {
            children: (0, t.jsx)(k.AnimatePresence, {
                initial: !1,
                mode: "sync",
                children: p
            })
        }), g[42] = p, g[43] = h) : h = g[43], h
    }
    let ro = {
        zeroButtonColor: {
            color: "green",
            customColors: void 0
        },
        oneButtonColor: {
            color: "red",
            customColors: void 0
        }
    };

    function rl(e) {
        let a, s, n, i, o, l, c, d, u, m, x = (0, r.c)(32);
        x[0] !== e ? ({
            className: a,
            ...s
        } = e, x[0] = e, x[1] = a, x[2] = s) : (a = x[1], s = x[2]), x[3] === Symbol.for("react.memo_cache_sentinel") ? (n = ["isNegRiskSportsEvent"], x[3] = n) : n = x[3];
        let {
            isNegRiskSportsEvent: p
        } = (0, g.useEventContext)(n);
        x[4] === Symbol.for("react.memo_cache_sentinel") ? (i = ["activeMarket"], x[4] = i) : i = x[4];
        let {
            activeMarket: h
        } = (0, f.useEventActiveMarketContext)(i), {
            oddsFormat: y
        } = (0, E.useOddsFormat)(), b = (0, E.useSportsStoreSelector)("sportSlug"), S = (0, z.useSportsButtonColor)(h, 0, p), j = (0, z.useSportsButtonColor)(h, 1, p);
        x[5] !== h.sportsMarketType ? (o = (0, t4.isTotalMarket)(h.sportsMarketType), x[5] = h.sportsMarketType, x[6] = o) : o = x[6];
        let C = o;
        e: {
            let e, t, r, a;x[7] !== C || x[8] !== S ? (e = C ? {
                color: "green",
                customColors: void 0
            } : S, x[7] = C, x[8] = S, x[9] = e) : e = x[9],
            x[10] !== C || x[11] !== j ? (t = C ? {
                color: "red",
                customColors: void 0
            } : j, x[10] = C, x[11] = j, x[12] = t) : t = x[12],
            x[13] !== e || x[14] !== t ? (r = {
                zeroButtonColor: e,
                oneButtonColor: t
            }, x[13] = e, x[14] = t, x[15] = r) : r = x[15];
            let s = r,
                n = "spreads" === h.sportsMarketType;
            if (p && !n || C || "ufc_go_the_distance" === h.sportsMarketType || "ufc_method_of_victory" === h.sportsMarketType || "parlays" === h.sportsMarketType || "anytime_touchdowns" === h.sportsMarketType || "first_touchdowns" === h.sportsMarketType || "soccer_anytime_goalscorer" === h.sportsMarketType || "soccer_exact_score" === h.sportsMarketType || "tennis_completed_match" === h.sportsMarketType || "round_over_under_match" === h.sportsMarketType) {
                let e;
                x[16] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                    buttonColors: ro,
                    shareBalancesColors: ro
                }, x[16] = e) : e = x[16], l = e;
                break e
            }
            x[17] !== s ? (a = {
                buttonColors: s,
                shareBalancesColors: s
            }, x[17] = s, x[18] = a) : a = x[18],
            l = a
        }
        let {
            buttonColors: T,
            shareBalancesColors: k
        } = l;
        return x[19] !== a ? (c = (0, v.cn)("flex flex-col w-full", a), x[19] = a, x[20] = c) : c = x[20], x[21] !== T || x[22] !== y || x[23] !== b ? (d = (0, t.jsx)(t9, {
            colors: T,
            oddsFormat: y,
            sportSlug: b
        }), x[21] = T, x[22] = y, x[23] = b, x[24] = d) : d = x[24], x[25] !== k ? (u = (0, t.jsx)(ri, {
            colors: k
        }), x[25] = k, x[26] = u) : u = x[26], x[27] !== s || x[28] !== c || x[29] !== d || x[30] !== u ? (m = (0, t.jsxs)(ey.motion.div, {
            className: c,
            ...s,
            children: [d, u]
        }), x[27] = s, x[28] = c, x[29] = d, x[30] = u, x[31] = m) : m = x[31], m
    }

    function rc(e) {
        let a, s, n, i, o, l, c = (0, r.c)(10);
        return c[0] !== e ? ({
            className: a,
            ...s
        } = e, c[0] = e, c[1] = a, c[2] = s) : (a = c[1], s = c[2]), c[3] !== a ? (n = (0, v.cn)("flex flex-col w-full", a), c[3] = a, c[4] = n) : n = c[4], c[5] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)(t9, {
            colors: ro
        }), o = (0, t.jsx)(ri, {
            colors: ro
        }), c[5] = i, c[6] = o) : (i = c[5], o = c[6]), c[7] !== s || c[8] !== n ? (l = (0, t.jsxs)(ey.motion.div, {
            className: n,
            ...s,
            children: [i, o]
        }), c[7] = s, c[8] = n, c[9] = l) : l = c[9], l
    }
    let rd = e => {
        let a, s, n, i, o, l = (0, r.c)(12);
        l[0] !== e ? ({
            teams: n,
            className: a,
            ...s
        } = e, l[0] = e, l[1] = a, l[2] = s, l[3] = n) : (a = l[1], s = l[2], n = l[3]), l[4] === Symbol.for("react.memo_cache_sentinel") ? (i = ["isSportsPage"], l[4] = i) : i = l[4];
        let {
            isSportsPage: c
        } = (0, $.useSportsContext)(i);
        if (c) {
            let e;
            return l[5] !== a || l[6] !== s || l[7] !== n ? (e = (0, t.jsx)(rl, {
                teams: n,
                className: a,
                ...s
            }), l[5] = a, l[6] = s, l[7] = n, l[8] = e) : e = l[8], e
        }
        return l[9] !== a || l[10] !== s ? (o = (0, t.jsx)(rc, {
            className: a,
            ...s
        }), l[9] = a, l[10] = s, l[11] = o) : o = l[11], o
    };

    function ru(e) {
        let o, v, j, C, T, k, _, N, w, M, I, O, R, E, q, B, P, A, D, F, U, L = (0, r.c)(57),
            {
                asChild: $,
                className: G,
                trackingPage: Q,
                trackingViewMode: z
            } = e,
            W = void 0 !== $ && $,
            H = void 0 === G ? "" : G,
            Y = (0, c.useTranslations)();
        L[0] === Symbol.for("react.memo_cache_sentinel") ? (o = ["event"], L[0] = o) : o = L[0];
        let {
            event: K
        } = (0, g.useEventContext)(o);
        L[1] === Symbol.for("react.memo_cache_sentinel") ? (v = ["activeMarket"], L[1] = v) : v = L[1];
        let {
            activeMarket: V
        } = (0, f.useEventActiveMarketContext)(v);
        L[2] === Symbol.for("react.memo_cache_sentinel") ? (j = ["splitDialogOpen", "mergeDialogOpen", "setSplitDialogOpen", "setMergeDialogOpen", "orderType", "side"], L[2] = j) : j = L[2];
        let {
            splitDialogOpen: J,
            mergeDialogOpen: X,
            setSplitDialogOpen: Z,
            setMergeDialogOpen: ee,
            orderType: et,
            side: er
        } = (0, y.useTradeContext)(j), ea = (0, b.useOneClickEligible)(), [es, , en] = (0, b.useOneClickEnabled)(), ei = ea && en && es && er === a.Side.BUY;
        L[3] !== K ? .tags ? (C = K ? .tags ? .some(rm) ? ? !1, L[3] = K ? .tags, L[4] = C) : C = L[4];
        let eo = C,
            el = K ? .live || K ? .isLive;
        if (L[5] !== V.gameStartTime || L[6] !== W || L[7] !== H || L[8] !== el || L[9] !== eo || L[10] !== et || L[11] !== ei || L[12] !== Y || L[13] !== Q || L[14] !== z) {
            let e = V.gameStartTime ? new Date(V.gameStartTime) : null,
                r = e ? e.toLocaleString([], {
                    month: "short",
                    day: "numeric",
                    hour: "numeric",
                    minute: "2-digit",
                    timeZoneName: "short"
                }) : "",
                a = eo && et === m.OrderType.Limit && !el && null != e && e.getTime() > (0, h.getServerNow)();
            _ = S.TradeAnimationContextProvider, k = l, E = W, N = H, L[25] === Symbol.for("react.memo_cache_sentinel") ? (w = {
                width: `${p.EVENT_LAYOUT_BUY_SELL_WIDGET_WIDTH}px`
            }, M = (0, t.jsx)(e5, {}), I = (0, t.jsx)(rd, {}), L[25] = w, L[26] = M, L[27] = I) : (w = L[25], M = L[26], I = L[27]), T = i.OrderContentAnimator, O = ei ? "one-tap" : "standard", R = ei ? (0, t.jsx)("div", {
                className: "flex flex-col gap-5",
                children: (0, t.jsx)(th, {})
            }) : (0, t.jsxs)("div", {
                className: "flex flex-col gap-4",
                children: [(0, t.jsx)(t3, {}), (0, t.jsx)(eR, {
                    trackingPage: Q,
                    trackingViewMode: z
                }), a && e && (0, t.jsxs)("div", {
                    className: "flex items-center justify-center gap-1 py-0.5",
                    children: [(0, t.jsx)("p", {
                        className: "text-xs text-text-secondary text-center",
                        children: Y("trading.orderBook.clearDisclaimer", {
                            time: e.toLocaleString([], {
                                hour: "numeric",
                                minute: "2-digit",
                                timeZoneName: "short"
                            })
                        })
                    }), (0, t.jsx)(n.Tooltip, {
                        content: Y("trading.orderBook.clearDisclaimerTooltip", {
                            dateTime: r
                        }),
                        children: (0, t.jsx)(d.IconCircleInfoOutline12, {
                            size: 12,
                            className: "text-text-secondary shrink-0"
                        })
                    })]
                })]
            }), L[5] = V.gameStartTime, L[6] = W, L[7] = H, L[8] = el, L[9] = eo, L[10] = et, L[11] = ei, L[12] = Y, L[13] = Q, L[14] = z, L[15] = T, L[16] = k, L[17] = _, L[18] = N, L[19] = w, L[20] = M, L[21] = I, L[22] = O, L[23] = R, L[24] = E
        } else T = L[15], k = L[16], _ = L[17], N = L[18], w = L[19], M = L[20], I = L[21], O = L[22], R = L[23], E = L[24];
        return L[28] !== T || L[29] !== O || L[30] !== R ? (q = (0, t.jsx)(T, {
            contentKey: O,
            children: R
        }), L[28] = T, L[29] = O, L[30] = R, L[31] = q) : q = L[31], L[32] !== ee ? (B = (0, t.jsx)(u.default, {
            onComplete: () => ee(!1)
        }), L[32] = ee, L[33] = B) : B = L[33], L[34] !== X || L[35] !== ee || L[36] !== B ? (P = (0, t.jsx)(s.Modal, {
            open: X,
            onOpenChange: ee,
            children: B
        }), L[34] = X, L[35] = ee, L[36] = B, L[37] = P) : P = L[37], L[38] !== Z ? (A = (0, t.jsx)(x.default, {
            onComplete: () => Z(!1)
        }), L[38] = Z, L[39] = A) : A = L[39], L[40] !== Z || L[41] !== J || L[42] !== A ? (D = (0, t.jsx)(s.Modal, {
            open: J,
            onOpenChange: Z,
            children: A
        }), L[40] = Z, L[41] = J, L[42] = A, L[43] = D) : D = L[43], L[44] !== k || L[45] !== N || L[46] !== w || L[47] !== M || L[48] !== I || L[49] !== q || L[50] !== P || L[51] !== D || L[52] !== E ? (F = (0, t.jsxs)(k, {
            asChild: E,
            className: N,
            style: w,
            children: [M, I, q, P, D]
        }), L[44] = k, L[45] = N, L[46] = w, L[47] = M, L[48] = I, L[49] = q, L[50] = P, L[51] = D, L[52] = E, L[53] = F) : F = L[53], L[54] !== _ || L[55] !== F ? (U = (0, t.jsx)(_, {
            children: F
        }), L[54] = _, L[55] = F, L[56] = U) : U = L[56], U
    }

    function rm(e) {
        return "sports" === e.slug || "esports" === e.slug
    }
    rd.displayName = "OutcomeButtons", ru.displayName = "TradeWidget", e.s(["TradeWidget", 0, ru], 364917)
}]);

//# debugId=17325cd3-f864-2360-2487-19505acb9219