@agg-market/ui 5.0.0 → 6.0.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/README.md +26 -26
- package/dist/auth.d.mts +1 -0
- package/dist/auth.d.ts +1 -0
- package/dist/{connect-button.js → auth.js} +6 -4
- package/dist/auth.mjs +8 -0
- package/dist/chunk-2ICOSP7N.mjs +1211 -0
- package/dist/chunk-5ZKPBMRK.mjs +2411 -0
- package/dist/{chunk-5K7VXAYM.mjs → chunk-ADGL6RFX.mjs} +2 -4
- package/dist/chunk-BXW3VIKV.mjs +90 -0
- package/dist/{chart.js → chunk-CN7GI2RJ.mjs} +250 -103
- package/dist/chunk-G6YKGVQR.mjs +769 -0
- package/dist/{chunk-PZTHM6WG.mjs → chunk-HI4EEDN5.mjs} +897 -357
- package/dist/{chunk-5ADMXO3Y.mjs → chunk-INRG3D4M.mjs} +5 -11
- package/dist/{chunk-QDMHLRDY.mjs → chunk-JE3Z52FD.mjs} +90 -38
- package/dist/chunk-KZOQW6NT.mjs +0 -0
- package/dist/chunk-LMOJKJOY.mjs +2616 -0
- package/dist/{chunk-YJA5VQW6.mjs → chunk-MHCHR65A.mjs} +2 -4
- package/dist/{chunk-IGPNIM2B.mjs → chunk-PASXFYKQ.mjs} +2 -4
- package/dist/chunk-UBBOLLOS.mjs +999 -0
- package/dist/events.d.mts +1 -0
- package/dist/events.d.ts +1 -0
- package/dist/{event-market-page.js → events.js} +4579 -4935
- package/dist/events.mjs +17 -0
- package/dist/index.d.mts +1 -79
- package/dist/index.d.ts +1 -79
- package/dist/index.js +6839 -6839
- package/dist/index.mjs +66 -170
- package/dist/modals.d.mts +1 -0
- package/dist/modals.d.ts +1 -0
- package/dist/{deposit-modal.js → modals.js} +1771 -6
- package/dist/modals.mjs +25 -0
- package/dist/pages.d.mts +1 -0
- package/dist/pages.d.ts +1 -0
- package/dist/{home-page.js → pages.js} +3868 -6
- package/dist/pages.mjs +16 -0
- package/dist/primitives.d.mts +1 -0
- package/dist/primitives.d.ts +1 -0
- package/dist/{market-details.js → primitives.js} +3302 -3729
- package/dist/{icon.mjs → primitives.mjs} +56 -9
- package/dist/trading.d.mts +1 -0
- package/dist/trading.d.ts +1 -0
- package/dist/{event-list.js → trading.js} +1426 -1467
- package/dist/trading.mjs +65 -0
- package/dist/types/auth/connect-button/connect-button.constants.d.mts +10 -0
- package/dist/types/auth/connect-button/connect-button.constants.d.ts +10 -0
- package/dist/{connect-button.d.mts → types/auth/connect-button/connect-button.types.d.mts} +5 -12
- package/dist/{connect-button.d.ts → types/auth/connect-button/connect-button.types.d.ts} +5 -12
- package/dist/types/auth/connect-button/index.d.mts +7 -0
- package/dist/types/auth/connect-button/index.d.ts +7 -0
- package/dist/types/auth/index.d.mts +1 -0
- package/dist/types/auth/index.d.ts +1 -0
- package/dist/types/constants.d.mts +1 -0
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/deposit/deposit-modal.constants.d.mts +9 -0
- package/dist/types/deposit/deposit-modal.constants.d.ts +9 -0
- package/dist/{deposit-modal.d.mts → types/deposit/deposit-modal.types.d.mts} +3 -10
- package/dist/{deposit-modal.d.ts → types/deposit/deposit-modal.types.d.ts} +3 -10
- package/dist/types/deposit/index.d.mts +6 -0
- package/dist/types/deposit/index.d.ts +6 -0
- package/dist/types/deposit/steps/card-deposit.d.mts +7 -0
- package/dist/types/deposit/steps/card-deposit.d.ts +7 -0
- package/dist/types/deposit/steps/crypto-transfer.d.mts +7 -0
- package/dist/types/deposit/steps/crypto-transfer.d.ts +7 -0
- package/dist/types/deposit/steps/deposit-method.d.mts +7 -0
- package/dist/types/deposit/steps/deposit-method.d.ts +7 -0
- package/dist/types/deposit/steps/kalshi-deposit.d.mts +5 -0
- package/dist/types/deposit/steps/kalshi-deposit.d.ts +5 -0
- package/dist/types/deposit/steps/venue-selection.d.mts +7 -0
- package/dist/types/deposit/steps/venue-selection.d.ts +7 -0
- package/dist/types/events/index.d.mts +4 -0
- package/dist/types/events/index.d.ts +4 -0
- package/dist/types/events/item/event-list-item.constants.d.mts +1 -0
- package/dist/types/events/item/event-list-item.constants.d.ts +1 -0
- package/dist/types/events/item/event-list-item.types.d.mts +46 -0
- package/dist/types/events/item/event-list-item.types.d.ts +46 -0
- package/dist/types/events/item/event-list-item.utils.d.mts +23 -0
- package/dist/types/events/item/event-list-item.utils.d.ts +23 -0
- package/dist/types/events/item/index.d.mts +6 -0
- package/dist/types/events/item/index.d.ts +6 -0
- package/dist/types/events/item-details/event-list-item-details.constants.d.mts +10 -0
- package/dist/types/events/item-details/event-list-item-details.constants.d.ts +10 -0
- package/dist/types/events/item-details/event-list-item-details.types.d.mts +53 -0
- package/dist/types/events/item-details/event-list-item-details.types.d.ts +53 -0
- package/dist/types/events/item-details/event-list-item-details.utils.d.mts +26 -0
- package/dist/types/events/item-details/event-list-item-details.utils.d.ts +26 -0
- package/dist/types/events/item-details/index.d.mts +6 -0
- package/dist/types/events/item-details/index.d.ts +6 -0
- package/dist/types/events/list/event-list.constants.d.mts +3 -0
- package/dist/types/events/list/event-list.constants.d.ts +3 -0
- package/dist/types/events/list/event-list.types.d.mts +21 -0
- package/dist/types/events/list/event-list.types.d.ts +21 -0
- package/dist/types/events/list/event-list.utils.d.mts +6 -0
- package/dist/types/events/list/event-list.utils.d.ts +6 -0
- package/dist/types/events/list/index.d.mts +6 -0
- package/dist/types/events/list/index.d.ts +6 -0
- package/dist/types/events/market-details/index.d.mts +6 -0
- package/dist/types/events/market-details/index.d.ts +6 -0
- package/dist/types/events/market-details/market-details.constants.d.mts +9 -0
- package/dist/types/events/market-details/market-details.constants.d.ts +9 -0
- package/dist/types/events/market-details/market-details.types.d.mts +63 -0
- package/dist/types/events/market-details/market-details.types.d.ts +63 -0
- package/dist/types/events/market-details/market-details.utils.d.mts +46 -0
- package/dist/types/events/market-details/market-details.utils.d.ts +46 -0
- package/dist/types/index.d.mts +9 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/modals/index.d.mts +4 -0
- package/dist/types/modals/index.d.ts +4 -0
- package/dist/types/onboarding/index.d.mts +11 -0
- package/dist/types/onboarding/index.d.ts +11 -0
- package/dist/types/onboarding/onboarding-modal.constants.d.mts +10 -0
- package/dist/types/onboarding/onboarding-modal.constants.d.ts +10 -0
- package/dist/types/onboarding/onboarding-modal.types.d.mts +55 -0
- package/dist/types/onboarding/onboarding-modal.types.d.ts +55 -0
- package/dist/types/onboarding/steps/connect-accounts.d.mts +5 -0
- package/dist/types/onboarding/steps/connect-accounts.d.ts +5 -0
- package/dist/types/onboarding/steps/connect-kalshi-modal.d.mts +5 -0
- package/dist/types/onboarding/steps/connect-kalshi-modal.d.ts +5 -0
- package/dist/types/onboarding/steps/connect-onchain-modal.d.mts +5 -0
- package/dist/types/onboarding/steps/connect-onchain-modal.d.ts +5 -0
- package/dist/types/onboarding/steps/how-it-works.d.mts +5 -0
- package/dist/types/onboarding/steps/how-it-works.d.ts +5 -0
- package/dist/types/onboarding/steps/profile-setup.d.mts +5 -0
- package/dist/types/onboarding/steps/profile-setup.d.ts +5 -0
- package/dist/types/pages/event-market/event-market.types.d.mts +42 -0
- package/dist/types/pages/event-market/event-market.types.d.ts +42 -0
- package/dist/types/pages/event-market/index.d.mts +6 -0
- package/dist/types/pages/event-market/index.d.ts +6 -0
- package/dist/types/pages/home/home.constants.d.mts +8 -0
- package/dist/types/pages/home/home.constants.d.ts +8 -0
- package/dist/{home-page.d.ts → types/pages/home/home.types.d.mts} +8 -18
- package/dist/{home-page.d.mts → types/pages/home/home.types.d.ts} +8 -18
- package/dist/types/pages/home/home.utils.d.mts +3 -0
- package/dist/types/pages/home/home.utils.d.ts +3 -0
- package/dist/types/pages/home/index.d.mts +6 -0
- package/dist/types/pages/home/index.d.ts +6 -0
- package/dist/types/pages/index.d.mts +3 -0
- package/dist/types/pages/index.d.ts +3 -0
- package/dist/types/pages/user-profile/components/activity-row.d.mts +10 -0
- package/dist/types/pages/user-profile/components/activity-row.d.ts +10 -0
- package/dist/types/pages/user-profile/components/balance-display.d.mts +12 -0
- package/dist/types/pages/user-profile/components/balance-display.d.ts +12 -0
- package/dist/types/pages/user-profile/components/balances-card.d.mts +12 -0
- package/dist/types/pages/user-profile/components/balances-card.d.ts +12 -0
- package/dist/types/pages/user-profile/components/default-avatar.d.mts +8 -0
- package/dist/types/pages/user-profile/components/default-avatar.d.ts +8 -0
- package/dist/types/pages/user-profile/components/empty-state.d.mts +10 -0
- package/dist/types/pages/user-profile/components/empty-state.d.ts +10 -0
- package/dist/types/pages/user-profile/components/position-row.d.mts +10 -0
- package/dist/types/pages/user-profile/components/position-row.d.ts +10 -0
- package/dist/types/pages/user-profile/components/positions-activity.d.mts +14 -0
- package/dist/types/pages/user-profile/components/positions-activity.d.ts +14 -0
- package/dist/types/pages/user-profile/components/user-info-card.d.mts +11 -0
- package/dist/types/pages/user-profile/components/user-info-card.d.ts +11 -0
- package/dist/types/pages/user-profile/index.d.mts +6 -0
- package/dist/types/pages/user-profile/index.d.ts +6 -0
- package/dist/types/pages/user-profile/user-profile.constants.d.mts +9 -0
- package/dist/types/pages/user-profile/user-profile.constants.d.ts +9 -0
- package/dist/{user-profile-page.d.ts → types/pages/user-profile/user-profile.types.d.mts} +12 -22
- package/dist/{user-profile-page.d.mts → types/pages/user-profile/user-profile.types.d.ts} +12 -22
- package/dist/types/primitives/badge/badge.constants.d.mts +4 -0
- package/dist/types/primitives/badge/badge.constants.d.ts +4 -0
- package/dist/types/primitives/badge/badge.types.d.mts +18 -0
- package/dist/types/primitives/badge/badge.types.d.ts +18 -0
- package/dist/types/primitives/badge/index.d.mts +7 -0
- package/dist/types/primitives/badge/index.d.ts +7 -0
- package/dist/types/primitives/button/button.constants.d.mts +6 -0
- package/dist/types/primitives/button/button.constants.d.ts +6 -0
- package/dist/types/primitives/button/button.types.d.mts +12 -0
- package/dist/types/primitives/button/button.types.d.ts +12 -0
- package/dist/types/primitives/button/index.d.mts +6 -0
- package/dist/types/primitives/button/index.d.ts +6 -0
- package/dist/types/primitives/card/card.types.d.mts +3 -0
- package/dist/types/primitives/card/card.types.d.ts +3 -0
- package/dist/types/primitives/card/index.d.mts +6 -0
- package/dist/types/primitives/card/index.d.ts +6 -0
- package/dist/{chart.d.mts → types/primitives/chart/index.d.mts} +7 -10
- package/dist/{chart.d.ts → types/primitives/chart/index.d.ts} +7 -10
- package/dist/types/primitives/hello-world.d.mts +4 -0
- package/dist/types/primitives/hello-world.d.ts +4 -0
- package/dist/types/primitives/icon/icon.constants.d.mts +2 -0
- package/dist/types/primitives/icon/icon.constants.d.ts +2 -0
- package/dist/types/primitives/icon/icon.types.d.mts +9 -0
- package/dist/types/primitives/icon/icon.types.d.ts +9 -0
- package/dist/types/primitives/icon/icon.utils.d.mts +2 -0
- package/dist/types/primitives/icon/icon.utils.d.ts +2 -0
- package/dist/types/primitives/icon/index.d.mts +46 -0
- package/dist/types/primitives/icon/index.d.ts +46 -0
- package/dist/types/primitives/icon/registry.d.mts +166 -0
- package/dist/types/primitives/icon/registry.d.ts +166 -0
- package/dist/types/primitives/icon/svg/arrow-trend-up.d.mts +5 -0
- package/dist/types/primitives/icon/svg/arrow-trend-up.d.ts +5 -0
- package/dist/types/primitives/icon/svg/arrows-to-dot.d.mts +5 -0
- package/dist/types/primitives/icon/svg/arrows-to-dot.d.ts +5 -0
- package/dist/types/primitives/icon/svg/bank.d.mts +5 -0
- package/dist/types/primitives/icon/svg/bank.d.ts +5 -0
- package/dist/types/primitives/icon/svg/best-prices.d.mts +5 -0
- package/dist/types/primitives/icon/svg/best-prices.d.ts +5 -0
- package/dist/types/primitives/icon/svg/bolt.d.mts +5 -0
- package/dist/types/primitives/icon/svg/bolt.d.ts +5 -0
- package/dist/types/primitives/icon/svg/check-badge.d.mts +5 -0
- package/dist/types/primitives/icon/svg/check-badge.d.ts +5 -0
- package/dist/types/primitives/icon/svg/check-circle.d.mts +5 -0
- package/dist/types/primitives/icon/svg/check-circle.d.ts +5 -0
- package/dist/types/primitives/icon/svg/chevron-down.d.mts +5 -0
- package/dist/types/primitives/icon/svg/chevron-down.d.ts +5 -0
- package/dist/types/primitives/icon/svg/chevron-left.d.mts +5 -0
- package/dist/types/primitives/icon/svg/chevron-left.d.ts +5 -0
- package/dist/types/primitives/icon/svg/chevron-right.d.mts +5 -0
- package/dist/types/primitives/icon/svg/chevron-right.d.ts +5 -0
- package/dist/types/primitives/icon/svg/chevron-up.d.mts +5 -0
- package/dist/types/primitives/icon/svg/chevron-up.d.ts +5 -0
- package/dist/types/primitives/icon/svg/close.d.mts +5 -0
- package/dist/types/primitives/icon/svg/close.d.ts +5 -0
- package/dist/types/primitives/icon/svg/copy.d.mts +5 -0
- package/dist/types/primitives/icon/svg/copy.d.ts +5 -0
- package/dist/types/primitives/icon/svg/create-account.d.mts +5 -0
- package/dist/types/primitives/icon/svg/create-account.d.ts +5 -0
- package/dist/types/primitives/icon/svg/credit-card.d.mts +5 -0
- package/dist/types/primitives/icon/svg/credit-card.d.ts +5 -0
- package/dist/types/primitives/icon/svg/disconnect.d.mts +5 -0
- package/dist/types/primitives/icon/svg/disconnect.d.ts +5 -0
- package/dist/types/primitives/icon/svg/discord.d.mts +5 -0
- package/dist/types/primitives/icon/svg/discord.d.ts +5 -0
- package/dist/types/primitives/icon/svg/document.d.mts +5 -0
- package/dist/types/primitives/icon/svg/document.d.ts +5 -0
- package/dist/types/primitives/icon/svg/dots-horizontal.d.mts +5 -0
- package/dist/types/primitives/icon/svg/dots-horizontal.d.ts +5 -0
- package/dist/types/primitives/icon/svg/download.d.mts +5 -0
- package/dist/types/primitives/icon/svg/download.d.ts +5 -0
- package/dist/types/primitives/icon/svg/email.d.mts +5 -0
- package/dist/types/primitives/icon/svg/email.d.ts +5 -0
- package/dist/types/primitives/icon/svg/external-link.d.mts +5 -0
- package/dist/types/primitives/icon/svg/external-link.d.ts +5 -0
- package/dist/types/primitives/icon/svg/info.d.mts +5 -0
- package/dist/types/primitives/icon/svg/info.d.ts +5 -0
- package/dist/types/primitives/icon/svg/link-accounts.d.mts +5 -0
- package/dist/types/primitives/icon/svg/link-accounts.d.ts +5 -0
- package/dist/types/primitives/icon/svg/pencil.d.mts +5 -0
- package/dist/types/primitives/icon/svg/pencil.d.ts +5 -0
- package/dist/types/primitives/icon/svg/play-square.d.mts +5 -0
- package/dist/types/primitives/icon/svg/play-square.d.ts +5 -0
- package/dist/types/primitives/icon/svg/profile.d.mts +5 -0
- package/dist/types/primitives/icon/svg/profile.d.ts +5 -0
- package/dist/types/primitives/icon/svg/revenue-alt.d.mts +5 -0
- package/dist/types/primitives/icon/svg/revenue-alt.d.ts +5 -0
- package/dist/types/primitives/icon/svg/search.d.mts +5 -0
- package/dist/types/primitives/icon/svg/search.d.ts +5 -0
- package/dist/types/primitives/icon/svg/shield-trust.d.mts +5 -0
- package/dist/types/primitives/icon/svg/shield-trust.d.ts +5 -0
- package/dist/types/primitives/icon/svg/stay-in-control.d.mts +5 -0
- package/dist/types/primitives/icon/svg/stay-in-control.d.ts +5 -0
- package/dist/types/primitives/icon/svg/telegram.d.mts +5 -0
- package/dist/types/primitives/icon/svg/telegram.d.ts +5 -0
- package/dist/types/primitives/icon/svg/triangle-down.d.mts +5 -0
- package/dist/types/primitives/icon/svg/triangle-down.d.ts +5 -0
- package/dist/types/primitives/icon/svg/triangle-up-filled.d.mts +5 -0
- package/dist/types/primitives/icon/svg/triangle-up-filled.d.ts +5 -0
- package/dist/types/primitives/icon/svg/triangle-up.d.mts +5 -0
- package/dist/types/primitives/icon/svg/triangle-up.d.ts +5 -0
- package/dist/types/primitives/icon/svg/twitter.d.mts +5 -0
- package/dist/types/primitives/icon/svg/twitter.d.ts +5 -0
- package/dist/types/primitives/icon/svg/upload.d.mts +5 -0
- package/dist/types/primitives/icon/svg/upload.d.ts +5 -0
- package/dist/types/primitives/icon/svg/wallet-avatar.d.mts +5 -0
- package/dist/types/primitives/icon/svg/wallet-avatar.d.ts +5 -0
- package/dist/types/primitives/icon/svg/wallet.d.mts +5 -0
- package/dist/types/primitives/icon/svg/wallet.d.ts +5 -0
- package/dist/types/primitives/icon/svg/warning-filled.d.mts +5 -0
- package/dist/types/primitives/icon/svg/warning-filled.d.ts +5 -0
- package/dist/types/primitives/icon/svg/warning.d.mts +5 -0
- package/dist/types/primitives/icon/svg/warning.d.ts +5 -0
- package/dist/types/primitives/icon/types.d.mts +5 -0
- package/dist/types/primitives/icon/types.d.ts +5 -0
- package/dist/types/primitives/index.d.mts +17 -0
- package/dist/types/primitives/index.d.ts +17 -0
- package/dist/types/primitives/loading-icon/index.d.mts +11 -0
- package/dist/types/primitives/loading-icon/index.d.ts +11 -0
- package/dist/types/primitives/modal/index.d.mts +10 -0
- package/dist/types/primitives/modal/index.d.ts +10 -0
- package/dist/types/primitives/modal/modal.types.d.mts +54 -0
- package/dist/types/primitives/modal/modal.types.d.ts +54 -0
- package/dist/{number-value.d.mts → types/primitives/number-value.d.mts} +3 -5
- package/dist/{number-value.d.ts → types/primitives/number-value.d.ts} +3 -5
- package/dist/types/primitives/search/index.d.mts +6 -0
- package/dist/types/primitives/search/index.d.ts +6 -0
- package/dist/types/primitives/search/search-empty-icon.d.mts +5 -0
- package/dist/types/primitives/search/search-empty-icon.d.ts +5 -0
- package/dist/types/primitives/search/search.types.d.mts +96 -0
- package/dist/types/primitives/search/search.types.d.ts +96 -0
- package/dist/{select.d.mts → types/primitives/select/index.d.mts} +3 -5
- package/dist/{select.d.ts → types/primitives/select/index.d.ts} +3 -5
- package/dist/types/primitives/skeleton/index.d.mts +7 -0
- package/dist/types/primitives/skeleton/index.d.ts +7 -0
- package/dist/types/primitives/skeleton/skeleton-block.d.mts +8 -0
- package/dist/types/primitives/skeleton/skeleton-block.d.ts +8 -0
- package/dist/{skeleton.d.mts → types/primitives/skeleton/skeleton.types.d.mts} +6 -9
- package/dist/{skeleton.d.ts → types/primitives/skeleton/skeleton.types.d.ts} +6 -9
- package/dist/types/primitives/skeleton/views/event-list-item-details-skeleton-view.d.mts +5 -0
- package/dist/types/primitives/skeleton/views/event-list-item-details-skeleton-view.d.ts +5 -0
- package/dist/types/primitives/skeleton/views/event-list-item-skeleton-view.d.mts +9 -0
- package/dist/types/primitives/skeleton/views/event-list-item-skeleton-view.d.ts +9 -0
- package/dist/types/primitives/skeleton/views/event-list-skeleton-view.d.mts +5 -0
- package/dist/types/primitives/skeleton/views/event-list-skeleton-view.d.ts +5 -0
- package/dist/types/primitives/skeleton/views/market-details-skeleton-view.d.mts +12 -0
- package/dist/types/primitives/skeleton/views/market-details-skeleton-view.d.ts +12 -0
- package/dist/types/primitives/skeleton/views/place-order-skeleton-view.d.mts +5 -0
- package/dist/types/primitives/skeleton/views/place-order-skeleton-view.d.ts +5 -0
- package/dist/types/primitives/skeleton/views/settlement-skeleton-view.d.mts +5 -0
- package/dist/types/primitives/skeleton/views/settlement-skeleton-view.d.ts +5 -0
- package/dist/{state-message.d.mts → types/primitives/state-message/index.d.mts} +2 -3
- package/dist/{state-message.d.ts → types/primitives/state-message/index.d.ts} +2 -3
- package/dist/{switch-button.d.mts → types/primitives/switch-button/index.d.mts} +4 -7
- package/dist/{switch-button.d.ts → types/primitives/switch-button/index.d.ts} +4 -7
- package/dist/types/primitives/tabs/index.d.mts +6 -0
- package/dist/types/primitives/tabs/index.d.ts +6 -0
- package/dist/types/primitives/tabs/tabs.types.d.mts +24 -0
- package/dist/types/primitives/tabs/tabs.types.d.ts +24 -0
- package/dist/types/primitives/tabs/tabs.utils.d.mts +14 -0
- package/dist/types/primitives/tabs/tabs.utils.d.ts +14 -0
- package/dist/types/primitives/typography/index.d.mts +7 -0
- package/dist/types/primitives/typography/index.d.ts +7 -0
- package/dist/types/primitives/typography/typography.constants.d.mts +3 -0
- package/dist/types/primitives/typography/typography.constants.d.ts +3 -0
- package/dist/types/primitives/typography/typography.types.d.mts +8 -0
- package/dist/types/primitives/typography/typography.types.d.ts +8 -0
- package/dist/types/primitives/venue-logo/index.d.mts +8 -0
- package/dist/types/primitives/venue-logo/index.d.ts +8 -0
- package/dist/types/primitives/venue-logo/logo-props.d.mts +10 -0
- package/dist/types/primitives/venue-logo/logo-props.d.ts +10 -0
- package/dist/types/primitives/venue-logo/svg/logo-kalshi.d.mts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-kalshi.d.ts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-opinion.d.mts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-opinion.d.ts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-polymarket.d.mts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-polymarket.d.ts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-probable.d.mts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-probable.d.ts +5 -0
- package/dist/types/primitives/venue-logo/venue-logo.constants.d.mts +9 -0
- package/dist/types/primitives/venue-logo/venue-logo.constants.d.ts +9 -0
- package/dist/types/primitives/venue-logo/venue-logo.types.d.mts +17 -0
- package/dist/types/primitives/venue-logo/venue-logo.types.d.ts +17 -0
- package/dist/types/profile/index.d.mts +6 -0
- package/dist/types/profile/index.d.ts +6 -0
- package/dist/types/profile/profile-modal.constants.d.mts +17 -0
- package/dist/types/profile/profile-modal.constants.d.ts +17 -0
- package/dist/{profile-modal.d.mts → types/profile/profile-modal.types.d.mts} +4 -11
- package/dist/{profile-modal.d.ts → types/profile/profile-modal.types.d.ts} +4 -11
- package/dist/types/profile/tabs/about-tab.d.mts +16 -0
- package/dist/types/profile/tabs/about-tab.d.ts +16 -0
- package/dist/types/profile/tabs/accounts-wallets-tab.d.mts +18 -0
- package/dist/types/profile/tabs/accounts-wallets-tab.d.ts +18 -0
- package/dist/types/shared/constants.d.mts +23 -0
- package/dist/types/shared/constants.d.ts +23 -0
- package/dist/types/shared/query-error.d.mts +2 -0
- package/dist/types/shared/query-error.d.ts +2 -0
- package/dist/types/shared/types.d.mts +1 -0
- package/dist/types/shared/types.d.ts +1 -0
- package/dist/types/shared/utils.d.mts +15 -0
- package/dist/types/shared/utils.d.ts +15 -0
- package/dist/types/trading/index.d.mts +4 -0
- package/dist/types/trading/index.d.ts +4 -0
- package/dist/{place-order.d.ts → types/trading/place-order/index.d.mts} +3 -7
- package/dist/{place-order.d.mts → types/trading/place-order/index.d.ts} +3 -7
- package/dist/{settlement.d.ts → types/trading/settlement/index.d.mts} +3 -7
- package/dist/{settlement.d.mts → types/trading/settlement/index.d.ts} +3 -7
- package/dist/{types-BImwqY4o.d.ts → types/trading/types.d.mts} +35 -38
- package/dist/{types-BImwqY4o.d.mts → types/trading/types.d.ts} +35 -38
- package/dist/types/trading/utils.d.mts +16 -0
- package/dist/types/trading/utils.d.ts +16 -0
- package/dist/types/withdraw/index.d.mts +6 -0
- package/dist/types/withdraw/index.d.ts +6 -0
- package/dist/types/withdraw/steps/kalshi-withdraw.d.mts +5 -0
- package/dist/types/withdraw/steps/kalshi-withdraw.d.ts +5 -0
- package/dist/types/withdraw/steps/venue-selection.d.mts +6 -0
- package/dist/types/withdraw/steps/venue-selection.d.ts +6 -0
- package/dist/types/withdraw/steps/withdraw-amount.d.mts +8 -0
- package/dist/types/withdraw/steps/withdraw-amount.d.ts +8 -0
- package/dist/types/withdraw/steps/withdraw-method.d.mts +7 -0
- package/dist/types/withdraw/steps/withdraw-method.d.ts +7 -0
- package/dist/types/withdraw/withdraw-modal.constants.d.mts +9 -0
- package/dist/types/withdraw/withdraw-modal.constants.d.ts +9 -0
- package/dist/{withdraw-modal.d.mts → types/withdraw/withdraw-modal.types.d.mts} +3 -10
- package/dist/{withdraw-modal.d.ts → types/withdraw/withdraw-modal.types.d.ts} +3 -10
- package/package.json +33 -283
- package/dist/badge.d.mts +0 -28
- package/dist/badge.d.ts +0 -28
- package/dist/badge.js +0 -110
- package/dist/badge.mjs +0 -9
- package/dist/button.d.mts +0 -20
- package/dist/button.d.ts +0 -20
- package/dist/button.js +0 -183
- package/dist/button.mjs +0 -8
- package/dist/card.d.mts +0 -10
- package/dist/card.d.ts +0 -10
- package/dist/card.js +0 -88
- package/dist/card.mjs +0 -7
- package/dist/chart.mjs +0 -8
- package/dist/chunk-34IRJYSU.mjs +0 -146
- package/dist/chunk-3QLOUBDJ.mjs +0 -483
- package/dist/chunk-3W7NBJLU.mjs +0 -371
- package/dist/chunk-4343LYSH.mjs +0 -45
- package/dist/chunk-4S3I6X7F.mjs +0 -855
- package/dist/chunk-4VUDTWH7.mjs +0 -42
- package/dist/chunk-6JG6I5AY.mjs +0 -654
- package/dist/chunk-BNDFQPHF.mjs +0 -9
- package/dist/chunk-CTYJVVHJ.mjs +0 -334
- package/dist/chunk-DHBHKIJR.mjs +0 -1049
- package/dist/chunk-ERGNR6UQ.mjs +0 -67
- package/dist/chunk-FO263M3V.mjs +0 -10
- package/dist/chunk-FO2QCB4Z.mjs +0 -35
- package/dist/chunk-GFBF2J3Y.mjs +0 -328
- package/dist/chunk-GJ4U5NCE.mjs +0 -134
- package/dist/chunk-K6IJ4WBM.mjs +0 -67
- package/dist/chunk-KAGYJ4XT.mjs +0 -126
- package/dist/chunk-KIYMVWL4.mjs +0 -280
- package/dist/chunk-LCZKSITC.mjs +0 -162
- package/dist/chunk-M4RJHRFT.mjs +0 -445
- package/dist/chunk-MJHKBCXQ.mjs +0 -379
- package/dist/chunk-MKVGQ7AS.mjs +0 -168
- package/dist/chunk-NDG43KGL.mjs +0 -44
- package/dist/chunk-NH2G3POM.mjs +0 -470
- package/dist/chunk-OBCHURW5.mjs +0 -64
- package/dist/chunk-OJVTGNIF.mjs +0 -230
- package/dist/chunk-PORVP72S.mjs +0 -277
- package/dist/chunk-Q6DGDBPV.mjs +0 -774
- package/dist/chunk-QLMVKLNJ.mjs +0 -669
- package/dist/chunk-S3H63TQ5.mjs +0 -537
- package/dist/chunk-T7TATHPD.mjs +0 -313
- package/dist/chunk-XUCS575S.mjs +0 -65
- package/dist/chunk-ZFMCCBP6.mjs +0 -25
- package/dist/connect-button.mjs +0 -14
- package/dist/deposit-modal.mjs +0 -15
- package/dist/event-list-item-details.d.mts +0 -11
- package/dist/event-list-item-details.d.ts +0 -11
- package/dist/event-list-item-details.js +0 -3711
- package/dist/event-list-item-details.mjs +0 -23
- package/dist/event-list-item-details.types-CMbXOrT-.d.ts +0 -53
- package/dist/event-list-item-details.types-DekJKeMD.d.mts +0 -53
- package/dist/event-list-item.d.mts +0 -10
- package/dist/event-list-item.d.ts +0 -10
- package/dist/event-list-item.js +0 -2821
- package/dist/event-list-item.mjs +0 -20
- package/dist/event-list-item.types-Y6IeJ4e4.d.mts +0 -46
- package/dist/event-list-item.types-Y6IeJ4e4.d.ts +0 -46
- package/dist/event-list.d.mts +0 -9
- package/dist/event-list.d.ts +0 -9
- package/dist/event-list.mjs +0 -23
- package/dist/event-list.types-CkAAUqwW.d.mts +0 -13
- package/dist/event-list.types-CkAAUqwW.d.ts +0 -13
- package/dist/event-market-page.d.mts +0 -52
- package/dist/event-market-page.d.ts +0 -52
- package/dist/event-market-page.mjs +0 -30
- package/dist/hello-world.d.mts +0 -8
- package/dist/hello-world.d.ts +0 -8
- package/dist/hello-world.js +0 -92
- package/dist/hello-world.mjs +0 -8
- package/dist/home-page.mjs +0 -24
- package/dist/icon.d.mts +0 -193
- package/dist/icon.d.ts +0 -193
- package/dist/icon.js +0 -1465
- package/dist/loading-icon.d.mts +0 -14
- package/dist/loading-icon.d.ts +0 -14
- package/dist/loading-icon.js +0 -112
- package/dist/loading-icon.mjs +0 -8
- package/dist/market-details.d.mts +0 -73
- package/dist/market-details.d.ts +0 -73
- package/dist/market-details.mjs +0 -24
- package/dist/modal.d.mts +0 -66
- package/dist/modal.d.ts +0 -66
- package/dist/modal.js +0 -321
- package/dist/modal.mjs +0 -9
- package/dist/number-value.js +0 -67
- package/dist/number-value.mjs +0 -7
- package/dist/onboarding-modal.d.mts +0 -88
- package/dist/onboarding-modal.d.ts +0 -88
- package/dist/onboarding-modal.js +0 -2836
- package/dist/onboarding-modal.mjs +0 -24
- package/dist/place-order.js +0 -3248
- package/dist/place-order.mjs +0 -18
- package/dist/profile-modal.js +0 -2447
- package/dist/profile-modal.mjs +0 -14
- package/dist/registry-DfSCFAdC.d.mts +0 -178
- package/dist/registry-DfSCFAdC.d.ts +0 -178
- package/dist/search.d.mts +0 -51
- package/dist/search.d.ts +0 -51
- package/dist/search.js +0 -1957
- package/dist/search.mjs +0 -13
- package/dist/select.js +0 -1552
- package/dist/select.mjs +0 -11
- package/dist/settlement.js +0 -2445
- package/dist/settlement.mjs +0 -15
- package/dist/skeleton.js +0 -490
- package/dist/skeleton.mjs +0 -10
- package/dist/state-message.js +0 -1629
- package/dist/state-message.mjs +0 -14
- package/dist/switch-button.js +0 -191
- package/dist/switch-button.mjs +0 -7
- package/dist/tabs.d.mts +0 -31
- package/dist/tabs.d.ts +0 -31
- package/dist/tabs.js +0 -2078
- package/dist/tabs.mjs +0 -12
- package/dist/types-BVj9ky9P.d.mts +0 -3
- package/dist/types-BVj9ky9P.d.ts +0 -3
- package/dist/typography.d.mts +0 -18
- package/dist/typography.d.ts +0 -18
- package/dist/typography.js +0 -93
- package/dist/typography.mjs +0 -9
- package/dist/user-profile-page.js +0 -3081
- package/dist/user-profile-page.mjs +0 -15
- package/dist/venue-logo.d.mts +0 -13
- package/dist/venue-logo.d.ts +0 -13
- package/dist/venue-logo.js +0 -323
- package/dist/venue-logo.mjs +0 -10
- package/dist/venue-logo.types-CGUc22ly.d.mts +0 -19
- package/dist/venue-logo.types-Dqr39S1-.d.ts +0 -19
- package/dist/withdraw-modal.js +0 -2449
- package/dist/withdraw-modal.mjs +0 -14
package/dist/chunk-Q6DGDBPV.mjs
DELETED
|
@@ -1,774 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
buildPriceHistoryGroups,
|
|
3
|
-
formatDateLabel,
|
|
4
|
-
getDefaultSelectedTimeRange,
|
|
5
|
-
getTimeWindowByRange,
|
|
6
|
-
isDateLikeLabel,
|
|
7
|
-
resolveDefaultOutcomeLabel,
|
|
8
|
-
resolveOutcomeLabels,
|
|
9
|
-
resolveOutcomesByVenue,
|
|
10
|
-
resolveSeriesColor
|
|
11
|
-
} from "./chunk-34IRJYSU.mjs";
|
|
12
|
-
import {
|
|
13
|
-
isErrorWithStatus,
|
|
14
|
-
normalizeProbability,
|
|
15
|
-
resolveEventListItemEvent,
|
|
16
|
-
resolveTileImage,
|
|
17
|
-
resolveTileTitle,
|
|
18
|
-
resolveVenueLabel,
|
|
19
|
-
selectPrimaryVenueMarket
|
|
20
|
-
} from "./chunk-MKVGQ7AS.mjs";
|
|
21
|
-
import {
|
|
22
|
-
StateMessage
|
|
23
|
-
} from "./chunk-XUCS575S.mjs";
|
|
24
|
-
import {
|
|
25
|
-
Badge
|
|
26
|
-
} from "./chunk-K6IJ4WBM.mjs";
|
|
27
|
-
import {
|
|
28
|
-
Skeleton,
|
|
29
|
-
detailsBaseCardClassName,
|
|
30
|
-
eventListItemDetailsTimeRanges
|
|
31
|
-
} from "./chunk-M4RJHRFT.mjs";
|
|
32
|
-
import {
|
|
33
|
-
VenueLogo
|
|
34
|
-
} from "./chunk-PORVP72S.mjs";
|
|
35
|
-
import {
|
|
36
|
-
Button
|
|
37
|
-
} from "./chunk-KAGYJ4XT.mjs";
|
|
38
|
-
import {
|
|
39
|
-
Typography
|
|
40
|
-
} from "./chunk-ERGNR6UQ.mjs";
|
|
41
|
-
import {
|
|
42
|
-
Card
|
|
43
|
-
} from "./chunk-FO2QCB4Z.mjs";
|
|
44
|
-
import {
|
|
45
|
-
LineChart
|
|
46
|
-
} from "./chunk-OJVTGNIF.mjs";
|
|
47
|
-
import {
|
|
48
|
-
SwitchButton
|
|
49
|
-
} from "./chunk-LCZKSITC.mjs";
|
|
50
|
-
import {
|
|
51
|
-
__objRest,
|
|
52
|
-
__spreadProps,
|
|
53
|
-
__spreadValues,
|
|
54
|
-
cn
|
|
55
|
-
} from "./chunk-GJ4U5NCE.mjs";
|
|
56
|
-
|
|
57
|
-
// src/events/item-details/index.tsx
|
|
58
|
-
import { useEffect, useMemo, useState } from "react";
|
|
59
|
-
import { useEvent, useLabels, usePriceHistory, useSdkUiConfig } from "@agg-market/hooks";
|
|
60
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
61
|
-
var EventListItemDetailsLoadingState = ({
|
|
62
|
-
classNames,
|
|
63
|
-
ariaLabel
|
|
64
|
-
}) => {
|
|
65
|
-
const labels = useLabels();
|
|
66
|
-
return /* @__PURE__ */ jsx(
|
|
67
|
-
Skeleton,
|
|
68
|
-
{
|
|
69
|
-
view: "event-list-item-details",
|
|
70
|
-
className: classNames == null ? void 0 : classNames.root,
|
|
71
|
-
ariaLabel: ariaLabel != null ? ariaLabel : labels.eventItemDetails.loading
|
|
72
|
-
}
|
|
73
|
-
);
|
|
74
|
-
};
|
|
75
|
-
var EventListItemDetailsUnavailableState = ({
|
|
76
|
-
classNames,
|
|
77
|
-
ariaLabel
|
|
78
|
-
}) => {
|
|
79
|
-
const labels = useLabels();
|
|
80
|
-
return /* @__PURE__ */ jsx(
|
|
81
|
-
Card,
|
|
82
|
-
{
|
|
83
|
-
className: cn(detailsBaseCardClassName, classNames == null ? void 0 : classNames.root),
|
|
84
|
-
role: "status",
|
|
85
|
-
"aria-label": ariaLabel != null ? ariaLabel : labels.eventItemDetails.unavailableAria,
|
|
86
|
-
children: /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1", classNames == null ? void 0 : classNames.header), children: [
|
|
87
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body-large-strong", className: cn("truncate", classNames == null ? void 0 : classNames.title), children: labels.eventItemDetails.unavailableTitle }),
|
|
88
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-agg-muted-foreground", children: labels.eventItemDetails.unavailableDescription })
|
|
89
|
-
] })
|
|
90
|
-
}
|
|
91
|
-
);
|
|
92
|
-
};
|
|
93
|
-
var EventListItemDetailsNotFoundState = ({
|
|
94
|
-
classNames,
|
|
95
|
-
ariaLabel
|
|
96
|
-
}) => {
|
|
97
|
-
const labels = useLabels();
|
|
98
|
-
return /* @__PURE__ */ jsx(Card, { className: cn(detailsBaseCardClassName, classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ jsx(
|
|
99
|
-
StateMessage,
|
|
100
|
-
{
|
|
101
|
-
ariaLabel: ariaLabel != null ? ariaLabel : labels.eventItemDetails.notFoundAria,
|
|
102
|
-
title: labels.eventItemDetails.notFoundTitle,
|
|
103
|
-
description: labels.eventItemDetails.notFoundDescription,
|
|
104
|
-
className: "min-h-[280px] md:min-h-[320px]"
|
|
105
|
-
}
|
|
106
|
-
) });
|
|
107
|
-
};
|
|
108
|
-
var probabilityModeOrder = ["yes", "no"];
|
|
109
|
-
var clampProbability = (value) => {
|
|
110
|
-
if (value < 0)
|
|
111
|
-
return 0;
|
|
112
|
-
if (value > 1)
|
|
113
|
-
return 1;
|
|
114
|
-
return value;
|
|
115
|
-
};
|
|
116
|
-
var resolveAverageProbability = (values) => {
|
|
117
|
-
const validValues = values.filter((value) => value != null);
|
|
118
|
-
if (validValues.length === 0)
|
|
119
|
-
return void 0;
|
|
120
|
-
return validValues.reduce((sum, value) => sum + value, 0) / validValues.length;
|
|
121
|
-
};
|
|
122
|
-
var resolveOutcomeCandidateIds = (market, outcome) => {
|
|
123
|
-
var _a, _b;
|
|
124
|
-
const marketWithCanonicalId = market;
|
|
125
|
-
return [
|
|
126
|
-
outcome.id,
|
|
127
|
-
(_a = outcome.externalIdentifier) != null ? _a : void 0,
|
|
128
|
-
market.externalIdentifier,
|
|
129
|
-
(_b = marketWithCanonicalId.marketId) != null ? _b : void 0
|
|
130
|
-
].filter((value) => typeof value === "string" && value.trim().length > 0);
|
|
131
|
-
};
|
|
132
|
-
var EventListItemDetailsGraphSection = ({
|
|
133
|
-
venueMarkets,
|
|
134
|
-
canonicalMarketId,
|
|
135
|
-
selectedOutcomeLabel,
|
|
136
|
-
onSelectedOutcomeLabelChange,
|
|
137
|
-
switchLabels,
|
|
138
|
-
isDateOutcomeMarket,
|
|
139
|
-
classNames,
|
|
140
|
-
showVenueLogo,
|
|
141
|
-
venueInfo,
|
|
142
|
-
formatPercent,
|
|
143
|
-
selectedTimeRange
|
|
144
|
-
}) => {
|
|
145
|
-
const labels = useLabels();
|
|
146
|
-
const [selectedVenue, setSelectedVenue] = useState(null);
|
|
147
|
-
const [activeProbabilityMode, setActiveProbabilityMode] = useState("yes");
|
|
148
|
-
const probabilityModeConfigs = useMemo(() => {
|
|
149
|
-
if (isDateOutcomeMarket) {
|
|
150
|
-
return {
|
|
151
|
-
yes: {
|
|
152
|
-
switchLabel: switchLabels[0],
|
|
153
|
-
sourceOutcomeLabel: selectedOutcomeLabel,
|
|
154
|
-
transformProbability: (value) => value
|
|
155
|
-
},
|
|
156
|
-
no: {
|
|
157
|
-
switchLabel: switchLabels[1],
|
|
158
|
-
sourceOutcomeLabel: selectedOutcomeLabel,
|
|
159
|
-
transformProbability: (value) => 1 - value
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
return {
|
|
164
|
-
yes: {
|
|
165
|
-
switchLabel: switchLabels[0],
|
|
166
|
-
sourceOutcomeLabel: switchLabels[0],
|
|
167
|
-
transformProbability: (value) => value
|
|
168
|
-
},
|
|
169
|
-
no: {
|
|
170
|
-
switchLabel: switchLabels[1],
|
|
171
|
-
sourceOutcomeLabel: switchLabels[1],
|
|
172
|
-
transformProbability: (value) => value
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
}, [isDateOutcomeMarket, selectedOutcomeLabel, switchLabels]);
|
|
176
|
-
const selectedOutcomesByMode = useMemo(() => {
|
|
177
|
-
return {
|
|
178
|
-
yes: resolveOutcomesByVenue(venueMarkets, probabilityModeConfigs.yes.sourceOutcomeLabel),
|
|
179
|
-
no: resolveOutcomesByVenue(venueMarkets, probabilityModeConfigs.no.sourceOutcomeLabel)
|
|
180
|
-
};
|
|
181
|
-
}, [
|
|
182
|
-
probabilityModeConfigs.no.sourceOutcomeLabel,
|
|
183
|
-
probabilityModeConfigs.yes.sourceOutcomeLabel,
|
|
184
|
-
venueMarkets
|
|
185
|
-
]);
|
|
186
|
-
useEffect(() => {
|
|
187
|
-
if (isDateOutcomeMarket) {
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
const nextMode = selectedOutcomeLabel === probabilityModeConfigs.no.sourceOutcomeLabel ? "no" : "yes";
|
|
191
|
-
setActiveProbabilityMode(nextMode);
|
|
192
|
-
}, [isDateOutcomeMarket, probabilityModeConfigs.no.sourceOutcomeLabel, selectedOutcomeLabel]);
|
|
193
|
-
const normalizedVenueDataByMode = useMemo(() => {
|
|
194
|
-
const buildModeData = (mode) => {
|
|
195
|
-
const modeConfig = probabilityModeConfigs[mode];
|
|
196
|
-
return selectedOutcomesByMode[mode].map((outcomeByVenue, index) => {
|
|
197
|
-
const rawProbability = normalizeProbability(outcomeByVenue.outcome.price);
|
|
198
|
-
const transformedProbability = rawProbability == null ? void 0 : clampProbability(modeConfig.transformProbability(rawProbability));
|
|
199
|
-
return {
|
|
200
|
-
venue: outcomeByVenue.venue,
|
|
201
|
-
venueLabel: resolveVenueLabel(outcomeByVenue.venue, venueInfo, labels),
|
|
202
|
-
market: outcomeByVenue.market,
|
|
203
|
-
outcome: outcomeByVenue.outcome,
|
|
204
|
-
probability: transformedProbability,
|
|
205
|
-
color: resolveSeriesColor(outcomeByVenue.venue, index)
|
|
206
|
-
};
|
|
207
|
-
});
|
|
208
|
-
};
|
|
209
|
-
return {
|
|
210
|
-
yes: buildModeData("yes"),
|
|
211
|
-
no: buildModeData("no")
|
|
212
|
-
};
|
|
213
|
-
}, [labels, probabilityModeConfigs, selectedOutcomesByMode, venueInfo]);
|
|
214
|
-
const allOutcomesForHistory = useMemo(() => {
|
|
215
|
-
const outcomeByModeAndId = /* @__PURE__ */ new Map();
|
|
216
|
-
probabilityModeOrder.forEach((mode) => {
|
|
217
|
-
selectedOutcomesByMode[mode].forEach((outcomeByVenue) => {
|
|
218
|
-
outcomeByModeAndId.set(
|
|
219
|
-
`${outcomeByVenue.venue}:${outcomeByVenue.outcome.id}`,
|
|
220
|
-
outcomeByVenue
|
|
221
|
-
);
|
|
222
|
-
});
|
|
223
|
-
});
|
|
224
|
-
return [...outcomeByModeAndId.values()];
|
|
225
|
-
}, [selectedOutcomesByMode]);
|
|
226
|
-
const priceHistoryGroups = useMemo(() => {
|
|
227
|
-
return buildPriceHistoryGroups(allOutcomesForHistory, canonicalMarketId);
|
|
228
|
-
}, [allOutcomesForHistory, canonicalMarketId]);
|
|
229
|
-
const timeWindow = useMemo(() => {
|
|
230
|
-
return getTimeWindowByRange(selectedTimeRange);
|
|
231
|
-
}, [selectedTimeRange]);
|
|
232
|
-
const {
|
|
233
|
-
data: priceHistoryData,
|
|
234
|
-
isLoading: isPriceHistoryLoading,
|
|
235
|
-
error: priceHistoryError,
|
|
236
|
-
results: priceHistoryResults
|
|
237
|
-
} = usePriceHistory(__spreadProps(__spreadValues({
|
|
238
|
-
groups: priceHistoryGroups
|
|
239
|
-
}, timeWindow), {
|
|
240
|
-
enabled: priceHistoryGroups.length > 0
|
|
241
|
-
}));
|
|
242
|
-
const priceHistoryByVenue = useMemo(() => {
|
|
243
|
-
const historyByVenue = /* @__PURE__ */ new Map();
|
|
244
|
-
if (!(priceHistoryData == null ? void 0 : priceHistoryData.length)) {
|
|
245
|
-
return historyByVenue;
|
|
246
|
-
}
|
|
247
|
-
priceHistoryData.forEach((historyItem) => {
|
|
248
|
-
const venue = historyItem.venue;
|
|
249
|
-
const venueHistory = historyByVenue.get(venue);
|
|
250
|
-
if (venueHistory) {
|
|
251
|
-
venueHistory.push(historyItem);
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
historyByVenue.set(venue, [historyItem]);
|
|
255
|
-
});
|
|
256
|
-
return historyByVenue;
|
|
257
|
-
}, [priceHistoryData]);
|
|
258
|
-
const chartSeriesByMode = useMemo(() => {
|
|
259
|
-
const buildSeries = (mode) => {
|
|
260
|
-
const modeConfig = probabilityModeConfigs[mode];
|
|
261
|
-
const chartSeries = [];
|
|
262
|
-
normalizedVenueDataByMode[mode].forEach((venueData) => {
|
|
263
|
-
var _a;
|
|
264
|
-
const venueHistory = priceHistoryByVenue.get(venueData.venue);
|
|
265
|
-
if (!(venueHistory == null ? void 0 : venueHistory.length))
|
|
266
|
-
return;
|
|
267
|
-
const candidateIds = resolveOutcomeCandidateIds(venueData.market, venueData.outcome);
|
|
268
|
-
const matchingHistory = (_a = venueHistory.find((historyItem) => candidateIds.includes(historyItem.marketId))) != null ? _a : venueHistory.length === 1 ? venueHistory[0] : void 0;
|
|
269
|
-
if (!matchingHistory)
|
|
270
|
-
return;
|
|
271
|
-
const points = matchingHistory.points.map((point) => {
|
|
272
|
-
const probability = normalizeProbability(point.price);
|
|
273
|
-
if (probability == null || !Number.isFinite(point.timestamp))
|
|
274
|
-
return null;
|
|
275
|
-
return {
|
|
276
|
-
time: point.timestamp,
|
|
277
|
-
value: clampProbability(modeConfig.transformProbability(probability)) * 100
|
|
278
|
-
};
|
|
279
|
-
}).filter((point) => point != null);
|
|
280
|
-
if (points.length === 0)
|
|
281
|
-
return;
|
|
282
|
-
chartSeries.push({
|
|
283
|
-
id: `${mode}-${venueData.venue}-${matchingHistory.marketId}`,
|
|
284
|
-
venue: venueData.venue,
|
|
285
|
-
color: venueData.color,
|
|
286
|
-
points,
|
|
287
|
-
lineWidth: 2,
|
|
288
|
-
lineStyle: "solid"
|
|
289
|
-
});
|
|
290
|
-
});
|
|
291
|
-
return chartSeries;
|
|
292
|
-
};
|
|
293
|
-
return {
|
|
294
|
-
yes: buildSeries("yes"),
|
|
295
|
-
no: buildSeries("no")
|
|
296
|
-
};
|
|
297
|
-
}, [normalizedVenueDataByMode, priceHistoryByVenue, probabilityModeConfigs]);
|
|
298
|
-
const visibleChartSeries = useMemo(() => {
|
|
299
|
-
const modeSeries = chartSeriesByMode[activeProbabilityMode];
|
|
300
|
-
if (!selectedVenue)
|
|
301
|
-
return modeSeries;
|
|
302
|
-
return modeSeries.filter((seriesItem) => seriesItem.venue === selectedVenue);
|
|
303
|
-
}, [activeProbabilityMode, chartSeriesByMode, selectedVenue]);
|
|
304
|
-
const segmentedDisplayItems = useMemo(() => {
|
|
305
|
-
return probabilityModeOrder.map((mode) => {
|
|
306
|
-
const averageProbability = resolveAverageProbability(
|
|
307
|
-
normalizedVenueDataByMode[mode].map((venueData) => venueData.probability)
|
|
308
|
-
);
|
|
309
|
-
const suffix = averageProbability == null ? "" : ` ${formatPercent(averageProbability)}`;
|
|
310
|
-
const switchLabel = probabilityModeConfigs[mode].switchLabel;
|
|
311
|
-
return {
|
|
312
|
-
mode,
|
|
313
|
-
display: `${switchLabel}${suffix}`
|
|
314
|
-
};
|
|
315
|
-
});
|
|
316
|
-
}, [formatPercent, normalizedVenueDataByMode, probabilityModeConfigs]);
|
|
317
|
-
const activeModeVenueData = normalizedVenueDataByMode[activeProbabilityMode];
|
|
318
|
-
useEffect(() => {
|
|
319
|
-
if (!selectedVenue) {
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
if (activeModeVenueData.some((item) => item.venue === selectedVenue)) {
|
|
323
|
-
return;
|
|
324
|
-
}
|
|
325
|
-
setSelectedVenue(null);
|
|
326
|
-
}, [activeModeVenueData, selectedVenue]);
|
|
327
|
-
const handleProbabilityModeChange = (nextMode) => {
|
|
328
|
-
setActiveProbabilityMode(nextMode);
|
|
329
|
-
if (isDateOutcomeMarket) {
|
|
330
|
-
return;
|
|
331
|
-
}
|
|
332
|
-
onSelectedOutcomeLabelChange(probabilityModeConfigs[nextMode].sourceOutcomeLabel);
|
|
333
|
-
};
|
|
334
|
-
const handleVenueToggle = (venue) => {
|
|
335
|
-
setSelectedVenue((currentSelectedVenue) => {
|
|
336
|
-
if (currentSelectedVenue === venue)
|
|
337
|
-
return null;
|
|
338
|
-
return venue;
|
|
339
|
-
});
|
|
340
|
-
};
|
|
341
|
-
const handleRetryPriceHistory = () => {
|
|
342
|
-
void Promise.all(priceHistoryResults.map((result) => result.refetch()));
|
|
343
|
-
};
|
|
344
|
-
if (priceHistoryError) {
|
|
345
|
-
return /* @__PURE__ */ jsx(
|
|
346
|
-
"div",
|
|
347
|
-
{
|
|
348
|
-
className: cn(
|
|
349
|
-
"w-full rounded-agg-xl border border-agg-separator bg-agg-secondary",
|
|
350
|
-
classNames == null ? void 0 : classNames.chart
|
|
351
|
-
),
|
|
352
|
-
children: /* @__PURE__ */ jsx(
|
|
353
|
-
StateMessage,
|
|
354
|
-
{
|
|
355
|
-
ariaLabel: labels.eventItemDetails.chartUnavailableAria,
|
|
356
|
-
tone: "warning",
|
|
357
|
-
title: labels.eventItemDetails.chartUnavailableTitle,
|
|
358
|
-
description: labels.eventItemDetails.chartUnavailableDescription,
|
|
359
|
-
actionLabel: labels.common.retry,
|
|
360
|
-
onAction: handleRetryPriceHistory,
|
|
361
|
-
className: "min-h-[300px] px-5 py-10 md:px-10"
|
|
362
|
-
}
|
|
363
|
-
)
|
|
364
|
-
}
|
|
365
|
-
);
|
|
366
|
-
}
|
|
367
|
-
return /* @__PURE__ */ jsx(
|
|
368
|
-
LineChart,
|
|
369
|
-
{
|
|
370
|
-
classNames: { root: classNames == null ? void 0 : classNames.chart },
|
|
371
|
-
series: visibleChartSeries,
|
|
372
|
-
height: 300,
|
|
373
|
-
isLoading: isPriceHistoryLoading,
|
|
374
|
-
showSeriesControls: activeModeVenueData.length > 0 || segmentedDisplayItems.length > 0,
|
|
375
|
-
renderSeriesControls: () => {
|
|
376
|
-
return /* @__PURE__ */ jsxs(
|
|
377
|
-
"div",
|
|
378
|
-
{
|
|
379
|
-
className: cn("flex flex-row items-center justify-between gap-4", classNames == null ? void 0 : classNames.summary),
|
|
380
|
-
children: [
|
|
381
|
-
/* @__PURE__ */ jsx(
|
|
382
|
-
"div",
|
|
383
|
-
{
|
|
384
|
-
className: cn(
|
|
385
|
-
"flex min-w-0 gap-2 overflow-x-auto pb-1 md:flex-wrap md:overflow-visible md:pb-0",
|
|
386
|
-
classNames == null ? void 0 : classNames.outcomeBadges
|
|
387
|
-
),
|
|
388
|
-
children: activeModeVenueData.map((venueData) => {
|
|
389
|
-
var _a;
|
|
390
|
-
const text = venueData.probability == null ? "-" : formatPercent(venueData.probability);
|
|
391
|
-
const isActiveVenue = selectedVenue === venueData.venue;
|
|
392
|
-
return /* @__PURE__ */ jsx(
|
|
393
|
-
"button",
|
|
394
|
-
{
|
|
395
|
-
type: "button",
|
|
396
|
-
"aria-label": `${venueData.venueLabel} ${text}`,
|
|
397
|
-
"aria-pressed": isActiveVenue,
|
|
398
|
-
className: cn(
|
|
399
|
-
"rounded-agg-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-2 focus-visible:ring-offset-agg-secondary-hover"
|
|
400
|
-
),
|
|
401
|
-
children: /* @__PURE__ */ jsx(
|
|
402
|
-
Badge,
|
|
403
|
-
{
|
|
404
|
-
text,
|
|
405
|
-
size: "large",
|
|
406
|
-
prefix: showVenueLogo ? /* @__PURE__ */ jsx(
|
|
407
|
-
VenueLogo,
|
|
408
|
-
{
|
|
409
|
-
venue: venueData.venue,
|
|
410
|
-
size: "small",
|
|
411
|
-
title: (_a = venueInfo == null ? void 0 : venueInfo[venueData.venue]) == null ? void 0 : _a.label
|
|
412
|
-
}
|
|
413
|
-
) : void 0,
|
|
414
|
-
classNames: {
|
|
415
|
-
root: cn("h-9 shrink-0 border-2 px-4 text-agg-base leading-agg-6")
|
|
416
|
-
},
|
|
417
|
-
isActive: isActiveVenue,
|
|
418
|
-
onClick: (e) => {
|
|
419
|
-
e.preventDefault();
|
|
420
|
-
e.stopPropagation();
|
|
421
|
-
handleVenueToggle(venueData.venue);
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
)
|
|
425
|
-
},
|
|
426
|
-
`${activeProbabilityMode}-${venueData.market.id}-${venueData.outcome.id}`
|
|
427
|
-
);
|
|
428
|
-
})
|
|
429
|
-
}
|
|
430
|
-
),
|
|
431
|
-
/* @__PURE__ */ jsx(
|
|
432
|
-
SwitchButton,
|
|
433
|
-
{
|
|
434
|
-
ariaLabel: labels.eventItemDetails.outcomeSelectorAria,
|
|
435
|
-
className: cn("w-full md:w-fit", classNames == null ? void 0 : classNames.segmentedControl),
|
|
436
|
-
value: activeProbabilityMode,
|
|
437
|
-
onValueChange: handleProbabilityModeChange,
|
|
438
|
-
options: segmentedDisplayItems.map((segmentedItem) => ({
|
|
439
|
-
value: segmentedItem.mode,
|
|
440
|
-
label: segmentedItem.display,
|
|
441
|
-
ariaLabel: segmentedItem.display
|
|
442
|
-
}))
|
|
443
|
-
}
|
|
444
|
-
)
|
|
445
|
-
]
|
|
446
|
-
}
|
|
447
|
-
);
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
);
|
|
451
|
-
};
|
|
452
|
-
var EventListItemDetailsContent = ({
|
|
453
|
-
event,
|
|
454
|
-
title,
|
|
455
|
-
image,
|
|
456
|
-
showVenueLogo = true,
|
|
457
|
-
classNames,
|
|
458
|
-
venueInfo,
|
|
459
|
-
detailsStats,
|
|
460
|
-
ariaLabel,
|
|
461
|
-
defaultTimeRange
|
|
462
|
-
}) => {
|
|
463
|
-
var _a, _b;
|
|
464
|
-
const config = useSdkUiConfig();
|
|
465
|
-
const labels = useLabels();
|
|
466
|
-
const venueMarkets = useMemo(() => {
|
|
467
|
-
var _a2, _b2, _c;
|
|
468
|
-
return (_c = (_b2 = (_a2 = event.markets) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.venueMarkets) != null ? _c : [];
|
|
469
|
-
}, [event.markets]);
|
|
470
|
-
const primaryVenueMarket = useMemo(() => {
|
|
471
|
-
return selectPrimaryVenueMarket(venueMarkets);
|
|
472
|
-
}, [venueMarkets]);
|
|
473
|
-
const outcomeLabels = useMemo(() => {
|
|
474
|
-
return resolveOutcomeLabels(venueMarkets);
|
|
475
|
-
}, [venueMarkets]);
|
|
476
|
-
const [selectedOutcomeLabel, setSelectedOutcomeLabel] = useState(() => {
|
|
477
|
-
return resolveDefaultOutcomeLabel(outcomeLabels);
|
|
478
|
-
});
|
|
479
|
-
const [selectedTimeRange, setSelectedTimeRange] = useState(() => {
|
|
480
|
-
return getDefaultSelectedTimeRange(defaultTimeRange);
|
|
481
|
-
});
|
|
482
|
-
useEffect(() => {
|
|
483
|
-
setSelectedTimeRange(getDefaultSelectedTimeRange(defaultTimeRange));
|
|
484
|
-
}, [defaultTimeRange]);
|
|
485
|
-
const resolvedTitle = resolveTileTitle(event, primaryVenueMarket, title);
|
|
486
|
-
const resolvedImage = resolveTileImage(event, primaryVenueMarket, image);
|
|
487
|
-
const isDateOutcomeMarket = outcomeLabels.length > 2 && outcomeLabels.every(isDateLikeLabel);
|
|
488
|
-
const outcomeSelectorLabels = outcomeLabels;
|
|
489
|
-
const probabilityByLabel = useMemo(() => {
|
|
490
|
-
return new Map(
|
|
491
|
-
outcomeLabels.map((label) => {
|
|
492
|
-
const outcomesByVenue = resolveOutcomesByVenue(venueMarkets, label);
|
|
493
|
-
const probabilities = outcomesByVenue.map((item) => normalizeProbability(item.outcome.price)).filter((value) => value != null);
|
|
494
|
-
if (probabilities.length === 0) {
|
|
495
|
-
return [label, void 0];
|
|
496
|
-
}
|
|
497
|
-
const averageProbability = probabilities.reduce((sum, value) => sum + value, 0) / probabilities.length;
|
|
498
|
-
return [label, averageProbability];
|
|
499
|
-
})
|
|
500
|
-
);
|
|
501
|
-
}, [outcomeLabels, venueMarkets]);
|
|
502
|
-
const mainOutcomeLabel = useMemo(() => {
|
|
503
|
-
if (outcomeLabels.length === 0)
|
|
504
|
-
return void 0;
|
|
505
|
-
return [...outcomeLabels].sort((left, right) => {
|
|
506
|
-
var _a2, _b2;
|
|
507
|
-
const leftProbability = (_a2 = probabilityByLabel.get(left)) != null ? _a2 : -1;
|
|
508
|
-
const rightProbability = (_b2 = probabilityByLabel.get(right)) != null ? _b2 : -1;
|
|
509
|
-
return rightProbability - leftProbability;
|
|
510
|
-
})[0];
|
|
511
|
-
}, [outcomeLabels, probabilityByLabel]);
|
|
512
|
-
useEffect(() => {
|
|
513
|
-
if (!outcomeLabels.length) {
|
|
514
|
-
setSelectedOutcomeLabel(void 0);
|
|
515
|
-
return;
|
|
516
|
-
}
|
|
517
|
-
if (selectedOutcomeLabel && outcomeLabels.includes(selectedOutcomeLabel)) {
|
|
518
|
-
return;
|
|
519
|
-
}
|
|
520
|
-
const fallbackOutcomeLabel = isDateOutcomeMarket ? resolveDefaultOutcomeLabel(outcomeLabels) : mainOutcomeLabel != null ? mainOutcomeLabel : resolveDefaultOutcomeLabel(outcomeLabels);
|
|
521
|
-
setSelectedOutcomeLabel(fallbackOutcomeLabel);
|
|
522
|
-
}, [isDateOutcomeMarket, mainOutcomeLabel, outcomeLabels, selectedOutcomeLabel]);
|
|
523
|
-
const switchLabels = useMemo(() => {
|
|
524
|
-
var _a2, _b2;
|
|
525
|
-
if (isDateOutcomeMarket) {
|
|
526
|
-
return [labels.eventItemDetails.yes, labels.eventItemDetails.no];
|
|
527
|
-
}
|
|
528
|
-
const sortedOutcomeLabels = [...outcomeLabels].sort((left, right) => {
|
|
529
|
-
var _a3, _b3;
|
|
530
|
-
const leftProbability = (_a3 = probabilityByLabel.get(left)) != null ? _a3 : -1;
|
|
531
|
-
const rightProbability = (_b3 = probabilityByLabel.get(right)) != null ? _b3 : -1;
|
|
532
|
-
return rightProbability - leftProbability;
|
|
533
|
-
});
|
|
534
|
-
const firstLabel = (_a2 = sortedOutcomeLabels[0]) != null ? _a2 : labels.eventItemDetails.yes;
|
|
535
|
-
const secondLabel = (_b2 = sortedOutcomeLabels.find((label) => label !== firstLabel)) != null ? _b2 : firstLabel;
|
|
536
|
-
return [firstLabel, secondLabel];
|
|
537
|
-
}, [
|
|
538
|
-
isDateOutcomeMarket,
|
|
539
|
-
labels.eventItemDetails.no,
|
|
540
|
-
labels.eventItemDetails.yes,
|
|
541
|
-
outcomeLabels,
|
|
542
|
-
probabilityByLabel
|
|
543
|
-
]);
|
|
544
|
-
const volumeLabel = useMemo(() => {
|
|
545
|
-
var _a2;
|
|
546
|
-
const resolvedVolume = typeof event.volume === "number" ? event.volume : (_a2 = primaryVenueMarket == null ? void 0 : primaryVenueMarket.volume) != null ? _a2 : void 0;
|
|
547
|
-
if (typeof resolvedVolume !== "number")
|
|
548
|
-
return "";
|
|
549
|
-
return `${config.formatCompactCurrency(resolvedVolume)} ${labels.eventItemDetails.volumeSuffix}`;
|
|
550
|
-
}, [config, event.volume, labels.eventItemDetails.volumeSuffix, primaryVenueMarket == null ? void 0 : primaryVenueMarket.volume]);
|
|
551
|
-
if (!primaryVenueMarket || !selectedOutcomeLabel) {
|
|
552
|
-
return /* @__PURE__ */ jsx(EventListItemDetailsUnavailableState, { classNames, ariaLabel });
|
|
553
|
-
}
|
|
554
|
-
return /* @__PURE__ */ jsxs(
|
|
555
|
-
Card,
|
|
556
|
-
{
|
|
557
|
-
className: cn(detailsBaseCardClassName, classNames == null ? void 0 : classNames.root),
|
|
558
|
-
"aria-label": ariaLabel != null ? ariaLabel : resolvedTitle,
|
|
559
|
-
children: [
|
|
560
|
-
/* @__PURE__ */ jsxs(
|
|
561
|
-
"div",
|
|
562
|
-
{
|
|
563
|
-
className: cn(
|
|
564
|
-
"flex flex-row gap-3 md:gap-4",
|
|
565
|
-
"items-center justify-start",
|
|
566
|
-
classNames == null ? void 0 : classNames.header
|
|
567
|
-
),
|
|
568
|
-
children: [
|
|
569
|
-
resolvedImage ? /* @__PURE__ */ jsx(
|
|
570
|
-
"img",
|
|
571
|
-
{
|
|
572
|
-
src: resolvedImage,
|
|
573
|
-
alt: "",
|
|
574
|
-
className: "size-10 rounded-agg-lg object-cover md:size-[60px]"
|
|
575
|
-
}
|
|
576
|
-
) : null,
|
|
577
|
-
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-3", children: [
|
|
578
|
-
/* @__PURE__ */ jsx(
|
|
579
|
-
Typography,
|
|
580
|
-
{
|
|
581
|
-
variant: "body-strong",
|
|
582
|
-
className: cn(
|
|
583
|
-
"min-w-0 text-agg-base font-agg-bold! leading-agg-6 md:text-agg-2xl md:leading-agg-8",
|
|
584
|
-
"truncate text-wrap wrap-break-word line-clamp-2",
|
|
585
|
-
classNames == null ? void 0 : classNames.title
|
|
586
|
-
),
|
|
587
|
-
children: resolvedTitle
|
|
588
|
-
}
|
|
589
|
-
),
|
|
590
|
-
outcomeSelectorLabels.length > 2 ? /* @__PURE__ */ jsx(
|
|
591
|
-
"div",
|
|
592
|
-
{
|
|
593
|
-
className: cn(
|
|
594
|
-
"flex items-center gap-2 overflow-x-auto pb-1 md:flex-wrap md:overflow-visible md:pb-0",
|
|
595
|
-
classNames == null ? void 0 : classNames.headerPills
|
|
596
|
-
),
|
|
597
|
-
children: outcomeSelectorLabels.map((outcomeSelectorLabel) => {
|
|
598
|
-
const isActive = outcomeSelectorLabel === selectedOutcomeLabel;
|
|
599
|
-
const displayLabel = isDateLikeLabel(outcomeSelectorLabel) ? formatDateLabel(outcomeSelectorLabel) : outcomeSelectorLabel;
|
|
600
|
-
return /* @__PURE__ */ jsx(
|
|
601
|
-
Button,
|
|
602
|
-
{
|
|
603
|
-
size: "small",
|
|
604
|
-
variant: "secondary",
|
|
605
|
-
"aria-pressed": isActive,
|
|
606
|
-
className: cn(
|
|
607
|
-
"h-auto shrink-0 rounded-agg-full px-4 py-1.5 text-agg-sm leading-agg-5",
|
|
608
|
-
"border-2",
|
|
609
|
-
isActive ? "border-agg-primary bg-agg-secondary text-agg-foreground font-agg-bold" : "border-transparent bg-agg-secondary-hover text-agg-foreground font-agg-normal"
|
|
610
|
-
),
|
|
611
|
-
onClick: () => setSelectedOutcomeLabel(outcomeSelectorLabel),
|
|
612
|
-
children: displayLabel
|
|
613
|
-
},
|
|
614
|
-
outcomeSelectorLabel
|
|
615
|
-
);
|
|
616
|
-
})
|
|
617
|
-
}
|
|
618
|
-
) : null
|
|
619
|
-
] })
|
|
620
|
-
]
|
|
621
|
-
}
|
|
622
|
-
),
|
|
623
|
-
detailsStats && detailsStats.length > 0 ? /* @__PURE__ */ jsx("div", { className: cn("flex flex-wrap items-start gap-4 md:gap-6", classNames == null ? void 0 : classNames.headerStats), children: detailsStats.map((statItem) => {
|
|
624
|
-
const deltaClassName = statItem.deltaTone === "positive" ? "text-agg-success!" : statItem.deltaTone === "negative" ? "text-agg-error!" : "text-agg-muted-foreground";
|
|
625
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
626
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption-caps", className: "text-agg-muted-foreground", children: statItem.label }),
|
|
627
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-baseline gap-1", children: [
|
|
628
|
-
/* @__PURE__ */ jsx(
|
|
629
|
-
Typography,
|
|
630
|
-
{
|
|
631
|
-
variant: "body",
|
|
632
|
-
className: "text-agg-lg leading-agg-7 text-agg-foreground",
|
|
633
|
-
children: statItem.value
|
|
634
|
-
}
|
|
635
|
-
),
|
|
636
|
-
statItem.delta ? /* @__PURE__ */ jsx(Typography, { variant: "label", className: cn(deltaClassName), children: statItem.delta }) : null
|
|
637
|
-
] })
|
|
638
|
-
] }, `${statItem.label}-${statItem.value}`);
|
|
639
|
-
}) }) : null,
|
|
640
|
-
/* @__PURE__ */ jsx(
|
|
641
|
-
EventListItemDetailsGraphSection,
|
|
642
|
-
{
|
|
643
|
-
venueMarkets,
|
|
644
|
-
canonicalMarketId: (_b = (_a = event.markets) == null ? void 0 : _a[0]) == null ? void 0 : _b.id,
|
|
645
|
-
selectedOutcomeLabel,
|
|
646
|
-
onSelectedOutcomeLabelChange: setSelectedOutcomeLabel,
|
|
647
|
-
switchLabels,
|
|
648
|
-
isDateOutcomeMarket,
|
|
649
|
-
classNames,
|
|
650
|
-
showVenueLogo,
|
|
651
|
-
venueInfo,
|
|
652
|
-
formatPercent: config.formatPercent,
|
|
653
|
-
selectedTimeRange
|
|
654
|
-
}
|
|
655
|
-
),
|
|
656
|
-
/* @__PURE__ */ jsxs("div", { className: cn("flex flex-wrap items-center justify-between gap-4", classNames == null ? void 0 : classNames.footer), children: [
|
|
657
|
-
/* @__PURE__ */ jsx(Typography, { variant: "label", className: "text-agg-muted-foreground", children: volumeLabel || "-" }),
|
|
658
|
-
/* @__PURE__ */ jsx("div", { className: cn("flex items-center gap-2 md:gap-3", classNames == null ? void 0 : classNames.timeRange), children: eventListItemDetailsTimeRanges.map((timeRange) => {
|
|
659
|
-
const isActive = timeRange === selectedTimeRange;
|
|
660
|
-
return /* @__PURE__ */ jsx(
|
|
661
|
-
Button,
|
|
662
|
-
{
|
|
663
|
-
size: "small",
|
|
664
|
-
variant: "tertiary",
|
|
665
|
-
className: cn(
|
|
666
|
-
"h-auto min-w-0 rounded-none px-0 py-0 text-agg-xs leading-agg-4 md:text-agg-sm md:leading-agg-5",
|
|
667
|
-
"border-0 bg-transparent shadow-none",
|
|
668
|
-
"hover:text-agg-foreground!",
|
|
669
|
-
isActive ? "font-agg-bold! text-agg-foreground!" : "font-agg-normal! text-agg-muted-foreground!"
|
|
670
|
-
),
|
|
671
|
-
"aria-pressed": isActive,
|
|
672
|
-
onClick: () => setSelectedTimeRange(timeRange),
|
|
673
|
-
children: timeRange === "ALL" ? labels.eventItemDetails.allTimeRange : timeRange
|
|
674
|
-
},
|
|
675
|
-
timeRange
|
|
676
|
-
);
|
|
677
|
-
}) })
|
|
678
|
-
] })
|
|
679
|
-
]
|
|
680
|
-
}
|
|
681
|
-
);
|
|
682
|
-
};
|
|
683
|
-
var EventListItemDetailsByEventId = (_a) => {
|
|
684
|
-
var _b = _a, {
|
|
685
|
-
eventId
|
|
686
|
-
} = _b, rest = __objRest(_b, [
|
|
687
|
-
"eventId"
|
|
688
|
-
]);
|
|
689
|
-
const {
|
|
690
|
-
event: fetchedEvent,
|
|
691
|
-
error,
|
|
692
|
-
isError,
|
|
693
|
-
isLoading
|
|
694
|
-
} = useEvent(eventId, {
|
|
695
|
-
enabled: !!eventId
|
|
696
|
-
});
|
|
697
|
-
const resolvedEvent = useMemo(() => {
|
|
698
|
-
return resolveEventListItemEvent(fetchedEvent);
|
|
699
|
-
}, [fetchedEvent]);
|
|
700
|
-
if (!eventId) {
|
|
701
|
-
return /* @__PURE__ */ jsx(
|
|
702
|
-
EventListItemDetailsUnavailableState,
|
|
703
|
-
{
|
|
704
|
-
classNames: rest.classNames,
|
|
705
|
-
ariaLabel: rest.ariaLabel
|
|
706
|
-
}
|
|
707
|
-
);
|
|
708
|
-
}
|
|
709
|
-
if (isLoading) {
|
|
710
|
-
return /* @__PURE__ */ jsx(EventListItemDetailsLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
711
|
-
}
|
|
712
|
-
if (isErrorWithStatus(error, 404)) {
|
|
713
|
-
return /* @__PURE__ */ jsx(EventListItemDetailsNotFoundState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
714
|
-
}
|
|
715
|
-
if (!fetchedEvent && !isError) {
|
|
716
|
-
return /* @__PURE__ */ jsx(EventListItemDetailsLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
717
|
-
}
|
|
718
|
-
if (!resolvedEvent) {
|
|
719
|
-
return /* @__PURE__ */ jsx(
|
|
720
|
-
EventListItemDetailsUnavailableState,
|
|
721
|
-
{
|
|
722
|
-
classNames: rest.classNames,
|
|
723
|
-
ariaLabel: rest.ariaLabel
|
|
724
|
-
}
|
|
725
|
-
);
|
|
726
|
-
}
|
|
727
|
-
return /* @__PURE__ */ jsx(EventListItemDetailsContent, __spreadValues({ event: resolvedEvent }, rest));
|
|
728
|
-
};
|
|
729
|
-
var EventListItemDetails = (props) => {
|
|
730
|
-
if (props.isLoading) {
|
|
731
|
-
return /* @__PURE__ */ jsx(EventListItemDetailsLoadingState, { classNames: props.classNames, ariaLabel: props.ariaLabel });
|
|
732
|
-
}
|
|
733
|
-
if ("event" in props && props.event) {
|
|
734
|
-
const _a = props, { event } = _a, rest = __objRest(_a, ["event"]);
|
|
735
|
-
return /* @__PURE__ */ jsx(EventListItemDetailsContent, __spreadValues({ event }, rest));
|
|
736
|
-
}
|
|
737
|
-
if ("eventId" in props && typeof props.eventId === "string") {
|
|
738
|
-
const {
|
|
739
|
-
title: titleOverride,
|
|
740
|
-
image: imageOverride,
|
|
741
|
-
showVenueLogo: showVenueLogoOverride,
|
|
742
|
-
classNames,
|
|
743
|
-
venueInfo,
|
|
744
|
-
detailsStats,
|
|
745
|
-
ariaLabel: ariaLabelOverride,
|
|
746
|
-
defaultTimeRange: defaultTimeRangeOverride
|
|
747
|
-
} = props;
|
|
748
|
-
const byEventIdProps = {
|
|
749
|
-
eventId: props.eventId,
|
|
750
|
-
isLoading: false,
|
|
751
|
-
title: titleOverride,
|
|
752
|
-
image: imageOverride,
|
|
753
|
-
showVenueLogo: showVenueLogoOverride,
|
|
754
|
-
classNames,
|
|
755
|
-
venueInfo,
|
|
756
|
-
detailsStats,
|
|
757
|
-
ariaLabel: ariaLabelOverride,
|
|
758
|
-
defaultTimeRange: defaultTimeRangeOverride
|
|
759
|
-
};
|
|
760
|
-
return /* @__PURE__ */ jsx(EventListItemDetailsByEventId, __spreadValues({}, byEventIdProps));
|
|
761
|
-
}
|
|
762
|
-
return /* @__PURE__ */ jsx(
|
|
763
|
-
EventListItemDetailsUnavailableState,
|
|
764
|
-
{
|
|
765
|
-
classNames: props.classNames,
|
|
766
|
-
ariaLabel: props.ariaLabel
|
|
767
|
-
}
|
|
768
|
-
);
|
|
769
|
-
};
|
|
770
|
-
EventListItemDetails.displayName = "EventListItemDetails";
|
|
771
|
-
|
|
772
|
-
export {
|
|
773
|
-
EventListItemDetails
|
|
774
|
-
};
|