@agg-build/ui 4.26.0 → 4.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/event-trading-state.utils-B3my25Re.mjs +789 -0
- package/dist/event-trading-state.utils-s4DEc4iA.js +921 -0
- package/dist/events.js +23 -17650
- package/dist/events.mjs +3 -50
- package/dist/index.js +811 -47144
- package/dist/index.mjs +584 -1204
- package/dist/list-D8v2SmY1.js +6989 -0
- package/dist/list-DD7roCVl.mjs +6838 -0
- package/dist/manage-betdex-account-modal-21ZVLsz0.js +2390 -0
- package/dist/manage-betdex-account-modal-D2vKHird.mjs +2294 -0
- package/dist/modals-BReGwJzz.mjs +2993 -0
- package/dist/modals-CSexQO1C.js +3077 -0
- package/dist/modals.js +24 -11810
- package/dist/modals.mjs +3 -49
- package/dist/pages-CMlCYngA.mjs +7846 -0
- package/dist/pages-xvAzj6c2.js +7955 -0
- package/dist/pages.js +25 -42383
- package/dist/pages.mjs +3 -57
- package/dist/primitives-CqxNeV7H.js +9930 -0
- package/dist/primitives-Dz5aF8ma.mjs +8928 -0
- package/dist/primitives.js +102 -11079
- package/dist/primitives.mjs +1 -204
- package/dist/trading-CDkNdjGx.mjs +7086 -0
- package/dist/trading-CXsZFd3l.js +7217 -0
- package/dist/trading.js +39 -18215
- package/dist/trading.mjs +3 -68
- package/dist/types/agg-provider.d.mts +1 -1
- package/dist/types/agg-provider.d.ts +1 -1
- package/dist/types/auth/connect-button-view/index.d.mts +4 -5
- package/dist/types/auth/connect-button-view/index.d.ts +4 -5
- package/dist/types/deposit/components/DepositQRCode.d.mts +2 -2
- package/dist/types/deposit/components/DepositQRCode.d.ts +2 -2
- package/dist/types/deposit/index.d.mts +4 -4
- package/dist/types/deposit/index.d.ts +4 -4
- package/dist/types/deposit/steps/card-deposit.d.mts +1 -1
- package/dist/types/deposit/steps/card-deposit.d.ts +1 -1
- package/dist/types/deposit/steps/card-payment-pending.d.mts +1 -1
- package/dist/types/deposit/steps/card-payment-pending.d.ts +1 -1
- package/dist/types/deposit/steps/card-provider.d.mts +1 -1
- package/dist/types/deposit/steps/card-provider.d.ts +1 -1
- package/dist/types/deposit/steps/card-purchase-success.d.mts +1 -1
- package/dist/types/deposit/steps/card-purchase-success.d.ts +1 -1
- package/dist/types/deposit/steps/card-widget.d.mts +1 -1
- package/dist/types/deposit/steps/card-widget.d.ts +1 -1
- package/dist/types/deposit/steps/crypto-transfer.d.mts +1 -1
- package/dist/types/deposit/steps/crypto-transfer.d.ts +1 -1
- package/dist/types/deposit/steps/deposit-method.d.mts +2 -1
- package/dist/types/deposit/steps/deposit-method.d.ts +2 -1
- package/dist/types/deposit/steps/venue-selection.d.mts +1 -1
- package/dist/types/deposit/steps/venue-selection.d.ts +1 -1
- package/dist/types/deposit/steps/wallet-form.d.mts +1 -1
- package/dist/types/deposit/steps/wallet-form.d.ts +1 -1
- package/dist/types/deposit/steps/wallet-processing.d.mts +1 -1
- package/dist/types/deposit/steps/wallet-processing.d.ts +1 -1
- package/dist/types/deposit/steps/wallet-success.d.mts +1 -1
- package/dist/types/deposit/steps/wallet-success.d.ts +1 -1
- package/dist/types/events/item/event-list-item.utils.d.mts +1 -1
- package/dist/types/events/item/event-list-item.utils.d.ts +1 -1
- package/dist/types/events/item/index.d.mts +8 -8
- package/dist/types/events/item/index.d.ts +8 -8
- package/dist/types/events/item-details/event-list-item-details-market-selector.d.mts +1 -1
- package/dist/types/events/item-details/event-list-item-details-market-selector.d.ts +1 -1
- package/dist/types/events/item-details/event-markets-chart.d.mts +1 -1
- package/dist/types/events/item-details/event-markets-chart.d.ts +1 -1
- package/dist/types/events/item-details/event-markets-chart.utils.d.mts +1 -1
- package/dist/types/events/item-details/event-markets-chart.utils.d.ts +1 -1
- package/dist/types/events/item-details/index.d.mts +4 -4
- package/dist/types/events/item-details/index.d.ts +4 -4
- package/dist/types/events/item-details/settlement-summary.d.mts +4 -4
- package/dist/types/events/item-details/settlement-summary.d.ts +4 -4
- package/dist/types/events/list/category-sidebar.d.mts +4 -4
- package/dist/types/events/list/category-sidebar.d.ts +4 -4
- package/dist/types/events/list/event-list-tabs.d.mts +4 -8
- package/dist/types/events/list/event-list-tabs.d.ts +4 -8
- package/dist/types/events/list/event-list-venue-strip.d.mts +4 -11
- package/dist/types/events/list/event-list-venue-strip.d.ts +4 -11
- package/dist/types/events/list/index.d.mts +4 -4
- package/dist/types/events/list/index.d.ts +4 -4
- package/dist/types/events/market-details/index.d.mts +8 -8
- package/dist/types/events/market-details/index.d.ts +8 -8
- package/dist/types/events/market-details/market-details-graph-panel.d.mts +4 -14
- package/dist/types/events/market-details/market-details-graph-panel.d.ts +4 -14
- package/dist/types/events/market-details/market-details-outcome-button.d.mts +4 -4
- package/dist/types/events/market-details/market-details-outcome-button.d.ts +4 -4
- package/dist/types/events/market-details/orderbook-aggregation.d.mts +3 -1
- package/dist/types/events/market-details/orderbook-aggregation.d.ts +3 -1
- package/dist/types/events/market-details/use-visible-market-streams.d.mts +1 -1
- package/dist/types/events/market-details/use-visible-market-streams.d.ts +1 -1
- package/dist/types/events/orderbook/index.d.mts +4 -4
- package/dist/types/events/orderbook/index.d.ts +4 -4
- package/dist/types/events/orderbook/orderbook-with-states.d.mts +4 -4
- package/dist/types/events/orderbook/orderbook-with-states.d.ts +4 -4
- package/dist/types/events/shared/chart-source-caption.d.mts +1 -1
- package/dist/types/events/shared/chart-source-caption.d.ts +1 -1
- package/dist/types/events/shared/sports-live-score.d.mts +4 -4
- package/dist/types/events/shared/sports-live-score.d.ts +4 -4
- package/dist/types/events/shared/use-chart-orderbook.d.mts +3 -3
- package/dist/types/events/shared/use-chart-orderbook.d.ts +3 -3
- package/dist/types/geo-block-banner/index.d.mts +4 -4
- package/dist/types/geo-block-banner/index.d.ts +4 -4
- package/dist/types/geo-block-modal/index.d.mts +4 -4
- package/dist/types/geo-block-modal/index.d.ts +4 -4
- package/dist/types/kyc/shared-kyc-modal.d.mts +4 -4
- package/dist/types/kyc/shared-kyc-modal.d.ts +4 -4
- package/dist/types/notifications/agg-notification-events-provider.d.mts +1 -1
- package/dist/types/notifications/agg-notification-events-provider.d.ts +1 -1
- package/dist/types/notifications/agg-toast-provider.d.mts +1 -1
- package/dist/types/notifications/agg-toast-provider.d.ts +1 -1
- package/dist/types/onboarding/index.d.mts +4 -4
- package/dist/types/onboarding/index.d.ts +4 -4
- package/dist/types/onboarding/steps/connect-accounts.d.mts +4 -4
- package/dist/types/onboarding/steps/connect-accounts.d.ts +4 -4
- package/dist/types/onboarding/steps/connect-kalshi-modal.d.mts +4 -4
- package/dist/types/onboarding/steps/connect-kalshi-modal.d.ts +4 -4
- package/dist/types/onboarding/steps/connect-novig-modal.d.mts +1 -1
- package/dist/types/onboarding/steps/connect-novig-modal.d.ts +1 -1
- package/dist/types/onboarding/steps/connect-onchain-modal.d.mts +4 -4
- package/dist/types/onboarding/steps/connect-onchain-modal.d.ts +4 -4
- package/dist/types/onboarding/steps/connect-prophetx-modal.d.mts +1 -1
- package/dist/types/onboarding/steps/connect-prophetx-modal.d.ts +1 -1
- package/dist/types/onboarding/steps/how-it-works.d.mts +4 -4
- package/dist/types/onboarding/steps/how-it-works.d.ts +4 -4
- package/dist/types/onboarding/steps/profile-setup.d.mts +4 -4
- package/dist/types/onboarding/steps/profile-setup.d.ts +4 -4
- package/dist/types/pages/event-market/event-market.shared.d.mts +4 -4
- package/dist/types/pages/event-market/event-market.shared.d.ts +4 -4
- package/dist/types/pages/event-market/event-market.types.d.mts +2 -0
- package/dist/types/pages/event-market/event-market.types.d.ts +2 -0
- package/dist/types/pages/event-market/event-open-orders.d.mts +8 -27
- package/dist/types/pages/event-market/event-open-orders.d.ts +8 -27
- package/dist/types/pages/event-market/index.d.mts +6 -6
- package/dist/types/pages/event-market/index.d.ts +6 -6
- package/dist/types/pages/event-market/sports-event-market-page.d.mts +6 -6
- package/dist/types/pages/event-market/sports-event-market-page.d.ts +6 -6
- package/dist/types/pages/event-market/sports-line-rail.d.mts +2 -1
- package/dist/types/pages/event-market/sports-line-rail.d.ts +2 -1
- package/dist/types/pages/event-market/sports-market-card.d.mts +4 -4
- package/dist/types/pages/event-market/sports-market-card.d.ts +4 -4
- package/dist/types/pages/event-market/sports-markets.d.mts +4 -4
- package/dist/types/pages/event-market/sports-markets.d.ts +4 -4
- package/dist/types/pages/home/index.d.mts +6 -6
- package/dist/types/pages/home/index.d.ts +6 -6
- package/dist/types/pages/leaderboard/components/leaderboard-header-row.d.mts +1 -1
- package/dist/types/pages/leaderboard/components/leaderboard-header-row.d.ts +1 -1
- package/dist/types/pages/leaderboard/components/leaderboard-row.d.mts +1 -1
- package/dist/types/pages/leaderboard/components/leaderboard-row.d.ts +1 -1
- package/dist/types/pages/leaderboard/components/leaderboard-skeleton.d.mts +1 -1
- package/dist/types/pages/leaderboard/components/leaderboard-skeleton.d.ts +1 -1
- package/dist/types/pages/leaderboard/components/segmented-control.d.mts +1 -1
- package/dist/types/pages/leaderboard/components/segmented-control.d.ts +1 -1
- package/dist/types/pages/leaderboard/index.d.mts +1 -1
- package/dist/types/pages/leaderboard/index.d.ts +1 -1
- package/dist/types/pages/user-profile/components/activity-row.d.mts +4 -4
- package/dist/types/pages/user-profile/components/activity-row.d.ts +4 -4
- package/dist/types/pages/user-profile/components/available-balance-card.d.mts +4 -4
- package/dist/types/pages/user-profile/components/available-balance-card.d.ts +4 -4
- package/dist/types/pages/user-profile/components/balance-display.d.mts +4 -4
- package/dist/types/pages/user-profile/components/balance-display.d.ts +4 -4
- package/dist/types/pages/user-profile/components/balances-card.d.mts +4 -4
- package/dist/types/pages/user-profile/components/balances-card.d.ts +4 -4
- package/dist/types/pages/user-profile/components/betdex-account-activity.d.mts +1 -1
- package/dist/types/pages/user-profile/components/betdex-account-activity.d.ts +1 -1
- package/dist/types/pages/user-profile/components/betdex-account-card.d.mts +1 -1
- package/dist/types/pages/user-profile/components/betdex-account-card.d.ts +1 -1
- package/dist/types/pages/user-profile/components/betdex-account-transfers.d.mts +1 -1
- package/dist/types/pages/user-profile/components/betdex-account-transfers.d.ts +1 -1
- package/dist/types/pages/user-profile/components/betdex-wallet-deposit.d.mts +1 -1
- package/dist/types/pages/user-profile/components/betdex-wallet-deposit.d.ts +1 -1
- package/dist/types/pages/user-profile/components/claim-activity-breakdown-modal.d.mts +1 -1
- package/dist/types/pages/user-profile/components/claim-activity-breakdown-modal.d.ts +1 -1
- package/dist/types/pages/user-profile/components/empty-state.d.mts +4 -4
- package/dist/types/pages/user-profile/components/empty-state.d.ts +4 -4
- package/dist/types/pages/user-profile/components/manage-balances-modal.d.mts +4 -4
- package/dist/types/pages/user-profile/components/manage-balances-modal.d.ts +4 -4
- package/dist/types/pages/user-profile/components/open-order-row.d.mts +4 -4
- package/dist/types/pages/user-profile/components/open-order-row.d.ts +4 -4
- package/dist/types/pages/user-profile/components/position-row.d.mts +4 -4
- package/dist/types/pages/user-profile/components/position-row.d.ts +4 -4
- package/dist/types/pages/user-profile/components/positions-activity.d.mts +4 -4
- package/dist/types/pages/user-profile/components/positions-activity.d.ts +4 -4
- package/dist/types/pages/user-profile/components/positions-value-card.d.mts +4 -4
- package/dist/types/pages/user-profile/components/positions-value-card.d.ts +4 -4
- package/dist/types/pages/user-profile/components/user-info-card.d.mts +4 -4
- package/dist/types/pages/user-profile/components/user-info-card.d.ts +4 -4
- package/dist/types/pages/user-profile/index.d.mts +6 -6
- package/dist/types/pages/user-profile/index.d.ts +6 -6
- package/dist/types/paper-trading/paper-onboarding-modal.d.mts +4 -14
- package/dist/types/paper-trading/paper-onboarding-modal.d.ts +4 -14
- package/dist/types/paper-trading/paper-trading-badge.d.mts +4 -16
- package/dist/types/paper-trading/paper-trading-badge.d.ts +4 -16
- package/dist/types/paper-trading/paper-trading-onboarding.d.mts +4 -12
- package/dist/types/paper-trading/paper-trading-onboarding.d.ts +4 -12
- package/dist/types/primitives/agg-logo/agg-logo.utils.d.mts +1 -1
- package/dist/types/primitives/agg-logo/agg-logo.utils.d.ts +1 -1
- package/dist/types/primitives/agg-logo/index.d.mts +4 -5
- package/dist/types/primitives/agg-logo/index.d.ts +4 -5
- package/dist/types/primitives/autocomplete-select/index.d.mts +4 -5
- package/dist/types/primitives/autocomplete-select/index.d.ts +4 -5
- package/dist/types/primitives/badge/index.d.mts +1 -1
- package/dist/types/primitives/badge/index.d.ts +1 -1
- package/dist/types/primitives/button/button.types.d.mts +2 -2
- package/dist/types/primitives/button/button.types.d.ts +2 -2
- package/dist/types/primitives/button/index.d.mts +4 -5
- package/dist/types/primitives/button/index.d.ts +4 -5
- package/dist/types/primitives/calendar/index.d.mts +4 -4
- package/dist/types/primitives/calendar/index.d.ts +4 -4
- package/dist/types/primitives/card/index.d.mts +4 -5
- package/dist/types/primitives/card/index.d.ts +4 -5
- package/dist/types/primitives/chart/chart-type-switch.d.mts +4 -5
- package/dist/types/primitives/chart/chart-type-switch.d.ts +4 -5
- package/dist/types/primitives/chart/index.d.mts +4 -5
- package/dist/types/primitives/chart/index.d.ts +4 -5
- package/dist/types/primitives/chart/probability-chart.d.mts +2 -2
- package/dist/types/primitives/chart/probability-chart.d.ts +2 -2
- package/dist/types/primitives/chart/probability-live-tail.d.mts +1 -1
- package/dist/types/primitives/chart/probability-live-tail.d.ts +1 -1
- package/dist/types/primitives/conditional-wrapper.d.mts +6 -7
- package/dist/types/primitives/conditional-wrapper.d.ts +6 -7
- package/dist/types/primitives/copy-button/index.d.mts +4 -5
- package/dist/types/primitives/copy-button/index.d.ts +4 -5
- package/dist/types/primitives/currency-input/index.d.mts +4 -5
- package/dist/types/primitives/currency-input/index.d.ts +4 -5
- package/dist/types/primitives/footer/agg-build-logo.d.mts +12 -15
- package/dist/types/primitives/footer/agg-build-logo.d.ts +12 -15
- package/dist/types/primitives/footer/index.d.mts +4 -6
- package/dist/types/primitives/footer/index.d.ts +4 -6
- package/dist/types/primitives/header/index.d.mts +4 -6
- package/dist/types/primitives/header/index.d.ts +4 -6
- package/dist/types/primitives/icon/index.d.mts +4 -5
- package/dist/types/primitives/icon/index.d.ts +4 -5
- package/dist/types/primitives/icon/registry.d.mts +180 -351
- package/dist/types/primitives/icon/registry.d.ts +180 -351
- package/dist/types/primitives/icon/svg/activity-chart.d.mts +4 -4
- package/dist/types/primitives/icon/svg/activity-chart.d.ts +4 -4
- package/dist/types/primitives/icon/svg/activity.d.mts +4 -4
- package/dist/types/primitives/icon/svg/activity.d.ts +4 -4
- package/dist/types/primitives/icon/svg/apple.d.mts +4 -4
- package/dist/types/primitives/icon/svg/apple.d.ts +4 -4
- package/dist/types/primitives/icon/svg/apps.d.mts +4 -4
- package/dist/types/primitives/icon/svg/apps.d.ts +4 -4
- package/dist/types/primitives/icon/svg/arbitrum.d.mts +4 -4
- package/dist/types/primitives/icon/svg/arbitrum.d.ts +4 -4
- package/dist/types/primitives/icon/svg/arrow-right.d.mts +4 -4
- package/dist/types/primitives/icon/svg/arrow-right.d.ts +4 -4
- package/dist/types/primitives/icon/svg/arrow-trend-up.d.mts +4 -4
- package/dist/types/primitives/icon/svg/arrow-trend-up.d.ts +4 -4
- package/dist/types/primitives/icon/svg/arrows-to-dot.d.mts +4 -4
- package/dist/types/primitives/icon/svg/arrows-to-dot.d.ts +4 -4
- package/dist/types/primitives/icon/svg/badge-check-thin.d.mts +4 -4
- package/dist/types/primitives/icon/svg/badge-check-thin.d.ts +4 -4
- package/dist/types/primitives/icon/svg/bank.d.mts +4 -4
- package/dist/types/primitives/icon/svg/bank.d.ts +4 -4
- package/dist/types/primitives/icon/svg/base.d.mts +4 -4
- package/dist/types/primitives/icon/svg/base.d.ts +4 -4
- package/dist/types/primitives/icon/svg/best-prices.d.mts +4 -4
- package/dist/types/primitives/icon/svg/best-prices.d.ts +4 -4
- package/dist/types/primitives/icon/svg/bnb.d.mts +4 -4
- package/dist/types/primitives/icon/svg/bnb.d.ts +4 -4
- package/dist/types/primitives/icon/svg/bolt.d.mts +4 -4
- package/dist/types/primitives/icon/svg/bolt.d.ts +4 -4
- package/dist/types/primitives/icon/svg/calendar.d.mts +1 -1
- package/dist/types/primitives/icon/svg/calendar.d.ts +1 -1
- package/dist/types/primitives/icon/svg/chart-candlestick.d.mts +4 -4
- package/dist/types/primitives/icon/svg/chart-candlestick.d.ts +4 -4
- package/dist/types/primitives/icon/svg/chart-line.d.mts +4 -4
- package/dist/types/primitives/icon/svg/chart-line.d.ts +4 -4
- package/dist/types/primitives/icon/svg/check-badge.d.mts +4 -4
- package/dist/types/primitives/icon/svg/check-badge.d.ts +4 -4
- package/dist/types/primitives/icon/svg/check-circle.d.mts +4 -4
- package/dist/types/primitives/icon/svg/check-circle.d.ts +4 -4
- package/dist/types/primitives/icon/svg/chevron-down-thin.d.mts +4 -5
- package/dist/types/primitives/icon/svg/chevron-down-thin.d.ts +4 -5
- package/dist/types/primitives/icon/svg/chevron-down.d.mts +4 -4
- package/dist/types/primitives/icon/svg/chevron-down.d.ts +4 -4
- package/dist/types/primitives/icon/svg/chevron-left.d.mts +4 -4
- package/dist/types/primitives/icon/svg/chevron-left.d.ts +4 -4
- package/dist/types/primitives/icon/svg/chevron-right.d.mts +4 -4
- package/dist/types/primitives/icon/svg/chevron-right.d.ts +4 -4
- package/dist/types/primitives/icon/svg/chevron-up.d.mts +4 -4
- package/dist/types/primitives/icon/svg/chevron-up.d.ts +4 -4
- package/dist/types/primitives/icon/svg/circle-overlap.d.mts +4 -4
- package/dist/types/primitives/icon/svg/circle-overlap.d.ts +4 -4
- package/dist/types/primitives/icon/svg/circle-xmark.d.mts +4 -4
- package/dist/types/primitives/icon/svg/circle-xmark.d.ts +4 -4
- package/dist/types/primitives/icon/svg/close.d.mts +4 -4
- package/dist/types/primitives/icon/svg/close.d.ts +4 -4
- package/dist/types/primitives/icon/svg/copy.d.mts +4 -4
- package/dist/types/primitives/icon/svg/copy.d.ts +4 -4
- package/dist/types/primitives/icon/svg/create-account.d.mts +4 -4
- package/dist/types/primitives/icon/svg/create-account.d.ts +4 -4
- package/dist/types/primitives/icon/svg/credit-card.d.mts +4 -4
- package/dist/types/primitives/icon/svg/credit-card.d.ts +4 -4
- package/dist/types/primitives/icon/svg/cross-circle.d.mts +4 -4
- package/dist/types/primitives/icon/svg/cross-circle.d.ts +4 -4
- package/dist/types/primitives/icon/svg/disconnect.d.mts +4 -4
- package/dist/types/primitives/icon/svg/disconnect.d.ts +4 -4
- package/dist/types/primitives/icon/svg/discord.d.mts +4 -4
- package/dist/types/primitives/icon/svg/discord.d.ts +4 -4
- package/dist/types/primitives/icon/svg/document.d.mts +4 -4
- package/dist/types/primitives/icon/svg/document.d.ts +4 -4
- package/dist/types/primitives/icon/svg/dots-horizontal.d.mts +4 -4
- package/dist/types/primitives/icon/svg/dots-horizontal.d.ts +4 -4
- package/dist/types/primitives/icon/svg/download.d.mts +4 -4
- package/dist/types/primitives/icon/svg/download.d.ts +4 -4
- package/dist/types/primitives/icon/svg/email.d.mts +4 -4
- package/dist/types/primitives/icon/svg/email.d.ts +4 -4
- package/dist/types/primitives/icon/svg/error-filled.d.mts +4 -4
- package/dist/types/primitives/icon/svg/error-filled.d.ts +4 -4
- package/dist/types/primitives/icon/svg/ethereum.d.mts +4 -4
- package/dist/types/primitives/icon/svg/ethereum.d.ts +4 -4
- package/dist/types/primitives/icon/svg/external-link.d.mts +4 -4
- package/dist/types/primitives/icon/svg/external-link.d.ts +4 -4
- package/dist/types/primitives/icon/svg/gift-bonus.d.mts +4 -4
- package/dist/types/primitives/icon/svg/gift-bonus.d.ts +4 -4
- package/dist/types/primitives/icon/svg/google.d.mts +4 -4
- package/dist/types/primitives/icon/svg/google.d.ts +4 -4
- package/dist/types/primitives/icon/svg/hourglass-start.d.mts +4 -4
- package/dist/types/primitives/icon/svg/hourglass-start.d.ts +4 -4
- package/dist/types/primitives/icon/svg/image.d.mts +4 -4
- package/dist/types/primitives/icon/svg/image.d.ts +4 -4
- package/dist/types/primitives/icon/svg/info.d.mts +4 -4
- package/dist/types/primitives/icon/svg/info.d.ts +4 -4
- package/dist/types/primitives/icon/svg/internet-security.d.mts +4 -4
- package/dist/types/primitives/icon/svg/internet-security.d.ts +4 -4
- package/dist/types/primitives/icon/svg/link-accounts.d.mts +4 -4
- package/dist/types/primitives/icon/svg/link-accounts.d.ts +4 -4
- package/dist/types/primitives/icon/svg/lock.d.mts +4 -4
- package/dist/types/primitives/icon/svg/lock.d.ts +4 -4
- package/dist/types/primitives/icon/svg/minus.d.mts +1 -1
- package/dist/types/primitives/icon/svg/minus.d.ts +1 -1
- package/dist/types/primitives/icon/svg/paper-buying-power.d.mts +4 -10
- package/dist/types/primitives/icon/svg/paper-buying-power.d.ts +4 -10
- package/dist/types/primitives/icon/svg/paper-earnings.d.mts +4 -10
- package/dist/types/primitives/icon/svg/paper-earnings.d.ts +4 -10
- package/dist/types/primitives/icon/svg/paper-mode.d.mts +4 -4
- package/dist/types/primitives/icon/svg/paper-mode.d.ts +4 -4
- package/dist/types/primitives/icon/svg/paper-onboarding-funds.d.mts +4 -11
- package/dist/types/primitives/icon/svg/paper-onboarding-funds.d.ts +4 -11
- package/dist/types/primitives/icon/svg/paper-onboarding-markets.d.mts +4 -11
- package/dist/types/primitives/icon/svg/paper-onboarding-markets.d.ts +4 -11
- package/dist/types/primitives/icon/svg/paper-onboarding-performance.d.mts +4 -11
- package/dist/types/primitives/icon/svg/paper-onboarding-performance.d.ts +4 -11
- package/dist/types/primitives/icon/svg/paper-plane.d.mts +4 -4
- package/dist/types/primitives/icon/svg/paper-plane.d.ts +4 -4
- package/dist/types/primitives/icon/svg/pencil.d.mts +4 -4
- package/dist/types/primitives/icon/svg/pencil.d.ts +4 -4
- package/dist/types/primitives/icon/svg/play-square.d.mts +4 -4
- package/dist/types/primitives/icon/svg/play-square.d.ts +4 -4
- package/dist/types/primitives/icon/svg/plus.d.mts +1 -1
- package/dist/types/primitives/icon/svg/plus.d.ts +1 -1
- package/dist/types/primitives/icon/svg/polygon.d.mts +4 -4
- package/dist/types/primitives/icon/svg/polygon.d.ts +4 -4
- package/dist/types/primitives/icon/svg/profile-about-tab.d.mts +4 -5
- package/dist/types/primitives/icon/svg/profile-about-tab.d.ts +4 -5
- package/dist/types/primitives/icon/svg/profile-accounts-wallets-tab.d.mts +4 -5
- package/dist/types/primitives/icon/svg/profile-accounts-wallets-tab.d.ts +4 -5
- package/dist/types/primitives/icon/svg/profile.d.mts +4 -4
- package/dist/types/primitives/icon/svg/profile.d.ts +4 -4
- package/dist/types/primitives/icon/svg/quotes-warning.d.mts +4 -5
- package/dist/types/primitives/icon/svg/quotes-warning.d.ts +4 -5
- package/dist/types/primitives/icon/svg/recenter.d.mts +4 -4
- package/dist/types/primitives/icon/svg/recenter.d.ts +4 -4
- package/dist/types/primitives/icon/svg/revenue-alt.d.mts +4 -4
- package/dist/types/primitives/icon/svg/revenue-alt.d.ts +4 -4
- package/dist/types/primitives/icon/svg/search.d.mts +4 -4
- package/dist/types/primitives/icon/svg/search.d.ts +4 -4
- package/dist/types/primitives/icon/svg/shield-trust.d.mts +4 -4
- package/dist/types/primitives/icon/svg/shield-trust.d.ts +4 -4
- package/dist/types/primitives/icon/svg/solana.d.mts +4 -4
- package/dist/types/primitives/icon/svg/solana.d.ts +4 -4
- package/dist/types/primitives/icon/svg/sort-end-date.d.mts +4 -4
- package/dist/types/primitives/icon/svg/sort-end-date.d.ts +4 -4
- package/dist/types/primitives/icon/svg/sort-top-arbitrage.d.mts +4 -4
- package/dist/types/primitives/icon/svg/sort-top-arbitrage.d.ts +4 -4
- package/dist/types/primitives/icon/svg/sort-volume-24hr.d.mts +4 -4
- package/dist/types/primitives/icon/svg/sort-volume-24hr.d.ts +4 -4
- package/dist/types/primitives/icon/svg/sort-volume.d.mts +4 -4
- package/dist/types/primitives/icon/svg/sort-volume.d.ts +4 -4
- package/dist/types/primitives/icon/svg/sparkles-filled.d.mts +4 -4
- package/dist/types/primitives/icon/svg/sparkles-filled.d.ts +4 -4
- package/dist/types/primitives/icon/svg/spinner.d.mts +4 -4
- package/dist/types/primitives/icon/svg/spinner.d.ts +4 -4
- package/dist/types/primitives/icon/svg/stay-in-control.d.mts +4 -4
- package/dist/types/primitives/icon/svg/stay-in-control.d.ts +4 -4
- package/dist/types/primitives/icon/svg/success-check.d.mts +4 -4
- package/dist/types/primitives/icon/svg/success-check.d.ts +4 -4
- package/dist/types/primitives/icon/svg/telegram.d.mts +4 -4
- package/dist/types/primitives/icon/svg/telegram.d.ts +4 -4
- package/dist/types/primitives/icon/svg/triangle-down.d.mts +4 -4
- package/dist/types/primitives/icon/svg/triangle-down.d.ts +4 -4
- package/dist/types/primitives/icon/svg/triangle-up-filled.d.mts +4 -4
- package/dist/types/primitives/icon/svg/triangle-up-filled.d.ts +4 -4
- package/dist/types/primitives/icon/svg/triangle-up.d.mts +4 -4
- package/dist/types/primitives/icon/svg/triangle-up.d.ts +4 -4
- package/dist/types/primitives/icon/svg/twitter.d.mts +4 -4
- package/dist/types/primitives/icon/svg/twitter.d.ts +4 -4
- package/dist/types/primitives/icon/svg/upload.d.mts +4 -4
- package/dist/types/primitives/icon/svg/upload.d.ts +4 -4
- package/dist/types/primitives/icon/svg/usdc.d.mts +4 -4
- package/dist/types/primitives/icon/svg/usdc.d.ts +4 -4
- package/dist/types/primitives/icon/svg/user-trust.d.mts +4 -4
- package/dist/types/primitives/icon/svg/user-trust.d.ts +4 -4
- package/dist/types/primitives/icon/svg/wallet-avatar.d.mts +1 -1
- package/dist/types/primitives/icon/svg/wallet-avatar.d.ts +1 -1
- package/dist/types/primitives/icon/svg/wallet-filled.d.mts +4 -4
- package/dist/types/primitives/icon/svg/wallet-filled.d.ts +4 -4
- package/dist/types/primitives/icon/svg/wallet.d.mts +4 -4
- package/dist/types/primitives/icon/svg/wallet.d.ts +4 -4
- package/dist/types/primitives/icon/svg/warning-filled.d.mts +4 -4
- package/dist/types/primitives/icon/svg/warning-filled.d.ts +4 -4
- package/dist/types/primitives/icon/svg/warning.d.mts +4 -4
- package/dist/types/primitives/icon/svg/warning.d.ts +4 -4
- package/dist/types/primitives/inline-alert/index.d.mts +4 -5
- package/dist/types/primitives/inline-alert/index.d.ts +4 -5
- package/dist/types/primitives/loading-icon/index.d.mts +4 -5
- package/dist/types/primitives/loading-icon/index.d.ts +4 -5
- package/dist/types/primitives/modal/index.d.mts +12 -9
- package/dist/types/primitives/modal/index.d.ts +12 -9
- package/dist/types/primitives/number-value.d.mts +4 -4
- package/dist/types/primitives/number-value.d.ts +4 -4
- package/dist/types/primitives/remote-image/index.d.mts +4 -5
- package/dist/types/primitives/remote-image/index.d.ts +4 -5
- package/dist/types/primitives/search/index.d.mts +4 -5
- package/dist/types/primitives/search/index.d.ts +4 -5
- package/dist/types/primitives/search/search-empty-icon.d.mts +4 -4
- package/dist/types/primitives/search/search-empty-icon.d.ts +4 -4
- package/dist/types/primitives/select/index.d.mts +4 -5
- package/dist/types/primitives/select/index.d.ts +4 -5
- package/dist/types/primitives/skeleton/index.d.mts +4 -5
- package/dist/types/primitives/skeleton/index.d.ts +4 -5
- package/dist/types/primitives/skeleton/skeleton-block.d.mts +4 -4
- package/dist/types/primitives/skeleton/skeleton-block.d.ts +4 -4
- package/dist/types/primitives/skeleton/views/event-list-item-details-skeleton-view.d.mts +4 -4
- package/dist/types/primitives/skeleton/views/event-list-item-details-skeleton-view.d.ts +4 -4
- package/dist/types/primitives/skeleton/views/event-list-item-skeleton-view.d.mts +4 -10
- package/dist/types/primitives/skeleton/views/event-list-item-skeleton-view.d.ts +4 -10
- package/dist/types/primitives/skeleton/views/event-list-skeleton-view.d.mts +4 -4
- package/dist/types/primitives/skeleton/views/event-list-skeleton-view.d.ts +4 -4
- package/dist/types/primitives/skeleton/views/market-details-skeleton-view.d.mts +5 -5
- package/dist/types/primitives/skeleton/views/market-details-skeleton-view.d.ts +5 -5
- package/dist/types/primitives/skeleton/views/place-order-skeleton-view.d.mts +8 -8
- package/dist/types/primitives/skeleton/views/place-order-skeleton-view.d.ts +8 -8
- package/dist/types/primitives/skeleton/views/search-skeleton-view.d.mts +4 -4
- package/dist/types/primitives/skeleton/views/search-skeleton-view.d.ts +4 -4
- package/dist/types/primitives/skeleton/views/settlement-skeleton-view.d.mts +4 -4
- package/dist/types/primitives/skeleton/views/settlement-skeleton-view.d.ts +4 -4
- package/dist/types/primitives/skeleton/views/user-profile-overview-skeleton-view.d.mts +4 -4
- package/dist/types/primitives/skeleton/views/user-profile-overview-skeleton-view.d.ts +4 -4
- package/dist/types/primitives/skeleton/views/user-profile-positions-activity-skeleton-view.d.mts +4 -4
- package/dist/types/primitives/skeleton/views/user-profile-positions-activity-skeleton-view.d.ts +4 -4
- package/dist/types/primitives/state-message/index.d.mts +4 -5
- package/dist/types/primitives/state-message/index.d.ts +4 -5
- package/dist/types/primitives/switch-button/index.d.mts +4 -5
- package/dist/types/primitives/switch-button/index.d.ts +4 -5
- package/dist/types/primitives/tabs/index.d.mts +4 -5
- package/dist/types/primitives/tabs/index.d.ts +4 -5
- package/dist/types/primitives/toast/index.d.mts +1 -1
- package/dist/types/primitives/toast/index.d.ts +1 -1
- package/dist/types/primitives/tooltip/index.d.mts +4 -5
- package/dist/types/primitives/tooltip/index.d.ts +4 -5
- package/dist/types/primitives/typography/index.d.mts +4 -5
- package/dist/types/primitives/typography/index.d.ts +4 -5
- package/dist/types/primitives/typography/typography.types.d.mts +1 -1
- package/dist/types/primitives/typography/typography.types.d.ts +1 -1
- package/dist/types/primitives/venue-logo/index.d.mts +4 -5
- package/dist/types/primitives/venue-logo/index.d.ts +4 -5
- package/dist/types/primitives/venue-logo/svg/default-venue.d.mts +1 -1
- package/dist/types/primitives/venue-logo/svg/default-venue.d.ts +1 -1
- package/dist/types/primitives/venue-logo/svg/logo-betdex.d.mts +1 -1
- package/dist/types/primitives/venue-logo/svg/logo-betdex.d.ts +1 -1
- package/dist/types/primitives/venue-logo/svg/logo-hyperliquid.d.mts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-hyperliquid.d.ts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-kalshi.d.mts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-kalshi.d.ts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-limitless.d.mts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-limitless.d.ts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-myriad.d.mts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-myriad.d.ts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-novig.d.mts +4 -23
- package/dist/types/primitives/venue-logo/svg/logo-novig.d.ts +4 -23
- package/dist/types/primitives/venue-logo/svg/logo-opinion.d.mts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-opinion.d.ts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-polymarket.d.mts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-polymarket.d.ts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-pred.d.mts +4 -5
- package/dist/types/primitives/venue-logo/svg/logo-pred.d.ts +4 -5
- package/dist/types/primitives/venue-logo/svg/logo-predict.d.mts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-predict.d.ts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-probable.d.mts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-probable.d.ts +4 -4
- package/dist/types/primitives/venue-logo/svg/logo-prophetx.d.mts +4 -26
- package/dist/types/primitives/venue-logo/svg/logo-prophetx.d.ts +4 -26
- package/dist/types/primitives/venue-logo/svg/logo-tiprun.d.mts +4 -5
- package/dist/types/primitives/venue-logo/svg/logo-tiprun.d.ts +4 -5
- package/dist/types/primitives/venue-logo/venue-logo.constants.d.mts +1 -1
- package/dist/types/primitives/venue-logo/venue-logo.constants.d.ts +1 -1
- package/dist/types/profile/index.d.mts +4 -4
- package/dist/types/profile/index.d.ts +4 -4
- package/dist/types/profile/tabs/about-tab.d.mts +4 -4
- package/dist/types/profile/tabs/about-tab.d.ts +4 -4
- package/dist/types/profile/tabs/accounts-wallets-tab.d.mts +4 -4
- package/dist/types/profile/tabs/accounts-wallets-tab.d.ts +4 -4
- package/dist/types/profile/tabs/trading-access-tab.d.mts +4 -4
- package/dist/types/profile/tabs/trading-access-tab.d.ts +4 -4
- package/dist/types/shared/default-avatar.d.mts +4 -4
- package/dist/types/shared/default-avatar.d.ts +4 -4
- package/dist/types/shared/open-orders.d.mts +1 -1
- package/dist/types/shared/open-orders.d.ts +1 -1
- package/dist/types/shared/react-inert.d.mts +1 -0
- package/dist/types/shared/react-inert.d.ts +1 -0
- package/dist/types/shared/transfer-fee-summary.d.mts +1 -1
- package/dist/types/shared/transfer-fee-summary.d.ts +1 -1
- package/dist/types/trading/fund-kalshi-modal.d.mts +4 -4
- package/dist/types/trading/fund-kalshi-modal.d.ts +4 -4
- package/dist/types/trading/manage-betdex-account-modal.d.mts +1 -1
- package/dist/types/trading/manage-betdex-account-modal.d.ts +1 -1
- package/dist/types/trading/place-order/index.d.mts +4 -4
- package/dist/types/trading/place-order/index.d.ts +4 -4
- package/dist/types/trading/place-order/index.place-order.execution-view.d.mts +6 -6
- package/dist/types/trading/place-order/index.place-order.execution-view.d.ts +6 -6
- package/dist/types/trading/place-order/index.place-order.failure.d.mts +4 -4
- package/dist/types/trading/place-order/index.place-order.failure.d.ts +4 -4
- package/dist/types/trading/place-order/index.place-order.success.d.mts +4 -4
- package/dist/types/trading/place-order/index.place-order.success.d.ts +4 -4
- package/dist/types/trading/settlement/index.d.mts +4 -4
- package/dist/types/trading/settlement/index.d.ts +4 -4
- package/dist/types/trading/settlement/settlement-details.d.mts +4 -4
- package/dist/types/trading/settlement/settlement-details.d.ts +4 -4
- package/dist/types/trading/settlement/settlement-text-renderer.d.mts +4 -4
- package/dist/types/trading/settlement/settlement-text-renderer.d.ts +4 -4
- package/dist/types/withdraw/index.d.mts +4 -4
- package/dist/types/withdraw/index.d.ts +4 -4
- package/dist/types/withdraw/steps/withdraw-amount.d.mts +1 -1
- package/dist/types/withdraw/steps/withdraw-amount.d.ts +1 -1
- package/dist/types/withdraw/steps/withdraw-method.d.mts +1 -1
- package/dist/types/withdraw/steps/withdraw-method.d.ts +1 -1
- package/dist/types/withdraw/steps/withdraw-provider.d.mts +1 -1
- package/dist/types/withdraw/steps/withdraw-provider.d.ts +1 -1
- package/dist/types/withdraw/steps/withdraw-success.d.mts +2 -2
- package/dist/types/withdraw/steps/withdraw-success.d.ts +2 -2
- package/package.json +9 -8
- package/dist/chunk-4X7OLBO6.mjs +0 -3551
- package/dist/chunk-7ORC3TUJ.mjs +0 -2883
- package/dist/chunk-JH4B3ZHQ.mjs +0 -1
- package/dist/chunk-KN7JN7F5.mjs +0 -8303
- package/dist/chunk-MDCFCGA3.mjs +0 -2377
- package/dist/chunk-PHT5VLGB.mjs +0 -5789
- package/dist/chunk-W2LCFCW3.mjs +0 -2879
- package/dist/chunk-WOCZ4TVT.mjs +0 -1645
- package/dist/chunk-XZVGHKMW.mjs +0 -11426
- package/dist/chunk-YYGS6S7N.mjs +0 -5180
- package/dist/event-market-Q2LBJJ5E.mjs +0 -21
package/dist/chunk-MDCFCGA3.mjs
DELETED
|
@@ -1,2377 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
isErrorWithStatus
|
|
4
|
-
} from "./chunk-YYGS6S7N.mjs";
|
|
5
|
-
import {
|
|
6
|
-
Badge,
|
|
7
|
-
Card,
|
|
8
|
-
CloseIcon,
|
|
9
|
-
Icon,
|
|
10
|
-
Modal,
|
|
11
|
-
RemoteImage,
|
|
12
|
-
SearchEmptyIcon,
|
|
13
|
-
Select,
|
|
14
|
-
Skeleton,
|
|
15
|
-
StateMessage,
|
|
16
|
-
Tabs,
|
|
17
|
-
Typography,
|
|
18
|
-
VenueLogo,
|
|
19
|
-
__objRest,
|
|
20
|
-
__spreadProps,
|
|
21
|
-
__spreadValues,
|
|
22
|
-
baseCardClassName,
|
|
23
|
-
cn,
|
|
24
|
-
dedupeVenueMarketsById,
|
|
25
|
-
filterEventsByTabValue,
|
|
26
|
-
formatMarketProbabilityPercent,
|
|
27
|
-
formatPriceGapPercent,
|
|
28
|
-
getMotionClassName,
|
|
29
|
-
mapEventToEventListItemEvent,
|
|
30
|
-
normalizeProbability,
|
|
31
|
-
resolveCategoryIdsFromPath,
|
|
32
|
-
resolveDisplayVolume,
|
|
33
|
-
resolveEventHeading,
|
|
34
|
-
resolveEventListItemEvent,
|
|
35
|
-
resolveOutcomeTitle,
|
|
36
|
-
resolveTabVenus,
|
|
37
|
-
resolveVenueLabel,
|
|
38
|
-
resolveYesOutcome,
|
|
39
|
-
sortCategoriesForNavigation,
|
|
40
|
-
sortOutcomes,
|
|
41
|
-
splitEventsByLifecycle,
|
|
42
|
-
validateSubcategoryPath
|
|
43
|
-
} from "./chunk-XZVGHKMW.mjs";
|
|
44
|
-
|
|
45
|
-
// src/events/item/index.tsx
|
|
46
|
-
import {
|
|
47
|
-
optimizedImageUrl,
|
|
48
|
-
retinaImageUrl,
|
|
49
|
-
resolveRecurringCryptoIdentity,
|
|
50
|
-
sortVenues,
|
|
51
|
-
useLabels,
|
|
52
|
-
useMidpoints,
|
|
53
|
-
useSdkUiConfig,
|
|
54
|
-
useVenueEvent,
|
|
55
|
-
useVenueMarketMidpoints,
|
|
56
|
-
useVenueMarkets
|
|
57
|
-
} from "@agg-build/hooks";
|
|
58
|
-
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
59
|
-
|
|
60
|
-
// src/events/item/event-list-item-v2.utils.ts
|
|
61
|
-
var isNonEmptyString = (value) => {
|
|
62
|
-
return typeof value === "string" && value.trim().length > 0;
|
|
63
|
-
};
|
|
64
|
-
var getOutcomeSortPrice = (outcome) => {
|
|
65
|
-
var _a;
|
|
66
|
-
return (_a = normalizeProbability(outcome.price)) != null ? _a : -1;
|
|
67
|
-
};
|
|
68
|
-
var MAX_VISIBLE_OUTCOME_PRICE_PILLS = 3;
|
|
69
|
-
var resolveDisplayOutcome = (market) => {
|
|
70
|
-
var _a;
|
|
71
|
-
return (_a = resolveYesOutcome(market)) != null ? _a : [...market.venueMarketOutcomes].sort((left, right) => {
|
|
72
|
-
return getOutcomeSortPrice(right) - getOutcomeSortPrice(left);
|
|
73
|
-
})[0];
|
|
74
|
-
};
|
|
75
|
-
var resolveOutcomeRows = ({
|
|
76
|
-
venueMarkets,
|
|
77
|
-
marketCount
|
|
78
|
-
}) => {
|
|
79
|
-
if (venueMarkets.length === 0) return [];
|
|
80
|
-
if (marketCount === 1 && venueMarkets.length === 1) {
|
|
81
|
-
const [market] = venueMarkets;
|
|
82
|
-
return sortOutcomes(market.venueMarketOutcomes).map((outcome) => ({
|
|
83
|
-
id: outcome.id,
|
|
84
|
-
label: resolveOutcomeTitle(outcome),
|
|
85
|
-
market,
|
|
86
|
-
outcome
|
|
87
|
-
}));
|
|
88
|
-
}
|
|
89
|
-
return venueMarkets.map((market) => {
|
|
90
|
-
const outcome = resolveDisplayOutcome(market);
|
|
91
|
-
if (!outcome) return void 0;
|
|
92
|
-
return {
|
|
93
|
-
id: market.id,
|
|
94
|
-
label: isNonEmptyString(market.question) ? market.question : resolveOutcomeTitle(outcome),
|
|
95
|
-
market,
|
|
96
|
-
outcome
|
|
97
|
-
};
|
|
98
|
-
}).filter((row) => row != null);
|
|
99
|
-
};
|
|
100
|
-
var collectOutcomePrices = (market, outcome, priceByOutcomeId) => {
|
|
101
|
-
var _a, _b, _c;
|
|
102
|
-
const prices = [];
|
|
103
|
-
const seenOutcomeKeys = /* @__PURE__ */ new Set();
|
|
104
|
-
const addPrice = (priceMarket, priceOutcome) => {
|
|
105
|
-
if (!priceMarket || !priceOutcome) return;
|
|
106
|
-
const resolvedPrice = priceByOutcomeId === void 0 ? priceOutcome.price : priceByOutcomeId.has(priceOutcome.id) ? priceByOutcomeId.get(priceOutcome.id) : void 0;
|
|
107
|
-
const normalizedPrice = normalizeProbability(resolvedPrice);
|
|
108
|
-
if (normalizedPrice == null) return;
|
|
109
|
-
const key = `${priceMarket.id}:${priceOutcome.id}`;
|
|
110
|
-
if (seenOutcomeKeys.has(key)) return;
|
|
111
|
-
seenOutcomeKeys.add(key);
|
|
112
|
-
prices.push({
|
|
113
|
-
venue: priceMarket.venue,
|
|
114
|
-
market: priceMarket,
|
|
115
|
-
outcome: priceOutcome,
|
|
116
|
-
price: normalizedPrice,
|
|
117
|
-
isBest: false
|
|
118
|
-
});
|
|
119
|
-
};
|
|
120
|
-
addPrice(market, outcome);
|
|
121
|
-
for (const matchedOutcomeRef of (_a = outcome.matchedVenueMarketOutcomes) != null ? _a : []) {
|
|
122
|
-
const matchedMarket = (_b = market.matchedVenueMarkets) == null ? void 0 : _b.find((candidate) => {
|
|
123
|
-
return candidate.id === matchedOutcomeRef.venueMarketId;
|
|
124
|
-
});
|
|
125
|
-
const matchedOutcome = (_c = matchedMarket == null ? void 0 : matchedMarket.venueMarketOutcomes) == null ? void 0 : _c.find((candidate) => {
|
|
126
|
-
return candidate.id === matchedOutcomeRef.venueMarketOutcomeId;
|
|
127
|
-
});
|
|
128
|
-
addPrice(matchedMarket, matchedOutcome);
|
|
129
|
-
}
|
|
130
|
-
if (prices.length === 0) return [];
|
|
131
|
-
const bestPriceByVenue = /* @__PURE__ */ new Map();
|
|
132
|
-
for (const price of prices) {
|
|
133
|
-
const existing = bestPriceByVenue.get(price.venue);
|
|
134
|
-
if (!existing || price.price < existing.price) {
|
|
135
|
-
bestPriceByVenue.set(price.venue, price);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
const dedupedPrices = Array.from(bestPriceByVenue.values());
|
|
139
|
-
const sortedPricesByBestOdds = [...dedupedPrices].sort((left, right) => {
|
|
140
|
-
return left.price - right.price;
|
|
141
|
-
});
|
|
142
|
-
const bestPrice = sortedPricesByBestOdds[0];
|
|
143
|
-
if (!bestPrice) return [];
|
|
144
|
-
const visiblePrices = [
|
|
145
|
-
sortedPricesByBestOdds.at(-1),
|
|
146
|
-
sortedPricesByBestOdds[1],
|
|
147
|
-
bestPrice
|
|
148
|
-
].reduce((accumulator, price) => {
|
|
149
|
-
if (!price) return accumulator;
|
|
150
|
-
const isDuplicate = accumulator.some((candidate) => {
|
|
151
|
-
return candidate.market.id === price.market.id && candidate.outcome.id === price.outcome.id;
|
|
152
|
-
});
|
|
153
|
-
if (isDuplicate) return accumulator;
|
|
154
|
-
accumulator.push(price);
|
|
155
|
-
return accumulator;
|
|
156
|
-
}, []);
|
|
157
|
-
return visiblePrices.slice(0, MAX_VISIBLE_OUTCOME_PRICE_PILLS).map((price) => __spreadProps(__spreadValues({}, price), {
|
|
158
|
-
isBest: price.market.id === bestPrice.market.id && price.outcome.id === bestPrice.outcome.id
|
|
159
|
-
}));
|
|
160
|
-
};
|
|
161
|
-
var collectMatchedVenues = (rows) => {
|
|
162
|
-
const venues = /* @__PURE__ */ new Set();
|
|
163
|
-
for (const row of rows) {
|
|
164
|
-
if (row.prices.length < 2) continue;
|
|
165
|
-
for (const price of row.prices) {
|
|
166
|
-
venues.add(price.venue);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
return Array.from(venues);
|
|
170
|
-
};
|
|
171
|
-
var computePriceGapsFromComparisonRows = (rows) => {
|
|
172
|
-
const gapsByVenueMarketId = /* @__PURE__ */ new Map();
|
|
173
|
-
for (const row of rows) {
|
|
174
|
-
if (row.prices.length < 2) continue;
|
|
175
|
-
const prices = row.prices.map((price) => price.price);
|
|
176
|
-
const minPrice = Math.min(...prices);
|
|
177
|
-
const maxPrice = Math.max(...prices);
|
|
178
|
-
if (minPrice <= 0 || maxPrice <= minPrice) continue;
|
|
179
|
-
gapsByVenueMarketId.set(row.market.id, (maxPrice - minPrice) * 100);
|
|
180
|
-
}
|
|
181
|
-
return gapsByVenueMarketId;
|
|
182
|
-
};
|
|
183
|
-
var normalizeEventListItemV2Comparison = ({
|
|
184
|
-
venueMarkets,
|
|
185
|
-
marketCount,
|
|
186
|
-
priceByOutcomeId
|
|
187
|
-
}) => {
|
|
188
|
-
const outcomeRows = resolveOutcomeRows({ venueMarkets, marketCount });
|
|
189
|
-
const rows = outcomeRows.map((row) => {
|
|
190
|
-
const prices = collectOutcomePrices(row.market, row.outcome, priceByOutcomeId);
|
|
191
|
-
return __spreadProps(__spreadValues({}, row), {
|
|
192
|
-
prices
|
|
193
|
-
});
|
|
194
|
-
}).filter((row) => row.prices.length === 0 || row.prices.some((price) => price.price > 0));
|
|
195
|
-
const matchedVenues = collectMatchedVenues(rows);
|
|
196
|
-
return {
|
|
197
|
-
rows,
|
|
198
|
-
matchedVenues,
|
|
199
|
-
hasVenueCompetition: matchedVenues.length > 1
|
|
200
|
-
};
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
// src/events/item/index.tsx
|
|
204
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
205
|
-
var EventListItemLoadingState = ({
|
|
206
|
-
classNames,
|
|
207
|
-
ariaLabel
|
|
208
|
-
}) => {
|
|
209
|
-
const labels = useLabels();
|
|
210
|
-
return /* @__PURE__ */ jsx(
|
|
211
|
-
Skeleton,
|
|
212
|
-
{
|
|
213
|
-
view: "event-list-item",
|
|
214
|
-
className: classNames == null ? void 0 : classNames.root,
|
|
215
|
-
ariaLabel: ariaLabel != null ? ariaLabel : labels.eventItem.loading
|
|
216
|
-
}
|
|
217
|
-
);
|
|
218
|
-
};
|
|
219
|
-
var EventListItemUnavailableState = ({
|
|
220
|
-
classNames,
|
|
221
|
-
ariaLabel
|
|
222
|
-
}) => {
|
|
223
|
-
const labels = useLabels();
|
|
224
|
-
return /* @__PURE__ */ jsx(
|
|
225
|
-
Card,
|
|
226
|
-
{
|
|
227
|
-
className: cn(
|
|
228
|
-
"group/agg-event-card agg-event-card-unavailable",
|
|
229
|
-
baseCardClassName,
|
|
230
|
-
classNames == null ? void 0 : classNames.root
|
|
231
|
-
),
|
|
232
|
-
role: "status",
|
|
233
|
-
"aria-label": ariaLabel != null ? ariaLabel : labels.eventItem.unavailableAria,
|
|
234
|
-
children: /* @__PURE__ */ jsxs("div", { className: cn("agg-event-card-header min-h-12 flex flex-col gap-1", classNames == null ? void 0 : classNames.header), children: [
|
|
235
|
-
/* @__PURE__ */ jsx(
|
|
236
|
-
Typography,
|
|
237
|
-
{
|
|
238
|
-
variant: "body-large-strong",
|
|
239
|
-
className: cn("agg-event-title truncate", classNames == null ? void 0 : classNames.title),
|
|
240
|
-
children: labels.eventItem.unavailableTitle
|
|
241
|
-
}
|
|
242
|
-
),
|
|
243
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-agg-muted-foreground", children: labels.eventItem.unavailableDescription })
|
|
244
|
-
] })
|
|
245
|
-
}
|
|
246
|
-
);
|
|
247
|
-
};
|
|
248
|
-
var EventListItemNotFoundState = ({
|
|
249
|
-
classNames: _classNames,
|
|
250
|
-
ariaLabel: _ariaLabel
|
|
251
|
-
}) => {
|
|
252
|
-
const labels = useLabels();
|
|
253
|
-
return /* @__PURE__ */ jsx(
|
|
254
|
-
StateMessage,
|
|
255
|
-
{
|
|
256
|
-
title: labels.eventItemDetails.notFoundTitle,
|
|
257
|
-
description: labels.eventItemDetails.notFoundDescription,
|
|
258
|
-
icon: /* @__PURE__ */ jsx(SearchEmptyIcon, {}),
|
|
259
|
-
classNames: { root: "agg-event-card-state min-h-[280px] md:min-h-[320px]" }
|
|
260
|
-
}
|
|
261
|
-
);
|
|
262
|
-
};
|
|
263
|
-
var OUTCOMES_SCROLL_LOAD_THRESHOLD_PX = 16;
|
|
264
|
-
var OUTCOMES_SCROLL_STATE_EPSILON_PX = 1;
|
|
265
|
-
var OUTCOMES_SCROLL_MASK_HEIGHT_PX = 24;
|
|
266
|
-
var MARKET_ID_QUERY_PARAM = "marketId";
|
|
267
|
-
var OUTCOME_ID_QUERY_PARAM = "outcomeId";
|
|
268
|
-
var OUTCOME_ROW_SELECTOR = ".agg-outcome-row";
|
|
269
|
-
var DEFAULT_OUTCOMES_SCROLL_STATE = {
|
|
270
|
-
hasOverflow: false,
|
|
271
|
-
isAtTop: true,
|
|
272
|
-
isAtBottom: true,
|
|
273
|
-
remainingMarkets: 0
|
|
274
|
-
};
|
|
275
|
-
var areOutcomesScrollStatesEqual = (left, right) => {
|
|
276
|
-
return left.hasOverflow === right.hasOverflow && left.isAtTop === right.isAtTop && left.isAtBottom === right.isAtBottom && left.remainingMarkets === right.remainingMarkets;
|
|
277
|
-
};
|
|
278
|
-
var useOutcomesScrollState = ({
|
|
279
|
-
totalMarketCount,
|
|
280
|
-
onReachScrollThreshold
|
|
281
|
-
}) => {
|
|
282
|
-
const containerRef = useRef(null);
|
|
283
|
-
const frameRef = useRef(null);
|
|
284
|
-
const scrollStateRef = useRef(DEFAULT_OUTCOMES_SCROLL_STATE);
|
|
285
|
-
const [scrollState, setScrollState] = useState(
|
|
286
|
-
DEFAULT_OUTCOMES_SCROLL_STATE
|
|
287
|
-
);
|
|
288
|
-
const measureScrollState = useCallback(() => {
|
|
289
|
-
frameRef.current = null;
|
|
290
|
-
const element = containerRef.current;
|
|
291
|
-
if (!element) return;
|
|
292
|
-
const { clientHeight, scrollHeight, scrollTop } = element;
|
|
293
|
-
const hasOverflow = scrollHeight > clientHeight + OUTCOMES_SCROLL_STATE_EPSILON_PX;
|
|
294
|
-
const isAtTop = scrollTop <= OUTCOMES_SCROLL_STATE_EPSILON_PX;
|
|
295
|
-
const isAtBottom = !hasOverflow || scrollTop + clientHeight >= scrollHeight - OUTCOMES_SCROLL_STATE_EPSILON_PX;
|
|
296
|
-
const loadedRows = Array.from(element.querySelectorAll(OUTCOME_ROW_SELECTOR));
|
|
297
|
-
const visibleMarketCount = loadedRows.reduce((count, row) => {
|
|
298
|
-
return count + (row.offsetTop < clientHeight - OUTCOMES_SCROLL_STATE_EPSILON_PX ? 1 : 0);
|
|
299
|
-
}, 0);
|
|
300
|
-
const remainingMarkets = hasOverflow ? Math.max(0, totalMarketCount - visibleMarketCount) : 0;
|
|
301
|
-
const nextScrollState = {
|
|
302
|
-
hasOverflow,
|
|
303
|
-
isAtTop,
|
|
304
|
-
isAtBottom,
|
|
305
|
-
remainingMarkets
|
|
306
|
-
};
|
|
307
|
-
if (!areOutcomesScrollStatesEqual(scrollStateRef.current, nextScrollState)) {
|
|
308
|
-
scrollStateRef.current = nextScrollState;
|
|
309
|
-
setScrollState(nextScrollState);
|
|
310
|
-
}
|
|
311
|
-
const distanceToBottom = scrollHeight - scrollTop - clientHeight;
|
|
312
|
-
if (distanceToBottom <= OUTCOMES_SCROLL_LOAD_THRESHOLD_PX) {
|
|
313
|
-
onReachScrollThreshold == null ? void 0 : onReachScrollThreshold();
|
|
314
|
-
}
|
|
315
|
-
}, [onReachScrollThreshold, totalMarketCount]);
|
|
316
|
-
const updateScrollState = useCallback(() => {
|
|
317
|
-
if (frameRef.current != null) return;
|
|
318
|
-
frameRef.current = window.requestAnimationFrame(measureScrollState);
|
|
319
|
-
}, [measureScrollState]);
|
|
320
|
-
useEffect(() => {
|
|
321
|
-
const element = containerRef.current;
|
|
322
|
-
if (!element) return;
|
|
323
|
-
element.addEventListener("scroll", updateScrollState, { passive: true });
|
|
324
|
-
let resizeObserver = null;
|
|
325
|
-
if (typeof ResizeObserver !== "undefined") {
|
|
326
|
-
resizeObserver = new ResizeObserver(() => {
|
|
327
|
-
updateScrollState();
|
|
328
|
-
});
|
|
329
|
-
resizeObserver.observe(element);
|
|
330
|
-
}
|
|
331
|
-
updateScrollState();
|
|
332
|
-
return () => {
|
|
333
|
-
element.removeEventListener("scroll", updateScrollState);
|
|
334
|
-
resizeObserver == null ? void 0 : resizeObserver.disconnect();
|
|
335
|
-
if (frameRef.current != null) {
|
|
336
|
-
window.cancelAnimationFrame(frameRef.current);
|
|
337
|
-
frameRef.current = null;
|
|
338
|
-
}
|
|
339
|
-
};
|
|
340
|
-
}, [updateScrollState]);
|
|
341
|
-
return { containerRef, scrollState, updateScrollState };
|
|
342
|
-
};
|
|
343
|
-
var buildOutcomeMidpointsByOutcomeId = (midpointRows) => {
|
|
344
|
-
const outcomeMidpointsByOutcomeId = /* @__PURE__ */ new Map();
|
|
345
|
-
const addOutcomeMidpoints = (value) => {
|
|
346
|
-
var _a, _b;
|
|
347
|
-
if (!value || typeof value !== "object") return;
|
|
348
|
-
const row = value;
|
|
349
|
-
for (const outcome of (_a = row.outcomes) != null ? _a : []) {
|
|
350
|
-
if (outcome.midpoint == null) continue;
|
|
351
|
-
outcomeMidpointsByOutcomeId.set(outcome.venueMarketOutcomeId, outcome.midpoint);
|
|
352
|
-
}
|
|
353
|
-
for (const matchedRow of (_b = row.matched) != null ? _b : []) {
|
|
354
|
-
addOutcomeMidpoints(matchedRow);
|
|
355
|
-
}
|
|
356
|
-
};
|
|
357
|
-
for (const row of midpointRows) {
|
|
358
|
-
addOutcomeMidpoints(row);
|
|
359
|
-
}
|
|
360
|
-
return outcomeMidpointsByOutcomeId;
|
|
361
|
-
};
|
|
362
|
-
var buildArbReturnByVenueMarketId = (midpointRows) => {
|
|
363
|
-
const arbReturnByVenueMarketId = /* @__PURE__ */ new Map();
|
|
364
|
-
const addArbReturn = (value) => {
|
|
365
|
-
var _a, _b;
|
|
366
|
-
if (!value || typeof value !== "object") return;
|
|
367
|
-
const row = value;
|
|
368
|
-
if (row.venueMarketId && !arbReturnByVenueMarketId.has(row.venueMarketId)) {
|
|
369
|
-
arbReturnByVenueMarketId.set(row.venueMarketId, (_a = row.arbReturn) != null ? _a : null);
|
|
370
|
-
}
|
|
371
|
-
for (const matchedRow of (_b = row.matched) != null ? _b : []) {
|
|
372
|
-
addArbReturn(matchedRow);
|
|
373
|
-
}
|
|
374
|
-
};
|
|
375
|
-
for (const row of midpointRows) {
|
|
376
|
-
addArbReturn(row);
|
|
377
|
-
}
|
|
378
|
-
return arbReturnByVenueMarketId;
|
|
379
|
-
};
|
|
380
|
-
var resolveMarketHrefFromEventHref = (eventHref, marketId, outcomeId) => {
|
|
381
|
-
if (!eventHref) return void 0;
|
|
382
|
-
if (typeof window === "undefined") return void 0;
|
|
383
|
-
try {
|
|
384
|
-
const url = new URL(eventHref, window.location.origin);
|
|
385
|
-
url.searchParams.set(MARKET_ID_QUERY_PARAM, marketId);
|
|
386
|
-
url.searchParams.set(OUTCOME_ID_QUERY_PARAM, outcomeId);
|
|
387
|
-
return url.toString();
|
|
388
|
-
} catch (e) {
|
|
389
|
-
return void 0;
|
|
390
|
-
}
|
|
391
|
-
};
|
|
392
|
-
var EventListItemContent = ({
|
|
393
|
-
event,
|
|
394
|
-
classNames,
|
|
395
|
-
arbitrageByOutcomeId,
|
|
396
|
-
midpointPrices,
|
|
397
|
-
midpointRows: sharedMidpointRows,
|
|
398
|
-
midpointsLoading,
|
|
399
|
-
onEventClick,
|
|
400
|
-
onMarketClick,
|
|
401
|
-
getMarketHref,
|
|
402
|
-
href,
|
|
403
|
-
ariaLabel,
|
|
404
|
-
marketStatus
|
|
405
|
-
}) => {
|
|
406
|
-
var _a;
|
|
407
|
-
const config = useSdkUiConfig();
|
|
408
|
-
const labels = useLabels();
|
|
409
|
-
const allVenueMarkets = useMemo(() => event.venueMarkets, [event.venueMarkets]);
|
|
410
|
-
const recurringCryptoIdentity = resolveRecurringCryptoIdentity(event);
|
|
411
|
-
const eventHeading = resolveEventHeading({
|
|
412
|
-
title: event.title,
|
|
413
|
-
categories: event.categories,
|
|
414
|
-
structureType: event.structureType,
|
|
415
|
-
gameStartTime: event.gameStartTime,
|
|
416
|
-
endDate: event.endDate,
|
|
417
|
-
venueMarkets: event.venueMarkets,
|
|
418
|
-
recurringCryptoWindowStart: recurringCryptoIdentity == null ? void 0 : recurringCryptoIdentity.windowStart,
|
|
419
|
-
recurringCryptoDuration: recurringCryptoIdentity == null ? void 0 : recurringCryptoIdentity.duration
|
|
420
|
-
});
|
|
421
|
-
const resolvedTitle = eventHeading.title;
|
|
422
|
-
const resolvedTimestamp = eventHeading.timestampLabel;
|
|
423
|
-
const resolvedImage = event.image;
|
|
424
|
-
const visibleVenueLogos = useMemo(() => {
|
|
425
|
-
var _a2;
|
|
426
|
-
return sortVenues(Array.from(new Set(((_a2 = event.venues) != null ? _a2 : []).map((venue) => venue))));
|
|
427
|
-
}, [event.venues]);
|
|
428
|
-
const resolvedMarketCount = typeof event.marketCount === "number" && Number.isFinite(event.marketCount) ? Math.max(0, Math.floor(event.marketCount)) : allVenueMarkets.length;
|
|
429
|
-
const resolvedVenueCount = typeof event.venueCount === "number" && Number.isFinite(event.venueCount) ? Math.max(0, Math.floor(event.venueCount)) : visibleVenueLogos.length;
|
|
430
|
-
const [isLazyMarketsQueryEnabled, setIsLazyMarketsQueryEnabled] = useState(false);
|
|
431
|
-
const shouldEnableLazyMarketLoading = useMemo(() => {
|
|
432
|
-
if (!event.id) return false;
|
|
433
|
-
const hasExplicitMarketCount = typeof event.marketCount === "number" && Number.isFinite(event.marketCount);
|
|
434
|
-
if (hasExplicitMarketCount) {
|
|
435
|
-
return resolvedMarketCount > allVenueMarkets.length;
|
|
436
|
-
}
|
|
437
|
-
return allVenueMarkets.length > 1;
|
|
438
|
-
}, [allVenueMarkets.length, event.id, event.marketCount, resolvedMarketCount]);
|
|
439
|
-
const {
|
|
440
|
-
markets: lazyLoadedMarkets,
|
|
441
|
-
fetchNextPage: fetchNextLazyMarketsPage,
|
|
442
|
-
hasNextPage: hasNextLazyMarketsPage,
|
|
443
|
-
isLoading: isLoadingLazyMarkets,
|
|
444
|
-
isFetchingNextPage: isFetchingNextLazyMarketsPage
|
|
445
|
-
} = useVenueMarkets({
|
|
446
|
-
venueEventId: event.id,
|
|
447
|
-
enabled: shouldEnableLazyMarketLoading && isLazyMarketsQueryEnabled,
|
|
448
|
-
// List/tile surface: axis/dates sort by volume so the scroll tail matches
|
|
449
|
-
// the volume-sorted top-3 (the detail page omits context and keeps the
|
|
450
|
-
// structured threshold/date order).
|
|
451
|
-
context: "list",
|
|
452
|
-
status: marketStatus,
|
|
453
|
-
minVolume: config.market.minVolume
|
|
454
|
-
});
|
|
455
|
-
const resolvedOutcomeMarkets = useMemo(() => {
|
|
456
|
-
if (!isLazyMarketsQueryEnabled || lazyLoadedMarkets.length === 0) return allVenueMarkets;
|
|
457
|
-
return dedupeVenueMarketsById([...allVenueMarkets, ...lazyLoadedMarkets]);
|
|
458
|
-
}, [allVenueMarkets, isLazyMarketsQueryEnabled, lazyLoadedMarkets]);
|
|
459
|
-
const hasExpandedMarkets = isLazyMarketsQueryEnabled && lazyLoadedMarkets.length > 0;
|
|
460
|
-
const shouldUseSharedMidpoints = !hasExpandedMarkets && (midpointPrices !== void 0 || sharedMidpointRows !== void 0 || midpointsLoading !== void 0);
|
|
461
|
-
const midpointVenueMarketIds = useMemo(() => {
|
|
462
|
-
var _a2;
|
|
463
|
-
const ids = [];
|
|
464
|
-
for (const market of resolvedOutcomeMarkets) {
|
|
465
|
-
ids.push(market.id);
|
|
466
|
-
for (const sibling of (_a2 = market.matchedVenueMarkets) != null ? _a2 : []) {
|
|
467
|
-
ids.push(sibling.id);
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
return [...new Set(ids)];
|
|
471
|
-
}, [resolvedOutcomeMarkets]);
|
|
472
|
-
const { midpointRows: fetchedMidpointRows, isLoading: isVenueMarketMidpointsLoading } = useVenueMarketMidpoints({
|
|
473
|
-
venueMarketIds: shouldUseSharedMidpoints ? [] : midpointVenueMarketIds,
|
|
474
|
-
enabled: !shouldUseSharedMidpoints && midpointVenueMarketIds.length > 0
|
|
475
|
-
});
|
|
476
|
-
const { prices: displayMidpointsByOutcomeId, isLoading: isOutcomeMidpointsLoading } = useMidpoints(shouldUseSharedMidpoints ? [] : resolvedOutcomeMarkets);
|
|
477
|
-
const resolvedMidpointRows = useMemo(
|
|
478
|
-
() => shouldUseSharedMidpoints ? sharedMidpointRows != null ? sharedMidpointRows : [] : fetchedMidpointRows,
|
|
479
|
-
[fetchedMidpointRows, sharedMidpointRows, shouldUseSharedMidpoints]
|
|
480
|
-
);
|
|
481
|
-
const resolvedDisplayMidpointsByOutcomeId = useMemo(
|
|
482
|
-
() => shouldUseSharedMidpoints ? midpointPrices != null ? midpointPrices : /* @__PURE__ */ new Map() : displayMidpointsByOutcomeId,
|
|
483
|
-
[displayMidpointsByOutcomeId, midpointPrices, shouldUseSharedMidpoints]
|
|
484
|
-
);
|
|
485
|
-
const isAwaitingMidpoints = midpointsLoading != null ? midpointsLoading : isOutcomeMidpointsLoading || midpointVenueMarketIds.length > 0 && isVenueMarketMidpointsLoading;
|
|
486
|
-
const displayPriceByOutcomeId = useMemo(() => {
|
|
487
|
-
const priceByOutcomeId = new Map(resolvedDisplayMidpointsByOutcomeId);
|
|
488
|
-
for (const [outcomeId, price] of buildOutcomeMidpointsByOutcomeId(resolvedMidpointRows)) {
|
|
489
|
-
priceByOutcomeId.set(outcomeId, price);
|
|
490
|
-
}
|
|
491
|
-
return priceByOutcomeId;
|
|
492
|
-
}, [resolvedDisplayMidpointsByOutcomeId, resolvedMidpointRows]);
|
|
493
|
-
const comparison = useMemo(() => {
|
|
494
|
-
return normalizeEventListItemV2Comparison({
|
|
495
|
-
venueMarkets: resolvedOutcomeMarkets,
|
|
496
|
-
marketCount: resolvedMarketCount,
|
|
497
|
-
priceByOutcomeId: displayPriceByOutcomeId
|
|
498
|
-
});
|
|
499
|
-
}, [displayPriceByOutcomeId, resolvedMarketCount, resolvedOutcomeMarkets]);
|
|
500
|
-
const gapsByVenueMarketId = useMemo(() => {
|
|
501
|
-
return computePriceGapsFromComparisonRows(comparison.rows);
|
|
502
|
-
}, [comparison.rows]);
|
|
503
|
-
const arbReturnByVenueMarketId = useMemo(() => {
|
|
504
|
-
return buildArbReturnByVenueMarketId(resolvedMidpointRows);
|
|
505
|
-
}, [resolvedMidpointRows]);
|
|
506
|
-
const shouldRenderLoadingOutcomeRow = shouldEnableLazyMarketLoading && (!isLazyMarketsQueryEnabled || isLoadingLazyMarkets || isFetchingNextLazyMarketsPage || hasNextLazyMarketsPage);
|
|
507
|
-
const resolvedVolume = (_a = resolveDisplayVolume(event.volume, allVenueMarkets)) != null ? _a : 0;
|
|
508
|
-
const volumeLabel = `${config.formatting.formatCompactCurrency(resolvedVolume)} ${labels.eventItem.volumeSuffix}`;
|
|
509
|
-
const orderedFooterVenues = useMemo(() => {
|
|
510
|
-
const venues = visibleVenueLogos.length > 0 ? visibleVenueLogos : comparison.matchedVenues.length > 0 ? comparison.matchedVenues : event.venue ? [event.venue] : [];
|
|
511
|
-
return Array.from(new Set(venues));
|
|
512
|
-
}, [comparison.matchedVenues, event.venue, visibleVenueLogos]);
|
|
513
|
-
const shouldShowMatchedVenueSummary = resolvedVenueCount > 1 || orderedFooterVenues.length > 1;
|
|
514
|
-
const visibleFooterVenues = shouldShowMatchedVenueSummary ? orderedFooterVenues : orderedFooterVenues.slice(0, 1);
|
|
515
|
-
const singleFooterVenue = shouldShowMatchedVenueSummary ? void 0 : visibleFooterVenues[0];
|
|
516
|
-
const matchedCountLabel = labels.eventItem.matchedCount(
|
|
517
|
-
Math.max(resolvedVenueCount, visibleFooterVenues.length)
|
|
518
|
-
);
|
|
519
|
-
const handleOutcomesScrollThreshold = useCallback(() => {
|
|
520
|
-
if (!shouldEnableLazyMarketLoading) return;
|
|
521
|
-
if (!isLazyMarketsQueryEnabled) {
|
|
522
|
-
setIsLazyMarketsQueryEnabled(true);
|
|
523
|
-
return;
|
|
524
|
-
}
|
|
525
|
-
if (!hasNextLazyMarketsPage) return;
|
|
526
|
-
if (isLoadingLazyMarkets || isFetchingNextLazyMarketsPage) return;
|
|
527
|
-
void fetchNextLazyMarketsPage();
|
|
528
|
-
}, [
|
|
529
|
-
fetchNextLazyMarketsPage,
|
|
530
|
-
hasNextLazyMarketsPage,
|
|
531
|
-
isFetchingNextLazyMarketsPage,
|
|
532
|
-
isLazyMarketsQueryEnabled,
|
|
533
|
-
isLoadingLazyMarkets,
|
|
534
|
-
shouldEnableLazyMarketLoading
|
|
535
|
-
]);
|
|
536
|
-
const {
|
|
537
|
-
containerRef: outcomesContainerRef,
|
|
538
|
-
scrollState: outcomesScrollState,
|
|
539
|
-
updateScrollState
|
|
540
|
-
} = useOutcomesScrollState({
|
|
541
|
-
totalMarketCount: resolvedMarketCount,
|
|
542
|
-
onReachScrollThreshold: handleOutcomesScrollThreshold
|
|
543
|
-
});
|
|
544
|
-
const shouldUseNativeLinkNavigation = (eventToHandle) => {
|
|
545
|
-
return eventToHandle.metaKey || eventToHandle.ctrlKey || eventToHandle.shiftKey || eventToHandle.altKey || eventToHandle.button === 1;
|
|
546
|
-
};
|
|
547
|
-
const handleClick = (eventToHandle) => {
|
|
548
|
-
if (!eventToHandle) {
|
|
549
|
-
onEventClick == null ? void 0 : onEventClick(event);
|
|
550
|
-
return;
|
|
551
|
-
}
|
|
552
|
-
if (!href) {
|
|
553
|
-
onEventClick == null ? void 0 : onEventClick(event);
|
|
554
|
-
return;
|
|
555
|
-
}
|
|
556
|
-
if (shouldUseNativeLinkNavigation(eventToHandle)) {
|
|
557
|
-
return;
|
|
558
|
-
}
|
|
559
|
-
if (!onEventClick) {
|
|
560
|
-
return;
|
|
561
|
-
}
|
|
562
|
-
eventToHandle.preventDefault();
|
|
563
|
-
eventToHandle.stopPropagation();
|
|
564
|
-
onEventClick(event);
|
|
565
|
-
};
|
|
566
|
-
const handleOutcomeBadgeClick = (eventToHandle, market, outcome, marketHref) => {
|
|
567
|
-
eventToHandle.preventDefault();
|
|
568
|
-
eventToHandle.stopPropagation();
|
|
569
|
-
if (marketHref && shouldUseNativeLinkNavigation(eventToHandle)) {
|
|
570
|
-
window.open(marketHref, "_blank", "noopener,noreferrer");
|
|
571
|
-
return;
|
|
572
|
-
}
|
|
573
|
-
if (onMarketClick) {
|
|
574
|
-
onMarketClick(event, market, outcome);
|
|
575
|
-
return;
|
|
576
|
-
}
|
|
577
|
-
if (marketHref) {
|
|
578
|
-
window.location.assign(marketHref);
|
|
579
|
-
}
|
|
580
|
-
};
|
|
581
|
-
const handleKeyDown = (eventToHandle) => {
|
|
582
|
-
if (href) {
|
|
583
|
-
if ((eventToHandle == null ? void 0 : eventToHandle.key) === " ") {
|
|
584
|
-
eventToHandle == null ? void 0 : eventToHandle.preventDefault();
|
|
585
|
-
eventToHandle.currentTarget.click();
|
|
586
|
-
}
|
|
587
|
-
return;
|
|
588
|
-
}
|
|
589
|
-
if (!onEventClick) return;
|
|
590
|
-
if ((eventToHandle == null ? void 0 : eventToHandle.key) === "Enter" || (eventToHandle == null ? void 0 : eventToHandle.key) === " ") {
|
|
591
|
-
eventToHandle == null ? void 0 : eventToHandle.preventDefault();
|
|
592
|
-
onEventClick == null ? void 0 : onEventClick(event);
|
|
593
|
-
}
|
|
594
|
-
};
|
|
595
|
-
useEffect(() => {
|
|
596
|
-
updateScrollState();
|
|
597
|
-
}, [comparison.rows.length, shouldRenderLoadingOutcomeRow, updateScrollState]);
|
|
598
|
-
const renderArbitrage = (value) => {
|
|
599
|
-
if (value == null) return null;
|
|
600
|
-
if (Math.abs(value) < config.market.arbitrageThreshold) return null;
|
|
601
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-1", "text-agg-success"), children: [
|
|
602
|
-
/* @__PURE__ */ jsx(Typography, { variant: "label-strong", className: "text-agg-success", children: config.formatting.formatPercent(value) }),
|
|
603
|
-
/* @__PURE__ */ jsx(
|
|
604
|
-
Icon,
|
|
605
|
-
{
|
|
606
|
-
name: "triangle-up",
|
|
607
|
-
size: "small",
|
|
608
|
-
title: labels.eventItem.arbitrage,
|
|
609
|
-
className: "size-2!"
|
|
610
|
-
}
|
|
611
|
-
)
|
|
612
|
-
] });
|
|
613
|
-
};
|
|
614
|
-
const renderPriceStripSkeleton = (count) => {
|
|
615
|
-
const safeCount = Math.max(1, Math.min(count || 1, 3));
|
|
616
|
-
const collapsedCount = safeCount - 1;
|
|
617
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
618
|
-
Array.from({ length: collapsedCount }).map((_, index) => /* @__PURE__ */ jsx(
|
|
619
|
-
"span",
|
|
620
|
-
{
|
|
621
|
-
"aria-hidden": "true",
|
|
622
|
-
className: cn(
|
|
623
|
-
"agg-outcome-price-loading agg-outcome-price-loading-collapsed",
|
|
624
|
-
"h-[30px] w-[30px] shrink-0 rounded-agg-full bg-agg-separator animate-pulse",
|
|
625
|
-
index > 0 && "-ml-3"
|
|
626
|
-
)
|
|
627
|
-
},
|
|
628
|
-
`agg-outcome-price-loading-collapsed-${index}`
|
|
629
|
-
)),
|
|
630
|
-
/* @__PURE__ */ jsx(
|
|
631
|
-
"span",
|
|
632
|
-
{
|
|
633
|
-
"aria-hidden": "true",
|
|
634
|
-
className: cn(
|
|
635
|
-
"agg-outcome-price-loading agg-outcome-price-loading-best",
|
|
636
|
-
"h-[30px] w-[68px] shrink-0 rounded-agg-full bg-agg-separator animate-pulse",
|
|
637
|
-
collapsedCount > 0 && "ml-2"
|
|
638
|
-
)
|
|
639
|
-
}
|
|
640
|
-
)
|
|
641
|
-
] });
|
|
642
|
-
};
|
|
643
|
-
const renderPriceGapPill = (value, source = "percent") => {
|
|
644
|
-
if (!config.features.enablePriceGap) return null;
|
|
645
|
-
if (isAwaitingMidpoints) return null;
|
|
646
|
-
const formattedPriceGap = formatPriceGapPercent(value, source);
|
|
647
|
-
if (!formattedPriceGap) return null;
|
|
648
|
-
return /* @__PURE__ */ jsxs(
|
|
649
|
-
"span",
|
|
650
|
-
{
|
|
651
|
-
className: cn(
|
|
652
|
-
"agg-price-gap-pill",
|
|
653
|
-
"inline-flex max-w-[52px] shrink-0 items-center gap-1 overflow-hidden whitespace-nowrap",
|
|
654
|
-
"text-agg-2xs font-agg-bold leading-agg-14 text-agg-success",
|
|
655
|
-
"opacity-100 transition-all duration-200 ease-out",
|
|
656
|
-
"group-hover/agg-event-card:mr-0 group-hover/agg-event-card:max-w-0 group-hover/agg-event-card:opacity-0"
|
|
657
|
-
),
|
|
658
|
-
title: labels.eventItem.priceGap,
|
|
659
|
-
"aria-label": `${formattedPriceGap} ${labels.eventItem.priceGap}`,
|
|
660
|
-
children: [
|
|
661
|
-
/* @__PURE__ */ jsx(
|
|
662
|
-
"i",
|
|
663
|
-
{
|
|
664
|
-
"aria-hidden": "true",
|
|
665
|
-
className: "fi-rr-arrow-down inline-flex size-3! shrink-0 items-center justify-center text-agg-xs text-agg-success"
|
|
666
|
-
}
|
|
667
|
-
),
|
|
668
|
-
/* @__PURE__ */ jsx("span", { children: formattedPriceGap })
|
|
669
|
-
]
|
|
670
|
-
}
|
|
671
|
-
);
|
|
672
|
-
};
|
|
673
|
-
const renderComparisonPriceBadge = (row, price, priceIndex) => {
|
|
674
|
-
var _a2;
|
|
675
|
-
const marketHref = (_a2 = getMarketHref == null ? void 0 : getMarketHref(event, row.market, row.outcome)) != null ? _a2 : resolveMarketHrefFromEventHref(href, row.market.id, row.outcome.id);
|
|
676
|
-
const isInteractive = Boolean(onMarketClick || marketHref);
|
|
677
|
-
const hasVenueCompetition = row.prices.length > 1;
|
|
678
|
-
const isHighlightedBestPrice = hasVenueCompetition && price.isBest;
|
|
679
|
-
const shouldCollapsePriceText = hasVenueCompetition && !isHighlightedBestPrice;
|
|
680
|
-
return /* @__PURE__ */ jsx(
|
|
681
|
-
Badge,
|
|
682
|
-
{
|
|
683
|
-
text: formatMarketProbabilityPercent(price.price, config.formatting.formatPercent),
|
|
684
|
-
prefix: /* @__PURE__ */ jsx(
|
|
685
|
-
VenueLogo,
|
|
686
|
-
{
|
|
687
|
-
venue: price.venue,
|
|
688
|
-
size: "small",
|
|
689
|
-
isMonochromatic: !isHighlightedBestPrice,
|
|
690
|
-
className: cn(!isHighlightedBestPrice && "text-agg-muted-foreground!")
|
|
691
|
-
}
|
|
692
|
-
),
|
|
693
|
-
size: "small",
|
|
694
|
-
classNames: {
|
|
695
|
-
root: cn(
|
|
696
|
-
"agg-outcome-price",
|
|
697
|
-
"h-[30px] justify-center overflow-hidden px-0 text-agg-sm leading-agg-5",
|
|
698
|
-
"shrink-0 p-0! transition-all duration-300 ease-out",
|
|
699
|
-
isHighlightedBestPrice ? "agg-outcome-price-best ml-2 w-[68px] min-w-[68px] shadow-none" : cn(
|
|
700
|
-
"bg-agg-secondary-hover hover:bg-agg-tertiary",
|
|
701
|
-
hasVenueCompetition ? "agg-outcome-price-collapsed relative box-border w-[30px] min-w-[30px] group-hover/agg-event-card:w-[68px] group-hover/agg-event-card:min-w-[68px] group-hover/agg-event-card:gap-1" : "w-[68px] min-w-[68px]",
|
|
702
|
-
hasVenueCompetition && priceIndex > 0 && "-ml-3 group-hover/agg-event-card:ml-2"
|
|
703
|
-
),
|
|
704
|
-
isInteractive && "cursor-pointer",
|
|
705
|
-
classNames == null ? void 0 : classNames.badge
|
|
706
|
-
),
|
|
707
|
-
prefix: cn(
|
|
708
|
-
"flex shrink-0 items-center justify-center [&>svg]:size-3.5",
|
|
709
|
-
shouldCollapsePriceText && "pointer-events-none absolute inset-0 transition-[opacity] duration-300 ease-in group-hover/agg-event-card:pointer-events-auto group-hover/agg-event-card:static group-hover/agg-event-card:inset-auto"
|
|
710
|
-
),
|
|
711
|
-
text: cn(
|
|
712
|
-
"transition-[max-width,opacity] duration-300 ease-in",
|
|
713
|
-
price.isBest ? "text-agg-foreground" : "text-agg-muted-foreground",
|
|
714
|
-
shouldCollapsePriceText && "max-w-0 overflow-hidden! opacity-0 group-hover/agg-event-card:max-w-[40px] group-hover/agg-event-card:opacity-100"
|
|
715
|
-
)
|
|
716
|
-
},
|
|
717
|
-
onClick: isInteractive ? (eventToHandle) => {
|
|
718
|
-
handleOutcomeBadgeClick(eventToHandle, row.market, row.outcome, marketHref);
|
|
719
|
-
} : void 0,
|
|
720
|
-
onAuxClick: isInteractive ? (eventToHandle) => {
|
|
721
|
-
handleOutcomeBadgeClick(eventToHandle, row.market, row.outcome, marketHref);
|
|
722
|
-
} : void 0
|
|
723
|
-
},
|
|
724
|
-
`${price.market.id}:${price.outcome.id}`
|
|
725
|
-
);
|
|
726
|
-
};
|
|
727
|
-
return /* @__PURE__ */ jsxs(
|
|
728
|
-
Card,
|
|
729
|
-
{
|
|
730
|
-
className: cn(
|
|
731
|
-
"group/agg-event-card min-w-60 md:min-w-90",
|
|
732
|
-
baseCardClassName,
|
|
733
|
-
(onEventClick || href) && "cursor-pointer",
|
|
734
|
-
classNames == null ? void 0 : classNames.root
|
|
735
|
-
),
|
|
736
|
-
role: !href && onEventClick ? "button" : void 0,
|
|
737
|
-
tabIndex: !href && onEventClick ? 0 : void 0,
|
|
738
|
-
href,
|
|
739
|
-
onClick: handleClick,
|
|
740
|
-
onKeyDown: handleKeyDown,
|
|
741
|
-
"aria-label": ariaLabel != null ? ariaLabel : [resolvedTitle, resolvedTimestamp].filter(Boolean).join(" "),
|
|
742
|
-
withGradient: true,
|
|
743
|
-
children: [
|
|
744
|
-
/* @__PURE__ */ jsxs("div", { className: cn("agg-event-card-header flex items-center gap-4", classNames == null ? void 0 : classNames.header), children: [
|
|
745
|
-
/* @__PURE__ */ jsx(
|
|
746
|
-
RemoteImage,
|
|
747
|
-
{
|
|
748
|
-
src: optimizedImageUrl(resolvedImage, 40),
|
|
749
|
-
retinaSrc: retinaImageUrl(resolvedImage, 40),
|
|
750
|
-
alt: "",
|
|
751
|
-
fallback: event.venue ? /* @__PURE__ */ jsx(VenueLogo, { venue: event.venue, size: "medium" }) : void 0,
|
|
752
|
-
classNames: {
|
|
753
|
-
root: "agg-event-image h-10 w-10 shrink-0 rounded-agg-lg object-cover",
|
|
754
|
-
image: "transition-transform duration-300 group-hover/agg-event-card:scale-110"
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
),
|
|
758
|
-
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1 self-stretch", children: /* @__PURE__ */ jsxs("div", { className: "flex h-12 min-w-0 flex-col justify-center", children: [
|
|
759
|
-
/* @__PURE__ */ jsx(
|
|
760
|
-
Typography,
|
|
761
|
-
{
|
|
762
|
-
variant: "body-strong",
|
|
763
|
-
className: cn(
|
|
764
|
-
"agg-event-title",
|
|
765
|
-
"min-w-0 text-agg-base font-agg-bold leading-agg-6",
|
|
766
|
-
resolvedTimestamp ? "truncate whitespace-nowrap" : "text-wrap wrap-break-word line-clamp-2",
|
|
767
|
-
classNames == null ? void 0 : classNames.title
|
|
768
|
-
),
|
|
769
|
-
children: resolvedTitle
|
|
770
|
-
}
|
|
771
|
-
),
|
|
772
|
-
resolvedTimestamp ? /* @__PURE__ */ jsx("div", { className: "agg-event-timestamp-row mt-0.5 h-5 min-w-0", children: /* @__PURE__ */ jsx(
|
|
773
|
-
Typography,
|
|
774
|
-
{
|
|
775
|
-
variant: "body",
|
|
776
|
-
className: cn(
|
|
777
|
-
"agg-event-timestamp min-w-0 truncate",
|
|
778
|
-
"text-agg-sm leading-agg-5 text-agg-muted-foreground"
|
|
779
|
-
),
|
|
780
|
-
children: resolvedTimestamp
|
|
781
|
-
}
|
|
782
|
-
) }) : null
|
|
783
|
-
] }) })
|
|
784
|
-
] }),
|
|
785
|
-
/* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
|
|
786
|
-
/* @__PURE__ */ jsxs(
|
|
787
|
-
"div",
|
|
788
|
-
{
|
|
789
|
-
ref: outcomesContainerRef,
|
|
790
|
-
className: cn(
|
|
791
|
-
"agg-outcomes flex max-h-[76px] flex-col gap-4 overflow-y-auto rounded-agg-md [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
|
792
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-2 focus-visible:ring-offset-agg-secondary",
|
|
793
|
-
classNames == null ? void 0 : classNames.outcomes
|
|
794
|
-
),
|
|
795
|
-
"aria-label": labels.marketDetails.marketOutcomesAria,
|
|
796
|
-
tabIndex: 0,
|
|
797
|
-
children: [
|
|
798
|
-
comparison.rows.map((row) => {
|
|
799
|
-
var _a2;
|
|
800
|
-
const arbitragePercent = (_a2 = arbitrageByOutcomeId == null ? void 0 : arbitrageByOutcomeId[row.outcome.id]) != null ? _a2 : arbitrageByOutcomeId == null ? void 0 : arbitrageByOutcomeId[row.market.id];
|
|
801
|
-
const arbReturn = arbReturnByVenueMarketId.get(row.market.id);
|
|
802
|
-
const priceGapPercent = arbReturn == null ? gapsByVenueMarketId.get(row.market.id) : arbReturn;
|
|
803
|
-
const priceGapSource = arbReturn == null ? "percent" : "fraction";
|
|
804
|
-
return /* @__PURE__ */ jsxs(
|
|
805
|
-
"div",
|
|
806
|
-
{
|
|
807
|
-
className: cn(
|
|
808
|
-
"agg-outcome-row",
|
|
809
|
-
"flex h-10 w-full flex-row items-center justify-between gap-3",
|
|
810
|
-
classNames == null ? void 0 : classNames.outcomeRow
|
|
811
|
-
),
|
|
812
|
-
children: [
|
|
813
|
-
/* @__PURE__ */ jsx("div", { className: "agg-outcome-label-row flex min-w-0 flex-1 flex-row items-center justify-start gap-2", children: /* @__PURE__ */ jsx(
|
|
814
|
-
Typography,
|
|
815
|
-
{
|
|
816
|
-
variant: "body",
|
|
817
|
-
className: "agg-outcome-label min-w-0 truncate text-agg-xs leading-agg-5 md:text-agg-base md:leading-agg-6",
|
|
818
|
-
children: row.label
|
|
819
|
-
}
|
|
820
|
-
) }),
|
|
821
|
-
/* @__PURE__ */ jsxs("div", { className: "agg-outcome-meta flex shrink-0 flex-row items-center justify-end gap-2", children: [
|
|
822
|
-
renderArbitrage(arbitragePercent),
|
|
823
|
-
renderPriceGapPill(priceGapPercent, priceGapSource),
|
|
824
|
-
/* @__PURE__ */ jsx("div", { className: "agg-outcome-price-strip relative flex shrink-0 items-center justify-end", children: isAwaitingMidpoints ? renderPriceStripSkeleton(row.prices.length) : row.prices.map(
|
|
825
|
-
(price, priceIndex) => renderComparisonPriceBadge(row, price, priceIndex)
|
|
826
|
-
) })
|
|
827
|
-
] })
|
|
828
|
-
]
|
|
829
|
-
},
|
|
830
|
-
row.id
|
|
831
|
-
);
|
|
832
|
-
}),
|
|
833
|
-
shouldRenderLoadingOutcomeRow ? /* @__PURE__ */ jsxs("div", { className: "agg-outcome-row-loading flex w-full items-center justify-between gap-3", children: [
|
|
834
|
-
/* @__PURE__ */ jsx(
|
|
835
|
-
"div",
|
|
836
|
-
{
|
|
837
|
-
"aria-hidden": "true",
|
|
838
|
-
className: "bg-agg-separator animate-pulse h-5 rounded-agg-sm w-[200px]"
|
|
839
|
-
}
|
|
840
|
-
),
|
|
841
|
-
/* @__PURE__ */ jsx(
|
|
842
|
-
"div",
|
|
843
|
-
{
|
|
844
|
-
"aria-hidden": "true",
|
|
845
|
-
className: "bg-agg-separator animate-pulse h-9 w-[100px] rounded-agg-full"
|
|
846
|
-
}
|
|
847
|
-
)
|
|
848
|
-
] }) : null
|
|
849
|
-
]
|
|
850
|
-
}
|
|
851
|
-
),
|
|
852
|
-
/* @__PURE__ */ jsx(
|
|
853
|
-
"div",
|
|
854
|
-
{
|
|
855
|
-
className: cn(
|
|
856
|
-
"agg-outcomes-scroll-gradient-top pointer-events-none absolute inset-x-0 top-0 z-10 bg-gradient-to-b from-agg-secondary to-transparent transition-opacity duration-150",
|
|
857
|
-
outcomesScrollState.hasOverflow && !outcomesScrollState.isAtTop ? "opacity-100" : "opacity-0"
|
|
858
|
-
),
|
|
859
|
-
style: { height: OUTCOMES_SCROLL_MASK_HEIGHT_PX }
|
|
860
|
-
}
|
|
861
|
-
),
|
|
862
|
-
/* @__PURE__ */ jsx(
|
|
863
|
-
"div",
|
|
864
|
-
{
|
|
865
|
-
className: cn(
|
|
866
|
-
"agg-outcomes-scroll-gradient-bottom pointer-events-none absolute inset-x-0 bottom-0 z-10 bg-gradient-to-t from-agg-secondary to-transparent transition-opacity duration-150",
|
|
867
|
-
outcomesScrollState.hasOverflow && !outcomesScrollState.isAtBottom ? "opacity-100" : "opacity-0"
|
|
868
|
-
),
|
|
869
|
-
style: { height: OUTCOMES_SCROLL_MASK_HEIGHT_PX }
|
|
870
|
-
}
|
|
871
|
-
)
|
|
872
|
-
] }),
|
|
873
|
-
/* @__PURE__ */ jsxs(
|
|
874
|
-
"div",
|
|
875
|
-
{
|
|
876
|
-
className: cn(
|
|
877
|
-
"agg-event-card-footer",
|
|
878
|
-
"flex items-center justify-between gap-5",
|
|
879
|
-
"text-agg-muted-foreground",
|
|
880
|
-
classNames == null ? void 0 : classNames.footer
|
|
881
|
-
),
|
|
882
|
-
children: [
|
|
883
|
-
/* @__PURE__ */ jsxs(
|
|
884
|
-
"div",
|
|
885
|
-
{
|
|
886
|
-
className: cn(
|
|
887
|
-
"agg-event-meta flex min-w-0 flex-1 items-center gap-2 text-agg-sm leading-agg-5 truncate"
|
|
888
|
-
),
|
|
889
|
-
children: [
|
|
890
|
-
outcomesScrollState.remainingMarkets > 0 ? /* @__PURE__ */ jsx(
|
|
891
|
-
Typography,
|
|
892
|
-
{
|
|
893
|
-
variant: "body",
|
|
894
|
-
className: "agg-event-remaining-markets shrink-0 text-agg-sm leading-agg-5 text-agg-muted-foreground",
|
|
895
|
-
children: labels.eventItem.remainingMarkets(outcomesScrollState.remainingMarkets)
|
|
896
|
-
}
|
|
897
|
-
) : null,
|
|
898
|
-
shouldShowMatchedVenueSummary ? /* @__PURE__ */ jsx("span", { className: "agg-event-matched-badge rounded-agg-full bg-agg-primary/10 px-2 py-[3px] text-agg-2xs font-agg-bold uppercase leading-agg-14 text-agg-primary", children: matchedCountLabel }) : null,
|
|
899
|
-
singleFooterVenue ? /* @__PURE__ */ jsxs("span", { className: "agg-event-single-venue flex min-w-0 items-center gap-1 overflow-hidden", children: [
|
|
900
|
-
/* @__PURE__ */ jsx(
|
|
901
|
-
VenueLogo,
|
|
902
|
-
{
|
|
903
|
-
venue: singleFooterVenue,
|
|
904
|
-
size: "small",
|
|
905
|
-
isMonochromatic: true,
|
|
906
|
-
className: "text-agg-muted-foreground! size-[14px]!"
|
|
907
|
-
}
|
|
908
|
-
),
|
|
909
|
-
/* @__PURE__ */ jsx("span", { className: "truncate text-agg-muted-foreground", children: resolveVenueLabel(singleFooterVenue, void 0, labels) })
|
|
910
|
-
] }) : null,
|
|
911
|
-
shouldShowMatchedVenueSummary && visibleFooterVenues.length > 0 ? /* @__PURE__ */ jsx("span", { className: "agg-event-venues flex items-center gap-1 overflow-hidden", children: visibleFooterVenues.map((venue) => (
|
|
912
|
-
// Muted at rest; hovering a logo crossfades it to the venue's colours.
|
|
913
|
-
/* @__PURE__ */ jsxs(
|
|
914
|
-
"span",
|
|
915
|
-
{
|
|
916
|
-
className: "agg-event-venue-logo group/agg-footer-venue relative inline-flex size-3.5 shrink-0",
|
|
917
|
-
title: resolveVenueLabel(venue, void 0, labels),
|
|
918
|
-
children: [
|
|
919
|
-
/* @__PURE__ */ jsx(
|
|
920
|
-
VenueLogo,
|
|
921
|
-
{
|
|
922
|
-
venue,
|
|
923
|
-
size: "small",
|
|
924
|
-
isMonochromatic: true,
|
|
925
|
-
className: cn(
|
|
926
|
-
"text-agg-muted-foreground! size-3.5!",
|
|
927
|
-
getMotionClassName(
|
|
928
|
-
config.features.enableAnimations,
|
|
929
|
-
"transition-opacity duration-150"
|
|
930
|
-
),
|
|
931
|
-
"group-hover/agg-footer-venue:opacity-0"
|
|
932
|
-
)
|
|
933
|
-
}
|
|
934
|
-
),
|
|
935
|
-
/* @__PURE__ */ jsx(
|
|
936
|
-
VenueLogo,
|
|
937
|
-
{
|
|
938
|
-
venue,
|
|
939
|
-
size: "small",
|
|
940
|
-
className: cn(
|
|
941
|
-
"absolute inset-0 size-3.5! opacity-0",
|
|
942
|
-
getMotionClassName(
|
|
943
|
-
config.features.enableAnimations,
|
|
944
|
-
"transition-opacity duration-150"
|
|
945
|
-
),
|
|
946
|
-
"group-hover/agg-footer-venue:opacity-100"
|
|
947
|
-
)
|
|
948
|
-
}
|
|
949
|
-
)
|
|
950
|
-
]
|
|
951
|
-
},
|
|
952
|
-
venue
|
|
953
|
-
)
|
|
954
|
-
)) }) : null
|
|
955
|
-
]
|
|
956
|
-
}
|
|
957
|
-
),
|
|
958
|
-
/* @__PURE__ */ jsx(
|
|
959
|
-
Typography,
|
|
960
|
-
{
|
|
961
|
-
variant: "label",
|
|
962
|
-
className: "agg-event-volume min-w-fit shrink-0 truncate whitespace-pre text-agg-sm text-agg-muted-foreground line-clamp-1",
|
|
963
|
-
children: volumeLabel
|
|
964
|
-
}
|
|
965
|
-
)
|
|
966
|
-
]
|
|
967
|
-
}
|
|
968
|
-
)
|
|
969
|
-
]
|
|
970
|
-
}
|
|
971
|
-
);
|
|
972
|
-
};
|
|
973
|
-
var EventListItemByEventId = (_a) => {
|
|
974
|
-
var _b = _a, {
|
|
975
|
-
eventId
|
|
976
|
-
} = _b, rest = __objRest(_b, [
|
|
977
|
-
"eventId"
|
|
978
|
-
]);
|
|
979
|
-
const {
|
|
980
|
-
event: fetchedEvent,
|
|
981
|
-
error,
|
|
982
|
-
isError,
|
|
983
|
-
isLoading
|
|
984
|
-
} = useVenueEvent({
|
|
985
|
-
eventId: eventId != null ? eventId : "",
|
|
986
|
-
enabled: !!eventId
|
|
987
|
-
});
|
|
988
|
-
const resolvedEvent = useMemo(() => {
|
|
989
|
-
return resolveEventListItemEvent(fetchedEvent);
|
|
990
|
-
}, [fetchedEvent]);
|
|
991
|
-
if (!eventId) {
|
|
992
|
-
return /* @__PURE__ */ jsx(EventListItemUnavailableState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
993
|
-
}
|
|
994
|
-
if (isLoading) {
|
|
995
|
-
return /* @__PURE__ */ jsx(EventListItemLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
996
|
-
}
|
|
997
|
-
if (isErrorWithStatus(error, 404)) {
|
|
998
|
-
return /* @__PURE__ */ jsx(EventListItemNotFoundState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
999
|
-
}
|
|
1000
|
-
if (!fetchedEvent && !isError) {
|
|
1001
|
-
return /* @__PURE__ */ jsx(EventListItemLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
1002
|
-
}
|
|
1003
|
-
if (!resolvedEvent) {
|
|
1004
|
-
return /* @__PURE__ */ jsx(EventListItemUnavailableState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
1005
|
-
}
|
|
1006
|
-
return /* @__PURE__ */ jsx(EventListItemContent, __spreadValues({ event: resolvedEvent }, rest));
|
|
1007
|
-
};
|
|
1008
|
-
var EventListItem = (props) => {
|
|
1009
|
-
if (props.isLoading) {
|
|
1010
|
-
return /* @__PURE__ */ jsx(EventListItemLoadingState, { classNames: props.classNames, ariaLabel: props.ariaLabel });
|
|
1011
|
-
}
|
|
1012
|
-
if ("event" in props && props.event) {
|
|
1013
|
-
const _a = props, { event } = _a, rest = __objRest(_a, ["event"]);
|
|
1014
|
-
return /* @__PURE__ */ jsx(EventListItemContent, __spreadValues({ event }, rest));
|
|
1015
|
-
}
|
|
1016
|
-
return /* @__PURE__ */ jsx(EventListItemByEventId, __spreadValues({}, props));
|
|
1017
|
-
};
|
|
1018
|
-
EventListItem.displayName = "EventListItem";
|
|
1019
|
-
var EventListItemV2 = (props) => {
|
|
1020
|
-
return /* @__PURE__ */ jsx(EventListItem, __spreadValues({}, props));
|
|
1021
|
-
};
|
|
1022
|
-
EventListItemV2.displayName = "EventListItemV2";
|
|
1023
|
-
|
|
1024
|
-
// src/events/list/event-list-venue-strip.tsx
|
|
1025
|
-
import { useAppConfig as useAppConfig2, useLabels as useLabels3, useSdkUiConfig as useSdkUiConfig2 } from "@agg-build/hooks";
|
|
1026
|
-
import { useEffect as useEffect3, useLayoutEffect, useMemo as useMemo3, useRef as useRef3, useState as useState3 } from "react";
|
|
1027
|
-
|
|
1028
|
-
// src/events/list/event-list-tabs.tsx
|
|
1029
|
-
import { getVenueAvailabilityState, useAppConfig, useGeoBlock, useLabels as useLabels2 } from "@agg-build/hooks";
|
|
1030
|
-
import { getEffectiveDisabledVenues, isVenueInactive } from "@agg-build/sdk";
|
|
1031
|
-
import { useCallback as useCallback2, useEffect as useEffect2, useMemo as useMemo2, useRef as useRef2, useState as useState2 } from "react";
|
|
1032
|
-
|
|
1033
|
-
// src/events/list/event-list.constants.ts
|
|
1034
|
-
import { sortVenues as sortVenues2 } from "@agg-build/hooks";
|
|
1035
|
-
import { MatchStatus, Venue } from "@agg-build/sdk";
|
|
1036
|
-
var DEFAULT_EVENTS_LIMIT = 50;
|
|
1037
|
-
var DEFAULT_EVENT_LIST_SORT = "volume24hr";
|
|
1038
|
-
var PLACEHOLDER_SKELETON_MIN_ITEMS = 6;
|
|
1039
|
-
var EVENT_LIST_SORT_VALUES = [
|
|
1040
|
-
"volume24hr",
|
|
1041
|
-
"topArbitrage",
|
|
1042
|
-
"volume",
|
|
1043
|
-
"endDate"
|
|
1044
|
-
];
|
|
1045
|
-
var getDefaultEventListTabs = (labels) => {
|
|
1046
|
-
const tabs = [
|
|
1047
|
-
{
|
|
1048
|
-
value: "matched",
|
|
1049
|
-
label: labels.eventList.matchedTab,
|
|
1050
|
-
iconName: "circle-overlap",
|
|
1051
|
-
matchStatus: [MatchStatus.matched, MatchStatus.verified]
|
|
1052
|
-
},
|
|
1053
|
-
{
|
|
1054
|
-
value: "all",
|
|
1055
|
-
label: labels.eventList.allTab,
|
|
1056
|
-
iconName: "apps"
|
|
1057
|
-
},
|
|
1058
|
-
{
|
|
1059
|
-
value: Venue.polymarket,
|
|
1060
|
-
label: labels.venues.polymarket,
|
|
1061
|
-
venueLogo: Venue.polymarket,
|
|
1062
|
-
venues: [Venue.polymarket]
|
|
1063
|
-
},
|
|
1064
|
-
{
|
|
1065
|
-
value: Venue.kalshi,
|
|
1066
|
-
label: labels.venues.kalshi,
|
|
1067
|
-
venueLogo: Venue.kalshi,
|
|
1068
|
-
venues: [Venue.kalshi]
|
|
1069
|
-
},
|
|
1070
|
-
{
|
|
1071
|
-
value: Venue.limitless,
|
|
1072
|
-
label: labels.venues.limitless,
|
|
1073
|
-
venueLogo: Venue.limitless,
|
|
1074
|
-
venues: [Venue.limitless]
|
|
1075
|
-
},
|
|
1076
|
-
{
|
|
1077
|
-
value: Venue.predict,
|
|
1078
|
-
label: labels.venues.predict,
|
|
1079
|
-
venueLogo: Venue.predict,
|
|
1080
|
-
venues: [Venue.predict]
|
|
1081
|
-
},
|
|
1082
|
-
{
|
|
1083
|
-
value: Venue.pred,
|
|
1084
|
-
label: labels.venues.pred,
|
|
1085
|
-
venueLogo: Venue.pred,
|
|
1086
|
-
venues: [Venue.pred]
|
|
1087
|
-
},
|
|
1088
|
-
{
|
|
1089
|
-
value: Venue.hyperliquid,
|
|
1090
|
-
label: labels.venues.hyperliquid,
|
|
1091
|
-
venueLogo: Venue.hyperliquid,
|
|
1092
|
-
venues: [Venue.hyperliquid]
|
|
1093
|
-
// isComingSoon: true,
|
|
1094
|
-
},
|
|
1095
|
-
{
|
|
1096
|
-
value: Venue.myriad,
|
|
1097
|
-
label: labels.venues.myriad,
|
|
1098
|
-
venueLogo: Venue.myriad,
|
|
1099
|
-
venues: [Venue.myriad]
|
|
1100
|
-
// isComingSoon: true,
|
|
1101
|
-
},
|
|
1102
|
-
{
|
|
1103
|
-
value: Venue.novig,
|
|
1104
|
-
label: labels.venues.novig,
|
|
1105
|
-
venueLogo: Venue.novig,
|
|
1106
|
-
venues: [Venue.novig]
|
|
1107
|
-
},
|
|
1108
|
-
{
|
|
1109
|
-
value: Venue.prophetx,
|
|
1110
|
-
label: labels.venues.prophetx,
|
|
1111
|
-
venueLogo: Venue.prophetx,
|
|
1112
|
-
venues: [Venue.prophetx]
|
|
1113
|
-
},
|
|
1114
|
-
{
|
|
1115
|
-
value: Venue.tiprun,
|
|
1116
|
-
label: labels.venues.tiprun,
|
|
1117
|
-
venueLogo: Venue.tiprun,
|
|
1118
|
-
venues: [Venue.tiprun]
|
|
1119
|
-
},
|
|
1120
|
-
{
|
|
1121
|
-
value: Venue.betdex,
|
|
1122
|
-
label: labels.venues.betdex,
|
|
1123
|
-
venueLogo: Venue.betdex,
|
|
1124
|
-
venues: [Venue.betdex]
|
|
1125
|
-
},
|
|
1126
|
-
{
|
|
1127
|
-
value: Venue.opinion,
|
|
1128
|
-
label: labels.venues.opinion,
|
|
1129
|
-
venueLogo: Venue.opinion,
|
|
1130
|
-
venues: [Venue.opinion],
|
|
1131
|
-
isComingSoon: true
|
|
1132
|
-
}
|
|
1133
|
-
];
|
|
1134
|
-
const venueRank = new Map(
|
|
1135
|
-
sortVenues2(tabs.flatMap((tab) => tab.venueLogo ? [tab.venueLogo] : [])).map((venue, i) => [
|
|
1136
|
-
venue,
|
|
1137
|
-
i
|
|
1138
|
-
])
|
|
1139
|
-
);
|
|
1140
|
-
const rank = (tab) => {
|
|
1141
|
-
var _a;
|
|
1142
|
-
return tab.venueLogo ? 1 + ((_a = venueRank.get(tab.venueLogo)) != null ? _a : venueRank.size) : 0;
|
|
1143
|
-
};
|
|
1144
|
-
return [...tabs].sort((a, b) => rank(a) - rank(b));
|
|
1145
|
-
};
|
|
1146
|
-
|
|
1147
|
-
// src/events/list/event-list-tabs.tsx
|
|
1148
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
1149
|
-
var DEFAULT_HIDDEN_VENUES = new Set(getEffectiveDisabledVenues(void 0));
|
|
1150
|
-
var renderTabIcon = (tab, isActive) => {
|
|
1151
|
-
if (tab.iconName === "warning-filled") {
|
|
1152
|
-
return /* @__PURE__ */ jsx2(Icon, { name: "warning-filled", size: "small", color: "currentColor" });
|
|
1153
|
-
}
|
|
1154
|
-
if (tab.venueLogo) {
|
|
1155
|
-
return /* @__PURE__ */ jsx2(VenueLogo, { venue: tab.venueLogo, size: "small" });
|
|
1156
|
-
}
|
|
1157
|
-
if (!tab.iconName) return null;
|
|
1158
|
-
return /* @__PURE__ */ jsx2(
|
|
1159
|
-
Icon,
|
|
1160
|
-
{
|
|
1161
|
-
name: tab.iconName,
|
|
1162
|
-
size: "small",
|
|
1163
|
-
color: isActive ? "var(--agg-color-primary)" : "var(--agg-color-foreground)"
|
|
1164
|
-
}
|
|
1165
|
-
);
|
|
1166
|
-
};
|
|
1167
|
-
var useEventListTabs = (tabs) => {
|
|
1168
|
-
const labels = useLabels2();
|
|
1169
|
-
const { disabledVenues, isLoading: isAppConfigLoading } = useAppConfig();
|
|
1170
|
-
const { isLocationBlocked } = useGeoBlock();
|
|
1171
|
-
return useMemo2(() => {
|
|
1172
|
-
const baseTabs = tabs != null ? tabs : getDefaultEventListTabs(labels);
|
|
1173
|
-
return baseTabs.flatMap((tab) => {
|
|
1174
|
-
if (!tab.venueLogo) return [tab];
|
|
1175
|
-
const availabilityState = getVenueAvailabilityState({
|
|
1176
|
-
venueId: tab.venueLogo,
|
|
1177
|
-
disabledVenues,
|
|
1178
|
-
// A globally inactive or default-disabled venue is hidden until
|
|
1179
|
-
// `/app/config` resolves. That prevents partner-opt-in venues such as
|
|
1180
|
-
// Novig from flashing briefly for apps that still disable them, while
|
|
1181
|
-
// ordinary active venues continue rendering immediately.
|
|
1182
|
-
isConfigLoading: isAppConfigLoading && (isVenueInactive(tab.venueLogo) || DEFAULT_HIDDEN_VENUES.has(tab.venueLogo)),
|
|
1183
|
-
isLocationBlocked
|
|
1184
|
-
});
|
|
1185
|
-
if (availabilityState === "hidden") return [];
|
|
1186
|
-
return [
|
|
1187
|
-
__spreadProps(__spreadValues({}, tab), {
|
|
1188
|
-
disabled: tab.disabled || availabilityState === "geoblocked",
|
|
1189
|
-
label: availabilityState === "geoblocked" ? `${tab.label} (${labels.trading.venueUnavailableInRegion})` : tab.label,
|
|
1190
|
-
iconName: availabilityState === "geoblocked" ? "warning-filled" : tab.iconName
|
|
1191
|
-
})
|
|
1192
|
-
];
|
|
1193
|
-
});
|
|
1194
|
-
}, [tabs, labels, disabledVenues, isAppConfigLoading, isLocationBlocked]);
|
|
1195
|
-
};
|
|
1196
|
-
var EventListTabs = ({
|
|
1197
|
-
tabs,
|
|
1198
|
-
activeTab,
|
|
1199
|
-
onTabChange,
|
|
1200
|
-
ariaLabel,
|
|
1201
|
-
className,
|
|
1202
|
-
overflowBehavior
|
|
1203
|
-
}) => {
|
|
1204
|
-
const resolvedTabs = useEventListTabs(tabs);
|
|
1205
|
-
useEffect2(() => {
|
|
1206
|
-
const fallbackTab = resolvedTabs.find((tab) => !tab.disabled);
|
|
1207
|
-
if (!fallbackTab) return;
|
|
1208
|
-
if (resolvedTabs.some((tab) => tab.value === activeTab && !tab.disabled)) return;
|
|
1209
|
-
onTabChange(fallbackTab.value);
|
|
1210
|
-
}, [activeTab, onTabChange, resolvedTabs]);
|
|
1211
|
-
const items = useMemo2(() => {
|
|
1212
|
-
return resolvedTabs.map((tab) => {
|
|
1213
|
-
const isActive = tab.value === activeTab;
|
|
1214
|
-
return {
|
|
1215
|
-
value: tab.value,
|
|
1216
|
-
label: tab.label,
|
|
1217
|
-
icon: renderTabIcon(tab, isActive),
|
|
1218
|
-
disabled: tab.disabled,
|
|
1219
|
-
isComingSoon: tab.isComingSoon
|
|
1220
|
-
};
|
|
1221
|
-
});
|
|
1222
|
-
}, [activeTab, resolvedTabs]);
|
|
1223
|
-
return /* @__PURE__ */ jsx2(
|
|
1224
|
-
Tabs,
|
|
1225
|
-
{
|
|
1226
|
-
ariaLabel,
|
|
1227
|
-
className,
|
|
1228
|
-
items,
|
|
1229
|
-
overflowBehavior,
|
|
1230
|
-
value: activeTab,
|
|
1231
|
-
onChange: onTabChange
|
|
1232
|
-
}
|
|
1233
|
-
);
|
|
1234
|
-
};
|
|
1235
|
-
EventListTabs.displayName = "EventListTabs";
|
|
1236
|
-
var useEventListTabsHeaderOverflow = (recomputeOn, options) => {
|
|
1237
|
-
const headerRef = useRef2(null);
|
|
1238
|
-
const titleRef = useRef2(null);
|
|
1239
|
-
const requiredTabsWidthRef = useRef2(0);
|
|
1240
|
-
const [shouldUseSelectOverflow, setShouldUseSelectOverflow] = useState2(false);
|
|
1241
|
-
const updateTabsOverflowBehavior = useCallback2(() => {
|
|
1242
|
-
var _a;
|
|
1243
|
-
if (typeof window === "undefined") return;
|
|
1244
|
-
const headerElement = headerRef.current;
|
|
1245
|
-
const titleElement = titleRef.current;
|
|
1246
|
-
if (!headerElement || !titleElement) return;
|
|
1247
|
-
const headerStyles = window.getComputedStyle(headerElement);
|
|
1248
|
-
const rawGap = headerStyles.columnGap || headerStyles.gap || "0";
|
|
1249
|
-
const horizontalGap = Number.parseFloat(rawGap) || 0;
|
|
1250
|
-
const availableTabsWidth = headerElement.clientWidth - titleElement.getBoundingClientRect().width - horizontalGap;
|
|
1251
|
-
if (availableTabsWidth <= 0) {
|
|
1252
|
-
setShouldUseSelectOverflow(true);
|
|
1253
|
-
return;
|
|
1254
|
-
}
|
|
1255
|
-
const minTabsInlineWidthForSelect = options == null ? void 0 : options.minTabsInlineWidthForSelect;
|
|
1256
|
-
if (typeof minTabsInlineWidthForSelect === "number" && availableTabsWidth < minTabsInlineWidthForSelect) {
|
|
1257
|
-
setShouldUseSelectOverflow(true);
|
|
1258
|
-
return;
|
|
1259
|
-
}
|
|
1260
|
-
const preferSelectOnOverflow = (_a = options == null ? void 0 : options.preferSelectOnOverflow) != null ? _a : true;
|
|
1261
|
-
if (!preferSelectOnOverflow) {
|
|
1262
|
-
setShouldUseSelectOverflow(false);
|
|
1263
|
-
return;
|
|
1264
|
-
}
|
|
1265
|
-
const tabListElement = headerElement.querySelector(".agg-tab-list");
|
|
1266
|
-
if (tabListElement) {
|
|
1267
|
-
const currentRequiredWidth = tabListElement.scrollWidth;
|
|
1268
|
-
if (currentRequiredWidth > 0) {
|
|
1269
|
-
requiredTabsWidthRef.current = currentRequiredWidth;
|
|
1270
|
-
}
|
|
1271
|
-
const hasRealOverflow = tabListElement.scrollWidth - tabListElement.clientWidth > 1;
|
|
1272
|
-
setShouldUseSelectOverflow(hasRealOverflow);
|
|
1273
|
-
return;
|
|
1274
|
-
}
|
|
1275
|
-
if (requiredTabsWidthRef.current <= 0) return;
|
|
1276
|
-
setShouldUseSelectOverflow(requiredTabsWidthRef.current > availableTabsWidth);
|
|
1277
|
-
}, [options == null ? void 0 : options.minTabsInlineWidthForSelect, options == null ? void 0 : options.preferSelectOnOverflow]);
|
|
1278
|
-
useEffect2(() => {
|
|
1279
|
-
updateTabsOverflowBehavior();
|
|
1280
|
-
}, [recomputeOn, updateTabsOverflowBehavior]);
|
|
1281
|
-
useEffect2(() => {
|
|
1282
|
-
if (typeof window === "undefined") return;
|
|
1283
|
-
const handleResize = () => {
|
|
1284
|
-
updateTabsOverflowBehavior();
|
|
1285
|
-
};
|
|
1286
|
-
window.addEventListener("resize", handleResize);
|
|
1287
|
-
return () => {
|
|
1288
|
-
window.removeEventListener("resize", handleResize);
|
|
1289
|
-
};
|
|
1290
|
-
}, [updateTabsOverflowBehavior]);
|
|
1291
|
-
useEffect2(() => {
|
|
1292
|
-
if (typeof ResizeObserver === "undefined") return;
|
|
1293
|
-
const headerElement = headerRef.current;
|
|
1294
|
-
const titleElement = titleRef.current;
|
|
1295
|
-
if (!headerElement || !titleElement) return;
|
|
1296
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
1297
|
-
updateTabsOverflowBehavior();
|
|
1298
|
-
});
|
|
1299
|
-
resizeObserver.observe(headerElement);
|
|
1300
|
-
resizeObserver.observe(titleElement);
|
|
1301
|
-
return () => {
|
|
1302
|
-
resizeObserver.disconnect();
|
|
1303
|
-
};
|
|
1304
|
-
}, [updateTabsOverflowBehavior]);
|
|
1305
|
-
return { headerRef, titleRef, shouldUseSelectOverflow };
|
|
1306
|
-
};
|
|
1307
|
-
|
|
1308
|
-
// src/events/list/event-list-venue-strip.tsx
|
|
1309
|
-
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1310
|
-
var TILE = 28;
|
|
1311
|
-
var TILE_GAP = 4;
|
|
1312
|
-
var CHIP = 36;
|
|
1313
|
-
var STRIP_INSET = 7;
|
|
1314
|
-
var FIT_TOLERANCE = 0.5;
|
|
1315
|
-
var useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect3 : useLayoutEffect;
|
|
1316
|
-
var isTabUnavailable = (tab) => !!tab.disabled || !!tab.isComingSoon;
|
|
1317
|
-
var resolveTabLabel = (tab) => tab.isComingSoon ? `${tab.label} (soon)` : tab.label;
|
|
1318
|
-
var StripFrame = ({
|
|
1319
|
-
className,
|
|
1320
|
-
children,
|
|
1321
|
-
frameRef
|
|
1322
|
-
}) => /* @__PURE__ */ jsx3(
|
|
1323
|
-
"div",
|
|
1324
|
-
{
|
|
1325
|
-
ref: frameRef,
|
|
1326
|
-
className: cn(
|
|
1327
|
-
"inline-flex items-center gap-1 rounded-agg-lg border border-agg-separator bg-agg-secondary p-1.5",
|
|
1328
|
-
className
|
|
1329
|
-
),
|
|
1330
|
-
children
|
|
1331
|
-
}
|
|
1332
|
-
);
|
|
1333
|
-
var StripTile = ({
|
|
1334
|
-
tab,
|
|
1335
|
-
isActive,
|
|
1336
|
-
shape,
|
|
1337
|
-
motionClassName,
|
|
1338
|
-
onSelect,
|
|
1339
|
-
showTooltip = true,
|
|
1340
|
-
isVenue = false
|
|
1341
|
-
}) => {
|
|
1342
|
-
const isUnavailable = isTabUnavailable(tab);
|
|
1343
|
-
const label = resolveTabLabel(tab);
|
|
1344
|
-
const isExpanded = shape === "pill" || isActive;
|
|
1345
|
-
const glyphClassName = cn(
|
|
1346
|
-
"shrink-0",
|
|
1347
|
-
motionClassName,
|
|
1348
|
-
!isActive && shape === "tile" && "opacity-70 group-hover:opacity-100"
|
|
1349
|
-
);
|
|
1350
|
-
const glyph = tab.venueLogo ? /* @__PURE__ */ jsx3(VenueLogo, { venue: tab.venueLogo, size: "small", className: glyphClassName }) : tab.iconName ? /* @__PURE__ */ jsx3(
|
|
1351
|
-
Icon,
|
|
1352
|
-
{
|
|
1353
|
-
name: tab.iconName,
|
|
1354
|
-
size: "small",
|
|
1355
|
-
color: "currentColor",
|
|
1356
|
-
className: cn(tab.iconName === "warning-filled" ? "shrink-0" : glyphClassName)
|
|
1357
|
-
}
|
|
1358
|
-
) : null;
|
|
1359
|
-
return /* @__PURE__ */ jsxs2(
|
|
1360
|
-
"button",
|
|
1361
|
-
{
|
|
1362
|
-
type: "button",
|
|
1363
|
-
"data-venue-tile": isVenue ? "" : void 0,
|
|
1364
|
-
"aria-pressed": isActive,
|
|
1365
|
-
"aria-label": label,
|
|
1366
|
-
disabled: isUnavailable,
|
|
1367
|
-
onClick: () => onSelect == null ? void 0 : onSelect(tab.value),
|
|
1368
|
-
className: cn(
|
|
1369
|
-
"agg-venue-strip-tile group relative inline-flex h-7 shrink-0 items-center gap-1.5",
|
|
1370
|
-
"rounded-agg-sm font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
|
|
1371
|
-
"cursor-pointer disabled:cursor-not-allowed",
|
|
1372
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary/40",
|
|
1373
|
-
motionClassName,
|
|
1374
|
-
isExpanded ? "px-3" : "w-7 justify-center",
|
|
1375
|
-
isActive ? "bg-agg-primary/10 text-agg-primary" : "bg-transparent text-agg-foreground hover:bg-agg-secondary-hover",
|
|
1376
|
-
isUnavailable && "opacity-50 hover:bg-transparent"
|
|
1377
|
-
),
|
|
1378
|
-
children: [
|
|
1379
|
-
glyph,
|
|
1380
|
-
isExpanded ? /* @__PURE__ */ jsx3("span", { className: "whitespace-nowrap", children: tab.label }) : null,
|
|
1381
|
-
!isExpanded && showTooltip ? /* @__PURE__ */ jsx3(
|
|
1382
|
-
"span",
|
|
1383
|
-
{
|
|
1384
|
-
role: "tooltip",
|
|
1385
|
-
className: cn(
|
|
1386
|
-
"pointer-events-none absolute left-1/2 top-[calc(100%+6px)] z-10 -translate-x-1/2",
|
|
1387
|
-
"whitespace-nowrap rounded-agg-sm border border-agg-separator bg-agg-secondary px-2 py-1",
|
|
1388
|
-
"text-agg-xs text-agg-foreground shadow-agg-card-hover",
|
|
1389
|
-
"opacity-0 transition-opacity delay-150 group-hover:opacity-100 group-focus-visible:opacity-100"
|
|
1390
|
-
),
|
|
1391
|
-
children: label
|
|
1392
|
-
}
|
|
1393
|
-
) : null
|
|
1394
|
-
]
|
|
1395
|
-
}
|
|
1396
|
-
);
|
|
1397
|
-
};
|
|
1398
|
-
var EventListVenueStrip = ({
|
|
1399
|
-
tabs,
|
|
1400
|
-
activeTab,
|
|
1401
|
-
onTabChange,
|
|
1402
|
-
ariaLabel,
|
|
1403
|
-
className,
|
|
1404
|
-
fullWidth = false
|
|
1405
|
-
}) => {
|
|
1406
|
-
const labels = useLabels3();
|
|
1407
|
-
const {
|
|
1408
|
-
features: { enableAnimations }
|
|
1409
|
-
} = useSdkUiConfig2();
|
|
1410
|
-
const { isLoading: isAppConfigLoading } = useAppConfig2();
|
|
1411
|
-
const resolvedTabs = useEventListTabs(tabs);
|
|
1412
|
-
const wrapRef = useRef3(null);
|
|
1413
|
-
const ghostRef = useRef3(null);
|
|
1414
|
-
const [fit, setFit] = useState3(null);
|
|
1415
|
-
const [isListOpen, setIsListOpen] = useState3(false);
|
|
1416
|
-
const motionClassName = getMotionClassName(
|
|
1417
|
-
enableAnimations,
|
|
1418
|
-
"transition-[color,background-color,opacity] duration-200 motion-reduce:transition-none"
|
|
1419
|
-
);
|
|
1420
|
-
const modeTabs = useMemo3(() => resolvedTabs.filter((tab) => !tab.venueLogo), [resolvedTabs]);
|
|
1421
|
-
const venueTabs = useMemo3(() => resolvedTabs.filter((tab) => !!tab.venueLogo), [resolvedTabs]);
|
|
1422
|
-
const activeVenueIndex = venueTabs.findIndex((tab) => tab.value === activeTab);
|
|
1423
|
-
useEffect3(() => {
|
|
1424
|
-
if (isAppConfigLoading) return;
|
|
1425
|
-
const fallbackTab = resolvedTabs.find((tab) => !isTabUnavailable(tab));
|
|
1426
|
-
if (!fallbackTab) return;
|
|
1427
|
-
if (resolvedTabs.some((tab) => tab.value === activeTab && !isTabUnavailable(tab))) return;
|
|
1428
|
-
onTabChange(fallbackTab.value);
|
|
1429
|
-
}, [activeTab, isAppConfigLoading, onTabChange, resolvedTabs]);
|
|
1430
|
-
useIsomorphicLayoutEffect(() => {
|
|
1431
|
-
const wrap = wrapRef.current;
|
|
1432
|
-
const ghost = ghostRef.current;
|
|
1433
|
-
if (!wrap || !ghost) return;
|
|
1434
|
-
const measure = () => {
|
|
1435
|
-
const available = wrap.getBoundingClientRect().width;
|
|
1436
|
-
const strip = ghost.getBoundingClientRect();
|
|
1437
|
-
if (strip.width <= available + FIT_TOLERANCE) {
|
|
1438
|
-
setFit(null);
|
|
1439
|
-
return;
|
|
1440
|
-
}
|
|
1441
|
-
const firstTile = ghost.querySelector("[data-venue-tile]");
|
|
1442
|
-
if (!firstTile) {
|
|
1443
|
-
setFit(null);
|
|
1444
|
-
return;
|
|
1445
|
-
}
|
|
1446
|
-
const activeTile = ghost.querySelector('[data-venue-tile][aria-pressed="true"]');
|
|
1447
|
-
const room = strip.right - STRIP_INSET - firstTile.getBoundingClientRect().left - (strip.width - available);
|
|
1448
|
-
const activeWidth = activeTile ? activeTile.getBoundingClientRect().width + TILE_GAP : 0;
|
|
1449
|
-
const plain = Math.max(0, Math.floor((room - CHIP - activeWidth) / (TILE + TILE_GAP)));
|
|
1450
|
-
setFit(plain + (activeTile ? 1 : 0));
|
|
1451
|
-
};
|
|
1452
|
-
measure();
|
|
1453
|
-
if (typeof ResizeObserver === "undefined") return;
|
|
1454
|
-
const observer = new ResizeObserver(measure);
|
|
1455
|
-
observer.observe(wrap);
|
|
1456
|
-
observer.observe(ghost);
|
|
1457
|
-
return () => {
|
|
1458
|
-
observer.disconnect();
|
|
1459
|
-
};
|
|
1460
|
-
}, [venueTabs, activeVenueIndex, fullWidth]);
|
|
1461
|
-
useEffect3(() => {
|
|
1462
|
-
if (!isListOpen) return;
|
|
1463
|
-
const handlePointerDown = (event) => {
|
|
1464
|
-
var _a;
|
|
1465
|
-
if (!((_a = wrapRef.current) == null ? void 0 : _a.contains(event.target))) setIsListOpen(false);
|
|
1466
|
-
};
|
|
1467
|
-
const handleKeyDown = (event) => {
|
|
1468
|
-
if (event.key === "Escape") setIsListOpen(false);
|
|
1469
|
-
};
|
|
1470
|
-
document.addEventListener("mousedown", handlePointerDown);
|
|
1471
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
1472
|
-
return () => {
|
|
1473
|
-
document.removeEventListener("mousedown", handlePointerDown);
|
|
1474
|
-
document.removeEventListener("keydown", handleKeyDown);
|
|
1475
|
-
};
|
|
1476
|
-
}, [isListOpen]);
|
|
1477
|
-
const shownVenueTabs = useMemo3(() => {
|
|
1478
|
-
if (fit === null) return venueTabs;
|
|
1479
|
-
if (activeVenueIndex >= fit) {
|
|
1480
|
-
const activeVenueTab = venueTabs[activeVenueIndex];
|
|
1481
|
-
return activeVenueTab ? [...venueTabs.slice(0, Math.max(0, fit - 1)), activeVenueTab] : venueTabs.slice(0, fit);
|
|
1482
|
-
}
|
|
1483
|
-
return venueTabs.slice(0, fit);
|
|
1484
|
-
}, [activeVenueIndex, fit, venueTabs]);
|
|
1485
|
-
const foldedVenueTabs = useMemo3(
|
|
1486
|
-
() => venueTabs.filter((tab) => !shownVenueTabs.includes(tab)),
|
|
1487
|
-
[shownVenueTabs, venueTabs]
|
|
1488
|
-
);
|
|
1489
|
-
const foldedCount = foldedVenueTabs.length;
|
|
1490
|
-
const modeShape = fullWidth ? "tile" : "pill";
|
|
1491
|
-
const separator = /* @__PURE__ */ jsx3("span", { className: "mx-0.5 h-4 w-px shrink-0 bg-agg-separator", "aria-hidden": true });
|
|
1492
|
-
return /* @__PURE__ */ jsxs2(
|
|
1493
|
-
"div",
|
|
1494
|
-
{
|
|
1495
|
-
ref: wrapRef,
|
|
1496
|
-
className: cn(
|
|
1497
|
-
"agg-venue-strip relative flex min-w-0 max-w-full flex-col items-end",
|
|
1498
|
-
fullWidth && "w-full",
|
|
1499
|
-
className
|
|
1500
|
-
),
|
|
1501
|
-
children: [
|
|
1502
|
-
/* @__PURE__ */ jsx3("div", __spreadProps(__spreadValues({ "aria-hidden": true }, { inert: "" }), { className: "h-0 w-full overflow-hidden", children: /* @__PURE__ */ jsxs2(StripFrame, { frameRef: ghostRef, className: "w-max", children: [
|
|
1503
|
-
modeTabs.map((tab) => /* @__PURE__ */ jsx3(
|
|
1504
|
-
StripTile,
|
|
1505
|
-
{
|
|
1506
|
-
tab,
|
|
1507
|
-
isActive: tab.value === activeTab,
|
|
1508
|
-
shape: modeShape,
|
|
1509
|
-
showTooltip: false
|
|
1510
|
-
},
|
|
1511
|
-
tab.value
|
|
1512
|
-
)),
|
|
1513
|
-
venueTabs.length > 0 && modeTabs.length > 0 ? separator : null,
|
|
1514
|
-
venueTabs.map((tab) => /* @__PURE__ */ jsx3(
|
|
1515
|
-
StripTile,
|
|
1516
|
-
{
|
|
1517
|
-
tab,
|
|
1518
|
-
isActive: tab.value === activeTab,
|
|
1519
|
-
shape: "tile",
|
|
1520
|
-
showTooltip: false,
|
|
1521
|
-
isVenue: true
|
|
1522
|
-
},
|
|
1523
|
-
tab.value
|
|
1524
|
-
))
|
|
1525
|
-
] }) })),
|
|
1526
|
-
/* @__PURE__ */ jsxs2(StripFrame, { className: cn("agg-venue-strip-bar relative", fullWidth && "w-full"), children: [
|
|
1527
|
-
/* @__PURE__ */ jsxs2("div", { role: "group", "aria-label": ariaLabel, className: "contents", children: [
|
|
1528
|
-
modeTabs.map((tab) => /* @__PURE__ */ jsx3(
|
|
1529
|
-
StripTile,
|
|
1530
|
-
{
|
|
1531
|
-
tab,
|
|
1532
|
-
isActive: tab.value === activeTab,
|
|
1533
|
-
shape: modeShape,
|
|
1534
|
-
motionClassName,
|
|
1535
|
-
showTooltip: false,
|
|
1536
|
-
onSelect: onTabChange
|
|
1537
|
-
},
|
|
1538
|
-
tab.value
|
|
1539
|
-
)),
|
|
1540
|
-
venueTabs.length > 0 && modeTabs.length > 0 ? separator : null,
|
|
1541
|
-
shownVenueTabs.map((tab) => /* @__PURE__ */ jsx3(
|
|
1542
|
-
StripTile,
|
|
1543
|
-
{
|
|
1544
|
-
tab,
|
|
1545
|
-
isActive: tab.value === activeTab,
|
|
1546
|
-
shape: "tile",
|
|
1547
|
-
motionClassName,
|
|
1548
|
-
onSelect: onTabChange,
|
|
1549
|
-
isVenue: true
|
|
1550
|
-
},
|
|
1551
|
-
tab.value
|
|
1552
|
-
))
|
|
1553
|
-
] }),
|
|
1554
|
-
foldedCount > 0 ? /* @__PURE__ */ jsxs2(
|
|
1555
|
-
"button",
|
|
1556
|
-
{
|
|
1557
|
-
type: "button",
|
|
1558
|
-
"aria-haspopup": "listbox",
|
|
1559
|
-
"aria-expanded": isListOpen,
|
|
1560
|
-
"aria-label": labels.eventList.moreVenuesAria(foldedCount),
|
|
1561
|
-
onClick: () => setIsListOpen((open) => !open),
|
|
1562
|
-
className: cn(
|
|
1563
|
-
"agg-venue-strip-more inline-flex h-7 w-9 shrink-0 items-center justify-center",
|
|
1564
|
-
"rounded-agg-sm font-agg-sans text-agg-xs tabular-nums cursor-pointer",
|
|
1565
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary/40",
|
|
1566
|
-
motionClassName,
|
|
1567
|
-
fullWidth && "ml-auto",
|
|
1568
|
-
isListOpen ? "bg-agg-secondary-hover text-agg-foreground" : "text-agg-foreground/70 hover:bg-agg-secondary-hover hover:text-agg-foreground"
|
|
1569
|
-
),
|
|
1570
|
-
children: [
|
|
1571
|
-
"+",
|
|
1572
|
-
foldedCount
|
|
1573
|
-
]
|
|
1574
|
-
}
|
|
1575
|
-
) : null
|
|
1576
|
-
] }),
|
|
1577
|
-
isListOpen ? /* @__PURE__ */ jsx3(
|
|
1578
|
-
"div",
|
|
1579
|
-
{
|
|
1580
|
-
role: "listbox",
|
|
1581
|
-
"aria-label": labels.eventList.moreVenuesListAria,
|
|
1582
|
-
className: cn(
|
|
1583
|
-
"agg-venue-strip-list absolute right-0 top-[calc(100%+6px)] z-20 flex flex-col",
|
|
1584
|
-
"rounded-agg-lg border border-agg-separator bg-agg-secondary p-1.5 shadow-agg-card-hover",
|
|
1585
|
-
fullWidth ? "left-0" : "w-[248px]"
|
|
1586
|
-
),
|
|
1587
|
-
children: /* @__PURE__ */ jsx3("div", { className: "flex max-h-[352px] flex-col overflow-y-auto", children: foldedVenueTabs.map((tab) => {
|
|
1588
|
-
const isActive = tab.value === activeTab;
|
|
1589
|
-
const isUnavailable = isTabUnavailable(tab);
|
|
1590
|
-
return /* @__PURE__ */ jsxs2(
|
|
1591
|
-
"button",
|
|
1592
|
-
{
|
|
1593
|
-
type: "button",
|
|
1594
|
-
role: "option",
|
|
1595
|
-
"aria-selected": isActive,
|
|
1596
|
-
"aria-disabled": isUnavailable || void 0,
|
|
1597
|
-
disabled: isUnavailable,
|
|
1598
|
-
onClick: () => {
|
|
1599
|
-
onTabChange(tab.value);
|
|
1600
|
-
setIsListOpen(false);
|
|
1601
|
-
},
|
|
1602
|
-
className: cn(
|
|
1603
|
-
"flex h-8 shrink-0 items-center gap-2.5 rounded-agg-sm px-2.5",
|
|
1604
|
-
"font-agg-sans text-agg-sm leading-agg-5 cursor-pointer disabled:cursor-not-allowed",
|
|
1605
|
-
motionClassName,
|
|
1606
|
-
isActive ? "bg-agg-primary/10 text-agg-primary" : "text-agg-foreground hover:bg-agg-secondary-hover",
|
|
1607
|
-
isUnavailable && "opacity-50 hover:bg-transparent"
|
|
1608
|
-
),
|
|
1609
|
-
children: [
|
|
1610
|
-
tab.iconName === "warning-filled" ? /* @__PURE__ */ jsx3(Icon, { name: "warning-filled", size: "small", color: "currentColor" }) : tab.venueLogo ? /* @__PURE__ */ jsx3(VenueLogo, { venue: tab.venueLogo, size: "small", className: "shrink-0" }) : null,
|
|
1611
|
-
/* @__PURE__ */ jsx3("span", { className: "flex-1 truncate text-left", children: resolveTabLabel(tab) })
|
|
1612
|
-
]
|
|
1613
|
-
},
|
|
1614
|
-
tab.value
|
|
1615
|
-
);
|
|
1616
|
-
}) })
|
|
1617
|
-
}
|
|
1618
|
-
) : null
|
|
1619
|
-
]
|
|
1620
|
-
}
|
|
1621
|
-
);
|
|
1622
|
-
};
|
|
1623
|
-
EventListVenueStrip.displayName = "EventListVenueStrip";
|
|
1624
|
-
|
|
1625
|
-
// src/events/list/index.tsx
|
|
1626
|
-
import {
|
|
1627
|
-
MarketStatus,
|
|
1628
|
-
getVisibleVenueIdsByConfig,
|
|
1629
|
-
useAppConfig as useAppConfig3,
|
|
1630
|
-
useCategories,
|
|
1631
|
-
useCategoryChildren,
|
|
1632
|
-
useLabels as useLabels4,
|
|
1633
|
-
useSdkUiConfig as useSdkUiConfig3,
|
|
1634
|
-
useVenueEvents,
|
|
1635
|
-
useVenueMarketMidpoints as useVenueMarketMidpoints2
|
|
1636
|
-
} from "@agg-build/hooks";
|
|
1637
|
-
import { VENUES } from "@agg-build/sdk";
|
|
1638
|
-
import * as Dialog from "@radix-ui/react-dialog";
|
|
1639
|
-
import { useCallback as useCallback3, useEffect as useEffect4, useMemo as useMemo5, useRef as useRef4, useState as useState4 } from "react";
|
|
1640
|
-
|
|
1641
|
-
// src/events/list/category-sidebar.tsx
|
|
1642
|
-
import { useMemo as useMemo4 } from "react";
|
|
1643
|
-
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1644
|
-
var rowBase = cn(
|
|
1645
|
-
"flex min-h-11 w-full items-center gap-3 rounded-[6px] px-3 py-3",
|
|
1646
|
-
"text-left text-agg-sm font-agg-normal leading-agg-5",
|
|
1647
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-1 focus-visible:ring-offset-agg-secondary"
|
|
1648
|
-
);
|
|
1649
|
-
var idleRowClassName = cn(
|
|
1650
|
-
rowBase,
|
|
1651
|
-
"cursor-pointer text-agg-foreground hover:bg-agg-secondary-hover"
|
|
1652
|
-
);
|
|
1653
|
-
var selectedRowClassName = cn(rowBase, "cursor-pointer bg-agg-primary/10 text-agg-primary");
|
|
1654
|
-
var CategorySidebar = ({
|
|
1655
|
-
baseCategoryId,
|
|
1656
|
-
childrenByParentId,
|
|
1657
|
-
categoryPath,
|
|
1658
|
-
collapsedCategoryIds,
|
|
1659
|
-
totalEventCount,
|
|
1660
|
-
labels,
|
|
1661
|
-
onSelectAll,
|
|
1662
|
-
onToggleCategory
|
|
1663
|
-
}) => {
|
|
1664
|
-
const isDrilledIn = categoryPath.length > 0;
|
|
1665
|
-
const sortedBaseChildren = useMemo4(() => {
|
|
1666
|
-
var _a;
|
|
1667
|
-
if (!baseCategoryId) return [];
|
|
1668
|
-
const children = [...(_a = childrenByParentId.get(baseCategoryId)) != null ? _a : []];
|
|
1669
|
-
return children.sort((a, b) => {
|
|
1670
|
-
var _a2, _b, _c, _d;
|
|
1671
|
-
const aHasChildren = ((_b = (_a2 = childrenByParentId.get(a.id)) == null ? void 0 : _a2.length) != null ? _b : 0) > 0;
|
|
1672
|
-
const bHasChildren = ((_d = (_c = childrenByParentId.get(b.id)) == null ? void 0 : _c.length) != null ? _d : 0) > 0;
|
|
1673
|
-
if (aHasChildren === bHasChildren) return 0;
|
|
1674
|
-
return aHasChildren ? -1 : 1;
|
|
1675
|
-
});
|
|
1676
|
-
}, [baseCategoryId, childrenByParentId]);
|
|
1677
|
-
const renderRow = ({
|
|
1678
|
-
entry,
|
|
1679
|
-
isExpanded,
|
|
1680
|
-
isSelected,
|
|
1681
|
-
onClick
|
|
1682
|
-
}) => {
|
|
1683
|
-
var _a, _b;
|
|
1684
|
-
const hasKnownChildren = ((_b = (_a = childrenByParentId.get(entry.id)) == null ? void 0 : _a.length) != null ? _b : 0) > 0;
|
|
1685
|
-
return /* @__PURE__ */ jsxs3(
|
|
1686
|
-
"button",
|
|
1687
|
-
{
|
|
1688
|
-
type: "button",
|
|
1689
|
-
"aria-current": isSelected ? "true" : void 0,
|
|
1690
|
-
"aria-expanded": hasKnownChildren ? isExpanded : void 0,
|
|
1691
|
-
className: isSelected ? selectedRowClassName : idleRowClassName,
|
|
1692
|
-
onClick,
|
|
1693
|
-
children: [
|
|
1694
|
-
/* @__PURE__ */ jsx4("span", { className: "min-w-0 flex-1 truncate first-letter:uppercase", children: entry.label }),
|
|
1695
|
-
hasKnownChildren ? /* @__PURE__ */ jsx4(
|
|
1696
|
-
Icon,
|
|
1697
|
-
{
|
|
1698
|
-
name: isExpanded ? "chevron-up" : "chevron-down",
|
|
1699
|
-
size: "small",
|
|
1700
|
-
color: "currentColor",
|
|
1701
|
-
className: "shrink-0 text-agg-muted-foreground"
|
|
1702
|
-
}
|
|
1703
|
-
) : /* @__PURE__ */ jsx4("span", { className: "shrink-0 text-agg-muted-foreground", children: entry.eventCount })
|
|
1704
|
-
]
|
|
1705
|
-
},
|
|
1706
|
-
entry.id
|
|
1707
|
-
);
|
|
1708
|
-
};
|
|
1709
|
-
const renderBranch = (category, depth) => {
|
|
1710
|
-
var _a, _b, _c, _d, _e;
|
|
1711
|
-
const label = (_a = category.displayName) != null ? _a : category.name;
|
|
1712
|
-
const entry = {
|
|
1713
|
-
id: category.id,
|
|
1714
|
-
label,
|
|
1715
|
-
eventCount: (_b = category.eventCount) != null ? _b : 0
|
|
1716
|
-
};
|
|
1717
|
-
const childCategories = (_c = childrenByParentId.get(category.id)) != null ? _c : [];
|
|
1718
|
-
const hasKnownChildren = childCategories.length > 0;
|
|
1719
|
-
const isExpanded = ((_d = categoryPath[depth]) == null ? void 0 : _d.id) === category.id && !collapsedCategoryIds.has(category.id);
|
|
1720
|
-
const isSelected = ((_e = categoryPath[depth]) == null ? void 0 : _e.id) === category.id && categoryPath.length === depth + 1;
|
|
1721
|
-
return /* @__PURE__ */ jsxs3("div", { className: "flex w-full flex-col", children: [
|
|
1722
|
-
renderRow({
|
|
1723
|
-
entry,
|
|
1724
|
-
isExpanded,
|
|
1725
|
-
isSelected,
|
|
1726
|
-
onClick: () => onToggleCategory({ entry, depth, hasKnownChildren, isExpanded, isSelected })
|
|
1727
|
-
}),
|
|
1728
|
-
/* @__PURE__ */ jsx4(
|
|
1729
|
-
"div",
|
|
1730
|
-
{
|
|
1731
|
-
className: cn(
|
|
1732
|
-
"grid transition-[grid-template-rows] duration-150 ease-in-out motion-reduce:transition-none",
|
|
1733
|
-
isExpanded ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
1734
|
-
),
|
|
1735
|
-
children: /* @__PURE__ */ jsx4("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx4("div", { className: "flex w-full flex-col gap-1 pl-4 pt-1", children: childCategories.map((child) => renderBranch(child, depth + 1)) }) })
|
|
1736
|
-
}
|
|
1737
|
-
)
|
|
1738
|
-
] }, category.id);
|
|
1739
|
-
};
|
|
1740
|
-
return /* @__PURE__ */ jsxs3("div", { className: "flex w-full flex-col gap-1", children: [
|
|
1741
|
-
/* @__PURE__ */ jsxs3(
|
|
1742
|
-
"button",
|
|
1743
|
-
{
|
|
1744
|
-
type: "button",
|
|
1745
|
-
"aria-current": !isDrilledIn ? "true" : void 0,
|
|
1746
|
-
className: !isDrilledIn ? selectedRowClassName : idleRowClassName,
|
|
1747
|
-
onClick: onSelectAll,
|
|
1748
|
-
children: [
|
|
1749
|
-
/* @__PURE__ */ jsx4("span", { className: "min-w-0 flex-1 truncate", children: labels.subcategoriesAll }),
|
|
1750
|
-
/* @__PURE__ */ jsx4("span", { className: "shrink-0 text-agg-muted-foreground", children: totalEventCount })
|
|
1751
|
-
]
|
|
1752
|
-
}
|
|
1753
|
-
),
|
|
1754
|
-
sortedBaseChildren.map((category) => renderBranch(category, 0))
|
|
1755
|
-
] });
|
|
1756
|
-
};
|
|
1757
|
-
CategorySidebar.displayName = "CategorySidebar";
|
|
1758
|
-
|
|
1759
|
-
// src/events/list/index.tsx
|
|
1760
|
-
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1761
|
-
var SORT_ICON_BY_VALUE = {
|
|
1762
|
-
volume24hr: "sort-volume-24hr",
|
|
1763
|
-
topArbitrage: "sort-top-arbitrage",
|
|
1764
|
-
volume: "sort-volume",
|
|
1765
|
-
endDate: "sort-end-date"
|
|
1766
|
-
};
|
|
1767
|
-
var resolveSortQueryParams = (value) => {
|
|
1768
|
-
if (value === "volume") {
|
|
1769
|
-
return { sortBy: "volume", sortDir: "desc" };
|
|
1770
|
-
}
|
|
1771
|
-
if (value === "endDate") {
|
|
1772
|
-
return { sortBy: "endDate", sortDir: "asc" };
|
|
1773
|
-
}
|
|
1774
|
-
if (value === "topArbitrage") {
|
|
1775
|
-
return {
|
|
1776
|
-
sortBy: "arbReturn",
|
|
1777
|
-
sortDir: "desc"
|
|
1778
|
-
};
|
|
1779
|
-
}
|
|
1780
|
-
return { sortBy: "volume24hr", sortDir: "desc" };
|
|
1781
|
-
};
|
|
1782
|
-
var collectEventListVenueMarkets = (events) => {
|
|
1783
|
-
return events.flatMap((event) => {
|
|
1784
|
-
var _a;
|
|
1785
|
-
return (_a = event.venueMarkets) != null ? _a : [];
|
|
1786
|
-
});
|
|
1787
|
-
};
|
|
1788
|
-
var collectMidpointVenueMarketIds = (venueMarkets) => {
|
|
1789
|
-
var _a;
|
|
1790
|
-
const ids = [];
|
|
1791
|
-
for (const market of venueMarkets) {
|
|
1792
|
-
ids.push(market.id);
|
|
1793
|
-
for (const sibling of (_a = market.matchedVenueMarkets) != null ? _a : []) {
|
|
1794
|
-
ids.push(sibling.id);
|
|
1795
|
-
}
|
|
1796
|
-
}
|
|
1797
|
-
return [...new Set(ids)];
|
|
1798
|
-
};
|
|
1799
|
-
var EventList = ({
|
|
1800
|
-
title,
|
|
1801
|
-
limit = DEFAULT_EVENTS_LIMIT,
|
|
1802
|
-
maxVisibleItems,
|
|
1803
|
-
search,
|
|
1804
|
-
categoryIds,
|
|
1805
|
-
onCategoryRootChange,
|
|
1806
|
-
onEventClick,
|
|
1807
|
-
onMarketClick,
|
|
1808
|
-
getMarketHref,
|
|
1809
|
-
getEventHref,
|
|
1810
|
-
initialVenueTab,
|
|
1811
|
-
activeVenueTab: controlledActiveVenueTab,
|
|
1812
|
-
onActiveVenueTabChange,
|
|
1813
|
-
selectedSort: controlledSelectedSort,
|
|
1814
|
-
onSelectedSortChange,
|
|
1815
|
-
categoryPath: controlledCategoryPath,
|
|
1816
|
-
onCategoryPathChange,
|
|
1817
|
-
initialLoadedPageCount,
|
|
1818
|
-
stateRef
|
|
1819
|
-
}) => {
|
|
1820
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1821
|
-
const labels = useLabels4();
|
|
1822
|
-
const { disabledVenues } = useAppConfig3();
|
|
1823
|
-
const {
|
|
1824
|
-
features: { enableVenueEventDiscoveryFilters, showSportsMarkets },
|
|
1825
|
-
market: { minVolume }
|
|
1826
|
-
} = useSdkUiConfig3();
|
|
1827
|
-
const isDiscoveryFiltersEnabled = enableVenueEventDiscoveryFilters && !search;
|
|
1828
|
-
const resolvedTabs = useEventListTabs();
|
|
1829
|
-
const visibleVenues = useMemo5(
|
|
1830
|
-
() => disabledVenues.length === 0 ? void 0 : getVisibleVenueIdsByConfig(VENUES, disabledVenues),
|
|
1831
|
-
[disabledVenues]
|
|
1832
|
-
);
|
|
1833
|
-
const [internalActiveTabValue, setInternalActiveTabValue] = useState4(
|
|
1834
|
-
(_b = initialVenueTab != null ? initialVenueTab : (_a = resolvedTabs[0]) == null ? void 0 : _a.value) != null ? _b : "matched"
|
|
1835
|
-
);
|
|
1836
|
-
const activeTabValue = controlledActiveVenueTab != null ? controlledActiveVenueTab : internalActiveTabValue;
|
|
1837
|
-
const [internalSelectedSort, setInternalSelectedSort] = useState4(DEFAULT_EVENT_LIST_SORT);
|
|
1838
|
-
const selectedSort = controlledSelectedSort != null ? controlledSelectedSort : internalSelectedSort;
|
|
1839
|
-
const [isSubcategoriesModalOpen, setIsSubcategoriesModalOpen] = useState4(false);
|
|
1840
|
-
const [internalCategoryPath, setInternalCategoryPath] = useState4([]);
|
|
1841
|
-
const categoryPath = controlledCategoryPath != null ? controlledCategoryPath : internalCategoryPath;
|
|
1842
|
-
const [collapsedCategoryIds, setCollapsedCategoryIds] = useState4(() => /* @__PURE__ */ new Set());
|
|
1843
|
-
const handleActiveTabChange = useCallback3(
|
|
1844
|
-
(value) => {
|
|
1845
|
-
if (controlledActiveVenueTab == null) setInternalActiveTabValue(value);
|
|
1846
|
-
onActiveVenueTabChange == null ? void 0 : onActiveVenueTabChange(value, { history: "push" });
|
|
1847
|
-
},
|
|
1848
|
-
[controlledActiveVenueTab, onActiveVenueTabChange]
|
|
1849
|
-
);
|
|
1850
|
-
const handleSelectedSortChange = useCallback3(
|
|
1851
|
-
(value) => {
|
|
1852
|
-
if (controlledSelectedSort == null) setInternalSelectedSort(value);
|
|
1853
|
-
onSelectedSortChange == null ? void 0 : onSelectedSortChange(value, { history: "push" });
|
|
1854
|
-
},
|
|
1855
|
-
[controlledSelectedSort, onSelectedSortChange]
|
|
1856
|
-
);
|
|
1857
|
-
const handleCategoryPathChange = useCallback3(
|
|
1858
|
-
(value, options) => {
|
|
1859
|
-
if (controlledCategoryPath == null) setInternalCategoryPath(value);
|
|
1860
|
-
onCategoryPathChange == null ? void 0 : onCategoryPathChange(value, options);
|
|
1861
|
-
},
|
|
1862
|
-
[controlledCategoryPath, onCategoryPathChange]
|
|
1863
|
-
);
|
|
1864
|
-
const sortItems = useMemo5(() => {
|
|
1865
|
-
return [
|
|
1866
|
-
{
|
|
1867
|
-
value: "volume24hr",
|
|
1868
|
-
label: labels.eventList.sortBy24hVolume,
|
|
1869
|
-
icon: /* @__PURE__ */ jsx5(Icon, { name: SORT_ICON_BY_VALUE.volume24hr, size: "small", color: "currentColor" })
|
|
1870
|
-
},
|
|
1871
|
-
{
|
|
1872
|
-
value: "topArbitrage",
|
|
1873
|
-
label: labels.eventList.sortByTopArbitrage,
|
|
1874
|
-
icon: /* @__PURE__ */ jsx5(Icon, { name: SORT_ICON_BY_VALUE.topArbitrage, size: "small", color: "currentColor" })
|
|
1875
|
-
},
|
|
1876
|
-
{
|
|
1877
|
-
value: "volume",
|
|
1878
|
-
label: labels.eventList.sortByTotalVolume,
|
|
1879
|
-
icon: /* @__PURE__ */ jsx5(Icon, { name: SORT_ICON_BY_VALUE.volume, size: "small", color: "currentColor" })
|
|
1880
|
-
},
|
|
1881
|
-
{
|
|
1882
|
-
value: "endDate",
|
|
1883
|
-
label: labels.eventList.sortByEndingSoon,
|
|
1884
|
-
icon: /* @__PURE__ */ jsx5(Icon, { name: SORT_ICON_BY_VALUE.endDate, size: "small", color: "currentColor" })
|
|
1885
|
-
}
|
|
1886
|
-
];
|
|
1887
|
-
}, [
|
|
1888
|
-
labels.eventList.sortBy24hVolume,
|
|
1889
|
-
labels.eventList.sortByEndingSoon,
|
|
1890
|
-
labels.eventList.sortByTopArbitrage,
|
|
1891
|
-
labels.eventList.sortByTotalVolume
|
|
1892
|
-
]);
|
|
1893
|
-
const baseCategoryId = (_c = categoryIds == null ? void 0 : categoryIds[0]) != null ? _c : null;
|
|
1894
|
-
const previousBaseCategoryIdRef = useRef4(baseCategoryId);
|
|
1895
|
-
useEffect4(() => {
|
|
1896
|
-
var _a2, _b2;
|
|
1897
|
-
if (previousBaseCategoryIdRef.current === baseCategoryId) return;
|
|
1898
|
-
previousBaseCategoryIdRef.current = baseCategoryId;
|
|
1899
|
-
if (controlledActiveVenueTab == null) {
|
|
1900
|
-
setInternalActiveTabValue((_b2 = (_a2 = resolvedTabs[0]) == null ? void 0 : _a2.value) != null ? _b2 : "matched");
|
|
1901
|
-
}
|
|
1902
|
-
if (controlledSelectedSort == null) setInternalSelectedSort(DEFAULT_EVENT_LIST_SORT);
|
|
1903
|
-
if (!isDiscoveryFiltersEnabled) return;
|
|
1904
|
-
if (controlledCategoryPath == null) setInternalCategoryPath([]);
|
|
1905
|
-
setCollapsedCategoryIds(/* @__PURE__ */ new Set());
|
|
1906
|
-
}, [
|
|
1907
|
-
baseCategoryId,
|
|
1908
|
-
controlledActiveVenueTab,
|
|
1909
|
-
controlledCategoryPath,
|
|
1910
|
-
controlledSelectedSort,
|
|
1911
|
-
isDiscoveryFiltersEnabled,
|
|
1912
|
-
resolvedTabs
|
|
1913
|
-
]);
|
|
1914
|
-
const { categories: topLevelCategories } = useCategories({
|
|
1915
|
-
queryKeyScope: "event-list-top-categories",
|
|
1916
|
-
enabled: isDiscoveryFiltersEnabled,
|
|
1917
|
-
limit: 100
|
|
1918
|
-
});
|
|
1919
|
-
const sortedTopLevelCategories = useMemo5(() => {
|
|
1920
|
-
return sortCategoriesForNavigation(topLevelCategories);
|
|
1921
|
-
}, [topLevelCategories]);
|
|
1922
|
-
const baseCategoryChildPrefetchIds = useMemo5(() => {
|
|
1923
|
-
return Array.from(
|
|
1924
|
-
/* @__PURE__ */ new Set([
|
|
1925
|
-
...baseCategoryId ? [baseCategoryId] : [],
|
|
1926
|
-
...sortedTopLevelCategories.map((category) => category.id),
|
|
1927
|
-
...categoryPath.map((category) => category.id)
|
|
1928
|
-
])
|
|
1929
|
-
);
|
|
1930
|
-
}, [baseCategoryId, categoryPath, sortedTopLevelCategories]);
|
|
1931
|
-
const { childrenByParentId: baseChildrenByParentId, isLoading: isBaseCategoryChildrenLoading } = useCategoryChildren({
|
|
1932
|
-
queryKeyScope: "event-list-category-children",
|
|
1933
|
-
enabled: isDiscoveryFiltersEnabled,
|
|
1934
|
-
parentIds: baseCategoryChildPrefetchIds,
|
|
1935
|
-
limit: 100
|
|
1936
|
-
});
|
|
1937
|
-
const visibleChildPrefetchIds = useMemo5(() => {
|
|
1938
|
-
var _a2, _b2;
|
|
1939
|
-
const ids = /* @__PURE__ */ new Set();
|
|
1940
|
-
if (baseCategoryId) {
|
|
1941
|
-
for (const child of (_a2 = baseChildrenByParentId.get(baseCategoryId)) != null ? _a2 : []) {
|
|
1942
|
-
ids.add(child.id);
|
|
1943
|
-
}
|
|
1944
|
-
}
|
|
1945
|
-
for (const expandedCategory of categoryPath) {
|
|
1946
|
-
for (const childCategory of (_b2 = baseChildrenByParentId.get(expandedCategory.id)) != null ? _b2 : []) {
|
|
1947
|
-
ids.add(childCategory.id);
|
|
1948
|
-
}
|
|
1949
|
-
}
|
|
1950
|
-
return Array.from(ids);
|
|
1951
|
-
}, [baseCategoryId, baseChildrenByParentId, categoryPath]);
|
|
1952
|
-
const { childrenByParentId: visibleChildrenByParentId } = useCategoryChildren({
|
|
1953
|
-
queryKeyScope: "event-list-category-children",
|
|
1954
|
-
enabled: isDiscoveryFiltersEnabled,
|
|
1955
|
-
parentIds: visibleChildPrefetchIds,
|
|
1956
|
-
limit: 100
|
|
1957
|
-
});
|
|
1958
|
-
const visibleGrandchildPrefetchIds = useMemo5(() => {
|
|
1959
|
-
var _a2;
|
|
1960
|
-
const ids = /* @__PURE__ */ new Set();
|
|
1961
|
-
for (const expandedCategory of categoryPath) {
|
|
1962
|
-
for (const childCategory of (_a2 = visibleChildrenByParentId.get(expandedCategory.id)) != null ? _a2 : []) {
|
|
1963
|
-
ids.add(childCategory.id);
|
|
1964
|
-
}
|
|
1965
|
-
}
|
|
1966
|
-
return Array.from(ids);
|
|
1967
|
-
}, [categoryPath, visibleChildrenByParentId]);
|
|
1968
|
-
const { childrenByParentId: visibleGrandchildrenByParentId } = useCategoryChildren({
|
|
1969
|
-
queryKeyScope: "event-list-category-children",
|
|
1970
|
-
enabled: isDiscoveryFiltersEnabled,
|
|
1971
|
-
parentIds: visibleGrandchildPrefetchIds,
|
|
1972
|
-
limit: 100
|
|
1973
|
-
});
|
|
1974
|
-
const childrenByParentId = useMemo5(() => {
|
|
1975
|
-
return new Map([
|
|
1976
|
-
...baseChildrenByParentId,
|
|
1977
|
-
...visibleChildrenByParentId,
|
|
1978
|
-
...visibleGrandchildrenByParentId
|
|
1979
|
-
]);
|
|
1980
|
-
}, [baseChildrenByParentId, visibleChildrenByParentId, visibleGrandchildrenByParentId]);
|
|
1981
|
-
const controlledCategoryPathKey = (_d = controlledCategoryPath == null ? void 0 : controlledCategoryPath.map((entry) => entry.id).join(",")) != null ? _d : "";
|
|
1982
|
-
const controlledCategoryPathValidationKey = `${baseCategoryId != null ? baseCategoryId : ""}|${controlledCategoryPathKey}`;
|
|
1983
|
-
const [validatedCategoryPathKey, setValidatedCategoryPathKey] = useState4(
|
|
1984
|
-
() => controlledCategoryPath == null || controlledCategoryPath.length === 0 ? controlledCategoryPathValidationKey : ""
|
|
1985
|
-
);
|
|
1986
|
-
useEffect4(() => {
|
|
1987
|
-
if (controlledCategoryPath == null || controlledCategoryPath.length === 0) {
|
|
1988
|
-
setValidatedCategoryPathKey(controlledCategoryPathValidationKey);
|
|
1989
|
-
return;
|
|
1990
|
-
}
|
|
1991
|
-
if (isBaseCategoryChildrenLoading) return;
|
|
1992
|
-
const requestedIds = controlledCategoryPath.map((entry) => entry.id);
|
|
1993
|
-
const validIds = validateSubcategoryPath(requestedIds, baseCategoryId, baseChildrenByParentId);
|
|
1994
|
-
if (validIds.length !== requestedIds.length) {
|
|
1995
|
-
handleCategoryPathChange(controlledCategoryPath.slice(0, validIds.length), {
|
|
1996
|
-
history: "replace"
|
|
1997
|
-
});
|
|
1998
|
-
return;
|
|
1999
|
-
}
|
|
2000
|
-
setValidatedCategoryPathKey(controlledCategoryPathValidationKey);
|
|
2001
|
-
}, [
|
|
2002
|
-
baseCategoryId,
|
|
2003
|
-
baseChildrenByParentId,
|
|
2004
|
-
controlledCategoryPath,
|
|
2005
|
-
controlledCategoryPathKey,
|
|
2006
|
-
controlledCategoryPathValidationKey,
|
|
2007
|
-
handleCategoryPathChange,
|
|
2008
|
-
isBaseCategoryChildrenLoading
|
|
2009
|
-
]);
|
|
2010
|
-
const shouldRenderSubcategoryFilters = isDiscoveryFiltersEnabled && baseCategoryId !== null && (((_f = (_e = childrenByParentId.get(baseCategoryId)) == null ? void 0 : _e.length) != null ? _f : 0) > 0 || categoryPath.length > 0);
|
|
2011
|
-
const baseCategoryEventCount = useMemo5(() => {
|
|
2012
|
-
var _a2, _b2;
|
|
2013
|
-
return (_b2 = (_a2 = sortedTopLevelCategories.find((c) => c.id === baseCategoryId)) == null ? void 0 : _a2.eventCount) != null ? _b2 : 0;
|
|
2014
|
-
}, [baseCategoryId, sortedTopLevelCategories]);
|
|
2015
|
-
const resolvedCategoryIds = useMemo5(() => {
|
|
2016
|
-
if (!isDiscoveryFiltersEnabled) return categoryIds;
|
|
2017
|
-
return resolveCategoryIdsFromPath(categoryPath, baseCategoryId ? [baseCategoryId] : void 0);
|
|
2018
|
-
}, [baseCategoryId, categoryIds, categoryPath, isDiscoveryFiltersEnabled]);
|
|
2019
|
-
const sortQueryParams = useMemo5(() => {
|
|
2020
|
-
return resolveSortQueryParams(selectedSort);
|
|
2021
|
-
}, [selectedSort]);
|
|
2022
|
-
const activeTab = useMemo5(() => {
|
|
2023
|
-
return resolvedTabs.find((tab) => tab.value === activeTabValue);
|
|
2024
|
-
}, [activeTabValue, resolvedTabs]);
|
|
2025
|
-
const venues = useMemo5(() => {
|
|
2026
|
-
return resolveTabVenus(activeTab, visibleVenues);
|
|
2027
|
-
}, [activeTab, visibleVenues]);
|
|
2028
|
-
const matchStatus = useMemo5(() => {
|
|
2029
|
-
return activeTabValue === "matched" ? activeTab == null ? void 0 : activeTab.matchStatus : void 0;
|
|
2030
|
-
}, [activeTabValue, activeTab]);
|
|
2031
|
-
const resolvedMaxVisibleItems = useMemo5(() => {
|
|
2032
|
-
if (!Number.isFinite(maxVisibleItems)) return void 0;
|
|
2033
|
-
return Math.max(1, Math.floor(maxVisibleItems));
|
|
2034
|
-
}, [maxVisibleItems]);
|
|
2035
|
-
const requestLimit = resolvedMaxVisibleItems != null ? resolvedMaxVisibleItems : limit;
|
|
2036
|
-
const shouldPaginate = resolvedMaxVisibleItems == null;
|
|
2037
|
-
const endDateFrom = useMemo5(() => {
|
|
2038
|
-
if (search) return void 0;
|
|
2039
|
-
const BUCKET_MINUTES = 5;
|
|
2040
|
-
const bucket = /* @__PURE__ */ new Date();
|
|
2041
|
-
bucket.setMinutes(Math.floor(bucket.getMinutes() / BUCKET_MINUTES) * BUCKET_MINUTES, 0, 0);
|
|
2042
|
-
return bucket.toISOString();
|
|
2043
|
-
}, [search]);
|
|
2044
|
-
const {
|
|
2045
|
-
events,
|
|
2046
|
-
isLoading,
|
|
2047
|
-
isError,
|
|
2048
|
-
fetchNextPage,
|
|
2049
|
-
hasNextPage,
|
|
2050
|
-
isFetchingNextPage,
|
|
2051
|
-
isPlaceholderData,
|
|
2052
|
-
loadedPageCount
|
|
2053
|
-
} = useVenueEvents({
|
|
2054
|
-
queryKeyScope: "event-list",
|
|
2055
|
-
venues,
|
|
2056
|
-
search,
|
|
2057
|
-
categoryIds: resolvedCategoryIds,
|
|
2058
|
-
matchStatus,
|
|
2059
|
-
limit: requestLimit,
|
|
2060
|
-
status: [MarketStatus.open],
|
|
2061
|
-
sortBy: sortQueryParams.sortBy,
|
|
2062
|
-
sortDir: sortQueryParams.sortDir,
|
|
2063
|
-
endDateFrom,
|
|
2064
|
-
// Fold same-venue companion events into one tile per game when the sports
|
|
2065
|
-
// markets experience is enabled (the sports event-detail view loads the
|
|
2066
|
-
// folded companions via aggKey). Gated on the same flag as that view.
|
|
2067
|
-
grouped: showSportsMarkets,
|
|
2068
|
-
minVolume,
|
|
2069
|
-
initialPages: initialLoadedPageCount,
|
|
2070
|
-
enabled: controlledCategoryPath == null || validatedCategoryPathKey === controlledCategoryPathValidationKey
|
|
2071
|
-
});
|
|
2072
|
-
useEffect4(() => {
|
|
2073
|
-
if (stateRef) {
|
|
2074
|
-
stateRef.current = { venueTab: activeTabValue, loadedPageCount };
|
|
2075
|
-
}
|
|
2076
|
-
}, [stateRef, activeTabValue, loadedPageCount]);
|
|
2077
|
-
const filteredEvents = useMemo5(() => {
|
|
2078
|
-
return filterEventsByTabValue(events, activeTabValue);
|
|
2079
|
-
}, [events, activeTabValue]);
|
|
2080
|
-
const groupedEvents = useMemo5(() => {
|
|
2081
|
-
return splitEventsByLifecycle(filteredEvents);
|
|
2082
|
-
}, [filteredEvents]);
|
|
2083
|
-
const orderedEvents = useMemo5(() => {
|
|
2084
|
-
return groupedEvents.open;
|
|
2085
|
-
}, [groupedEvents.open]);
|
|
2086
|
-
const tileEvents = useMemo5(() => {
|
|
2087
|
-
const normalizedEvents = orderedEvents.map((event) => mapEventToEventListItemEvent(event)).filter((event) => event != null);
|
|
2088
|
-
if (resolvedMaxVisibleItems == null) return normalizedEvents;
|
|
2089
|
-
return normalizedEvents.slice(0, resolvedMaxVisibleItems);
|
|
2090
|
-
}, [orderedEvents, resolvedMaxVisibleItems]);
|
|
2091
|
-
const visibleVenueMarkets = useMemo5(() => {
|
|
2092
|
-
return collectEventListVenueMarkets(tileEvents);
|
|
2093
|
-
}, [tileEvents]);
|
|
2094
|
-
const visibleMidpointVenueMarketIds = useMemo5(() => {
|
|
2095
|
-
return collectMidpointVenueMarketIds(visibleVenueMarkets);
|
|
2096
|
-
}, [visibleVenueMarkets]);
|
|
2097
|
-
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = useVenueMarketMidpoints2({
|
|
2098
|
-
venueMarketIds: visibleMidpointVenueMarketIds,
|
|
2099
|
-
enabled: visibleMidpointVenueMarketIds.length > 0
|
|
2100
|
-
});
|
|
2101
|
-
const shouldRenderLoadingState = isLoading && !isPlaceholderData && tileEvents.length === 0;
|
|
2102
|
-
const shouldRenderEmptyState = !isLoading && !isError && tileEvents.length === 0;
|
|
2103
|
-
const placeholderSkeletonCount = isPlaceholderData ? Math.min(Math.max(tileEvents.length, PLACEHOLDER_SKELETON_MIN_ITEMS), requestLimit) : 0;
|
|
2104
|
-
const shouldRenderPaginationLoadingItems = shouldPaginate && hasNextPage && !isPlaceholderData;
|
|
2105
|
-
const loadMoreRef = useRef4(null);
|
|
2106
|
-
useEffect4(() => {
|
|
2107
|
-
if (!shouldPaginate) return;
|
|
2108
|
-
if (!hasNextPage) return;
|
|
2109
|
-
if (typeof IntersectionObserver === "undefined") return;
|
|
2110
|
-
const target = loadMoreRef.current;
|
|
2111
|
-
if (!target) return;
|
|
2112
|
-
const observer = new IntersectionObserver(
|
|
2113
|
-
(entries) => {
|
|
2114
|
-
const entry = entries[0];
|
|
2115
|
-
if (!(entry == null ? void 0 : entry.isIntersecting)) return;
|
|
2116
|
-
if (isLoading || isFetchingNextPage || !hasNextPage) return;
|
|
2117
|
-
void fetchNextPage();
|
|
2118
|
-
},
|
|
2119
|
-
{
|
|
2120
|
-
rootMargin: "320px 0px"
|
|
2121
|
-
}
|
|
2122
|
-
);
|
|
2123
|
-
observer.observe(target);
|
|
2124
|
-
return () => {
|
|
2125
|
-
observer.disconnect();
|
|
2126
|
-
};
|
|
2127
|
-
}, [fetchNextPage, hasNextPage, isFetchingNextPage, isLoading, shouldPaginate]);
|
|
2128
|
-
const gridClassName = cn(
|
|
2129
|
-
"grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] md:grid-cols-[repeat(auto-fill,minmax(360px,1fr))] gap-4"
|
|
2130
|
-
);
|
|
2131
|
-
const handleSelectAllCategories = () => {
|
|
2132
|
-
handleCategoryPathChange([], { history: "push" });
|
|
2133
|
-
setCollapsedCategoryIds(/* @__PURE__ */ new Set());
|
|
2134
|
-
onCategoryRootChange == null ? void 0 : onCategoryRootChange(baseCategoryId != null ? baseCategoryId : void 0);
|
|
2135
|
-
setIsSubcategoriesModalOpen(false);
|
|
2136
|
-
};
|
|
2137
|
-
const handleToggleSubcategory = ({
|
|
2138
|
-
entry,
|
|
2139
|
-
depth,
|
|
2140
|
-
hasKnownChildren,
|
|
2141
|
-
isExpanded,
|
|
2142
|
-
isSelected
|
|
2143
|
-
}) => {
|
|
2144
|
-
handleCategoryPathChange([...categoryPath.slice(0, depth), entry], { history: "push" });
|
|
2145
|
-
setCollapsedCategoryIds((prev) => {
|
|
2146
|
-
const next = new Set(prev);
|
|
2147
|
-
if (hasKnownChildren && isExpanded && isSelected) {
|
|
2148
|
-
next.add(entry.id);
|
|
2149
|
-
return next;
|
|
2150
|
-
}
|
|
2151
|
-
next.delete(entry.id);
|
|
2152
|
-
return next;
|
|
2153
|
-
});
|
|
2154
|
-
onCategoryRootChange == null ? void 0 : onCategoryRootChange(baseCategoryId != null ? baseCategoryId : void 0);
|
|
2155
|
-
};
|
|
2156
|
-
if (shouldRenderLoadingState) {
|
|
2157
|
-
return /* @__PURE__ */ jsx5(
|
|
2158
|
-
Skeleton,
|
|
2159
|
-
{
|
|
2160
|
-
view: "event-list",
|
|
2161
|
-
ariaLabel: labels.eventList.loading(title),
|
|
2162
|
-
withSidebar: shouldRenderSubcategoryFilters
|
|
2163
|
-
}
|
|
2164
|
-
);
|
|
2165
|
-
}
|
|
2166
|
-
return /* @__PURE__ */ jsxs4("section", { className: "agg-event-list flex w-full flex-col gap-2 md:gap-5 t", children: [
|
|
2167
|
-
/* @__PURE__ */ jsxs4(
|
|
2168
|
-
"header",
|
|
2169
|
-
{
|
|
2170
|
-
className: cn(
|
|
2171
|
-
"agg-event-list-header",
|
|
2172
|
-
"flex flex-col w-full items-start justify-between",
|
|
2173
|
-
"gap-2 sm:flex-row sm:items-center sm:gap-4"
|
|
2174
|
-
),
|
|
2175
|
-
children: [
|
|
2176
|
-
/* @__PURE__ */ jsx5("div", { className: "agg-event-list-title min-w-32", children: /* @__PURE__ */ jsx5(Typography, { as: "h2", variant: "title", className: "truncate first-letter:uppercase", children: title }) }),
|
|
2177
|
-
/* @__PURE__ */ jsxs4("div", { className: "hidden min-w-0 max-w-full items-center gap-3 md:flex", children: [
|
|
2178
|
-
/* @__PURE__ */ jsx5(
|
|
2179
|
-
EventListVenueStrip,
|
|
2180
|
-
{
|
|
2181
|
-
ariaLabel: labels.eventList.tabsAria(title),
|
|
2182
|
-
className: "agg-event-list-tabs",
|
|
2183
|
-
activeTab: activeTabValue,
|
|
2184
|
-
onTabChange: handleActiveTabChange
|
|
2185
|
-
}
|
|
2186
|
-
),
|
|
2187
|
-
/* @__PURE__ */ jsx5(
|
|
2188
|
-
Select,
|
|
2189
|
-
{
|
|
2190
|
-
ariaLabel: labels.eventList.sortByLabel,
|
|
2191
|
-
className: "min-w-[200px] w-auto! shrink-0",
|
|
2192
|
-
value: selectedSort,
|
|
2193
|
-
onChange: handleSelectedSortChange,
|
|
2194
|
-
items: sortItems,
|
|
2195
|
-
contentClassName: "py-2",
|
|
2196
|
-
triggerClassName: "rounded-agg-lg!"
|
|
2197
|
-
}
|
|
2198
|
-
)
|
|
2199
|
-
] })
|
|
2200
|
-
]
|
|
2201
|
-
}
|
|
2202
|
-
),
|
|
2203
|
-
/* @__PURE__ */ jsx5(
|
|
2204
|
-
EventListVenueStrip,
|
|
2205
|
-
{
|
|
2206
|
-
ariaLabel: labels.eventList.tabsAria(title),
|
|
2207
|
-
className: "agg-event-list-tabs md:hidden!",
|
|
2208
|
-
activeTab: activeTabValue,
|
|
2209
|
-
onTabChange: handleActiveTabChange,
|
|
2210
|
-
fullWidth: true
|
|
2211
|
-
}
|
|
2212
|
-
),
|
|
2213
|
-
/* @__PURE__ */ jsxs4("div", { className: "flex w-full gap-2 md:hidden mb-3", children: [
|
|
2214
|
-
/* @__PURE__ */ jsx5(
|
|
2215
|
-
Select,
|
|
2216
|
-
{
|
|
2217
|
-
ariaLabel: labels.eventList.sortByLabel,
|
|
2218
|
-
className: "min-w-0 flex-1 md:min-w-[144px]",
|
|
2219
|
-
value: selectedSort,
|
|
2220
|
-
onChange: handleSelectedSortChange,
|
|
2221
|
-
items: sortItems,
|
|
2222
|
-
contentClassName: "rounded-[12px] py-2 shadow-[0_8px_16px_rgba(0,0,0,0.1)]"
|
|
2223
|
-
}
|
|
2224
|
-
),
|
|
2225
|
-
shouldRenderSubcategoryFilters ? /* @__PURE__ */ jsx5(
|
|
2226
|
-
"button",
|
|
2227
|
-
{
|
|
2228
|
-
type: "button",
|
|
2229
|
-
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-[8px] border-2 border-agg-primary bg-agg-secondary text-agg-foreground cursor-pointer",
|
|
2230
|
-
"aria-label": labels.eventList.subcategoriesOpenAria,
|
|
2231
|
-
onClick: () => setIsSubcategoriesModalOpen(true),
|
|
2232
|
-
children: /* @__PURE__ */ jsx5(Icon, { name: "apps", size: "small", color: "currentColor" })
|
|
2233
|
-
}
|
|
2234
|
-
) : null
|
|
2235
|
-
] }),
|
|
2236
|
-
/* @__PURE__ */ jsxs4(
|
|
2237
|
-
"div",
|
|
2238
|
-
{
|
|
2239
|
-
className: cn("flex w-full gap-6", shouldRenderSubcategoryFilters ? "md:items-start" : ""),
|
|
2240
|
-
children: [
|
|
2241
|
-
shouldRenderSubcategoryFilters ? /* @__PURE__ */ jsx5("aside", { className: "hidden w-[200px] shrink-0 md:block self-start sticky top-4", children: /* @__PURE__ */ jsx5("div", { className: "agg-sidebar max-h-[calc(100vh-19rem)] overflow-y-auto rounded-[8px] border border-agg-separator bg-agg-secondary p-2", children: /* @__PURE__ */ jsx5(
|
|
2242
|
-
CategorySidebar,
|
|
2243
|
-
{
|
|
2244
|
-
baseCategoryId,
|
|
2245
|
-
childrenByParentId,
|
|
2246
|
-
categoryPath,
|
|
2247
|
-
collapsedCategoryIds,
|
|
2248
|
-
totalEventCount: baseCategoryEventCount,
|
|
2249
|
-
labels: { subcategoriesAll: labels.eventList.subcategoriesAll },
|
|
2250
|
-
onSelectAll: handleSelectAllCategories,
|
|
2251
|
-
onToggleCategory: handleToggleSubcategory
|
|
2252
|
-
}
|
|
2253
|
-
) }) }) : null,
|
|
2254
|
-
/* @__PURE__ */ jsxs4(
|
|
2255
|
-
"div",
|
|
2256
|
-
{
|
|
2257
|
-
className: cn(
|
|
2258
|
-
"agg-event-list-grid",
|
|
2259
|
-
"grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] md:grid-cols-[repeat(auto-fill,minmax(360px,1fr))] gap-4",
|
|
2260
|
-
"w-full",
|
|
2261
|
-
gridClassName
|
|
2262
|
-
),
|
|
2263
|
-
children: [
|
|
2264
|
-
isPlaceholderData ? Array.from({ length: placeholderSkeletonCount }).map((_, index) => /* @__PURE__ */ jsx5(
|
|
2265
|
-
EventListItem,
|
|
2266
|
-
{
|
|
2267
|
-
isLoading: true,
|
|
2268
|
-
classNames: {
|
|
2269
|
-
root: "agg-event-list-item w-full min-w-0! max-w-none justify-between!"
|
|
2270
|
-
}
|
|
2271
|
-
},
|
|
2272
|
-
`placeholder-${index}`
|
|
2273
|
-
)) : null,
|
|
2274
|
-
(isPlaceholderData ? [] : tileEvents).map((event) => /* @__PURE__ */ jsx5(
|
|
2275
|
-
EventListItem,
|
|
2276
|
-
{
|
|
2277
|
-
event,
|
|
2278
|
-
midpointRows: sharedMidpointRows,
|
|
2279
|
-
midpointsLoading: isSharedMidpointsLoading,
|
|
2280
|
-
classNames: {
|
|
2281
|
-
root: "agg-event-list-item w-full min-w-0! max-w-none justify-between!"
|
|
2282
|
-
},
|
|
2283
|
-
onEventClick,
|
|
2284
|
-
onMarketClick,
|
|
2285
|
-
getMarketHref,
|
|
2286
|
-
href: getEventHref == null ? void 0 : getEventHref(event),
|
|
2287
|
-
marketStatus: MarketStatus.open
|
|
2288
|
-
},
|
|
2289
|
-
event.id
|
|
2290
|
-
)),
|
|
2291
|
-
shouldRenderPaginationLoadingItems ? Array.from({ length: 6 }).map((_, index) => /* @__PURE__ */ jsx5(
|
|
2292
|
-
EventListItem,
|
|
2293
|
-
{
|
|
2294
|
-
isLoading: true,
|
|
2295
|
-
classNames: {
|
|
2296
|
-
root: "agg-event-list-item w-full min-w-0! max-w-none justify-between!"
|
|
2297
|
-
}
|
|
2298
|
-
},
|
|
2299
|
-
`loading-${index}`
|
|
2300
|
-
)) : null,
|
|
2301
|
-
shouldRenderEmptyState ? /* @__PURE__ */ jsx5("div", { className: "col-span-full w-full", children: /* @__PURE__ */ jsx5(
|
|
2302
|
-
StateMessage,
|
|
2303
|
-
{
|
|
2304
|
-
title: labels.eventList.emptyTitle,
|
|
2305
|
-
description: labels.eventList.emptyDescription,
|
|
2306
|
-
icon: /* @__PURE__ */ jsx5(Icon, { name: "search-empty" })
|
|
2307
|
-
}
|
|
2308
|
-
) }) : null,
|
|
2309
|
-
isError ? /* @__PURE__ */ jsx5("div", { className: "col-span-full w-full", children: /* @__PURE__ */ jsx5(
|
|
2310
|
-
StateMessage,
|
|
2311
|
-
{
|
|
2312
|
-
title: labels.eventList.errorTitle,
|
|
2313
|
-
description: labels.eventList.errorDescription,
|
|
2314
|
-
icon: /* @__PURE__ */ jsx5(Icon, { name: "warning" })
|
|
2315
|
-
}
|
|
2316
|
-
) }) : null
|
|
2317
|
-
]
|
|
2318
|
-
}
|
|
2319
|
-
)
|
|
2320
|
-
]
|
|
2321
|
-
}
|
|
2322
|
-
),
|
|
2323
|
-
shouldRenderSubcategoryFilters ? /* @__PURE__ */ jsx5(Modal, { open: isSubcategoriesModalOpen, onOpenChange: setIsSubcategoriesModalOpen, children: /* @__PURE__ */ jsx5(
|
|
2324
|
-
Modal.Container,
|
|
2325
|
-
{
|
|
2326
|
-
classNames: {
|
|
2327
|
-
// pointer-events-none lets clicks on the empty area above the panel pass through
|
|
2328
|
-
// to Dialog.Overlay, which triggers Radix's outside-click dismiss.
|
|
2329
|
-
content: "items-end p-0 pointer-events-none",
|
|
2330
|
-
container: "w-full max-w-none border-0 bg-transparent shadow-none"
|
|
2331
|
-
},
|
|
2332
|
-
children: /* @__PURE__ */ jsxs4("div", { className: "pointer-events-auto w-full rounded-t-[12px] border border-agg-separator bg-agg-secondary", children: [
|
|
2333
|
-
/* @__PURE__ */ jsx5("div", { className: "flex justify-center pb-1 pt-3", "aria-hidden": "true", children: /* @__PURE__ */ jsx5("div", { className: "h-1 w-10 rounded-full bg-agg-muted-foreground/30" }) }),
|
|
2334
|
-
/* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between px-4 pb-2 pt-1", children: [
|
|
2335
|
-
/* @__PURE__ */ jsx5(Dialog.Title, { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.eventList.subcategoriesLabel }),
|
|
2336
|
-
/* @__PURE__ */ jsx5(
|
|
2337
|
-
Dialog.Close,
|
|
2338
|
-
{
|
|
2339
|
-
className: "flex cursor-pointer items-center justify-center rounded-full p-1 text-agg-muted-foreground hover:bg-agg-secondary-hover",
|
|
2340
|
-
"aria-label": labels.common.close,
|
|
2341
|
-
children: /* @__PURE__ */ jsx5(CloseIcon, { className: "h-5 w-5" })
|
|
2342
|
-
}
|
|
2343
|
-
)
|
|
2344
|
-
] }),
|
|
2345
|
-
/* @__PURE__ */ jsx5("div", { className: "flex flex-col gap-1 px-4 pb-4", children: /* @__PURE__ */ jsx5(
|
|
2346
|
-
CategorySidebar,
|
|
2347
|
-
{
|
|
2348
|
-
baseCategoryId,
|
|
2349
|
-
childrenByParentId,
|
|
2350
|
-
categoryPath,
|
|
2351
|
-
collapsedCategoryIds,
|
|
2352
|
-
totalEventCount: baseCategoryEventCount,
|
|
2353
|
-
labels: { subcategoriesAll: labels.eventList.subcategoriesAll },
|
|
2354
|
-
onSelectAll: handleSelectAllCategories,
|
|
2355
|
-
onToggleCategory: handleToggleSubcategory
|
|
2356
|
-
}
|
|
2357
|
-
) })
|
|
2358
|
-
] })
|
|
2359
|
-
}
|
|
2360
|
-
) }) : null,
|
|
2361
|
-
shouldPaginate && hasNextPage ? /* @__PURE__ */ jsx5("div", { ref: loadMoreRef, className: "agg-event-list-sentinel h-px w-full", "aria-hidden": true }) : null
|
|
2362
|
-
] });
|
|
2363
|
-
};
|
|
2364
|
-
EventList.displayName = "EventList";
|
|
2365
|
-
|
|
2366
|
-
export {
|
|
2367
|
-
EventListItem,
|
|
2368
|
-
EventListItemV2,
|
|
2369
|
-
DEFAULT_EVENTS_LIMIT,
|
|
2370
|
-
DEFAULT_EVENT_LIST_SORT,
|
|
2371
|
-
EVENT_LIST_SORT_VALUES,
|
|
2372
|
-
useEventListTabs,
|
|
2373
|
-
EventListTabs,
|
|
2374
|
-
useEventListTabsHeaderOverflow,
|
|
2375
|
-
EventListVenueStrip,
|
|
2376
|
-
EventList
|
|
2377
|
-
};
|