@agg-build/ui 4.2.0 → 4.4.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 +21 -16
- package/dist/{chunk-DNPDXL2D.mjs → chunk-64BBTXFE.mjs} +333 -102
- package/dist/{chunk-WDCH4RRS.mjs → chunk-6STRIKUA.mjs} +1 -1
- package/dist/{chunk-FTL25XKE.mjs → chunk-734VTGCV.mjs} +1 -1
- package/dist/{chunk-QW7VFURU.mjs → chunk-N7UPPT5J.mjs} +53 -3
- package/dist/{chunk-6X6Y4INU.mjs → chunk-UCU2XCV5.mjs} +2 -2
- package/dist/{chunk-GNEFI4SO.mjs → chunk-V5CRUO6S.mjs} +637 -380
- package/dist/{chunk-UDBHAZJJ.mjs → chunk-WW5QKNIM.mjs} +270 -123
- package/dist/events.js +1061 -645
- package/dist/events.mjs +6 -4
- package/dist/index.js +2923 -2251
- package/dist/index.mjs +12 -8
- package/dist/modals.js +9 -2
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +2391 -1721
- package/dist/pages.mjs +8 -6
- package/dist/primitives.js +30 -3
- package/dist/primitives.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +330 -99
- package/dist/trading.mjs +4 -4
- package/dist/types/events/index.d.mts +1 -0
- package/dist/types/events/index.d.ts +1 -0
- package/dist/types/events/item-details/event-list-item-details-market-selector.d.mts +4 -1
- package/dist/types/events/item-details/event-list-item-details-market-selector.d.ts +4 -1
- package/dist/types/events/item-details/event-list-item-details.types.d.mts +25 -1
- package/dist/types/events/item-details/event-list-item-details.types.d.ts +25 -1
- package/dist/types/events/item-details/index.d.mts +1 -1
- package/dist/types/events/item-details/index.d.ts +1 -1
- package/dist/types/events/market-details/index.d.mts +1 -1
- package/dist/types/events/market-details/index.d.ts +1 -1
- package/dist/types/events/market-details/market-details.types.d.mts +4 -0
- package/dist/types/events/market-details/market-details.types.d.ts +4 -0
- package/dist/types/events/shared/format-event-title.d.mts +9 -1
- package/dist/types/events/shared/format-event-title.d.ts +9 -1
- package/dist/types/events/shared/format-sports-event-time.d.mts +2 -0
- package/dist/types/events/shared/format-sports-event-time.d.ts +2 -0
- package/dist/types/events/shared/sports-live-score.d.mts +10 -0
- package/dist/types/events/shared/sports-live-score.d.ts +10 -0
- package/dist/types/pages/event-market/event-market.types.d.mts +4 -0
- package/dist/types/pages/event-market/event-market.types.d.ts +4 -0
- package/dist/types/pages/event-market/index.d.mts +1 -0
- package/dist/types/pages/event-market/index.d.ts +1 -0
- package/dist/types/pages/user-profile/components/available-balance-card.d.mts +5 -0
- package/dist/types/pages/user-profile/components/available-balance-card.d.ts +5 -0
- package/dist/types/pages/user-profile/components/open-order-row.d.mts +1 -0
- package/dist/types/pages/user-profile/components/open-order-row.d.ts +1 -0
- package/dist/types/pages/user-profile/components/positions-activity.d.mts +1 -1
- package/dist/types/pages/user-profile/components/positions-activity.d.ts +1 -1
- package/dist/types/pages/user-profile/user-profile.types.d.mts +1 -1
- package/dist/types/pages/user-profile/user-profile.types.d.ts +1 -1
- package/dist/types/trading/place-order/index.d.mts +1 -1
- package/dist/types/trading/place-order/index.d.ts +1 -1
- package/dist/types/trading/place-order/index.place-order.execution-steps.d.mts +13 -1
- package/dist/types/trading/place-order/index.place-order.execution-steps.d.ts +13 -1
- package/dist/types/trading/place-order/index.place-order.execution-view.d.mts +2 -1
- package/dist/types/trading/place-order/index.place-order.execution-view.d.ts +2 -1
- package/dist/types/trading/place-order/index.place-order.types.d.mts +9 -0
- package/dist/types/trading/place-order/index.place-order.types.d.ts +9 -0
- package/dist/types/trading/place-order/index.place-order.utils.d.mts +6 -0
- package/dist/types/trading/place-order/index.place-order.utils.d.ts +6 -0
- package/package.json +3 -3
- /package/dist/{chunk-KHHFHXXD.mjs → chunk-JH4B3ZHQ.mjs} +0 -0
package/dist/events.js
CHANGED
|
@@ -69,6 +69,7 @@ __export(events_exports, {
|
|
|
69
69
|
Orderbook: () => Orderbook,
|
|
70
70
|
OrderbookWithStates: () => OrderbookWithStates,
|
|
71
71
|
SettlementSummary: () => SettlementSummary,
|
|
72
|
+
SportsLiveScore: () => SportsLiveScore,
|
|
72
73
|
collectEligibleVenueOutcomeIds: () => collectEligibleVenueOutcomeIds,
|
|
73
74
|
collectEligibleVenueOutcomes: () => collectEligibleVenueOutcomes,
|
|
74
75
|
formatProbabilityCents: () => formatProbabilityCents,
|
|
@@ -82,7 +83,7 @@ __export(events_exports, {
|
|
|
82
83
|
module.exports = __toCommonJS(events_exports);
|
|
83
84
|
|
|
84
85
|
// src/events/item/index.tsx
|
|
85
|
-
var
|
|
86
|
+
var import_hooks33 = require("@agg-build/hooks");
|
|
86
87
|
var import_react10 = require("react");
|
|
87
88
|
|
|
88
89
|
// src/constants.ts
|
|
@@ -5724,6 +5725,14 @@ var formatSportsEventTimeEt = (value) => {
|
|
|
5724
5725
|
|
|
5725
5726
|
// src/events/shared/format-event-title.ts
|
|
5726
5727
|
var SPORT_CATEGORY_TOKENS = /* @__PURE__ */ new Set(["sport", "sports"]);
|
|
5728
|
+
var RECURRING_CRYPTO_TIMESTAMP_SUFFIX = /\s+-\s+(?:jan(?:uary)?|feb(?:ruary)?|mar(?:ch)?|apr(?:il)?|may|jun(?:e)?|jul(?:y)?|aug(?:ust)?|sep(?:t(?:ember)?)?|oct(?:ober)?|nov(?:ember)?|dec(?:ember)?)\b.*$/i;
|
|
5729
|
+
var RECURRING_CRYPTO_DURATION_SUFFIX = /\s+-\s+(?:5m(?:in)?|15m(?:in)?|1h|1d)$/i;
|
|
5730
|
+
var RECURRING_CRYPTO_DURATION_LABELS = {
|
|
5731
|
+
PT5M: "5min",
|
|
5732
|
+
PT15M: "15min",
|
|
5733
|
+
PT1H: "1h",
|
|
5734
|
+
P1D: "1d"
|
|
5735
|
+
};
|
|
5727
5736
|
var normalizeCategoryToken = (value) => {
|
|
5728
5737
|
if (typeof value !== "string") return null;
|
|
5729
5738
|
const normalizedValue = value.trim().toLowerCase();
|
|
@@ -5792,9 +5801,21 @@ var resolveEventHeading = ({
|
|
|
5792
5801
|
structureType,
|
|
5793
5802
|
gameStartTime,
|
|
5794
5803
|
endDate,
|
|
5795
|
-
venueMarkets
|
|
5804
|
+
venueMarkets,
|
|
5805
|
+
recurringCryptoWindowStart,
|
|
5806
|
+
recurringCryptoDuration
|
|
5796
5807
|
}) => {
|
|
5797
5808
|
const resolvedTitle = title2.trim();
|
|
5809
|
+
if (recurringCryptoWindowStart !== void 0) {
|
|
5810
|
+
const windowStartDate = recurringCryptoWindowStart == null ? null : new Date(recurringCryptoWindowStart);
|
|
5811
|
+
const timestampLabel = windowStartDate && !Number.isNaN(windowStartDate.getTime()) ? formatSportsEventTimeEt(windowStartDate.toISOString()) : null;
|
|
5812
|
+
const titleWithoutTimestamp = resolvedTitle.replace(RECURRING_CRYPTO_TIMESTAMP_SUFFIX, "").replace(RECURRING_CRYPTO_DURATION_SUFFIX, "").trim();
|
|
5813
|
+
const durationLabel = recurringCryptoDuration ? RECURRING_CRYPTO_DURATION_LABELS[recurringCryptoDuration] : null;
|
|
5814
|
+
return {
|
|
5815
|
+
title: durationLabel ? `${titleWithoutTimestamp} - ${durationLabel}` : titleWithoutTimestamp,
|
|
5816
|
+
timestampLabel
|
|
5817
|
+
};
|
|
5818
|
+
}
|
|
5798
5819
|
return {
|
|
5799
5820
|
title: resolvedTitle,
|
|
5800
5821
|
timestampLabel: resolveEventTimestampLabel({
|
|
@@ -6064,8 +6085,141 @@ var resolveDisplayVolume = (eventVolume, venueMarkets) => {
|
|
|
6064
6085
|
return void 0;
|
|
6065
6086
|
};
|
|
6066
6087
|
|
|
6067
|
-
// src/primitives/
|
|
6088
|
+
// src/primitives/loading-icon/index.tsx
|
|
6068
6089
|
var import_hooks27 = require("@agg-build/hooks");
|
|
6090
|
+
|
|
6091
|
+
// src/primitives/loading-icon/loading-icon.constants.ts
|
|
6092
|
+
var LOADING_ICON_DEFAULT_SIZE = "medium";
|
|
6093
|
+
var LOADING_ICON_SVG_VIEW_BOX = "0 0 44 44";
|
|
6094
|
+
var LOADING_ICON_PROMINENT_FRAME_CLASS = "h-12 w-12";
|
|
6095
|
+
var LOADING_ICON_PROMINENT_STROKE = 2;
|
|
6096
|
+
var LOADING_ICON_PROMINENT_DASHARRAY = "75 25";
|
|
6097
|
+
|
|
6098
|
+
// src/primitives/loading-icon/loading-icon.utils.ts
|
|
6099
|
+
var resolveLoadingIconAriaLabel = ({
|
|
6100
|
+
ariaLabel,
|
|
6101
|
+
fallbackLabel
|
|
6102
|
+
}) => {
|
|
6103
|
+
return ariaLabel != null ? ariaLabel : fallbackLabel;
|
|
6104
|
+
};
|
|
6105
|
+
|
|
6106
|
+
// src/primitives/loading-icon/index.tsx
|
|
6107
|
+
var import_jsx_runtime117 = require("react/jsx-runtime");
|
|
6108
|
+
var LoadingIcon = ({
|
|
6109
|
+
size = LOADING_ICON_DEFAULT_SIZE,
|
|
6110
|
+
variant = "default",
|
|
6111
|
+
className,
|
|
6112
|
+
ariaLabel
|
|
6113
|
+
}) => {
|
|
6114
|
+
const labels = (0, import_hooks27.useLabels)();
|
|
6115
|
+
const {
|
|
6116
|
+
features: { enableAnimations }
|
|
6117
|
+
} = (0, import_hooks27.useSdkUiConfig)();
|
|
6118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6119
|
+
"span",
|
|
6120
|
+
{
|
|
6121
|
+
role: "status",
|
|
6122
|
+
"aria-label": resolveLoadingIconAriaLabel({
|
|
6123
|
+
ariaLabel,
|
|
6124
|
+
fallbackLabel: labels.common.loading
|
|
6125
|
+
}),
|
|
6126
|
+
className: cn(
|
|
6127
|
+
"group/agg-loading-icon",
|
|
6128
|
+
"inline-grid place-items-center text-agg-primary will-change-transform",
|
|
6129
|
+
className
|
|
6130
|
+
),
|
|
6131
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("span", { className: "inline-grid place-items-center", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6132
|
+
"svg",
|
|
6133
|
+
{
|
|
6134
|
+
viewBox: LOADING_ICON_SVG_VIEW_BOX,
|
|
6135
|
+
className: cn(
|
|
6136
|
+
"block",
|
|
6137
|
+
variant === "prominent" ? LOADING_ICON_PROMINENT_FRAME_CLASS : iconSizeClasses[size]
|
|
6138
|
+
),
|
|
6139
|
+
children: variant === "prominent" ? /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("g", { children: [
|
|
6140
|
+
enableAnimations ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6141
|
+
"animateTransform",
|
|
6142
|
+
{
|
|
6143
|
+
attributeName: "transform",
|
|
6144
|
+
attributeType: "XML",
|
|
6145
|
+
type: "rotate",
|
|
6146
|
+
from: "0 22 22",
|
|
6147
|
+
to: "360 22 22",
|
|
6148
|
+
dur: "0.85s",
|
|
6149
|
+
repeatCount: "indefinite"
|
|
6150
|
+
}
|
|
6151
|
+
) : null,
|
|
6152
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6153
|
+
"circle",
|
|
6154
|
+
{
|
|
6155
|
+
cx: "22",
|
|
6156
|
+
cy: "22",
|
|
6157
|
+
r: "16",
|
|
6158
|
+
fill: "none",
|
|
6159
|
+
pathLength: 100,
|
|
6160
|
+
stroke: "currentColor",
|
|
6161
|
+
strokeWidth: LOADING_ICON_PROMINENT_STROKE,
|
|
6162
|
+
strokeLinecap: "round",
|
|
6163
|
+
strokeDasharray: LOADING_ICON_PROMINENT_DASHARRAY
|
|
6164
|
+
}
|
|
6165
|
+
)
|
|
6166
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("g", { children: [
|
|
6167
|
+
enableAnimations ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6168
|
+
"animateTransform",
|
|
6169
|
+
{
|
|
6170
|
+
attributeName: "transform",
|
|
6171
|
+
attributeType: "XML",
|
|
6172
|
+
type: "rotate",
|
|
6173
|
+
from: "0 22 22",
|
|
6174
|
+
to: "360 22 22",
|
|
6175
|
+
dur: "1.4s",
|
|
6176
|
+
repeatCount: "indefinite"
|
|
6177
|
+
}
|
|
6178
|
+
) : null,
|
|
6179
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6180
|
+
"circle",
|
|
6181
|
+
{
|
|
6182
|
+
cx: "22",
|
|
6183
|
+
cy: "22",
|
|
6184
|
+
r: "16",
|
|
6185
|
+
fill: "none",
|
|
6186
|
+
stroke: "currentColor",
|
|
6187
|
+
strokeWidth: 6,
|
|
6188
|
+
strokeLinecap: "round",
|
|
6189
|
+
strokeDasharray: "60 100",
|
|
6190
|
+
strokeDashoffset: "0",
|
|
6191
|
+
children: enableAnimations ? /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(import_jsx_runtime117.Fragment, { children: [
|
|
6192
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6193
|
+
"animate",
|
|
6194
|
+
{
|
|
6195
|
+
attributeName: "stroke-dasharray",
|
|
6196
|
+
values: "1 100;60 100;1 100",
|
|
6197
|
+
dur: "1.2s",
|
|
6198
|
+
repeatCount: "indefinite"
|
|
6199
|
+
}
|
|
6200
|
+
),
|
|
6201
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6202
|
+
"animate",
|
|
6203
|
+
{
|
|
6204
|
+
attributeName: "stroke-dashoffset",
|
|
6205
|
+
values: "0;-25;-100",
|
|
6206
|
+
dur: "1.2s",
|
|
6207
|
+
repeatCount: "indefinite"
|
|
6208
|
+
}
|
|
6209
|
+
)
|
|
6210
|
+
] }) : null
|
|
6211
|
+
}
|
|
6212
|
+
)
|
|
6213
|
+
] })
|
|
6214
|
+
}
|
|
6215
|
+
) })
|
|
6216
|
+
}
|
|
6217
|
+
);
|
|
6218
|
+
};
|
|
6219
|
+
LoadingIcon.displayName = "LoadingIcon";
|
|
6220
|
+
|
|
6221
|
+
// src/primitives/modal/index.tsx
|
|
6222
|
+
var import_hooks28 = require("@agg-build/hooks");
|
|
6069
6223
|
var Dialog = __toESM(require("@radix-ui/react-dialog"));
|
|
6070
6224
|
|
|
6071
6225
|
// src/primitives/modal/modal.constants.ts
|
|
@@ -6089,7 +6243,7 @@ var resolveModalCloseIcon = ({
|
|
|
6089
6243
|
};
|
|
6090
6244
|
|
|
6091
6245
|
// src/primitives/modal/index.tsx
|
|
6092
|
-
var
|
|
6246
|
+
var import_jsx_runtime118 = require("react/jsx-runtime");
|
|
6093
6247
|
var Modal = ({
|
|
6094
6248
|
open,
|
|
6095
6249
|
onOpenChange,
|
|
@@ -6097,7 +6251,7 @@ var Modal = ({
|
|
|
6097
6251
|
"aria-label": _ariaLabel,
|
|
6098
6252
|
"aria-labelledby": _ariaLabelledBy
|
|
6099
6253
|
}) => {
|
|
6100
|
-
return /* @__PURE__ */ (0,
|
|
6254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(Dialog.Root, { open, onOpenChange, children });
|
|
6101
6255
|
};
|
|
6102
6256
|
var ModalContainer = ({
|
|
6103
6257
|
children,
|
|
@@ -6109,11 +6263,11 @@ var ModalContainer = ({
|
|
|
6109
6263
|
const {
|
|
6110
6264
|
general: { rootClassName },
|
|
6111
6265
|
features: { enableAnimations }
|
|
6112
|
-
} = (0,
|
|
6266
|
+
} = (0, import_hooks28.useSdkUiConfig)();
|
|
6113
6267
|
const overlayAnimationClassName = resolveModalOverlayAnimationClassName(enableAnimations);
|
|
6114
6268
|
const panelAnimationClassName = resolveModalPanelAnimationClassName(enableAnimations);
|
|
6115
|
-
return /* @__PURE__ */ (0,
|
|
6116
|
-
/* @__PURE__ */ (0,
|
|
6269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(Dialog.Portal, { children: [
|
|
6270
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
6117
6271
|
Dialog.Overlay,
|
|
6118
6272
|
{
|
|
6119
6273
|
className: cn(
|
|
@@ -6124,7 +6278,7 @@ var ModalContainer = ({
|
|
|
6124
6278
|
)
|
|
6125
6279
|
}
|
|
6126
6280
|
),
|
|
6127
|
-
/* @__PURE__ */ (0,
|
|
6281
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
6128
6282
|
Dialog.Content,
|
|
6129
6283
|
{
|
|
6130
6284
|
className: cn(
|
|
@@ -6150,7 +6304,7 @@ var ModalContainer = ({
|
|
|
6150
6304
|
event.preventDefault();
|
|
6151
6305
|
}
|
|
6152
6306
|
},
|
|
6153
|
-
children: /* @__PURE__ */ (0,
|
|
6307
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
6154
6308
|
"div",
|
|
6155
6309
|
{
|
|
6156
6310
|
className: cn(
|
|
@@ -6158,7 +6312,7 @@ var ModalContainer = ({
|
|
|
6158
6312
|
"items-end md:items-center",
|
|
6159
6313
|
"flex h-full min-h-0 w-full justify-center p-0 md:p-5"
|
|
6160
6314
|
),
|
|
6161
|
-
children: /* @__PURE__ */ (0,
|
|
6315
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
6162
6316
|
"div",
|
|
6163
6317
|
{
|
|
6164
6318
|
className: cn(
|
|
@@ -6198,14 +6352,14 @@ var ModalHeader = ({
|
|
|
6198
6352
|
}) => {
|
|
6199
6353
|
const {
|
|
6200
6354
|
features: { enableAnimations }
|
|
6201
|
-
} = (0,
|
|
6202
|
-
const labels = (0,
|
|
6203
|
-
const defaultCloseIcon = /* @__PURE__ */ (0,
|
|
6355
|
+
} = (0, import_hooks28.useSdkUiConfig)();
|
|
6356
|
+
const labels = (0, import_hooks28.useLabels)();
|
|
6357
|
+
const defaultCloseIcon = /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(CloseIcon, { className: "h-6 w-6" });
|
|
6204
6358
|
const resolvedCloseIcon = resolveModalCloseIcon({
|
|
6205
6359
|
closeIcon,
|
|
6206
6360
|
defaultCloseIcon
|
|
6207
6361
|
});
|
|
6208
|
-
return /* @__PURE__ */ (0,
|
|
6362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(
|
|
6209
6363
|
"div",
|
|
6210
6364
|
{
|
|
6211
6365
|
className: cn(
|
|
@@ -6218,7 +6372,7 @@ var ModalHeader = ({
|
|
|
6218
6372
|
classNames == null ? void 0 : classNames.root
|
|
6219
6373
|
),
|
|
6220
6374
|
children: [
|
|
6221
|
-
/* @__PURE__ */ (0,
|
|
6375
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(
|
|
6222
6376
|
"div",
|
|
6223
6377
|
{
|
|
6224
6378
|
className: cn(
|
|
@@ -6231,8 +6385,8 @@ var ModalHeader = ({
|
|
|
6231
6385
|
classNames == null ? void 0 : classNames.container
|
|
6232
6386
|
),
|
|
6233
6387
|
children: [
|
|
6234
|
-
leftElement ? /* @__PURE__ */ (0,
|
|
6235
|
-
/* @__PURE__ */ (0,
|
|
6388
|
+
leftElement ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_jsx_runtime118.Fragment, { children: leftElement }) : null,
|
|
6389
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(
|
|
6236
6390
|
"div",
|
|
6237
6391
|
{
|
|
6238
6392
|
className: cn(
|
|
@@ -6241,7 +6395,7 @@ var ModalHeader = ({
|
|
|
6241
6395
|
classNames == null ? void 0 : classNames.titleContainer
|
|
6242
6396
|
),
|
|
6243
6397
|
children: [
|
|
6244
|
-
/* @__PURE__ */ (0,
|
|
6398
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
6245
6399
|
Dialog.Title,
|
|
6246
6400
|
{
|
|
6247
6401
|
className: cn(
|
|
@@ -6255,7 +6409,7 @@ var ModalHeader = ({
|
|
|
6255
6409
|
children: title2
|
|
6256
6410
|
}
|
|
6257
6411
|
),
|
|
6258
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
6412
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
6259
6413
|
"span",
|
|
6260
6414
|
{
|
|
6261
6415
|
className: cn(
|
|
@@ -6269,9 +6423,9 @@ var ModalHeader = ({
|
|
|
6269
6423
|
]
|
|
6270
6424
|
}
|
|
6271
6425
|
),
|
|
6272
|
-
/* @__PURE__ */ (0,
|
|
6273
|
-
rightElement ? /* @__PURE__ */ (0,
|
|
6274
|
-
!hideClose && /* @__PURE__ */ (0,
|
|
6426
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: "agg-modal-header-actions flex flex-row items-center justify-end gap-6", children: [
|
|
6427
|
+
rightElement ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_jsx_runtime118.Fragment, { children: rightElement }) : null,
|
|
6428
|
+
!hideClose && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
6275
6429
|
Dialog.Close,
|
|
6276
6430
|
{
|
|
6277
6431
|
className: cn(
|
|
@@ -6288,14 +6442,14 @@ var ModalHeader = ({
|
|
|
6288
6442
|
]
|
|
6289
6443
|
}
|
|
6290
6444
|
),
|
|
6291
|
-
children ? /* @__PURE__ */ (0,
|
|
6445
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: "agg-modal-header-extra", children }) : null
|
|
6292
6446
|
]
|
|
6293
6447
|
}
|
|
6294
6448
|
);
|
|
6295
6449
|
};
|
|
6296
6450
|
Modal.Header = ModalHeader;
|
|
6297
6451
|
var ModalBody = ({ children, classNames }) => {
|
|
6298
|
-
return /* @__PURE__ */ (0,
|
|
6452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
6299
6453
|
"div",
|
|
6300
6454
|
{
|
|
6301
6455
|
className: cn(
|
|
@@ -6316,7 +6470,7 @@ var ModalFooter = ({
|
|
|
6316
6470
|
classNames,
|
|
6317
6471
|
hideBorder = false
|
|
6318
6472
|
}) => {
|
|
6319
|
-
return /* @__PURE__ */ (0,
|
|
6473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
6320
6474
|
"div",
|
|
6321
6475
|
{
|
|
6322
6476
|
className: cn(
|
|
@@ -6337,7 +6491,7 @@ Modal.Footer = ModalFooter;
|
|
|
6337
6491
|
Modal.displayName = "Modal";
|
|
6338
6492
|
|
|
6339
6493
|
// src/primitives/select/index.tsx
|
|
6340
|
-
var
|
|
6494
|
+
var import_hooks29 = require("@agg-build/hooks");
|
|
6341
6495
|
var import_react5 = require("react");
|
|
6342
6496
|
var import_react_dom = require("react-dom");
|
|
6343
6497
|
|
|
@@ -6359,7 +6513,7 @@ var resolveIsSelectDisabled = ({
|
|
|
6359
6513
|
};
|
|
6360
6514
|
|
|
6361
6515
|
// src/primitives/select/index.tsx
|
|
6362
|
-
var
|
|
6516
|
+
var import_jsx_runtime119 = require("react/jsx-runtime");
|
|
6363
6517
|
var SELECT_DROPDOWN_Z = 1e4;
|
|
6364
6518
|
function resolveSelectPortalContainer(triggerRoot) {
|
|
6365
6519
|
var _a, _b;
|
|
@@ -6382,11 +6536,11 @@ var Select = ({
|
|
|
6382
6536
|
contentSideOffset = 8
|
|
6383
6537
|
}) => {
|
|
6384
6538
|
var _a;
|
|
6385
|
-
const labels = (0,
|
|
6539
|
+
const labels = (0, import_hooks29.useLabels)();
|
|
6386
6540
|
const {
|
|
6387
6541
|
general: { rootClassName },
|
|
6388
6542
|
features: { enableAnimations }
|
|
6389
|
-
} = (0,
|
|
6543
|
+
} = (0, import_hooks29.useSdkUiConfig)();
|
|
6390
6544
|
const isDisabled = resolveIsSelectDisabled({ disabled, items });
|
|
6391
6545
|
const selectedItem = resolveSelectedItem(items, value);
|
|
6392
6546
|
const [isOpen, setIsOpen] = (0, import_react5.useState)(false);
|
|
@@ -6478,7 +6632,7 @@ var Select = ({
|
|
|
6478
6632
|
};
|
|
6479
6633
|
const isInline = variant === "inline";
|
|
6480
6634
|
const triggerRadiusClass = triggerClassName != null ? triggerClassName : isInline ? "rounded-agg-sm" : "rounded-agg-md";
|
|
6481
|
-
const listbox = menuRect ? /* @__PURE__ */ (0,
|
|
6635
|
+
const listbox = menuRect ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
6482
6636
|
"div",
|
|
6483
6637
|
{
|
|
6484
6638
|
ref: portalRef,
|
|
@@ -6506,7 +6660,7 @@ var Select = ({
|
|
|
6506
6660
|
const isSelected = item.value === value;
|
|
6507
6661
|
const isHidden = item.hidden === true;
|
|
6508
6662
|
if (isHidden) return null;
|
|
6509
|
-
return /* @__PURE__ */ (0,
|
|
6663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
|
|
6510
6664
|
"button",
|
|
6511
6665
|
{
|
|
6512
6666
|
type: "button",
|
|
@@ -6530,14 +6684,14 @@ var Select = ({
|
|
|
6530
6684
|
handleClose();
|
|
6531
6685
|
},
|
|
6532
6686
|
children: [
|
|
6533
|
-
isInline && isSelected ? /* @__PURE__ */ (0,
|
|
6687
|
+
isInline && isSelected ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
6534
6688
|
"span",
|
|
6535
6689
|
{
|
|
6536
6690
|
className: "agg-select-item-indicator absolute bottom-2 left-0 top-2 w-1 bg-agg-primary",
|
|
6537
6691
|
"aria-hidden": true
|
|
6538
6692
|
}
|
|
6539
6693
|
) : null,
|
|
6540
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
6694
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
6541
6695
|
"span",
|
|
6542
6696
|
{
|
|
6543
6697
|
className: cn(
|
|
@@ -6546,7 +6700,7 @@ var Select = ({
|
|
|
6546
6700
|
),
|
|
6547
6701
|
children: item.icon
|
|
6548
6702
|
}
|
|
6549
|
-
) : item.iconUrl ? /* @__PURE__ */ (0,
|
|
6703
|
+
) : item.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
6550
6704
|
RemoteImage,
|
|
6551
6705
|
{
|
|
6552
6706
|
src: item.iconUrl,
|
|
@@ -6554,7 +6708,7 @@ var Select = ({
|
|
|
6554
6708
|
className: "agg-select-item-icon h-4 w-4 shrink-0 rounded-sm object-contain"
|
|
6555
6709
|
}
|
|
6556
6710
|
) : null,
|
|
6557
|
-
/* @__PURE__ */ (0,
|
|
6711
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { className: "agg-select-item-label truncate", children: item.label })
|
|
6558
6712
|
]
|
|
6559
6713
|
},
|
|
6560
6714
|
item.value
|
|
@@ -6562,7 +6716,7 @@ var Select = ({
|
|
|
6562
6716
|
})
|
|
6563
6717
|
}
|
|
6564
6718
|
) : null;
|
|
6565
|
-
return /* @__PURE__ */ (0,
|
|
6719
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
|
|
6566
6720
|
"div",
|
|
6567
6721
|
{
|
|
6568
6722
|
ref: containerRef,
|
|
@@ -6572,7 +6726,7 @@ var Select = ({
|
|
|
6572
6726
|
className
|
|
6573
6727
|
),
|
|
6574
6728
|
children: [
|
|
6575
|
-
/* @__PURE__ */ (0,
|
|
6729
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
|
|
6576
6730
|
"button",
|
|
6577
6731
|
{
|
|
6578
6732
|
type: "button",
|
|
@@ -6596,7 +6750,7 @@ var Select = ({
|
|
|
6596
6750
|
onPointerEnter: handlePointerEnter,
|
|
6597
6751
|
onPointerLeave: handlePointerLeave,
|
|
6598
6752
|
children: [
|
|
6599
|
-
(selectedItem == null ? void 0 : selectedItem.icon) ? /* @__PURE__ */ (0,
|
|
6753
|
+
(selectedItem == null ? void 0 : selectedItem.icon) ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { className: "h-4 w-4 shrink-0 [&_svg]:h-full [&_svg]:w-full", children: selectedItem.icon }) : (selectedItem == null ? void 0 : selectedItem.iconUrl) ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
6600
6754
|
RemoteImage,
|
|
6601
6755
|
{
|
|
6602
6756
|
src: selectedItem.iconUrl,
|
|
@@ -6604,18 +6758,18 @@ var Select = ({
|
|
|
6604
6758
|
className: "agg-select-icon h-4 w-4 shrink-0 rounded-sm object-contain"
|
|
6605
6759
|
}
|
|
6606
6760
|
) : null,
|
|
6607
|
-
/* @__PURE__ */ (0,
|
|
6761
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { className: "agg-select-value flex-1 truncate", children: (_a = selectedItem == null ? void 0 : selectedItem.label) != null ? _a : "" })
|
|
6608
6762
|
]
|
|
6609
6763
|
}
|
|
6610
6764
|
),
|
|
6611
|
-
/* @__PURE__ */ (0,
|
|
6765
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
6612
6766
|
"span",
|
|
6613
6767
|
{
|
|
6614
6768
|
className: cn(
|
|
6615
6769
|
"agg-select-chevron pointer-events-none absolute inset-y-0 inline-flex items-center justify-center",
|
|
6616
6770
|
isInline ? "right-2 text-agg-foreground" : "right-3 text-agg-muted-foreground"
|
|
6617
6771
|
),
|
|
6618
|
-
children: /* @__PURE__ */ (0,
|
|
6772
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
6619
6773
|
Icon,
|
|
6620
6774
|
{
|
|
6621
6775
|
name: isOpen ? "chevron-up" : "chevron-down-thin",
|
|
@@ -6634,7 +6788,7 @@ Select.displayName = "Select";
|
|
|
6634
6788
|
|
|
6635
6789
|
// src/primitives/state-message/index.tsx
|
|
6636
6790
|
var import_react6 = require("react");
|
|
6637
|
-
var
|
|
6791
|
+
var import_hooks30 = require("@agg-build/hooks");
|
|
6638
6792
|
|
|
6639
6793
|
// src/primitives/typography/typography.constants.ts
|
|
6640
6794
|
var display = cn("agg-type-display");
|
|
@@ -6699,7 +6853,7 @@ var getTypographyClassName = ({
|
|
|
6699
6853
|
};
|
|
6700
6854
|
|
|
6701
6855
|
// src/primitives/typography/index.tsx
|
|
6702
|
-
var
|
|
6856
|
+
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
6703
6857
|
var Typography = ({
|
|
6704
6858
|
as: Component = "p",
|
|
6705
6859
|
variant = "body",
|
|
@@ -6707,7 +6861,7 @@ var Typography = ({
|
|
|
6707
6861
|
children,
|
|
6708
6862
|
"aria-label": ariaLabel
|
|
6709
6863
|
}) => {
|
|
6710
|
-
return /* @__PURE__ */ (0,
|
|
6864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Component, { className: getTypographyClassName({ className, variant }), "aria-label": ariaLabel, children });
|
|
6711
6865
|
};
|
|
6712
6866
|
Typography.displayName = "Typography";
|
|
6713
6867
|
|
|
@@ -6720,7 +6874,7 @@ var resolveStateMessageHasAction = ({ onAction }) => {
|
|
|
6720
6874
|
};
|
|
6721
6875
|
|
|
6722
6876
|
// src/primitives/state-message/index.tsx
|
|
6723
|
-
var
|
|
6877
|
+
var import_jsx_runtime121 = require("react/jsx-runtime");
|
|
6724
6878
|
var StateMessage = (_a) => {
|
|
6725
6879
|
var _b = _a, {
|
|
6726
6880
|
icon,
|
|
@@ -6735,13 +6889,13 @@ var StateMessage = (_a) => {
|
|
|
6735
6889
|
"onAction",
|
|
6736
6890
|
"classNames"
|
|
6737
6891
|
]);
|
|
6738
|
-
const labels = (0,
|
|
6892
|
+
const labels = (0, import_hooks30.useLabels)();
|
|
6739
6893
|
const hasAction = resolveStateMessageHasAction({ onAction });
|
|
6740
6894
|
const resolvedIcon = (0, import_react6.cloneElement)(icon, {
|
|
6741
6895
|
className: cn(STATE_MESSAGE_ICON_CLASS_NAME, icon.props.className, classNames == null ? void 0 : classNames.icon),
|
|
6742
6896
|
"aria-hidden": true
|
|
6743
6897
|
});
|
|
6744
|
-
return /* @__PURE__ */ (0,
|
|
6898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
6745
6899
|
"div",
|
|
6746
6900
|
__spreadProps(__spreadValues({}, rest), {
|
|
6747
6901
|
className: cn(
|
|
@@ -6752,7 +6906,7 @@ var StateMessage = (_a) => {
|
|
|
6752
6906
|
role: "status",
|
|
6753
6907
|
"aria-live": "polite",
|
|
6754
6908
|
"aria-label": title2,
|
|
6755
|
-
children: /* @__PURE__ */ (0,
|
|
6909
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(
|
|
6756
6910
|
"div",
|
|
6757
6911
|
{
|
|
6758
6912
|
className: cn(
|
|
@@ -6761,7 +6915,7 @@ var StateMessage = (_a) => {
|
|
|
6761
6915
|
),
|
|
6762
6916
|
children: [
|
|
6763
6917
|
resolvedIcon,
|
|
6764
|
-
/* @__PURE__ */ (0,
|
|
6918
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(
|
|
6765
6919
|
"div",
|
|
6766
6920
|
{
|
|
6767
6921
|
className: cn(
|
|
@@ -6769,8 +6923,8 @@ var StateMessage = (_a) => {
|
|
|
6769
6923
|
classNames == null ? void 0 : classNames.text
|
|
6770
6924
|
),
|
|
6771
6925
|
children: [
|
|
6772
|
-
/* @__PURE__ */ (0,
|
|
6773
|
-
description ? /* @__PURE__ */ (0,
|
|
6926
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Typography, { variant: "body-strong", className: classNames == null ? void 0 : classNames.title, children: title2 }),
|
|
6927
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
6774
6928
|
Typography,
|
|
6775
6929
|
{
|
|
6776
6930
|
variant: "label",
|
|
@@ -6781,7 +6935,7 @@ var StateMessage = (_a) => {
|
|
|
6781
6935
|
]
|
|
6782
6936
|
}
|
|
6783
6937
|
),
|
|
6784
|
-
hasAction ? /* @__PURE__ */ (0,
|
|
6938
|
+
hasAction ? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
6785
6939
|
Button,
|
|
6786
6940
|
{
|
|
6787
6941
|
variant: "tertiary",
|
|
@@ -6808,7 +6962,7 @@ var StateMessage = (_a) => {
|
|
|
6808
6962
|
StateMessage.displayName = "StateMessage";
|
|
6809
6963
|
|
|
6810
6964
|
// src/primitives/tabs/index.tsx
|
|
6811
|
-
var
|
|
6965
|
+
var import_hooks31 = require("@agg-build/hooks");
|
|
6812
6966
|
var import_react8 = require("react");
|
|
6813
6967
|
|
|
6814
6968
|
// src/shared/use-horizontal-scroll-state.ts
|
|
@@ -6883,7 +7037,7 @@ var findEdgeEnabledIndex = (items, direction) => {
|
|
|
6883
7037
|
};
|
|
6884
7038
|
|
|
6885
7039
|
// src/primitives/tabs/index.tsx
|
|
6886
|
-
var
|
|
7040
|
+
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
6887
7041
|
var getTabButtonClassName = ({
|
|
6888
7042
|
enableAnimations,
|
|
6889
7043
|
isBarVariant,
|
|
@@ -6926,10 +7080,10 @@ var Tabs = ({
|
|
|
6926
7080
|
className,
|
|
6927
7081
|
classNames
|
|
6928
7082
|
}) => {
|
|
6929
|
-
const labels = (0,
|
|
7083
|
+
const labels = (0, import_hooks31.useLabels)();
|
|
6930
7084
|
const {
|
|
6931
7085
|
features: { enableAnimations }
|
|
6932
|
-
} = (0,
|
|
7086
|
+
} = (0, import_hooks31.useSdkUiConfig)();
|
|
6933
7087
|
const buttonRefs = (0, import_react8.useRef)([]);
|
|
6934
7088
|
const dragStateRef = (0, import_react8.useRef)({
|
|
6935
7089
|
isPointerDown: false,
|
|
@@ -7143,7 +7297,7 @@ var Tabs = ({
|
|
|
7143
7297
|
width: activeButton.offsetWidth,
|
|
7144
7298
|
opacity: 1
|
|
7145
7299
|
});
|
|
7146
|
-
}, [isBarVariant, renderedItems, value]);
|
|
7300
|
+
}, [isBarVariant, renderedItems, tabListRef, value]);
|
|
7147
7301
|
(0, import_react8.useLayoutEffect)(() => {
|
|
7148
7302
|
updateActiveUnderline();
|
|
7149
7303
|
}, [updateActiveUnderline]);
|
|
@@ -7202,9 +7356,16 @@ var Tabs = ({
|
|
|
7202
7356
|
requestAnimationFrame(() => {
|
|
7203
7357
|
updateScrollState();
|
|
7204
7358
|
});
|
|
7205
|
-
}, [
|
|
7359
|
+
}, [
|
|
7360
|
+
enableAnimations,
|
|
7361
|
+
renderedItems,
|
|
7362
|
+
shouldUseOverflowScroll,
|
|
7363
|
+
tabListRef,
|
|
7364
|
+
updateScrollState,
|
|
7365
|
+
value
|
|
7366
|
+
]);
|
|
7206
7367
|
if (shouldUseOverflowSelect) {
|
|
7207
|
-
return /* @__PURE__ */ (0,
|
|
7368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { className: cn("group/agg-tabs w-full", className, classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
7208
7369
|
Select,
|
|
7209
7370
|
{
|
|
7210
7371
|
ariaLabel,
|
|
@@ -7216,7 +7377,7 @@ var Tabs = ({
|
|
|
7216
7377
|
}
|
|
7217
7378
|
) });
|
|
7218
7379
|
}
|
|
7219
|
-
return /* @__PURE__ */ (0,
|
|
7380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
|
|
7220
7381
|
"div",
|
|
7221
7382
|
{
|
|
7222
7383
|
className: cn(
|
|
@@ -7227,7 +7388,7 @@ var Tabs = ({
|
|
|
7227
7388
|
classNames == null ? void 0 : classNames.root
|
|
7228
7389
|
),
|
|
7229
7390
|
children: [
|
|
7230
|
-
/* @__PURE__ */ (0,
|
|
7391
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
|
|
7231
7392
|
"div",
|
|
7232
7393
|
{
|
|
7233
7394
|
ref: tabListRef,
|
|
@@ -7241,7 +7402,7 @@ var Tabs = ({
|
|
|
7241
7402
|
onPointerUp: handleEndTabListDrag,
|
|
7242
7403
|
onWheel: handleTabListWheel,
|
|
7243
7404
|
children: [
|
|
7244
|
-
shouldUseOverflowScroll && !isBarVariant && hasOverflow ? /* @__PURE__ */ (0,
|
|
7405
|
+
shouldUseOverflowScroll && !isBarVariant && hasOverflow ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
7245
7406
|
"span",
|
|
7246
7407
|
{
|
|
7247
7408
|
"aria-hidden": true,
|
|
@@ -7252,7 +7413,7 @@ var Tabs = ({
|
|
|
7252
7413
|
var _a;
|
|
7253
7414
|
const isActive = item.value === value;
|
|
7254
7415
|
const isComingSoon = (_a = item == null ? void 0 : item.isComingSoon) != null ? _a : false;
|
|
7255
|
-
return /* @__PURE__ */ (0,
|
|
7416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
|
|
7256
7417
|
"button",
|
|
7257
7418
|
{
|
|
7258
7419
|
ref: (buttonElement) => {
|
|
@@ -7288,7 +7449,7 @@ var Tabs = ({
|
|
|
7288
7449
|
),
|
|
7289
7450
|
children: [
|
|
7290
7451
|
item.icon ? item.icon : null,
|
|
7291
|
-
/* @__PURE__ */ (0,
|
|
7452
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
|
|
7292
7453
|
"span",
|
|
7293
7454
|
{
|
|
7294
7455
|
className: cn(
|
|
@@ -7306,7 +7467,7 @@ var Tabs = ({
|
|
|
7306
7467
|
item.value
|
|
7307
7468
|
);
|
|
7308
7469
|
}),
|
|
7309
|
-
!isBarVariant ? /* @__PURE__ */ (0,
|
|
7470
|
+
!isBarVariant ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
7310
7471
|
"span",
|
|
7311
7472
|
{
|
|
7312
7473
|
"aria-hidden": true,
|
|
@@ -7325,8 +7486,8 @@ var Tabs = ({
|
|
|
7325
7486
|
]
|
|
7326
7487
|
}
|
|
7327
7488
|
),
|
|
7328
|
-
shouldUseOverflowScroll && !isBarVariant ? /* @__PURE__ */ (0,
|
|
7329
|
-
/* @__PURE__ */ (0,
|
|
7489
|
+
shouldUseOverflowScroll && !isBarVariant ? /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
|
|
7490
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
7330
7491
|
"span",
|
|
7331
7492
|
{
|
|
7332
7493
|
"aria-hidden": true,
|
|
@@ -7338,7 +7499,7 @@ var Tabs = ({
|
|
|
7338
7499
|
)
|
|
7339
7500
|
}
|
|
7340
7501
|
),
|
|
7341
|
-
/* @__PURE__ */ (0,
|
|
7502
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
7342
7503
|
"span",
|
|
7343
7504
|
{
|
|
7344
7505
|
"aria-hidden": true,
|
|
@@ -7351,8 +7512,8 @@ var Tabs = ({
|
|
|
7351
7512
|
}
|
|
7352
7513
|
)
|
|
7353
7514
|
] }) : null,
|
|
7354
|
-
shouldUseOverflowScroll && isBarVariant ? /* @__PURE__ */ (0,
|
|
7355
|
-
/* @__PURE__ */ (0,
|
|
7515
|
+
shouldUseOverflowScroll && isBarVariant ? /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
|
|
7516
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
7356
7517
|
"button",
|
|
7357
7518
|
{
|
|
7358
7519
|
type: "button",
|
|
@@ -7374,10 +7535,10 @@ var Tabs = ({
|
|
|
7374
7535
|
behavior: getScrollBehavior(enableAnimations)
|
|
7375
7536
|
});
|
|
7376
7537
|
},
|
|
7377
|
-
children: /* @__PURE__ */ (0,
|
|
7538
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Icon, { name: "chevron-left", size: "small", color: "currentColor" })
|
|
7378
7539
|
}
|
|
7379
7540
|
),
|
|
7380
|
-
/* @__PURE__ */ (0,
|
|
7541
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
7381
7542
|
"button",
|
|
7382
7543
|
{
|
|
7383
7544
|
type: "button",
|
|
@@ -7399,7 +7560,7 @@ var Tabs = ({
|
|
|
7399
7560
|
behavior: getScrollBehavior(enableAnimations)
|
|
7400
7561
|
});
|
|
7401
7562
|
},
|
|
7402
|
-
children: /* @__PURE__ */ (0,
|
|
7563
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Icon, { name: "chevron-right", size: "small", color: "currentColor" })
|
|
7403
7564
|
}
|
|
7404
7565
|
)
|
|
7405
7566
|
] }) : null
|
|
@@ -7410,7 +7571,7 @@ var Tabs = ({
|
|
|
7410
7571
|
Tabs.displayName = "Tabs";
|
|
7411
7572
|
|
|
7412
7573
|
// src/primitives/tooltip/index.tsx
|
|
7413
|
-
var
|
|
7574
|
+
var import_hooks32 = require("@agg-build/hooks");
|
|
7414
7575
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
7415
7576
|
var import_react9 = require("react");
|
|
7416
7577
|
|
|
@@ -7444,7 +7605,7 @@ var resolveTooltipArrowDimensions = (size) => {
|
|
|
7444
7605
|
};
|
|
7445
7606
|
|
|
7446
7607
|
// src/primitives/tooltip/index.tsx
|
|
7447
|
-
var
|
|
7608
|
+
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
7448
7609
|
var Tooltip = ({
|
|
7449
7610
|
content,
|
|
7450
7611
|
children,
|
|
@@ -7459,25 +7620,25 @@ var Tooltip = ({
|
|
|
7459
7620
|
const {
|
|
7460
7621
|
general: { rootClassName },
|
|
7461
7622
|
features: { enableAnimations }
|
|
7462
|
-
} = (0,
|
|
7623
|
+
} = (0, import_hooks32.useSdkUiConfig)();
|
|
7463
7624
|
const trigger = (0, import_react9.useMemo)(() => {
|
|
7464
7625
|
if (children) return children;
|
|
7465
|
-
return /* @__PURE__ */ (0,
|
|
7626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
7466
7627
|
"button",
|
|
7467
7628
|
{
|
|
7468
7629
|
type: "button",
|
|
7469
7630
|
className: resolveTooltipTriggerClassName(classNames == null ? void 0 : classNames.trigger),
|
|
7470
7631
|
"aria-label": ariaLabel != null ? ariaLabel : defaultTooltipTriggerAriaLabel,
|
|
7471
|
-
children: /* @__PURE__ */ (0,
|
|
7632
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Icon, { name: "info", size: "small", className: cn(classNames == null ? void 0 : classNames.icon), "aria-hidden": true })
|
|
7472
7633
|
}
|
|
7473
7634
|
);
|
|
7474
7635
|
}, [children, classNames == null ? void 0 : classNames.trigger, classNames == null ? void 0 : classNames.icon, ariaLabel]);
|
|
7475
7636
|
const { width: arrowWidth, height: arrowHeight } = resolveTooltipArrowDimensions(size);
|
|
7476
7637
|
const arrowPoints = `0,0 ${arrowWidth},0 ${arrowWidth / 2},${arrowHeight}`;
|
|
7477
7638
|
const arrowBorderPath = `M0 0 L${arrowWidth / 2} ${arrowHeight} L${arrowWidth} 0`;
|
|
7478
|
-
return /* @__PURE__ */ (0,
|
|
7479
|
-
/* @__PURE__ */ (0,
|
|
7480
|
-
/* @__PURE__ */ (0,
|
|
7639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(TooltipPrimitive.Provider, { delayDuration, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(TooltipPrimitive.Root, { children: [
|
|
7640
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(TooltipPrimitive.Trigger, { asChild: true, children: trigger }),
|
|
7641
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(
|
|
7481
7642
|
TooltipPrimitive.Content,
|
|
7482
7643
|
{
|
|
7483
7644
|
side,
|
|
@@ -7501,7 +7662,7 @@ var Tooltip = ({
|
|
|
7501
7662
|
classNames == null ? void 0 : classNames.content
|
|
7502
7663
|
),
|
|
7503
7664
|
children: [
|
|
7504
|
-
/* @__PURE__ */ (0,
|
|
7665
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(TooltipPrimitive.Arrow, { asChild: true, width: arrowWidth, height: arrowHeight, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(
|
|
7505
7666
|
"svg",
|
|
7506
7667
|
{
|
|
7507
7668
|
width: arrowWidth,
|
|
@@ -7510,8 +7671,8 @@ var Tooltip = ({
|
|
|
7510
7671
|
"aria-hidden": "true",
|
|
7511
7672
|
className: cn("overflow-visible", classNames == null ? void 0 : classNames.arrow),
|
|
7512
7673
|
children: [
|
|
7513
|
-
/* @__PURE__ */ (0,
|
|
7514
|
-
/* @__PURE__ */ (0,
|
|
7674
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("polygon", { points: arrowPoints, className: "fill-agg-secondary" }),
|
|
7675
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
7515
7676
|
"path",
|
|
7516
7677
|
{
|
|
7517
7678
|
d: arrowBorderPath,
|
|
@@ -7689,13 +7850,13 @@ var normalizeEventListItemV2Comparison = ({
|
|
|
7689
7850
|
var baseCardClassName = "gap-3 overflow-hidden p-4 w-full";
|
|
7690
7851
|
|
|
7691
7852
|
// src/events/item/index.tsx
|
|
7692
|
-
var
|
|
7853
|
+
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
7693
7854
|
var EventListItemLoadingState = ({
|
|
7694
7855
|
classNames,
|
|
7695
7856
|
ariaLabel
|
|
7696
7857
|
}) => {
|
|
7697
|
-
const labels = (0,
|
|
7698
|
-
return /* @__PURE__ */ (0,
|
|
7858
|
+
const labels = (0, import_hooks33.useLabels)();
|
|
7859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
7699
7860
|
Skeleton,
|
|
7700
7861
|
{
|
|
7701
7862
|
view: "event-list-item",
|
|
@@ -7708,8 +7869,8 @@ var EventListItemUnavailableState = ({
|
|
|
7708
7869
|
classNames,
|
|
7709
7870
|
ariaLabel
|
|
7710
7871
|
}) => {
|
|
7711
|
-
const labels = (0,
|
|
7712
|
-
return /* @__PURE__ */ (0,
|
|
7872
|
+
const labels = (0, import_hooks33.useLabels)();
|
|
7873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
7713
7874
|
Card,
|
|
7714
7875
|
{
|
|
7715
7876
|
className: cn(
|
|
@@ -7719,8 +7880,8 @@ var EventListItemUnavailableState = ({
|
|
|
7719
7880
|
),
|
|
7720
7881
|
role: "status",
|
|
7721
7882
|
"aria-label": ariaLabel != null ? ariaLabel : labels.eventItem.unavailableAria,
|
|
7722
|
-
children: /* @__PURE__ */ (0,
|
|
7723
|
-
/* @__PURE__ */ (0,
|
|
7883
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: cn("agg-event-card-header min-h-12 flex flex-col gap-1", classNames == null ? void 0 : classNames.header), children: [
|
|
7884
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
7724
7885
|
Typography,
|
|
7725
7886
|
{
|
|
7726
7887
|
variant: "body-large-strong",
|
|
@@ -7728,7 +7889,7 @@ var EventListItemUnavailableState = ({
|
|
|
7728
7889
|
children: labels.eventItem.unavailableTitle
|
|
7729
7890
|
}
|
|
7730
7891
|
),
|
|
7731
|
-
/* @__PURE__ */ (0,
|
|
7892
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Typography, { variant: "body", className: "text-agg-muted-foreground", children: labels.eventItem.unavailableDescription })
|
|
7732
7893
|
] })
|
|
7733
7894
|
}
|
|
7734
7895
|
);
|
|
@@ -7737,13 +7898,13 @@ var EventListItemNotFoundState = ({
|
|
|
7737
7898
|
classNames: _classNames,
|
|
7738
7899
|
ariaLabel: _ariaLabel
|
|
7739
7900
|
}) => {
|
|
7740
|
-
const labels = (0,
|
|
7741
|
-
return /* @__PURE__ */ (0,
|
|
7901
|
+
const labels = (0, import_hooks33.useLabels)();
|
|
7902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
7742
7903
|
StateMessage,
|
|
7743
7904
|
{
|
|
7744
7905
|
title: labels.eventItemDetails.notFoundTitle,
|
|
7745
7906
|
description: labels.eventItemDetails.notFoundDescription,
|
|
7746
|
-
icon: /* @__PURE__ */ (0,
|
|
7907
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(SearchEmptyIcon, {}),
|
|
7747
7908
|
classNames: { root: "agg-event-card-state min-h-[280px] md:min-h-[320px]" }
|
|
7748
7909
|
}
|
|
7749
7910
|
);
|
|
@@ -7892,23 +8053,26 @@ var EventListItemContent = ({
|
|
|
7892
8053
|
marketStatus
|
|
7893
8054
|
}) => {
|
|
7894
8055
|
var _a;
|
|
7895
|
-
const config = (0,
|
|
7896
|
-
const labels = (0,
|
|
8056
|
+
const config = (0, import_hooks33.useSdkUiConfig)();
|
|
8057
|
+
const labels = (0, import_hooks33.useLabels)();
|
|
7897
8058
|
const allVenueMarkets = (0, import_react10.useMemo)(() => event.venueMarkets, [event.venueMarkets]);
|
|
8059
|
+
const recurringCryptoIdentity = (0, import_hooks33.resolveRecurringCryptoIdentity)(event);
|
|
7898
8060
|
const eventHeading = resolveEventHeading({
|
|
7899
8061
|
title: event.title,
|
|
7900
8062
|
categories: event.categories,
|
|
7901
8063
|
structureType: event.structureType,
|
|
7902
8064
|
gameStartTime: event.gameStartTime,
|
|
7903
8065
|
endDate: event.endDate,
|
|
7904
|
-
venueMarkets: event.venueMarkets
|
|
8066
|
+
venueMarkets: event.venueMarkets,
|
|
8067
|
+
recurringCryptoWindowStart: recurringCryptoIdentity == null ? void 0 : recurringCryptoIdentity.windowStart,
|
|
8068
|
+
recurringCryptoDuration: recurringCryptoIdentity == null ? void 0 : recurringCryptoIdentity.duration
|
|
7905
8069
|
});
|
|
7906
8070
|
const resolvedTitle = eventHeading.title;
|
|
7907
8071
|
const resolvedTimestamp = eventHeading.timestampLabel;
|
|
7908
8072
|
const resolvedImage = event.image;
|
|
7909
8073
|
const visibleVenueLogos = (0, import_react10.useMemo)(() => {
|
|
7910
8074
|
var _a2;
|
|
7911
|
-
return (0,
|
|
8075
|
+
return (0, import_hooks33.sortVenues)(Array.from(new Set(((_a2 = event.venues) != null ? _a2 : []).map((venue) => venue))));
|
|
7912
8076
|
}, [event.venues]);
|
|
7913
8077
|
const resolvedMarketCount = typeof event.marketCount === "number" && Number.isFinite(event.marketCount) ? Math.max(0, Math.floor(event.marketCount)) : allVenueMarkets.length;
|
|
7914
8078
|
const resolvedVenueCount = typeof event.venueCount === "number" && Number.isFinite(event.venueCount) ? Math.max(0, Math.floor(event.venueCount)) : visibleVenueLogos.length;
|
|
@@ -7927,7 +8091,7 @@ var EventListItemContent = ({
|
|
|
7927
8091
|
hasNextPage: hasNextLazyMarketsPage,
|
|
7928
8092
|
isLoading: isLoadingLazyMarkets,
|
|
7929
8093
|
isFetchingNextPage: isFetchingNextLazyMarketsPage
|
|
7930
|
-
} = (0,
|
|
8094
|
+
} = (0, import_hooks33.useVenueMarkets)({
|
|
7931
8095
|
venueEventId: event.id,
|
|
7932
8096
|
enabled: shouldEnableLazyMarketLoading && isLazyMarketsQueryEnabled,
|
|
7933
8097
|
// List/tile surface: axis/dates sort by volume so the scroll tail matches
|
|
@@ -7953,13 +8117,19 @@ var EventListItemContent = ({
|
|
|
7953
8117
|
}
|
|
7954
8118
|
return [...new Set(ids)];
|
|
7955
8119
|
}, [resolvedOutcomeMarkets]);
|
|
7956
|
-
const { midpointRows: fetchedMidpointRows, isLoading: isVenueMarketMidpointsLoading } = (0,
|
|
8120
|
+
const { midpointRows: fetchedMidpointRows, isLoading: isVenueMarketMidpointsLoading } = (0, import_hooks33.useVenueMarketMidpoints)({
|
|
7957
8121
|
venueMarketIds: shouldUseSharedMidpoints ? [] : midpointVenueMarketIds,
|
|
7958
8122
|
enabled: !shouldUseSharedMidpoints && midpointVenueMarketIds.length > 0
|
|
7959
8123
|
});
|
|
7960
|
-
const { prices: displayMidpointsByOutcomeId, isLoading: isOutcomeMidpointsLoading } = (0,
|
|
7961
|
-
const resolvedMidpointRows =
|
|
7962
|
-
|
|
8124
|
+
const { prices: displayMidpointsByOutcomeId, isLoading: isOutcomeMidpointsLoading } = (0, import_hooks33.useMidpoints)(shouldUseSharedMidpoints ? [] : resolvedOutcomeMarkets);
|
|
8125
|
+
const resolvedMidpointRows = (0, import_react10.useMemo)(
|
|
8126
|
+
() => shouldUseSharedMidpoints ? sharedMidpointRows != null ? sharedMidpointRows : [] : fetchedMidpointRows,
|
|
8127
|
+
[fetchedMidpointRows, sharedMidpointRows, shouldUseSharedMidpoints]
|
|
8128
|
+
);
|
|
8129
|
+
const resolvedDisplayMidpointsByOutcomeId = (0, import_react10.useMemo)(
|
|
8130
|
+
() => shouldUseSharedMidpoints ? midpointPrices != null ? midpointPrices : /* @__PURE__ */ new Map() : displayMidpointsByOutcomeId,
|
|
8131
|
+
[displayMidpointsByOutcomeId, midpointPrices, shouldUseSharedMidpoints]
|
|
8132
|
+
);
|
|
7963
8133
|
const isAwaitingMidpoints = midpointsLoading != null ? midpointsLoading : isOutcomeMidpointsLoading || midpointVenueMarketIds.length > 0 && isVenueMarketMidpointsLoading;
|
|
7964
8134
|
const displayPriceByOutcomeId = (0, import_react10.useMemo)(() => {
|
|
7965
8135
|
const priceByOutcomeId = new Map(resolvedDisplayMidpointsByOutcomeId);
|
|
@@ -8076,9 +8246,9 @@ var EventListItemContent = ({
|
|
|
8076
8246
|
const renderArbitrage = (value) => {
|
|
8077
8247
|
if (value == null) return null;
|
|
8078
8248
|
if (Math.abs(value) < config.market.arbitrageThreshold) return null;
|
|
8079
|
-
return /* @__PURE__ */ (0,
|
|
8080
|
-
/* @__PURE__ */ (0,
|
|
8081
|
-
/* @__PURE__ */ (0,
|
|
8249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: cn("flex items-center gap-1", "text-agg-success"), children: [
|
|
8250
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Typography, { variant: "label-strong", className: "text-agg-success", children: config.formatting.formatPercent(value) }),
|
|
8251
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8082
8252
|
Icon,
|
|
8083
8253
|
{
|
|
8084
8254
|
name: "triangle-up",
|
|
@@ -8092,8 +8262,8 @@ var EventListItemContent = ({
|
|
|
8092
8262
|
const renderPriceStripSkeleton = (count) => {
|
|
8093
8263
|
const safeCount = Math.max(1, Math.min(count || 1, 3));
|
|
8094
8264
|
const collapsedCount = safeCount - 1;
|
|
8095
|
-
return /* @__PURE__ */ (0,
|
|
8096
|
-
Array.from({ length: collapsedCount }).map((_, index) => /* @__PURE__ */ (0,
|
|
8265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(import_jsx_runtime124.Fragment, { children: [
|
|
8266
|
+
Array.from({ length: collapsedCount }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8097
8267
|
"span",
|
|
8098
8268
|
{
|
|
8099
8269
|
"aria-hidden": "true",
|
|
@@ -8105,7 +8275,7 @@ var EventListItemContent = ({
|
|
|
8105
8275
|
},
|
|
8106
8276
|
`agg-outcome-price-loading-collapsed-${index}`
|
|
8107
8277
|
)),
|
|
8108
|
-
/* @__PURE__ */ (0,
|
|
8278
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8109
8279
|
"span",
|
|
8110
8280
|
{
|
|
8111
8281
|
"aria-hidden": "true",
|
|
@@ -8122,7 +8292,7 @@ var EventListItemContent = ({
|
|
|
8122
8292
|
if (isAwaitingMidpoints) return null;
|
|
8123
8293
|
const formattedPriceGap = formatPriceGapPercent(value, source);
|
|
8124
8294
|
if (!formattedPriceGap) return null;
|
|
8125
|
-
return /* @__PURE__ */ (0,
|
|
8295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
|
|
8126
8296
|
"span",
|
|
8127
8297
|
{
|
|
8128
8298
|
className: cn(
|
|
@@ -8135,14 +8305,14 @@ var EventListItemContent = ({
|
|
|
8135
8305
|
title: labels.eventItem.priceGap,
|
|
8136
8306
|
"aria-label": `${formattedPriceGap} ${labels.eventItem.priceGap}`,
|
|
8137
8307
|
children: [
|
|
8138
|
-
/* @__PURE__ */ (0,
|
|
8308
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8139
8309
|
"i",
|
|
8140
8310
|
{
|
|
8141
8311
|
"aria-hidden": "true",
|
|
8142
8312
|
className: "fi-rr-arrow-down inline-flex size-3! shrink-0 items-center justify-center text-agg-xs text-agg-success"
|
|
8143
8313
|
}
|
|
8144
8314
|
),
|
|
8145
|
-
/* @__PURE__ */ (0,
|
|
8315
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { children: formattedPriceGap })
|
|
8146
8316
|
]
|
|
8147
8317
|
}
|
|
8148
8318
|
);
|
|
@@ -8154,11 +8324,11 @@ var EventListItemContent = ({
|
|
|
8154
8324
|
const hasVenueCompetition = row.prices.length > 1;
|
|
8155
8325
|
const isHighlightedBestPrice = hasVenueCompetition && price.isBest;
|
|
8156
8326
|
const shouldCollapsePriceText = hasVenueCompetition && !isHighlightedBestPrice;
|
|
8157
|
-
return /* @__PURE__ */ (0,
|
|
8327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8158
8328
|
Badge,
|
|
8159
8329
|
{
|
|
8160
8330
|
text: formatMarketProbabilityPercent(price.price, config.formatting.formatPercent),
|
|
8161
|
-
prefix: /* @__PURE__ */ (0,
|
|
8331
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8162
8332
|
VenueLogo,
|
|
8163
8333
|
{
|
|
8164
8334
|
venue: price.venue,
|
|
@@ -8201,7 +8371,7 @@ var EventListItemContent = ({
|
|
|
8201
8371
|
`${price.market.id}:${price.outcome.id}`
|
|
8202
8372
|
);
|
|
8203
8373
|
};
|
|
8204
|
-
return /* @__PURE__ */ (0,
|
|
8374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
|
|
8205
8375
|
Card,
|
|
8206
8376
|
{
|
|
8207
8377
|
className: cn(
|
|
@@ -8218,11 +8388,11 @@ var EventListItemContent = ({
|
|
|
8218
8388
|
"aria-label": ariaLabel != null ? ariaLabel : [resolvedTitle, resolvedTimestamp].filter(Boolean).join(" "),
|
|
8219
8389
|
withGradient: true,
|
|
8220
8390
|
children: [
|
|
8221
|
-
/* @__PURE__ */ (0,
|
|
8222
|
-
/* @__PURE__ */ (0,
|
|
8391
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: cn("agg-event-card-header flex items-center gap-4", classNames == null ? void 0 : classNames.header), children: [
|
|
8392
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8223
8393
|
RemoteImage,
|
|
8224
8394
|
{
|
|
8225
|
-
src: (0,
|
|
8395
|
+
src: (0, import_hooks33.optimizedImageUrl)(resolvedImage, 40),
|
|
8226
8396
|
alt: "",
|
|
8227
8397
|
classNames: {
|
|
8228
8398
|
root: "agg-event-image h-10 w-10 shrink-0 rounded-agg-lg object-cover",
|
|
@@ -8230,8 +8400,8 @@ var EventListItemContent = ({
|
|
|
8230
8400
|
}
|
|
8231
8401
|
}
|
|
8232
8402
|
),
|
|
8233
|
-
/* @__PURE__ */ (0,
|
|
8234
|
-
/* @__PURE__ */ (0,
|
|
8403
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("div", { className: "min-w-0 flex-1 self-stretch", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "flex h-12 min-w-0 flex-col justify-center", children: [
|
|
8404
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8235
8405
|
Typography,
|
|
8236
8406
|
{
|
|
8237
8407
|
variant: "body-strong",
|
|
@@ -8244,7 +8414,7 @@ var EventListItemContent = ({
|
|
|
8244
8414
|
children: resolvedTitle
|
|
8245
8415
|
}
|
|
8246
8416
|
),
|
|
8247
|
-
resolvedTimestamp ? /* @__PURE__ */ (0,
|
|
8417
|
+
resolvedTimestamp ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("div", { className: "agg-event-timestamp-row mt-0.5 h-5 min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8248
8418
|
Typography,
|
|
8249
8419
|
{
|
|
8250
8420
|
variant: "body",
|
|
@@ -8257,8 +8427,8 @@ var EventListItemContent = ({
|
|
|
8257
8427
|
) }) : null
|
|
8258
8428
|
] }) })
|
|
8259
8429
|
] }),
|
|
8260
|
-
/* @__PURE__ */ (0,
|
|
8261
|
-
/* @__PURE__ */ (0,
|
|
8430
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "relative w-full", children: [
|
|
8431
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
|
|
8262
8432
|
"div",
|
|
8263
8433
|
{
|
|
8264
8434
|
ref: outcomesContainerRef,
|
|
@@ -8276,7 +8446,7 @@ var EventListItemContent = ({
|
|
|
8276
8446
|
const arbReturn = arbReturnByVenueMarketId.get(row.market.id);
|
|
8277
8447
|
const priceGapPercent = arbReturn == null ? gapsByVenueMarketId.get(row.market.id) : arbReturn;
|
|
8278
8448
|
const priceGapSource = arbReturn == null ? "percent" : "fraction";
|
|
8279
|
-
return /* @__PURE__ */ (0,
|
|
8449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
|
|
8280
8450
|
"div",
|
|
8281
8451
|
{
|
|
8282
8452
|
className: cn(
|
|
@@ -8285,7 +8455,7 @@ var EventListItemContent = ({
|
|
|
8285
8455
|
classNames == null ? void 0 : classNames.outcomeRow
|
|
8286
8456
|
),
|
|
8287
8457
|
children: [
|
|
8288
|
-
/* @__PURE__ */ (0,
|
|
8458
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("div", { className: "agg-outcome-label-row flex min-w-0 flex-1 flex-row items-center justify-start gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8289
8459
|
Typography,
|
|
8290
8460
|
{
|
|
8291
8461
|
variant: "body",
|
|
@@ -8293,10 +8463,10 @@ var EventListItemContent = ({
|
|
|
8293
8463
|
children: row.label
|
|
8294
8464
|
}
|
|
8295
8465
|
) }),
|
|
8296
|
-
/* @__PURE__ */ (0,
|
|
8466
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "agg-outcome-meta flex shrink-0 flex-row items-center justify-end gap-2", children: [
|
|
8297
8467
|
renderArbitrage(arbitragePercent),
|
|
8298
8468
|
renderPriceGapPill(priceGapPercent, priceGapSource),
|
|
8299
|
-
/* @__PURE__ */ (0,
|
|
8469
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("div", { className: "agg-outcome-price-strip relative flex shrink-0 items-center justify-end", children: isAwaitingMidpoints ? renderPriceStripSkeleton(row.prices.length) : row.prices.map(
|
|
8300
8470
|
(price, priceIndex) => renderComparisonPriceBadge(row, price, priceIndex)
|
|
8301
8471
|
) })
|
|
8302
8472
|
] })
|
|
@@ -8305,15 +8475,15 @@ var EventListItemContent = ({
|
|
|
8305
8475
|
row.id
|
|
8306
8476
|
);
|
|
8307
8477
|
}),
|
|
8308
|
-
shouldRenderLoadingOutcomeRow ? /* @__PURE__ */ (0,
|
|
8309
|
-
/* @__PURE__ */ (0,
|
|
8478
|
+
shouldRenderLoadingOutcomeRow ? /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "agg-outcome-row-loading flex w-full items-center justify-between gap-3", children: [
|
|
8479
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8310
8480
|
"div",
|
|
8311
8481
|
{
|
|
8312
8482
|
"aria-hidden": "true",
|
|
8313
8483
|
className: "bg-agg-separator animate-pulse h-5 rounded-agg-sm w-[200px]"
|
|
8314
8484
|
}
|
|
8315
8485
|
),
|
|
8316
|
-
/* @__PURE__ */ (0,
|
|
8486
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8317
8487
|
"div",
|
|
8318
8488
|
{
|
|
8319
8489
|
"aria-hidden": "true",
|
|
@@ -8324,7 +8494,7 @@ var EventListItemContent = ({
|
|
|
8324
8494
|
]
|
|
8325
8495
|
}
|
|
8326
8496
|
),
|
|
8327
|
-
/* @__PURE__ */ (0,
|
|
8497
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8328
8498
|
"div",
|
|
8329
8499
|
{
|
|
8330
8500
|
className: cn(
|
|
@@ -8334,7 +8504,7 @@ var EventListItemContent = ({
|
|
|
8334
8504
|
style: { height: OUTCOMES_SCROLL_MASK_HEIGHT_PX }
|
|
8335
8505
|
}
|
|
8336
8506
|
),
|
|
8337
|
-
/* @__PURE__ */ (0,
|
|
8507
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8338
8508
|
"div",
|
|
8339
8509
|
{
|
|
8340
8510
|
className: cn(
|
|
@@ -8345,7 +8515,7 @@ var EventListItemContent = ({
|
|
|
8345
8515
|
}
|
|
8346
8516
|
)
|
|
8347
8517
|
] }),
|
|
8348
|
-
/* @__PURE__ */ (0,
|
|
8518
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
|
|
8349
8519
|
"div",
|
|
8350
8520
|
{
|
|
8351
8521
|
className: cn(
|
|
@@ -8355,14 +8525,14 @@ var EventListItemContent = ({
|
|
|
8355
8525
|
classNames == null ? void 0 : classNames.footer
|
|
8356
8526
|
),
|
|
8357
8527
|
children: [
|
|
8358
|
-
/* @__PURE__ */ (0,
|
|
8528
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
|
|
8359
8529
|
"div",
|
|
8360
8530
|
{
|
|
8361
8531
|
className: cn(
|
|
8362
8532
|
"agg-event-meta flex min-w-0 flex-1 items-center gap-2 text-agg-sm leading-agg-5 truncate"
|
|
8363
8533
|
),
|
|
8364
8534
|
children: [
|
|
8365
|
-
outcomesScrollState.remainingMarkets > 0 ? /* @__PURE__ */ (0,
|
|
8535
|
+
outcomesScrollState.remainingMarkets > 0 ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8366
8536
|
Typography,
|
|
8367
8537
|
{
|
|
8368
8538
|
variant: "body",
|
|
@@ -8370,9 +8540,9 @@ var EventListItemContent = ({
|
|
|
8370
8540
|
children: labels.eventItem.remainingMarkets(outcomesScrollState.remainingMarkets)
|
|
8371
8541
|
}
|
|
8372
8542
|
) : null,
|
|
8373
|
-
shouldShowMatchedVenueSummary ? /* @__PURE__ */ (0,
|
|
8374
|
-
singleFooterVenue ? /* @__PURE__ */ (0,
|
|
8375
|
-
/* @__PURE__ */ (0,
|
|
8543
|
+
shouldShowMatchedVenueSummary ? /* @__PURE__ */ (0, import_jsx_runtime124.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,
|
|
8544
|
+
singleFooterVenue ? /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("span", { className: "agg-event-single-venue flex min-w-0 items-center gap-1 overflow-hidden", children: [
|
|
8545
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8376
8546
|
VenueLogo,
|
|
8377
8547
|
{
|
|
8378
8548
|
venue: singleFooterVenue,
|
|
@@ -8381,9 +8551,9 @@ var EventListItemContent = ({
|
|
|
8381
8551
|
className: "text-agg-muted-foreground! size-[14px]!"
|
|
8382
8552
|
}
|
|
8383
8553
|
),
|
|
8384
|
-
/* @__PURE__ */ (0,
|
|
8554
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "truncate text-agg-muted-foreground", children: resolveVenueLabel(singleFooterVenue, void 0, labels) })
|
|
8385
8555
|
] }) : null,
|
|
8386
|
-
shouldShowMatchedVenueSummary && visibleFooterVenues.length > 0 ? /* @__PURE__ */ (0,
|
|
8556
|
+
shouldShowMatchedVenueSummary && visibleFooterVenues.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "agg-event-venues flex items-center gap-1 overflow-hidden", children: visibleFooterVenues.map((venue) => /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8387
8557
|
VenueLogo,
|
|
8388
8558
|
{
|
|
8389
8559
|
venue,
|
|
@@ -8396,7 +8566,7 @@ var EventListItemContent = ({
|
|
|
8396
8566
|
]
|
|
8397
8567
|
}
|
|
8398
8568
|
),
|
|
8399
|
-
/* @__PURE__ */ (0,
|
|
8569
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8400
8570
|
Typography,
|
|
8401
8571
|
{
|
|
8402
8572
|
variant: "label",
|
|
@@ -8422,7 +8592,7 @@ var EventListItemByEventId = (_a) => {
|
|
|
8422
8592
|
error,
|
|
8423
8593
|
isError,
|
|
8424
8594
|
isLoading
|
|
8425
|
-
} = (0,
|
|
8595
|
+
} = (0, import_hooks33.useVenueEvent)({
|
|
8426
8596
|
eventId: eventId != null ? eventId : "",
|
|
8427
8597
|
enabled: !!eventId
|
|
8428
8598
|
});
|
|
@@ -8430,44 +8600,44 @@ var EventListItemByEventId = (_a) => {
|
|
|
8430
8600
|
return resolveEventListItemEvent(fetchedEvent);
|
|
8431
8601
|
}, [fetchedEvent]);
|
|
8432
8602
|
if (!eventId) {
|
|
8433
|
-
return /* @__PURE__ */ (0,
|
|
8603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(EventListItemUnavailableState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
8434
8604
|
}
|
|
8435
8605
|
if (isLoading) {
|
|
8436
|
-
return /* @__PURE__ */ (0,
|
|
8606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(EventListItemLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
8437
8607
|
}
|
|
8438
8608
|
if (isErrorWithStatus(error, 404)) {
|
|
8439
|
-
return /* @__PURE__ */ (0,
|
|
8609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(EventListItemNotFoundState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
8440
8610
|
}
|
|
8441
8611
|
if (!fetchedEvent && !isError) {
|
|
8442
|
-
return /* @__PURE__ */ (0,
|
|
8612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(EventListItemLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
8443
8613
|
}
|
|
8444
8614
|
if (!resolvedEvent) {
|
|
8445
|
-
return /* @__PURE__ */ (0,
|
|
8615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(EventListItemUnavailableState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
8446
8616
|
}
|
|
8447
|
-
return /* @__PURE__ */ (0,
|
|
8617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(EventListItemContent, __spreadValues({ event: resolvedEvent }, rest));
|
|
8448
8618
|
};
|
|
8449
8619
|
var EventListItem = (props) => {
|
|
8450
8620
|
if (props.isLoading) {
|
|
8451
|
-
return /* @__PURE__ */ (0,
|
|
8621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(EventListItemLoadingState, { classNames: props.classNames, ariaLabel: props.ariaLabel });
|
|
8452
8622
|
}
|
|
8453
8623
|
if ("event" in props && props.event) {
|
|
8454
8624
|
const _a = props, { event } = _a, rest = __objRest(_a, ["event"]);
|
|
8455
|
-
return /* @__PURE__ */ (0,
|
|
8625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(EventListItemContent, __spreadValues({ event }, rest));
|
|
8456
8626
|
}
|
|
8457
|
-
return /* @__PURE__ */ (0,
|
|
8627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(EventListItemByEventId, __spreadValues({}, props));
|
|
8458
8628
|
};
|
|
8459
8629
|
EventListItem.displayName = "EventListItem";
|
|
8460
8630
|
var EventListItemV2 = (props) => {
|
|
8461
|
-
return /* @__PURE__ */ (0,
|
|
8631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(EventListItem, __spreadValues({}, props));
|
|
8462
8632
|
};
|
|
8463
8633
|
EventListItemV2.displayName = "EventListItemV2";
|
|
8464
8634
|
|
|
8465
8635
|
// src/events/item-details/index.tsx
|
|
8466
|
-
var
|
|
8636
|
+
var import_hooks43 = require("@agg-build/hooks");
|
|
8467
8637
|
var import_react16 = require("react");
|
|
8468
8638
|
|
|
8469
8639
|
// src/primitives/chart/chart-type-switch.tsx
|
|
8470
|
-
var
|
|
8640
|
+
var import_hooks34 = require("@agg-build/hooks");
|
|
8471
8641
|
var import_react11 = require("react");
|
|
8472
8642
|
|
|
8473
8643
|
// src/primitives/chart/chart-type-switch.constants.ts
|
|
@@ -8493,13 +8663,13 @@ var resolveChartTypeOptionIconName = (chartType) => {
|
|
|
8493
8663
|
};
|
|
8494
8664
|
|
|
8495
8665
|
// src/primitives/chart/chart-type-switch.tsx
|
|
8496
|
-
var
|
|
8666
|
+
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
8497
8667
|
var ChartTypeSwitch = ({
|
|
8498
8668
|
value,
|
|
8499
8669
|
onValueChange,
|
|
8500
8670
|
className
|
|
8501
8671
|
}) => {
|
|
8502
|
-
const labels = (0,
|
|
8672
|
+
const labels = (0, import_hooks34.useLabels)();
|
|
8503
8673
|
const options = (0, import_react11.useMemo)(
|
|
8504
8674
|
() => CHART_TYPE_SWITCH_OPTION_KEYS.map((chartType) => ({
|
|
8505
8675
|
value: chartType,
|
|
@@ -8529,7 +8699,7 @@ var ChartTypeSwitch = ({
|
|
|
8529
8699
|
}
|
|
8530
8700
|
onValueChange(nextOption.value);
|
|
8531
8701
|
};
|
|
8532
|
-
return /* @__PURE__ */ (0,
|
|
8702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
8533
8703
|
"div",
|
|
8534
8704
|
{
|
|
8535
8705
|
className: cn("agg-chart-type-switch inline-flex items-center gap-2", className),
|
|
@@ -8537,7 +8707,7 @@ var ChartTypeSwitch = ({
|
|
|
8537
8707
|
"aria-label": labels.common.chartTypeSwitchAria,
|
|
8538
8708
|
children: options.map((option, index) => {
|
|
8539
8709
|
const isActive = option.value === value;
|
|
8540
|
-
return /* @__PURE__ */ (0,
|
|
8710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
8541
8711
|
"button",
|
|
8542
8712
|
{
|
|
8543
8713
|
type: "button",
|
|
@@ -8564,7 +8734,7 @@ var ChartTypeSwitch = ({
|
|
|
8564
8734
|
onKeyDown: (event) => {
|
|
8565
8735
|
handleKeyDown(event, index);
|
|
8566
8736
|
},
|
|
8567
|
-
children: /* @__PURE__ */ (0,
|
|
8737
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Icon, { name: option.iconName, color: "currentColor", className: "h-5 w-5" })
|
|
8568
8738
|
},
|
|
8569
8739
|
option.value
|
|
8570
8740
|
);
|
|
@@ -8575,7 +8745,7 @@ var ChartTypeSwitch = ({
|
|
|
8575
8745
|
ChartTypeSwitch.displayName = "ChartTypeSwitch";
|
|
8576
8746
|
|
|
8577
8747
|
// src/trading/trading-context/index.tsx
|
|
8578
|
-
var
|
|
8748
|
+
var import_hooks35 = require("@agg-build/hooks");
|
|
8579
8749
|
|
|
8580
8750
|
// src/events/market-details/market-details.utils.ts
|
|
8581
8751
|
var import_sdk13 = require("@agg-build/sdk");
|
|
@@ -9330,7 +9500,7 @@ var buildMarketDetailsModel = ({
|
|
|
9330
9500
|
};
|
|
9331
9501
|
|
|
9332
9502
|
// src/events/market-details/orderbook-aggregation.ts
|
|
9333
|
-
var
|
|
9503
|
+
var import_hooks36 = require("@agg-build/hooks");
|
|
9334
9504
|
var PRICE_PRECISION = 1e6;
|
|
9335
9505
|
var SIZE_PRECISION = 1e8;
|
|
9336
9506
|
var POSITIVE_OUTCOME_KEYS = /* @__PURE__ */ new Set(["yes", "y", "true", "up", "buy", "long"]);
|
|
@@ -9451,7 +9621,7 @@ var buildRowsFromAccumulator = ({
|
|
|
9451
9621
|
const venueBreakdown = Object.fromEntries(
|
|
9452
9622
|
Object.entries(level.venueBreakdownScaled).filter(([, scaledSize]) => scaledSize > 0).map(([venue2, scaledSize]) => [venue2, fromScaled(scaledSize, SIZE_PRECISION)])
|
|
9453
9623
|
);
|
|
9454
|
-
const resolvedFallbackVenue = fallbackVenue != null ? fallbackVenue :
|
|
9624
|
+
const resolvedFallbackVenue = fallbackVenue != null ? fallbackVenue : import_hooks36.Venue.polymarket;
|
|
9455
9625
|
const venues = resolveVenues(venueBreakdown, resolvedFallbackVenue);
|
|
9456
9626
|
const venue = resolvePrimaryVenue(venueBreakdown, resolvedFallbackVenue);
|
|
9457
9627
|
return {
|
|
@@ -9749,7 +9919,7 @@ var shouldAutoFallbackToAllRange = ({
|
|
|
9749
9919
|
};
|
|
9750
9920
|
|
|
9751
9921
|
// src/events/shared/chart-venue-selection.ts
|
|
9752
|
-
var
|
|
9922
|
+
var import_hooks37 = require("@agg-build/hooks");
|
|
9753
9923
|
var resolveChartVenueOutcomes = ({
|
|
9754
9924
|
eligibleVenueOutcomes,
|
|
9755
9925
|
livePrices
|
|
@@ -9761,7 +9931,7 @@ var resolveChartVenueOutcomes = ({
|
|
|
9761
9931
|
const probabilityDifference = (leftProbability != null ? leftProbability : 2) - (rightProbability != null ? rightProbability : 2);
|
|
9762
9932
|
if (probabilityDifference !== 0) return probabilityDifference;
|
|
9763
9933
|
if (left.venue === right.venue) return 0;
|
|
9764
|
-
const sortedVenues = (0,
|
|
9934
|
+
const sortedVenues = (0, import_hooks37.sortVenues)([left.venue, right.venue]);
|
|
9765
9935
|
return sortedVenues[0] === left.venue ? -1 : 1;
|
|
9766
9936
|
});
|
|
9767
9937
|
const venueOutcomesByVenue = /* @__PURE__ */ new Map();
|
|
@@ -9855,16 +10025,160 @@ var getDisplayOutcomePrice = ({
|
|
|
9855
10025
|
return resolvedFallbackPrice;
|
|
9856
10026
|
};
|
|
9857
10027
|
|
|
10028
|
+
// src/events/shared/sports-live-score.tsx
|
|
10029
|
+
var import_hooks38 = require("@agg-build/hooks");
|
|
10030
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
10031
|
+
var SportsLiveScore = ({
|
|
10032
|
+
state,
|
|
10033
|
+
variant = "detail",
|
|
10034
|
+
className
|
|
10035
|
+
}) => {
|
|
10036
|
+
const labels = (0, import_hooks38.useLabels)();
|
|
10037
|
+
if (!state || state.participants.length !== 2) return null;
|
|
10038
|
+
const [firstParticipant, secondParticipant] = state.participants;
|
|
10039
|
+
const firstScore = firstParticipant == null ? void 0 : firstParticipant.score;
|
|
10040
|
+
const secondScore = secondParticipant == null ? void 0 : secondParticipant.score;
|
|
10041
|
+
if (firstScore == null || secondScore == null) return null;
|
|
10042
|
+
const statusLabels = {
|
|
10043
|
+
scheduled: labels.sportsLive.scheduled,
|
|
10044
|
+
live: labels.sportsLive.live,
|
|
10045
|
+
paused: labels.sportsLive.paused,
|
|
10046
|
+
finished: labels.sportsLive.finished,
|
|
10047
|
+
cancelled: labels.sportsLive.cancelled,
|
|
10048
|
+
postponed: labels.sportsLive.postponed,
|
|
10049
|
+
unknown: labels.sportsLive.unknown
|
|
10050
|
+
};
|
|
10051
|
+
const statusText = [state.period, state.clock].filter(Boolean).join(" \xB7 ") || statusLabels[state.status];
|
|
10052
|
+
const isLiveIndicatorVisible = state.status === "live" || state.status === "paused";
|
|
10053
|
+
const isCard = variant === "card";
|
|
10054
|
+
const renderParticipant = (participant) => {
|
|
10055
|
+
var _a;
|
|
10056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
10057
|
+
"div",
|
|
10058
|
+
{
|
|
10059
|
+
className: cn("flex min-w-0 flex-col items-center", isCard ? "gap-1.5" : "gap-3"),
|
|
10060
|
+
title: participant.name,
|
|
10061
|
+
children: [
|
|
10062
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
10063
|
+
RemoteImage,
|
|
10064
|
+
{
|
|
10065
|
+
src: participant.imageUrl,
|
|
10066
|
+
alt: "",
|
|
10067
|
+
width: isCard ? 28 : 44,
|
|
10068
|
+
height: isCard ? 28 : 44,
|
|
10069
|
+
classNames: {
|
|
10070
|
+
root: cn(
|
|
10071
|
+
"shrink-0 border border-agg-separator bg-agg-secondary-hover",
|
|
10072
|
+
isCard ? "size-7 rounded-agg-md" : "size-11 rounded-agg-lg"
|
|
10073
|
+
),
|
|
10074
|
+
image: "object-contain",
|
|
10075
|
+
placeholder: "text-agg-muted-foreground"
|
|
10076
|
+
}
|
|
10077
|
+
}
|
|
10078
|
+
),
|
|
10079
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
10080
|
+
Typography,
|
|
10081
|
+
{
|
|
10082
|
+
variant: "body",
|
|
10083
|
+
className: cn(
|
|
10084
|
+
"max-w-full truncate text-center text-agg-foreground",
|
|
10085
|
+
isCard ? "text-agg-xs leading-agg-4" : "text-agg-base leading-agg-6"
|
|
10086
|
+
),
|
|
10087
|
+
children: (_a = participant.shortName) != null ? _a : participant.name
|
|
10088
|
+
}
|
|
10089
|
+
)
|
|
10090
|
+
]
|
|
10091
|
+
}
|
|
10092
|
+
);
|
|
10093
|
+
};
|
|
10094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
10095
|
+
"div",
|
|
10096
|
+
{
|
|
10097
|
+
role: "status",
|
|
10098
|
+
"aria-label": labels.sportsLive.scoreAria(
|
|
10099
|
+
firstParticipant.name,
|
|
10100
|
+
firstScore,
|
|
10101
|
+
secondParticipant.name,
|
|
10102
|
+
secondScore,
|
|
10103
|
+
statusText
|
|
10104
|
+
),
|
|
10105
|
+
className: cn(
|
|
10106
|
+
"agg-sports-live-score grid w-full grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center",
|
|
10107
|
+
isCard ? "gap-3 py-1" : "gap-6 md:gap-10",
|
|
10108
|
+
className
|
|
10109
|
+
),
|
|
10110
|
+
children: [
|
|
10111
|
+
renderParticipant(firstParticipant),
|
|
10112
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: cn("flex flex-col items-center", isCard ? "gap-1" : "gap-3"), children: [
|
|
10113
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: cn("flex items-center", isCard ? "gap-2" : "gap-3"), children: [
|
|
10114
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
10115
|
+
Typography,
|
|
10116
|
+
{
|
|
10117
|
+
variant: "body-strong",
|
|
10118
|
+
className: cn(
|
|
10119
|
+
"font-agg-bold tabular-nums text-agg-foreground",
|
|
10120
|
+
isCard ? "text-agg-xl leading-agg-7" : "text-agg-3xl leading-agg-9"
|
|
10121
|
+
),
|
|
10122
|
+
children: firstScore
|
|
10123
|
+
}
|
|
10124
|
+
),
|
|
10125
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
10126
|
+
"span",
|
|
10127
|
+
{
|
|
10128
|
+
"aria-hidden": "true",
|
|
10129
|
+
className: cn("shrink-0 bg-agg-separator", isCard ? "h-0.5 w-2" : "h-0.5 w-3")
|
|
10130
|
+
}
|
|
10131
|
+
),
|
|
10132
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
10133
|
+
Typography,
|
|
10134
|
+
{
|
|
10135
|
+
variant: "body-strong",
|
|
10136
|
+
className: cn(
|
|
10137
|
+
"font-agg-bold tabular-nums text-agg-foreground",
|
|
10138
|
+
isCard ? "text-agg-xl leading-agg-7" : "text-agg-3xl leading-agg-9"
|
|
10139
|
+
),
|
|
10140
|
+
children: secondScore
|
|
10141
|
+
}
|
|
10142
|
+
)
|
|
10143
|
+
] }),
|
|
10144
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex min-w-0 items-center gap-2 text-agg-primary", children: [
|
|
10145
|
+
isLiveIndicatorVisible ? /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
10146
|
+
"span",
|
|
10147
|
+
{
|
|
10148
|
+
"aria-hidden": "true",
|
|
10149
|
+
className: "flex size-3.5 shrink-0 items-center justify-center rounded-agg-full bg-agg-primary/10",
|
|
10150
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { className: "size-1.5 rounded-agg-full bg-agg-primary" })
|
|
10151
|
+
}
|
|
10152
|
+
) : null,
|
|
10153
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
10154
|
+
Typography,
|
|
10155
|
+
{
|
|
10156
|
+
variant: "label-strong",
|
|
10157
|
+
className: cn(
|
|
10158
|
+
"max-w-full truncate uppercase text-agg-primary",
|
|
10159
|
+
isCard ? "text-agg-2xs leading-agg-4" : "text-agg-sm leading-agg-5"
|
|
10160
|
+
),
|
|
10161
|
+
children: statusText
|
|
10162
|
+
}
|
|
10163
|
+
)
|
|
10164
|
+
] })
|
|
10165
|
+
] }),
|
|
10166
|
+
renderParticipant(secondParticipant)
|
|
10167
|
+
]
|
|
10168
|
+
}
|
|
10169
|
+
);
|
|
10170
|
+
};
|
|
10171
|
+
SportsLiveScore.displayName = "SportsLiveScore";
|
|
10172
|
+
|
|
9858
10173
|
// src/events/item-details/event-list-item-details-market-selector.tsx
|
|
9859
|
-
var
|
|
10174
|
+
var import_hooks39 = require("@agg-build/hooks");
|
|
9860
10175
|
var import_react12 = require("react");
|
|
9861
|
-
var
|
|
10176
|
+
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
9862
10177
|
var MARKET_PILL_MAX_ROWS = 2;
|
|
9863
10178
|
var MARKET_PILL_FALLBACK_CONTAINER_WIDTH = 640;
|
|
9864
10179
|
var MARKET_PILL_FALLBACK_GAP = 8;
|
|
9865
10180
|
var MARKET_PILL_FALLBACK_WIDTH = 72;
|
|
9866
10181
|
var MARKET_PILL_FALLBACK_MORE_WIDTH = 88;
|
|
9867
|
-
var MARKET_PILL_MORE_LABEL = "More";
|
|
9868
10182
|
var MARKET_DROPDOWN_MAX_VISIBLE_OPTIONS = 6;
|
|
9869
10183
|
var MARKET_DROPDOWN_OPTION_HEIGHT = 48;
|
|
9870
10184
|
var MARKET_DROPDOWN_MAX_HEIGHT = MARKET_DROPDOWN_MAX_VISIBLE_OPTIONS * MARKET_DROPDOWN_OPTION_HEIGHT;
|
|
@@ -9949,11 +10263,17 @@ var resolveMarketPillLayout = ({
|
|
|
9949
10263
|
var EventListItemDetailsMarketSelector = ({
|
|
9950
10264
|
className,
|
|
9951
10265
|
options,
|
|
10266
|
+
browseOptions = options,
|
|
9952
10267
|
selectedValue,
|
|
10268
|
+
liveValue,
|
|
10269
|
+
alwaysShowMore = false,
|
|
9953
10270
|
onChange
|
|
9954
10271
|
}) => {
|
|
9955
10272
|
var _a;
|
|
9956
|
-
const labels = (0,
|
|
10273
|
+
const labels = (0, import_hooks39.useLabels)();
|
|
10274
|
+
const {
|
|
10275
|
+
features: { enableAnimations }
|
|
10276
|
+
} = (0, import_hooks39.useSdkUiConfig)();
|
|
9957
10277
|
const containerRef = (0, import_react12.useRef)(null);
|
|
9958
10278
|
const measurementContainerRef = (0, import_react12.useRef)(null);
|
|
9959
10279
|
const moreButtonRef = (0, import_react12.useRef)(null);
|
|
@@ -9974,15 +10294,22 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
9974
10294
|
});
|
|
9975
10295
|
const selectedHiddenOption = (0, import_react12.useMemo)(() => {
|
|
9976
10296
|
var _a2;
|
|
9977
|
-
return (_a2 =
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
|
|
10297
|
+
return (_a2 = browseOptions.find(
|
|
10298
|
+
(option) => option.value === selectedValue && !layout.visibleItems.some((visibleOption) => visibleOption.value === option.value)
|
|
10299
|
+
)) != null ? _a2 : null;
|
|
10300
|
+
}, [browseOptions, layout.visibleItems, selectedValue]);
|
|
10301
|
+
const hasSeparateBrowseOptions = browseOptions.length > options.length;
|
|
10302
|
+
const moreButtonLabel = hasSeparateBrowseOptions ? labels.eventItemDetails.moreMarkets : (_a = selectedHiddenOption == null ? void 0 : selectedHiddenOption.label) != null ? _a : labels.eventItemDetails.moreMarkets;
|
|
10303
|
+
const isMoreButtonSelected = !alwaysShowMore && selectedHiddenOption != null;
|
|
10304
|
+
const hasMoreButton = alwaysShowMore || layout.hiddenItems.length > 0 || hasSeparateBrowseOptions;
|
|
10305
|
+
const displayedOptions = alwaysShowMore ? options : layout.visibleItems;
|
|
9981
10306
|
const filteredOptions = (0, import_react12.useMemo)(() => {
|
|
9982
10307
|
const normalizedSearchValue = searchValue.trim().toLowerCase();
|
|
9983
|
-
if (!normalizedSearchValue) return
|
|
9984
|
-
return
|
|
9985
|
-
|
|
10308
|
+
if (!normalizedSearchValue) return browseOptions;
|
|
10309
|
+
return browseOptions.filter(
|
|
10310
|
+
(option) => option.label.toLowerCase().includes(normalizedSearchValue)
|
|
10311
|
+
);
|
|
10312
|
+
}, [browseOptions, searchValue]);
|
|
9986
10313
|
const lastMeasuredKeyRef = (0, import_react12.useRef)(null);
|
|
9987
10314
|
const measureFrameRef = (0, import_react12.useRef)(null);
|
|
9988
10315
|
(0, import_react12.useLayoutEffect)(() => {
|
|
@@ -10098,7 +10425,7 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10098
10425
|
};
|
|
10099
10426
|
}, [isDropdownOpen]);
|
|
10100
10427
|
(0, import_react12.useLayoutEffect)(() => {
|
|
10101
|
-
if (!isDropdownOpen || isMobileViewport) return;
|
|
10428
|
+
if (!isDropdownOpen || isMobileViewport && !alwaysShowMore) return;
|
|
10102
10429
|
const updateDropdownPosition = () => {
|
|
10103
10430
|
const containerElement = containerRef.current;
|
|
10104
10431
|
const moreButtonElement = moreButtonRef.current;
|
|
@@ -10132,7 +10459,7 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10132
10459
|
return () => {
|
|
10133
10460
|
resizeObserver.disconnect();
|
|
10134
10461
|
};
|
|
10135
|
-
}, [isDropdownOpen, isMobileViewport, moreButtonLabel]);
|
|
10462
|
+
}, [alwaysShowMore, isDropdownOpen, isMobileViewport, moreButtonLabel]);
|
|
10136
10463
|
(0, import_react12.useEffect)(() => {
|
|
10137
10464
|
if (!isDropdownOpen) return;
|
|
10138
10465
|
const handlePointerDown = (event) => {
|
|
@@ -10161,11 +10488,11 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10161
10488
|
onChange(marketId);
|
|
10162
10489
|
setIsDropdownOpen(false);
|
|
10163
10490
|
};
|
|
10164
|
-
if (isMobileViewport) {
|
|
10165
|
-
return /* @__PURE__ */ (0,
|
|
10491
|
+
if (isMobileViewport && !alwaysShowMore) {
|
|
10492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
10166
10493
|
AutocompleteSelect,
|
|
10167
10494
|
{
|
|
10168
|
-
options,
|
|
10495
|
+
options: browseOptions,
|
|
10169
10496
|
value: selectedValue,
|
|
10170
10497
|
onChange,
|
|
10171
10498
|
placeholder: labels.eventItemDetails.marketSelectPlaceholder,
|
|
@@ -10176,15 +10503,17 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10176
10503
|
}
|
|
10177
10504
|
);
|
|
10178
10505
|
}
|
|
10179
|
-
return /* @__PURE__ */ (0,
|
|
10180
|
-
/* @__PURE__ */ (0,
|
|
10181
|
-
|
|
10506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { ref: containerRef, className: cn("agg-market-select relative w-full", className), children: [
|
|
10507
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "agg-market-pill-list flex flex-wrap gap-2", children: [
|
|
10508
|
+
displayedOptions.map((option) => {
|
|
10182
10509
|
const isSelected = option.value === selectedValue;
|
|
10183
|
-
|
|
10510
|
+
const isLive = option.value === liveValue;
|
|
10511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
10184
10512
|
"button",
|
|
10185
10513
|
{
|
|
10186
10514
|
type: "button",
|
|
10187
10515
|
"aria-pressed": isSelected,
|
|
10516
|
+
"aria-label": isLive ? `${option.label}, ${labels.eventItemDetails.liveMarket}` : option.label,
|
|
10188
10517
|
className: cn(
|
|
10189
10518
|
"agg-market-pill inline-flex min-h-8 items-center justify-center rounded-agg-full border px-4 py-1.5 text-left text-agg-sm leading-agg-5 text-agg-foreground transition-colors",
|
|
10190
10519
|
"cursor-pointer hover:bg-agg-tertiary!",
|
|
@@ -10196,12 +10525,28 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10196
10525
|
eventToHandle.stopPropagation();
|
|
10197
10526
|
handleSelectMarket(option.value);
|
|
10198
10527
|
},
|
|
10199
|
-
children:
|
|
10528
|
+
children: [
|
|
10529
|
+
isLive ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
10530
|
+
"span",
|
|
10531
|
+
{
|
|
10532
|
+
"aria-hidden": "true",
|
|
10533
|
+
className: cn(
|
|
10534
|
+
"mr-2 size-1.5 shrink-0 rounded-full bg-agg-primary ring-4 ring-agg-primary/20",
|
|
10535
|
+
enableAnimations ? "animate-pulse motion-reduce:animate-none" : null
|
|
10536
|
+
)
|
|
10537
|
+
}
|
|
10538
|
+
) : null,
|
|
10539
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { className: "truncate", children: option.label }),
|
|
10540
|
+
isLive ? /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("span", { className: "sr-only", children: [
|
|
10541
|
+
" ",
|
|
10542
|
+
labels.eventItemDetails.liveMarket
|
|
10543
|
+
] }) : null
|
|
10544
|
+
]
|
|
10200
10545
|
},
|
|
10201
10546
|
option.value
|
|
10202
10547
|
);
|
|
10203
10548
|
}),
|
|
10204
|
-
|
|
10549
|
+
hasMoreButton ? /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
10205
10550
|
"button",
|
|
10206
10551
|
{
|
|
10207
10552
|
ref: moreButtonRef,
|
|
@@ -10222,8 +10567,8 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10222
10567
|
setIsDropdownOpen((previousValue) => !previousValue);
|
|
10223
10568
|
},
|
|
10224
10569
|
children: [
|
|
10225
|
-
/* @__PURE__ */ (0,
|
|
10226
|
-
/* @__PURE__ */ (0,
|
|
10570
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { className: "truncate", children: moreButtonLabel }),
|
|
10571
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
10227
10572
|
Icon,
|
|
10228
10573
|
{
|
|
10229
10574
|
name: isDropdownOpen ? "chevron-up" : "chevron-down",
|
|
@@ -10237,7 +10582,7 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10237
10582
|
}
|
|
10238
10583
|
) : null
|
|
10239
10584
|
] }),
|
|
10240
|
-
isDropdownOpen ? /* @__PURE__ */ (0,
|
|
10585
|
+
isDropdownOpen ? /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
10241
10586
|
"div",
|
|
10242
10587
|
{
|
|
10243
10588
|
id: "agg-event-details-market-dropdown",
|
|
@@ -10254,9 +10599,9 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10254
10599
|
eventToHandle.stopPropagation();
|
|
10255
10600
|
},
|
|
10256
10601
|
children: [
|
|
10257
|
-
/* @__PURE__ */ (0,
|
|
10258
|
-
/* @__PURE__ */ (0,
|
|
10259
|
-
/* @__PURE__ */ (0,
|
|
10602
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "border-b border-agg-separator", children: [
|
|
10603
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("label", { className: "sr-only", htmlFor: "agg-event-details-market-search", children: labels.eventItemDetails.marketSelectSearchPlaceholder }),
|
|
10604
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
10260
10605
|
"input",
|
|
10261
10606
|
{
|
|
10262
10607
|
ref: dropdownInputRef,
|
|
@@ -10278,7 +10623,7 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10278
10623
|
}
|
|
10279
10624
|
)
|
|
10280
10625
|
] }),
|
|
10281
|
-
/* @__PURE__ */ (0,
|
|
10626
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
10282
10627
|
"div",
|
|
10283
10628
|
{
|
|
10284
10629
|
role: "listbox",
|
|
@@ -10287,7 +10632,7 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10287
10632
|
style: { maxHeight: `${MARKET_DROPDOWN_MAX_HEIGHT}px` },
|
|
10288
10633
|
children: filteredOptions.length > 0 ? filteredOptions.map((option) => {
|
|
10289
10634
|
const isSelected = option.value === selectedValue;
|
|
10290
|
-
return /* @__PURE__ */ (0,
|
|
10635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
10291
10636
|
"button",
|
|
10292
10637
|
{
|
|
10293
10638
|
type: "button",
|
|
@@ -10306,25 +10651,25 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10306
10651
|
handleSelectMarket(option.value);
|
|
10307
10652
|
},
|
|
10308
10653
|
children: [
|
|
10309
|
-
isSelected ? /* @__PURE__ */ (0,
|
|
10654
|
+
isSelected ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
10310
10655
|
"span",
|
|
10311
10656
|
{
|
|
10312
10657
|
"aria-hidden": "true",
|
|
10313
10658
|
className: "absolute bottom-2 left-0 top-2 w-1 bg-agg-primary"
|
|
10314
10659
|
}
|
|
10315
10660
|
) : null,
|
|
10316
|
-
/* @__PURE__ */ (0,
|
|
10661
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { className: "truncate", children: option.label })
|
|
10317
10662
|
]
|
|
10318
10663
|
},
|
|
10319
10664
|
option.value
|
|
10320
10665
|
);
|
|
10321
|
-
}) : /* @__PURE__ */ (0,
|
|
10666
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("div", { className: "px-5 py-4 text-agg-sm leading-agg-5 text-agg-muted-foreground", children: labels.eventItemDetails.marketSelectEmpty })
|
|
10322
10667
|
}
|
|
10323
10668
|
)
|
|
10324
10669
|
]
|
|
10325
10670
|
}
|
|
10326
10671
|
) : null,
|
|
10327
|
-
/* @__PURE__ */ (0,
|
|
10672
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
10328
10673
|
"div",
|
|
10329
10674
|
{
|
|
10330
10675
|
ref: measurementContainerRef,
|
|
@@ -10333,7 +10678,7 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10333
10678
|
children: [
|
|
10334
10679
|
options.map((option) => {
|
|
10335
10680
|
const isSelected = option.value === selectedValue;
|
|
10336
|
-
return /* @__PURE__ */ (0,
|
|
10681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
10337
10682
|
"button",
|
|
10338
10683
|
{
|
|
10339
10684
|
ref: (element) => {
|
|
@@ -10345,12 +10690,12 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10345
10690
|
"inline-flex min-h-8 items-center justify-center rounded-agg-full border px-4 py-1.5 text-agg-sm leading-agg-5",
|
|
10346
10691
|
isSelected ? "border-agg-primary bg-agg-secondary font-agg-bold" : "border-transparent bg-agg-secondary-hover font-agg-normal"
|
|
10347
10692
|
),
|
|
10348
|
-
children: /* @__PURE__ */ (0,
|
|
10693
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { className: "truncate", children: option.label })
|
|
10349
10694
|
},
|
|
10350
10695
|
option.value
|
|
10351
10696
|
);
|
|
10352
10697
|
}),
|
|
10353
|
-
/* @__PURE__ */ (0,
|
|
10698
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
10354
10699
|
"button",
|
|
10355
10700
|
{
|
|
10356
10701
|
ref: moreButtonMeasureRef,
|
|
@@ -10358,8 +10703,8 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10358
10703
|
tabIndex: -1,
|
|
10359
10704
|
className: "inline-flex min-h-8 items-center justify-center gap-1.5 rounded-agg-full border border-agg-primary bg-agg-secondary px-4 py-1.5 text-agg-sm leading-agg-5 text-agg-foreground",
|
|
10360
10705
|
children: [
|
|
10361
|
-
/* @__PURE__ */ (0,
|
|
10362
|
-
/* @__PURE__ */ (0,
|
|
10706
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { children: moreButtonLabel }),
|
|
10707
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
10363
10708
|
Icon,
|
|
10364
10709
|
{
|
|
10365
10710
|
name: "chevron-down",
|
|
@@ -10379,17 +10724,17 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10379
10724
|
};
|
|
10380
10725
|
|
|
10381
10726
|
// src/events/item-details/settlement-summary.tsx
|
|
10382
|
-
var
|
|
10727
|
+
var import_hooks42 = require("@agg-build/hooks");
|
|
10383
10728
|
var import_react15 = require("react");
|
|
10384
10729
|
|
|
10385
10730
|
// src/trading/settlement/index.tsx
|
|
10386
|
-
var
|
|
10731
|
+
var import_hooks41 = require("@agg-build/hooks");
|
|
10387
10732
|
var import_react14 = require("react");
|
|
10388
10733
|
|
|
10389
10734
|
// src/trading/utils.ts
|
|
10390
|
-
var
|
|
10735
|
+
var import_hooks40 = require("@agg-build/hooks");
|
|
10391
10736
|
var import_dayjs5 = __toESM(require("dayjs"));
|
|
10392
|
-
var defaultLabels = (0,
|
|
10737
|
+
var defaultLabels = (0, import_hooks40.resolveAggUiLabels)("en-US");
|
|
10393
10738
|
var defaultSettlementSectionLabel = defaultLabels.trading.settlementSection;
|
|
10394
10739
|
var defaultTradingDisclaimer = defaultLabels.trading.disclaimer;
|
|
10395
10740
|
|
|
@@ -10441,7 +10786,7 @@ var dedupeSettlementSources = (sources) => {
|
|
|
10441
10786
|
};
|
|
10442
10787
|
|
|
10443
10788
|
// src/trading/settlement/settlement-text-renderer.tsx
|
|
10444
|
-
var
|
|
10789
|
+
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
10445
10790
|
var inlineTokenRegex = new RegExp(
|
|
10446
10791
|
[
|
|
10447
10792
|
/\[([^\]\n]+)\]\(([^)\s]+)\)/.source,
|
|
@@ -10480,12 +10825,12 @@ var renderInlineSegment = (text, baseKey) => {
|
|
|
10480
10825
|
}
|
|
10481
10826
|
if (match.index > lastIndex) {
|
|
10482
10827
|
nodes.push(
|
|
10483
|
-
/* @__PURE__ */ (0,
|
|
10828
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_react13.Fragment, { children: text.slice(lastIndex, match.index) }, `${baseKey}-text-${segmentIndex++}`)
|
|
10484
10829
|
);
|
|
10485
10830
|
}
|
|
10486
10831
|
if (isLinkMatch(match)) {
|
|
10487
10832
|
nodes.push(
|
|
10488
|
-
/* @__PURE__ */ (0,
|
|
10833
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
10489
10834
|
"a",
|
|
10490
10835
|
{
|
|
10491
10836
|
href: match[2],
|
|
@@ -10499,7 +10844,7 @@ var renderInlineSegment = (text, baseKey) => {
|
|
|
10499
10844
|
);
|
|
10500
10845
|
} else if (match[3] !== void 0) {
|
|
10501
10846
|
nodes.push(
|
|
10502
|
-
/* @__PURE__ */ (0,
|
|
10847
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
10503
10848
|
"strong",
|
|
10504
10849
|
{
|
|
10505
10850
|
className: "agg-settlement-text-bold font-agg-bold",
|
|
@@ -10510,7 +10855,7 @@ var renderInlineSegment = (text, baseKey) => {
|
|
|
10510
10855
|
);
|
|
10511
10856
|
} else if (match[4] !== void 0) {
|
|
10512
10857
|
nodes.push(
|
|
10513
|
-
/* @__PURE__ */ (0,
|
|
10858
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
10514
10859
|
"code",
|
|
10515
10860
|
{
|
|
10516
10861
|
className: "agg-settlement-text-code rounded-agg-sm bg-agg-secondary-hover px-1 py-0.5 font-mono text-[0.875em]",
|
|
@@ -10521,7 +10866,7 @@ var renderInlineSegment = (text, baseKey) => {
|
|
|
10521
10866
|
);
|
|
10522
10867
|
} else if (bareUrl !== void 0) {
|
|
10523
10868
|
nodes.push(
|
|
10524
|
-
/* @__PURE__ */ (0,
|
|
10869
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
10525
10870
|
"a",
|
|
10526
10871
|
{
|
|
10527
10872
|
href: bareUrl,
|
|
@@ -10538,18 +10883,18 @@ var renderInlineSegment = (text, baseKey) => {
|
|
|
10538
10883
|
}
|
|
10539
10884
|
if (lastIndex < text.length) {
|
|
10540
10885
|
nodes.push(
|
|
10541
|
-
/* @__PURE__ */ (0,
|
|
10886
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_react13.Fragment, { children: text.slice(lastIndex) }, `${baseKey}-text-${segmentIndex++}`)
|
|
10542
10887
|
);
|
|
10543
10888
|
}
|
|
10544
10889
|
return nodes;
|
|
10545
10890
|
};
|
|
10546
10891
|
var renderBlock = (block, blockIndex) => {
|
|
10547
10892
|
if (block.kind === "list") {
|
|
10548
|
-
return /* @__PURE__ */ (0,
|
|
10893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
10549
10894
|
"ul",
|
|
10550
10895
|
{
|
|
10551
10896
|
className: "agg-settlement-text-list list-disc pl-5 text-agg-sm leading-agg-5 text-agg-foreground",
|
|
10552
|
-
children: block.items.map((item, itemIndex) => /* @__PURE__ */ (0,
|
|
10897
|
+
children: block.items.map((item, itemIndex) => /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
10553
10898
|
"li",
|
|
10554
10899
|
{
|
|
10555
10900
|
className: "agg-settlement-text-list-item",
|
|
@@ -10561,12 +10906,12 @@ var renderBlock = (block, blockIndex) => {
|
|
|
10561
10906
|
`block-${blockIndex}`
|
|
10562
10907
|
);
|
|
10563
10908
|
}
|
|
10564
|
-
return /* @__PURE__ */ (0,
|
|
10909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
10565
10910
|
"p",
|
|
10566
10911
|
{
|
|
10567
10912
|
className: "agg-settlement-text-paragraph text-agg-sm leading-agg-5 text-agg-foreground break-words [overflow-wrap:anywhere]",
|
|
10568
|
-
children: block.lines.map((line, lineIndex) => /* @__PURE__ */ (0,
|
|
10569
|
-
lineIndex > 0 ? /* @__PURE__ */ (0,
|
|
10913
|
+
children: block.lines.map((line, lineIndex) => /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_react13.Fragment, { children: [
|
|
10914
|
+
lineIndex > 0 ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("br", {}) : null,
|
|
10570
10915
|
renderInlineSegment(line, `block-${blockIndex}-line-${lineIndex}`)
|
|
10571
10916
|
] }, `block-${blockIndex}-line-${lineIndex}`))
|
|
10572
10917
|
},
|
|
@@ -10579,12 +10924,12 @@ var SettlementTextRenderer = ({
|
|
|
10579
10924
|
}) => {
|
|
10580
10925
|
const blocks = parseSettlementBlocks(content);
|
|
10581
10926
|
if (blocks.length === 0) return null;
|
|
10582
|
-
return /* @__PURE__ */ (0,
|
|
10927
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: cn("agg-settlement-text flex flex-col gap-2", className), children: blocks.map((block, blockIndex) => renderBlock(block, blockIndex)) });
|
|
10583
10928
|
};
|
|
10584
10929
|
SettlementTextRenderer.displayName = "SettlementTextRenderer";
|
|
10585
10930
|
|
|
10586
10931
|
// src/trading/settlement/index.tsx
|
|
10587
|
-
var
|
|
10932
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
10588
10933
|
var SETTLEMENT_SECTION_ID = "agg-settlement-section";
|
|
10589
10934
|
var getSettlementDifferenceId = (sectionId, canonicalKey) => {
|
|
10590
10935
|
return `${sectionId}-difference-${canonicalKey}`;
|
|
@@ -10751,13 +11096,13 @@ var SettlementVenueRules = ({
|
|
|
10751
11096
|
rules,
|
|
10752
11097
|
labels
|
|
10753
11098
|
}) => {
|
|
10754
|
-
return /* @__PURE__ */ (0,
|
|
10755
|
-
/* @__PURE__ */ (0,
|
|
10756
|
-
/* @__PURE__ */ (0,
|
|
11099
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "agg-settlement-venue-rules flex w-full flex-col items-start gap-4", children: [
|
|
11100
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.trading.settlementFullRulesTitle }),
|
|
11101
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "flex w-full flex-col items-start gap-4", children: rules.map((rule) => {
|
|
10757
11102
|
const venueLabel = resolveSettlementVenueLabel(rule.venue, labels);
|
|
10758
|
-
return /* @__PURE__ */ (0,
|
|
10759
|
-
/* @__PURE__ */ (0,
|
|
10760
|
-
/* @__PURE__ */ (0,
|
|
11103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("details", { className: "group/agg-settlement-rule w-full", children: [
|
|
11104
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("summary", { className: "flex cursor-pointer list-none items-center gap-2 text-agg-sm font-agg-normal leading-agg-5 text-agg-foreground group-hover/agg-settlement-rule:text-agg-muted-foreground transition-colors marker:hidden", children: [
|
|
11105
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
10761
11106
|
VenueLogo,
|
|
10762
11107
|
{
|
|
10763
11108
|
venue: rule.venue,
|
|
@@ -10766,8 +11111,8 @@ var SettlementVenueRules = ({
|
|
|
10766
11111
|
ariaLabel: venueLabel
|
|
10767
11112
|
}
|
|
10768
11113
|
),
|
|
10769
|
-
/* @__PURE__ */ (0,
|
|
10770
|
-
/* @__PURE__ */ (0,
|
|
11114
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "text-agg-foreground group-hover/agg-settlement-rule:text-agg-muted-foreground transition-colors", children: venueLabel }),
|
|
11115
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
10771
11116
|
"i",
|
|
10772
11117
|
{
|
|
10773
11118
|
className: cn(
|
|
@@ -10780,7 +11125,7 @@ var SettlementVenueRules = ({
|
|
|
10780
11125
|
}
|
|
10781
11126
|
)
|
|
10782
11127
|
] }),
|
|
10783
|
-
/* @__PURE__ */ (0,
|
|
11128
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "mt-3 pl-6", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(SettlementTextRenderer, { content: rule.content }) })
|
|
10784
11129
|
] }, rule.venue);
|
|
10785
11130
|
}) })
|
|
10786
11131
|
] });
|
|
@@ -10799,7 +11144,7 @@ var Settlement = ({
|
|
|
10799
11144
|
isLoading = false
|
|
10800
11145
|
}) => {
|
|
10801
11146
|
var _a, _b, _c, _d, _e;
|
|
10802
|
-
const labels = (0,
|
|
11147
|
+
const labels = (0, import_hooks41.useLabels)();
|
|
10803
11148
|
const blocks = (0, import_react14.useMemo)(
|
|
10804
11149
|
() => dedupeSettlementSources({
|
|
10805
11150
|
eventDescription,
|
|
@@ -10844,7 +11189,7 @@ var Settlement = ({
|
|
|
10844
11189
|
);
|
|
10845
11190
|
};
|
|
10846
11191
|
if (isLoading) {
|
|
10847
|
-
return /* @__PURE__ */ (0,
|
|
11192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
10848
11193
|
Skeleton,
|
|
10849
11194
|
{
|
|
10850
11195
|
ariaLabel: labels.trading.settlementLoading,
|
|
@@ -10855,7 +11200,7 @@ var Settlement = ({
|
|
|
10855
11200
|
}
|
|
10856
11201
|
if (!hasSettlementContent) return null;
|
|
10857
11202
|
const resolvedSectionLabel = sectionLabel === defaultSettlementSectionLabel ? labels.trading.settlementSection : sectionLabel;
|
|
10858
|
-
return /* @__PURE__ */ (0,
|
|
11203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
10859
11204
|
Card,
|
|
10860
11205
|
{
|
|
10861
11206
|
id,
|
|
@@ -10865,51 +11210,51 @@ var Settlement = ({
|
|
|
10865
11210
|
className
|
|
10866
11211
|
),
|
|
10867
11212
|
children: [
|
|
10868
|
-
/* @__PURE__ */ (0,
|
|
10869
|
-
/* @__PURE__ */ (0,
|
|
10870
|
-
question ? /* @__PURE__ */ (0,
|
|
11213
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "agg-settlement-header flex w-full flex-col items-start gap-1 text-agg-muted-foreground sm:flex-row sm:items-center sm:justify-between sm:gap-4", children: [
|
|
11214
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { className: "shrink-0 text-agg-xs font-agg-bold leading-agg-4 uppercase", children: resolvedSectionLabel }),
|
|
11215
|
+
question ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { className: "agg-settlement-question min-w-0 text-agg-sm font-agg-normal leading-agg-5 sm:max-w-[314px] sm:truncate", children: question }) : null
|
|
10871
11216
|
] }),
|
|
10872
|
-
/* @__PURE__ */ (0,
|
|
10873
|
-
hasStandaloneSettlementText ? /* @__PURE__ */ (0,
|
|
10874
|
-
standaloneEventBlock || standaloneMarketBlock ? /* @__PURE__ */ (0,
|
|
11217
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "agg-settlement-sections flex w-full flex-col items-start gap-5", children: [
|
|
11218
|
+
hasStandaloneSettlementText ? /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "w-full", children: [
|
|
11219
|
+
standaloneEventBlock || standaloneMarketBlock ? /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
10875
11220
|
"div",
|
|
10876
11221
|
{
|
|
10877
11222
|
className: "agg-settlement-section agg-settlement-section-description",
|
|
10878
11223
|
"data-source": "description",
|
|
10879
11224
|
children: [
|
|
10880
|
-
standaloneEventBlock ? /* @__PURE__ */ (0,
|
|
10881
|
-
standaloneEventBlock && standaloneMarketBlock ? /* @__PURE__ */ (0,
|
|
10882
|
-
standaloneMarketBlock ? /* @__PURE__ */ (0,
|
|
11225
|
+
standaloneEventBlock ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { "data-source": "eventDescription", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(SettlementTextRenderer, { content: standaloneEventBlock.content }) }) : null,
|
|
11226
|
+
standaloneEventBlock && standaloneMarketBlock ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("hr", { className: "agg-settlement-divider my-4 border-0 border-t border-agg-separator" }) : null,
|
|
11227
|
+
standaloneMarketBlock ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { "data-source": "marketDescription", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(SettlementTextRenderer, { content: standaloneMarketBlock.content }) }) : null
|
|
10883
11228
|
]
|
|
10884
11229
|
}
|
|
10885
11230
|
) : null,
|
|
10886
|
-
standalonePrimaryRulesBlock ? /* @__PURE__ */ (0,
|
|
11231
|
+
standalonePrimaryRulesBlock ? /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
10887
11232
|
"div",
|
|
10888
11233
|
{
|
|
10889
11234
|
className: "agg-settlement-section agg-settlement-section-primaryRules",
|
|
10890
11235
|
"data-source": "primaryRules",
|
|
10891
11236
|
children: [
|
|
10892
|
-
/* @__PURE__ */ (0,
|
|
10893
|
-
/* @__PURE__ */ (0,
|
|
11237
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { className: "agg-settlement-section-label text-agg-xs font-agg-bold leading-agg-4 uppercase text-agg-muted-foreground mb-2", children: labels.trading.settlementPrimaryRulesLabel }),
|
|
11238
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(SettlementTextRenderer, { content: standalonePrimaryRulesBlock.content })
|
|
10894
11239
|
]
|
|
10895
11240
|
}
|
|
10896
11241
|
) : null
|
|
10897
11242
|
] }) : null,
|
|
10898
|
-
hasSettlementDifferences ? /* @__PURE__ */ (0,
|
|
10899
|
-
/* @__PURE__ */ (0,
|
|
10900
|
-
/* @__PURE__ */ (0,
|
|
10901
|
-
/* @__PURE__ */ (0,
|
|
11243
|
+
hasSettlementDifferences ? /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "agg-settlement-differences flex w-full flex-col items-start gap-5", children: [
|
|
11244
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
11245
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.trading.settlementDifferencesTitle }),
|
|
11246
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "flex size-4 shrink-0 items-center justify-center rounded-agg-full bg-agg-primary text-[10px] font-agg-bold leading-[14px] text-agg-on-primary", children: settlementDifferences.length })
|
|
10902
11247
|
] }),
|
|
10903
|
-
/* @__PURE__ */ (0,
|
|
11248
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "flex w-full flex-col items-start gap-5", children: settlementDifferences.map((difference) => {
|
|
10904
11249
|
const venueKeys = resolveDifferenceVenueKeys(difference, settlementVenues);
|
|
10905
11250
|
const isExpanded = openDifferenceKeys.includes(difference.canonicalKey) && venueKeys.length > 0;
|
|
10906
|
-
return /* @__PURE__ */ (0,
|
|
11251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
10907
11252
|
"div",
|
|
10908
11253
|
{
|
|
10909
11254
|
id: getSettlementDifferenceId(id, difference.canonicalKey),
|
|
10910
11255
|
className: "agg-settlement-difference flex w-full flex-col items-start gap-2 rounded-agg-lg",
|
|
10911
11256
|
children: [
|
|
10912
|
-
/* @__PURE__ */ (0,
|
|
11257
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
10913
11258
|
"button",
|
|
10914
11259
|
{
|
|
10915
11260
|
type: "button",
|
|
@@ -10917,7 +11262,7 @@ var Settlement = ({
|
|
|
10917
11262
|
"aria-expanded": isExpanded,
|
|
10918
11263
|
onClick: () => handleToggleDifference(difference.canonicalKey),
|
|
10919
11264
|
children: [
|
|
10920
|
-
/* @__PURE__ */ (0,
|
|
11265
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
10921
11266
|
"i",
|
|
10922
11267
|
{
|
|
10923
11268
|
className: cn(
|
|
@@ -10928,8 +11273,8 @@ var Settlement = ({
|
|
|
10928
11273
|
"aria-hidden": "true"
|
|
10929
11274
|
}
|
|
10930
11275
|
),
|
|
10931
|
-
/* @__PURE__ */ (0,
|
|
10932
|
-
/* @__PURE__ */ (0,
|
|
11276
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { className: "min-w-0 text-agg-sm font-agg-normal leading-agg-5 text-agg-foreground group-hover/agg-settlement-difference:text-agg-muted-foreground transition-colors break-words [overflow-wrap:anywhere]", children: difference.title }),
|
|
11277
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
10933
11278
|
"i",
|
|
10934
11279
|
{
|
|
10935
11280
|
className: cn(
|
|
@@ -10944,12 +11289,12 @@ var Settlement = ({
|
|
|
10944
11289
|
]
|
|
10945
11290
|
}
|
|
10946
11291
|
),
|
|
10947
|
-
isExpanded ? /* @__PURE__ */ (0,
|
|
11292
|
+
isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("dl", { className: "flex w-full flex-col items-start gap-1 px-6", children: venueKeys.map((venue) => {
|
|
10948
11293
|
var _a2;
|
|
10949
11294
|
const venueValue = (_a2 = difference.perVenue[venue]) != null ? _a2 : labels.trading.settlementValueUnavailable;
|
|
10950
11295
|
const venueLabel = resolveSettlementVenueLabel(venue, labels);
|
|
10951
|
-
return /* @__PURE__ */ (0,
|
|
10952
|
-
/* @__PURE__ */ (0,
|
|
11296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex w-full items-start gap-2", children: [
|
|
11297
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
10953
11298
|
VenueLogo,
|
|
10954
11299
|
{
|
|
10955
11300
|
venue,
|
|
@@ -10958,8 +11303,8 @@ var Settlement = ({
|
|
|
10958
11303
|
ariaLabel: venueLabel
|
|
10959
11304
|
}
|
|
10960
11305
|
),
|
|
10961
|
-
/* @__PURE__ */ (0,
|
|
10962
|
-
/* @__PURE__ */ (0,
|
|
11306
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("dt", { className: "w-[88px] shrink-0 text-agg-sm font-agg-normal leading-agg-5 text-agg-foreground", children: venueLabel }),
|
|
11307
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("dd", { className: "min-w-0 flex-1 text-agg-sm font-agg-normal leading-agg-5 text-agg-muted-foreground break-words [overflow-wrap:anywhere]", children: venueValue })
|
|
10963
11308
|
] }, venue);
|
|
10964
11309
|
}) }) : null
|
|
10965
11310
|
]
|
|
@@ -10968,9 +11313,9 @@ var Settlement = ({
|
|
|
10968
11313
|
);
|
|
10969
11314
|
}) })
|
|
10970
11315
|
] }) : null,
|
|
10971
|
-
hasVenueSettlementRules ? /* @__PURE__ */ (0,
|
|
10972
|
-
hasSettlementDifferences || hasStandaloneSettlementText ? /* @__PURE__ */ (0,
|
|
10973
|
-
/* @__PURE__ */ (0,
|
|
11316
|
+
hasVenueSettlementRules ? /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(import_jsx_runtime129.Fragment, { children: [
|
|
11317
|
+
hasSettlementDifferences || hasStandaloneSettlementText ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "h-px w-full bg-agg-separator" }) : null,
|
|
11318
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(SettlementVenueRules, { rules: venueRuleBlocks, labels })
|
|
10974
11319
|
] }) : null
|
|
10975
11320
|
] })
|
|
10976
11321
|
]
|
|
@@ -10980,13 +11325,13 @@ var Settlement = ({
|
|
|
10980
11325
|
Settlement.displayName = "Settlement";
|
|
10981
11326
|
|
|
10982
11327
|
// src/events/item-details/settlement-summary.tsx
|
|
10983
|
-
var
|
|
11328
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
10984
11329
|
var SettlementSummary = ({
|
|
10985
11330
|
settlementDiff,
|
|
10986
11331
|
settlementSectionId = SETTLEMENT_SECTION_ID,
|
|
10987
11332
|
className
|
|
10988
11333
|
}) => {
|
|
10989
|
-
const labels = (0,
|
|
11334
|
+
const labels = (0, import_hooks42.useLabels)();
|
|
10990
11335
|
const settlementDifferences = (0, import_react15.useMemo)(
|
|
10991
11336
|
() => prepareSettlementDifferences(settlementDiff == null ? void 0 : settlementDiff.differences),
|
|
10992
11337
|
[settlementDiff == null ? void 0 : settlementDiff.differences]
|
|
@@ -11000,7 +11345,7 @@ var SettlementSummary = ({
|
|
|
11000
11345
|
if (!target) return;
|
|
11001
11346
|
target.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
11002
11347
|
};
|
|
11003
|
-
const actionButton = /* @__PURE__ */ (0,
|
|
11348
|
+
const actionButton = /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
11004
11349
|
"button",
|
|
11005
11350
|
{
|
|
11006
11351
|
type: "button",
|
|
@@ -11013,8 +11358,8 @@ var SettlementSummary = ({
|
|
|
11013
11358
|
"aria-controls": settlementSectionId,
|
|
11014
11359
|
onClick: handleReadFullDetails,
|
|
11015
11360
|
children: [
|
|
11016
|
-
/* @__PURE__ */ (0,
|
|
11017
|
-
/* @__PURE__ */ (0,
|
|
11361
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { children: labels.settlementSummary.readFullDetails }),
|
|
11362
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
11018
11363
|
"i",
|
|
11019
11364
|
{
|
|
11020
11365
|
className: "fi fi-rr-arrow-small-down size-3.5!",
|
|
@@ -11027,7 +11372,7 @@ var SettlementSummary = ({
|
|
|
11027
11372
|
);
|
|
11028
11373
|
const visibleDifferences = settlementDifferences.slice(0, 2);
|
|
11029
11374
|
const hiddenDifferenceCount = settlementDifferences.length - visibleDifferences.length;
|
|
11030
|
-
return /* @__PURE__ */ (0,
|
|
11375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
11031
11376
|
"div",
|
|
11032
11377
|
{
|
|
11033
11378
|
className: cn(
|
|
@@ -11035,18 +11380,18 @@ var SettlementSummary = ({
|
|
|
11035
11380
|
className
|
|
11036
11381
|
),
|
|
11037
11382
|
children: [
|
|
11038
|
-
/* @__PURE__ */ (0,
|
|
11039
|
-
/* @__PURE__ */ (0,
|
|
11040
|
-
/* @__PURE__ */ (0,
|
|
11041
|
-
/* @__PURE__ */ (0,
|
|
11383
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex min-w-[240px] flex-1 flex-wrap items-center gap-x-5 gap-y-3", children: [
|
|
11384
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "agg-settlement-summary-heading flex shrink-0 items-center gap-2", children: [
|
|
11385
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("p", { className: "text-agg-sm font-agg-normal leading-agg-5 text-agg-foreground", children: labels.settlementSummary.title }),
|
|
11386
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "flex size-4 shrink-0 items-center justify-center rounded-agg-full bg-agg-primary text-[10px] font-agg-bold leading-[14px] text-agg-on-primary", children: settlementDifferences.length })
|
|
11042
11387
|
] }),
|
|
11043
|
-
/* @__PURE__ */ (0,
|
|
11044
|
-
visibleDifferences.map((difference) => /* @__PURE__ */ (0,
|
|
11388
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "agg-settlement-summary-pills flex min-w-[240px] flex-1 flex-wrap items-center gap-2", children: [
|
|
11389
|
+
visibleDifferences.map((difference) => /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
11045
11390
|
"span",
|
|
11046
11391
|
{
|
|
11047
11392
|
className: "flex h-6 max-w-full shrink-0 items-center gap-2 rounded-agg-full bg-agg-secondary-hover px-3 py-1 text-agg-xs font-agg-normal leading-agg-4 text-agg-foreground sm:max-w-[220px]",
|
|
11048
11393
|
children: [
|
|
11049
|
-
/* @__PURE__ */ (0,
|
|
11394
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
11050
11395
|
"i",
|
|
11051
11396
|
{
|
|
11052
11397
|
className: cn(
|
|
@@ -11057,12 +11402,12 @@ var SettlementSummary = ({
|
|
|
11057
11402
|
"aria-hidden": "true"
|
|
11058
11403
|
}
|
|
11059
11404
|
),
|
|
11060
|
-
/* @__PURE__ */ (0,
|
|
11405
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "min-w-0 truncate", children: difference.title })
|
|
11061
11406
|
]
|
|
11062
11407
|
},
|
|
11063
11408
|
difference.canonicalKey
|
|
11064
11409
|
)),
|
|
11065
|
-
hiddenDifferenceCount > 0 ? /* @__PURE__ */ (0,
|
|
11410
|
+
hiddenDifferenceCount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("span", { className: "flex h-6 shrink-0 items-center rounded-agg-full bg-agg-secondary-hover px-3 py-1 text-agg-xs font-agg-normal leading-agg-4 text-agg-foreground", children: [
|
|
11066
11411
|
"+",
|
|
11067
11412
|
hiddenDifferenceCount
|
|
11068
11413
|
] }) : null
|
|
@@ -11076,7 +11421,7 @@ var SettlementSummary = ({
|
|
|
11076
11421
|
SettlementSummary.displayName = "SettlementSummary";
|
|
11077
11422
|
|
|
11078
11423
|
// src/events/item-details/index.tsx
|
|
11079
|
-
var
|
|
11424
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
11080
11425
|
var resolveEventDetailsSyncKey = (event) => {
|
|
11081
11426
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
11082
11427
|
const parts = [
|
|
@@ -11121,8 +11466,8 @@ var EventListItemDetailsLoadingState = ({
|
|
|
11121
11466
|
classNames,
|
|
11122
11467
|
ariaLabel
|
|
11123
11468
|
}) => {
|
|
11124
|
-
const labels = (0,
|
|
11125
|
-
return /* @__PURE__ */ (0,
|
|
11469
|
+
const labels = (0, import_hooks43.useLabels)();
|
|
11470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11126
11471
|
Skeleton,
|
|
11127
11472
|
{
|
|
11128
11473
|
view: "event-list-item-details",
|
|
@@ -11135,16 +11480,16 @@ var EventListItemDetailsUnavailableState = ({
|
|
|
11135
11480
|
classNames,
|
|
11136
11481
|
ariaLabel
|
|
11137
11482
|
}) => {
|
|
11138
|
-
const labels = (0,
|
|
11139
|
-
return /* @__PURE__ */ (0,
|
|
11483
|
+
const labels = (0, import_hooks43.useLabels)();
|
|
11484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11140
11485
|
Card,
|
|
11141
11486
|
{
|
|
11142
11487
|
className: cn(detailsBaseCardClassName, classNames == null ? void 0 : classNames.root),
|
|
11143
11488
|
role: "status",
|
|
11144
11489
|
"aria-label": ariaLabel != null ? ariaLabel : labels.eventItemDetails.unavailableAria,
|
|
11145
|
-
children: /* @__PURE__ */ (0,
|
|
11146
|
-
/* @__PURE__ */ (0,
|
|
11147
|
-
/* @__PURE__ */ (0,
|
|
11490
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: cn("flex flex-col gap-1", classNames == null ? void 0 : classNames.header), children: [
|
|
11491
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Typography, { variant: "body-large-strong", className: cn("truncate", classNames == null ? void 0 : classNames.title), children: labels.eventItemDetails.unavailableTitle }),
|
|
11492
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Typography, { variant: "body", className: "text-agg-muted-foreground", children: labels.eventItemDetails.unavailableDescription })
|
|
11148
11493
|
] })
|
|
11149
11494
|
}
|
|
11150
11495
|
);
|
|
@@ -11153,13 +11498,13 @@ var EventListItemDetailsNotFoundState = ({
|
|
|
11153
11498
|
classNames: _classNames,
|
|
11154
11499
|
ariaLabel: _ariaLabel
|
|
11155
11500
|
}) => {
|
|
11156
|
-
const labels = (0,
|
|
11157
|
-
return /* @__PURE__ */ (0,
|
|
11501
|
+
const labels = (0, import_hooks43.useLabels)();
|
|
11502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11158
11503
|
StateMessage,
|
|
11159
11504
|
{
|
|
11160
11505
|
title: labels.eventItemDetails.notFoundTitle,
|
|
11161
11506
|
description: labels.eventItemDetails.notFoundDescription,
|
|
11162
|
-
icon: /* @__PURE__ */ (0,
|
|
11507
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(SearchEmptyIcon, {}),
|
|
11163
11508
|
classNames: { root: "min-h-[280px] md:min-h-[320px]" }
|
|
11164
11509
|
}
|
|
11165
11510
|
);
|
|
@@ -11184,8 +11529,8 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11184
11529
|
onRangeOverrideChange
|
|
11185
11530
|
}) => {
|
|
11186
11531
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
11187
|
-
const labels = (0,
|
|
11188
|
-
const tradingContext = (0,
|
|
11532
|
+
const labels = (0, import_hooks43.useLabels)();
|
|
11533
|
+
const tradingContext = (0, import_hooks35.useEventTradingContext)();
|
|
11189
11534
|
const [selectedGraphVenue, setSelectedGraphVenue] = (0, import_react16.useState)(null);
|
|
11190
11535
|
const [chartOutcomeLabel, setChartOutcomeLabel] = (0, import_react16.useState)(
|
|
11191
11536
|
(_c = (_b = (_a = tradingContext == null ? void 0 : tradingContext.selectedOutcome) == null ? void 0 : _a.label) == null ? void 0 : _b.trim()) != null ? _c : null
|
|
@@ -11202,10 +11547,10 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11202
11547
|
chart: { selectedChartTimeRange },
|
|
11203
11548
|
formatting: { formatPercent, formatPrice },
|
|
11204
11549
|
general: { theme }
|
|
11205
|
-
} = (0,
|
|
11550
|
+
} = (0, import_hooks43.useSdkUiConfig)();
|
|
11206
11551
|
const isDarkTheme = theme === "dark";
|
|
11207
11552
|
const effectiveChartTimeRange = rangeOverride != null ? rangeOverride : selectedChartTimeRange;
|
|
11208
|
-
const rollingWindow = (0,
|
|
11553
|
+
const rollingWindow = (0, import_hooks43.useRollingChartWindow)({ range: effectiveChartTimeRange });
|
|
11209
11554
|
const availableMarkets = (0, import_react16.useMemo)(() => {
|
|
11210
11555
|
var _a2, _b2, _c2, _d2;
|
|
11211
11556
|
if (venueMarkets.length === 0) return [];
|
|
@@ -11236,7 +11581,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11236
11581
|
isLoading: isScopedMarketChartLoading,
|
|
11237
11582
|
error: scopedMarketChartError,
|
|
11238
11583
|
refetch: refetchScopedMarketChart
|
|
11239
|
-
} = (0,
|
|
11584
|
+
} = (0, import_hooks43.useMarketChart)({
|
|
11240
11585
|
marketId: chartPrimaryOutcomeId,
|
|
11241
11586
|
venueMarketIds: availableVenueOutcomes.map((item) => item.outcome.id),
|
|
11242
11587
|
interval: rollingWindow.interval,
|
|
@@ -11293,7 +11638,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11293
11638
|
const resolvedOutcomePriceByMarketId = (0, import_react16.useMemo)(() => {
|
|
11294
11639
|
const map = /* @__PURE__ */ new Map();
|
|
11295
11640
|
for (const market of availableMarkets) {
|
|
11296
|
-
const marketTradingState = (0,
|
|
11641
|
+
const marketTradingState = (0, import_hooks43.resolveMarketTradingState)(market);
|
|
11297
11642
|
if (marketTradingState.kind !== "resolved") continue;
|
|
11298
11643
|
const outcomePriceMap = resolveResolvedOutcomePriceMap(market.venueMarketOutcomes);
|
|
11299
11644
|
if (outcomePriceMap) {
|
|
@@ -11353,18 +11698,18 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11353
11698
|
void refetchScopedMarketChart();
|
|
11354
11699
|
};
|
|
11355
11700
|
if (scopedMarketChartError) {
|
|
11356
|
-
return /* @__PURE__ */ (0,
|
|
11701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: cn("agg-chart-region w-full", classNames == null ? void 0 : classNames.chart), children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11357
11702
|
StateMessage,
|
|
11358
11703
|
{
|
|
11359
11704
|
title: labels.eventItemDetails.chartUnavailableTitle,
|
|
11360
11705
|
description: labels.eventItemDetails.chartUnavailableDescription,
|
|
11361
|
-
icon: /* @__PURE__ */ (0,
|
|
11706
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(WarningIcon, {}),
|
|
11362
11707
|
onAction: handleRetryMarketChart,
|
|
11363
11708
|
classNames: { root: "min-h-[300px] px-5 py-10 md:px-10" }
|
|
11364
11709
|
}
|
|
11365
11710
|
) });
|
|
11366
11711
|
}
|
|
11367
|
-
return /* @__PURE__ */ (0,
|
|
11712
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11368
11713
|
LineChart,
|
|
11369
11714
|
{
|
|
11370
11715
|
classNames: { root: cn("agg-chart-region", classNames == null ? void 0 : classNames.chart) },
|
|
@@ -11377,7 +11722,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11377
11722
|
showSeriesControls: selectedMarketOutcomes.length > 0,
|
|
11378
11723
|
renderSeriesControls: ({ handleSeriesChange }) => {
|
|
11379
11724
|
var _a2, _b2, _c2, _d2;
|
|
11380
|
-
return /* @__PURE__ */ (0,
|
|
11725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
11381
11726
|
"div",
|
|
11382
11727
|
{
|
|
11383
11728
|
className: cn(
|
|
@@ -11388,7 +11733,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11388
11733
|
classNames == null ? void 0 : classNames.summary
|
|
11389
11734
|
),
|
|
11390
11735
|
children: [
|
|
11391
|
-
/* @__PURE__ */ (0,
|
|
11736
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11392
11737
|
"div",
|
|
11393
11738
|
{
|
|
11394
11739
|
className: cn(
|
|
@@ -11402,7 +11747,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11402
11747
|
const text = formatMarketProbabilityPercent(percentage, formatPercent);
|
|
11403
11748
|
const seriesId = `${item.venue}-chart`;
|
|
11404
11749
|
const isActiveVenue = activeGraphVenue === item.venue;
|
|
11405
|
-
return /* @__PURE__ */ (0,
|
|
11750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11406
11751
|
"button",
|
|
11407
11752
|
{
|
|
11408
11753
|
type: "button",
|
|
@@ -11421,12 +11766,12 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11421
11766
|
setSelectedGraphVenue(nextSelectedGraphVenue);
|
|
11422
11767
|
handleSeriesChange(seriesId);
|
|
11423
11768
|
},
|
|
11424
|
-
children: /* @__PURE__ */ (0,
|
|
11769
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11425
11770
|
Badge,
|
|
11426
11771
|
{
|
|
11427
11772
|
text,
|
|
11428
11773
|
size: "large",
|
|
11429
|
-
prefix: /* @__PURE__ */ (0,
|
|
11774
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11430
11775
|
VenueLogo,
|
|
11431
11776
|
{
|
|
11432
11777
|
venue: item.market.venue,
|
|
@@ -11448,7 +11793,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11448
11793
|
})
|
|
11449
11794
|
}
|
|
11450
11795
|
),
|
|
11451
|
-
/* @__PURE__ */ (0,
|
|
11796
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11452
11797
|
SwitchButton,
|
|
11453
11798
|
{
|
|
11454
11799
|
ariaLabel: labels.eventItemDetails.outcomeSelectorAria,
|
|
@@ -11499,19 +11844,21 @@ var EventListItemDetailsContent = ({
|
|
|
11499
11844
|
ariaLabel,
|
|
11500
11845
|
defaultTimeRange,
|
|
11501
11846
|
onClick,
|
|
11502
|
-
midpointsResult
|
|
11847
|
+
midpointsResult,
|
|
11848
|
+
recurringMarkets,
|
|
11849
|
+
sportsLiveState
|
|
11503
11850
|
}) => {
|
|
11504
|
-
var _a, _b, _c, _d;
|
|
11851
|
+
var _a, _b, _c, _d, _e, _f;
|
|
11505
11852
|
const [selectedChartType, setSelectedChartType] = (0, import_react16.useState)("line");
|
|
11506
11853
|
const lastAppliedEventSyncKeyRef = (0, import_react16.useRef)(null);
|
|
11507
11854
|
const lastAppliedDefaultRef = (0, import_react16.useRef)(null);
|
|
11508
11855
|
const [chartRangeOverride, setChartRangeOverride] = (0, import_react16.useState)(null);
|
|
11509
|
-
const config = (0,
|
|
11510
|
-
const labels = (0,
|
|
11511
|
-
const tradingContext = (0,
|
|
11856
|
+
const config = (0, import_hooks43.useSdkUiConfig)();
|
|
11857
|
+
const labels = (0, import_hooks43.useLabels)();
|
|
11858
|
+
const tradingContext = (0, import_hooks35.useEventTradingContext)();
|
|
11512
11859
|
const eventSyncKey = (0, import_react16.useMemo)(() => resolveEventDetailsSyncKey(event), [event]);
|
|
11513
11860
|
const resolvedEventTradingState = (0, import_react16.useMemo)(() => {
|
|
11514
|
-
return eventTradingState != null ? eventTradingState : (0,
|
|
11861
|
+
return eventTradingState != null ? eventTradingState : (0, import_hooks43.resolveEventTradingState)(event);
|
|
11515
11862
|
}, [event, eventTradingState]);
|
|
11516
11863
|
const scopedSelectedMarket = (tradingContext == null ? void 0 : tradingContext.selectedEventId) === event.id ? (_a = tradingContext.selectedMarket) != null ? _a : resolvedEventTradingState.primaryMarket : resolvedEventTradingState.primaryMarket;
|
|
11517
11864
|
const venueMarkets = (0, import_react16.useMemo)(
|
|
@@ -11522,12 +11869,12 @@ var EventListItemDetailsContent = ({
|
|
|
11522
11869
|
return normalizeVenueMarketCluster(venueMarkets);
|
|
11523
11870
|
}, [venueMarkets]);
|
|
11524
11871
|
const scopedSelectedMarketId = (tradingContext == null ? void 0 : tradingContext.selectedEventId) === event.id ? tradingContext.selectedMarketId : null;
|
|
11525
|
-
(0,
|
|
11872
|
+
(0, import_hooks43.useEventOrderbookData)(
|
|
11526
11873
|
resolvedEventTradingState.isTradingDisabled ? [] : resolvedEventTradingState.displayMarkets,
|
|
11527
11874
|
scopedSelectedMarketId
|
|
11528
11875
|
);
|
|
11529
|
-
const wsLivePrices = (0,
|
|
11530
|
-
const wsBestPrices = (0,
|
|
11876
|
+
const wsLivePrices = (0, import_hooks43.useLiveOutcomePrices)(eventDetailVenueMarkets);
|
|
11877
|
+
const wsBestPrices = (0, import_hooks43.useLiveBestPrices)(eventDetailVenueMarkets);
|
|
11531
11878
|
const resolvedMidpointsResult = midpointsResult != null ? midpointsResult : {
|
|
11532
11879
|
prices: /* @__PURE__ */ new Map(),
|
|
11533
11880
|
bestMidpointsByOutcomeId: /* @__PURE__ */ new Map(),
|
|
@@ -11542,7 +11889,7 @@ var EventListItemDetailsContent = ({
|
|
|
11542
11889
|
const bestMidpoint = resolvedMidpointsResult.bestMidpoint;
|
|
11543
11890
|
const restBestPrices = resolvedMidpointsResult.bestPrices;
|
|
11544
11891
|
const bestPrices = (0, import_react16.useMemo)(
|
|
11545
|
-
() => (0,
|
|
11892
|
+
() => (0, import_hooks43.mergeBestPricesPreferringLive)(restBestPrices, wsBestPrices),
|
|
11546
11893
|
[restBestPrices, wsBestPrices]
|
|
11547
11894
|
);
|
|
11548
11895
|
const livePrices = (0, import_react16.useMemo)(() => {
|
|
@@ -11622,7 +11969,9 @@ var EventListItemDetailsContent = ({
|
|
|
11622
11969
|
structureType: event.structureType,
|
|
11623
11970
|
gameStartTime: event.gameStartTime,
|
|
11624
11971
|
endDate: event.endDate,
|
|
11625
|
-
venueMarkets: event.venueMarkets
|
|
11972
|
+
venueMarkets: event.venueMarkets,
|
|
11973
|
+
recurringCryptoWindowStart: recurringMarkets ? null : void 0,
|
|
11974
|
+
recurringCryptoDuration: recurringMarkets == null ? void 0 : recurringMarkets.duration
|
|
11626
11975
|
});
|
|
11627
11976
|
}, [
|
|
11628
11977
|
event.categories,
|
|
@@ -11630,18 +11979,19 @@ var EventListItemDetailsContent = ({
|
|
|
11630
11979
|
event.gameStartTime,
|
|
11631
11980
|
event.structureType,
|
|
11632
11981
|
event.title,
|
|
11633
|
-
event.venueMarkets
|
|
11982
|
+
event.venueMarkets,
|
|
11983
|
+
recurringMarkets
|
|
11634
11984
|
]);
|
|
11635
|
-
return /* @__PURE__ */ (0,
|
|
11985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
11636
11986
|
Card,
|
|
11637
11987
|
{
|
|
11638
11988
|
className: cn("group/agg-event-details", detailsBaseCardClassName, classNames == null ? void 0 : classNames.root),
|
|
11639
|
-
"aria-label": ariaLabel != null ? ariaLabel : [resolvedTitle.title, resolvedTitle.timestampLabel].filter(Boolean).join(" "),
|
|
11989
|
+
"aria-label": ariaLabel != null ? ariaLabel : [resolvedTitle.title, (_c = recurringMarkets == null ? void 0 : recurringMarkets.windowLabel) != null ? _c : resolvedTitle.timestampLabel].filter(Boolean).join(" "),
|
|
11640
11990
|
onClick: () => {
|
|
11641
11991
|
onClick == null ? void 0 : onClick(event);
|
|
11642
11992
|
},
|
|
11643
11993
|
children: [
|
|
11644
|
-
/* @__PURE__ */ (0,
|
|
11994
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
11645
11995
|
"div",
|
|
11646
11996
|
{
|
|
11647
11997
|
className: cn(
|
|
@@ -11652,44 +12002,109 @@ var EventListItemDetailsContent = ({
|
|
|
11652
12002
|
classNames == null ? void 0 : classNames.header
|
|
11653
12003
|
),
|
|
11654
12004
|
children: [
|
|
11655
|
-
/* @__PURE__ */ (0,
|
|
12005
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11656
12006
|
RemoteImage,
|
|
11657
12007
|
{
|
|
11658
|
-
src: (0,
|
|
12008
|
+
src: (0, import_hooks43.optimizedImageUrl)(event.image, 60),
|
|
11659
12009
|
alt: "",
|
|
11660
12010
|
className: "agg-event-image size-10 rounded-agg-lg object-cover md:size-[60px]"
|
|
11661
12011
|
}
|
|
11662
12012
|
),
|
|
11663
|
-
/* @__PURE__ */ (0,
|
|
11664
|
-
/* @__PURE__ */ (0,
|
|
11665
|
-
|
|
11666
|
-
|
|
11667
|
-
|
|
11668
|
-
|
|
11669
|
-
|
|
11670
|
-
|
|
11671
|
-
|
|
11672
|
-
|
|
11673
|
-
|
|
12013
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: cn("flex min-w-0 flex-1 flex-col", recurringMarkets ? "gap-3" : "gap-2"), children: [
|
|
12014
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
12015
|
+
"div",
|
|
12016
|
+
{
|
|
12017
|
+
className: cn(
|
|
12018
|
+
"min-w-0",
|
|
12019
|
+
recurringMarkets ? "flex flex-col gap-1 md:flex-row md:items-baseline md:justify-between" : null
|
|
12020
|
+
),
|
|
12021
|
+
children: [
|
|
12022
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
12023
|
+
Typography,
|
|
12024
|
+
{
|
|
12025
|
+
variant: "body-strong",
|
|
12026
|
+
className: cn(
|
|
12027
|
+
"agg-event-title",
|
|
12028
|
+
"min-w-0 text-agg-base font-agg-bold! leading-agg-6 md:text-agg-2xl md:leading-agg-8",
|
|
12029
|
+
resolvedTitle.timestampLabel && !recurringMarkets ? "truncate whitespace-nowrap" : "truncate text-wrap wrap-break-word line-clamp-2",
|
|
12030
|
+
classNames == null ? void 0 : classNames.title
|
|
12031
|
+
),
|
|
12032
|
+
children: resolvedTitle.title
|
|
12033
|
+
}
|
|
11674
12034
|
),
|
|
11675
|
-
|
|
12035
|
+
(recurringMarkets == null ? void 0 : recurringMarkets.windowLabel) ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
12036
|
+
Typography,
|
|
12037
|
+
{
|
|
12038
|
+
variant: "body",
|
|
12039
|
+
className: "agg-event-timestamp min-w-0 shrink-0 truncate text-agg-sm leading-agg-5 text-agg-muted-foreground md:text-agg-base md:leading-agg-6",
|
|
12040
|
+
children: recurringMarkets.windowLabel
|
|
12041
|
+
}
|
|
12042
|
+
) : resolvedTitle.timestampLabel ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
12043
|
+
Typography,
|
|
12044
|
+
{
|
|
12045
|
+
variant: "body",
|
|
12046
|
+
className: "agg-event-timestamp mt-0.5 min-w-0 truncate text-agg-sm leading-agg-5 text-agg-muted-foreground",
|
|
12047
|
+
children: resolvedTitle.timestampLabel
|
|
12048
|
+
}
|
|
12049
|
+
) : null
|
|
12050
|
+
]
|
|
12051
|
+
}
|
|
12052
|
+
),
|
|
12053
|
+
recurringMarkets ? /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "flex min-w-0 flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
|
|
12054
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
12055
|
+
EventListItemDetailsMarketSelector,
|
|
12056
|
+
{
|
|
12057
|
+
className: cn("min-w-0 flex-1", classNames == null ? void 0 : classNames.headerPills),
|
|
12058
|
+
options: recurringMarkets.visibleOptions,
|
|
12059
|
+
browseOptions: recurringMarkets.browseOptions,
|
|
12060
|
+
selectedValue: recurringMarkets.selectedValue,
|
|
12061
|
+
liveValue: recurringMarkets.liveValue,
|
|
12062
|
+
alwaysShowMore: true,
|
|
12063
|
+
onChange: recurringMarkets.onSelect
|
|
11676
12064
|
}
|
|
11677
12065
|
),
|
|
11678
|
-
|
|
11679
|
-
|
|
12066
|
+
recurringMarkets.isResolving ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
12067
|
+
Button,
|
|
12068
|
+
{
|
|
12069
|
+
variant: "secondary",
|
|
12070
|
+
size: "small",
|
|
12071
|
+
disabled: !recurringMarkets.canGoToLive,
|
|
12072
|
+
"aria-label": recurringMarkets.canGoToLive ? labels.eventMarketPage.goToLive : labels.eventMarketPage.liveMarketUnavailable,
|
|
12073
|
+
className: "h-8 shrink-0",
|
|
12074
|
+
onClick: (eventToHandle) => {
|
|
12075
|
+
eventToHandle.preventDefault();
|
|
12076
|
+
eventToHandle.stopPropagation();
|
|
12077
|
+
recurringMarkets.onGoToLive();
|
|
12078
|
+
},
|
|
12079
|
+
children: labels.eventMarketPage.goToLive
|
|
12080
|
+
}
|
|
12081
|
+
) : recurringMarkets.countdownLabel ? /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
12082
|
+
"div",
|
|
11680
12083
|
{
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
|
|
12084
|
+
role: "timer",
|
|
12085
|
+
"aria-live": "off",
|
|
12086
|
+
"aria-label": (_d = recurringMarkets.countdownAriaLabel) != null ? _d : void 0,
|
|
12087
|
+
className: "flex shrink-0 items-center gap-1.5 text-agg-foreground",
|
|
12088
|
+
children: [
|
|
12089
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
12090
|
+
Icon,
|
|
12091
|
+
{
|
|
12092
|
+
name: "hourglass-start",
|
|
12093
|
+
size: "small",
|
|
12094
|
+
className: "size-3.5",
|
|
12095
|
+
"aria-hidden": "true"
|
|
12096
|
+
}
|
|
12097
|
+
),
|
|
12098
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Typography, { variant: "body-strong", className: "text-agg-base leading-agg-6", children: recurringMarkets.countdownLabel })
|
|
12099
|
+
]
|
|
11684
12100
|
}
|
|
11685
12101
|
) : null
|
|
11686
|
-
] }),
|
|
11687
|
-
venueMarkets.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
12102
|
+
] }) : venueMarkets.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11688
12103
|
EventListItemDetailsMarketSelector,
|
|
11689
12104
|
{
|
|
11690
12105
|
className: classNames == null ? void 0 : classNames.headerPills,
|
|
11691
12106
|
options: marketOptions,
|
|
11692
|
-
selectedValue: (
|
|
12107
|
+
selectedValue: (_e = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.id) != null ? _e : "",
|
|
11693
12108
|
onChange: (marketId) => {
|
|
11694
12109
|
tradingContext == null ? void 0 : tradingContext.selectMarket(marketId);
|
|
11695
12110
|
}
|
|
@@ -11699,7 +12114,8 @@ var EventListItemDetailsContent = ({
|
|
|
11699
12114
|
]
|
|
11700
12115
|
}
|
|
11701
12116
|
),
|
|
11702
|
-
|
|
12117
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(SportsLiveScore, { state: sportsLiveState, className: classNames == null ? void 0 : classNames.sportsLive }),
|
|
12118
|
+
detailsStats && detailsStats.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11703
12119
|
"div",
|
|
11704
12120
|
{
|
|
11705
12121
|
className: cn(
|
|
@@ -11708,14 +12124,14 @@ var EventListItemDetailsContent = ({
|
|
|
11708
12124
|
),
|
|
11709
12125
|
children: detailsStats.map((statItem) => {
|
|
11710
12126
|
const deltaClassName = statItem.deltaTone === "positive" ? "text-agg-success!" : statItem.deltaTone === "negative" ? "text-agg-error!" : "text-agg-muted-foreground";
|
|
11711
|
-
return /* @__PURE__ */ (0,
|
|
12127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
11712
12128
|
"div",
|
|
11713
12129
|
{
|
|
11714
12130
|
className: "agg-event-stat flex flex-col gap-1",
|
|
11715
12131
|
children: [
|
|
11716
|
-
/* @__PURE__ */ (0,
|
|
11717
|
-
/* @__PURE__ */ (0,
|
|
11718
|
-
/* @__PURE__ */ (0,
|
|
12132
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Typography, { variant: "caption-caps", className: "text-agg-muted-foreground", children: statItem.label }),
|
|
12133
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "flex items-baseline gap-1", children: [
|
|
12134
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11719
12135
|
Typography,
|
|
11720
12136
|
{
|
|
11721
12137
|
variant: "body",
|
|
@@ -11723,7 +12139,7 @@ var EventListItemDetailsContent = ({
|
|
|
11723
12139
|
children: statItem.value
|
|
11724
12140
|
}
|
|
11725
12141
|
),
|
|
11726
|
-
statItem.delta ? /* @__PURE__ */ (0,
|
|
12142
|
+
statItem.delta ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Typography, { variant: "label", className: cn(deltaClassName), children: statItem.delta }) : null
|
|
11727
12143
|
] })
|
|
11728
12144
|
]
|
|
11729
12145
|
},
|
|
@@ -11732,15 +12148,15 @@ var EventListItemDetailsContent = ({
|
|
|
11732
12148
|
})
|
|
11733
12149
|
}
|
|
11734
12150
|
) : null,
|
|
11735
|
-
/* @__PURE__ */ (0,
|
|
11736
|
-
/* @__PURE__ */ (0,
|
|
12151
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: cn("agg-event-details-chart", "flex flex-col gap-2"), children: [
|
|
12152
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11737
12153
|
EventListItemDetailsGraphSection,
|
|
11738
12154
|
{
|
|
11739
12155
|
classNames,
|
|
11740
12156
|
selectedChartType,
|
|
11741
12157
|
venueInfo,
|
|
11742
12158
|
venueMarkets,
|
|
11743
|
-
selectedMarketId: (
|
|
12159
|
+
selectedMarketId: (_f = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.id) != null ? _f : null,
|
|
11744
12160
|
livePrices,
|
|
11745
12161
|
restMidpoints,
|
|
11746
12162
|
bestMidpoint,
|
|
@@ -11750,7 +12166,7 @@ var EventListItemDetailsContent = ({
|
|
|
11750
12166
|
onRangeOverrideChange: setChartRangeOverride
|
|
11751
12167
|
}
|
|
11752
12168
|
),
|
|
11753
|
-
/* @__PURE__ */ (0,
|
|
12169
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
11754
12170
|
"div",
|
|
11755
12171
|
{
|
|
11756
12172
|
className: cn(
|
|
@@ -11758,8 +12174,8 @@ var EventListItemDetailsContent = ({
|
|
|
11758
12174
|
classNames == null ? void 0 : classNames.footer
|
|
11759
12175
|
),
|
|
11760
12176
|
children: [
|
|
11761
|
-
/* @__PURE__ */ (0,
|
|
11762
|
-
/* @__PURE__ */ (0,
|
|
12177
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Typography, { variant: "label", className: "agg-chart-volume text-agg-muted-foreground", children: volumeLabel || "-" }),
|
|
12178
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
11763
12179
|
"div",
|
|
11764
12180
|
{
|
|
11765
12181
|
className: cn(
|
|
@@ -11767,7 +12183,7 @@ var EventListItemDetailsContent = ({
|
|
|
11767
12183
|
classNames == null ? void 0 : classNames.timeRange
|
|
11768
12184
|
),
|
|
11769
12185
|
children: [
|
|
11770
|
-
/* @__PURE__ */ (0,
|
|
12186
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11771
12187
|
ChartTypeSwitch,
|
|
11772
12188
|
{
|
|
11773
12189
|
className: "agg-chart-type-switch",
|
|
@@ -11775,11 +12191,11 @@ var EventListItemDetailsContent = ({
|
|
|
11775
12191
|
onValueChange: setSelectedChartType
|
|
11776
12192
|
}
|
|
11777
12193
|
),
|
|
11778
|
-
/* @__PURE__ */ (0,
|
|
11779
|
-
|
|
12194
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { "aria-hidden": "true", className: "hidden h-4 w-px bg-agg-separator md:block" }),
|
|
12195
|
+
import_hooks43.CHART_TIME_RANGES.map((timeRange) => {
|
|
11780
12196
|
const effectiveRange = chartRangeOverride != null ? chartRangeOverride : config.chart.selectedChartTimeRange;
|
|
11781
12197
|
const isActive = timeRange === effectiveRange;
|
|
11782
|
-
return /* @__PURE__ */ (0,
|
|
12198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11783
12199
|
Button,
|
|
11784
12200
|
{
|
|
11785
12201
|
size: "small",
|
|
@@ -11810,7 +12226,7 @@ var EventListItemDetailsContent = ({
|
|
|
11810
12226
|
}
|
|
11811
12227
|
)
|
|
11812
12228
|
] }),
|
|
11813
|
-
event.description || event.settlementDiff ? /* @__PURE__ */ (0,
|
|
12229
|
+
event.description || event.settlementDiff ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(SettlementSummary, { content: event.description, settlementDiff: event.settlementDiff }) : null
|
|
11814
12230
|
]
|
|
11815
12231
|
}
|
|
11816
12232
|
);
|
|
@@ -11827,12 +12243,12 @@ var EventListItemDetailsByEventId = (_a) => {
|
|
|
11827
12243
|
error,
|
|
11828
12244
|
isError,
|
|
11829
12245
|
isLoading
|
|
11830
|
-
} = (0,
|
|
12246
|
+
} = (0, import_hooks43.useVenueEvent)({
|
|
11831
12247
|
eventId: resolvedEventId,
|
|
11832
12248
|
enabled: !!resolvedEventId
|
|
11833
12249
|
});
|
|
11834
12250
|
if (!resolvedEventId) {
|
|
11835
|
-
return /* @__PURE__ */ (0,
|
|
12251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11836
12252
|
EventListItemDetailsUnavailableState,
|
|
11837
12253
|
{
|
|
11838
12254
|
classNames: rest.classNames,
|
|
@@ -11841,16 +12257,16 @@ var EventListItemDetailsByEventId = (_a) => {
|
|
|
11841
12257
|
);
|
|
11842
12258
|
}
|
|
11843
12259
|
if (isLoading) {
|
|
11844
|
-
return /* @__PURE__ */ (0,
|
|
12260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(EventListItemDetailsLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
11845
12261
|
}
|
|
11846
12262
|
if (isErrorWithStatus(error, 404)) {
|
|
11847
|
-
return /* @__PURE__ */ (0,
|
|
12263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(EventListItemDetailsNotFoundState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
11848
12264
|
}
|
|
11849
12265
|
if (!fetchedEvent && !isError) {
|
|
11850
|
-
return /* @__PURE__ */ (0,
|
|
12266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(EventListItemDetailsLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
11851
12267
|
}
|
|
11852
12268
|
if (!fetchedEvent) {
|
|
11853
|
-
return /* @__PURE__ */ (0,
|
|
12269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11854
12270
|
EventListItemDetailsUnavailableState,
|
|
11855
12271
|
{
|
|
11856
12272
|
classNames: rest.classNames,
|
|
@@ -11858,15 +12274,15 @@ var EventListItemDetailsByEventId = (_a) => {
|
|
|
11858
12274
|
}
|
|
11859
12275
|
);
|
|
11860
12276
|
}
|
|
11861
|
-
return /* @__PURE__ */ (0,
|
|
12277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(EventListItemDetailsContent, __spreadValues({ event: fetchedEvent }, rest));
|
|
11862
12278
|
};
|
|
11863
12279
|
var EventListItemDetails = (props) => {
|
|
11864
12280
|
if (props.isLoading) {
|
|
11865
|
-
return /* @__PURE__ */ (0,
|
|
12281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(EventListItemDetailsLoadingState, { classNames: props.classNames, ariaLabel: props.ariaLabel });
|
|
11866
12282
|
}
|
|
11867
12283
|
if ("event" in props && props.event) {
|
|
11868
12284
|
const _a = props, { event } = _a, rest = __objRest(_a, ["event"]);
|
|
11869
|
-
return /* @__PURE__ */ (0,
|
|
12285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(EventListItemDetailsContent, __spreadValues({ event }, rest));
|
|
11870
12286
|
}
|
|
11871
12287
|
if ("eventId" in props && typeof props.eventId === "string") {
|
|
11872
12288
|
const {
|
|
@@ -11889,9 +12305,9 @@ var EventListItemDetails = (props) => {
|
|
|
11889
12305
|
ariaLabel: ariaLabelOverride,
|
|
11890
12306
|
onClick
|
|
11891
12307
|
};
|
|
11892
|
-
return /* @__PURE__ */ (0,
|
|
12308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(EventListItemDetailsByEventId, __spreadValues({}, byEventIdProps));
|
|
11893
12309
|
}
|
|
11894
|
-
return /* @__PURE__ */ (0,
|
|
12310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11895
12311
|
EventListItemDetailsUnavailableState,
|
|
11896
12312
|
{
|
|
11897
12313
|
classNames: props.classNames,
|
|
@@ -11902,11 +12318,11 @@ var EventListItemDetails = (props) => {
|
|
|
11902
12318
|
EventListItemDetails.displayName = "EventListItemDetails";
|
|
11903
12319
|
|
|
11904
12320
|
// src/events/market-details/index.tsx
|
|
11905
|
-
var
|
|
12321
|
+
var import_hooks47 = require("@agg-build/hooks");
|
|
11906
12322
|
var import_react20 = require("react");
|
|
11907
12323
|
|
|
11908
12324
|
// src/events/orderbook/index.tsx
|
|
11909
|
-
var
|
|
12325
|
+
var import_hooks44 = require("@agg-build/hooks");
|
|
11910
12326
|
var import_react18 = require("react");
|
|
11911
12327
|
|
|
11912
12328
|
// src/events/orderbook/orderbook.constants.ts
|
|
@@ -12070,7 +12486,7 @@ var useCenterOrderbookSpread = ({
|
|
|
12070
12486
|
};
|
|
12071
12487
|
|
|
12072
12488
|
// src/events/orderbook/orderbook-with-states.tsx
|
|
12073
|
-
var
|
|
12489
|
+
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
12074
12490
|
var stateMessageMinHeight = "min-h-[248px] px-5 py-10 md:min-h-[272px]";
|
|
12075
12491
|
var OrderbookWithStates = (_a) => {
|
|
12076
12492
|
var _b = _a, {
|
|
@@ -12082,65 +12498,65 @@ var OrderbookWithStates = (_a) => {
|
|
|
12082
12498
|
]);
|
|
12083
12499
|
var _a2;
|
|
12084
12500
|
if (state.kind === "loading") {
|
|
12085
|
-
return /* @__PURE__ */ (0,
|
|
12501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: cn("agg-orderbook flex flex-col gap-5", wrapperClassName), children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(MarketDetailsOderbookSkeleton, {}) });
|
|
12086
12502
|
}
|
|
12087
12503
|
if (state.kind === "disabled") {
|
|
12088
|
-
return /* @__PURE__ */ (0,
|
|
12504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: cn("agg-orderbook flex flex-col gap-5", wrapperClassName), children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
12089
12505
|
StateMessage,
|
|
12090
12506
|
{
|
|
12091
12507
|
title: state.title,
|
|
12092
12508
|
description: state.description,
|
|
12093
|
-
icon: (_a2 = state.icon) != null ? _a2 : /* @__PURE__ */ (0,
|
|
12509
|
+
icon: (_a2 = state.icon) != null ? _a2 : /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(WarningIcon, {}),
|
|
12094
12510
|
classNames: { root: stateMessageMinHeight }
|
|
12095
12511
|
}
|
|
12096
12512
|
) });
|
|
12097
12513
|
}
|
|
12098
12514
|
if (state.kind === "error") {
|
|
12099
|
-
return /* @__PURE__ */ (0,
|
|
12515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: cn("agg-orderbook flex flex-col gap-5", wrapperClassName), children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
12100
12516
|
StateMessage,
|
|
12101
12517
|
{
|
|
12102
12518
|
title: state.title,
|
|
12103
12519
|
description: state.description,
|
|
12104
|
-
icon: /* @__PURE__ */ (0,
|
|
12520
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(WarningIcon, {}),
|
|
12105
12521
|
onAction: state.onRetry,
|
|
12106
12522
|
classNames: { root: stateMessageMinHeight }
|
|
12107
12523
|
}
|
|
12108
12524
|
) });
|
|
12109
12525
|
}
|
|
12110
12526
|
if (state.kind === "resolved") {
|
|
12111
|
-
return /* @__PURE__ */ (0,
|
|
12527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: cn("agg-orderbook flex flex-col gap-5", wrapperClassName), children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
12112
12528
|
StateMessage,
|
|
12113
12529
|
{
|
|
12114
12530
|
title: state.title,
|
|
12115
12531
|
description: state.description,
|
|
12116
|
-
icon: /* @__PURE__ */ (0,
|
|
12532
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(WarningIcon, {}),
|
|
12117
12533
|
classNames: { root: stateMessageMinHeight }
|
|
12118
12534
|
}
|
|
12119
12535
|
) });
|
|
12120
12536
|
}
|
|
12121
12537
|
if (state.kind === "empty") {
|
|
12122
|
-
return /* @__PURE__ */ (0,
|
|
12538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: cn("agg-orderbook flex flex-col gap-5", wrapperClassName), children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
12123
12539
|
StateMessage,
|
|
12124
12540
|
{
|
|
12125
12541
|
title: state.title,
|
|
12126
12542
|
description: state.description,
|
|
12127
|
-
icon: /* @__PURE__ */ (0,
|
|
12543
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(SearchEmptyIcon, {}),
|
|
12128
12544
|
classNames: { root: stateMessageMinHeight }
|
|
12129
12545
|
}
|
|
12130
12546
|
) });
|
|
12131
12547
|
}
|
|
12132
|
-
return /* @__PURE__ */ (0,
|
|
12548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: cn("agg-orderbook flex flex-col gap-5", wrapperClassName), children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Orderbook, __spreadValues({}, orderbookProps)) });
|
|
12133
12549
|
};
|
|
12134
12550
|
OrderbookWithStates.displayName = "OrderbookWithStates";
|
|
12135
12551
|
|
|
12136
12552
|
// src/events/orderbook/index.tsx
|
|
12137
|
-
var
|
|
12553
|
+
var import_jsx_runtime133 = require("react/jsx-runtime");
|
|
12138
12554
|
var OrderbookVenueLogos = ({ venues }) => {
|
|
12139
|
-
const visible = (0,
|
|
12555
|
+
const visible = (0, import_hooks44.sortVenues)(venues).slice(0, orderbookMaxVisibleVenues);
|
|
12140
12556
|
const overflow = venues.length - visible.length;
|
|
12141
|
-
return /* @__PURE__ */ (0,
|
|
12142
|
-
visible.map((venue) => /* @__PURE__ */ (0,
|
|
12143
|
-
overflow > 0 ? /* @__PURE__ */ (0,
|
|
12557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "flex flex-row items-center justify-start gap-0.5 md:gap-1", children: [
|
|
12558
|
+
visible.map((venue) => /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(VenueLogo, { venue, size: "small" }, venue)),
|
|
12559
|
+
overflow > 0 ? /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("span", { className: "text-agg-xs font-agg-bold leading-agg-4 text-agg-muted-foreground", children: [
|
|
12144
12560
|
"+",
|
|
12145
12561
|
overflow
|
|
12146
12562
|
] }) : null
|
|
@@ -12167,8 +12583,8 @@ var OrderbookRow = ({
|
|
|
12167
12583
|
}).map(([venue]) => venue);
|
|
12168
12584
|
const venues = entry.row.venues && entry.row.venues.length > 0 ? entry.row.venues : venuesFromBreakdown.length > 0 ? venuesFromBreakdown : [entry.row.venue];
|
|
12169
12585
|
const barPercent = Math.max(2, Number((entry.unifiedBarScale * 100).toFixed(2)));
|
|
12170
|
-
return /* @__PURE__ */ (0,
|
|
12171
|
-
/* @__PURE__ */ (0,
|
|
12586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "agg-orderbook-row relative flex h-9 items-center gap-2.5 overflow-clip pl-5 pr-2.5 md:gap-10 md:pl-0 md:pr-5", children: [
|
|
12587
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
12172
12588
|
"div",
|
|
12173
12589
|
{
|
|
12174
12590
|
"aria-hidden": "true",
|
|
@@ -12180,8 +12596,8 @@ var OrderbookRow = ({
|
|
|
12180
12596
|
style: { width: `${barPercent}%` }
|
|
12181
12597
|
}
|
|
12182
12598
|
),
|
|
12183
|
-
/* @__PURE__ */ (0,
|
|
12184
|
-
/* @__PURE__ */ (0,
|
|
12599
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "hidden md:block md:relative min-w-0 flex-1 self-stretch", children: [
|
|
12600
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
12185
12601
|
"div",
|
|
12186
12602
|
{
|
|
12187
12603
|
"aria-hidden": "true",
|
|
@@ -12193,14 +12609,14 @@ var OrderbookRow = ({
|
|
|
12193
12609
|
style: { width: `${barPercent}%` }
|
|
12194
12610
|
}
|
|
12195
12611
|
),
|
|
12196
|
-
showBadge && badgeLabel ? /* @__PURE__ */ (0,
|
|
12612
|
+
showBadge && badgeLabel ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
12197
12613
|
"div",
|
|
12198
12614
|
{
|
|
12199
12615
|
className: cn(
|
|
12200
12616
|
"absolute flex left-5 top-1/2 -translate-y-1/2 rounded-[4px] border px-2 py-0.5",
|
|
12201
12617
|
badgeBorderClassName
|
|
12202
12618
|
),
|
|
12203
|
-
children: /* @__PURE__ */ (0,
|
|
12619
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
12204
12620
|
"span",
|
|
12205
12621
|
{
|
|
12206
12622
|
className: cn("text-[10px] font-bold uppercase leading-[14px]", badgeTextClassName),
|
|
@@ -12210,8 +12626,8 @@ var OrderbookRow = ({
|
|
|
12210
12626
|
}
|
|
12211
12627
|
) : null
|
|
12212
12628
|
] }),
|
|
12213
|
-
/* @__PURE__ */ (0,
|
|
12214
|
-
/* @__PURE__ */ (0,
|
|
12629
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "flex w-20 shrink-0 items-center justify-start gap-2 md:w-[120px]", children: [
|
|
12630
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
12215
12631
|
"span",
|
|
12216
12632
|
{
|
|
12217
12633
|
className: cn(
|
|
@@ -12222,10 +12638,10 @@ var OrderbookRow = ({
|
|
|
12222
12638
|
children: formatProbabilityCents(entry.row.price, formatPrice)
|
|
12223
12639
|
}
|
|
12224
12640
|
),
|
|
12225
|
-
/* @__PURE__ */ (0,
|
|
12641
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(OrderbookVenueLogos, { venues })
|
|
12226
12642
|
] }),
|
|
12227
|
-
/* @__PURE__ */ (0,
|
|
12228
|
-
/* @__PURE__ */ (0,
|
|
12643
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)("span", { className: "agg-orderbook-size w-20 shrink-0 truncate text-center text-agg-sm leading-agg-5 text-agg-foreground md:w-[120px]", children: formatNumber(entry.row.size) }),
|
|
12644
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)("span", { className: "agg-orderbook-total w-20 shrink-0 truncate text-center text-agg-sm leading-agg-5 text-agg-foreground md:w-[120px]", children: formatCurrency(entry.row.total) })
|
|
12229
12645
|
] });
|
|
12230
12646
|
};
|
|
12231
12647
|
var Orderbook = ({
|
|
@@ -12244,7 +12660,7 @@ var Orderbook = ({
|
|
|
12244
12660
|
const {
|
|
12245
12661
|
enableWebsocketsLogs,
|
|
12246
12662
|
formatting: { formatPrice }
|
|
12247
|
-
} = (0,
|
|
12663
|
+
} = (0, import_hooks44.useAggUiConfig)();
|
|
12248
12664
|
const labels = __spreadValues(__spreadValues({}, orderbookDefaultLabels), labelsProp);
|
|
12249
12665
|
const scrollContainerRef = (0, import_react18.useRef)(null);
|
|
12250
12666
|
const spreadRowRef = (0, import_react18.useRef)(null);
|
|
@@ -12285,15 +12701,15 @@ var Orderbook = ({
|
|
|
12285
12701
|
snapshotKey,
|
|
12286
12702
|
spreadEntry
|
|
12287
12703
|
]);
|
|
12288
|
-
return /* @__PURE__ */ (0,
|
|
12289
|
-
/* @__PURE__ */ (0,
|
|
12290
|
-
/* @__PURE__ */ (0,
|
|
12291
|
-
/* @__PURE__ */ (0,
|
|
12292
|
-
/* @__PURE__ */ (0,
|
|
12293
|
-
/* @__PURE__ */ (0,
|
|
12704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: cn("agg-orderbook-unified flex flex-col", className), children: [
|
|
12705
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "flex h-9 items-center gap-2.5 overflow-clip border-b border-agg-separator pl-5 pr-5 md:pl-0 md:gap-10", children: [
|
|
12706
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)("span", { className: "hidden md:flex min-w-0 flex-1 items-center gap-2 pl-5", children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("span", { className: "text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground", children: labels.tradeOutcome }) }),
|
|
12707
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)("span", { className: "w-20 shrink-0 text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground md:w-[120px]", children: labels.price }),
|
|
12708
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)("span", { className: "w-20 shrink-0 text-center text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground md:w-[120px]", children: labels.shares }),
|
|
12709
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)("span", { className: "w-20 shrink-0 text-center text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground md:w-[120px]", children: labels.total })
|
|
12294
12710
|
] }),
|
|
12295
|
-
/* @__PURE__ */ (0,
|
|
12296
|
-
/* @__PURE__ */ (0,
|
|
12711
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "relative", children: [
|
|
12712
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
|
|
12297
12713
|
"div",
|
|
12298
12714
|
{
|
|
12299
12715
|
ref: scrollContainerRef,
|
|
@@ -12303,7 +12719,7 @@ var Orderbook = ({
|
|
|
12303
12719
|
"aria-label": "Order book",
|
|
12304
12720
|
tabIndex: 0,
|
|
12305
12721
|
children: [
|
|
12306
|
-
askEntries.length > 0 ? /* @__PURE__ */ (0,
|
|
12722
|
+
askEntries.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { className: "agg-orderbook-asks flex flex-col", children: askEntries.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
12307
12723
|
OrderbookRow,
|
|
12308
12724
|
{
|
|
12309
12725
|
entry,
|
|
@@ -12316,7 +12732,7 @@ var Orderbook = ({
|
|
|
12316
12732
|
},
|
|
12317
12733
|
entry.row.id
|
|
12318
12734
|
)) }) : null,
|
|
12319
|
-
/* @__PURE__ */ (0,
|
|
12735
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
|
|
12320
12736
|
"div",
|
|
12321
12737
|
{
|
|
12322
12738
|
ref: spreadRowRef,
|
|
@@ -12324,7 +12740,7 @@ var Orderbook = ({
|
|
|
12324
12740
|
role: "separator",
|
|
12325
12741
|
"aria-label": `${labels.midPrice}: ${formatProbabilityCents((_b = spreadEntry == null ? void 0 : spreadEntry.midPrice) != null ? _b : null, formatPrice)}, ${labels.spread}: ${formatProbabilityCents((_c = spreadEntry == null ? void 0 : spreadEntry.spread) != null ? _c : null)}`,
|
|
12326
12742
|
children: [
|
|
12327
|
-
/* @__PURE__ */ (0,
|
|
12743
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
|
|
12328
12744
|
Typography,
|
|
12329
12745
|
{
|
|
12330
12746
|
variant: "label",
|
|
@@ -12336,7 +12752,7 @@ var Orderbook = ({
|
|
|
12336
12752
|
]
|
|
12337
12753
|
}
|
|
12338
12754
|
),
|
|
12339
|
-
/* @__PURE__ */ (0,
|
|
12755
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
|
|
12340
12756
|
Typography,
|
|
12341
12757
|
{
|
|
12342
12758
|
variant: "label",
|
|
@@ -12348,12 +12764,12 @@ var Orderbook = ({
|
|
|
12348
12764
|
]
|
|
12349
12765
|
}
|
|
12350
12766
|
),
|
|
12351
|
-
/* @__PURE__ */ (0,
|
|
12352
|
-
/* @__PURE__ */ (0,
|
|
12767
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { className: "hidden md:inline-flex w-20 shrink-0 md:w-[120px]" }),
|
|
12768
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { className: "hidden md:inline-flex w-20 shrink-0 md:w-[120px]" })
|
|
12353
12769
|
]
|
|
12354
12770
|
}
|
|
12355
12771
|
),
|
|
12356
|
-
bidEntries.length > 0 ? /* @__PURE__ */ (0,
|
|
12772
|
+
bidEntries.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { className: "agg-orderbook-bids flex flex-col", children: bidEntries.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
12357
12773
|
OrderbookRow,
|
|
12358
12774
|
{
|
|
12359
12775
|
entry,
|
|
@@ -12369,14 +12785,14 @@ var Orderbook = ({
|
|
|
12369
12785
|
]
|
|
12370
12786
|
}
|
|
12371
12787
|
),
|
|
12372
|
-
/* @__PURE__ */ (0,
|
|
12788
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
12373
12789
|
"button",
|
|
12374
12790
|
{
|
|
12375
12791
|
type: "button",
|
|
12376
12792
|
onClick: recenter,
|
|
12377
12793
|
className: "absolute bottom-3 left-5 z-10 flex size-8 cursor-pointer items-center justify-center rounded-lg border border-agg-separator bg-agg-secondary text-agg-muted-foreground transition-colors hover:text-agg-foreground",
|
|
12378
12794
|
"aria-label": "Re-center orderbook",
|
|
12379
|
-
children: /* @__PURE__ */ (0,
|
|
12795
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Icon, { name: "recenter", size: "small", className: "!size-4 text-current" })
|
|
12380
12796
|
}
|
|
12381
12797
|
)
|
|
12382
12798
|
] })
|
|
@@ -12536,8 +12952,8 @@ var resolveTradingStateBadgeClassName = (kind) => {
|
|
|
12536
12952
|
};
|
|
12537
12953
|
|
|
12538
12954
|
// src/events/market-details/market-details-outcome-button.tsx
|
|
12539
|
-
var
|
|
12540
|
-
var
|
|
12955
|
+
var import_hooks45 = require("@agg-build/hooks");
|
|
12956
|
+
var import_jsx_runtime134 = require("react/jsx-runtime");
|
|
12541
12957
|
var marketDetailsOutcomeButtonToneClasses = {
|
|
12542
12958
|
positive: {
|
|
12543
12959
|
activeSurface: "bg-agg-success/15",
|
|
@@ -12587,9 +13003,9 @@ var OutcomePriceContent = ({
|
|
|
12587
13003
|
value,
|
|
12588
13004
|
textClassName
|
|
12589
13005
|
}) => {
|
|
12590
|
-
const { formatPrice } = (0,
|
|
13006
|
+
const { formatPrice } = (0, import_hooks45.useAggUiConfig)().formatting;
|
|
12591
13007
|
if (isLoading) {
|
|
12592
|
-
return /* @__PURE__ */ (0,
|
|
13008
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12593
13009
|
"span",
|
|
12594
13010
|
{
|
|
12595
13011
|
"aria-hidden": "true",
|
|
@@ -12600,7 +13016,7 @@ var OutcomePriceContent = ({
|
|
|
12600
13016
|
}
|
|
12601
13017
|
);
|
|
12602
13018
|
}
|
|
12603
|
-
return /* @__PURE__ */ (0,
|
|
13019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12604
13020
|
Typography,
|
|
12605
13021
|
{
|
|
12606
13022
|
as: "span",
|
|
@@ -12628,7 +13044,7 @@ var MarketDetailsOutcomeButton = ({
|
|
|
12628
13044
|
});
|
|
12629
13045
|
const itemLabel = (_a = item.title) != null ? _a : item.label;
|
|
12630
13046
|
const isLineVariant = item.variant === "line";
|
|
12631
|
-
return /* @__PURE__ */ (0,
|
|
13047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12632
13048
|
"button",
|
|
12633
13049
|
{
|
|
12634
13050
|
type: "button",
|
|
@@ -12644,9 +13060,9 @@ var MarketDetailsOutcomeButton = ({
|
|
|
12644
13060
|
enforceFixedWidth ? "flex-none" : "flex-1 md:flex-auto"
|
|
12645
13061
|
),
|
|
12646
13062
|
onClick: () => onSelect(item.label),
|
|
12647
|
-
children: isLineVariant ? /* @__PURE__ */ (0,
|
|
12648
|
-
/* @__PURE__ */ (0,
|
|
12649
|
-
/* @__PURE__ */ (0,
|
|
13063
|
+
children: isLineVariant ? /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex min-w-0 max-w-full items-center justify-center gap-1.5 overflow-hidden", children: [
|
|
13064
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(VenueLogo, { venue: item.venue, size: "small" }),
|
|
13065
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12650
13066
|
Typography,
|
|
12651
13067
|
{
|
|
12652
13068
|
as: "span",
|
|
@@ -12655,7 +13071,7 @@ var MarketDetailsOutcomeButton = ({
|
|
|
12655
13071
|
children: itemLabel
|
|
12656
13072
|
}
|
|
12657
13073
|
),
|
|
12658
|
-
item.lineLabel ? /* @__PURE__ */ (0,
|
|
13074
|
+
item.lineLabel ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12659
13075
|
Typography,
|
|
12660
13076
|
{
|
|
12661
13077
|
as: "span",
|
|
@@ -12664,7 +13080,7 @@ var MarketDetailsOutcomeButton = ({
|
|
|
12664
13080
|
children: item.lineLabel
|
|
12665
13081
|
}
|
|
12666
13082
|
) : null,
|
|
12667
|
-
/* @__PURE__ */ (0,
|
|
13083
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12668
13084
|
OutcomePriceContent,
|
|
12669
13085
|
{
|
|
12670
13086
|
isLoading: item.isPriceLoading,
|
|
@@ -12673,9 +13089,9 @@ var MarketDetailsOutcomeButton = ({
|
|
|
12673
13089
|
textClassName: classNames.text
|
|
12674
13090
|
}
|
|
12675
13091
|
)
|
|
12676
|
-
] }) : /* @__PURE__ */ (0,
|
|
12677
|
-
/* @__PURE__ */ (0,
|
|
12678
|
-
/* @__PURE__ */ (0,
|
|
13092
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "inline-flex max-w-full items-center justify-center gap-1.5", children: [
|
|
13093
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(VenueLogo, { venue: item.venue, size: "small" }),
|
|
13094
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12679
13095
|
Typography,
|
|
12680
13096
|
{
|
|
12681
13097
|
as: "span",
|
|
@@ -12684,7 +13100,7 @@ var MarketDetailsOutcomeButton = ({
|
|
|
12684
13100
|
children: itemLabel
|
|
12685
13101
|
}
|
|
12686
13102
|
),
|
|
12687
|
-
/* @__PURE__ */ (0,
|
|
13103
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12688
13104
|
OutcomePriceContent,
|
|
12689
13105
|
{
|
|
12690
13106
|
isLoading: item.isPriceLoading,
|
|
@@ -12700,9 +13116,9 @@ var MarketDetailsOutcomeButton = ({
|
|
|
12700
13116
|
MarketDetailsOutcomeButton.displayName = "MarketDetailsOutcomeButton";
|
|
12701
13117
|
|
|
12702
13118
|
// src/events/market-details/market-details-graph-panel.tsx
|
|
12703
|
-
var
|
|
13119
|
+
var import_hooks46 = require("@agg-build/hooks");
|
|
12704
13120
|
var import_react19 = require("react");
|
|
12705
|
-
var
|
|
13121
|
+
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
12706
13122
|
var MarketDetailsGraphPanel = ({
|
|
12707
13123
|
venueMarkets,
|
|
12708
13124
|
selectedOutcomeLabel,
|
|
@@ -12717,13 +13133,13 @@ var MarketDetailsGraphPanel = ({
|
|
|
12717
13133
|
classNames
|
|
12718
13134
|
}) => {
|
|
12719
13135
|
var _a, _b, _c;
|
|
12720
|
-
const config = (0,
|
|
13136
|
+
const config = (0, import_hooks46.useSdkUiConfig)();
|
|
12721
13137
|
const {
|
|
12722
13138
|
formatting: { formatPercent, formatCompactCurrency, formatPrice },
|
|
12723
13139
|
general: { theme }
|
|
12724
13140
|
} = config;
|
|
12725
13141
|
const isDarkTheme = theme === "dark";
|
|
12726
|
-
const labels = (0,
|
|
13142
|
+
const labels = (0, import_hooks46.useLabels)();
|
|
12727
13143
|
const selectedTimeRange = config.chart.selectedChartTimeRange;
|
|
12728
13144
|
const setSelectedTimeRange = config.chart.setSelectedChartTimeRange;
|
|
12729
13145
|
const [chartRangeOverride, setChartRangeOverride] = (0, import_react19.useState)(null);
|
|
@@ -12743,7 +13159,7 @@ var MarketDetailsGraphPanel = ({
|
|
|
12743
13159
|
livePrices
|
|
12744
13160
|
});
|
|
12745
13161
|
}, [livePrices, venueMarkets, resolvedChartOutcomeLabel, chartSelectedOutcomeId]);
|
|
12746
|
-
const rollingWindow = (0,
|
|
13162
|
+
const rollingWindow = (0, import_hooks46.useRollingChartWindow)({ range: effectiveChartTimeRange });
|
|
12747
13163
|
const chartPrimaryOutcomeId = (_b = (_a = chartOutcomesByVenue[0]) == null ? void 0 : _a.outcome.id) != null ? _b : null;
|
|
12748
13164
|
const chartVenueOutcomeIds = (0, import_react19.useMemo)(() => {
|
|
12749
13165
|
return chartOutcomesByVenue.map((item) => item.outcome.id);
|
|
@@ -12753,7 +13169,7 @@ var MarketDetailsGraphPanel = ({
|
|
|
12753
13169
|
isLoading: isMarketChartLoading,
|
|
12754
13170
|
error: marketChartError,
|
|
12755
13171
|
refetch: refetchMarketChart
|
|
12756
|
-
} = (0,
|
|
13172
|
+
} = (0, import_hooks46.useMarketChart)({
|
|
12757
13173
|
marketId: chartPrimaryOutcomeId,
|
|
12758
13174
|
venueMarketIds: chartVenueOutcomeIds,
|
|
12759
13175
|
interval: rollingWindow.interval,
|
|
@@ -12857,17 +13273,17 @@ var MarketDetailsGraphPanel = ({
|
|
|
12857
13273
|
const handleRetryMarketChart = () => {
|
|
12858
13274
|
void refetchMarketChart();
|
|
12859
13275
|
};
|
|
12860
|
-
return /* @__PURE__ */ (0,
|
|
12861
|
-
hasChartError ? /* @__PURE__ */ (0,
|
|
13276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: cn("agg-price-chart flex flex-col gap-5 p-5", classNames == null ? void 0 : classNames.graph), children: [
|
|
13277
|
+
hasChartError ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12862
13278
|
StateMessage,
|
|
12863
13279
|
{
|
|
12864
13280
|
title: labels.marketDetails.chartUnavailableTitle,
|
|
12865
13281
|
description: labels.marketDetails.chartUnavailableDescription,
|
|
12866
|
-
icon: /* @__PURE__ */ (0,
|
|
13282
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(WarningIcon, {}),
|
|
12867
13283
|
onAction: handleRetryMarketChart,
|
|
12868
13284
|
classNames: { root: "min-h-[248px] px-5 py-10 md:min-h-[272px]" }
|
|
12869
13285
|
}
|
|
12870
|
-
) : /* @__PURE__ */ (0,
|
|
13286
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12871
13287
|
LineChart,
|
|
12872
13288
|
{
|
|
12873
13289
|
series: graphSeries,
|
|
@@ -12880,14 +13296,14 @@ var MarketDetailsGraphPanel = ({
|
|
|
12880
13296
|
showSeriesControls: chartAvailableOutcomesByVenue.length > 0 || headerOutcomeItems.length > 0,
|
|
12881
13297
|
renderSeriesControls: () => {
|
|
12882
13298
|
var _a2, _b2, _c2, _d;
|
|
12883
|
-
return /* @__PURE__ */ (0,
|
|
12884
|
-
/* @__PURE__ */ (0,
|
|
13299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-chart-toolbar w-full flex flex-col gap-4 md:flex-row md:items-center md:justify-between", children: [
|
|
13300
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "agg-market-venues flex flex-wrap gap-2", children: chartAvailableOutcomesByVenue.map((item) => {
|
|
12885
13301
|
const probability = formatProbabilityPercent(
|
|
12886
13302
|
wsLivePrices.get(item.outcome.id),
|
|
12887
13303
|
formatPercent
|
|
12888
13304
|
);
|
|
12889
13305
|
const isActiveVenue = selectedGraphVenue === item.venue;
|
|
12890
|
-
return /* @__PURE__ */ (0,
|
|
13306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
12891
13307
|
"button",
|
|
12892
13308
|
{
|
|
12893
13309
|
type: "button",
|
|
@@ -12906,14 +13322,14 @@ var MarketDetailsGraphPanel = ({
|
|
|
12906
13322
|
handleGraphVenueToggle(item.venue);
|
|
12907
13323
|
},
|
|
12908
13324
|
children: [
|
|
12909
|
-
/* @__PURE__ */ (0,
|
|
12910
|
-
/* @__PURE__ */ (0,
|
|
13325
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(VenueLogo, { venue: item.venue, size: "small" }),
|
|
13326
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: probability })
|
|
12911
13327
|
]
|
|
12912
13328
|
},
|
|
12913
13329
|
`${item.market.id}-${item.outcome.id}`
|
|
12914
13330
|
);
|
|
12915
13331
|
}) }),
|
|
12916
|
-
!isOutcomeSelectionLocked ? /* @__PURE__ */ (0,
|
|
13332
|
+
!isOutcomeSelectionLocked ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12917
13333
|
SwitchButton,
|
|
12918
13334
|
{
|
|
12919
13335
|
ariaLabel: labels.marketDetails.outcomeSelectorAria,
|
|
@@ -12943,7 +13359,7 @@ var MarketDetailsGraphPanel = ({
|
|
|
12943
13359
|
}
|
|
12944
13360
|
}
|
|
12945
13361
|
),
|
|
12946
|
-
/* @__PURE__ */ (0,
|
|
13362
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
12947
13363
|
"div",
|
|
12948
13364
|
{
|
|
12949
13365
|
className: cn(
|
|
@@ -12952,9 +13368,9 @@ var MarketDetailsGraphPanel = ({
|
|
|
12952
13368
|
classNames == null ? void 0 : classNames.footer
|
|
12953
13369
|
),
|
|
12954
13370
|
children: [
|
|
12955
|
-
/* @__PURE__ */ (0,
|
|
12956
|
-
/* @__PURE__ */ (0,
|
|
12957
|
-
/* @__PURE__ */ (0,
|
|
13371
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { children: typeof volume !== "number" ? labels.marketDetails.volumeUnavailable : volume > 0 ? `${formatCompactCurrency(volume)} ${labels.marketDetails.meta.volumeSuffix}` : "" }),
|
|
13372
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex flex-wrap items-center gap-3 md:gap-4", children: [
|
|
13373
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12958
13374
|
ChartTypeSwitch,
|
|
12959
13375
|
{
|
|
12960
13376
|
className: "agg-chart-type-switch shrink-0",
|
|
@@ -12962,11 +13378,11 @@ var MarketDetailsGraphPanel = ({
|
|
|
12962
13378
|
onValueChange: setSelectedChartType
|
|
12963
13379
|
}
|
|
12964
13380
|
),
|
|
12965
|
-
/* @__PURE__ */ (0,
|
|
12966
|
-
|
|
13381
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { "aria-hidden": "true", className: "hidden h-4 w-px bg-agg-separator md:block" }),
|
|
13382
|
+
import_hooks46.CHART_TIME_RANGES.map((timeRange) => {
|
|
12967
13383
|
const isActive = effectiveChartTimeRange === timeRange;
|
|
12968
13384
|
const isDisabled = isResolvedMarket && timeRange !== "ALL";
|
|
12969
|
-
return /* @__PURE__ */ (0,
|
|
13385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12970
13386
|
"button",
|
|
12971
13387
|
{
|
|
12972
13388
|
type: "button",
|
|
@@ -13000,14 +13416,14 @@ var MarketDetailsGraphPanel = ({
|
|
|
13000
13416
|
MarketDetailsGraphPanel.displayName = "MarketDetailsGraphPanel";
|
|
13001
13417
|
|
|
13002
13418
|
// src/events/market-details/index.tsx
|
|
13003
|
-
var
|
|
13419
|
+
var import_jsx_runtime136 = require("react/jsx-runtime");
|
|
13004
13420
|
var MarketDetailsUnavailableState = ({
|
|
13005
13421
|
marketId,
|
|
13006
13422
|
ariaLabel,
|
|
13007
13423
|
classNames
|
|
13008
13424
|
}) => {
|
|
13009
|
-
const labels = (0,
|
|
13010
|
-
return /* @__PURE__ */ (0,
|
|
13425
|
+
const labels = (0, import_hooks47.useLabels)();
|
|
13426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13011
13427
|
Card,
|
|
13012
13428
|
{
|
|
13013
13429
|
"data-market-id": marketId || void 0,
|
|
@@ -13018,9 +13434,9 @@ var MarketDetailsUnavailableState = ({
|
|
|
13018
13434
|
),
|
|
13019
13435
|
role: "status",
|
|
13020
13436
|
"aria-label": ariaLabel != null ? ariaLabel : labels.marketDetails.unavailableAria,
|
|
13021
|
-
children: /* @__PURE__ */ (0,
|
|
13022
|
-
/* @__PURE__ */ (0,
|
|
13023
|
-
/* @__PURE__ */ (0,
|
|
13437
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { className: "flex flex-col gap-1 p-5", children: [
|
|
13438
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Typography, { variant: "body-large-strong", children: labels.marketDetails.unavailableTitle }),
|
|
13439
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: labels.marketDetails.unavailableDescription })
|
|
13024
13440
|
] })
|
|
13025
13441
|
}
|
|
13026
13442
|
);
|
|
@@ -13030,14 +13446,14 @@ var MarketDetailsNotFoundState = ({
|
|
|
13030
13446
|
ariaLabel: _ariaLabel,
|
|
13031
13447
|
classNames: _classNames
|
|
13032
13448
|
}) => {
|
|
13033
|
-
const labels = (0,
|
|
13034
|
-
return /* @__PURE__ */ (0,
|
|
13449
|
+
const labels = (0, import_hooks47.useLabels)();
|
|
13450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13035
13451
|
StateMessage,
|
|
13036
13452
|
{
|
|
13037
13453
|
"data-market-id": marketId || void 0,
|
|
13038
13454
|
title: labels.marketDetails.notFoundTitle,
|
|
13039
13455
|
description: labels.marketDetails.notFoundDescription,
|
|
13040
|
-
icon: /* @__PURE__ */ (0,
|
|
13456
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(SearchEmptyIcon, {}),
|
|
13041
13457
|
classNames: { root: "min-h-[280px] md:min-h-[320px]" }
|
|
13042
13458
|
}
|
|
13043
13459
|
);
|
|
@@ -13062,39 +13478,40 @@ var MarketDetailsContent = ({
|
|
|
13062
13478
|
headerOutcomeItemsOverride,
|
|
13063
13479
|
onOutcomeSelect,
|
|
13064
13480
|
live,
|
|
13481
|
+
showResolvingState = false,
|
|
13065
13482
|
midpointsFallback,
|
|
13066
13483
|
midpointsFallbackVenues,
|
|
13067
13484
|
suppressOutcomeFallbackSelection,
|
|
13068
13485
|
midpointsResult
|
|
13069
13486
|
}) => {
|
|
13070
13487
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
13071
|
-
const config = (0,
|
|
13488
|
+
const config = (0, import_hooks47.useSdkUiConfig)();
|
|
13072
13489
|
const {
|
|
13073
13490
|
features: { enableAnimations },
|
|
13074
13491
|
formatting: { formatPercent }
|
|
13075
13492
|
} = config;
|
|
13076
|
-
const labels = (0,
|
|
13077
|
-
const tradingContext = (0,
|
|
13493
|
+
const labels = (0, import_hooks47.useLabels)();
|
|
13494
|
+
const tradingContext = (0, import_hooks47.useEventTradingContext)();
|
|
13078
13495
|
const detailsContentId = (0, import_react20.useId)();
|
|
13079
13496
|
const tradeSide = (_a = tradingContext == null ? void 0 : tradingContext.tradeSide) != null ? _a : "buy";
|
|
13080
13497
|
const resolvedMarket = (0, import_react20.useMemo)(() => {
|
|
13081
13498
|
return resolveMarketFromVenueMarkets(venueMarkets, marketId);
|
|
13082
13499
|
}, [venueMarkets, marketId]);
|
|
13083
13500
|
const clusterVenueMarkets = resolvedMarket == null ? void 0 : resolvedMarket.venueMarkets;
|
|
13084
|
-
const wsLivePrices = (0,
|
|
13085
|
-
const wsBestPrices = (0,
|
|
13086
|
-
const wsBestCandidates = (0,
|
|
13501
|
+
const wsLivePrices = (0, import_hooks47.useLiveOutcomePrices)(clusterVenueMarkets);
|
|
13502
|
+
const wsBestPrices = (0, import_hooks47.useLiveBestPrices)(clusterVenueMarkets);
|
|
13503
|
+
const wsBestCandidates = (0, import_hooks47.useLiveBestPriceCandidates)(clusterVenueMarkets);
|
|
13087
13504
|
const scopedResolvedMarket = (0, import_react20.useMemo)(() => {
|
|
13088
13505
|
var _a2, _b2;
|
|
13089
13506
|
if (!resolvedMarket) return null;
|
|
13090
13507
|
return (_b2 = (_a2 = resolvedMarket.venueMarkets.find((venueMarket) => venueMarket.id === resolvedMarket.id)) != null ? _a2 : resolvedMarket.venueMarkets[0]) != null ? _b2 : null;
|
|
13091
13508
|
}, [resolvedMarket]);
|
|
13092
|
-
const isResolvedMarket = (0,
|
|
13093
|
-
(0,
|
|
13509
|
+
const isResolvedMarket = (0, import_hooks47.resolveMarketTradingState)(scopedResolvedMarket).kind === "resolved";
|
|
13510
|
+
(0, import_hooks47.useEventOrderbookData)(
|
|
13094
13511
|
isResolvedMarket ? [] : resolvedMarket == null ? void 0 : resolvedMarket.venueMarkets,
|
|
13095
13512
|
(_b = scopedResolvedMarket == null ? void 0 : scopedResolvedMarket.id) != null ? _b : null
|
|
13096
13513
|
);
|
|
13097
|
-
const fetchedClusterMidpointResult = (0,
|
|
13514
|
+
const fetchedClusterMidpointResult = (0, import_hooks47.useMidpoints)(midpointsResult ? [] : clusterVenueMarkets);
|
|
13098
13515
|
const clusterMidpointResult = midpointsResult != null ? midpointsResult : fetchedClusterMidpointResult;
|
|
13099
13516
|
const clusterMidpoints = (_c = clusterMidpointResult.bestMidpointsByOutcomeId) != null ? _c : clusterMidpointResult.prices;
|
|
13100
13517
|
const clusterBestMidpointsByOutcomeId = clusterMidpoints;
|
|
@@ -13103,30 +13520,10 @@ var MarketDetailsContent = ({
|
|
|
13103
13520
|
const clusterBestMidpointVenue = clusterMidpointResult.bestMidpointVenue;
|
|
13104
13521
|
const clusterBestPricesRest = clusterMidpointResult.bestPrices;
|
|
13105
13522
|
const clusterBestPrices = (0, import_react20.useMemo)(
|
|
13106
|
-
() => (0,
|
|
13523
|
+
() => (0, import_hooks47.mergeBestPricesPreferringLive)(clusterBestPricesRest, wsBestPrices),
|
|
13107
13524
|
[clusterBestPricesRest, wsBestPrices]
|
|
13108
13525
|
);
|
|
13109
13526
|
const clusterBestPriceVenuesByOutcomeId = clusterMidpointResult.bestPriceVenuesByOutcomeId;
|
|
13110
|
-
const clusterMidpointMarkets = (0, import_react20.useMemo)(() => {
|
|
13111
|
-
var _a2;
|
|
13112
|
-
if (!resolvedMarket) return [];
|
|
13113
|
-
return (_a2 = resolvedMarket.venueMarkets) != null ? _a2 : [];
|
|
13114
|
-
}, [resolvedMarket]);
|
|
13115
|
-
const tradableVenues = (0, import_react20.useMemo)(() => {
|
|
13116
|
-
var _a2;
|
|
13117
|
-
if (clusterMidpointMarkets.length === 0) return null;
|
|
13118
|
-
const set = /* @__PURE__ */ new Set();
|
|
13119
|
-
for (const market of clusterMidpointMarkets) {
|
|
13120
|
-
for (const outcome of (_a2 = market.venueMarketOutcomes) != null ? _a2 : []) {
|
|
13121
|
-
if (clusterMidpoints.has(outcome.id)) {
|
|
13122
|
-
set.add(market.venue);
|
|
13123
|
-
break;
|
|
13124
|
-
}
|
|
13125
|
-
}
|
|
13126
|
-
}
|
|
13127
|
-
if (set.size === 0) return null;
|
|
13128
|
-
return set;
|
|
13129
|
-
}, [clusterMidpointMarkets, clusterMidpoints]);
|
|
13130
13527
|
const model = (0, import_react20.useMemo)(() => {
|
|
13131
13528
|
return buildMarketDetailsModel({
|
|
13132
13529
|
venueMarkets,
|
|
@@ -13158,9 +13555,9 @@ var MarketDetailsContent = ({
|
|
|
13158
13555
|
return (_a2 = model.market.venueMarkets.find((venueMarket) => venueMarket.id === model.market.id)) != null ? _a2 : model.primaryVenueMarket;
|
|
13159
13556
|
}, [model]);
|
|
13160
13557
|
const marketTradingState = (0, import_react20.useMemo)(() => {
|
|
13161
|
-
return (0,
|
|
13558
|
+
return (0, import_hooks47.resolveMarketTradingState)(scopedMarketForCard);
|
|
13162
13559
|
}, [scopedMarketForCard]);
|
|
13163
|
-
const isOutcomeSelectionLocked = marketTradingState.isTradingDisabled;
|
|
13560
|
+
const isOutcomeSelectionLocked = showResolvingState || marketTradingState.isTradingDisabled;
|
|
13164
13561
|
const isUpcomingMarket = marketTradingState.kind === "unopened";
|
|
13165
13562
|
const marketStatePresentation = resolveTradingStatePresentation(labels, marketTradingState);
|
|
13166
13563
|
const resolvedWinningOutcomeLabel = resolveResolvedOutcomeLabel({
|
|
@@ -13284,6 +13681,7 @@ var MarketDetailsContent = ({
|
|
|
13284
13681
|
clusterBestMidpointsByOutcomeId,
|
|
13285
13682
|
clusterBestPricesRest,
|
|
13286
13683
|
clusterBestPriceVenuesByOutcomeId,
|
|
13684
|
+
clusterMidpointResult.isLoading,
|
|
13287
13685
|
headerOutcomeItemsOverride,
|
|
13288
13686
|
model,
|
|
13289
13687
|
scopedMarketForCard,
|
|
@@ -13319,7 +13717,7 @@ var MarketDetailsContent = ({
|
|
|
13319
13717
|
fallbackPrice: midpointsFallback == null ? void 0 : midpointsFallback.get(displayOutcome.id)
|
|
13320
13718
|
});
|
|
13321
13719
|
if (referencePrice != null) return referencePrice;
|
|
13322
|
-
return (0,
|
|
13720
|
+
return (0, import_hooks47.findLivePriceById)(wsLivePrices, displayOutcome.id);
|
|
13323
13721
|
}, [
|
|
13324
13722
|
clusterBestMidpoint,
|
|
13325
13723
|
clusterBestMidpointsByOutcomeId,
|
|
@@ -13345,7 +13743,7 @@ var MarketDetailsContent = ({
|
|
|
13345
13743
|
const orderBookEnabled = isOpened && effectiveSelectedTab === "order-book" && !marketTradingState.isTradingDisabled;
|
|
13346
13744
|
const primaryVenueMarketId = (_g = (_f = selectedOutcomesByVenue[0]) == null ? void 0 : _f.market.id) != null ? _g : null;
|
|
13347
13745
|
const primaryOutcomeId = (_i = (_h = selectedOutcomesByVenue[0]) == null ? void 0 : _h.outcome.id) != null ? _i : null;
|
|
13348
|
-
const marketOrderbookResult = (0,
|
|
13746
|
+
const marketOrderbookResult = (0, import_hooks47.useMarketOrderbook)({
|
|
13349
13747
|
marketId: primaryVenueMarketId,
|
|
13350
13748
|
enabled: orderBookEnabled && !!primaryVenueMarketId,
|
|
13351
13749
|
venueOutcomes: selectedOutcomesByVenue.map((item) => ({
|
|
@@ -13447,11 +13845,16 @@ var MarketDetailsContent = ({
|
|
|
13447
13845
|
const handleRetryOrderBook = () => {
|
|
13448
13846
|
void refetchOrderBook();
|
|
13449
13847
|
};
|
|
13450
|
-
const orderbookState =
|
|
13848
|
+
const orderbookState = showResolvingState ? {
|
|
13849
|
+
kind: "disabled",
|
|
13850
|
+
title: labels.marketDetails.resolvingTitle,
|
|
13851
|
+
description: labels.marketDetails.resolvingDescription,
|
|
13852
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(LoadingIcon, { size: "small" })
|
|
13853
|
+
} : marketTradingState.isTradingDisabled ? {
|
|
13451
13854
|
kind: "disabled",
|
|
13452
13855
|
title: marketStatePresentation.title,
|
|
13453
13856
|
description: marketStatePresentation.description,
|
|
13454
|
-
icon: /* @__PURE__ */ (0,
|
|
13857
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Icon, { name: marketStatePresentation.iconName, className: "h-5 w-5", "aria-hidden": "true" })
|
|
13455
13858
|
} : isOrderBookLoading ? { kind: "loading" } : hasOrderBookError ? {
|
|
13456
13859
|
kind: "error",
|
|
13457
13860
|
title: labels.marketDetails.orderBookUnavailableTitle,
|
|
@@ -13467,7 +13870,7 @@ var MarketDetailsContent = ({
|
|
|
13467
13870
|
description: labels.marketDetails.orderBookEmptyDescription
|
|
13468
13871
|
} : { kind: "data" };
|
|
13469
13872
|
if (marketId && !resolvedMarket) {
|
|
13470
|
-
return /* @__PURE__ */ (0,
|
|
13873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13471
13874
|
MarketDetailsNotFoundState,
|
|
13472
13875
|
{
|
|
13473
13876
|
marketId,
|
|
@@ -13477,7 +13880,7 @@ var MarketDetailsContent = ({
|
|
|
13477
13880
|
);
|
|
13478
13881
|
}
|
|
13479
13882
|
if (!model) {
|
|
13480
|
-
return /* @__PURE__ */ (0,
|
|
13883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13481
13884
|
MarketDetailsUnavailableState,
|
|
13482
13885
|
{
|
|
13483
13886
|
marketId,
|
|
@@ -13486,18 +13889,18 @@ var MarketDetailsContent = ({
|
|
|
13486
13889
|
}
|
|
13487
13890
|
);
|
|
13488
13891
|
}
|
|
13489
|
-
return /* @__PURE__ */ (0,
|
|
13892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
|
|
13490
13893
|
Card,
|
|
13491
13894
|
{
|
|
13492
13895
|
className: cn(
|
|
13493
13896
|
"group/agg-market-card",
|
|
13494
13897
|
"w-full rounded-agg-2xl text-left outline-none",
|
|
13495
|
-
marketTradingState.isTradingDisabled && "agg-market-card-readonly",
|
|
13898
|
+
(showResolvingState || marketTradingState.isTradingDisabled) && "agg-market-card-readonly",
|
|
13496
13899
|
marketDetailsBaseCardClassName,
|
|
13497
13900
|
classNames == null ? void 0 : classNames.root
|
|
13498
13901
|
),
|
|
13499
13902
|
children: [
|
|
13500
|
-
/* @__PURE__ */ (0,
|
|
13903
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
|
|
13501
13904
|
"div",
|
|
13502
13905
|
{
|
|
13503
13906
|
"data-market-id": marketId || void 0,
|
|
@@ -13508,7 +13911,7 @@ var MarketDetailsContent = ({
|
|
|
13508
13911
|
classNames == null ? void 0 : classNames.header
|
|
13509
13912
|
),
|
|
13510
13913
|
children: [
|
|
13511
|
-
/* @__PURE__ */ (0,
|
|
13914
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
|
|
13512
13915
|
"button",
|
|
13513
13916
|
{
|
|
13514
13917
|
className: cn(
|
|
@@ -13522,17 +13925,17 @@ var MarketDetailsContent = ({
|
|
|
13522
13925
|
"aria-controls": detailsContentId,
|
|
13523
13926
|
"aria-label": isOpened ? labels.marketDetails.toggleCloseDetailsAria(model.title) : labels.marketDetails.toggleOpenDetailsAria(model.title),
|
|
13524
13927
|
children: [
|
|
13525
|
-
/* @__PURE__ */ (0,
|
|
13526
|
-
!compactHeader ? /* @__PURE__ */ (0,
|
|
13928
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { className: "agg-market-summary flex min-w-24 flex-1 items-center gap-3 md:gap-4", children: [
|
|
13929
|
+
!compactHeader ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13527
13930
|
RemoteImage,
|
|
13528
13931
|
{
|
|
13529
|
-
src: (0,
|
|
13932
|
+
src: (0, import_hooks47.optimizedImageUrl)(model.image, 60),
|
|
13530
13933
|
alt: "",
|
|
13531
13934
|
className: "agg-market-image size-12 rounded-agg-lg object-cover md:size-[60px]"
|
|
13532
13935
|
}
|
|
13533
13936
|
) : null,
|
|
13534
|
-
/* @__PURE__ */ (0,
|
|
13535
|
-
/* @__PURE__ */ (0,
|
|
13937
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { className: "flex min-w-24 flex-col", children: [
|
|
13938
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Tooltip, { content: model.title, side: "top", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13536
13939
|
Typography,
|
|
13537
13940
|
{
|
|
13538
13941
|
as: "h3",
|
|
@@ -13541,7 +13944,7 @@ var MarketDetailsContent = ({
|
|
|
13541
13944
|
children: model.title
|
|
13542
13945
|
}
|
|
13543
13946
|
) }) }),
|
|
13544
|
-
/* @__PURE__ */ (0,
|
|
13947
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13545
13948
|
Typography,
|
|
13546
13949
|
{
|
|
13547
13950
|
variant: "label",
|
|
@@ -13549,8 +13952,8 @@ var MarketDetailsContent = ({
|
|
|
13549
13952
|
children: subtitleOverride != null ? subtitleOverride : model.subtitle
|
|
13550
13953
|
}
|
|
13551
13954
|
) }),
|
|
13552
|
-
marketTradingState.isTradingDisabled && marketTradingState.kind !== "resolved" && !isUpcomingMarket ? /* @__PURE__ */ (0,
|
|
13553
|
-
/* @__PURE__ */ (0,
|
|
13955
|
+
!showResolvingState && marketTradingState.isTradingDisabled && marketTradingState.kind !== "resolved" && !isUpcomingMarket ? /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { className: "mt-2 flex flex-wrap items-center gap-2 justify-center md:justify-start", children: [
|
|
13956
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
|
|
13554
13957
|
"span",
|
|
13555
13958
|
{
|
|
13556
13959
|
className: cn(
|
|
@@ -13558,7 +13961,7 @@ var MarketDetailsContent = ({
|
|
|
13558
13961
|
resolveTradingStateBadgeClassName(marketTradingState.kind)
|
|
13559
13962
|
),
|
|
13560
13963
|
children: [
|
|
13561
|
-
/* @__PURE__ */ (0,
|
|
13964
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13562
13965
|
Icon,
|
|
13563
13966
|
{
|
|
13564
13967
|
name: marketStatePresentation.iconName,
|
|
@@ -13566,20 +13969,23 @@ var MarketDetailsContent = ({
|
|
|
13566
13969
|
className: "h-3.5 w-3.5"
|
|
13567
13970
|
}
|
|
13568
13971
|
),
|
|
13569
|
-
/* @__PURE__ */ (0,
|
|
13972
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("span", { children: marketStatePresentation.badgeLabel })
|
|
13570
13973
|
]
|
|
13571
13974
|
}
|
|
13572
13975
|
),
|
|
13573
|
-
marketStatePresentation.timestampLabel ? /* @__PURE__ */ (0,
|
|
13574
|
-
marketStatePresentation.winningOutcomeLabel ? /* @__PURE__ */ (0,
|
|
13976
|
+
marketStatePresentation.timestampLabel ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: marketStatePresentation.timestampLabel }) : null,
|
|
13977
|
+
marketStatePresentation.winningOutcomeLabel ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: marketStatePresentation.winningOutcomeLabel }) : null
|
|
13575
13978
|
] }) : null
|
|
13576
13979
|
] })
|
|
13577
13980
|
] }),
|
|
13578
|
-
!compactHeader ? /* @__PURE__ */ (0,
|
|
13981
|
+
!compactHeader ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Typography, { as: "div", variant: "heading", className: "agg-market-headline shrink-0", children: formatProbabilityPercent(headlineProbability, formatPercent) }) : null
|
|
13579
13982
|
]
|
|
13580
13983
|
}
|
|
13581
13984
|
),
|
|
13582
|
-
|
|
13985
|
+
showResolvingState ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "agg-outcomes flex w-full items-center justify-end md:w-auto md:shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("span", { className: "inline-flex h-9 min-w-35 items-center justify-center gap-2 rounded-agg-full bg-agg-secondary-hover px-5 py-1.5 text-agg-sm", children: [
|
|
13986
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(LoadingIcon, { size: "small" }),
|
|
13987
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Typography, { variant: "body", children: labels.marketDetails.resolvingBadge })
|
|
13988
|
+
] }) }) : marketTradingState.kind === "resolved" && marketTradingState.winningOutcome ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "agg-outcomes flex w-full items-center justify-end md:w-auto md:shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
|
|
13583
13989
|
"span",
|
|
13584
13990
|
{
|
|
13585
13991
|
className: cn(
|
|
@@ -13592,7 +13998,7 @@ var MarketDetailsContent = ({
|
|
|
13592
13998
|
"border-transparent bg-agg-secondary-hover"
|
|
13593
13999
|
),
|
|
13594
14000
|
children: [
|
|
13595
|
-
/* @__PURE__ */ (0,
|
|
14001
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13596
14002
|
Icon,
|
|
13597
14003
|
{
|
|
13598
14004
|
name: marketTradingState.winningOutcome.label.trim().toLowerCase() === "yes" ? "check-circle" : "cross-circle",
|
|
@@ -13603,12 +14009,12 @@ var MarketDetailsContent = ({
|
|
|
13603
14009
|
)
|
|
13604
14010
|
}
|
|
13605
14011
|
),
|
|
13606
|
-
/* @__PURE__ */ (0,
|
|
14012
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Typography, { variant: "body", children: labels.eventMarketPage.resolvedOutcome(
|
|
13607
14013
|
resolvedWinningOutcomeLabel != null ? resolvedWinningOutcomeLabel : marketTradingState.winningOutcome.label
|
|
13608
14014
|
) })
|
|
13609
14015
|
]
|
|
13610
14016
|
}
|
|
13611
|
-
) }) : isUpcomingMarket ? /* @__PURE__ */ (0,
|
|
14017
|
+
) }) : isUpcomingMarket ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "agg-outcomes flex w-full items-center justify-end md:w-auto md:shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
|
|
13612
14018
|
"span",
|
|
13613
14019
|
{
|
|
13614
14020
|
className: cn(
|
|
@@ -13617,7 +14023,7 @@ var MarketDetailsContent = ({
|
|
|
13617
14023
|
resolveTradingStateBadgeClassName(marketTradingState.kind)
|
|
13618
14024
|
),
|
|
13619
14025
|
children: [
|
|
13620
|
-
/* @__PURE__ */ (0,
|
|
14026
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13621
14027
|
Icon,
|
|
13622
14028
|
{
|
|
13623
14029
|
name: marketStatePresentation.iconName,
|
|
@@ -13626,10 +14032,10 @@ var MarketDetailsContent = ({
|
|
|
13626
14032
|
"aria-hidden": "true"
|
|
13627
14033
|
}
|
|
13628
14034
|
),
|
|
13629
|
-
/* @__PURE__ */ (0,
|
|
14035
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("span", { children: marketStatePresentation.badgeLabel })
|
|
13630
14036
|
]
|
|
13631
14037
|
}
|
|
13632
|
-
) }) : /* @__PURE__ */ (0,
|
|
14038
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13633
14039
|
"div",
|
|
13634
14040
|
{
|
|
13635
14041
|
className: "agg-outcomes flex w-full flex-wrap gap-2 md:w-auto md:shrink-0 md:flex-nowrap",
|
|
@@ -13638,7 +14044,7 @@ var MarketDetailsContent = ({
|
|
|
13638
14044
|
onKeyDown: (eventToHandle) => handleOutcomeKeyDown(eventToHandle),
|
|
13639
14045
|
children: headerOutcomeItems.map((item) => {
|
|
13640
14046
|
const isActiveOutcome = item.id === selectedOutcomeId;
|
|
13641
|
-
return /* @__PURE__ */ (0,
|
|
14047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13642
14048
|
MarketDetailsOutcomeButton,
|
|
13643
14049
|
{
|
|
13644
14050
|
enforceFixedWidth: headerOutcomeVariant != null,
|
|
@@ -13665,8 +14071,8 @@ var MarketDetailsContent = ({
|
|
|
13665
14071
|
]
|
|
13666
14072
|
}
|
|
13667
14073
|
),
|
|
13668
|
-
headerAccessory ? /* @__PURE__ */ (0,
|
|
13669
|
-
/* @__PURE__ */ (0,
|
|
14074
|
+
headerAccessory ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "agg-market-card-accessory border-t border-agg-separator", children: headerAccessory }) : null,
|
|
14075
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13670
14076
|
"div",
|
|
13671
14077
|
{
|
|
13672
14078
|
id: detailsContentId,
|
|
@@ -13680,9 +14086,9 @@ var MarketDetailsContent = ({
|
|
|
13680
14086
|
isOpened ? "grid-rows-[1fr] opacity-100" : "pointer-events-none grid-rows-[0fr] opacity-0"
|
|
13681
14087
|
),
|
|
13682
14088
|
"aria-hidden": !isOpened,
|
|
13683
|
-
children: /* @__PURE__ */ (0,
|
|
13684
|
-
/* @__PURE__ */ (0,
|
|
13685
|
-
/* @__PURE__ */ (0,
|
|
14089
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { className: "min-h-0", children: [
|
|
14090
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
|
|
14091
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
|
|
13686
14092
|
"div",
|
|
13687
14093
|
{
|
|
13688
14094
|
className: cn(
|
|
@@ -13696,8 +14102,8 @@ var MarketDetailsContent = ({
|
|
|
13696
14102
|
) : "translate-y-5 opacity-0"
|
|
13697
14103
|
),
|
|
13698
14104
|
children: [
|
|
13699
|
-
!isResolvedMarket ? /* @__PURE__ */ (0,
|
|
13700
|
-
/* @__PURE__ */ (0,
|
|
14105
|
+
!isResolvedMarket ? /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_jsx_runtime136.Fragment, { children: [
|
|
14106
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: cn("block", classNames == null ? void 0 : classNames.tabs), children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13701
14107
|
Tabs,
|
|
13702
14108
|
{
|
|
13703
14109
|
ariaLabel: labels.marketDetails.tabsAria,
|
|
@@ -13708,10 +14114,10 @@ var MarketDetailsContent = ({
|
|
|
13708
14114
|
className: "agg-market-tabs flex! w-full px-5"
|
|
13709
14115
|
}
|
|
13710
14116
|
) }),
|
|
13711
|
-
/* @__PURE__ */ (0,
|
|
14117
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "h-px w-full bg-agg-separator" })
|
|
13712
14118
|
] }) : null,
|
|
13713
|
-
/* @__PURE__ */ (0,
|
|
13714
|
-
effectiveSelectedTab === "order-book" ? /* @__PURE__ */ (0,
|
|
14119
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { className: cn("agg-market-card-body p-0", classNames == null ? void 0 : classNames.content), children: [
|
|
14120
|
+
effectiveSelectedTab === "order-book" ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13715
14121
|
OrderbookWithStates,
|
|
13716
14122
|
{
|
|
13717
14123
|
state: orderbookState,
|
|
@@ -13737,7 +14143,7 @@ var MarketDetailsContent = ({
|
|
|
13737
14143
|
wrapperClassName: classNames == null ? void 0 : classNames.orderBook
|
|
13738
14144
|
}
|
|
13739
14145
|
) : null,
|
|
13740
|
-
isOpened && effectiveSelectedTab === "graph" ? /* @__PURE__ */ (0,
|
|
14146
|
+
isOpened && effectiveSelectedTab === "graph" ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13741
14147
|
MarketDetailsGraphPanel,
|
|
13742
14148
|
{
|
|
13743
14149
|
venueMarkets: model.market.venueMarkets,
|
|
@@ -13753,13 +14159,13 @@ var MarketDetailsContent = ({
|
|
|
13753
14159
|
classNames: { graph: classNames == null ? void 0 : classNames.graph, footer: classNames == null ? void 0 : classNames.footer }
|
|
13754
14160
|
}
|
|
13755
14161
|
) : null,
|
|
13756
|
-
effectiveSelectedTab === "other" ? /* @__PURE__ */ (0,
|
|
14162
|
+
effectiveSelectedTab === "other" ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "agg-market-meta flex flex-col gap-4", children: otherContent != null ? otherContent : /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "agg-market-meta-list grid grid-cols-1 gap-3", children: otherRows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
|
|
13757
14163
|
"div",
|
|
13758
14164
|
{
|
|
13759
14165
|
className: "agg-market-meta-row flex items-center justify-between rounded-agg-xl bg-agg-secondary-hover px-4 py-3",
|
|
13760
14166
|
children: [
|
|
13761
|
-
/* @__PURE__ */ (0,
|
|
13762
|
-
/* @__PURE__ */ (0,
|
|
14167
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: row.label }),
|
|
14168
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Typography, { variant: "body", className: "text-right", children: row.value })
|
|
13763
14169
|
]
|
|
13764
14170
|
},
|
|
13765
14171
|
row.label
|
|
@@ -13777,9 +14183,9 @@ var MarketDetailsContent = ({
|
|
|
13777
14183
|
};
|
|
13778
14184
|
var MarketDetails = (_a) => {
|
|
13779
14185
|
var _b = _a, { isOpened } = _b, props = __objRest(_b, ["isOpened"]);
|
|
13780
|
-
const labels = (0,
|
|
14186
|
+
const labels = (0, import_hooks47.useLabels)();
|
|
13781
14187
|
if (props.isLoading) {
|
|
13782
|
-
return /* @__PURE__ */ (0,
|
|
14188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13783
14189
|
Skeleton,
|
|
13784
14190
|
{
|
|
13785
14191
|
view: "market-details-minified",
|
|
@@ -13789,7 +14195,7 @@ var MarketDetails = (_a) => {
|
|
|
13789
14195
|
);
|
|
13790
14196
|
}
|
|
13791
14197
|
if ("venueMarkets" in props && props.venueMarkets) {
|
|
13792
|
-
return /* @__PURE__ */ (0,
|
|
14198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13793
14199
|
MarketDetailsContent,
|
|
13794
14200
|
__spreadProps(__spreadValues({}, props), {
|
|
13795
14201
|
isOpened,
|
|
@@ -13801,7 +14207,7 @@ var MarketDetails = (_a) => {
|
|
|
13801
14207
|
);
|
|
13802
14208
|
}
|
|
13803
14209
|
const { classNames: fallbackClassNames } = props;
|
|
13804
|
-
return /* @__PURE__ */ (0,
|
|
14210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(MarketDetailsUnavailableState, { classNames: fallbackClassNames });
|
|
13805
14211
|
};
|
|
13806
14212
|
MarketDetails.displayName = "MarketDetails";
|
|
13807
14213
|
var AFFIRMATIVE_WINNER_LABELS = /* @__PURE__ */ new Set(["yes", "up", "buy", "long", "true"]);
|
|
@@ -13832,13 +14238,13 @@ var resolveIsResolvedEvent = (sourceMarkets, eventTradingState) => {
|
|
|
13832
14238
|
return eventTradingState.kind === "resolved";
|
|
13833
14239
|
}
|
|
13834
14240
|
if (sourceMarkets.length === 0) return false;
|
|
13835
|
-
return sourceMarkets.every((market) => (0,
|
|
14241
|
+
return sourceMarkets.every((market) => (0, import_hooks47.resolveMarketTradingState)(market).kind === "resolved");
|
|
13836
14242
|
};
|
|
13837
14243
|
var resolveResolvedWinnerMarketId = (sourceMarkets, eventTradingState) => {
|
|
13838
14244
|
var _a, _b, _c, _d, _e;
|
|
13839
14245
|
const preferredMarket = (_a = eventTradingState == null ? void 0 : eventTradingState.primaryMarket) != null ? _a : null;
|
|
13840
14246
|
if (preferredMarket && sourceMarkets.some((market) => market.id === preferredMarket.id)) {
|
|
13841
|
-
if ((0,
|
|
14247
|
+
if ((0, import_hooks47.resolveMarketTradingState)(preferredMarket).kind === "resolved") {
|
|
13842
14248
|
return preferredMarket.id;
|
|
13843
14249
|
}
|
|
13844
14250
|
}
|
|
@@ -13855,11 +14261,12 @@ var MarketDetailsList = ({
|
|
|
13855
14261
|
defaultTab,
|
|
13856
14262
|
classNames,
|
|
13857
14263
|
live,
|
|
14264
|
+
showResolvingState = false,
|
|
13858
14265
|
midpointsResult
|
|
13859
14266
|
}) => {
|
|
13860
14267
|
var _a, _b;
|
|
13861
|
-
const labels = (0,
|
|
13862
|
-
const tradingContext = (0,
|
|
14268
|
+
const labels = (0, import_hooks47.useLabels)();
|
|
14269
|
+
const tradingContext = (0, import_hooks47.useEventTradingContext)();
|
|
13863
14270
|
const selectedMarketId = (_a = tradingContext == null ? void 0 : tradingContext.selectedMarketId) != null ? _a : null;
|
|
13864
14271
|
const [expandedMarketId, setExpandedMarketId] = (0, import_react20.useState)(null);
|
|
13865
14272
|
const [areResolvedMarketsVisible, setAreResolvedMarketsVisible] = (0, import_react20.useState)(false);
|
|
@@ -13868,10 +14275,10 @@ var MarketDetailsList = ({
|
|
|
13868
14275
|
markets: rawMarkets,
|
|
13869
14276
|
isLoading,
|
|
13870
14277
|
error
|
|
13871
|
-
} = (0,
|
|
14278
|
+
} = (0, import_hooks47.useVenueMarkets)({
|
|
13872
14279
|
venueEventId: resolvedEventId,
|
|
13873
14280
|
enabled: !providedMarkets && !!resolvedEventId,
|
|
13874
|
-
status:
|
|
14281
|
+
status: import_hooks47.MarketStatus.open,
|
|
13875
14282
|
// Keep in lockstep with useEnrichedVenueEvent: limit is part of the React
|
|
13876
14283
|
// Query key, so a mismatch would fork the shared cache into two requests.
|
|
13877
14284
|
// fetchAll drains every page — events can exceed any single-page limit
|
|
@@ -13906,6 +14313,7 @@ var MarketDetailsList = ({
|
|
|
13906
14313
|
const winnerMarketId = resolveResolvedWinnerMarketId(sourceMarkets, eventTradingState);
|
|
13907
14314
|
return {
|
|
13908
14315
|
primary: moveMarketToFront(sourceMarkets, winnerMarketId),
|
|
14316
|
+
closed: [],
|
|
13909
14317
|
upcoming: [],
|
|
13910
14318
|
resolved: []
|
|
13911
14319
|
};
|
|
@@ -13915,7 +14323,7 @@ var MarketDetailsList = ({
|
|
|
13915
14323
|
const resolved = [];
|
|
13916
14324
|
const closed = [];
|
|
13917
14325
|
sourceMarkets.forEach((market) => {
|
|
13918
|
-
const marketStateKind = (0,
|
|
14326
|
+
const marketStateKind = (0, import_hooks47.resolveMarketTradingState)(market).kind;
|
|
13919
14327
|
if (marketStateKind === "resolved") {
|
|
13920
14328
|
resolved.push(market);
|
|
13921
14329
|
return;
|
|
@@ -13938,15 +14346,19 @@ var MarketDetailsList = ({
|
|
|
13938
14346
|
return [];
|
|
13939
14347
|
}, [areResolvedMarketsVisible, groupedMarkets.resolved, isResolvedEvent]);
|
|
13940
14348
|
const displayedMarkets = (0, import_react20.useMemo)(() => {
|
|
13941
|
-
return [
|
|
13942
|
-
|
|
14349
|
+
return [
|
|
14350
|
+
...groupedMarkets.primary,
|
|
14351
|
+
...showResolvingState ? groupedMarkets.closed : [],
|
|
14352
|
+
...visibleResolvedMarkets
|
|
14353
|
+
];
|
|
14354
|
+
}, [groupedMarkets.closed, groupedMarkets.primary, showResolvingState, visibleResolvedMarkets]);
|
|
13943
14355
|
const hasPrefetchedMarkets = !!providedMarkets || !!((_b = eventTradingState == null ? void 0 : eventTradingState.marketStates) == null ? void 0 : _b.length);
|
|
13944
14356
|
const midpointEligibleMarkets = (0, import_react20.useMemo)(() => {
|
|
13945
14357
|
return displayedMarkets.filter(
|
|
13946
|
-
(market) => (0,
|
|
14358
|
+
(market) => (0, import_hooks47.resolveMarketTradingState)(market).kind !== "resolved"
|
|
13947
14359
|
);
|
|
13948
14360
|
}, [displayedMarkets]);
|
|
13949
|
-
const { prices: midpointsFallback, venueByOutcomeId: midpointsFallbackVenues } = (0,
|
|
14361
|
+
const { prices: midpointsFallback, venueByOutcomeId: midpointsFallbackVenues } = (0, import_hooks47.useViewportMidpoints)(midpointEligibleMarkets);
|
|
13950
14362
|
(0, import_react20.useEffect)(() => {
|
|
13951
14363
|
if (isResolvedEvent) {
|
|
13952
14364
|
setAreResolvedMarketsVisible(false);
|
|
@@ -13965,7 +14377,7 @@ var MarketDetailsList = ({
|
|
|
13965
14377
|
return;
|
|
13966
14378
|
}
|
|
13967
14379
|
const fallbackSelectableMarket = displayedMarkets.find(
|
|
13968
|
-
(market) => !(0,
|
|
14380
|
+
(market) => !(0, import_hooks47.resolveMarketTradingState)(market).isTradingDisabled
|
|
13969
14381
|
);
|
|
13970
14382
|
if (!fallbackSelectableMarket) {
|
|
13971
14383
|
return;
|
|
@@ -13987,11 +14399,11 @@ var MarketDetailsList = ({
|
|
|
13987
14399
|
setExpandedMarketId(marketId);
|
|
13988
14400
|
onExpandedMarketChange == null ? void 0 : onExpandedMarketChange(marketId);
|
|
13989
14401
|
if (marketId === selectedMarketId) return;
|
|
13990
|
-
if ((0,
|
|
14402
|
+
if ((0, import_hooks47.resolveMarketTradingState)(market).isTradingDisabled) return;
|
|
13991
14403
|
tradingContext == null ? void 0 : tradingContext.selectMarket(market.id, market);
|
|
13992
14404
|
};
|
|
13993
14405
|
if (!hasPrefetchedMarkets && isLoading) {
|
|
13994
|
-
return /* @__PURE__ */ (0,
|
|
14406
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13995
14407
|
Skeleton,
|
|
13996
14408
|
{
|
|
13997
14409
|
view: "market-details-minified",
|
|
@@ -14001,29 +14413,29 @@ var MarketDetailsList = ({
|
|
|
14001
14413
|
);
|
|
14002
14414
|
}
|
|
14003
14415
|
if (!hasPrefetchedMarkets && error) {
|
|
14004
|
-
return /* @__PURE__ */ (0,
|
|
14416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
14005
14417
|
StateMessage,
|
|
14006
14418
|
{
|
|
14007
14419
|
title: labels.marketDetails.unavailableTitle,
|
|
14008
14420
|
description: labels.marketDetails.unavailableDescription,
|
|
14009
|
-
icon: /* @__PURE__ */ (0,
|
|
14421
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(SearchEmptyIcon, {}),
|
|
14010
14422
|
classNames: { root: "min-h-[280px] md:min-h-[320px]" }
|
|
14011
14423
|
}
|
|
14012
14424
|
);
|
|
14013
14425
|
}
|
|
14014
14426
|
if (displayedMarkets.length === 0 && !shouldShowResolvedToggle) {
|
|
14015
14427
|
const hasSourceMarkets = sourceMarkets.length > 0;
|
|
14016
|
-
return /* @__PURE__ */ (0,
|
|
14428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
14017
14429
|
StateMessage,
|
|
14018
14430
|
{
|
|
14019
14431
|
title: hasSourceMarkets ? isResolvedEvent ? labels.markets.emptyResolved : labels.markets.emptyNoOpen : labels.marketDetails.notFoundTitle,
|
|
14020
14432
|
description: hasSourceMarkets ? void 0 : labels.marketDetails.notFoundDescription,
|
|
14021
|
-
icon: /* @__PURE__ */ (0,
|
|
14433
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(SearchEmptyIcon, {}),
|
|
14022
14434
|
classNames: { root: "min-h-[280px] md:min-h-[320px]" }
|
|
14023
14435
|
}
|
|
14024
14436
|
);
|
|
14025
14437
|
}
|
|
14026
|
-
const renderMarketCard = (market) => /* @__PURE__ */ (0,
|
|
14438
|
+
const renderMarketCard = (market) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
14027
14439
|
MarketDetails,
|
|
14028
14440
|
{
|
|
14029
14441
|
marketId: market.id,
|
|
@@ -14045,14 +14457,16 @@ var MarketDetailsList = ({
|
|
|
14045
14457
|
ariaLabel: market.question,
|
|
14046
14458
|
classNames: { root: cn("agg-market-list-item", classNames == null ? void 0 : classNames.item) },
|
|
14047
14459
|
live,
|
|
14460
|
+
showResolvingState,
|
|
14048
14461
|
midpointsFallback,
|
|
14049
14462
|
midpointsFallbackVenues,
|
|
14050
14463
|
midpointsResult
|
|
14051
14464
|
}
|
|
14052
14465
|
) }, market.id);
|
|
14053
|
-
return /* @__PURE__ */ (0,
|
|
14466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { className: cn("agg-market-list flex flex-col gap-3", classNames == null ? void 0 : classNames.root), children: [
|
|
14054
14467
|
groupedMarkets.primary.map((market) => renderMarketCard(market)),
|
|
14055
|
-
|
|
14468
|
+
showResolvingState ? groupedMarkets.closed.map((market) => renderMarketCard(market)) : null,
|
|
14469
|
+
shouldShowResolvedToggle ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
14056
14470
|
Button,
|
|
14057
14471
|
{
|
|
14058
14472
|
variant: "tertiary",
|
|
@@ -14062,7 +14476,7 @@ var MarketDetailsList = ({
|
|
|
14062
14476
|
setAreResolvedMarketsVisible((isVisible) => !isVisible);
|
|
14063
14477
|
},
|
|
14064
14478
|
"aria-expanded": areResolvedMarketsVisible,
|
|
14065
|
-
suffix: /* @__PURE__ */ (0,
|
|
14479
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
14066
14480
|
Icon,
|
|
14067
14481
|
{
|
|
14068
14482
|
name: areResolvedMarketsVisible ? "chevron-up" : "chevron-down",
|
|
@@ -14080,14 +14494,14 @@ var MarketDetailsList = ({
|
|
|
14080
14494
|
MarketDetailsList.displayName = "MarketDetailsList";
|
|
14081
14495
|
|
|
14082
14496
|
// src/events/list/index.tsx
|
|
14083
|
-
var
|
|
14497
|
+
var import_hooks49 = require("@agg-build/hooks");
|
|
14084
14498
|
var import_sdk16 = require("@agg-build/sdk");
|
|
14085
14499
|
var Dialog2 = __toESM(require("@radix-ui/react-dialog"));
|
|
14086
14500
|
var import_react23 = require("react");
|
|
14087
14501
|
|
|
14088
14502
|
// src/events/list/category-sidebar.tsx
|
|
14089
14503
|
var import_react21 = require("react");
|
|
14090
|
-
var
|
|
14504
|
+
var import_jsx_runtime137 = require("react/jsx-runtime");
|
|
14091
14505
|
var rowBase = cn(
|
|
14092
14506
|
"flex min-h-11 w-full items-center gap-3 rounded-[6px] px-3 py-3",
|
|
14093
14507
|
"text-left text-agg-sm font-agg-normal leading-agg-5",
|
|
@@ -14129,7 +14543,7 @@ var CategorySidebar = ({
|
|
|
14129
14543
|
}) => {
|
|
14130
14544
|
var _a, _b;
|
|
14131
14545
|
const hasKnownChildren = ((_b = (_a = childrenByParentId.get(entry.id)) == null ? void 0 : _a.length) != null ? _b : 0) > 0;
|
|
14132
|
-
return /* @__PURE__ */ (0,
|
|
14546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(
|
|
14133
14547
|
"button",
|
|
14134
14548
|
{
|
|
14135
14549
|
type: "button",
|
|
@@ -14137,8 +14551,8 @@ var CategorySidebar = ({
|
|
|
14137
14551
|
className: isSelected ? selectedRowClassName : idleRowClassName,
|
|
14138
14552
|
onClick,
|
|
14139
14553
|
children: [
|
|
14140
|
-
/* @__PURE__ */ (0,
|
|
14141
|
-
hasKnownChildren ? /* @__PURE__ */ (0,
|
|
14554
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "min-w-0 flex-1 truncate first-letter:uppercase", children: entry.label }),
|
|
14555
|
+
hasKnownChildren ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
|
|
14142
14556
|
Icon,
|
|
14143
14557
|
{
|
|
14144
14558
|
name: isExpanded ? "chevron-up" : "chevron-down",
|
|
@@ -14146,7 +14560,7 @@ var CategorySidebar = ({
|
|
|
14146
14560
|
color: "currentColor",
|
|
14147
14561
|
className: "shrink-0 text-agg-muted-foreground"
|
|
14148
14562
|
}
|
|
14149
|
-
) : /* @__PURE__ */ (0,
|
|
14563
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "shrink-0 text-agg-muted-foreground", children: entry.eventCount })
|
|
14150
14564
|
]
|
|
14151
14565
|
},
|
|
14152
14566
|
entry.id
|
|
@@ -14164,27 +14578,27 @@ var CategorySidebar = ({
|
|
|
14164
14578
|
const hasKnownChildren = childCategories.length > 0;
|
|
14165
14579
|
const isExpanded = ((_d = categoryPath[depth]) == null ? void 0 : _d.id) === category.id && !collapsedCategoryIds.has(category.id);
|
|
14166
14580
|
const isSelected = ((_e = categoryPath[depth]) == null ? void 0 : _e.id) === category.id && categoryPath.length === depth + 1;
|
|
14167
|
-
return /* @__PURE__ */ (0,
|
|
14581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("div", { className: "flex w-full flex-col", children: [
|
|
14168
14582
|
renderRow({
|
|
14169
14583
|
entry,
|
|
14170
14584
|
isExpanded,
|
|
14171
14585
|
isSelected,
|
|
14172
14586
|
onClick: () => onToggleCategory({ entry, depth, hasKnownChildren, isExpanded, isSelected })
|
|
14173
14587
|
}),
|
|
14174
|
-
/* @__PURE__ */ (0,
|
|
14588
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
|
|
14175
14589
|
"div",
|
|
14176
14590
|
{
|
|
14177
14591
|
className: cn(
|
|
14178
14592
|
"grid transition-[grid-template-rows] duration-150 ease-in-out motion-reduce:transition-none",
|
|
14179
14593
|
isExpanded ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
14180
14594
|
),
|
|
14181
|
-
children: /* @__PURE__ */ (0,
|
|
14595
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { className: "overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { className: "flex w-full flex-col gap-1 pl-4 pt-1", children: childCategories.map((child) => renderBranch(child, depth + 1)) }) })
|
|
14182
14596
|
}
|
|
14183
14597
|
)
|
|
14184
14598
|
] }, category.id);
|
|
14185
14599
|
};
|
|
14186
|
-
return /* @__PURE__ */ (0,
|
|
14187
|
-
/* @__PURE__ */ (0,
|
|
14600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("div", { className: "flex w-full flex-col gap-1", children: [
|
|
14601
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(
|
|
14188
14602
|
"button",
|
|
14189
14603
|
{
|
|
14190
14604
|
type: "button",
|
|
@@ -14192,8 +14606,8 @@ var CategorySidebar = ({
|
|
|
14192
14606
|
className: !isDrilledIn ? selectedRowClassName : idleRowClassName,
|
|
14193
14607
|
onClick: onSelectAll,
|
|
14194
14608
|
children: [
|
|
14195
|
-
/* @__PURE__ */ (0,
|
|
14196
|
-
/* @__PURE__ */ (0,
|
|
14609
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "min-w-0 flex-1 truncate", children: labels.subcategoriesAll }),
|
|
14610
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "shrink-0 text-agg-muted-foreground", children: totalEventCount })
|
|
14197
14611
|
]
|
|
14198
14612
|
}
|
|
14199
14613
|
),
|
|
@@ -14203,7 +14617,7 @@ var CategorySidebar = ({
|
|
|
14203
14617
|
CategorySidebar.displayName = "CategorySidebar";
|
|
14204
14618
|
|
|
14205
14619
|
// src/events/list/event-list-tabs.tsx
|
|
14206
|
-
var
|
|
14620
|
+
var import_hooks48 = require("@agg-build/hooks");
|
|
14207
14621
|
var import_sdk15 = require("@agg-build/sdk");
|
|
14208
14622
|
var import_react22 = require("react");
|
|
14209
14623
|
|
|
@@ -14278,16 +14692,16 @@ var getDefaultEventListTabs = (labels) => {
|
|
|
14278
14692
|
};
|
|
14279
14693
|
|
|
14280
14694
|
// src/events/list/event-list-tabs.tsx
|
|
14281
|
-
var
|
|
14695
|
+
var import_jsx_runtime138 = require("react/jsx-runtime");
|
|
14282
14696
|
var renderTabIcon = (tab, isActive) => {
|
|
14283
14697
|
if (tab.iconName === "warning-filled") {
|
|
14284
|
-
return /* @__PURE__ */ (0,
|
|
14698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(Icon, { name: "warning-filled", size: "small", color: "currentColor" });
|
|
14285
14699
|
}
|
|
14286
14700
|
if (tab.venueLogo) {
|
|
14287
|
-
return /* @__PURE__ */ (0,
|
|
14701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(VenueLogo, { venue: tab.venueLogo, size: "small" });
|
|
14288
14702
|
}
|
|
14289
14703
|
if (!tab.iconName) return null;
|
|
14290
|
-
return /* @__PURE__ */ (0,
|
|
14704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
14291
14705
|
Icon,
|
|
14292
14706
|
{
|
|
14293
14707
|
name: tab.iconName,
|
|
@@ -14297,23 +14711,24 @@ var renderTabIcon = (tab, isActive) => {
|
|
|
14297
14711
|
);
|
|
14298
14712
|
};
|
|
14299
14713
|
var useEventListTabs = (tabs) => {
|
|
14300
|
-
const labels = (0,
|
|
14301
|
-
const { disabledVenues, isLoading: isAppConfigLoading } = (0,
|
|
14302
|
-
const { isLocationBlocked } = (0,
|
|
14714
|
+
const labels = (0, import_hooks48.useLabels)();
|
|
14715
|
+
const { disabledVenues, isLoading: isAppConfigLoading } = (0, import_hooks48.useAppConfig)();
|
|
14716
|
+
const { isLocationBlocked } = (0, import_hooks48.useGeoBlock)();
|
|
14303
14717
|
return (0, import_react22.useMemo)(() => {
|
|
14304
14718
|
const baseTabs = tabs != null ? tabs : getDefaultEventListTabs(labels);
|
|
14305
14719
|
return baseTabs.flatMap((tab) => {
|
|
14306
14720
|
if (!tab.venueLogo) return [tab];
|
|
14307
|
-
const availabilityState = (0,
|
|
14721
|
+
const availabilityState = (0, import_hooks48.getVenueAvailabilityState)({
|
|
14308
14722
|
venueId: tab.venueLogo,
|
|
14309
14723
|
disabledVenues,
|
|
14310
|
-
//
|
|
14311
|
-
//
|
|
14312
|
-
// disabled-ness is only known once `/app/config` resolves
|
|
14313
|
-
//
|
|
14314
|
-
// the flag is unset.
|
|
14315
|
-
//
|
|
14316
|
-
//
|
|
14724
|
+
// A compile-time-inactive venue (novig today) is hidden by default and
|
|
14725
|
+
// un-hidden per-environment by NOVIG_DATA_VISIBLE, so its
|
|
14726
|
+
// disabled-ness is only known once `/app/config` resolves — treating
|
|
14727
|
+
// it as hidden while that request is in flight stops its tab flashing
|
|
14728
|
+
// in and out where the flag is unset. Active venues must NOT be
|
|
14729
|
+
// withheld, or they pop in late. Keyed off the shared inactive-venue
|
|
14730
|
+
// helper rather than a venue name, so launching or retiring one needs
|
|
14731
|
+
// no change here.
|
|
14317
14732
|
isConfigLoading: isAppConfigLoading && (0, import_sdk15.isVenueInactive)(tab.venueLogo),
|
|
14318
14733
|
isLocationBlocked
|
|
14319
14734
|
});
|
|
@@ -14355,7 +14770,7 @@ var EventListTabs = ({
|
|
|
14355
14770
|
};
|
|
14356
14771
|
});
|
|
14357
14772
|
}, [activeTab, resolvedTabs]);
|
|
14358
|
-
return /* @__PURE__ */ (0,
|
|
14773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
14359
14774
|
Tabs,
|
|
14360
14775
|
{
|
|
14361
14776
|
ariaLabel,
|
|
@@ -14370,7 +14785,7 @@ var EventListTabs = ({
|
|
|
14370
14785
|
EventListTabs.displayName = "EventListTabs";
|
|
14371
14786
|
|
|
14372
14787
|
// src/events/list/index.tsx
|
|
14373
|
-
var
|
|
14788
|
+
var import_jsx_runtime139 = require("react/jsx-runtime");
|
|
14374
14789
|
var SORT_ICON_BY_VALUE = {
|
|
14375
14790
|
volume24hr: "sort-volume-24hr",
|
|
14376
14791
|
topArbitrage: "sort-top-arbitrage",
|
|
@@ -14425,15 +14840,15 @@ var EventList = ({
|
|
|
14425
14840
|
stateRef
|
|
14426
14841
|
}) => {
|
|
14427
14842
|
var _a, _b, _c, _d, _e;
|
|
14428
|
-
const labels = (0,
|
|
14429
|
-
const { disabledVenues } = (0,
|
|
14843
|
+
const labels = (0, import_hooks49.useLabels)();
|
|
14844
|
+
const { disabledVenues } = (0, import_hooks49.useAppConfig)();
|
|
14430
14845
|
const {
|
|
14431
14846
|
features: { enableVenueEventDiscoveryFilters, showSportsMarkets }
|
|
14432
|
-
} = (0,
|
|
14847
|
+
} = (0, import_hooks49.useSdkUiConfig)();
|
|
14433
14848
|
const isDiscoveryFiltersEnabled = enableVenueEventDiscoveryFilters && !search;
|
|
14434
14849
|
const resolvedTabs = useEventListTabs();
|
|
14435
14850
|
const visibleVenues = (0, import_react23.useMemo)(
|
|
14436
|
-
() => disabledVenues.length === 0 ? void 0 : (0,
|
|
14851
|
+
() => disabledVenues.length === 0 ? void 0 : (0, import_hooks49.getVisibleVenueIdsByConfig)(import_sdk16.VENUES, disabledVenues),
|
|
14437
14852
|
[disabledVenues]
|
|
14438
14853
|
);
|
|
14439
14854
|
const [activeTabValue, setActiveTabValue] = (0, import_react23.useState)(
|
|
@@ -14448,22 +14863,22 @@ var EventList = ({
|
|
|
14448
14863
|
{
|
|
14449
14864
|
value: "volume24hr",
|
|
14450
14865
|
label: labels.eventList.sortBy24hVolume,
|
|
14451
|
-
icon: /* @__PURE__ */ (0,
|
|
14866
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Icon, { name: SORT_ICON_BY_VALUE.volume24hr, size: "small", color: "currentColor" })
|
|
14452
14867
|
},
|
|
14453
14868
|
{
|
|
14454
14869
|
value: "topArbitrage",
|
|
14455
14870
|
label: labels.eventList.sortByTopArbitrage,
|
|
14456
|
-
icon: /* @__PURE__ */ (0,
|
|
14871
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Icon, { name: SORT_ICON_BY_VALUE.topArbitrage, size: "small", color: "currentColor" })
|
|
14457
14872
|
},
|
|
14458
14873
|
{
|
|
14459
14874
|
value: "volume",
|
|
14460
14875
|
label: labels.eventList.sortByTotalVolume,
|
|
14461
|
-
icon: /* @__PURE__ */ (0,
|
|
14876
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Icon, { name: SORT_ICON_BY_VALUE.volume, size: "small", color: "currentColor" })
|
|
14462
14877
|
},
|
|
14463
14878
|
{
|
|
14464
14879
|
value: "endDate",
|
|
14465
14880
|
label: labels.eventList.sortByEndingSoon,
|
|
14466
|
-
icon: /* @__PURE__ */ (0,
|
|
14881
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Icon, { name: SORT_ICON_BY_VALUE.endDate, size: "small", color: "currentColor" })
|
|
14467
14882
|
}
|
|
14468
14883
|
];
|
|
14469
14884
|
}, [
|
|
@@ -14478,7 +14893,7 @@ var EventList = ({
|
|
|
14478
14893
|
setCategoryPath([]);
|
|
14479
14894
|
setCollapsedCategoryIds(/* @__PURE__ */ new Set());
|
|
14480
14895
|
}, [baseCategoryId, isDiscoveryFiltersEnabled]);
|
|
14481
|
-
const { categories: topLevelCategories } = (0,
|
|
14896
|
+
const { categories: topLevelCategories } = (0, import_hooks49.useCategories)({
|
|
14482
14897
|
queryKeyScope: "event-list-top-categories",
|
|
14483
14898
|
enabled: isDiscoveryFiltersEnabled,
|
|
14484
14899
|
limit: 100
|
|
@@ -14494,7 +14909,7 @@ var EventList = ({
|
|
|
14494
14909
|
])
|
|
14495
14910
|
);
|
|
14496
14911
|
}, [categoryPath, sortedTopLevelCategories]);
|
|
14497
|
-
const { childrenByParentId: baseChildrenByParentId } = (0,
|
|
14912
|
+
const { childrenByParentId: baseChildrenByParentId } = (0, import_hooks49.useCategoryChildren)({
|
|
14498
14913
|
queryKeyScope: "event-list-category-children",
|
|
14499
14914
|
enabled: isDiscoveryFiltersEnabled,
|
|
14500
14915
|
parentIds: baseCategoryChildPrefetchIds,
|
|
@@ -14515,7 +14930,7 @@ var EventList = ({
|
|
|
14515
14930
|
}
|
|
14516
14931
|
return Array.from(ids);
|
|
14517
14932
|
}, [baseCategoryId, baseChildrenByParentId, categoryPath]);
|
|
14518
|
-
const { childrenByParentId: visibleChildrenByParentId } = (0,
|
|
14933
|
+
const { childrenByParentId: visibleChildrenByParentId } = (0, import_hooks49.useCategoryChildren)({
|
|
14519
14934
|
queryKeyScope: "event-list-category-children",
|
|
14520
14935
|
enabled: isDiscoveryFiltersEnabled,
|
|
14521
14936
|
parentIds: visibleChildPrefetchIds,
|
|
@@ -14531,7 +14946,7 @@ var EventList = ({
|
|
|
14531
14946
|
}
|
|
14532
14947
|
return Array.from(ids);
|
|
14533
14948
|
}, [categoryPath, visibleChildrenByParentId]);
|
|
14534
|
-
const { childrenByParentId: visibleGrandchildrenByParentId } = (0,
|
|
14949
|
+
const { childrenByParentId: visibleGrandchildrenByParentId } = (0, import_hooks49.useCategoryChildren)({
|
|
14535
14950
|
queryKeyScope: "event-list-category-children",
|
|
14536
14951
|
enabled: isDiscoveryFiltersEnabled,
|
|
14537
14952
|
parentIds: visibleGrandchildPrefetchIds,
|
|
@@ -14587,14 +15002,14 @@ var EventList = ({
|
|
|
14587
15002
|
isFetchingNextPage,
|
|
14588
15003
|
isPlaceholderData,
|
|
14589
15004
|
loadedPageCount
|
|
14590
|
-
} = (0,
|
|
15005
|
+
} = (0, import_hooks49.useVenueEvents)({
|
|
14591
15006
|
queryKeyScope: "event-list",
|
|
14592
15007
|
venues,
|
|
14593
15008
|
search,
|
|
14594
15009
|
categoryIds: resolvedCategoryIds,
|
|
14595
15010
|
matchStatus,
|
|
14596
15011
|
limit: requestLimit,
|
|
14597
|
-
status: [
|
|
15012
|
+
status: [import_hooks49.MarketStatus.open],
|
|
14598
15013
|
sortBy: sortQueryParams.sortBy,
|
|
14599
15014
|
sortDir: sortQueryParams.sortDir,
|
|
14600
15015
|
endDateFrom,
|
|
@@ -14629,7 +15044,7 @@ var EventList = ({
|
|
|
14629
15044
|
const visibleMidpointVenueMarketIds = (0, import_react23.useMemo)(() => {
|
|
14630
15045
|
return collectMidpointVenueMarketIds(visibleVenueMarkets);
|
|
14631
15046
|
}, [visibleVenueMarkets]);
|
|
14632
|
-
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0,
|
|
15047
|
+
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0, import_hooks49.useVenueMarketMidpoints)({
|
|
14633
15048
|
venueMarketIds: visibleMidpointVenueMarketIds,
|
|
14634
15049
|
enabled: visibleMidpointVenueMarketIds.length > 0
|
|
14635
15050
|
});
|
|
@@ -14688,7 +15103,7 @@ var EventList = ({
|
|
|
14688
15103
|
onCategoryRootChange == null ? void 0 : onCategoryRootChange(baseCategoryId != null ? baseCategoryId : void 0);
|
|
14689
15104
|
};
|
|
14690
15105
|
if (shouldRenderLoadingState) {
|
|
14691
|
-
return /* @__PURE__ */ (0,
|
|
15106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14692
15107
|
Skeleton,
|
|
14693
15108
|
{
|
|
14694
15109
|
view: "event-list",
|
|
@@ -14697,8 +15112,8 @@ var EventList = ({
|
|
|
14697
15112
|
}
|
|
14698
15113
|
);
|
|
14699
15114
|
}
|
|
14700
|
-
return /* @__PURE__ */ (0,
|
|
14701
|
-
/* @__PURE__ */ (0,
|
|
15115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("section", { className: "agg-event-list flex w-full flex-col gap-2 md:gap-5 t", children: [
|
|
15116
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(
|
|
14702
15117
|
"header",
|
|
14703
15118
|
{
|
|
14704
15119
|
className: cn(
|
|
@@ -14707,9 +15122,9 @@ var EventList = ({
|
|
|
14707
15122
|
"gap-2 sm:flex-row sm:items-center sm:gap-4"
|
|
14708
15123
|
),
|
|
14709
15124
|
children: [
|
|
14710
|
-
/* @__PURE__ */ (0,
|
|
14711
|
-
/* @__PURE__ */ (0,
|
|
14712
|
-
/* @__PURE__ */ (0,
|
|
15125
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "agg-event-list-title min-w-32", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Typography, { as: "h2", variant: "title", className: "truncate first-letter:uppercase", children: title2 }) }),
|
|
15126
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "hidden min-w-0 max-w-full items-center gap-3 md:flex", children: [
|
|
15127
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14713
15128
|
EventListTabs,
|
|
14714
15129
|
{
|
|
14715
15130
|
ariaLabel: labels.eventList.tabsAria(title2),
|
|
@@ -14719,7 +15134,7 @@ var EventList = ({
|
|
|
14719
15134
|
overflowBehavior: "scroll"
|
|
14720
15135
|
}
|
|
14721
15136
|
),
|
|
14722
|
-
/* @__PURE__ */ (0,
|
|
15137
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14723
15138
|
Select,
|
|
14724
15139
|
{
|
|
14725
15140
|
ariaLabel: labels.eventList.sortByLabel,
|
|
@@ -14735,8 +15150,8 @@ var EventList = ({
|
|
|
14735
15150
|
]
|
|
14736
15151
|
}
|
|
14737
15152
|
),
|
|
14738
|
-
/* @__PURE__ */ (0,
|
|
14739
|
-
/* @__PURE__ */ (0,
|
|
15153
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "flex w-full gap-2 md:hidden mb-3", children: [
|
|
15154
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14740
15155
|
EventListTabs,
|
|
14741
15156
|
{
|
|
14742
15157
|
ariaLabel: labels.eventList.tabsAria(title2),
|
|
@@ -14746,7 +15161,7 @@ var EventList = ({
|
|
|
14746
15161
|
overflowBehavior: "select"
|
|
14747
15162
|
}
|
|
14748
15163
|
),
|
|
14749
|
-
/* @__PURE__ */ (0,
|
|
15164
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14750
15165
|
Select,
|
|
14751
15166
|
{
|
|
14752
15167
|
ariaLabel: labels.eventList.sortByLabel,
|
|
@@ -14757,23 +15172,23 @@ var EventList = ({
|
|
|
14757
15172
|
contentClassName: "rounded-[12px] py-2 shadow-[0_8px_16px_rgba(0,0,0,0.1)]"
|
|
14758
15173
|
}
|
|
14759
15174
|
),
|
|
14760
|
-
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0,
|
|
15175
|
+
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14761
15176
|
"button",
|
|
14762
15177
|
{
|
|
14763
15178
|
type: "button",
|
|
14764
15179
|
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",
|
|
14765
15180
|
"aria-label": labels.eventList.subcategoriesOpenAria,
|
|
14766
15181
|
onClick: () => setIsSubcategoriesModalOpen(true),
|
|
14767
|
-
children: /* @__PURE__ */ (0,
|
|
15182
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Icon, { name: "apps", size: "small", color: "currentColor" })
|
|
14768
15183
|
}
|
|
14769
15184
|
) : null
|
|
14770
15185
|
] }),
|
|
14771
|
-
/* @__PURE__ */ (0,
|
|
15186
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(
|
|
14772
15187
|
"div",
|
|
14773
15188
|
{
|
|
14774
15189
|
className: cn("flex w-full gap-6", shouldRenderSubcategoryFilters ? "md:items-start" : ""),
|
|
14775
15190
|
children: [
|
|
14776
|
-
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0,
|
|
15191
|
+
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("aside", { className: "hidden w-[200px] shrink-0 md:block self-start sticky top-4", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("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__ */ (0, import_jsx_runtime139.jsx)(
|
|
14777
15192
|
CategorySidebar,
|
|
14778
15193
|
{
|
|
14779
15194
|
baseCategoryId,
|
|
@@ -14786,7 +15201,7 @@ var EventList = ({
|
|
|
14786
15201
|
onToggleCategory: handleToggleSubcategory
|
|
14787
15202
|
}
|
|
14788
15203
|
) }) }) : null,
|
|
14789
|
-
/* @__PURE__ */ (0,
|
|
15204
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(
|
|
14790
15205
|
"div",
|
|
14791
15206
|
{
|
|
14792
15207
|
className: cn(
|
|
@@ -14797,7 +15212,7 @@ var EventList = ({
|
|
|
14797
15212
|
gridClassName
|
|
14798
15213
|
),
|
|
14799
15214
|
children: [
|
|
14800
|
-
tileEvents.map((event) => /* @__PURE__ */ (0,
|
|
15215
|
+
tileEvents.map((event) => /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14801
15216
|
EventListItem,
|
|
14802
15217
|
{
|
|
14803
15218
|
event,
|
|
@@ -14810,11 +15225,11 @@ var EventList = ({
|
|
|
14810
15225
|
onMarketClick,
|
|
14811
15226
|
getMarketHref,
|
|
14812
15227
|
href: getEventHref == null ? void 0 : getEventHref(event),
|
|
14813
|
-
marketStatus:
|
|
15228
|
+
marketStatus: import_hooks49.MarketStatus.open
|
|
14814
15229
|
},
|
|
14815
15230
|
event.id
|
|
14816
15231
|
)),
|
|
14817
|
-
shouldRenderPaginationLoadingItems ? Array.from({ length: 6 }).map((_, index) => /* @__PURE__ */ (0,
|
|
15232
|
+
shouldRenderPaginationLoadingItems ? Array.from({ length: 6 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14818
15233
|
EventListItem,
|
|
14819
15234
|
{
|
|
14820
15235
|
isLoading: true,
|
|
@@ -14824,20 +15239,20 @@ var EventList = ({
|
|
|
14824
15239
|
},
|
|
14825
15240
|
`loading-${index}`
|
|
14826
15241
|
)) : null,
|
|
14827
|
-
shouldRenderEmptyState ? /* @__PURE__ */ (0,
|
|
15242
|
+
shouldRenderEmptyState ? /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "col-span-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14828
15243
|
StateMessage,
|
|
14829
15244
|
{
|
|
14830
15245
|
title: labels.eventList.emptyTitle,
|
|
14831
15246
|
description: labels.eventList.emptyDescription,
|
|
14832
|
-
icon: /* @__PURE__ */ (0,
|
|
15247
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Icon, { name: "search-empty" })
|
|
14833
15248
|
}
|
|
14834
15249
|
) }) : null,
|
|
14835
|
-
isError ? /* @__PURE__ */ (0,
|
|
15250
|
+
isError ? /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "col-span-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14836
15251
|
StateMessage,
|
|
14837
15252
|
{
|
|
14838
15253
|
title: labels.eventList.errorTitle,
|
|
14839
15254
|
description: labels.eventList.errorDescription,
|
|
14840
|
-
icon: /* @__PURE__ */ (0,
|
|
15255
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Icon, { name: "warning" })
|
|
14841
15256
|
}
|
|
14842
15257
|
) }) : null
|
|
14843
15258
|
]
|
|
@@ -14846,7 +15261,7 @@ var EventList = ({
|
|
|
14846
15261
|
]
|
|
14847
15262
|
}
|
|
14848
15263
|
),
|
|
14849
|
-
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0,
|
|
15264
|
+
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Modal, { open: isSubcategoriesModalOpen, onOpenChange: setIsSubcategoriesModalOpen, children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14850
15265
|
Modal.Container,
|
|
14851
15266
|
{
|
|
14852
15267
|
classNames: {
|
|
@@ -14855,20 +15270,20 @@ var EventList = ({
|
|
|
14855
15270
|
content: "items-end p-0 pointer-events-none",
|
|
14856
15271
|
container: "w-full max-w-none border-0 bg-transparent shadow-none"
|
|
14857
15272
|
},
|
|
14858
|
-
children: /* @__PURE__ */ (0,
|
|
14859
|
-
/* @__PURE__ */ (0,
|
|
14860
|
-
/* @__PURE__ */ (0,
|
|
14861
|
-
/* @__PURE__ */ (0,
|
|
14862
|
-
/* @__PURE__ */ (0,
|
|
15273
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "pointer-events-auto w-full rounded-t-[12px] border border-agg-separator bg-agg-secondary", children: [
|
|
15274
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "flex justify-center pb-1 pt-3", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "h-1 w-10 rounded-full bg-agg-muted-foreground/30" }) }),
|
|
15275
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "flex items-center justify-between px-4 pb-2 pt-1", children: [
|
|
15276
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Dialog2.Title, { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.eventList.subcategoriesLabel }),
|
|
15277
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14863
15278
|
Dialog2.Close,
|
|
14864
15279
|
{
|
|
14865
15280
|
className: "flex cursor-pointer items-center justify-center rounded-full p-1 text-agg-muted-foreground hover:bg-agg-secondary-hover",
|
|
14866
15281
|
"aria-label": labels.common.close,
|
|
14867
|
-
children: /* @__PURE__ */ (0,
|
|
15282
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(CloseIcon, { className: "h-5 w-5" })
|
|
14868
15283
|
}
|
|
14869
15284
|
)
|
|
14870
15285
|
] }),
|
|
14871
|
-
/* @__PURE__ */ (0,
|
|
15286
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "flex flex-col gap-1 px-4 pb-4", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14872
15287
|
CategorySidebar,
|
|
14873
15288
|
{
|
|
14874
15289
|
baseCategoryId,
|
|
@@ -14884,7 +15299,7 @@ var EventList = ({
|
|
|
14884
15299
|
] })
|
|
14885
15300
|
}
|
|
14886
15301
|
) }) : null,
|
|
14887
|
-
shouldPaginate && hasNextPage ? /* @__PURE__ */ (0,
|
|
15302
|
+
shouldPaginate && hasNextPage ? /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { ref: loadMoreRef, className: "agg-event-list-sentinel h-px w-full", "aria-hidden": true }) : null
|
|
14888
15303
|
] });
|
|
14889
15304
|
};
|
|
14890
15305
|
EventList.displayName = "EventList";
|
|
@@ -14899,6 +15314,7 @@ EventList.displayName = "EventList";
|
|
|
14899
15314
|
Orderbook,
|
|
14900
15315
|
OrderbookWithStates,
|
|
14901
15316
|
SettlementSummary,
|
|
15317
|
+
SportsLiveScore,
|
|
14902
15318
|
collectEligibleVenueOutcomeIds,
|
|
14903
15319
|
collectEligibleVenueOutcomes,
|
|
14904
15320
|
formatProbabilityCents,
|