;
! 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] = "92cb5fa9-c082-ba9e-05c2-6345f94743e0")
    } catch (e) {}
}();
(globalThis.TURBOPACK || (globalThis.TURBOPACK = [])).push(["object" == typeof document ? document.currentScript : void 0, 405473, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        i = e.i(23128),
        l = e.i(169010),
        n = e.i(474280);
    e.i(416340);
    var s = e.i(870555),
        a = e.i(784521),
        o = e.i(684686),
        c = e.i(799471);

    function d(e) {
        return e.hasFetchedLocation
    }

    function u(e) {
        return e.permissions
    }
    e.s(["default", 0, e => {
        let m, f, p, x, h, g, y, v, b = (0, r.c)(19),
            {
                mode: C,
                callback: w,
                isEvenRow: j
            } = e,
            N = (0, o.useGeoStore)(d),
            k = (0, o.useGeoStore)(u);
        b[0] === Symbol.for("react.memo_cache_sentinel") ? (m = ["proxyAddress", "closedDynamic"], b[0] = m) : m = b[0];
        let {
            proxyAddress: S,
            closedDynamic: O
        } = (0, a.useAccountContext)(m);
        b[1] !== O || b[2] !== k || b[3] !== S ? (f = (0, c.modifyPermissionsToMatchCloseOnlyBlockAndAllowLists)(S, k, O), b[1] = O, b[2] = k, b[3] = S, b[4] = f) : f = b[4];
        let T = f,
            A = N && !T.canCancelOrders;
        e: {
            if (A) {
                p = "Unavailable";
                break e
            }
            p = "single" === C ? "Cancel" : "Cancel all"
        }
        let $ = p,
            D = j && "hover:bg-neutral-50";
        b[5] !== D ? (x = (0, s.cn)("h-[32px] w-[32px]", D), b[5] = D, b[6] = x) : x = b[6], b[7] !== w ? (h = e => {
            e.preventDefault(), e.stopPropagation(), w()
        }, b[7] = w, b[8] = h) : h = b[8];
        let F = A ? "opacity-50" : "";
        return b[9] !== F ? (g = (0, t.jsx)(n.IconXmarkFill18, {
            size: 14,
            className: F
        }), b[9] = F, b[10] = g) : g = b[10], b[11] !== A || b[12] !== x || b[13] !== h || b[14] !== g ? (y = (0, t.jsx)(i.Button, {
            variant: "ghost",
            size: "icon",
            className: x,
            onClick: h,
            disabled: A,
            children: g
        }), b[11] = A, b[12] = x, b[13] = h, b[14] = g, b[15] = y) : y = b[15], b[16] !== $ || b[17] !== y ? (v = (0, t.jsx)(l.Tooltip, {
            content: $,
            showArrow: !1,
            sideOffset: 4,
            children: y
        }), b[16] = $, b[17] = y, b[18] = v) : v = b[18], v
    }])
}, 577103, e => {
    "use strict";
    var t = e.i(318594),
        r = e.i(416340),
        i = e.i(249792),
        l = e.i(606572),
        n = e.i(510954),
        s = e.i(57096),
        a = e.i(502980),
        o = e.i(373898);
    e.s(["useCancelAllOpenOrders", 0, function({
        openOrders: e,
        market: c,
        onCancelStart: d
    }) {
        let u = (0, i.useToast)(),
            m = (0, t.useQueryClient)(),
            f = (0, o.default)();
        return (0, r.useCallback)(async () => {
            let t = (0, a.getOrderToastPosition)();
            if (!e.length) return;
            let r = e.length > 1;
            d ? .();
            try {
                await Promise.all(e.map(e => f(e, e.associatedMarket ? ? c, !0)));
                let i = `${e.length} order${r?"s were":" was"} cancelled`;
                u.success(new l.ToastBuilder().position({
                    side: t
                }).title(r ? "All open limit orders cancelled" : "Order cancelled").subtext(i))
            } catch {
                let i = `Failed to cancel ${e.length} order${r?"s":""}`;
                u.error(new l.ToastBuilder().position({
                    side: t
                }).title(r ? "Error cancelling orders" : "Error cancelling order").subtext(i))
            } finally {
                m.invalidateQueries({
                    queryKey: n.queryKeys[s.QueryKey.OpenOrders]._def
                })
            }
        }, [f, m, c, e, u, d])
    }])
}, 358515, 533331, 196627, 586652, e => {
    "use strict";
    var t, r = e.i(221628),
        i = e.i(318594),
        l = e.i(181687),
        n = e.i(53382),
        s = e.i(798631),
        a = e.i(416340),
        o = e.i(196593),
        c = e.i(405473),
        d = e.i(870555),
        u = e.i(784521),
        m = e.i(799471),
        f = e.i(294472),
        p = e.i(864006),
        x = e.i(604777),
        h = e.i(684686),
        g = e.i(373898),
        y = e.i(510954),
        v = e.i(57096),
        b = e.i(999061);
    let C = (0, e.i(766181).cva)("flex place-items-center p-0.5 pl-2 pr-2 rounded-[5px] w-fit", {
        variants: {
            color: {
                green: "text-green-500 bg-green-500/10",
                red: "text-red-600 bg-red-600/10",
                custom: ""
            }
        },
        defaultVariants: {
            color: "green"
        }
    });

    function w(e) {
        let t, i, l, n, s, a, o, c, u, m, f, p = (0, b.c)(23);
        return p[0] !== e ? ({
            ref: s,
            className: t,
            color: i,
            customColors: l,
            style: a,
            ...n
        } = e, p[0] = e, p[1] = t, p[2] = i, p[3] = l, p[4] = n, p[5] = s, p[6] = a) : (t = p[1], i = p[2], l = p[3], n = p[4], s = p[5], a = p[6]), p[7] !== t || p[8] !== i ? (o = (0, d.cn)(C({
            color: i
        }), t), p[7] = t, p[8] = i, p[9] = o) : o = p[9], p[10] !== l ? (c = l ? .color && {
            color: l.color
        }, p[10] = l, p[11] = c) : c = p[11], p[12] !== l ? (u = l ? .backgroundColor && {
            backgroundColor: l.backgroundColor
        }, p[12] = l, p[13] = u) : u = p[13], p[14] !== a || p[15] !== c || p[16] !== u ? (m = { ...c,
            ...u,
            ...a
        }, p[14] = a, p[15] = c, p[16] = u, p[17] = m) : m = p[17], p[18] !== n || p[19] !== s || p[20] !== o || p[21] !== m ? (f = (0, r.jsx)("div", {
            ref: s,
            className: o,
            style: m,
            ...n
        }), p[18] = n, p[19] = s, p[20] = o, p[21] = m, p[22] = f) : f = p[22], f
    }

    function j(e) {
        let t, i, l, n, s, a, o, c, u, m, f, p, x, h, g = (0, b.c)(32);
        g[0] !== e ? ({
            ref: o,
            outcomeIndex: a,
            color: l,
            colors: n,
            customColors: s,
            truncate: u,
            inline: m,
            invert: f,
            className: i,
            children: t,
            ...c
        } = e, g[0] = e, g[1] = t, g[2] = i, g[3] = l, g[4] = n, g[5] = s, g[6] = a, g[7] = o, g[8] = c, g[9] = u, g[10] = m, g[11] = f) : (t = g[1], i = g[2], l = g[3], n = g[4], s = g[5], a = g[6], o = g[7], c = g[8], u = g[9], m = g[10], f = g[11]);
        let y = void 0 !== u && u,
            v = void 0 !== m && m,
            C = void 0 !== f && f;
        e: {
            let e;
            if (l) {
                let e;
                g[12] !== l ? (e = {
                    color: l,
                    customColors: void 0
                }, g[12] = l, g[13] = e) : e = g[13], p = e;
                break e
            }
            if (s) {
                let e;
                g[14] !== s ? (e = {
                    color: "custom",
                    customColors: s
                }, g[14] = s, g[15] = e) : e = g[15], p = e;
                break e
            }
            if (n && n.length >= 2) {
                let e, t = n[a],
                    r = `${n[a]}1A`,
                    i = C ? r : t,
                    l = C ? t : r;
                g[16] !== i || g[17] !== l ? (e = {
                    color: "custom",
                    customColors: {
                        color: i,
                        backgroundColor: l
                    }
                }, g[16] = i, g[17] = l, g[18] = e) : e = g[18], p = e;
                break e
            }
            let t = 0 === a ? "green" : "red";g[19] !== t ? (e = {
                color: t,
                customColors: void 0
            }, g[19] = t, g[20] = e) : e = g[20],
            p = e
        }
        let {
            color: j,
            customColors: N
        } = p, k = v && "whitespace-nowrap", S = y && "overflow-hidden text-ellipsis";
        return g[21] !== i || g[22] !== k || g[23] !== S ? (x = (0, d.cn)("font-medium", k, S, i), g[21] = i, g[22] = k, g[23] = S, g[24] = x) : x = g[24], g[25] !== t || g[26] !== j || g[27] !== N || g[28] !== o || g[29] !== c || g[30] !== x ? (h = (0, r.jsx)(w, {
            ref: o,
            color: j,
            customColors: N,
            className: x,
            ...c,
            children: t
        }), g[25] = t, g[26] = j, g[27] = N, g[28] = o, g[29] = c, g[30] = x, g[31] = h) : h = g[31], h
    }
    e.s(["PositionsChip", 0, w, "PositionsTBody", 0, function(e) {
        let t, i, l, n, s = (0, b.c)(8);
        return s[0] !== e ? ({
            className: t,
            ...i
        } = e, s[0] = e, s[1] = t, s[2] = i) : (t = s[1], i = s[2]), s[3] !== t ? (l = (0, d.cn)("max-w-[922px]", t), s[3] = t, s[4] = l) : l = s[4], s[5] !== i || s[6] !== l ? (n = (0, r.jsx)("tbody", {
            className: l,
            ...i
        }), s[5] = i, s[6] = l, s[7] = n) : n = s[7], n
    }, "PositionsTHead", 0, function(e) {
        let t, i, l, n, s = (0, b.c)(8);
        return s[0] !== e ? ({
            className: t,
            ...i
        } = e, s[0] = e, s[1] = t, s[2] = i) : (t = s[1], i = s[2]), s[3] !== t ? (l = (0, d.cn)("border-b border-neutral-50 py-2.5 mb-2", t), s[3] = t, s[4] = l) : l = s[4], s[5] !== i || s[6] !== l ? (n = (0, r.jsx)("thead", {
            className: l,
            ...i
        }), s[5] = i, s[6] = l, s[7] = n) : n = s[7], n
    }, "PositionsTable", 0, function(e) {
        let t, i, l, n, s = (0, b.c)(8);
        return s[0] !== e ? ({
            className: t,
            ...i
        } = e, s[0] = e, s[1] = t, s[2] = i) : (t = s[1], i = s[2]), s[3] !== t ? (l = (0, d.cn)("border-separate border-spacing-0 w-full max-w-[922px]", t), s[3] = t, s[4] = l) : l = s[4], s[5] !== i || s[6] !== l ? (n = (0, r.jsx)("table", {
            className: l,
            ...i
        }), s[5] = i, s[6] = l, s[7] = n) : n = s[7], n
    }, "PositionsTd", 0, function(e) {
        let t, i, l, n, s, a = (0, b.c)(10);
        return a[0] !== e ? ({
            className: t,
            style: l,
            ...i
        } = e, a[0] = e, a[1] = t, a[2] = i, a[3] = l) : (t = a[1], i = a[2], l = a[3]), a[4] !== t ? (n = (0, d.cn)("py-2.5 font-normal text-sm leading-normal", t), a[4] = t, a[5] = n) : n = a[5], a[6] !== i || a[7] !== l || a[8] !== n ? (s = (0, r.jsx)("td", {
            className: n,
            style: l,
            ...i
        }), a[6] = i, a[7] = l, a[8] = n, a[9] = s) : s = a[9], s
    }, "PositionsTr", 0, function(e) {
        let t, i, l, n, s = (0, b.c)(8);
        return s[0] !== e ? ({
            className: t,
            ...i
        } = e, s[0] = e, s[1] = t, s[2] = i) : (t = s[1], i = s[2]), s[3] !== t ? (l = (0, d.cn)("flex w-fit max-w-[922px]", t), s[3] = t, s[4] = l) : l = s[4], s[5] !== i || s[6] !== l ? (n = (0, r.jsx)("tr", {
            className: l,
            ...i
        }), s[5] = i, s[6] = l, s[7] = n) : n = s[7], n
    }], 533331), e.s(["OutcomeChip", 0, j], 196627);
    var N = ((t = N || {}).Side = "side", t.Outcome = "outcome", t.Price = "price", t.Filled = "filled", t.Total = "total", t.Expiration = "expiration", t.Order = "order", t);
    e.s(["default", 0, function({
        data: e,
        market: t,
        containerClassName: b,
        headerClassName: C,
        bodyClassName: w,
        tableHeaderItemClassName: N,
        tableBodyItemClassName: k,
        hasHeader: S = !1,
        setOrderToCancel: O,
        setDialogOpen: T,
        colors: A,
        isSports: $,
        getCustomOrderChipDetails: D,
        stickyTopRow: F = !1
    }) {
        let M = (0, i.useQueryClient)(),
            I = (0, x.useTranslations)(),
            R = (0, p.useMessages)().time,
            [E, P] = (0, a.useState)([]),
            {
                proxyAddress: V,
                closedDynamic: z
            } = (0, u.useAccountContext)(["proxyAddress", "closedDynamic"]),
            L = (0, h.useGeoStore)(e => e.hasFetchedLocation),
            K = (0, h.useGeoStore)(e => e.permissions),
            H = (0, m.modifyPermissionsToMatchCloseOnlyBlockAndAllowLists)(V, K, z),
            B = (0, g.default)(),
            _ = (0, a.useMemo)(() => L && !H.canCancelOrders, [L, H.canCancelOrders]),
            U = (0, a.useCallback)(async e => {
                try {
                    await B(e, t, !1)
                } finally {
                    M.invalidateQueries({
                        queryKey: y.queryKeys[v.QueryKey.OpenOrders]._def
                    })
                }
            }, [B, M, t]),
            W = (0, a.useMemo)(() => [{
                header: I("events.orderHeaders.side"),
                id: "side",
                accessorKey: "side",
                cell: e => e.getValue(),
                sortingFn: (e, t) => e.original.side.localeCompare(t.original.side)
            }, {
                header: I("events.orderHeaders.outcome"),
                id: "outcome",
                accessorKey: "outcome",
                cell: e => e.getValue(),
                sortingFn: (e, t) => e.original.outcome.localeCompare(t.original.outcome)
            }, {
                header: I("events.orderHeaders.price"),
                id: "price",
                accessorKey: "price",
                cell: e => {
                    let t = e.getValue();
                    return `${t}\xa2`
                },
                sortingFn: (e, t) => parseFloat(e.original.price) - parseFloat(t.original.price)
            }, {
                header: I("events.orderHeaders.filled"),
                id: "filled",
                accessorKey: "filled",
                cell: e => {
                    let [t, r] = e.getValue();
                    return `${(0,o.formatNum)(t,{decimals:0})} / ${(0,o.formatNum)(r,{decimals:0})}`
                },
                sortingFn: (e, t) => e.original.filled[0] - t.original.filled[0]
            }, {
                header: I("events.orderHeaders.total"),
                id: "total",
                accessorKey: "total",
                cell: e => {
                    let t = e.getValue();
                    return (0, o.formatCurrency)(t, {
                        decimals: 2
                    })
                },
                sortingFn: (e, t) => e.original.total - t.original.total
            }, {
                header: I("events.orderHeaders.expiration"),
                id: "expiration",
                accessorKey: "expiration",
                cell: e => {
                    let t = e.getValue();
                    return (0, f.fromPossibleUnixToRelativeTime)(t, !0, R)
                },
                sortingFn: (e, t) => {
                    let r = Number(e ? .original ? .expiration),
                        i = Number(t ? .original ? .expiration);
                    return r > 0 && i > 0 ? r - i : 0
                }
            }, {
                header: I("rewards.trading.cancelAll"),
                id: "order",
                accessorKey: "order",
                cell: e => (0, r.jsx)("div", {
                    className: "flex flex-col items-end -mt-[5px] whitespace-nowrap",
                    children: (0, r.jsx)(c.default, {
                        mode: "single",
                        callback: () => {
                            U(e.getValue())
                        }
                    })
                })
            }], [U, I, R]),
            {
                getHeaderGroups: G,
                getRowModel: Q
            } = (0, l.useReactTable)({
                data: e,
                columns: W,
                state: {
                    sorting: E
                },
                onSortingChange: P,
                getCoreRowModel: (0, n.getCoreRowModel)(),
                getSortedRowModel: (0, n.getSortedRowModel)(),
                sortDescFirst: !0
            });
        return (0, r.jsxs)("div", {
            className: (0, d.cn)("flex rounded-xl border-border! bg-background flex-col max-lg:hidden", b),
            children: [S && (0, r.jsx)("div", {
                className: (0, d.cn)("flex flex-col px-4 pt-5 pb-2", C),
                children: (0, r.jsx)("h3", {
                    className: "text-text font-medium",
                    children: I("events.tabs.openOrders")
                })
            }), (0, r.jsxs)("div", {
                className: (0, d.cn)("px-6 py-0.5 overflow-x-auto max-w-full", w),
                children: [(0, r.jsx)("div", {
                    className: F ? "sticky top-0 bg-background mb-0 pb-0" : void 0,
                    children: G().map(e => (0, r.jsx)("div", {
                        className: "flex w-full h-10 items-center",
                        children: e.headers.map((e, t) => (0, r.jsxs)("div", {
                            className: (0, d.cn)("flex items-center h-[30.5px] text-left py-2.5 border-b border-border relative leading-[0.65]! font-semibold text-[10px] tracking-wider text-text-secondary uppercase", !!e.column.columnDef.header && "cursor-pointer transition-all duration-200 hover:opacity-90 active:opacity-80", F && "mb-0", 0 === t && S && "pl-4!", "order" === e.column.columnDef.id && "text-red-600 justify-end", "order" === e.column.columnDef.id && S && "pr-4!", "order" === e.column.columnDef.id && _ && "opacity-50! cursor-not-allowed!", N),
                            style: {
                                flex: `0 1 ${e.getSize()}px`,
                                minWidth: e.column.columnDef.minSize ? ? 60
                            },
                            onClick: e.column.columnDef.header ? "order" !== e.column.columnDef.id ? e.column.getToggleSortingHandler() : _ ? void 0 : () => T(!0) : void 0,
                            children: [e.isPlaceholder ? null : (0, l.flexRender)(e.column.columnDef.header, e.getContext()), e.column.columnDef.header && "order" !== e.column.columnDef.id ? (0, r.jsxs)("div", {
                                className: "flex flex-col -space-y-[5px] ml-0.5",
                                children: [(0, r.jsx)(s.IconChevronDownOutline12, {
                                    size: 10,
                                    className: `rotate-180 ${"asc"===e.column.getIsSorted()?"text-text-secondary":"text-text-tertiary"}`
                                }), (0, r.jsx)(s.IconChevronDownOutline12, {
                                    size: 10,
                                    className: "desc" === e.column.getIsSorted() ? "text-text-secondary" : "text-text-tertiary"
                                })]
                            }) : null]
                        }, e.id))
                    }, e.id))
                }), Q().rows.map(e => (0, r.jsx)("div", {
                    className: (0, d.cn)("flex w-full h-10 items-center", F && "first-of-type:mt-2", S && !$ && "pr-2"),
                    children: e.getVisibleCells().map((i, n) => (0, r.jsx)("div", {
                        className: (0, d.cn)("text-sm whitespace-nowrap", 0 === n && S && "pl-4!", n === e.getVisibleCells().length - 1 && S && "pr-4!", k),
                        style: {
                            flex: `0 1 ${i.column.getSize()}px`,
                            minWidth: i.column.columnDef.minSize ? ? 60
                        },
                        children: "outcome" === i.getContext().column.id ? (0, r.jsx)(j, {
                            outcomeIndex: t.outcomes.map(e => e.toLowerCase()).indexOf(i.getValue().toLowerCase()),
                            colors: A,
                            className: "font-medium text-sm",
                            ...D ? .({
                                mode: "colors",
                                order: i.row.getValue("order")
                            }),
                            children : (0, l.flexRender)(i.column.columnDef.cell, i.getContext())
                        }) : (0, l.flexRender)(i.column.columnDef.cell, i.getContext())
                    }, i.id))
                }, e.id))]
            })]
        })
    }], 358515);
    var k = e.i(23128),
        S = e.i(116371),
        O = e.i(632227);
    let T = e => {
        let t, i, l, n, s, a, d, u, m, x, h, g, y, v = (0, b.c)(31),
            {
                order: C,
                cancelCallback: w
            } = e,
            j = (0, p.useMessages)().time,
            N = `${C.side} ${C.outcome}`;
        v[0] !== N ? (t = (0, r.jsx)("p", {
            className: "font-semibold",
            children: N
        }), v[0] = N, v[1] = t) : t = v[1], v[2] !== C.filled[0] ? (i = (0, o.formatNum)(C.filled[0], {
            decimals: 0
        }), v[2] = C.filled[0], v[3] = i) : i = v[3], v[4] !== C.filled[1] ? (l = (0, o.formatNum)(C.filled[1], {
            decimals: 0
        }), v[4] = C.filled[1], v[5] = l) : l = v[5];
        let k = `${i} / ${l}`;
        v[6] !== k ? (n = (0, r.jsx)("p", {
            children: k
        }), v[6] = k, v[7] = n) : n = v[7], v[8] !== t || v[9] !== n ? (s = (0, r.jsxs)("div", {
            className: "flex w-full justify-between",
            children: [t, n]
        }), v[8] = t, v[9] = n, v[10] = s) : s = v[10];
        let S = C.price;
        v[11] !== C.total ? (a = (0, o.formatCurrency)(C.total, {
            decimals: 2
        }), v[11] = C.total, v[12] = a) : a = v[12];
        let O = `${S}\xa2 \xb7 ${a}`;
        return v[13] !== O ? (d = (0, r.jsx)("p", {
            className: "text-xs text-neutral-500",
            children: O
        }), v[13] = O, v[14] = d) : d = v[14], v[15] !== C.expiration || v[16] !== j ? (u = (0, f.fromPossibleUnixToRelativeTime)(C.expiration, !0, j), v[15] = C.expiration, v[16] = j, v[17] = u) : u = v[17], v[18] !== u ? (m = (0, r.jsx)("p", {
            className: "text-xs text-neutral-500",
            children: u
        }), v[18] = u, v[19] = m) : m = v[19], v[20] !== d || v[21] !== m ? (x = (0, r.jsxs)("div", {
            className: "flex w-full justify-between",
            children: [d, m]
        }), v[20] = d, v[21] = m, v[22] = x) : x = v[22], v[23] !== x || v[24] !== s ? (h = (0, r.jsxs)("div", {
            className: "flex w-full flex-col gap-1",
            children: [s, x]
        }), v[23] = x, v[24] = s, v[25] = h) : h = v[25], v[26] !== w ? (g = (0, r.jsx)(c.default, {
            mode: "single",
            callback: () => w()
        }), v[26] = w, v[27] = g) : g = v[27], v[28] !== h || v[29] !== g ? (y = (0, r.jsxs)("div", {
            className: "flex w-full py-3 gap-2 border-b border-border-secondary",
            children: [h, g]
        }), v[28] = h, v[29] = g, v[30] = y) : y = v[30], y
    };
    e.s(["default", 0, ({
        data: e,
        market: t,
        containerVariant: l,
        containerStyles: n,
        setOrderToCancel: s,
        setDialogOpen: o
    }) => {
        let c = (0, i.useQueryClient)(),
            f = (0, x.useTranslations)(),
            [p, b] = (0, a.useState)(!1),
            C = (0, h.useGeoStore)(e => e.hasFetchedLocation),
            w = (0, h.useGeoStore)(e => e.permissions),
            {
                proxyAddress: j,
                closedDynamic: N
            } = (0, u.useAccountContext)(["proxyAddress", "closedDynamic"]),
            A = (0, m.modifyPermissionsToMatchCloseOnlyBlockAndAllowLists)(j, w, N),
            $ = (0, g.default)(),
            D = (0, a.useMemo)(() => C && !A.canCancelOrders, [A, C]),
            F = (0, a.useCallback)(async e => {
                try {
                    await $(e, t, !1)
                } finally {
                    c.invalidateQueries({
                        queryKey: y.queryKeys[v.QueryKey.OpenOrders]._def
                    })
                }
            }, [$, c, t]),
            M = (0, a.useCallback)(() => (0, r.jsx)(r.Fragment, {
                children: D ? (0, r.jsx)("div", {
                    className: "flex flex-col w-1/2 justify-center items-end",
                    children: (0, r.jsx)(O.default, {
                        className: "h-8 max-w-[160px] px-0.5 self-end"
                    })
                }) : (0, r.jsx)(k.Button, {
                    className: "bg-transparent px-0 border-none font-semibold hover:bg-transparent focus:bg-transparent active:bg-transparent",
                    disabled: D,
                    onClick: () => {
                        s(void 0), o(!0)
                    },
                    children: (0, r.jsx)("p", {
                        className: "font-semibold text-sm text-right text-red-500",
                        style: {
                            opacity: D ? .5 : 1
                        },
                        children: f("rewards.trading.cancelAll")
                    })
                })
            }), [o, s, D]);
        return (0, r.jsxs)(r.Fragment, {
            children: [(0, r.jsxs)("div", {
                className: (0, d.cn)("border-none lg:hidden", "primary" === l || "secondary" === l ? "border border-border bg-surface-1" : ""),
                style: n,
                children: [(0, r.jsxs)("div", {
                    className: "flex border-b border-border-light flex-row justify-between px-0 pt-5 pb-1",
                    children: [(0, r.jsx)("h1", {
                        className: "text-xl font-semibold text-text whitespace-nowrap",
                        children: f("events.tabs.openOrders")
                    }), (0, r.jsx)(M, {})]
                }), (0, r.jsxs)("div", {
                    className: "max-lg:z-1",
                    children: [e.slice(0, 4).map(e => (0, r.jsx)(T, {
                        order: e,
                        cancelCallback: () => {
                            F(e.order)
                        }
                    }, JSON.stringify(e))), e.length > 4 && (0, r.jsx)("p", {
                        className: "my-3 font-semibold underline cursor-pointer transition-all duration-200 hover:opacity-90 active:opacity-80",
                        onClick: () => b(!0),
                        children: f("footer.viewMore")
                    })]
                })]
            }), (0, r.jsx)(S.Drawer.Root, {
                shouldScaleBackground: !0,
                open: !!p,
                onOpenChange: e => b(e),
                children: (0, r.jsxs)(S.Drawer.Portal, {
                    children: [(0, r.jsx)(S.Drawer.Overlay, {
                        className: "fixed inset-0 bg-black/40",
                        style: {
                            zIndex: S.DrawerLevel.Second
                        }
                    }), (0, r.jsx)(S.Drawer.Content, {
                        className: "flex flex-col fixed bottom-0 left-0 right-0 top-[calc(26px+env(safe-area-inset-top))] bg-background rounded-t-md outline-none",
                        style: {
                            zIndex: S.DrawerLevel.Second
                        },
                        children: (0, r.jsxs)("div", {
                            className: "w-full flex-1 mx-auto flex flex-col overflow-auto pt-4 rounded-t-md bg-background",
                            children: [(0, r.jsx)(S.Drawer.Notch, {}), (0, r.jsx)("div", {
                                className: "w-full flex flex-col px-4 pt-4 pb-4 gap-4 border-b border-border sticky top-0 z-1",
                                children: (0, r.jsxs)("div", {
                                    className: "flex flex-1 justify-between items-center",
                                    children: [(0, r.jsx)("span", {
                                        className: "font-bold text-lg",
                                        children: f("events.tabs.openOrders")
                                    }), (0, r.jsx)(M, {})]
                                })
                            }), (0, r.jsx)("div", {
                                className: "flex flex-col px-4",
                                children: e.map(e => (0, r.jsx)(T, {
                                    order: e,
                                    cancelCallback: () => {
                                        F(e.order)
                                    }
                                }, JSON.stringify(e)))
                            })]
                        })
                    })]
                })
            })]
        })
    }], 586652)
}, 466542, e => {
    "use strict";
    var t, r = e.i(63238),
        i = e.i(156591),
        l = ((t = {}).Bids = "bids", t.Asks = "asks", t);
    let n = (e, t) => {
        let l = (0, i.getParseUnitsFromTickSize)(t);
        return (0, r.parseUnits)(e || "0", l)
    };
    e.s(["FormFields", () => l, "RT_BOOK_WIDTH", 0, 430, "RT_BUY_SELL_PADDING", 0, 10, "RT_BUY_SELL_WIDGET", 0, 260, "RT_HEIGHT", 0, 404, "RT_ORDERS_WIDTH", 0, 420, "RT_TOP_PADDING", 0, 8, "SPREAD_ROW_HEIGHT", 0, 36, "calculateOrdersValue", 0, (e, t) => {
        if (!Array.isArray(e)) return 0 n;
        let i = 10 n ** 6 n;
        return e.reduce((e, l) => {
            try {
                let s = (0, r.parseUnits)(l.shares, 6),
                    a = n(l.price, t);
                e += s * a / i
            } catch {}
            return e
        }, 0 n)
    }, "formatToBn", 0, (e, t) => {
        try {
            let i = n(e.price, t),
                l = (0, r.parseUnits)(e.shares, 6);
            return { ...e,
                priceUSDC: i,
                sharesUSDC: l
            }
        } catch {
            return { ...e,
                priceUSDC: 0 n,
                sharesUSDC: 0 n
            }
        }
    }, "getIsValidOrder", 0, e => {
        try {
            return parseFloat(e.price) > 0 && parseFloat(e.shares) > 0
        } catch {
            return !1
        }
    }, "headerTextClasses", 0, "font-medium text-[11px] leading-[15px] text-text-secondary tracking-wider uppercase", "headerWrapperClasses", 0, "flex h-[var(--spread-row-height)] justify-between items-center"])
}, 815940, e => {
    "use strict";
    var t, r = e.i(221628),
        i = e.i(23128),
        l = e.i(525962),
        n = e.i(318594),
        s = e.i(140527),
        a = e.i(604777),
        o = e.i(416340),
        c = e.i(577103),
        d = e.i(373898),
        u = e.i(510954),
        m = e.i(57096),
        f = e.i(196593),
        p = e.i(156591),
        x = e.i(358515),
        h = e.i(586652),
        g = e.i(181687),
        y = e.i(53382),
        v = e.i(798631),
        b = e.i(466542),
        C = e.i(405473),
        w = e.i(870555),
        j = e.i(294472),
        N = e.i(864006),
        k = e.i(533331),
        S = ((t = S || {}).Side = "side", t.Outcome = "outcome", t.Price = "price", t.Filled = "filled", t.Total = "total", t.Expiration = "expiration", t.Order = "order", t);
    let O = {
            side: 1,
            outcome: 1,
            price: 1.25,
            filled: 1.5,
            total: 1.5,
            expiration: 1.5,
            order: .6
        },
        T = function({
            data: e,
            market: t,
            containerVariant: i,
            containerClassName: l,
            bodyClassName: s,
            bodyStyle: c,
            tableHeaderItemClassName: p,
            tableBodyItemClassName: x,
            setOrderToCancel: h
        }) {
            let S = (0, n.useQueryClient)(),
                T = (0, a.useTranslations)(),
                A = (0, N.useMessages)().time,
                [$, D] = (0, o.useState)([]),
                F = (0, d.default)(),
                M = (0, o.useCallback)(e => 0 === t.outcomes.map(e => e.toLowerCase()).indexOf(e.toLowerCase()) ? "green" : "red", [t.outcomes]),
                I = (0, o.useCallback)(async e => {
                    try {
                        await F(e, t, !1)
                    } finally {
                        S.invalidateQueries({
                            queryKey: u.queryKeys[m.QueryKey.OpenOrders]._def
                        })
                    }
                }, [F, S, t]),
                R = (0, o.useMemo)(() => {
                    let e = Object.values(O).reduce((e, t) => e + t, 0),
                        t = (b.RT_ORDERS_WIDTH - 4) / e;
                    return [{
                        header: T("events.orderHeaders.type"),
                        id: "side",
                        accessorKey: "side",
                        cell: e => e.getValue(),
                        size: t * O.side,
                        sortingFn: (e, t) => e.original.side.localeCompare(t.original.side)
                    }, {
                        header: T("events.orderHeaders.side"),
                        id: "outcome",
                        accessorKey: "outcome",
                        cell: e => e.getValue(),
                        size: t * O.outcome,
                        sortingFn: (e, t) => e.original.outcome.localeCompare(t.original.outcome)
                    }, {
                        header: T("events.orderHeaders.price"),
                        id: "price",
                        accessorKey: "price",
                        cell: e => {
                            let t = e.getValue();
                            return `${t}\xa2`
                        },
                        size: t * O.price,
                        sortingFn: (e, t) => parseFloat(e.original.price) - parseFloat(t.original.price)
                    }, {
                        header: T("events.orderHeaders.filled"),
                        id: "filled",
                        accessorKey: "filled",
                        cell: e => {
                            let [t, r] = e.getValue();
                            return `${(0,f.formatNum)(t,{decimals:0})} / ${(0,f.formatNum)(r,{decimals:0})}`
                        },
                        size: t * O.filled,
                        sortingFn: (e, t) => e.original.filled[0] - t.original.filled[0]
                    }, {
                        header: T("events.orderHeaders.total"),
                        id: "total",
                        accessorKey: "total",
                        cell: e => {
                            let t = e.getValue();
                            return t < 10 ? (0, f.formatCurrency)(t, {
                                decimals: 2
                            }) : (0, f.formatCurrency)(Math.round(t), {
                                decimals: 0
                            })
                        },
                        size: t * O.total,
                        sortingFn: (e, t) => e.original.total - t.original.total
                    }, {
                        header: T("events.orderHeaders.expiry"),
                        id: "expiration",
                        accessorKey: "expiration",
                        cell: e => {
                            let t = e.getValue(),
                                r = (0, j.fromPossibleUnixToRelativeTime)(t, !1, A);
                            return "Until Cancelled" === r ? "--" : r
                        },
                        size: t * O.expiration,
                        sortingFn: (e, t) => (Number(e ? .original ? .expiration) || 1 / 0) - (Number(t ? .original ? .expiration) || 1 / 0)
                    }, {
                        header: "",
                        id: "order",
                        accessorKey: "order",
                        cell: e => (0, r.jsx)(C.default, {
                            mode: "single",
                            callback: () => {
                                I(e.getValue())
                            }
                        }),
                        size: t * O.order
                    }]
                }, [I, T, A]),
                {
                    getHeaderGroups: E,
                    getRowModel: P,
                    getCenterTotalSize: V
                } = (0, g.useReactTable)({
                    data: e,
                    columns: R,
                    state: {
                        sorting: $
                    },
                    onSortingChange: D,
                    getCoreRowModel: (0, y.getCoreRowModel)(),
                    getSortedRowModel: (0, y.getSortedRowModel)(),
                    sortDescFirst: !0
                });
            return (0, r.jsx)("div", {
                className: (0, w.cn)("rounded-lg text-text hidden lg:block", "primary" === i || "secondary" === i ? "border border-border bg-surface-1" : "", l),
                children: (0, r.jsx)("div", {
                    className: (0, w.cn)("px-6 py-0.5 overflow-x-auto", s),
                    style: c,
                    children: (0, r.jsxs)(k.PositionsTable, {
                        style: {
                            width: V()
                        },
                        children: [(0, r.jsx)(k.PositionsTHead, {
                            children: E().map(e => (0, r.jsx)(k.PositionsTr, {
                                className: "items-center",
                                children: e.headers.map(e => {
                                    let t = "function" == typeof e.column.columnDef.sortingFn;
                                    return (0, r.jsxs)("th", {
                                        colSpan: e.colSpan,
                                        className: (0, w.cn)("flex items-center h-[30.5px] text-left py-2.5 border-b border-neutral-50 mb-2 relative leading-[0.65]! font-semibold text-[10px] tracking-wider text-text-secondary uppercase", t && "cursor-pointer select-none", p),
                                        style: {
                                            width: e.getSize()
                                        },
                                        onClick: t ? e.column.getToggleSortingHandler() : void 0,
                                        children: [(0, g.flexRender)(e.column.columnDef.header, e.getContext()), t ? (0, r.jsxs)("div", {
                                            className: "flex flex-col -space-y-[5px] ml-0.5",
                                            children: [(0, r.jsx)(v.IconChevronDownOutline12, {
                                                size: 10,
                                                className: `rotate-180 ${"asc"===e.column.getIsSorted()?"text-text-secondary":"text-text-tertiary"}`
                                            }), (0, r.jsx)(v.IconChevronDownOutline12, {
                                                size: 10,
                                                className: "desc" === e.column.getIsSorted() ? "text-text-secondary" : "text-text-tertiary"
                                            })]
                                        }) : null]
                                    }, e.id)
                                })
                            }, e.id))
                        }), (0, r.jsx)(k.PositionsTBody, {
                            children: P().rows.map(e => (0, r.jsx)(k.PositionsTr, {
                                children: e.getVisibleCells().map(e => (0, r.jsx)(k.PositionsTd, {
                                    className: x,
                                    style: {
                                        width: e.column.getSize()
                                    },
                                    children: "outcome" === e.getContext().column.id ? (0, r.jsx)(k.PositionsChip, {
                                        color: M(e.getValue()),
                                        className: "font-medium",
                                        children: (0, g.flexRender)(e.column.columnDef.cell, e.getContext())
                                    }) : (0, g.flexRender)(e.column.columnDef.cell, e.getContext())
                                }, e.id))
                            }, e.id))
                        })]
                    })
                })
            })
        };
    e.s(["default", 0, function({
        market: e,
        openOrders: t,
        containerVariant: g,
        containerClassName: y,
        headerClassName: v,
        bodyClassName: b,
        bodyStyle: C,
        tableHeaderItemClassName: w,
        tableBodyItemClassName: j,
        hasHeader: N = !1,
        isRewardPage: k = !1,
        shouldShowEmptyTableHeaders: S = !1,
        colors: O,
        isSports: A,
        getCustomOrderChipDetails: $,
        stickyTopRow: D
    }) {
        let F = (0, a.useTranslations)(),
            M = (0, n.useQueryClient)(),
            I = (0, d.default)(),
            [R, E] = (0, o.useState)(!1),
            [P, V] = (0, o.useState)(),
            z = (0, o.useCallback)(e => {
                E(e)
            }, []),
            L = (0, o.useCallback)(() => {
                E(!1), V(void 0)
            }, []),
            K = (0, o.useCallback)(async t => {
                try {
                    await I(t, e, !1)
                } finally {
                    M.invalidateQueries({
                        queryKey: u.queryKeys[m.QueryKey.OpenOrders]._def
                    })
                }
            }, [I, M, e]),
            H = (0, c.useCancelAllOpenOrders)({
                openOrders: t,
                market: e
            }),
            B = (0, o.useMemo)(() => t.map(t => {
                let r = parseFloat(t.originalSize),
                    i = parseFloat(t.sizeMatched),
                    l = parseFloat(t.price),
                    n = `${(0,f.showCentsOnly)(t.price,(0,p.getPrecisionFromTickSize)(e.orderPriceMinTickSize))}`;
                return {
                    side: (0, s.capitalize)(t.side),
                    outcome: t.outcome,
                    price: n,
                    filled: [i, r],
                    total: r * l,
                    order: t,
                    expiration: t ? .expiration
                }
            }) ? ? [], [t, e.orderPriceMinTickSize]);
        return 0 !== B.length || S ? (0, r.jsxs)(r.Fragment, {
            children: [k ? (0, r.jsx)(T, {
                data: B,
                market: e,
                containerVariant: g,
                containerClassName: y,
                bodyClassName: b,
                bodyStyle: C,
                tableHeaderItemClassName: w,
                tableBodyItemClassName: j,
                setOrderToCancel: V
            }) : null, k ? null : (0, r.jsx)(x.default, {
                data: B,
                market: e,
                containerClassName: y,
                headerClassName: v,
                bodyClassName: b,
                tableHeaderItemClassName: w,
                tableBodyItemClassName: j,
                hasHeader: N,
                setOrderToCancel: V,
                setDialogOpen: z,
                colors: O,
                isSports: A,
                getCustomOrderChipDetails: $,
                stickyTopRow: D
            }), k ? null : (0, r.jsx)(h.default, {
                data: B,
                market: e,
                containerVariant: g,
                setOrderToCancel: V,
                setDialogOpen: z
            }), (0, r.jsx)(l.Modal, {
                open: R,
                onOpenChange: e => {
                    E(e), e || V(void 0)
                },
                size: "sm",
                children: (0, r.jsxs)(l.ModalContent, {
                    children: [(0, r.jsx)(l.ModalTitle, {
                        children: P || 1 === t.length ? F("orders.cancelOneOrder") : F("orders.cancelNOrders", {
                            count: String(t.length)
                        })
                    }), (0, r.jsx)(l.ModalDescription, {
                        children: F("orders.cannotBeUndone")
                    }), (0, r.jsxs)(l.ModalFooter, {
                        children: [(0, r.jsx)(i.Button, {
                            variant: "outline",
                            onClick: L,
                            children: F("auth.back")
                        }), (0, r.jsx)(i.Button, {
                            variant: "destructive",
                            onClick: async () => {
                                P ? K({ ...P
                                }) : H(), L()
                            },
                            children: P || 1 === t.length ? F("orders.cancelOneOrder") : F("orders.cancelNOrders", {
                                count: String(t.length)
                            })
                        })]
                    })]
                })
            })]
        }) : null
    }], 815940)
}, 475753, e => {
    "use strict";
    class t {
        constructor(e) {
            this.stop = () => this.runAll("stop"), this.animations = e.filter(Boolean)
        }
        get finished() {
            return Promise.all(this.animations.map(e => e.finished))
        }
        getAll(e) {
            return this.animations[0][e]
        }
        setAll(e, t) {
            for (let r = 0; r < this.animations.length; r++) this.animations[r][e] = t
        }
        attachTimeline(e) {
            let t = this.animations.map(t => t.attachTimeline(e));
            return () => {
                t.forEach((e, t) => {
                    e && e(), this.animations[t].stop()
                })
            }
        }
        get time() {
            return this.getAll("time")
        }
        set time(e) {
            this.setAll("time", e)
        }
        get speed() {
            return this.getAll("speed")
        }
        set speed(e) {
            this.setAll("speed", e)
        }
        get state() {
            return this.getAll("state")
        }
        get startTime() {
            return this.getAll("startTime")
        }
        get duration() {
            return r(this.animations, "duration")
        }
        get iterationDuration() {
            return r(this.animations, "iterationDuration")
        }
        runAll(e) {
            this.animations.forEach(t => t[e]())
        }
        play() {
            this.runAll("play")
        }
        pause() {
            this.runAll("pause")
        }
        cancel() {
            this.runAll("cancel")
        }
        complete() {
            this.runAll("complete")
        }
    }

    function r(e, t) {
        let r = 0;
        for (let i = 0; i < e.length; i++) {
            let l = e[i][t];
            null !== l && l > r && (r = l)
        }
        return r
    }
    class i extends t {
        then(e, t) {
            return this.finished.finally(e).then(() => {})
        }
    }
    var l = e.i(522120),
        n = e.i(520415),
        s = e.i(516528),
        a = e.i(828397),
        o = e.i(95456),
        c = e.i(94855),
        d = e.i(976905),
        u = e.i(389815),
        m = e.i(724820),
        f = e.i(648400),
        p = e.i(451258),
        x = e.i(584346);

    function h(e, t) {
        var r;
        let i;
        return (0, x.isEasingArray)(e) ? e[r = e.length, ((t - 0) % (i = r - 0) + i) % i + 0] : e
    }
    var g = e.i(279393);

    function y(e) {
        return "object" == typeof e && !Array.isArray(e)
    }

    function v(e, t, r, i) {
        return null == e ? [] : "string" == typeof e && y(t) ? (0, g.resolveElements)(e, r, i) : e instanceof NodeList ? Array.from(e) : Array.isArray(e) ? e.filter(e => null != e) : [e]
    }

    function b(e, t, r, i) {
        return "number" == typeof t ? t : t.startsWith("-") || t.startsWith("+") ? Math.max(0, e + parseFloat(t)) : "<" === t ? r : t.startsWith("<") ? Math.max(0, r + parseFloat(t.slice(1))) : i.get(t) ? ? e
    }
    var C = e.i(509667);

    function w(e, t) {
        return e.at !== t.at ? e.at - t.at : null === e.value ? 1 : null === t.value ? -1 : 0
    }

    function j(e, t) {
        return t.has(e) || t.set(e, {}), t.get(e)
    }

    function N(e, t) {
        return t[e] || (t[e] = []), t[e]
    }
    let k = e => "number" == typeof e,
        S = e => e.every(k);
    var O = e.i(754710),
        T = e.i(874013),
        A = e.i(897296),
        $ = e.i(874833),
        D = e.i(220719),
        F = e.i(678611),
        M = e.i(435099),
        I = e.i(107952),
        R = e.i(742397);
    class E extends R.VisualElement {
        constructor() {
            super(...arguments), this.type = "object"
        }
        readValueFromInstance(e, t) {
            if (t in e) {
                let r = e[t];
                if ("string" == typeof r || "number" == typeof r) return r
            }
        }
        getBaseTargetFromProps() {}
        removeValueFromRenderState(e, t) {
            delete t.output[e]
        }
        measureInstanceViewportBox() {
            return (0, I.createBox)()
        }
        build(e, t) {
            Object.assign(e.output, t)
        }
        renderInstance(e, {
            output: t
        }) {
            Object.assign(e, t)
        }
        sortInstanceNodePosition() {
            return 0
        }
    }

    function P(e) {
        let t = {
                presenceContext: null,
                props: {},
                visualState: {
                    renderState: {
                        transform: {},
                        transformOrigin: {},
                        style: {},
                        vars: {},
                        attrs: {}
                    },
                    latestValues: {}
                }
            },
            r = (0, $.isSVGElement)(e) && !(0, D.isSVGSVGElement)(e) ? new F.SVGVisualElement(t) : new M.HTMLVisualElement(t);
        r.mount(e), T.visualElementStore.set(e, r)
    }

    function V(e) {
        let t = new E({
            presenceContext: null,
            props: {},
            visualState: {
                renderState: {
                    output: {}
                },
                latestValues: {}
            }
        });
        t.mount(e), T.visualElementStore.set(e, t)
    }

    function z(e, t, r, i) {
        let l = [];
        if ((0, a.isMotionValue)(e) || "number" == typeof e || "string" == typeof e && !y(t)) l.push((0, O.animateSingleValue)(e, y(t) && t.default || t, r && r.default || r));
        else {
            if (null == e) return l;
            let n = v(e, t, i),
                s = n.length;
            (0, p.invariant)(!!s, "No valid elements provided.", "no-valid-elements");
            for (let e = 0; e < s; e++) {
                let i = n[e],
                    a = i instanceof Element ? P : V;
                T.visualElementStore.has(i) || a(i);
                let o = T.visualElementStore.get(i),
                    c = { ...r
                    };
                "delay" in c && "function" == typeof c.delay && (c.delay = c.delay(e, s)), l.push(...(0, A.animateTarget)(o, { ...t,
                    transition: c
                }, {}))
            }
        }
        return l
    }

    function L(e = {}) {
        let {
            scope: t,
            reduceMotion: r
        } = e;
        return function(e, x, g) {
            var y;
            let k, O = [];
            if (Array.isArray(e) && e.some(Array.isArray)) {
                let i, {
                    onComplete: g,
                    ...T
                } = x || {};
                "function" == typeof g && (k = g), y = void 0 !== r ? {
                    reduceMotion: r,
                    ...T
                } : T, i = [], (function(e, {
                    defaultTransition: t = {},
                    ...r
                } = {}, i, n) {
                    let s = t.duration || .3,
                        x = new Map,
                        g = new Map,
                        y = {},
                        k = new Map,
                        O = 0,
                        T = 0,
                        A = 0;
                    for (let r = 0; r < e.length; r++) {
                        let m = e[r];
                        if ("string" == typeof m) {
                            k.set(m, T);
                            continue
                        }
                        if (!Array.isArray(m)) {
                            k.set(m.name, b(T, m.at, O, k));
                            continue
                        }
                        let [x, w, F = {}] = m;
                        void 0 !== F.at && (T = b(T, F.at, O, k));
                        let M = 0,
                            I = (e, r, i, a = 0, m = 0) => {
                                var x;
                                let g = Array.isArray(x = e) ? x : [x],
                                    {
                                        delay: y = 0,
                                        times: v = (0, o.defaultOffset)(g),
                                        type: b = t.type || "keyframes",
                                        repeat: w,
                                        repeatType: j,
                                        repeatDelay: N = 0,
                                        ...k
                                    } = r,
                                    {
                                        ease: O = t.ease || "easeOut",
                                        duration: $
                                    } = r,
                                    D = "function" == typeof y ? y(a, m) : y,
                                    F = g.length,
                                    I = (0, c.isGenerator)(b) ? b : n ? .[b || "keyframes"];
                                if (F <= 2 && I) {
                                    let e = 100;
                                    2 === F && S(g) && (e = Math.abs(g[1] - g[0]));
                                    let r = { ...t,
                                        ...k
                                    };
                                    void 0 !== $ && (r.duration = (0, f.secondsToMilliseconds)($));
                                    let i = (0, d.createGeneratorEasing)(r, e, I);
                                    O = i.ease, $ = i.duration
                                }
                                $ ? ? ($ = s);
                                let R = T + D;
                                1 === v.length && 0 === v[0] && (v[1] = 1);
                                let E = v.length - g.length;
                                if (E > 0 && (0, u.fillOffset)(v, E), 1 === g.length && g.unshift(null), w) {
                                    (0, p.invariant)(w < 20, "Repeat count too high, must be less than 20", "repeat-count-high"), $ *= w + 1;
                                    let e = [...g],
                                        t = [...v],
                                        r = [...O = Array.isArray(O) ? [...O] : [O]];
                                    for (let i = 0; i < w; i++) {
                                        g.push(...e);
                                        for (let l = 0; l < e.length; l++) v.push(t[l] + (i + 1)), O.push(0 === l ? "linear" : h(r, l - 1))
                                    }
                                    for (let e = 0; e < v.length; e++) v[e] = v[e] / (w + 1)
                                }
                                let P = R + $;
                                ! function(e, t, r, i, n, s) {
                                    for (let t = 0; t < e.length; t++) {
                                        let r = e[t];
                                        r.at > n && r.at < s && ((0, l.removeItem)(e, r), t--)
                                    }
                                    for (let l = 0; l < t.length; l++) e.push({
                                        value: t[l],
                                        at: (0, C.mixNumber)(n, s, i[l]),
                                        easing: h(r, l)
                                    })
                                }(i, g, O, v, R, P), M = Math.max(D + $, M), A = Math.max(P, A)
                            };
                        if ((0, a.isMotionValue)(x)) I(w, F, N("default", j(x, g)));
                        else {
                            let e = v(x, w, i, y),
                                t = e.length;
                            for (let r = 0; r < t; r++) {
                                let i = j(e[r], g);
                                for (let e in w) {
                                    var $, D;
                                    I(w[e], ($ = F, D = e, $ && $[D] ? { ...$,
                                        ...$[D]
                                    } : { ...$
                                    }), N(e, i), r, t)
                                }
                            }
                        }
                        O = T, T += M
                    }
                    return g.forEach((e, i) => {
                        for (let l in e) {
                            let n = e[l];
                            n.sort(w);
                            let s = [],
                                a = [],
                                o = [];
                            for (let e = 0; e < n.length; e++) {
                                let {
                                    at: t,
                                    value: r,
                                    easing: i
                                } = n[e];
                                s.push(r), a.push((0, m.progress)(0, A, t)), o.push(i || "easeOut")
                            }
                            0 !== a[0] && (a.unshift(0), s.unshift(s[0]), o.unshift("easeInOut")), 1 !== a[a.length - 1] && (a.push(1), s.push(null)), x.has(i) || x.set(i, {
                                keyframes: {},
                                transition: {}
                            });
                            let c = x.get(i);
                            c.keyframes[l] = s;
                            let {
                                type: d,
                                ...u
                            } = t;
                            c.transition[l] = { ...u,
                                duration: A,
                                ease: o,
                                times: a,
                                ...r
                            }
                        }
                    }), x
                })(e.map(e => {
                    if (Array.isArray(e) && "function" == typeof e[0]) {
                        let t = e[0],
                            r = (0, n.motionValue)(0);
                        return (r.on("change", t), 1 === e.length) ? [r, [0, 1]] : 2 === e.length ? [r, [0, 1], e[1]] : [r, e[1], e[2]]
                    }
                    return e
                }), y, t, {
                    spring: s.spring
                }).forEach(({
                    keyframes: e,
                    transition: t
                }, r) => {
                    i.push(...z(r, e, t))
                }), O = i
            } else {
                let {
                    onComplete: i,
                    ...l
                } = g || {};
                "function" == typeof i && (k = i), O = z(e, x, void 0 !== r ? {
                    reduceMotion: r,
                    ...l
                } : l, t)
            }
            let T = new i(O);
            return k && T.finished.then(k), t && (t.animations.push(T), T.finished.then(() => {
                (0, l.removeItem)(t.animations, T)
            })), T
        }
    }
    let K = L();
    e.s(["animate", 0, K, "createScopedAnimate", 0, L], 475753)
}, 147658, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(583730),
        i = e.i(20655);
    e.i(284553);
    var l = e.i(644362),
        n = e.i(710918),
        s = e.i(475753);
    e.s(["useAnimate", 0, function() {
        var e;
        let a = (0, r.useConstant)(() => ({
                current: null,
                animations: []
            })),
            o = function() {
                let e = function() {
                        l.hasReducedMotionListener.current || (0, n.initPrefersReducedMotion)();
                        let [e] = (0, t.useState)(l.prefersReducedMotion.current);
                        return e
                    }(),
                    {
                        reducedMotion: r
                    } = (0, t.useContext)(i.MotionConfigContext);
                return "never" !== r && ("always" === r || e)
            }() ? ? void 0,
            c = (0, t.useMemo)(() => (0, s.createScopedAnimate)({
                scope: a,
                reduceMotion: o
            }), [a, o]);
        return e = () => {
            a.animations.forEach(e => e.stop()), a.animations.length = 0
        }, (0, t.useEffect)(() => () => e(), []), [a, c]
    }], 147658)
}, 986179, e => {
    "use strict";
    var t = e.i(642615),
        r = e.i(63238);
    e.s(["parseEther", 0, function(e, i = "wei") {
        return (0, r.parseUnits)(e, t.etherUnits[i])
    }])
}, 276918, e => {
    "use strict";
    e.s(["getMarketImageAlt", 0, function(e) {
        let t = e ? .trim();
        return t ? `icon for ${t}` : "market icon"
    }])
}, 896414, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        i = e.i(416340),
        l = e.i(86831),
        n = e.i(573818),
        s = e.i(664318),
        a = e.i(276918);
    e.s(["MarketImage", 0, function(e) {
        let o, c, d, u, m, f, p, x, h = (0, r.c)(24),
            {
                image: g,
                alt: y,
                marketName: v,
                size: b,
                containerClassName: C,
                skeletonClassName: w,
                imgClassName: j,
                forceHasLoaded: N,
                fallbackImage: k
            } = e,
            S = void 0 === b ? 40 : b,
            O = g || k || null;
        h[0] !== y || h[1] !== v ? (o = y ? ? (0, a.getMarketImageAlt)(v), h[0] = y, h[1] = v, h[2] = o) : o = h[2];
        let T = o,
            [A, $] = (0, i.useState)(void 0 !== N && N || !O);
        h[3] !== C ? (c = (0, l.cn)("relative overflow-hidden rounded-full", C), h[3] = C, h[4] = c) : c = h[4], h[5] !== S ? (d = {
            height: S,
            width: S,
            minWidth: S
        }, h[5] = S, h[6] = d) : d = h[6], h[7] !== w ? (u = (0, l.cn)("absolute top-0 left-0 rounded-[inherit]", w), h[7] = w, h[8] = u) : u = h[8];
        let D = A && O ? 0 : 1;
        return h[9] !== S || h[10] !== D ? (m = {
            width: S,
            height: S,
            minWidth: S,
            opacity: D
        }, h[9] = S, h[10] = D, h[11] = m) : m = h[11], h[12] !== u || h[13] !== m ? (f = (0, t.jsx)(s.Skeleton, {
            className: u,
            style: m
        }), h[12] = u, h[13] = m, h[14] = f) : f = h[14], h[15] !== j || h[16] !== T || h[17] !== O ? (p = O && (0, t.jsx)(n.ImageWithFallback, {
            src: O,
            alt: T,
            fill: !0,
            quality: 75,
            onLoad: () => $(!0),
            sizes: "(max-width: 768px) 15vw, (max-width: 1400px) 10vw, 90px",
            className: (0, l.cn)("object-cover", j)
        }), h[15] = j, h[16] = T, h[17] = O, h[18] = p) : p = h[18], h[19] !== p || h[20] !== c || h[21] !== d || h[22] !== f ? (x = (0, t.jsxs)("div", {
            className: c,
            style: d,
            children: [f, p]
        }), h[19] = p, h[20] = c, h[21] = d, h[22] = f, h[23] = x) : x = h[23], x
    }])
}, 534532, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(149534);
    e.s(["IconUpload4Outline18", 0, ({
        strokeWidth: e = 1.5,
        ...i
    }) => t.default.createElement(r.Icon, {
        size: "18px",
        ...i
    }, t.default.createElement("path", {
        d: "M15.25,11.75v1.5c0,1.105-.895,2-2,2H4.75c-1.105,0-2-.895-2-2v-1.5",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }), t.default.createElement("polyline", {
        points: "12.5 6.25 9 2.75 5.5 6.25",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), t.default.createElement("line", {
        x1: "9",
        y1: "2.75",
        x2: "9",
        y2: "10.25",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }))])
}, 213567, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(180715);
    e.s(["IconCircleInfoOutline12", 0, ({
        strokeWidth: e = 1.5,
        ...i
    }) => t.default.createElement(r.Icon, {
        size: "12px",
        ...i
    }, t.default.createElement("circle", {
        cx: "6",
        cy: "6",
        r: "5.25",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }), t.default.createElement("circle", {
        cx: "6",
        cy: "3.125",
        r: ".875",
        fill: "currentColor",
        strokeWidth: "0",
        "data-color": "color-2"
    }), t.default.createElement("line", {
        x1: "6",
        y1: "8.5",
        x2: "6",
        y2: "5.5",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }))])
}, 992805, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        i = e.i(416340),
        l = e.i(86831),
        n = e.i(254380);
    let s = {
        default: "text-heading-lg",
        sm: "text-heading-base",
        xs: "text-sm"
    };
    e.s(["TextTabs", 0, function(e) {
        let a, o, c, d = (0, r.c)(19),
            {
                items: u,
                value: m,
                onValueChange: f,
                onItemHover: p,
                className: x,
                id: h,
                headingLevel: g,
                size: y
            } = e,
            v = void 0 === y ? "default" : y,
            b = i.useRef(null);
        if (d[0] !== g || d[1] !== u || d[2] !== p || d[3] !== f || d[4] !== v || d[5] !== m) {
            let e;
            d[7] !== g || d[8] !== p || d[9] !== f || d[10] !== v || d[11] !== m ? (e = e => {
                let r = (0, t.jsx)("button", {
                    id: e.id,
                    type: "button",
                    onClick: () => f(e.value),
                    onPointerEnter: () => p ? .(e.value),
                    className: (0, l.cn)(s[v], "font-semibold cursor-pointer whitespace-nowrap shrink-0 transition-colors duration-150", m === e.value ? "text-text" : "text-text-secondary hover:text-text-tertiary"),
                    children: e.label
                }, g ? void 0 : e.value);
                return g ? (0, t.jsx)(g, {
                    className: "contents",
                    children: r
                }, e.value) : r
            }, d[7] = g, d[8] = p, d[9] = f, d[10] = v, d[11] = m, d[12] = e) : e = d[12], a = u.map(e), d[0] = g, d[1] = u, d[2] = p, d[3] = f, d[4] = v, d[5] = m, d[6] = a
        } else a = d[6];
        return d[13] !== a ? (o = (0, t.jsx)(n.ScrollContainer, {
            containerRef: b,
            className: "flex gap-4 overflow-x-auto no-scrollbar",
            children: a
        }), d[13] = a, d[14] = o) : o = d[14], d[15] !== x || d[16] !== h || d[17] !== o ? (c = (0, t.jsx)("div", {
            className: x,
            id: h,
            children: o
        }), d[15] = x, d[16] = h, d[17] = o, d[18] = c) : c = d[18], c
    }])
}, 618357, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        i = e.i(23128),
        l = e.i(870555),
        n = e.i(534532);
    e.s(["default", 0, e => {
        let s, a, o, c, d, u, m = (0, r.c)(11);
        m[0] !== e ? ({
            isEvenRow: a,
            className: s,
            ...o
        } = e, m[0] = e, m[1] = s, m[2] = a, m[3] = o) : (s = m[1], a = m[2], o = m[3]);
        let f = a && "hover:bg-neutral-50";
        return m[4] !== s || m[5] !== f ? (c = (0, l.cn)("h-[32px] w-[32px]", f, s), m[4] = s, m[5] = f, m[6] = c) : c = m[6], m[7] === Symbol.for("react.memo_cache_sentinel") ? (d = (0, t.jsx)(n.IconUpload4Outline18, {
            size: 14
        }), m[7] = d) : d = m[7], m[8] !== o || m[9] !== c ? (u = (0, t.jsx)(i.Button, {
            variant: "ghost",
            size: "icon",
            className: c,
            ...o,
            children: d
        }), m[8] = o, m[9] = c, m[10] = u) : u = m[10], u
    }])
}, 92902, e => {
    "use strict";
    e.s(["formatAsCents", 0, function(e) {
        try {
            let t = "string" == typeof e ? parseFloat(e) : e,
                r = Math.max(t, 0),
                i = new Intl.NumberFormat("en-US", {
                    style: "decimal",
                    maximumFractionDigits: 1,
                    minimumFractionDigits: 0
                });
            return `${i.format(100*r).replace(/,/g,"")}\xa2`
        } catch {
            return "N/A"
        }
    }, "formatAsDollars", 0, function(e, t) {
        try {
            let r = "string" == typeof e ? parseFloat(e) : e;
            if (Number.isNaN(r)) return "$0.00";
            let {
                signDisplay: i = "auto",
                minimumFractionDigits: l = 2,
                maximumFractionDigits: n = 2,
                ...s
            } = t || {}, a = Math.abs(r), o = r < 0, c = a.toLocaleString("en-US", {
                style: "decimal",
                minimumFractionDigits: l,
                maximumFractionDigits: n,
                ...s
            });
            if ("never" === i) return `$${c}`;
            if ("always" === i) return o ? `-$${c}` : `+$${c}`;
            if ("exceptZero" !== i) return o ? `-$${c}` : `$${c}`;
            if (0 === r) return `$${c}`;
            return o ? `-$${c}` : `+$${c}`
        } catch {
            return "$0.00"
        }
    }, "formatAsPercent", 0, function(e, t) {
        try {
            let r = "string" == typeof e ? parseFloat(e) : e;
            if (Number.isNaN(r)) return "0%";
            return new Intl.NumberFormat("en-US", {
                style: "percent",
                maximumFractionDigits: 2,
                minimumFractionDigits: 0,
                ...t
            }).format(r / 100)
        } catch {
            return "0%"
        }
    }])
}, 131878, e => {
    "use strict";

    function t(e) {
        return e.transactionHash ? `${e.transactionHash.toLowerCase()}-${e.timestamp}-${e.outcomeIndex}` : `${e.asset}-${e.proxyWallet}-${e.timestamp}-${e.outcomeIndex}`
    }
    e.s(["abbreviateTime", 0, (e, t) => {
        let r = t.ago,
            i = e.replace(/\D/g, "");
        switch (!0) {
            case e.includes("seconds") || e.includes("second"):
                return "0" === i ? t.now : `${i}${t.short.s} ${r}`;
            case e.includes("less than a minute") || e.includes("half a minute"):
                return t.now;
            case e.includes("minutes") || e.includes("minute"):
                return i ? `${i}${t.short.m} ${r}` : t.now;
            case e.includes("hours") || e.includes("hour"):
                return `${i}${t.short.h} ${r}`;
            case e.includes("days") || e.includes("day"):
                return `${i}${t.short.d} ${r}`;
            case e.includes("months") || e.includes("month"):
                return `${i}${t.short.mo} ${r}`;
            case e.includes("years") || e.includes("year"):
                return `${i}${t.short.y} ${r}`;
            default:
                return e
        }
    }, "deduplicateTrades", 0, function(e) {
        let r = new Set;
        return e.filter(e => {
            let i = t(e);
            return !r.has(i) && (r.add(i), !0)
        })
    }, "doesTradeExist", 0, function(e, r) {
        if (!Array.isArray(e) || !r) return !1;
        let i = t(r);
        return e.some(e => !!Array.isArray(e) && e.some(e => t(e) === i))
    }, "getActivityId", 0, t])
}, 994345, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(416340),
        i = e.i(31360);
    e.s(["useTradeShareDialog", 0, function() {
        let e, l, n = (0, t.c)(7),
            {
                showModal: s,
                setShowModal: a
            } = (0, i.default)(),
            [o, c] = (0, r.useState)();
        n[0] !== a ? (e = e => {
            c(e), a(!0)
        }, n[0] = a, n[1] = e) : e = n[1];
        let d = e;
        return n[2] !== d || n[3] !== a || n[4] !== o || n[5] !== s ? (l = {
            sharePosition: o,
            isOpen: s,
            setIsOpen: a,
            openShare: d
        }, n[2] = d, n[3] = a, n[4] = o, n[5] = s, n[6] = l) : l = n[6], l
    }])
}]);

//# debugId=92cb5fa9-c082-ba9e-05c2-6345f94743e0