@agg-build/ui 4.2.0 → 4.7.1
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 +25 -16
- package/dist/{chunk-DNPDXL2D.mjs → chunk-3RQCBGIK.mjs} +341 -105
- package/dist/{chunk-GNEFI4SO.mjs → chunk-C4GFVJ62.mjs} +725 -400
- package/dist/{chunk-UDBHAZJJ.mjs → chunk-EOLR7DHL.mjs} +568 -145
- package/dist/{chunk-6X6Y4INU.mjs → chunk-LXQ3U4X2.mjs} +2 -2
- package/dist/{chunk-QW7VFURU.mjs → chunk-RDBMHBR2.mjs} +67 -3
- package/dist/{chunk-WDCH4RRS.mjs → chunk-WYCSTAN7.mjs} +1 -1
- package/dist/{chunk-FTL25XKE.mjs → chunk-XN2NB2NP.mjs} +1 -1
- package/dist/events.js +1149 -661
- package/dist/events.mjs +6 -4
- package/dist/index.js +3320 -2291
- package/dist/index.mjs +12 -8
- package/dist/modals.js +9 -2
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +2789 -1762
- 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 +338 -102
- 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/list/event-list.constants.d.mts +3 -1
- package/dist/types/events/list/event-list.constants.d.ts +3 -1
- package/dist/types/events/list/event-list.types.d.mts +17 -0
- package/dist/types/events/list/event-list.types.d.ts +17 -0
- package/dist/types/events/list/event-list.utils.d.mts +4 -0
- package/dist/types/events/list/event-list.utils.d.ts +4 -0
- package/dist/types/events/list/index.d.mts +2 -2
- package/dist/types/events/list/index.d.ts +2 -2
- 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/home/event-discovery-url-state.d.mts +35 -0
- package/dist/types/pages/home/event-discovery-url-state.d.ts +35 -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
|
|
@@ -4288,6 +4289,19 @@ var resolveCategoryIdsFromPath = (path, fallbackCategoryIds) => {
|
|
|
4288
4289
|
if (deepest) return [deepest];
|
|
4289
4290
|
return fallbackCategoryIds;
|
|
4290
4291
|
};
|
|
4292
|
+
var validateSubcategoryPath = (requestedPath, rootCategoryId, childrenByParentId) => {
|
|
4293
|
+
var _a;
|
|
4294
|
+
if (!rootCategoryId) return [];
|
|
4295
|
+
const validPath = [];
|
|
4296
|
+
let parentId = rootCategoryId;
|
|
4297
|
+
for (const categoryId of requestedPath) {
|
|
4298
|
+
const category = (_a = childrenByParentId.get(parentId)) == null ? void 0 : _a.find((child) => child.id === categoryId);
|
|
4299
|
+
if (!category) break;
|
|
4300
|
+
validPath.push(category.id);
|
|
4301
|
+
parentId = category.id;
|
|
4302
|
+
}
|
|
4303
|
+
return validPath;
|
|
4304
|
+
};
|
|
4291
4305
|
var resolveTabVenus = (tab, visibleVenues) => {
|
|
4292
4306
|
const applyAllowList = (venues) => {
|
|
4293
4307
|
if (!venues) {
|
|
@@ -5724,6 +5738,14 @@ var formatSportsEventTimeEt = (value) => {
|
|
|
5724
5738
|
|
|
5725
5739
|
// src/events/shared/format-event-title.ts
|
|
5726
5740
|
var SPORT_CATEGORY_TOKENS = /* @__PURE__ */ new Set(["sport", "sports"]);
|
|
5741
|
+
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;
|
|
5742
|
+
var RECURRING_CRYPTO_DURATION_SUFFIX = /\s+-\s+(?:5m(?:in)?|15m(?:in)?|1h|1d)$/i;
|
|
5743
|
+
var RECURRING_CRYPTO_DURATION_LABELS = {
|
|
5744
|
+
PT5M: "5min",
|
|
5745
|
+
PT15M: "15min",
|
|
5746
|
+
PT1H: "1h",
|
|
5747
|
+
P1D: "1d"
|
|
5748
|
+
};
|
|
5727
5749
|
var normalizeCategoryToken = (value) => {
|
|
5728
5750
|
if (typeof value !== "string") return null;
|
|
5729
5751
|
const normalizedValue = value.trim().toLowerCase();
|
|
@@ -5792,9 +5814,21 @@ var resolveEventHeading = ({
|
|
|
5792
5814
|
structureType,
|
|
5793
5815
|
gameStartTime,
|
|
5794
5816
|
endDate,
|
|
5795
|
-
venueMarkets
|
|
5817
|
+
venueMarkets,
|
|
5818
|
+
recurringCryptoWindowStart,
|
|
5819
|
+
recurringCryptoDuration
|
|
5796
5820
|
}) => {
|
|
5797
5821
|
const resolvedTitle = title2.trim();
|
|
5822
|
+
if (recurringCryptoWindowStart !== void 0) {
|
|
5823
|
+
const windowStartDate = recurringCryptoWindowStart == null ? null : new Date(recurringCryptoWindowStart);
|
|
5824
|
+
const timestampLabel = windowStartDate && !Number.isNaN(windowStartDate.getTime()) ? formatSportsEventTimeEt(windowStartDate.toISOString()) : null;
|
|
5825
|
+
const titleWithoutTimestamp = resolvedTitle.replace(RECURRING_CRYPTO_TIMESTAMP_SUFFIX, "").replace(RECURRING_CRYPTO_DURATION_SUFFIX, "").trim();
|
|
5826
|
+
const durationLabel = recurringCryptoDuration ? RECURRING_CRYPTO_DURATION_LABELS[recurringCryptoDuration] : null;
|
|
5827
|
+
return {
|
|
5828
|
+
title: durationLabel ? `${titleWithoutTimestamp} - ${durationLabel}` : titleWithoutTimestamp,
|
|
5829
|
+
timestampLabel
|
|
5830
|
+
};
|
|
5831
|
+
}
|
|
5798
5832
|
return {
|
|
5799
5833
|
title: resolvedTitle,
|
|
5800
5834
|
timestampLabel: resolveEventTimestampLabel({
|
|
@@ -6064,8 +6098,141 @@ var resolveDisplayVolume = (eventVolume, venueMarkets) => {
|
|
|
6064
6098
|
return void 0;
|
|
6065
6099
|
};
|
|
6066
6100
|
|
|
6067
|
-
// src/primitives/
|
|
6101
|
+
// src/primitives/loading-icon/index.tsx
|
|
6068
6102
|
var import_hooks27 = require("@agg-build/hooks");
|
|
6103
|
+
|
|
6104
|
+
// src/primitives/loading-icon/loading-icon.constants.ts
|
|
6105
|
+
var LOADING_ICON_DEFAULT_SIZE = "medium";
|
|
6106
|
+
var LOADING_ICON_SVG_VIEW_BOX = "0 0 44 44";
|
|
6107
|
+
var LOADING_ICON_PROMINENT_FRAME_CLASS = "h-12 w-12";
|
|
6108
|
+
var LOADING_ICON_PROMINENT_STROKE = 2;
|
|
6109
|
+
var LOADING_ICON_PROMINENT_DASHARRAY = "75 25";
|
|
6110
|
+
|
|
6111
|
+
// src/primitives/loading-icon/loading-icon.utils.ts
|
|
6112
|
+
var resolveLoadingIconAriaLabel = ({
|
|
6113
|
+
ariaLabel,
|
|
6114
|
+
fallbackLabel
|
|
6115
|
+
}) => {
|
|
6116
|
+
return ariaLabel != null ? ariaLabel : fallbackLabel;
|
|
6117
|
+
};
|
|
6118
|
+
|
|
6119
|
+
// src/primitives/loading-icon/index.tsx
|
|
6120
|
+
var import_jsx_runtime117 = require("react/jsx-runtime");
|
|
6121
|
+
var LoadingIcon = ({
|
|
6122
|
+
size = LOADING_ICON_DEFAULT_SIZE,
|
|
6123
|
+
variant = "default",
|
|
6124
|
+
className,
|
|
6125
|
+
ariaLabel
|
|
6126
|
+
}) => {
|
|
6127
|
+
const labels = (0, import_hooks27.useLabels)();
|
|
6128
|
+
const {
|
|
6129
|
+
features: { enableAnimations }
|
|
6130
|
+
} = (0, import_hooks27.useSdkUiConfig)();
|
|
6131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6132
|
+
"span",
|
|
6133
|
+
{
|
|
6134
|
+
role: "status",
|
|
6135
|
+
"aria-label": resolveLoadingIconAriaLabel({
|
|
6136
|
+
ariaLabel,
|
|
6137
|
+
fallbackLabel: labels.common.loading
|
|
6138
|
+
}),
|
|
6139
|
+
className: cn(
|
|
6140
|
+
"group/agg-loading-icon",
|
|
6141
|
+
"inline-grid place-items-center text-agg-primary will-change-transform",
|
|
6142
|
+
className
|
|
6143
|
+
),
|
|
6144
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("span", { className: "inline-grid place-items-center", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6145
|
+
"svg",
|
|
6146
|
+
{
|
|
6147
|
+
viewBox: LOADING_ICON_SVG_VIEW_BOX,
|
|
6148
|
+
className: cn(
|
|
6149
|
+
"block",
|
|
6150
|
+
variant === "prominent" ? LOADING_ICON_PROMINENT_FRAME_CLASS : iconSizeClasses[size]
|
|
6151
|
+
),
|
|
6152
|
+
children: variant === "prominent" ? /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("g", { children: [
|
|
6153
|
+
enableAnimations ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6154
|
+
"animateTransform",
|
|
6155
|
+
{
|
|
6156
|
+
attributeName: "transform",
|
|
6157
|
+
attributeType: "XML",
|
|
6158
|
+
type: "rotate",
|
|
6159
|
+
from: "0 22 22",
|
|
6160
|
+
to: "360 22 22",
|
|
6161
|
+
dur: "0.85s",
|
|
6162
|
+
repeatCount: "indefinite"
|
|
6163
|
+
}
|
|
6164
|
+
) : null,
|
|
6165
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6166
|
+
"circle",
|
|
6167
|
+
{
|
|
6168
|
+
cx: "22",
|
|
6169
|
+
cy: "22",
|
|
6170
|
+
r: "16",
|
|
6171
|
+
fill: "none",
|
|
6172
|
+
pathLength: 100,
|
|
6173
|
+
stroke: "currentColor",
|
|
6174
|
+
strokeWidth: LOADING_ICON_PROMINENT_STROKE,
|
|
6175
|
+
strokeLinecap: "round",
|
|
6176
|
+
strokeDasharray: LOADING_ICON_PROMINENT_DASHARRAY
|
|
6177
|
+
}
|
|
6178
|
+
)
|
|
6179
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("g", { children: [
|
|
6180
|
+
enableAnimations ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6181
|
+
"animateTransform",
|
|
6182
|
+
{
|
|
6183
|
+
attributeName: "transform",
|
|
6184
|
+
attributeType: "XML",
|
|
6185
|
+
type: "rotate",
|
|
6186
|
+
from: "0 22 22",
|
|
6187
|
+
to: "360 22 22",
|
|
6188
|
+
dur: "1.4s",
|
|
6189
|
+
repeatCount: "indefinite"
|
|
6190
|
+
}
|
|
6191
|
+
) : null,
|
|
6192
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6193
|
+
"circle",
|
|
6194
|
+
{
|
|
6195
|
+
cx: "22",
|
|
6196
|
+
cy: "22",
|
|
6197
|
+
r: "16",
|
|
6198
|
+
fill: "none",
|
|
6199
|
+
stroke: "currentColor",
|
|
6200
|
+
strokeWidth: 6,
|
|
6201
|
+
strokeLinecap: "round",
|
|
6202
|
+
strokeDasharray: "60 100",
|
|
6203
|
+
strokeDashoffset: "0",
|
|
6204
|
+
children: enableAnimations ? /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(import_jsx_runtime117.Fragment, { children: [
|
|
6205
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6206
|
+
"animate",
|
|
6207
|
+
{
|
|
6208
|
+
attributeName: "stroke-dasharray",
|
|
6209
|
+
values: "1 100;60 100;1 100",
|
|
6210
|
+
dur: "1.2s",
|
|
6211
|
+
repeatCount: "indefinite"
|
|
6212
|
+
}
|
|
6213
|
+
),
|
|
6214
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6215
|
+
"animate",
|
|
6216
|
+
{
|
|
6217
|
+
attributeName: "stroke-dashoffset",
|
|
6218
|
+
values: "0;-25;-100",
|
|
6219
|
+
dur: "1.2s",
|
|
6220
|
+
repeatCount: "indefinite"
|
|
6221
|
+
}
|
|
6222
|
+
)
|
|
6223
|
+
] }) : null
|
|
6224
|
+
}
|
|
6225
|
+
)
|
|
6226
|
+
] })
|
|
6227
|
+
}
|
|
6228
|
+
) })
|
|
6229
|
+
}
|
|
6230
|
+
);
|
|
6231
|
+
};
|
|
6232
|
+
LoadingIcon.displayName = "LoadingIcon";
|
|
6233
|
+
|
|
6234
|
+
// src/primitives/modal/index.tsx
|
|
6235
|
+
var import_hooks28 = require("@agg-build/hooks");
|
|
6069
6236
|
var Dialog = __toESM(require("@radix-ui/react-dialog"));
|
|
6070
6237
|
|
|
6071
6238
|
// src/primitives/modal/modal.constants.ts
|
|
@@ -6089,7 +6256,7 @@ var resolveModalCloseIcon = ({
|
|
|
6089
6256
|
};
|
|
6090
6257
|
|
|
6091
6258
|
// src/primitives/modal/index.tsx
|
|
6092
|
-
var
|
|
6259
|
+
var import_jsx_runtime118 = require("react/jsx-runtime");
|
|
6093
6260
|
var Modal = ({
|
|
6094
6261
|
open,
|
|
6095
6262
|
onOpenChange,
|
|
@@ -6097,7 +6264,7 @@ var Modal = ({
|
|
|
6097
6264
|
"aria-label": _ariaLabel,
|
|
6098
6265
|
"aria-labelledby": _ariaLabelledBy
|
|
6099
6266
|
}) => {
|
|
6100
|
-
return /* @__PURE__ */ (0,
|
|
6267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(Dialog.Root, { open, onOpenChange, children });
|
|
6101
6268
|
};
|
|
6102
6269
|
var ModalContainer = ({
|
|
6103
6270
|
children,
|
|
@@ -6109,11 +6276,11 @@ var ModalContainer = ({
|
|
|
6109
6276
|
const {
|
|
6110
6277
|
general: { rootClassName },
|
|
6111
6278
|
features: { enableAnimations }
|
|
6112
|
-
} = (0,
|
|
6279
|
+
} = (0, import_hooks28.useSdkUiConfig)();
|
|
6113
6280
|
const overlayAnimationClassName = resolveModalOverlayAnimationClassName(enableAnimations);
|
|
6114
6281
|
const panelAnimationClassName = resolveModalPanelAnimationClassName(enableAnimations);
|
|
6115
|
-
return /* @__PURE__ */ (0,
|
|
6116
|
-
/* @__PURE__ */ (0,
|
|
6282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(Dialog.Portal, { children: [
|
|
6283
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
6117
6284
|
Dialog.Overlay,
|
|
6118
6285
|
{
|
|
6119
6286
|
className: cn(
|
|
@@ -6124,7 +6291,7 @@ var ModalContainer = ({
|
|
|
6124
6291
|
)
|
|
6125
6292
|
}
|
|
6126
6293
|
),
|
|
6127
|
-
/* @__PURE__ */ (0,
|
|
6294
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
6128
6295
|
Dialog.Content,
|
|
6129
6296
|
{
|
|
6130
6297
|
className: cn(
|
|
@@ -6150,7 +6317,7 @@ var ModalContainer = ({
|
|
|
6150
6317
|
event.preventDefault();
|
|
6151
6318
|
}
|
|
6152
6319
|
},
|
|
6153
|
-
children: /* @__PURE__ */ (0,
|
|
6320
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
6154
6321
|
"div",
|
|
6155
6322
|
{
|
|
6156
6323
|
className: cn(
|
|
@@ -6158,7 +6325,7 @@ var ModalContainer = ({
|
|
|
6158
6325
|
"items-end md:items-center",
|
|
6159
6326
|
"flex h-full min-h-0 w-full justify-center p-0 md:p-5"
|
|
6160
6327
|
),
|
|
6161
|
-
children: /* @__PURE__ */ (0,
|
|
6328
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
6162
6329
|
"div",
|
|
6163
6330
|
{
|
|
6164
6331
|
className: cn(
|
|
@@ -6198,14 +6365,14 @@ var ModalHeader = ({
|
|
|
6198
6365
|
}) => {
|
|
6199
6366
|
const {
|
|
6200
6367
|
features: { enableAnimations }
|
|
6201
|
-
} = (0,
|
|
6202
|
-
const labels = (0,
|
|
6203
|
-
const defaultCloseIcon = /* @__PURE__ */ (0,
|
|
6368
|
+
} = (0, import_hooks28.useSdkUiConfig)();
|
|
6369
|
+
const labels = (0, import_hooks28.useLabels)();
|
|
6370
|
+
const defaultCloseIcon = /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(CloseIcon, { className: "h-6 w-6" });
|
|
6204
6371
|
const resolvedCloseIcon = resolveModalCloseIcon({
|
|
6205
6372
|
closeIcon,
|
|
6206
6373
|
defaultCloseIcon
|
|
6207
6374
|
});
|
|
6208
|
-
return /* @__PURE__ */ (0,
|
|
6375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(
|
|
6209
6376
|
"div",
|
|
6210
6377
|
{
|
|
6211
6378
|
className: cn(
|
|
@@ -6218,7 +6385,7 @@ var ModalHeader = ({
|
|
|
6218
6385
|
classNames == null ? void 0 : classNames.root
|
|
6219
6386
|
),
|
|
6220
6387
|
children: [
|
|
6221
|
-
/* @__PURE__ */ (0,
|
|
6388
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(
|
|
6222
6389
|
"div",
|
|
6223
6390
|
{
|
|
6224
6391
|
className: cn(
|
|
@@ -6231,8 +6398,8 @@ var ModalHeader = ({
|
|
|
6231
6398
|
classNames == null ? void 0 : classNames.container
|
|
6232
6399
|
),
|
|
6233
6400
|
children: [
|
|
6234
|
-
leftElement ? /* @__PURE__ */ (0,
|
|
6235
|
-
/* @__PURE__ */ (0,
|
|
6401
|
+
leftElement ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_jsx_runtime118.Fragment, { children: leftElement }) : null,
|
|
6402
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(
|
|
6236
6403
|
"div",
|
|
6237
6404
|
{
|
|
6238
6405
|
className: cn(
|
|
@@ -6241,7 +6408,7 @@ var ModalHeader = ({
|
|
|
6241
6408
|
classNames == null ? void 0 : classNames.titleContainer
|
|
6242
6409
|
),
|
|
6243
6410
|
children: [
|
|
6244
|
-
/* @__PURE__ */ (0,
|
|
6411
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
6245
6412
|
Dialog.Title,
|
|
6246
6413
|
{
|
|
6247
6414
|
className: cn(
|
|
@@ -6255,7 +6422,7 @@ var ModalHeader = ({
|
|
|
6255
6422
|
children: title2
|
|
6256
6423
|
}
|
|
6257
6424
|
),
|
|
6258
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
6425
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
6259
6426
|
"span",
|
|
6260
6427
|
{
|
|
6261
6428
|
className: cn(
|
|
@@ -6269,9 +6436,9 @@ var ModalHeader = ({
|
|
|
6269
6436
|
]
|
|
6270
6437
|
}
|
|
6271
6438
|
),
|
|
6272
|
-
/* @__PURE__ */ (0,
|
|
6273
|
-
rightElement ? /* @__PURE__ */ (0,
|
|
6274
|
-
!hideClose && /* @__PURE__ */ (0,
|
|
6439
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: "agg-modal-header-actions flex flex-row items-center justify-end gap-6", children: [
|
|
6440
|
+
rightElement ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_jsx_runtime118.Fragment, { children: rightElement }) : null,
|
|
6441
|
+
!hideClose && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
6275
6442
|
Dialog.Close,
|
|
6276
6443
|
{
|
|
6277
6444
|
className: cn(
|
|
@@ -6288,14 +6455,14 @@ var ModalHeader = ({
|
|
|
6288
6455
|
]
|
|
6289
6456
|
}
|
|
6290
6457
|
),
|
|
6291
|
-
children ? /* @__PURE__ */ (0,
|
|
6458
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: "agg-modal-header-extra", children }) : null
|
|
6292
6459
|
]
|
|
6293
6460
|
}
|
|
6294
6461
|
);
|
|
6295
6462
|
};
|
|
6296
6463
|
Modal.Header = ModalHeader;
|
|
6297
6464
|
var ModalBody = ({ children, classNames }) => {
|
|
6298
|
-
return /* @__PURE__ */ (0,
|
|
6465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
6299
6466
|
"div",
|
|
6300
6467
|
{
|
|
6301
6468
|
className: cn(
|
|
@@ -6316,7 +6483,7 @@ var ModalFooter = ({
|
|
|
6316
6483
|
classNames,
|
|
6317
6484
|
hideBorder = false
|
|
6318
6485
|
}) => {
|
|
6319
|
-
return /* @__PURE__ */ (0,
|
|
6486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
6320
6487
|
"div",
|
|
6321
6488
|
{
|
|
6322
6489
|
className: cn(
|
|
@@ -6337,7 +6504,7 @@ Modal.Footer = ModalFooter;
|
|
|
6337
6504
|
Modal.displayName = "Modal";
|
|
6338
6505
|
|
|
6339
6506
|
// src/primitives/select/index.tsx
|
|
6340
|
-
var
|
|
6507
|
+
var import_hooks29 = require("@agg-build/hooks");
|
|
6341
6508
|
var import_react5 = require("react");
|
|
6342
6509
|
var import_react_dom = require("react-dom");
|
|
6343
6510
|
|
|
@@ -6359,7 +6526,7 @@ var resolveIsSelectDisabled = ({
|
|
|
6359
6526
|
};
|
|
6360
6527
|
|
|
6361
6528
|
// src/primitives/select/index.tsx
|
|
6362
|
-
var
|
|
6529
|
+
var import_jsx_runtime119 = require("react/jsx-runtime");
|
|
6363
6530
|
var SELECT_DROPDOWN_Z = 1e4;
|
|
6364
6531
|
function resolveSelectPortalContainer(triggerRoot) {
|
|
6365
6532
|
var _a, _b;
|
|
@@ -6382,11 +6549,11 @@ var Select = ({
|
|
|
6382
6549
|
contentSideOffset = 8
|
|
6383
6550
|
}) => {
|
|
6384
6551
|
var _a;
|
|
6385
|
-
const labels = (0,
|
|
6552
|
+
const labels = (0, import_hooks29.useLabels)();
|
|
6386
6553
|
const {
|
|
6387
6554
|
general: { rootClassName },
|
|
6388
6555
|
features: { enableAnimations }
|
|
6389
|
-
} = (0,
|
|
6556
|
+
} = (0, import_hooks29.useSdkUiConfig)();
|
|
6390
6557
|
const isDisabled = resolveIsSelectDisabled({ disabled, items });
|
|
6391
6558
|
const selectedItem = resolveSelectedItem(items, value);
|
|
6392
6559
|
const [isOpen, setIsOpen] = (0, import_react5.useState)(false);
|
|
@@ -6478,7 +6645,7 @@ var Select = ({
|
|
|
6478
6645
|
};
|
|
6479
6646
|
const isInline = variant === "inline";
|
|
6480
6647
|
const triggerRadiusClass = triggerClassName != null ? triggerClassName : isInline ? "rounded-agg-sm" : "rounded-agg-md";
|
|
6481
|
-
const listbox = menuRect ? /* @__PURE__ */ (0,
|
|
6648
|
+
const listbox = menuRect ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
6482
6649
|
"div",
|
|
6483
6650
|
{
|
|
6484
6651
|
ref: portalRef,
|
|
@@ -6506,7 +6673,7 @@ var Select = ({
|
|
|
6506
6673
|
const isSelected = item.value === value;
|
|
6507
6674
|
const isHidden = item.hidden === true;
|
|
6508
6675
|
if (isHidden) return null;
|
|
6509
|
-
return /* @__PURE__ */ (0,
|
|
6676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
|
|
6510
6677
|
"button",
|
|
6511
6678
|
{
|
|
6512
6679
|
type: "button",
|
|
@@ -6530,14 +6697,14 @@ var Select = ({
|
|
|
6530
6697
|
handleClose();
|
|
6531
6698
|
},
|
|
6532
6699
|
children: [
|
|
6533
|
-
isInline && isSelected ? /* @__PURE__ */ (0,
|
|
6700
|
+
isInline && isSelected ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
6534
6701
|
"span",
|
|
6535
6702
|
{
|
|
6536
6703
|
className: "agg-select-item-indicator absolute bottom-2 left-0 top-2 w-1 bg-agg-primary",
|
|
6537
6704
|
"aria-hidden": true
|
|
6538
6705
|
}
|
|
6539
6706
|
) : null,
|
|
6540
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
6707
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
6541
6708
|
"span",
|
|
6542
6709
|
{
|
|
6543
6710
|
className: cn(
|
|
@@ -6546,7 +6713,7 @@ var Select = ({
|
|
|
6546
6713
|
),
|
|
6547
6714
|
children: item.icon
|
|
6548
6715
|
}
|
|
6549
|
-
) : item.iconUrl ? /* @__PURE__ */ (0,
|
|
6716
|
+
) : item.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
6550
6717
|
RemoteImage,
|
|
6551
6718
|
{
|
|
6552
6719
|
src: item.iconUrl,
|
|
@@ -6554,7 +6721,7 @@ var Select = ({
|
|
|
6554
6721
|
className: "agg-select-item-icon h-4 w-4 shrink-0 rounded-sm object-contain"
|
|
6555
6722
|
}
|
|
6556
6723
|
) : null,
|
|
6557
|
-
/* @__PURE__ */ (0,
|
|
6724
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { className: "agg-select-item-label truncate", children: item.label })
|
|
6558
6725
|
]
|
|
6559
6726
|
},
|
|
6560
6727
|
item.value
|
|
@@ -6562,7 +6729,7 @@ var Select = ({
|
|
|
6562
6729
|
})
|
|
6563
6730
|
}
|
|
6564
6731
|
) : null;
|
|
6565
|
-
return /* @__PURE__ */ (0,
|
|
6732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
|
|
6566
6733
|
"div",
|
|
6567
6734
|
{
|
|
6568
6735
|
ref: containerRef,
|
|
@@ -6572,7 +6739,7 @@ var Select = ({
|
|
|
6572
6739
|
className
|
|
6573
6740
|
),
|
|
6574
6741
|
children: [
|
|
6575
|
-
/* @__PURE__ */ (0,
|
|
6742
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
|
|
6576
6743
|
"button",
|
|
6577
6744
|
{
|
|
6578
6745
|
type: "button",
|
|
@@ -6596,7 +6763,7 @@ var Select = ({
|
|
|
6596
6763
|
onPointerEnter: handlePointerEnter,
|
|
6597
6764
|
onPointerLeave: handlePointerLeave,
|
|
6598
6765
|
children: [
|
|
6599
|
-
(selectedItem == null ? void 0 : selectedItem.icon) ? /* @__PURE__ */ (0,
|
|
6766
|
+
(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
6767
|
RemoteImage,
|
|
6601
6768
|
{
|
|
6602
6769
|
src: selectedItem.iconUrl,
|
|
@@ -6604,18 +6771,18 @@ var Select = ({
|
|
|
6604
6771
|
className: "agg-select-icon h-4 w-4 shrink-0 rounded-sm object-contain"
|
|
6605
6772
|
}
|
|
6606
6773
|
) : null,
|
|
6607
|
-
/* @__PURE__ */ (0,
|
|
6774
|
+
/* @__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
6775
|
]
|
|
6609
6776
|
}
|
|
6610
6777
|
),
|
|
6611
|
-
/* @__PURE__ */ (0,
|
|
6778
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
6612
6779
|
"span",
|
|
6613
6780
|
{
|
|
6614
6781
|
className: cn(
|
|
6615
6782
|
"agg-select-chevron pointer-events-none absolute inset-y-0 inline-flex items-center justify-center",
|
|
6616
6783
|
isInline ? "right-2 text-agg-foreground" : "right-3 text-agg-muted-foreground"
|
|
6617
6784
|
),
|
|
6618
|
-
children: /* @__PURE__ */ (0,
|
|
6785
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
6619
6786
|
Icon,
|
|
6620
6787
|
{
|
|
6621
6788
|
name: isOpen ? "chevron-up" : "chevron-down-thin",
|
|
@@ -6634,7 +6801,7 @@ Select.displayName = "Select";
|
|
|
6634
6801
|
|
|
6635
6802
|
// src/primitives/state-message/index.tsx
|
|
6636
6803
|
var import_react6 = require("react");
|
|
6637
|
-
var
|
|
6804
|
+
var import_hooks30 = require("@agg-build/hooks");
|
|
6638
6805
|
|
|
6639
6806
|
// src/primitives/typography/typography.constants.ts
|
|
6640
6807
|
var display = cn("agg-type-display");
|
|
@@ -6699,7 +6866,7 @@ var getTypographyClassName = ({
|
|
|
6699
6866
|
};
|
|
6700
6867
|
|
|
6701
6868
|
// src/primitives/typography/index.tsx
|
|
6702
|
-
var
|
|
6869
|
+
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
6703
6870
|
var Typography = ({
|
|
6704
6871
|
as: Component = "p",
|
|
6705
6872
|
variant = "body",
|
|
@@ -6707,7 +6874,7 @@ var Typography = ({
|
|
|
6707
6874
|
children,
|
|
6708
6875
|
"aria-label": ariaLabel
|
|
6709
6876
|
}) => {
|
|
6710
|
-
return /* @__PURE__ */ (0,
|
|
6877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Component, { className: getTypographyClassName({ className, variant }), "aria-label": ariaLabel, children });
|
|
6711
6878
|
};
|
|
6712
6879
|
Typography.displayName = "Typography";
|
|
6713
6880
|
|
|
@@ -6720,7 +6887,7 @@ var resolveStateMessageHasAction = ({ onAction }) => {
|
|
|
6720
6887
|
};
|
|
6721
6888
|
|
|
6722
6889
|
// src/primitives/state-message/index.tsx
|
|
6723
|
-
var
|
|
6890
|
+
var import_jsx_runtime121 = require("react/jsx-runtime");
|
|
6724
6891
|
var StateMessage = (_a) => {
|
|
6725
6892
|
var _b = _a, {
|
|
6726
6893
|
icon,
|
|
@@ -6735,13 +6902,13 @@ var StateMessage = (_a) => {
|
|
|
6735
6902
|
"onAction",
|
|
6736
6903
|
"classNames"
|
|
6737
6904
|
]);
|
|
6738
|
-
const labels = (0,
|
|
6905
|
+
const labels = (0, import_hooks30.useLabels)();
|
|
6739
6906
|
const hasAction = resolveStateMessageHasAction({ onAction });
|
|
6740
6907
|
const resolvedIcon = (0, import_react6.cloneElement)(icon, {
|
|
6741
6908
|
className: cn(STATE_MESSAGE_ICON_CLASS_NAME, icon.props.className, classNames == null ? void 0 : classNames.icon),
|
|
6742
6909
|
"aria-hidden": true
|
|
6743
6910
|
});
|
|
6744
|
-
return /* @__PURE__ */ (0,
|
|
6911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
6745
6912
|
"div",
|
|
6746
6913
|
__spreadProps(__spreadValues({}, rest), {
|
|
6747
6914
|
className: cn(
|
|
@@ -6752,7 +6919,7 @@ var StateMessage = (_a) => {
|
|
|
6752
6919
|
role: "status",
|
|
6753
6920
|
"aria-live": "polite",
|
|
6754
6921
|
"aria-label": title2,
|
|
6755
|
-
children: /* @__PURE__ */ (0,
|
|
6922
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(
|
|
6756
6923
|
"div",
|
|
6757
6924
|
{
|
|
6758
6925
|
className: cn(
|
|
@@ -6761,7 +6928,7 @@ var StateMessage = (_a) => {
|
|
|
6761
6928
|
),
|
|
6762
6929
|
children: [
|
|
6763
6930
|
resolvedIcon,
|
|
6764
|
-
/* @__PURE__ */ (0,
|
|
6931
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(
|
|
6765
6932
|
"div",
|
|
6766
6933
|
{
|
|
6767
6934
|
className: cn(
|
|
@@ -6769,8 +6936,8 @@ var StateMessage = (_a) => {
|
|
|
6769
6936
|
classNames == null ? void 0 : classNames.text
|
|
6770
6937
|
),
|
|
6771
6938
|
children: [
|
|
6772
|
-
/* @__PURE__ */ (0,
|
|
6773
|
-
description ? /* @__PURE__ */ (0,
|
|
6939
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Typography, { variant: "body-strong", className: classNames == null ? void 0 : classNames.title, children: title2 }),
|
|
6940
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
6774
6941
|
Typography,
|
|
6775
6942
|
{
|
|
6776
6943
|
variant: "label",
|
|
@@ -6781,7 +6948,7 @@ var StateMessage = (_a) => {
|
|
|
6781
6948
|
]
|
|
6782
6949
|
}
|
|
6783
6950
|
),
|
|
6784
|
-
hasAction ? /* @__PURE__ */ (0,
|
|
6951
|
+
hasAction ? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
6785
6952
|
Button,
|
|
6786
6953
|
{
|
|
6787
6954
|
variant: "tertiary",
|
|
@@ -6808,7 +6975,7 @@ var StateMessage = (_a) => {
|
|
|
6808
6975
|
StateMessage.displayName = "StateMessage";
|
|
6809
6976
|
|
|
6810
6977
|
// src/primitives/tabs/index.tsx
|
|
6811
|
-
var
|
|
6978
|
+
var import_hooks31 = require("@agg-build/hooks");
|
|
6812
6979
|
var import_react8 = require("react");
|
|
6813
6980
|
|
|
6814
6981
|
// src/shared/use-horizontal-scroll-state.ts
|
|
@@ -6883,7 +7050,7 @@ var findEdgeEnabledIndex = (items, direction) => {
|
|
|
6883
7050
|
};
|
|
6884
7051
|
|
|
6885
7052
|
// src/primitives/tabs/index.tsx
|
|
6886
|
-
var
|
|
7053
|
+
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
6887
7054
|
var getTabButtonClassName = ({
|
|
6888
7055
|
enableAnimations,
|
|
6889
7056
|
isBarVariant,
|
|
@@ -6926,10 +7093,10 @@ var Tabs = ({
|
|
|
6926
7093
|
className,
|
|
6927
7094
|
classNames
|
|
6928
7095
|
}) => {
|
|
6929
|
-
const labels = (0,
|
|
7096
|
+
const labels = (0, import_hooks31.useLabels)();
|
|
6930
7097
|
const {
|
|
6931
7098
|
features: { enableAnimations }
|
|
6932
|
-
} = (0,
|
|
7099
|
+
} = (0, import_hooks31.useSdkUiConfig)();
|
|
6933
7100
|
const buttonRefs = (0, import_react8.useRef)([]);
|
|
6934
7101
|
const dragStateRef = (0, import_react8.useRef)({
|
|
6935
7102
|
isPointerDown: false,
|
|
@@ -7143,7 +7310,7 @@ var Tabs = ({
|
|
|
7143
7310
|
width: activeButton.offsetWidth,
|
|
7144
7311
|
opacity: 1
|
|
7145
7312
|
});
|
|
7146
|
-
}, [isBarVariant, renderedItems, value]);
|
|
7313
|
+
}, [isBarVariant, renderedItems, tabListRef, value]);
|
|
7147
7314
|
(0, import_react8.useLayoutEffect)(() => {
|
|
7148
7315
|
updateActiveUnderline();
|
|
7149
7316
|
}, [updateActiveUnderline]);
|
|
@@ -7202,9 +7369,16 @@ var Tabs = ({
|
|
|
7202
7369
|
requestAnimationFrame(() => {
|
|
7203
7370
|
updateScrollState();
|
|
7204
7371
|
});
|
|
7205
|
-
}, [
|
|
7372
|
+
}, [
|
|
7373
|
+
enableAnimations,
|
|
7374
|
+
renderedItems,
|
|
7375
|
+
shouldUseOverflowScroll,
|
|
7376
|
+
tabListRef,
|
|
7377
|
+
updateScrollState,
|
|
7378
|
+
value
|
|
7379
|
+
]);
|
|
7206
7380
|
if (shouldUseOverflowSelect) {
|
|
7207
|
-
return /* @__PURE__ */ (0,
|
|
7381
|
+
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
7382
|
Select,
|
|
7209
7383
|
{
|
|
7210
7384
|
ariaLabel,
|
|
@@ -7216,7 +7390,7 @@ var Tabs = ({
|
|
|
7216
7390
|
}
|
|
7217
7391
|
) });
|
|
7218
7392
|
}
|
|
7219
|
-
return /* @__PURE__ */ (0,
|
|
7393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
|
|
7220
7394
|
"div",
|
|
7221
7395
|
{
|
|
7222
7396
|
className: cn(
|
|
@@ -7227,7 +7401,7 @@ var Tabs = ({
|
|
|
7227
7401
|
classNames == null ? void 0 : classNames.root
|
|
7228
7402
|
),
|
|
7229
7403
|
children: [
|
|
7230
|
-
/* @__PURE__ */ (0,
|
|
7404
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
|
|
7231
7405
|
"div",
|
|
7232
7406
|
{
|
|
7233
7407
|
ref: tabListRef,
|
|
@@ -7241,7 +7415,7 @@ var Tabs = ({
|
|
|
7241
7415
|
onPointerUp: handleEndTabListDrag,
|
|
7242
7416
|
onWheel: handleTabListWheel,
|
|
7243
7417
|
children: [
|
|
7244
|
-
shouldUseOverflowScroll && !isBarVariant && hasOverflow ? /* @__PURE__ */ (0,
|
|
7418
|
+
shouldUseOverflowScroll && !isBarVariant && hasOverflow ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
7245
7419
|
"span",
|
|
7246
7420
|
{
|
|
7247
7421
|
"aria-hidden": true,
|
|
@@ -7252,7 +7426,7 @@ var Tabs = ({
|
|
|
7252
7426
|
var _a;
|
|
7253
7427
|
const isActive = item.value === value;
|
|
7254
7428
|
const isComingSoon = (_a = item == null ? void 0 : item.isComingSoon) != null ? _a : false;
|
|
7255
|
-
return /* @__PURE__ */ (0,
|
|
7429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
|
|
7256
7430
|
"button",
|
|
7257
7431
|
{
|
|
7258
7432
|
ref: (buttonElement) => {
|
|
@@ -7288,7 +7462,7 @@ var Tabs = ({
|
|
|
7288
7462
|
),
|
|
7289
7463
|
children: [
|
|
7290
7464
|
item.icon ? item.icon : null,
|
|
7291
|
-
/* @__PURE__ */ (0,
|
|
7465
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
|
|
7292
7466
|
"span",
|
|
7293
7467
|
{
|
|
7294
7468
|
className: cn(
|
|
@@ -7306,7 +7480,7 @@ var Tabs = ({
|
|
|
7306
7480
|
item.value
|
|
7307
7481
|
);
|
|
7308
7482
|
}),
|
|
7309
|
-
!isBarVariant ? /* @__PURE__ */ (0,
|
|
7483
|
+
!isBarVariant ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
7310
7484
|
"span",
|
|
7311
7485
|
{
|
|
7312
7486
|
"aria-hidden": true,
|
|
@@ -7325,8 +7499,8 @@ var Tabs = ({
|
|
|
7325
7499
|
]
|
|
7326
7500
|
}
|
|
7327
7501
|
),
|
|
7328
|
-
shouldUseOverflowScroll && !isBarVariant ? /* @__PURE__ */ (0,
|
|
7329
|
-
/* @__PURE__ */ (0,
|
|
7502
|
+
shouldUseOverflowScroll && !isBarVariant ? /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
|
|
7503
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
7330
7504
|
"span",
|
|
7331
7505
|
{
|
|
7332
7506
|
"aria-hidden": true,
|
|
@@ -7338,7 +7512,7 @@ var Tabs = ({
|
|
|
7338
7512
|
)
|
|
7339
7513
|
}
|
|
7340
7514
|
),
|
|
7341
|
-
/* @__PURE__ */ (0,
|
|
7515
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
7342
7516
|
"span",
|
|
7343
7517
|
{
|
|
7344
7518
|
"aria-hidden": true,
|
|
@@ -7351,8 +7525,8 @@ var Tabs = ({
|
|
|
7351
7525
|
}
|
|
7352
7526
|
)
|
|
7353
7527
|
] }) : null,
|
|
7354
|
-
shouldUseOverflowScroll && isBarVariant ? /* @__PURE__ */ (0,
|
|
7355
|
-
/* @__PURE__ */ (0,
|
|
7528
|
+
shouldUseOverflowScroll && isBarVariant ? /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
|
|
7529
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
7356
7530
|
"button",
|
|
7357
7531
|
{
|
|
7358
7532
|
type: "button",
|
|
@@ -7374,10 +7548,10 @@ var Tabs = ({
|
|
|
7374
7548
|
behavior: getScrollBehavior(enableAnimations)
|
|
7375
7549
|
});
|
|
7376
7550
|
},
|
|
7377
|
-
children: /* @__PURE__ */ (0,
|
|
7551
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Icon, { name: "chevron-left", size: "small", color: "currentColor" })
|
|
7378
7552
|
}
|
|
7379
7553
|
),
|
|
7380
|
-
/* @__PURE__ */ (0,
|
|
7554
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
7381
7555
|
"button",
|
|
7382
7556
|
{
|
|
7383
7557
|
type: "button",
|
|
@@ -7399,7 +7573,7 @@ var Tabs = ({
|
|
|
7399
7573
|
behavior: getScrollBehavior(enableAnimations)
|
|
7400
7574
|
});
|
|
7401
7575
|
},
|
|
7402
|
-
children: /* @__PURE__ */ (0,
|
|
7576
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Icon, { name: "chevron-right", size: "small", color: "currentColor" })
|
|
7403
7577
|
}
|
|
7404
7578
|
)
|
|
7405
7579
|
] }) : null
|
|
@@ -7410,7 +7584,7 @@ var Tabs = ({
|
|
|
7410
7584
|
Tabs.displayName = "Tabs";
|
|
7411
7585
|
|
|
7412
7586
|
// src/primitives/tooltip/index.tsx
|
|
7413
|
-
var
|
|
7587
|
+
var import_hooks32 = require("@agg-build/hooks");
|
|
7414
7588
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
7415
7589
|
var import_react9 = require("react");
|
|
7416
7590
|
|
|
@@ -7444,7 +7618,7 @@ var resolveTooltipArrowDimensions = (size) => {
|
|
|
7444
7618
|
};
|
|
7445
7619
|
|
|
7446
7620
|
// src/primitives/tooltip/index.tsx
|
|
7447
|
-
var
|
|
7621
|
+
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
7448
7622
|
var Tooltip = ({
|
|
7449
7623
|
content,
|
|
7450
7624
|
children,
|
|
@@ -7459,25 +7633,25 @@ var Tooltip = ({
|
|
|
7459
7633
|
const {
|
|
7460
7634
|
general: { rootClassName },
|
|
7461
7635
|
features: { enableAnimations }
|
|
7462
|
-
} = (0,
|
|
7636
|
+
} = (0, import_hooks32.useSdkUiConfig)();
|
|
7463
7637
|
const trigger = (0, import_react9.useMemo)(() => {
|
|
7464
7638
|
if (children) return children;
|
|
7465
|
-
return /* @__PURE__ */ (0,
|
|
7639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
7466
7640
|
"button",
|
|
7467
7641
|
{
|
|
7468
7642
|
type: "button",
|
|
7469
7643
|
className: resolveTooltipTriggerClassName(classNames == null ? void 0 : classNames.trigger),
|
|
7470
7644
|
"aria-label": ariaLabel != null ? ariaLabel : defaultTooltipTriggerAriaLabel,
|
|
7471
|
-
children: /* @__PURE__ */ (0,
|
|
7645
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Icon, { name: "info", size: "small", className: cn(classNames == null ? void 0 : classNames.icon), "aria-hidden": true })
|
|
7472
7646
|
}
|
|
7473
7647
|
);
|
|
7474
7648
|
}, [children, classNames == null ? void 0 : classNames.trigger, classNames == null ? void 0 : classNames.icon, ariaLabel]);
|
|
7475
7649
|
const { width: arrowWidth, height: arrowHeight } = resolveTooltipArrowDimensions(size);
|
|
7476
7650
|
const arrowPoints = `0,0 ${arrowWidth},0 ${arrowWidth / 2},${arrowHeight}`;
|
|
7477
7651
|
const arrowBorderPath = `M0 0 L${arrowWidth / 2} ${arrowHeight} L${arrowWidth} 0`;
|
|
7478
|
-
return /* @__PURE__ */ (0,
|
|
7479
|
-
/* @__PURE__ */ (0,
|
|
7480
|
-
/* @__PURE__ */ (0,
|
|
7652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(TooltipPrimitive.Provider, { delayDuration, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(TooltipPrimitive.Root, { children: [
|
|
7653
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(TooltipPrimitive.Trigger, { asChild: true, children: trigger }),
|
|
7654
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(
|
|
7481
7655
|
TooltipPrimitive.Content,
|
|
7482
7656
|
{
|
|
7483
7657
|
side,
|
|
@@ -7501,7 +7675,7 @@ var Tooltip = ({
|
|
|
7501
7675
|
classNames == null ? void 0 : classNames.content
|
|
7502
7676
|
),
|
|
7503
7677
|
children: [
|
|
7504
|
-
/* @__PURE__ */ (0,
|
|
7678
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(TooltipPrimitive.Arrow, { asChild: true, width: arrowWidth, height: arrowHeight, children: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(
|
|
7505
7679
|
"svg",
|
|
7506
7680
|
{
|
|
7507
7681
|
width: arrowWidth,
|
|
@@ -7510,8 +7684,8 @@ var Tooltip = ({
|
|
|
7510
7684
|
"aria-hidden": "true",
|
|
7511
7685
|
className: cn("overflow-visible", classNames == null ? void 0 : classNames.arrow),
|
|
7512
7686
|
children: [
|
|
7513
|
-
/* @__PURE__ */ (0,
|
|
7514
|
-
/* @__PURE__ */ (0,
|
|
7687
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("polygon", { points: arrowPoints, className: "fill-agg-secondary" }),
|
|
7688
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
7515
7689
|
"path",
|
|
7516
7690
|
{
|
|
7517
7691
|
d: arrowBorderPath,
|
|
@@ -7689,13 +7863,13 @@ var normalizeEventListItemV2Comparison = ({
|
|
|
7689
7863
|
var baseCardClassName = "gap-3 overflow-hidden p-4 w-full";
|
|
7690
7864
|
|
|
7691
7865
|
// src/events/item/index.tsx
|
|
7692
|
-
var
|
|
7866
|
+
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
7693
7867
|
var EventListItemLoadingState = ({
|
|
7694
7868
|
classNames,
|
|
7695
7869
|
ariaLabel
|
|
7696
7870
|
}) => {
|
|
7697
|
-
const labels = (0,
|
|
7698
|
-
return /* @__PURE__ */ (0,
|
|
7871
|
+
const labels = (0, import_hooks33.useLabels)();
|
|
7872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
7699
7873
|
Skeleton,
|
|
7700
7874
|
{
|
|
7701
7875
|
view: "event-list-item",
|
|
@@ -7708,8 +7882,8 @@ var EventListItemUnavailableState = ({
|
|
|
7708
7882
|
classNames,
|
|
7709
7883
|
ariaLabel
|
|
7710
7884
|
}) => {
|
|
7711
|
-
const labels = (0,
|
|
7712
|
-
return /* @__PURE__ */ (0,
|
|
7885
|
+
const labels = (0, import_hooks33.useLabels)();
|
|
7886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
7713
7887
|
Card,
|
|
7714
7888
|
{
|
|
7715
7889
|
className: cn(
|
|
@@ -7719,8 +7893,8 @@ var EventListItemUnavailableState = ({
|
|
|
7719
7893
|
),
|
|
7720
7894
|
role: "status",
|
|
7721
7895
|
"aria-label": ariaLabel != null ? ariaLabel : labels.eventItem.unavailableAria,
|
|
7722
|
-
children: /* @__PURE__ */ (0,
|
|
7723
|
-
/* @__PURE__ */ (0,
|
|
7896
|
+
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: [
|
|
7897
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
7724
7898
|
Typography,
|
|
7725
7899
|
{
|
|
7726
7900
|
variant: "body-large-strong",
|
|
@@ -7728,7 +7902,7 @@ var EventListItemUnavailableState = ({
|
|
|
7728
7902
|
children: labels.eventItem.unavailableTitle
|
|
7729
7903
|
}
|
|
7730
7904
|
),
|
|
7731
|
-
/* @__PURE__ */ (0,
|
|
7905
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Typography, { variant: "body", className: "text-agg-muted-foreground", children: labels.eventItem.unavailableDescription })
|
|
7732
7906
|
] })
|
|
7733
7907
|
}
|
|
7734
7908
|
);
|
|
@@ -7737,13 +7911,13 @@ var EventListItemNotFoundState = ({
|
|
|
7737
7911
|
classNames: _classNames,
|
|
7738
7912
|
ariaLabel: _ariaLabel
|
|
7739
7913
|
}) => {
|
|
7740
|
-
const labels = (0,
|
|
7741
|
-
return /* @__PURE__ */ (0,
|
|
7914
|
+
const labels = (0, import_hooks33.useLabels)();
|
|
7915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
7742
7916
|
StateMessage,
|
|
7743
7917
|
{
|
|
7744
7918
|
title: labels.eventItemDetails.notFoundTitle,
|
|
7745
7919
|
description: labels.eventItemDetails.notFoundDescription,
|
|
7746
|
-
icon: /* @__PURE__ */ (0,
|
|
7920
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(SearchEmptyIcon, {}),
|
|
7747
7921
|
classNames: { root: "agg-event-card-state min-h-[280px] md:min-h-[320px]" }
|
|
7748
7922
|
}
|
|
7749
7923
|
);
|
|
@@ -7892,23 +8066,26 @@ var EventListItemContent = ({
|
|
|
7892
8066
|
marketStatus
|
|
7893
8067
|
}) => {
|
|
7894
8068
|
var _a;
|
|
7895
|
-
const config = (0,
|
|
7896
|
-
const labels = (0,
|
|
8069
|
+
const config = (0, import_hooks33.useSdkUiConfig)();
|
|
8070
|
+
const labels = (0, import_hooks33.useLabels)();
|
|
7897
8071
|
const allVenueMarkets = (0, import_react10.useMemo)(() => event.venueMarkets, [event.venueMarkets]);
|
|
8072
|
+
const recurringCryptoIdentity = (0, import_hooks33.resolveRecurringCryptoIdentity)(event);
|
|
7898
8073
|
const eventHeading = resolveEventHeading({
|
|
7899
8074
|
title: event.title,
|
|
7900
8075
|
categories: event.categories,
|
|
7901
8076
|
structureType: event.structureType,
|
|
7902
8077
|
gameStartTime: event.gameStartTime,
|
|
7903
8078
|
endDate: event.endDate,
|
|
7904
|
-
venueMarkets: event.venueMarkets
|
|
8079
|
+
venueMarkets: event.venueMarkets,
|
|
8080
|
+
recurringCryptoWindowStart: recurringCryptoIdentity == null ? void 0 : recurringCryptoIdentity.windowStart,
|
|
8081
|
+
recurringCryptoDuration: recurringCryptoIdentity == null ? void 0 : recurringCryptoIdentity.duration
|
|
7905
8082
|
});
|
|
7906
8083
|
const resolvedTitle = eventHeading.title;
|
|
7907
8084
|
const resolvedTimestamp = eventHeading.timestampLabel;
|
|
7908
8085
|
const resolvedImage = event.image;
|
|
7909
8086
|
const visibleVenueLogos = (0, import_react10.useMemo)(() => {
|
|
7910
8087
|
var _a2;
|
|
7911
|
-
return (0,
|
|
8088
|
+
return (0, import_hooks33.sortVenues)(Array.from(new Set(((_a2 = event.venues) != null ? _a2 : []).map((venue) => venue))));
|
|
7912
8089
|
}, [event.venues]);
|
|
7913
8090
|
const resolvedMarketCount = typeof event.marketCount === "number" && Number.isFinite(event.marketCount) ? Math.max(0, Math.floor(event.marketCount)) : allVenueMarkets.length;
|
|
7914
8091
|
const resolvedVenueCount = typeof event.venueCount === "number" && Number.isFinite(event.venueCount) ? Math.max(0, Math.floor(event.venueCount)) : visibleVenueLogos.length;
|
|
@@ -7927,7 +8104,7 @@ var EventListItemContent = ({
|
|
|
7927
8104
|
hasNextPage: hasNextLazyMarketsPage,
|
|
7928
8105
|
isLoading: isLoadingLazyMarkets,
|
|
7929
8106
|
isFetchingNextPage: isFetchingNextLazyMarketsPage
|
|
7930
|
-
} = (0,
|
|
8107
|
+
} = (0, import_hooks33.useVenueMarkets)({
|
|
7931
8108
|
venueEventId: event.id,
|
|
7932
8109
|
enabled: shouldEnableLazyMarketLoading && isLazyMarketsQueryEnabled,
|
|
7933
8110
|
// List/tile surface: axis/dates sort by volume so the scroll tail matches
|
|
@@ -7953,13 +8130,19 @@ var EventListItemContent = ({
|
|
|
7953
8130
|
}
|
|
7954
8131
|
return [...new Set(ids)];
|
|
7955
8132
|
}, [resolvedOutcomeMarkets]);
|
|
7956
|
-
const { midpointRows: fetchedMidpointRows, isLoading: isVenueMarketMidpointsLoading } = (0,
|
|
8133
|
+
const { midpointRows: fetchedMidpointRows, isLoading: isVenueMarketMidpointsLoading } = (0, import_hooks33.useVenueMarketMidpoints)({
|
|
7957
8134
|
venueMarketIds: shouldUseSharedMidpoints ? [] : midpointVenueMarketIds,
|
|
7958
8135
|
enabled: !shouldUseSharedMidpoints && midpointVenueMarketIds.length > 0
|
|
7959
8136
|
});
|
|
7960
|
-
const { prices: displayMidpointsByOutcomeId, isLoading: isOutcomeMidpointsLoading } = (0,
|
|
7961
|
-
const resolvedMidpointRows =
|
|
7962
|
-
|
|
8137
|
+
const { prices: displayMidpointsByOutcomeId, isLoading: isOutcomeMidpointsLoading } = (0, import_hooks33.useMidpoints)(shouldUseSharedMidpoints ? [] : resolvedOutcomeMarkets);
|
|
8138
|
+
const resolvedMidpointRows = (0, import_react10.useMemo)(
|
|
8139
|
+
() => shouldUseSharedMidpoints ? sharedMidpointRows != null ? sharedMidpointRows : [] : fetchedMidpointRows,
|
|
8140
|
+
[fetchedMidpointRows, sharedMidpointRows, shouldUseSharedMidpoints]
|
|
8141
|
+
);
|
|
8142
|
+
const resolvedDisplayMidpointsByOutcomeId = (0, import_react10.useMemo)(
|
|
8143
|
+
() => shouldUseSharedMidpoints ? midpointPrices != null ? midpointPrices : /* @__PURE__ */ new Map() : displayMidpointsByOutcomeId,
|
|
8144
|
+
[displayMidpointsByOutcomeId, midpointPrices, shouldUseSharedMidpoints]
|
|
8145
|
+
);
|
|
7963
8146
|
const isAwaitingMidpoints = midpointsLoading != null ? midpointsLoading : isOutcomeMidpointsLoading || midpointVenueMarketIds.length > 0 && isVenueMarketMidpointsLoading;
|
|
7964
8147
|
const displayPriceByOutcomeId = (0, import_react10.useMemo)(() => {
|
|
7965
8148
|
const priceByOutcomeId = new Map(resolvedDisplayMidpointsByOutcomeId);
|
|
@@ -8076,9 +8259,9 @@ var EventListItemContent = ({
|
|
|
8076
8259
|
const renderArbitrage = (value) => {
|
|
8077
8260
|
if (value == null) return null;
|
|
8078
8261
|
if (Math.abs(value) < config.market.arbitrageThreshold) return null;
|
|
8079
|
-
return /* @__PURE__ */ (0,
|
|
8080
|
-
/* @__PURE__ */ (0,
|
|
8081
|
-
/* @__PURE__ */ (0,
|
|
8262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: cn("flex items-center gap-1", "text-agg-success"), children: [
|
|
8263
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Typography, { variant: "label-strong", className: "text-agg-success", children: config.formatting.formatPercent(value) }),
|
|
8264
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8082
8265
|
Icon,
|
|
8083
8266
|
{
|
|
8084
8267
|
name: "triangle-up",
|
|
@@ -8092,8 +8275,8 @@ var EventListItemContent = ({
|
|
|
8092
8275
|
const renderPriceStripSkeleton = (count) => {
|
|
8093
8276
|
const safeCount = Math.max(1, Math.min(count || 1, 3));
|
|
8094
8277
|
const collapsedCount = safeCount - 1;
|
|
8095
|
-
return /* @__PURE__ */ (0,
|
|
8096
|
-
Array.from({ length: collapsedCount }).map((_, index) => /* @__PURE__ */ (0,
|
|
8278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(import_jsx_runtime124.Fragment, { children: [
|
|
8279
|
+
Array.from({ length: collapsedCount }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8097
8280
|
"span",
|
|
8098
8281
|
{
|
|
8099
8282
|
"aria-hidden": "true",
|
|
@@ -8105,7 +8288,7 @@ var EventListItemContent = ({
|
|
|
8105
8288
|
},
|
|
8106
8289
|
`agg-outcome-price-loading-collapsed-${index}`
|
|
8107
8290
|
)),
|
|
8108
|
-
/* @__PURE__ */ (0,
|
|
8291
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8109
8292
|
"span",
|
|
8110
8293
|
{
|
|
8111
8294
|
"aria-hidden": "true",
|
|
@@ -8122,7 +8305,7 @@ var EventListItemContent = ({
|
|
|
8122
8305
|
if (isAwaitingMidpoints) return null;
|
|
8123
8306
|
const formattedPriceGap = formatPriceGapPercent(value, source);
|
|
8124
8307
|
if (!formattedPriceGap) return null;
|
|
8125
|
-
return /* @__PURE__ */ (0,
|
|
8308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
|
|
8126
8309
|
"span",
|
|
8127
8310
|
{
|
|
8128
8311
|
className: cn(
|
|
@@ -8135,14 +8318,14 @@ var EventListItemContent = ({
|
|
|
8135
8318
|
title: labels.eventItem.priceGap,
|
|
8136
8319
|
"aria-label": `${formattedPriceGap} ${labels.eventItem.priceGap}`,
|
|
8137
8320
|
children: [
|
|
8138
|
-
/* @__PURE__ */ (0,
|
|
8321
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8139
8322
|
"i",
|
|
8140
8323
|
{
|
|
8141
8324
|
"aria-hidden": "true",
|
|
8142
8325
|
className: "fi-rr-arrow-down inline-flex size-3! shrink-0 items-center justify-center text-agg-xs text-agg-success"
|
|
8143
8326
|
}
|
|
8144
8327
|
),
|
|
8145
|
-
/* @__PURE__ */ (0,
|
|
8328
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { children: formattedPriceGap })
|
|
8146
8329
|
]
|
|
8147
8330
|
}
|
|
8148
8331
|
);
|
|
@@ -8154,11 +8337,11 @@ var EventListItemContent = ({
|
|
|
8154
8337
|
const hasVenueCompetition = row.prices.length > 1;
|
|
8155
8338
|
const isHighlightedBestPrice = hasVenueCompetition && price.isBest;
|
|
8156
8339
|
const shouldCollapsePriceText = hasVenueCompetition && !isHighlightedBestPrice;
|
|
8157
|
-
return /* @__PURE__ */ (0,
|
|
8340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8158
8341
|
Badge,
|
|
8159
8342
|
{
|
|
8160
8343
|
text: formatMarketProbabilityPercent(price.price, config.formatting.formatPercent),
|
|
8161
|
-
prefix: /* @__PURE__ */ (0,
|
|
8344
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8162
8345
|
VenueLogo,
|
|
8163
8346
|
{
|
|
8164
8347
|
venue: price.venue,
|
|
@@ -8201,7 +8384,7 @@ var EventListItemContent = ({
|
|
|
8201
8384
|
`${price.market.id}:${price.outcome.id}`
|
|
8202
8385
|
);
|
|
8203
8386
|
};
|
|
8204
|
-
return /* @__PURE__ */ (0,
|
|
8387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
|
|
8205
8388
|
Card,
|
|
8206
8389
|
{
|
|
8207
8390
|
className: cn(
|
|
@@ -8218,11 +8401,11 @@ var EventListItemContent = ({
|
|
|
8218
8401
|
"aria-label": ariaLabel != null ? ariaLabel : [resolvedTitle, resolvedTimestamp].filter(Boolean).join(" "),
|
|
8219
8402
|
withGradient: true,
|
|
8220
8403
|
children: [
|
|
8221
|
-
/* @__PURE__ */ (0,
|
|
8222
|
-
/* @__PURE__ */ (0,
|
|
8404
|
+
/* @__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: [
|
|
8405
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8223
8406
|
RemoteImage,
|
|
8224
8407
|
{
|
|
8225
|
-
src: (0,
|
|
8408
|
+
src: (0, import_hooks33.optimizedImageUrl)(resolvedImage, 40),
|
|
8226
8409
|
alt: "",
|
|
8227
8410
|
classNames: {
|
|
8228
8411
|
root: "agg-event-image h-10 w-10 shrink-0 rounded-agg-lg object-cover",
|
|
@@ -8230,8 +8413,8 @@ var EventListItemContent = ({
|
|
|
8230
8413
|
}
|
|
8231
8414
|
}
|
|
8232
8415
|
),
|
|
8233
|
-
/* @__PURE__ */ (0,
|
|
8234
|
-
/* @__PURE__ */ (0,
|
|
8416
|
+
/* @__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: [
|
|
8417
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8235
8418
|
Typography,
|
|
8236
8419
|
{
|
|
8237
8420
|
variant: "body-strong",
|
|
@@ -8244,7 +8427,7 @@ var EventListItemContent = ({
|
|
|
8244
8427
|
children: resolvedTitle
|
|
8245
8428
|
}
|
|
8246
8429
|
),
|
|
8247
|
-
resolvedTimestamp ? /* @__PURE__ */ (0,
|
|
8430
|
+
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
8431
|
Typography,
|
|
8249
8432
|
{
|
|
8250
8433
|
variant: "body",
|
|
@@ -8257,8 +8440,8 @@ var EventListItemContent = ({
|
|
|
8257
8440
|
) }) : null
|
|
8258
8441
|
] }) })
|
|
8259
8442
|
] }),
|
|
8260
|
-
/* @__PURE__ */ (0,
|
|
8261
|
-
/* @__PURE__ */ (0,
|
|
8443
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "relative w-full", children: [
|
|
8444
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
|
|
8262
8445
|
"div",
|
|
8263
8446
|
{
|
|
8264
8447
|
ref: outcomesContainerRef,
|
|
@@ -8276,7 +8459,7 @@ var EventListItemContent = ({
|
|
|
8276
8459
|
const arbReturn = arbReturnByVenueMarketId.get(row.market.id);
|
|
8277
8460
|
const priceGapPercent = arbReturn == null ? gapsByVenueMarketId.get(row.market.id) : arbReturn;
|
|
8278
8461
|
const priceGapSource = arbReturn == null ? "percent" : "fraction";
|
|
8279
|
-
return /* @__PURE__ */ (0,
|
|
8462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
|
|
8280
8463
|
"div",
|
|
8281
8464
|
{
|
|
8282
8465
|
className: cn(
|
|
@@ -8285,7 +8468,7 @@ var EventListItemContent = ({
|
|
|
8285
8468
|
classNames == null ? void 0 : classNames.outcomeRow
|
|
8286
8469
|
),
|
|
8287
8470
|
children: [
|
|
8288
|
-
/* @__PURE__ */ (0,
|
|
8471
|
+
/* @__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
8472
|
Typography,
|
|
8290
8473
|
{
|
|
8291
8474
|
variant: "body",
|
|
@@ -8293,10 +8476,10 @@ var EventListItemContent = ({
|
|
|
8293
8476
|
children: row.label
|
|
8294
8477
|
}
|
|
8295
8478
|
) }),
|
|
8296
|
-
/* @__PURE__ */ (0,
|
|
8479
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "agg-outcome-meta flex shrink-0 flex-row items-center justify-end gap-2", children: [
|
|
8297
8480
|
renderArbitrage(arbitragePercent),
|
|
8298
8481
|
renderPriceGapPill(priceGapPercent, priceGapSource),
|
|
8299
|
-
/* @__PURE__ */ (0,
|
|
8482
|
+
/* @__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
8483
|
(price, priceIndex) => renderComparisonPriceBadge(row, price, priceIndex)
|
|
8301
8484
|
) })
|
|
8302
8485
|
] })
|
|
@@ -8305,15 +8488,15 @@ var EventListItemContent = ({
|
|
|
8305
8488
|
row.id
|
|
8306
8489
|
);
|
|
8307
8490
|
}),
|
|
8308
|
-
shouldRenderLoadingOutcomeRow ? /* @__PURE__ */ (0,
|
|
8309
|
-
/* @__PURE__ */ (0,
|
|
8491
|
+
shouldRenderLoadingOutcomeRow ? /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { className: "agg-outcome-row-loading flex w-full items-center justify-between gap-3", children: [
|
|
8492
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8310
8493
|
"div",
|
|
8311
8494
|
{
|
|
8312
8495
|
"aria-hidden": "true",
|
|
8313
8496
|
className: "bg-agg-separator animate-pulse h-5 rounded-agg-sm w-[200px]"
|
|
8314
8497
|
}
|
|
8315
8498
|
),
|
|
8316
|
-
/* @__PURE__ */ (0,
|
|
8499
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8317
8500
|
"div",
|
|
8318
8501
|
{
|
|
8319
8502
|
"aria-hidden": "true",
|
|
@@ -8324,7 +8507,7 @@ var EventListItemContent = ({
|
|
|
8324
8507
|
]
|
|
8325
8508
|
}
|
|
8326
8509
|
),
|
|
8327
|
-
/* @__PURE__ */ (0,
|
|
8510
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8328
8511
|
"div",
|
|
8329
8512
|
{
|
|
8330
8513
|
className: cn(
|
|
@@ -8334,7 +8517,7 @@ var EventListItemContent = ({
|
|
|
8334
8517
|
style: { height: OUTCOMES_SCROLL_MASK_HEIGHT_PX }
|
|
8335
8518
|
}
|
|
8336
8519
|
),
|
|
8337
|
-
/* @__PURE__ */ (0,
|
|
8520
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8338
8521
|
"div",
|
|
8339
8522
|
{
|
|
8340
8523
|
className: cn(
|
|
@@ -8345,7 +8528,7 @@ var EventListItemContent = ({
|
|
|
8345
8528
|
}
|
|
8346
8529
|
)
|
|
8347
8530
|
] }),
|
|
8348
|
-
/* @__PURE__ */ (0,
|
|
8531
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
|
|
8349
8532
|
"div",
|
|
8350
8533
|
{
|
|
8351
8534
|
className: cn(
|
|
@@ -8355,14 +8538,14 @@ var EventListItemContent = ({
|
|
|
8355
8538
|
classNames == null ? void 0 : classNames.footer
|
|
8356
8539
|
),
|
|
8357
8540
|
children: [
|
|
8358
|
-
/* @__PURE__ */ (0,
|
|
8541
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
|
|
8359
8542
|
"div",
|
|
8360
8543
|
{
|
|
8361
8544
|
className: cn(
|
|
8362
8545
|
"agg-event-meta flex min-w-0 flex-1 items-center gap-2 text-agg-sm leading-agg-5 truncate"
|
|
8363
8546
|
),
|
|
8364
8547
|
children: [
|
|
8365
|
-
outcomesScrollState.remainingMarkets > 0 ? /* @__PURE__ */ (0,
|
|
8548
|
+
outcomesScrollState.remainingMarkets > 0 ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8366
8549
|
Typography,
|
|
8367
8550
|
{
|
|
8368
8551
|
variant: "body",
|
|
@@ -8370,9 +8553,9 @@ var EventListItemContent = ({
|
|
|
8370
8553
|
children: labels.eventItem.remainingMarkets(outcomesScrollState.remainingMarkets)
|
|
8371
8554
|
}
|
|
8372
8555
|
) : null,
|
|
8373
|
-
shouldShowMatchedVenueSummary ? /* @__PURE__ */ (0,
|
|
8374
|
-
singleFooterVenue ? /* @__PURE__ */ (0,
|
|
8375
|
-
/* @__PURE__ */ (0,
|
|
8556
|
+
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,
|
|
8557
|
+
singleFooterVenue ? /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("span", { className: "agg-event-single-venue flex min-w-0 items-center gap-1 overflow-hidden", children: [
|
|
8558
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8376
8559
|
VenueLogo,
|
|
8377
8560
|
{
|
|
8378
8561
|
venue: singleFooterVenue,
|
|
@@ -8381,9 +8564,9 @@ var EventListItemContent = ({
|
|
|
8381
8564
|
className: "text-agg-muted-foreground! size-[14px]!"
|
|
8382
8565
|
}
|
|
8383
8566
|
),
|
|
8384
|
-
/* @__PURE__ */ (0,
|
|
8567
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "truncate text-agg-muted-foreground", children: resolveVenueLabel(singleFooterVenue, void 0, labels) })
|
|
8385
8568
|
] }) : null,
|
|
8386
|
-
shouldShowMatchedVenueSummary && visibleFooterVenues.length > 0 ? /* @__PURE__ */ (0,
|
|
8569
|
+
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
8570
|
VenueLogo,
|
|
8388
8571
|
{
|
|
8389
8572
|
venue,
|
|
@@ -8396,7 +8579,7 @@ var EventListItemContent = ({
|
|
|
8396
8579
|
]
|
|
8397
8580
|
}
|
|
8398
8581
|
),
|
|
8399
|
-
/* @__PURE__ */ (0,
|
|
8582
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
8400
8583
|
Typography,
|
|
8401
8584
|
{
|
|
8402
8585
|
variant: "label",
|
|
@@ -8422,7 +8605,7 @@ var EventListItemByEventId = (_a) => {
|
|
|
8422
8605
|
error,
|
|
8423
8606
|
isError,
|
|
8424
8607
|
isLoading
|
|
8425
|
-
} = (0,
|
|
8608
|
+
} = (0, import_hooks33.useVenueEvent)({
|
|
8426
8609
|
eventId: eventId != null ? eventId : "",
|
|
8427
8610
|
enabled: !!eventId
|
|
8428
8611
|
});
|
|
@@ -8430,44 +8613,44 @@ var EventListItemByEventId = (_a) => {
|
|
|
8430
8613
|
return resolveEventListItemEvent(fetchedEvent);
|
|
8431
8614
|
}, [fetchedEvent]);
|
|
8432
8615
|
if (!eventId) {
|
|
8433
|
-
return /* @__PURE__ */ (0,
|
|
8616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(EventListItemUnavailableState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
8434
8617
|
}
|
|
8435
8618
|
if (isLoading) {
|
|
8436
|
-
return /* @__PURE__ */ (0,
|
|
8619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(EventListItemLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
8437
8620
|
}
|
|
8438
8621
|
if (isErrorWithStatus(error, 404)) {
|
|
8439
|
-
return /* @__PURE__ */ (0,
|
|
8622
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(EventListItemNotFoundState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
8440
8623
|
}
|
|
8441
8624
|
if (!fetchedEvent && !isError) {
|
|
8442
|
-
return /* @__PURE__ */ (0,
|
|
8625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(EventListItemLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
8443
8626
|
}
|
|
8444
8627
|
if (!resolvedEvent) {
|
|
8445
|
-
return /* @__PURE__ */ (0,
|
|
8628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(EventListItemUnavailableState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
8446
8629
|
}
|
|
8447
|
-
return /* @__PURE__ */ (0,
|
|
8630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(EventListItemContent, __spreadValues({ event: resolvedEvent }, rest));
|
|
8448
8631
|
};
|
|
8449
8632
|
var EventListItem = (props) => {
|
|
8450
8633
|
if (props.isLoading) {
|
|
8451
|
-
return /* @__PURE__ */ (0,
|
|
8634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(EventListItemLoadingState, { classNames: props.classNames, ariaLabel: props.ariaLabel });
|
|
8452
8635
|
}
|
|
8453
8636
|
if ("event" in props && props.event) {
|
|
8454
8637
|
const _a = props, { event } = _a, rest = __objRest(_a, ["event"]);
|
|
8455
|
-
return /* @__PURE__ */ (0,
|
|
8638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(EventListItemContent, __spreadValues({ event }, rest));
|
|
8456
8639
|
}
|
|
8457
|
-
return /* @__PURE__ */ (0,
|
|
8640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(EventListItemByEventId, __spreadValues({}, props));
|
|
8458
8641
|
};
|
|
8459
8642
|
EventListItem.displayName = "EventListItem";
|
|
8460
8643
|
var EventListItemV2 = (props) => {
|
|
8461
|
-
return /* @__PURE__ */ (0,
|
|
8644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(EventListItem, __spreadValues({}, props));
|
|
8462
8645
|
};
|
|
8463
8646
|
EventListItemV2.displayName = "EventListItemV2";
|
|
8464
8647
|
|
|
8465
8648
|
// src/events/item-details/index.tsx
|
|
8466
|
-
var
|
|
8649
|
+
var import_hooks43 = require("@agg-build/hooks");
|
|
8467
8650
|
var import_react16 = require("react");
|
|
8468
8651
|
|
|
8469
8652
|
// src/primitives/chart/chart-type-switch.tsx
|
|
8470
|
-
var
|
|
8653
|
+
var import_hooks34 = require("@agg-build/hooks");
|
|
8471
8654
|
var import_react11 = require("react");
|
|
8472
8655
|
|
|
8473
8656
|
// src/primitives/chart/chart-type-switch.constants.ts
|
|
@@ -8493,13 +8676,13 @@ var resolveChartTypeOptionIconName = (chartType) => {
|
|
|
8493
8676
|
};
|
|
8494
8677
|
|
|
8495
8678
|
// src/primitives/chart/chart-type-switch.tsx
|
|
8496
|
-
var
|
|
8679
|
+
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
8497
8680
|
var ChartTypeSwitch = ({
|
|
8498
8681
|
value,
|
|
8499
8682
|
onValueChange,
|
|
8500
8683
|
className
|
|
8501
8684
|
}) => {
|
|
8502
|
-
const labels = (0,
|
|
8685
|
+
const labels = (0, import_hooks34.useLabels)();
|
|
8503
8686
|
const options = (0, import_react11.useMemo)(
|
|
8504
8687
|
() => CHART_TYPE_SWITCH_OPTION_KEYS.map((chartType) => ({
|
|
8505
8688
|
value: chartType,
|
|
@@ -8529,7 +8712,7 @@ var ChartTypeSwitch = ({
|
|
|
8529
8712
|
}
|
|
8530
8713
|
onValueChange(nextOption.value);
|
|
8531
8714
|
};
|
|
8532
|
-
return /* @__PURE__ */ (0,
|
|
8715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
8533
8716
|
"div",
|
|
8534
8717
|
{
|
|
8535
8718
|
className: cn("agg-chart-type-switch inline-flex items-center gap-2", className),
|
|
@@ -8537,7 +8720,7 @@ var ChartTypeSwitch = ({
|
|
|
8537
8720
|
"aria-label": labels.common.chartTypeSwitchAria,
|
|
8538
8721
|
children: options.map((option, index) => {
|
|
8539
8722
|
const isActive = option.value === value;
|
|
8540
|
-
return /* @__PURE__ */ (0,
|
|
8723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
8541
8724
|
"button",
|
|
8542
8725
|
{
|
|
8543
8726
|
type: "button",
|
|
@@ -8564,7 +8747,7 @@ var ChartTypeSwitch = ({
|
|
|
8564
8747
|
onKeyDown: (event) => {
|
|
8565
8748
|
handleKeyDown(event, index);
|
|
8566
8749
|
},
|
|
8567
|
-
children: /* @__PURE__ */ (0,
|
|
8750
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Icon, { name: option.iconName, color: "currentColor", className: "h-5 w-5" })
|
|
8568
8751
|
},
|
|
8569
8752
|
option.value
|
|
8570
8753
|
);
|
|
@@ -8575,7 +8758,7 @@ var ChartTypeSwitch = ({
|
|
|
8575
8758
|
ChartTypeSwitch.displayName = "ChartTypeSwitch";
|
|
8576
8759
|
|
|
8577
8760
|
// src/trading/trading-context/index.tsx
|
|
8578
|
-
var
|
|
8761
|
+
var import_hooks35 = require("@agg-build/hooks");
|
|
8579
8762
|
|
|
8580
8763
|
// src/events/market-details/market-details.utils.ts
|
|
8581
8764
|
var import_sdk13 = require("@agg-build/sdk");
|
|
@@ -9330,7 +9513,7 @@ var buildMarketDetailsModel = ({
|
|
|
9330
9513
|
};
|
|
9331
9514
|
|
|
9332
9515
|
// src/events/market-details/orderbook-aggregation.ts
|
|
9333
|
-
var
|
|
9516
|
+
var import_hooks36 = require("@agg-build/hooks");
|
|
9334
9517
|
var PRICE_PRECISION = 1e6;
|
|
9335
9518
|
var SIZE_PRECISION = 1e8;
|
|
9336
9519
|
var POSITIVE_OUTCOME_KEYS = /* @__PURE__ */ new Set(["yes", "y", "true", "up", "buy", "long"]);
|
|
@@ -9451,7 +9634,7 @@ var buildRowsFromAccumulator = ({
|
|
|
9451
9634
|
const venueBreakdown = Object.fromEntries(
|
|
9452
9635
|
Object.entries(level.venueBreakdownScaled).filter(([, scaledSize]) => scaledSize > 0).map(([venue2, scaledSize]) => [venue2, fromScaled(scaledSize, SIZE_PRECISION)])
|
|
9453
9636
|
);
|
|
9454
|
-
const resolvedFallbackVenue = fallbackVenue != null ? fallbackVenue :
|
|
9637
|
+
const resolvedFallbackVenue = fallbackVenue != null ? fallbackVenue : import_hooks36.Venue.polymarket;
|
|
9455
9638
|
const venues = resolveVenues(venueBreakdown, resolvedFallbackVenue);
|
|
9456
9639
|
const venue = resolvePrimaryVenue(venueBreakdown, resolvedFallbackVenue);
|
|
9457
9640
|
return {
|
|
@@ -9749,7 +9932,7 @@ var shouldAutoFallbackToAllRange = ({
|
|
|
9749
9932
|
};
|
|
9750
9933
|
|
|
9751
9934
|
// src/events/shared/chart-venue-selection.ts
|
|
9752
|
-
var
|
|
9935
|
+
var import_hooks37 = require("@agg-build/hooks");
|
|
9753
9936
|
var resolveChartVenueOutcomes = ({
|
|
9754
9937
|
eligibleVenueOutcomes,
|
|
9755
9938
|
livePrices
|
|
@@ -9761,7 +9944,7 @@ var resolveChartVenueOutcomes = ({
|
|
|
9761
9944
|
const probabilityDifference = (leftProbability != null ? leftProbability : 2) - (rightProbability != null ? rightProbability : 2);
|
|
9762
9945
|
if (probabilityDifference !== 0) return probabilityDifference;
|
|
9763
9946
|
if (left.venue === right.venue) return 0;
|
|
9764
|
-
const sortedVenues = (0,
|
|
9947
|
+
const sortedVenues = (0, import_hooks37.sortVenues)([left.venue, right.venue]);
|
|
9765
9948
|
return sortedVenues[0] === left.venue ? -1 : 1;
|
|
9766
9949
|
});
|
|
9767
9950
|
const venueOutcomesByVenue = /* @__PURE__ */ new Map();
|
|
@@ -9855,16 +10038,160 @@ var getDisplayOutcomePrice = ({
|
|
|
9855
10038
|
return resolvedFallbackPrice;
|
|
9856
10039
|
};
|
|
9857
10040
|
|
|
10041
|
+
// src/events/shared/sports-live-score.tsx
|
|
10042
|
+
var import_hooks38 = require("@agg-build/hooks");
|
|
10043
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
10044
|
+
var SportsLiveScore = ({
|
|
10045
|
+
state,
|
|
10046
|
+
variant = "detail",
|
|
10047
|
+
className
|
|
10048
|
+
}) => {
|
|
10049
|
+
const labels = (0, import_hooks38.useLabels)();
|
|
10050
|
+
if (!state || state.participants.length !== 2) return null;
|
|
10051
|
+
const [firstParticipant, secondParticipant] = state.participants;
|
|
10052
|
+
const firstScore = firstParticipant == null ? void 0 : firstParticipant.score;
|
|
10053
|
+
const secondScore = secondParticipant == null ? void 0 : secondParticipant.score;
|
|
10054
|
+
if (firstScore == null || secondScore == null) return null;
|
|
10055
|
+
const statusLabels = {
|
|
10056
|
+
scheduled: labels.sportsLive.scheduled,
|
|
10057
|
+
live: labels.sportsLive.live,
|
|
10058
|
+
paused: labels.sportsLive.paused,
|
|
10059
|
+
finished: labels.sportsLive.finished,
|
|
10060
|
+
cancelled: labels.sportsLive.cancelled,
|
|
10061
|
+
postponed: labels.sportsLive.postponed,
|
|
10062
|
+
unknown: labels.sportsLive.unknown
|
|
10063
|
+
};
|
|
10064
|
+
const statusText = [state.period, state.clock].filter(Boolean).join(" \xB7 ") || statusLabels[state.status];
|
|
10065
|
+
const isLiveIndicatorVisible = state.status === "live" || state.status === "paused";
|
|
10066
|
+
const isCard = variant === "card";
|
|
10067
|
+
const renderParticipant = (participant) => {
|
|
10068
|
+
var _a;
|
|
10069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
10070
|
+
"div",
|
|
10071
|
+
{
|
|
10072
|
+
className: cn("flex min-w-0 flex-col items-center", isCard ? "gap-1.5" : "gap-3"),
|
|
10073
|
+
title: participant.name,
|
|
10074
|
+
children: [
|
|
10075
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
10076
|
+
RemoteImage,
|
|
10077
|
+
{
|
|
10078
|
+
src: participant.imageUrl,
|
|
10079
|
+
alt: "",
|
|
10080
|
+
width: isCard ? 28 : 44,
|
|
10081
|
+
height: isCard ? 28 : 44,
|
|
10082
|
+
classNames: {
|
|
10083
|
+
root: cn(
|
|
10084
|
+
"shrink-0 border border-agg-separator bg-agg-secondary-hover",
|
|
10085
|
+
isCard ? "size-7 rounded-agg-md" : "size-11 rounded-agg-lg"
|
|
10086
|
+
),
|
|
10087
|
+
image: "object-contain",
|
|
10088
|
+
placeholder: "text-agg-muted-foreground"
|
|
10089
|
+
}
|
|
10090
|
+
}
|
|
10091
|
+
),
|
|
10092
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
10093
|
+
Typography,
|
|
10094
|
+
{
|
|
10095
|
+
variant: "body",
|
|
10096
|
+
className: cn(
|
|
10097
|
+
"max-w-full truncate text-center text-agg-foreground",
|
|
10098
|
+
isCard ? "text-agg-xs leading-agg-4" : "text-agg-base leading-agg-6"
|
|
10099
|
+
),
|
|
10100
|
+
children: (_a = participant.shortName) != null ? _a : participant.name
|
|
10101
|
+
}
|
|
10102
|
+
)
|
|
10103
|
+
]
|
|
10104
|
+
}
|
|
10105
|
+
);
|
|
10106
|
+
};
|
|
10107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
10108
|
+
"div",
|
|
10109
|
+
{
|
|
10110
|
+
role: "status",
|
|
10111
|
+
"aria-label": labels.sportsLive.scoreAria(
|
|
10112
|
+
firstParticipant.name,
|
|
10113
|
+
firstScore,
|
|
10114
|
+
secondParticipant.name,
|
|
10115
|
+
secondScore,
|
|
10116
|
+
statusText
|
|
10117
|
+
),
|
|
10118
|
+
className: cn(
|
|
10119
|
+
"agg-sports-live-score grid w-full grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center",
|
|
10120
|
+
isCard ? "gap-3 py-1" : "gap-6 md:gap-10",
|
|
10121
|
+
className
|
|
10122
|
+
),
|
|
10123
|
+
children: [
|
|
10124
|
+
renderParticipant(firstParticipant),
|
|
10125
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: cn("flex flex-col items-center", isCard ? "gap-1" : "gap-3"), children: [
|
|
10126
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: cn("flex items-center", isCard ? "gap-2" : "gap-3"), children: [
|
|
10127
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
10128
|
+
Typography,
|
|
10129
|
+
{
|
|
10130
|
+
variant: "body-strong",
|
|
10131
|
+
className: cn(
|
|
10132
|
+
"font-agg-bold tabular-nums text-agg-foreground",
|
|
10133
|
+
isCard ? "text-agg-xl leading-agg-7" : "text-agg-3xl leading-agg-9"
|
|
10134
|
+
),
|
|
10135
|
+
children: firstScore
|
|
10136
|
+
}
|
|
10137
|
+
),
|
|
10138
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
10139
|
+
"span",
|
|
10140
|
+
{
|
|
10141
|
+
"aria-hidden": "true",
|
|
10142
|
+
className: cn("shrink-0 bg-agg-separator", isCard ? "h-0.5 w-2" : "h-0.5 w-3")
|
|
10143
|
+
}
|
|
10144
|
+
),
|
|
10145
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
10146
|
+
Typography,
|
|
10147
|
+
{
|
|
10148
|
+
variant: "body-strong",
|
|
10149
|
+
className: cn(
|
|
10150
|
+
"font-agg-bold tabular-nums text-agg-foreground",
|
|
10151
|
+
isCard ? "text-agg-xl leading-agg-7" : "text-agg-3xl leading-agg-9"
|
|
10152
|
+
),
|
|
10153
|
+
children: secondScore
|
|
10154
|
+
}
|
|
10155
|
+
)
|
|
10156
|
+
] }),
|
|
10157
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex min-w-0 items-center gap-2 text-agg-primary", children: [
|
|
10158
|
+
isLiveIndicatorVisible ? /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
10159
|
+
"span",
|
|
10160
|
+
{
|
|
10161
|
+
"aria-hidden": "true",
|
|
10162
|
+
className: "flex size-3.5 shrink-0 items-center justify-center rounded-agg-full bg-agg-primary/10",
|
|
10163
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { className: "size-1.5 rounded-agg-full bg-agg-primary" })
|
|
10164
|
+
}
|
|
10165
|
+
) : null,
|
|
10166
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
10167
|
+
Typography,
|
|
10168
|
+
{
|
|
10169
|
+
variant: "label-strong",
|
|
10170
|
+
className: cn(
|
|
10171
|
+
"max-w-full truncate uppercase text-agg-primary",
|
|
10172
|
+
isCard ? "text-agg-2xs leading-agg-4" : "text-agg-sm leading-agg-5"
|
|
10173
|
+
),
|
|
10174
|
+
children: statusText
|
|
10175
|
+
}
|
|
10176
|
+
)
|
|
10177
|
+
] })
|
|
10178
|
+
] }),
|
|
10179
|
+
renderParticipant(secondParticipant)
|
|
10180
|
+
]
|
|
10181
|
+
}
|
|
10182
|
+
);
|
|
10183
|
+
};
|
|
10184
|
+
SportsLiveScore.displayName = "SportsLiveScore";
|
|
10185
|
+
|
|
9858
10186
|
// src/events/item-details/event-list-item-details-market-selector.tsx
|
|
9859
|
-
var
|
|
10187
|
+
var import_hooks39 = require("@agg-build/hooks");
|
|
9860
10188
|
var import_react12 = require("react");
|
|
9861
|
-
var
|
|
10189
|
+
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
9862
10190
|
var MARKET_PILL_MAX_ROWS = 2;
|
|
9863
10191
|
var MARKET_PILL_FALLBACK_CONTAINER_WIDTH = 640;
|
|
9864
10192
|
var MARKET_PILL_FALLBACK_GAP = 8;
|
|
9865
10193
|
var MARKET_PILL_FALLBACK_WIDTH = 72;
|
|
9866
10194
|
var MARKET_PILL_FALLBACK_MORE_WIDTH = 88;
|
|
9867
|
-
var MARKET_PILL_MORE_LABEL = "More";
|
|
9868
10195
|
var MARKET_DROPDOWN_MAX_VISIBLE_OPTIONS = 6;
|
|
9869
10196
|
var MARKET_DROPDOWN_OPTION_HEIGHT = 48;
|
|
9870
10197
|
var MARKET_DROPDOWN_MAX_HEIGHT = MARKET_DROPDOWN_MAX_VISIBLE_OPTIONS * MARKET_DROPDOWN_OPTION_HEIGHT;
|
|
@@ -9949,11 +10276,17 @@ var resolveMarketPillLayout = ({
|
|
|
9949
10276
|
var EventListItemDetailsMarketSelector = ({
|
|
9950
10277
|
className,
|
|
9951
10278
|
options,
|
|
10279
|
+
browseOptions = options,
|
|
9952
10280
|
selectedValue,
|
|
10281
|
+
liveValue,
|
|
10282
|
+
alwaysShowMore = false,
|
|
9953
10283
|
onChange
|
|
9954
10284
|
}) => {
|
|
9955
10285
|
var _a;
|
|
9956
|
-
const labels = (0,
|
|
10286
|
+
const labels = (0, import_hooks39.useLabels)();
|
|
10287
|
+
const {
|
|
10288
|
+
features: { enableAnimations }
|
|
10289
|
+
} = (0, import_hooks39.useSdkUiConfig)();
|
|
9957
10290
|
const containerRef = (0, import_react12.useRef)(null);
|
|
9958
10291
|
const measurementContainerRef = (0, import_react12.useRef)(null);
|
|
9959
10292
|
const moreButtonRef = (0, import_react12.useRef)(null);
|
|
@@ -9974,15 +10307,22 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
9974
10307
|
});
|
|
9975
10308
|
const selectedHiddenOption = (0, import_react12.useMemo)(() => {
|
|
9976
10309
|
var _a2;
|
|
9977
|
-
return (_a2 =
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
|
|
10310
|
+
return (_a2 = browseOptions.find(
|
|
10311
|
+
(option) => option.value === selectedValue && !layout.visibleItems.some((visibleOption) => visibleOption.value === option.value)
|
|
10312
|
+
)) != null ? _a2 : null;
|
|
10313
|
+
}, [browseOptions, layout.visibleItems, selectedValue]);
|
|
10314
|
+
const hasSeparateBrowseOptions = browseOptions.length > options.length;
|
|
10315
|
+
const moreButtonLabel = hasSeparateBrowseOptions ? labels.eventItemDetails.moreMarkets : (_a = selectedHiddenOption == null ? void 0 : selectedHiddenOption.label) != null ? _a : labels.eventItemDetails.moreMarkets;
|
|
10316
|
+
const isMoreButtonSelected = !alwaysShowMore && selectedHiddenOption != null;
|
|
10317
|
+
const hasMoreButton = alwaysShowMore || layout.hiddenItems.length > 0 || hasSeparateBrowseOptions;
|
|
10318
|
+
const displayedOptions = alwaysShowMore ? options : layout.visibleItems;
|
|
9981
10319
|
const filteredOptions = (0, import_react12.useMemo)(() => {
|
|
9982
10320
|
const normalizedSearchValue = searchValue.trim().toLowerCase();
|
|
9983
|
-
if (!normalizedSearchValue) return
|
|
9984
|
-
return
|
|
9985
|
-
|
|
10321
|
+
if (!normalizedSearchValue) return browseOptions;
|
|
10322
|
+
return browseOptions.filter(
|
|
10323
|
+
(option) => option.label.toLowerCase().includes(normalizedSearchValue)
|
|
10324
|
+
);
|
|
10325
|
+
}, [browseOptions, searchValue]);
|
|
9986
10326
|
const lastMeasuredKeyRef = (0, import_react12.useRef)(null);
|
|
9987
10327
|
const measureFrameRef = (0, import_react12.useRef)(null);
|
|
9988
10328
|
(0, import_react12.useLayoutEffect)(() => {
|
|
@@ -10098,7 +10438,7 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10098
10438
|
};
|
|
10099
10439
|
}, [isDropdownOpen]);
|
|
10100
10440
|
(0, import_react12.useLayoutEffect)(() => {
|
|
10101
|
-
if (!isDropdownOpen || isMobileViewport) return;
|
|
10441
|
+
if (!isDropdownOpen || isMobileViewport && !alwaysShowMore) return;
|
|
10102
10442
|
const updateDropdownPosition = () => {
|
|
10103
10443
|
const containerElement = containerRef.current;
|
|
10104
10444
|
const moreButtonElement = moreButtonRef.current;
|
|
@@ -10132,7 +10472,7 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10132
10472
|
return () => {
|
|
10133
10473
|
resizeObserver.disconnect();
|
|
10134
10474
|
};
|
|
10135
|
-
}, [isDropdownOpen, isMobileViewport, moreButtonLabel]);
|
|
10475
|
+
}, [alwaysShowMore, isDropdownOpen, isMobileViewport, moreButtonLabel]);
|
|
10136
10476
|
(0, import_react12.useEffect)(() => {
|
|
10137
10477
|
if (!isDropdownOpen) return;
|
|
10138
10478
|
const handlePointerDown = (event) => {
|
|
@@ -10161,11 +10501,11 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10161
10501
|
onChange(marketId);
|
|
10162
10502
|
setIsDropdownOpen(false);
|
|
10163
10503
|
};
|
|
10164
|
-
if (isMobileViewport) {
|
|
10165
|
-
return /* @__PURE__ */ (0,
|
|
10504
|
+
if (isMobileViewport && !alwaysShowMore) {
|
|
10505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
10166
10506
|
AutocompleteSelect,
|
|
10167
10507
|
{
|
|
10168
|
-
options,
|
|
10508
|
+
options: browseOptions,
|
|
10169
10509
|
value: selectedValue,
|
|
10170
10510
|
onChange,
|
|
10171
10511
|
placeholder: labels.eventItemDetails.marketSelectPlaceholder,
|
|
@@ -10176,15 +10516,17 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10176
10516
|
}
|
|
10177
10517
|
);
|
|
10178
10518
|
}
|
|
10179
|
-
return /* @__PURE__ */ (0,
|
|
10180
|
-
/* @__PURE__ */ (0,
|
|
10181
|
-
|
|
10519
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { ref: containerRef, className: cn("agg-market-select relative w-full", className), children: [
|
|
10520
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "agg-market-pill-list flex flex-wrap gap-2", children: [
|
|
10521
|
+
displayedOptions.map((option) => {
|
|
10182
10522
|
const isSelected = option.value === selectedValue;
|
|
10183
|
-
|
|
10523
|
+
const isLive = option.value === liveValue;
|
|
10524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
10184
10525
|
"button",
|
|
10185
10526
|
{
|
|
10186
10527
|
type: "button",
|
|
10187
10528
|
"aria-pressed": isSelected,
|
|
10529
|
+
"aria-label": isLive ? `${option.label}, ${labels.eventItemDetails.liveMarket}` : option.label,
|
|
10188
10530
|
className: cn(
|
|
10189
10531
|
"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
10532
|
"cursor-pointer hover:bg-agg-tertiary!",
|
|
@@ -10196,12 +10538,28 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10196
10538
|
eventToHandle.stopPropagation();
|
|
10197
10539
|
handleSelectMarket(option.value);
|
|
10198
10540
|
},
|
|
10199
|
-
children:
|
|
10541
|
+
children: [
|
|
10542
|
+
isLive ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
10543
|
+
"span",
|
|
10544
|
+
{
|
|
10545
|
+
"aria-hidden": "true",
|
|
10546
|
+
className: cn(
|
|
10547
|
+
"mr-2 size-1.5 shrink-0 rounded-full bg-agg-primary ring-4 ring-agg-primary/20",
|
|
10548
|
+
enableAnimations ? "animate-pulse motion-reduce:animate-none" : null
|
|
10549
|
+
)
|
|
10550
|
+
}
|
|
10551
|
+
) : null,
|
|
10552
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { className: "truncate", children: option.label }),
|
|
10553
|
+
isLive ? /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("span", { className: "sr-only", children: [
|
|
10554
|
+
" ",
|
|
10555
|
+
labels.eventItemDetails.liveMarket
|
|
10556
|
+
] }) : null
|
|
10557
|
+
]
|
|
10200
10558
|
},
|
|
10201
10559
|
option.value
|
|
10202
10560
|
);
|
|
10203
10561
|
}),
|
|
10204
|
-
|
|
10562
|
+
hasMoreButton ? /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
10205
10563
|
"button",
|
|
10206
10564
|
{
|
|
10207
10565
|
ref: moreButtonRef,
|
|
@@ -10222,8 +10580,8 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10222
10580
|
setIsDropdownOpen((previousValue) => !previousValue);
|
|
10223
10581
|
},
|
|
10224
10582
|
children: [
|
|
10225
|
-
/* @__PURE__ */ (0,
|
|
10226
|
-
/* @__PURE__ */ (0,
|
|
10583
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { className: "truncate", children: moreButtonLabel }),
|
|
10584
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
10227
10585
|
Icon,
|
|
10228
10586
|
{
|
|
10229
10587
|
name: isDropdownOpen ? "chevron-up" : "chevron-down",
|
|
@@ -10237,7 +10595,7 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10237
10595
|
}
|
|
10238
10596
|
) : null
|
|
10239
10597
|
] }),
|
|
10240
|
-
isDropdownOpen ? /* @__PURE__ */ (0,
|
|
10598
|
+
isDropdownOpen ? /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
10241
10599
|
"div",
|
|
10242
10600
|
{
|
|
10243
10601
|
id: "agg-event-details-market-dropdown",
|
|
@@ -10254,9 +10612,9 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10254
10612
|
eventToHandle.stopPropagation();
|
|
10255
10613
|
},
|
|
10256
10614
|
children: [
|
|
10257
|
-
/* @__PURE__ */ (0,
|
|
10258
|
-
/* @__PURE__ */ (0,
|
|
10259
|
-
/* @__PURE__ */ (0,
|
|
10615
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "border-b border-agg-separator", children: [
|
|
10616
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("label", { className: "sr-only", htmlFor: "agg-event-details-market-search", children: labels.eventItemDetails.marketSelectSearchPlaceholder }),
|
|
10617
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
10260
10618
|
"input",
|
|
10261
10619
|
{
|
|
10262
10620
|
ref: dropdownInputRef,
|
|
@@ -10278,7 +10636,7 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10278
10636
|
}
|
|
10279
10637
|
)
|
|
10280
10638
|
] }),
|
|
10281
|
-
/* @__PURE__ */ (0,
|
|
10639
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
10282
10640
|
"div",
|
|
10283
10641
|
{
|
|
10284
10642
|
role: "listbox",
|
|
@@ -10287,7 +10645,7 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10287
10645
|
style: { maxHeight: `${MARKET_DROPDOWN_MAX_HEIGHT}px` },
|
|
10288
10646
|
children: filteredOptions.length > 0 ? filteredOptions.map((option) => {
|
|
10289
10647
|
const isSelected = option.value === selectedValue;
|
|
10290
|
-
return /* @__PURE__ */ (0,
|
|
10648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
10291
10649
|
"button",
|
|
10292
10650
|
{
|
|
10293
10651
|
type: "button",
|
|
@@ -10306,25 +10664,25 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10306
10664
|
handleSelectMarket(option.value);
|
|
10307
10665
|
},
|
|
10308
10666
|
children: [
|
|
10309
|
-
isSelected ? /* @__PURE__ */ (0,
|
|
10667
|
+
isSelected ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
10310
10668
|
"span",
|
|
10311
10669
|
{
|
|
10312
10670
|
"aria-hidden": "true",
|
|
10313
10671
|
className: "absolute bottom-2 left-0 top-2 w-1 bg-agg-primary"
|
|
10314
10672
|
}
|
|
10315
10673
|
) : null,
|
|
10316
|
-
/* @__PURE__ */ (0,
|
|
10674
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { className: "truncate", children: option.label })
|
|
10317
10675
|
]
|
|
10318
10676
|
},
|
|
10319
10677
|
option.value
|
|
10320
10678
|
);
|
|
10321
|
-
}) : /* @__PURE__ */ (0,
|
|
10679
|
+
}) : /* @__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
10680
|
}
|
|
10323
10681
|
)
|
|
10324
10682
|
]
|
|
10325
10683
|
}
|
|
10326
10684
|
) : null,
|
|
10327
|
-
/* @__PURE__ */ (0,
|
|
10685
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
10328
10686
|
"div",
|
|
10329
10687
|
{
|
|
10330
10688
|
ref: measurementContainerRef,
|
|
@@ -10333,7 +10691,7 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10333
10691
|
children: [
|
|
10334
10692
|
options.map((option) => {
|
|
10335
10693
|
const isSelected = option.value === selectedValue;
|
|
10336
|
-
return /* @__PURE__ */ (0,
|
|
10694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
10337
10695
|
"button",
|
|
10338
10696
|
{
|
|
10339
10697
|
ref: (element) => {
|
|
@@ -10345,12 +10703,12 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10345
10703
|
"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
10704
|
isSelected ? "border-agg-primary bg-agg-secondary font-agg-bold" : "border-transparent bg-agg-secondary-hover font-agg-normal"
|
|
10347
10705
|
),
|
|
10348
|
-
children: /* @__PURE__ */ (0,
|
|
10706
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { className: "truncate", children: option.label })
|
|
10349
10707
|
},
|
|
10350
10708
|
option.value
|
|
10351
10709
|
);
|
|
10352
10710
|
}),
|
|
10353
|
-
/* @__PURE__ */ (0,
|
|
10711
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
10354
10712
|
"button",
|
|
10355
10713
|
{
|
|
10356
10714
|
ref: moreButtonMeasureRef,
|
|
@@ -10358,8 +10716,8 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10358
10716
|
tabIndex: -1,
|
|
10359
10717
|
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
10718
|
children: [
|
|
10361
|
-
/* @__PURE__ */ (0,
|
|
10362
|
-
/* @__PURE__ */ (0,
|
|
10719
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { children: moreButtonLabel }),
|
|
10720
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
10363
10721
|
Icon,
|
|
10364
10722
|
{
|
|
10365
10723
|
name: "chevron-down",
|
|
@@ -10379,17 +10737,17 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
10379
10737
|
};
|
|
10380
10738
|
|
|
10381
10739
|
// src/events/item-details/settlement-summary.tsx
|
|
10382
|
-
var
|
|
10740
|
+
var import_hooks42 = require("@agg-build/hooks");
|
|
10383
10741
|
var import_react15 = require("react");
|
|
10384
10742
|
|
|
10385
10743
|
// src/trading/settlement/index.tsx
|
|
10386
|
-
var
|
|
10744
|
+
var import_hooks41 = require("@agg-build/hooks");
|
|
10387
10745
|
var import_react14 = require("react");
|
|
10388
10746
|
|
|
10389
10747
|
// src/trading/utils.ts
|
|
10390
|
-
var
|
|
10748
|
+
var import_hooks40 = require("@agg-build/hooks");
|
|
10391
10749
|
var import_dayjs5 = __toESM(require("dayjs"));
|
|
10392
|
-
var defaultLabels = (0,
|
|
10750
|
+
var defaultLabels = (0, import_hooks40.resolveAggUiLabels)("en-US");
|
|
10393
10751
|
var defaultSettlementSectionLabel = defaultLabels.trading.settlementSection;
|
|
10394
10752
|
var defaultTradingDisclaimer = defaultLabels.trading.disclaimer;
|
|
10395
10753
|
|
|
@@ -10441,7 +10799,7 @@ var dedupeSettlementSources = (sources) => {
|
|
|
10441
10799
|
};
|
|
10442
10800
|
|
|
10443
10801
|
// src/trading/settlement/settlement-text-renderer.tsx
|
|
10444
|
-
var
|
|
10802
|
+
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
10445
10803
|
var inlineTokenRegex = new RegExp(
|
|
10446
10804
|
[
|
|
10447
10805
|
/\[([^\]\n]+)\]\(([^)\s]+)\)/.source,
|
|
@@ -10480,12 +10838,12 @@ var renderInlineSegment = (text, baseKey) => {
|
|
|
10480
10838
|
}
|
|
10481
10839
|
if (match.index > lastIndex) {
|
|
10482
10840
|
nodes.push(
|
|
10483
|
-
/* @__PURE__ */ (0,
|
|
10841
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_react13.Fragment, { children: text.slice(lastIndex, match.index) }, `${baseKey}-text-${segmentIndex++}`)
|
|
10484
10842
|
);
|
|
10485
10843
|
}
|
|
10486
10844
|
if (isLinkMatch(match)) {
|
|
10487
10845
|
nodes.push(
|
|
10488
|
-
/* @__PURE__ */ (0,
|
|
10846
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
10489
10847
|
"a",
|
|
10490
10848
|
{
|
|
10491
10849
|
href: match[2],
|
|
@@ -10499,7 +10857,7 @@ var renderInlineSegment = (text, baseKey) => {
|
|
|
10499
10857
|
);
|
|
10500
10858
|
} else if (match[3] !== void 0) {
|
|
10501
10859
|
nodes.push(
|
|
10502
|
-
/* @__PURE__ */ (0,
|
|
10860
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
10503
10861
|
"strong",
|
|
10504
10862
|
{
|
|
10505
10863
|
className: "agg-settlement-text-bold font-agg-bold",
|
|
@@ -10510,7 +10868,7 @@ var renderInlineSegment = (text, baseKey) => {
|
|
|
10510
10868
|
);
|
|
10511
10869
|
} else if (match[4] !== void 0) {
|
|
10512
10870
|
nodes.push(
|
|
10513
|
-
/* @__PURE__ */ (0,
|
|
10871
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
10514
10872
|
"code",
|
|
10515
10873
|
{
|
|
10516
10874
|
className: "agg-settlement-text-code rounded-agg-sm bg-agg-secondary-hover px-1 py-0.5 font-mono text-[0.875em]",
|
|
@@ -10521,7 +10879,7 @@ var renderInlineSegment = (text, baseKey) => {
|
|
|
10521
10879
|
);
|
|
10522
10880
|
} else if (bareUrl !== void 0) {
|
|
10523
10881
|
nodes.push(
|
|
10524
|
-
/* @__PURE__ */ (0,
|
|
10882
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
10525
10883
|
"a",
|
|
10526
10884
|
{
|
|
10527
10885
|
href: bareUrl,
|
|
@@ -10538,18 +10896,18 @@ var renderInlineSegment = (text, baseKey) => {
|
|
|
10538
10896
|
}
|
|
10539
10897
|
if (lastIndex < text.length) {
|
|
10540
10898
|
nodes.push(
|
|
10541
|
-
/* @__PURE__ */ (0,
|
|
10899
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_react13.Fragment, { children: text.slice(lastIndex) }, `${baseKey}-text-${segmentIndex++}`)
|
|
10542
10900
|
);
|
|
10543
10901
|
}
|
|
10544
10902
|
return nodes;
|
|
10545
10903
|
};
|
|
10546
10904
|
var renderBlock = (block, blockIndex) => {
|
|
10547
10905
|
if (block.kind === "list") {
|
|
10548
|
-
return /* @__PURE__ */ (0,
|
|
10906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
10549
10907
|
"ul",
|
|
10550
10908
|
{
|
|
10551
10909
|
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,
|
|
10910
|
+
children: block.items.map((item, itemIndex) => /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
10553
10911
|
"li",
|
|
10554
10912
|
{
|
|
10555
10913
|
className: "agg-settlement-text-list-item",
|
|
@@ -10561,12 +10919,12 @@ var renderBlock = (block, blockIndex) => {
|
|
|
10561
10919
|
`block-${blockIndex}`
|
|
10562
10920
|
);
|
|
10563
10921
|
}
|
|
10564
|
-
return /* @__PURE__ */ (0,
|
|
10922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
10565
10923
|
"p",
|
|
10566
10924
|
{
|
|
10567
10925
|
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,
|
|
10926
|
+
children: block.lines.map((line, lineIndex) => /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_react13.Fragment, { children: [
|
|
10927
|
+
lineIndex > 0 ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("br", {}) : null,
|
|
10570
10928
|
renderInlineSegment(line, `block-${blockIndex}-line-${lineIndex}`)
|
|
10571
10929
|
] }, `block-${blockIndex}-line-${lineIndex}`))
|
|
10572
10930
|
},
|
|
@@ -10579,12 +10937,12 @@ var SettlementTextRenderer = ({
|
|
|
10579
10937
|
}) => {
|
|
10580
10938
|
const blocks = parseSettlementBlocks(content);
|
|
10581
10939
|
if (blocks.length === 0) return null;
|
|
10582
|
-
return /* @__PURE__ */ (0,
|
|
10940
|
+
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
10941
|
};
|
|
10584
10942
|
SettlementTextRenderer.displayName = "SettlementTextRenderer";
|
|
10585
10943
|
|
|
10586
10944
|
// src/trading/settlement/index.tsx
|
|
10587
|
-
var
|
|
10945
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
10588
10946
|
var SETTLEMENT_SECTION_ID = "agg-settlement-section";
|
|
10589
10947
|
var getSettlementDifferenceId = (sectionId, canonicalKey) => {
|
|
10590
10948
|
return `${sectionId}-difference-${canonicalKey}`;
|
|
@@ -10751,13 +11109,13 @@ var SettlementVenueRules = ({
|
|
|
10751
11109
|
rules,
|
|
10752
11110
|
labels
|
|
10753
11111
|
}) => {
|
|
10754
|
-
return /* @__PURE__ */ (0,
|
|
10755
|
-
/* @__PURE__ */ (0,
|
|
10756
|
-
/* @__PURE__ */ (0,
|
|
11112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "agg-settlement-venue-rules flex w-full flex-col items-start gap-4", children: [
|
|
11113
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.trading.settlementFullRulesTitle }),
|
|
11114
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "flex w-full flex-col items-start gap-4", children: rules.map((rule) => {
|
|
10757
11115
|
const venueLabel = resolveSettlementVenueLabel(rule.venue, labels);
|
|
10758
|
-
return /* @__PURE__ */ (0,
|
|
10759
|
-
/* @__PURE__ */ (0,
|
|
10760
|
-
/* @__PURE__ */ (0,
|
|
11116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("details", { className: "group/agg-settlement-rule w-full", children: [
|
|
11117
|
+
/* @__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: [
|
|
11118
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
10761
11119
|
VenueLogo,
|
|
10762
11120
|
{
|
|
10763
11121
|
venue: rule.venue,
|
|
@@ -10766,8 +11124,8 @@ var SettlementVenueRules = ({
|
|
|
10766
11124
|
ariaLabel: venueLabel
|
|
10767
11125
|
}
|
|
10768
11126
|
),
|
|
10769
|
-
/* @__PURE__ */ (0,
|
|
10770
|
-
/* @__PURE__ */ (0,
|
|
11127
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "text-agg-foreground group-hover/agg-settlement-rule:text-agg-muted-foreground transition-colors", children: venueLabel }),
|
|
11128
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
10771
11129
|
"i",
|
|
10772
11130
|
{
|
|
10773
11131
|
className: cn(
|
|
@@ -10780,7 +11138,7 @@ var SettlementVenueRules = ({
|
|
|
10780
11138
|
}
|
|
10781
11139
|
)
|
|
10782
11140
|
] }),
|
|
10783
|
-
/* @__PURE__ */ (0,
|
|
11141
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "mt-3 pl-6", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(SettlementTextRenderer, { content: rule.content }) })
|
|
10784
11142
|
] }, rule.venue);
|
|
10785
11143
|
}) })
|
|
10786
11144
|
] });
|
|
@@ -10799,7 +11157,7 @@ var Settlement = ({
|
|
|
10799
11157
|
isLoading = false
|
|
10800
11158
|
}) => {
|
|
10801
11159
|
var _a, _b, _c, _d, _e;
|
|
10802
|
-
const labels = (0,
|
|
11160
|
+
const labels = (0, import_hooks41.useLabels)();
|
|
10803
11161
|
const blocks = (0, import_react14.useMemo)(
|
|
10804
11162
|
() => dedupeSettlementSources({
|
|
10805
11163
|
eventDescription,
|
|
@@ -10844,7 +11202,7 @@ var Settlement = ({
|
|
|
10844
11202
|
);
|
|
10845
11203
|
};
|
|
10846
11204
|
if (isLoading) {
|
|
10847
|
-
return /* @__PURE__ */ (0,
|
|
11205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
10848
11206
|
Skeleton,
|
|
10849
11207
|
{
|
|
10850
11208
|
ariaLabel: labels.trading.settlementLoading,
|
|
@@ -10855,7 +11213,7 @@ var Settlement = ({
|
|
|
10855
11213
|
}
|
|
10856
11214
|
if (!hasSettlementContent) return null;
|
|
10857
11215
|
const resolvedSectionLabel = sectionLabel === defaultSettlementSectionLabel ? labels.trading.settlementSection : sectionLabel;
|
|
10858
|
-
return /* @__PURE__ */ (0,
|
|
11216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
10859
11217
|
Card,
|
|
10860
11218
|
{
|
|
10861
11219
|
id,
|
|
@@ -10865,51 +11223,51 @@ var Settlement = ({
|
|
|
10865
11223
|
className
|
|
10866
11224
|
),
|
|
10867
11225
|
children: [
|
|
10868
|
-
/* @__PURE__ */ (0,
|
|
10869
|
-
/* @__PURE__ */ (0,
|
|
10870
|
-
question ? /* @__PURE__ */ (0,
|
|
11226
|
+
/* @__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: [
|
|
11227
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { className: "shrink-0 text-agg-xs font-agg-bold leading-agg-4 uppercase", children: resolvedSectionLabel }),
|
|
11228
|
+
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
11229
|
] }),
|
|
10872
|
-
/* @__PURE__ */ (0,
|
|
10873
|
-
hasStandaloneSettlementText ? /* @__PURE__ */ (0,
|
|
10874
|
-
standaloneEventBlock || standaloneMarketBlock ? /* @__PURE__ */ (0,
|
|
11230
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "agg-settlement-sections flex w-full flex-col items-start gap-5", children: [
|
|
11231
|
+
hasStandaloneSettlementText ? /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "w-full", children: [
|
|
11232
|
+
standaloneEventBlock || standaloneMarketBlock ? /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
10875
11233
|
"div",
|
|
10876
11234
|
{
|
|
10877
11235
|
className: "agg-settlement-section agg-settlement-section-description",
|
|
10878
11236
|
"data-source": "description",
|
|
10879
11237
|
children: [
|
|
10880
|
-
standaloneEventBlock ? /* @__PURE__ */ (0,
|
|
10881
|
-
standaloneEventBlock && standaloneMarketBlock ? /* @__PURE__ */ (0,
|
|
10882
|
-
standaloneMarketBlock ? /* @__PURE__ */ (0,
|
|
11238
|
+
standaloneEventBlock ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { "data-source": "eventDescription", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(SettlementTextRenderer, { content: standaloneEventBlock.content }) }) : null,
|
|
11239
|
+
standaloneEventBlock && standaloneMarketBlock ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("hr", { className: "agg-settlement-divider my-4 border-0 border-t border-agg-separator" }) : null,
|
|
11240
|
+
standaloneMarketBlock ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { "data-source": "marketDescription", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(SettlementTextRenderer, { content: standaloneMarketBlock.content }) }) : null
|
|
10883
11241
|
]
|
|
10884
11242
|
}
|
|
10885
11243
|
) : null,
|
|
10886
|
-
standalonePrimaryRulesBlock ? /* @__PURE__ */ (0,
|
|
11244
|
+
standalonePrimaryRulesBlock ? /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
10887
11245
|
"div",
|
|
10888
11246
|
{
|
|
10889
11247
|
className: "agg-settlement-section agg-settlement-section-primaryRules",
|
|
10890
11248
|
"data-source": "primaryRules",
|
|
10891
11249
|
children: [
|
|
10892
|
-
/* @__PURE__ */ (0,
|
|
10893
|
-
/* @__PURE__ */ (0,
|
|
11250
|
+
/* @__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 }),
|
|
11251
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(SettlementTextRenderer, { content: standalonePrimaryRulesBlock.content })
|
|
10894
11252
|
]
|
|
10895
11253
|
}
|
|
10896
11254
|
) : null
|
|
10897
11255
|
] }) : null,
|
|
10898
|
-
hasSettlementDifferences ? /* @__PURE__ */ (0,
|
|
10899
|
-
/* @__PURE__ */ (0,
|
|
10900
|
-
/* @__PURE__ */ (0,
|
|
10901
|
-
/* @__PURE__ */ (0,
|
|
11256
|
+
hasSettlementDifferences ? /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "agg-settlement-differences flex w-full flex-col items-start gap-5", children: [
|
|
11257
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
11258
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.trading.settlementDifferencesTitle }),
|
|
11259
|
+
/* @__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
11260
|
] }),
|
|
10903
|
-
/* @__PURE__ */ (0,
|
|
11261
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "flex w-full flex-col items-start gap-5", children: settlementDifferences.map((difference) => {
|
|
10904
11262
|
const venueKeys = resolveDifferenceVenueKeys(difference, settlementVenues);
|
|
10905
11263
|
const isExpanded = openDifferenceKeys.includes(difference.canonicalKey) && venueKeys.length > 0;
|
|
10906
|
-
return /* @__PURE__ */ (0,
|
|
11264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
10907
11265
|
"div",
|
|
10908
11266
|
{
|
|
10909
11267
|
id: getSettlementDifferenceId(id, difference.canonicalKey),
|
|
10910
11268
|
className: "agg-settlement-difference flex w-full flex-col items-start gap-2 rounded-agg-lg",
|
|
10911
11269
|
children: [
|
|
10912
|
-
/* @__PURE__ */ (0,
|
|
11270
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
10913
11271
|
"button",
|
|
10914
11272
|
{
|
|
10915
11273
|
type: "button",
|
|
@@ -10917,7 +11275,7 @@ var Settlement = ({
|
|
|
10917
11275
|
"aria-expanded": isExpanded,
|
|
10918
11276
|
onClick: () => handleToggleDifference(difference.canonicalKey),
|
|
10919
11277
|
children: [
|
|
10920
|
-
/* @__PURE__ */ (0,
|
|
11278
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
10921
11279
|
"i",
|
|
10922
11280
|
{
|
|
10923
11281
|
className: cn(
|
|
@@ -10928,8 +11286,8 @@ var Settlement = ({
|
|
|
10928
11286
|
"aria-hidden": "true"
|
|
10929
11287
|
}
|
|
10930
11288
|
),
|
|
10931
|
-
/* @__PURE__ */ (0,
|
|
10932
|
-
/* @__PURE__ */ (0,
|
|
11289
|
+
/* @__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 }),
|
|
11290
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
10933
11291
|
"i",
|
|
10934
11292
|
{
|
|
10935
11293
|
className: cn(
|
|
@@ -10944,12 +11302,12 @@ var Settlement = ({
|
|
|
10944
11302
|
]
|
|
10945
11303
|
}
|
|
10946
11304
|
),
|
|
10947
|
-
isExpanded ? /* @__PURE__ */ (0,
|
|
11305
|
+
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
11306
|
var _a2;
|
|
10949
11307
|
const venueValue = (_a2 = difference.perVenue[venue]) != null ? _a2 : labels.trading.settlementValueUnavailable;
|
|
10950
11308
|
const venueLabel = resolveSettlementVenueLabel(venue, labels);
|
|
10951
|
-
return /* @__PURE__ */ (0,
|
|
10952
|
-
/* @__PURE__ */ (0,
|
|
11309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex w-full items-start gap-2", children: [
|
|
11310
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
10953
11311
|
VenueLogo,
|
|
10954
11312
|
{
|
|
10955
11313
|
venue,
|
|
@@ -10958,8 +11316,8 @@ var Settlement = ({
|
|
|
10958
11316
|
ariaLabel: venueLabel
|
|
10959
11317
|
}
|
|
10960
11318
|
),
|
|
10961
|
-
/* @__PURE__ */ (0,
|
|
10962
|
-
/* @__PURE__ */ (0,
|
|
11319
|
+
/* @__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 }),
|
|
11320
|
+
/* @__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
11321
|
] }, venue);
|
|
10964
11322
|
}) }) : null
|
|
10965
11323
|
]
|
|
@@ -10968,9 +11326,9 @@ var Settlement = ({
|
|
|
10968
11326
|
);
|
|
10969
11327
|
}) })
|
|
10970
11328
|
] }) : null,
|
|
10971
|
-
hasVenueSettlementRules ? /* @__PURE__ */ (0,
|
|
10972
|
-
hasSettlementDifferences || hasStandaloneSettlementText ? /* @__PURE__ */ (0,
|
|
10973
|
-
/* @__PURE__ */ (0,
|
|
11329
|
+
hasVenueSettlementRules ? /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(import_jsx_runtime129.Fragment, { children: [
|
|
11330
|
+
hasSettlementDifferences || hasStandaloneSettlementText ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "h-px w-full bg-agg-separator" }) : null,
|
|
11331
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(SettlementVenueRules, { rules: venueRuleBlocks, labels })
|
|
10974
11332
|
] }) : null
|
|
10975
11333
|
] })
|
|
10976
11334
|
]
|
|
@@ -10980,13 +11338,13 @@ var Settlement = ({
|
|
|
10980
11338
|
Settlement.displayName = "Settlement";
|
|
10981
11339
|
|
|
10982
11340
|
// src/events/item-details/settlement-summary.tsx
|
|
10983
|
-
var
|
|
11341
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
10984
11342
|
var SettlementSummary = ({
|
|
10985
11343
|
settlementDiff,
|
|
10986
11344
|
settlementSectionId = SETTLEMENT_SECTION_ID,
|
|
10987
11345
|
className
|
|
10988
11346
|
}) => {
|
|
10989
|
-
const labels = (0,
|
|
11347
|
+
const labels = (0, import_hooks42.useLabels)();
|
|
10990
11348
|
const settlementDifferences = (0, import_react15.useMemo)(
|
|
10991
11349
|
() => prepareSettlementDifferences(settlementDiff == null ? void 0 : settlementDiff.differences),
|
|
10992
11350
|
[settlementDiff == null ? void 0 : settlementDiff.differences]
|
|
@@ -11000,7 +11358,7 @@ var SettlementSummary = ({
|
|
|
11000
11358
|
if (!target) return;
|
|
11001
11359
|
target.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
11002
11360
|
};
|
|
11003
|
-
const actionButton = /* @__PURE__ */ (0,
|
|
11361
|
+
const actionButton = /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
11004
11362
|
"button",
|
|
11005
11363
|
{
|
|
11006
11364
|
type: "button",
|
|
@@ -11013,8 +11371,8 @@ var SettlementSummary = ({
|
|
|
11013
11371
|
"aria-controls": settlementSectionId,
|
|
11014
11372
|
onClick: handleReadFullDetails,
|
|
11015
11373
|
children: [
|
|
11016
|
-
/* @__PURE__ */ (0,
|
|
11017
|
-
/* @__PURE__ */ (0,
|
|
11374
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { children: labels.settlementSummary.readFullDetails }),
|
|
11375
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
11018
11376
|
"i",
|
|
11019
11377
|
{
|
|
11020
11378
|
className: "fi fi-rr-arrow-small-down size-3.5!",
|
|
@@ -11027,7 +11385,7 @@ var SettlementSummary = ({
|
|
|
11027
11385
|
);
|
|
11028
11386
|
const visibleDifferences = settlementDifferences.slice(0, 2);
|
|
11029
11387
|
const hiddenDifferenceCount = settlementDifferences.length - visibleDifferences.length;
|
|
11030
|
-
return /* @__PURE__ */ (0,
|
|
11388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
11031
11389
|
"div",
|
|
11032
11390
|
{
|
|
11033
11391
|
className: cn(
|
|
@@ -11035,18 +11393,18 @@ var SettlementSummary = ({
|
|
|
11035
11393
|
className
|
|
11036
11394
|
),
|
|
11037
11395
|
children: [
|
|
11038
|
-
/* @__PURE__ */ (0,
|
|
11039
|
-
/* @__PURE__ */ (0,
|
|
11040
|
-
/* @__PURE__ */ (0,
|
|
11041
|
-
/* @__PURE__ */ (0,
|
|
11396
|
+
/* @__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: [
|
|
11397
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "agg-settlement-summary-heading flex shrink-0 items-center gap-2", children: [
|
|
11398
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("p", { className: "text-agg-sm font-agg-normal leading-agg-5 text-agg-foreground", children: labels.settlementSummary.title }),
|
|
11399
|
+
/* @__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
11400
|
] }),
|
|
11043
|
-
/* @__PURE__ */ (0,
|
|
11044
|
-
visibleDifferences.map((difference) => /* @__PURE__ */ (0,
|
|
11401
|
+
/* @__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: [
|
|
11402
|
+
visibleDifferences.map((difference) => /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
11045
11403
|
"span",
|
|
11046
11404
|
{
|
|
11047
11405
|
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
11406
|
children: [
|
|
11049
|
-
/* @__PURE__ */ (0,
|
|
11407
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
11050
11408
|
"i",
|
|
11051
11409
|
{
|
|
11052
11410
|
className: cn(
|
|
@@ -11057,12 +11415,12 @@ var SettlementSummary = ({
|
|
|
11057
11415
|
"aria-hidden": "true"
|
|
11058
11416
|
}
|
|
11059
11417
|
),
|
|
11060
|
-
/* @__PURE__ */ (0,
|
|
11418
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "min-w-0 truncate", children: difference.title })
|
|
11061
11419
|
]
|
|
11062
11420
|
},
|
|
11063
11421
|
difference.canonicalKey
|
|
11064
11422
|
)),
|
|
11065
|
-
hiddenDifferenceCount > 0 ? /* @__PURE__ */ (0,
|
|
11423
|
+
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
11424
|
"+",
|
|
11067
11425
|
hiddenDifferenceCount
|
|
11068
11426
|
] }) : null
|
|
@@ -11076,7 +11434,7 @@ var SettlementSummary = ({
|
|
|
11076
11434
|
SettlementSummary.displayName = "SettlementSummary";
|
|
11077
11435
|
|
|
11078
11436
|
// src/events/item-details/index.tsx
|
|
11079
|
-
var
|
|
11437
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
11080
11438
|
var resolveEventDetailsSyncKey = (event) => {
|
|
11081
11439
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
11082
11440
|
const parts = [
|
|
@@ -11121,8 +11479,8 @@ var EventListItemDetailsLoadingState = ({
|
|
|
11121
11479
|
classNames,
|
|
11122
11480
|
ariaLabel
|
|
11123
11481
|
}) => {
|
|
11124
|
-
const labels = (0,
|
|
11125
|
-
return /* @__PURE__ */ (0,
|
|
11482
|
+
const labels = (0, import_hooks43.useLabels)();
|
|
11483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11126
11484
|
Skeleton,
|
|
11127
11485
|
{
|
|
11128
11486
|
view: "event-list-item-details",
|
|
@@ -11135,16 +11493,16 @@ var EventListItemDetailsUnavailableState = ({
|
|
|
11135
11493
|
classNames,
|
|
11136
11494
|
ariaLabel
|
|
11137
11495
|
}) => {
|
|
11138
|
-
const labels = (0,
|
|
11139
|
-
return /* @__PURE__ */ (0,
|
|
11496
|
+
const labels = (0, import_hooks43.useLabels)();
|
|
11497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11140
11498
|
Card,
|
|
11141
11499
|
{
|
|
11142
11500
|
className: cn(detailsBaseCardClassName, classNames == null ? void 0 : classNames.root),
|
|
11143
11501
|
role: "status",
|
|
11144
11502
|
"aria-label": ariaLabel != null ? ariaLabel : labels.eventItemDetails.unavailableAria,
|
|
11145
|
-
children: /* @__PURE__ */ (0,
|
|
11146
|
-
/* @__PURE__ */ (0,
|
|
11147
|
-
/* @__PURE__ */ (0,
|
|
11503
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: cn("flex flex-col gap-1", classNames == null ? void 0 : classNames.header), children: [
|
|
11504
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Typography, { variant: "body-large-strong", className: cn("truncate", classNames == null ? void 0 : classNames.title), children: labels.eventItemDetails.unavailableTitle }),
|
|
11505
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Typography, { variant: "body", className: "text-agg-muted-foreground", children: labels.eventItemDetails.unavailableDescription })
|
|
11148
11506
|
] })
|
|
11149
11507
|
}
|
|
11150
11508
|
);
|
|
@@ -11153,13 +11511,13 @@ var EventListItemDetailsNotFoundState = ({
|
|
|
11153
11511
|
classNames: _classNames,
|
|
11154
11512
|
ariaLabel: _ariaLabel
|
|
11155
11513
|
}) => {
|
|
11156
|
-
const labels = (0,
|
|
11157
|
-
return /* @__PURE__ */ (0,
|
|
11514
|
+
const labels = (0, import_hooks43.useLabels)();
|
|
11515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11158
11516
|
StateMessage,
|
|
11159
11517
|
{
|
|
11160
11518
|
title: labels.eventItemDetails.notFoundTitle,
|
|
11161
11519
|
description: labels.eventItemDetails.notFoundDescription,
|
|
11162
|
-
icon: /* @__PURE__ */ (0,
|
|
11520
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(SearchEmptyIcon, {}),
|
|
11163
11521
|
classNames: { root: "min-h-[280px] md:min-h-[320px]" }
|
|
11164
11522
|
}
|
|
11165
11523
|
);
|
|
@@ -11184,8 +11542,8 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11184
11542
|
onRangeOverrideChange
|
|
11185
11543
|
}) => {
|
|
11186
11544
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
11187
|
-
const labels = (0,
|
|
11188
|
-
const tradingContext = (0,
|
|
11545
|
+
const labels = (0, import_hooks43.useLabels)();
|
|
11546
|
+
const tradingContext = (0, import_hooks35.useEventTradingContext)();
|
|
11189
11547
|
const [selectedGraphVenue, setSelectedGraphVenue] = (0, import_react16.useState)(null);
|
|
11190
11548
|
const [chartOutcomeLabel, setChartOutcomeLabel] = (0, import_react16.useState)(
|
|
11191
11549
|
(_c = (_b = (_a = tradingContext == null ? void 0 : tradingContext.selectedOutcome) == null ? void 0 : _a.label) == null ? void 0 : _b.trim()) != null ? _c : null
|
|
@@ -11202,10 +11560,10 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11202
11560
|
chart: { selectedChartTimeRange },
|
|
11203
11561
|
formatting: { formatPercent, formatPrice },
|
|
11204
11562
|
general: { theme }
|
|
11205
|
-
} = (0,
|
|
11563
|
+
} = (0, import_hooks43.useSdkUiConfig)();
|
|
11206
11564
|
const isDarkTheme = theme === "dark";
|
|
11207
11565
|
const effectiveChartTimeRange = rangeOverride != null ? rangeOverride : selectedChartTimeRange;
|
|
11208
|
-
const rollingWindow = (0,
|
|
11566
|
+
const rollingWindow = (0, import_hooks43.useRollingChartWindow)({ range: effectiveChartTimeRange });
|
|
11209
11567
|
const availableMarkets = (0, import_react16.useMemo)(() => {
|
|
11210
11568
|
var _a2, _b2, _c2, _d2;
|
|
11211
11569
|
if (venueMarkets.length === 0) return [];
|
|
@@ -11236,7 +11594,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11236
11594
|
isLoading: isScopedMarketChartLoading,
|
|
11237
11595
|
error: scopedMarketChartError,
|
|
11238
11596
|
refetch: refetchScopedMarketChart
|
|
11239
|
-
} = (0,
|
|
11597
|
+
} = (0, import_hooks43.useMarketChart)({
|
|
11240
11598
|
marketId: chartPrimaryOutcomeId,
|
|
11241
11599
|
venueMarketIds: availableVenueOutcomes.map((item) => item.outcome.id),
|
|
11242
11600
|
interval: rollingWindow.interval,
|
|
@@ -11293,7 +11651,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11293
11651
|
const resolvedOutcomePriceByMarketId = (0, import_react16.useMemo)(() => {
|
|
11294
11652
|
const map = /* @__PURE__ */ new Map();
|
|
11295
11653
|
for (const market of availableMarkets) {
|
|
11296
|
-
const marketTradingState = (0,
|
|
11654
|
+
const marketTradingState = (0, import_hooks43.resolveMarketTradingState)(market);
|
|
11297
11655
|
if (marketTradingState.kind !== "resolved") continue;
|
|
11298
11656
|
const outcomePriceMap = resolveResolvedOutcomePriceMap(market.venueMarketOutcomes);
|
|
11299
11657
|
if (outcomePriceMap) {
|
|
@@ -11353,18 +11711,18 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11353
11711
|
void refetchScopedMarketChart();
|
|
11354
11712
|
};
|
|
11355
11713
|
if (scopedMarketChartError) {
|
|
11356
|
-
return /* @__PURE__ */ (0,
|
|
11714
|
+
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
11715
|
StateMessage,
|
|
11358
11716
|
{
|
|
11359
11717
|
title: labels.eventItemDetails.chartUnavailableTitle,
|
|
11360
11718
|
description: labels.eventItemDetails.chartUnavailableDescription,
|
|
11361
|
-
icon: /* @__PURE__ */ (0,
|
|
11719
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(WarningIcon, {}),
|
|
11362
11720
|
onAction: handleRetryMarketChart,
|
|
11363
11721
|
classNames: { root: "min-h-[300px] px-5 py-10 md:px-10" }
|
|
11364
11722
|
}
|
|
11365
11723
|
) });
|
|
11366
11724
|
}
|
|
11367
|
-
return /* @__PURE__ */ (0,
|
|
11725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11368
11726
|
LineChart,
|
|
11369
11727
|
{
|
|
11370
11728
|
classNames: { root: cn("agg-chart-region", classNames == null ? void 0 : classNames.chart) },
|
|
@@ -11377,7 +11735,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11377
11735
|
showSeriesControls: selectedMarketOutcomes.length > 0,
|
|
11378
11736
|
renderSeriesControls: ({ handleSeriesChange }) => {
|
|
11379
11737
|
var _a2, _b2, _c2, _d2;
|
|
11380
|
-
return /* @__PURE__ */ (0,
|
|
11738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
11381
11739
|
"div",
|
|
11382
11740
|
{
|
|
11383
11741
|
className: cn(
|
|
@@ -11388,7 +11746,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11388
11746
|
classNames == null ? void 0 : classNames.summary
|
|
11389
11747
|
),
|
|
11390
11748
|
children: [
|
|
11391
|
-
/* @__PURE__ */ (0,
|
|
11749
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11392
11750
|
"div",
|
|
11393
11751
|
{
|
|
11394
11752
|
className: cn(
|
|
@@ -11402,7 +11760,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11402
11760
|
const text = formatMarketProbabilityPercent(percentage, formatPercent);
|
|
11403
11761
|
const seriesId = `${item.venue}-chart`;
|
|
11404
11762
|
const isActiveVenue = activeGraphVenue === item.venue;
|
|
11405
|
-
return /* @__PURE__ */ (0,
|
|
11763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11406
11764
|
"button",
|
|
11407
11765
|
{
|
|
11408
11766
|
type: "button",
|
|
@@ -11421,12 +11779,12 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11421
11779
|
setSelectedGraphVenue(nextSelectedGraphVenue);
|
|
11422
11780
|
handleSeriesChange(seriesId);
|
|
11423
11781
|
},
|
|
11424
|
-
children: /* @__PURE__ */ (0,
|
|
11782
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11425
11783
|
Badge,
|
|
11426
11784
|
{
|
|
11427
11785
|
text,
|
|
11428
11786
|
size: "large",
|
|
11429
|
-
prefix: /* @__PURE__ */ (0,
|
|
11787
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11430
11788
|
VenueLogo,
|
|
11431
11789
|
{
|
|
11432
11790
|
venue: item.market.venue,
|
|
@@ -11448,7 +11806,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11448
11806
|
})
|
|
11449
11807
|
}
|
|
11450
11808
|
),
|
|
11451
|
-
/* @__PURE__ */ (0,
|
|
11809
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11452
11810
|
SwitchButton,
|
|
11453
11811
|
{
|
|
11454
11812
|
ariaLabel: labels.eventItemDetails.outcomeSelectorAria,
|
|
@@ -11499,19 +11857,21 @@ var EventListItemDetailsContent = ({
|
|
|
11499
11857
|
ariaLabel,
|
|
11500
11858
|
defaultTimeRange,
|
|
11501
11859
|
onClick,
|
|
11502
|
-
midpointsResult
|
|
11860
|
+
midpointsResult,
|
|
11861
|
+
recurringMarkets,
|
|
11862
|
+
sportsLiveState
|
|
11503
11863
|
}) => {
|
|
11504
|
-
var _a, _b, _c, _d;
|
|
11864
|
+
var _a, _b, _c, _d, _e, _f;
|
|
11505
11865
|
const [selectedChartType, setSelectedChartType] = (0, import_react16.useState)("line");
|
|
11506
11866
|
const lastAppliedEventSyncKeyRef = (0, import_react16.useRef)(null);
|
|
11507
11867
|
const lastAppliedDefaultRef = (0, import_react16.useRef)(null);
|
|
11508
11868
|
const [chartRangeOverride, setChartRangeOverride] = (0, import_react16.useState)(null);
|
|
11509
|
-
const config = (0,
|
|
11510
|
-
const labels = (0,
|
|
11511
|
-
const tradingContext = (0,
|
|
11869
|
+
const config = (0, import_hooks43.useSdkUiConfig)();
|
|
11870
|
+
const labels = (0, import_hooks43.useLabels)();
|
|
11871
|
+
const tradingContext = (0, import_hooks35.useEventTradingContext)();
|
|
11512
11872
|
const eventSyncKey = (0, import_react16.useMemo)(() => resolveEventDetailsSyncKey(event), [event]);
|
|
11513
11873
|
const resolvedEventTradingState = (0, import_react16.useMemo)(() => {
|
|
11514
|
-
return eventTradingState != null ? eventTradingState : (0,
|
|
11874
|
+
return eventTradingState != null ? eventTradingState : (0, import_hooks43.resolveEventTradingState)(event);
|
|
11515
11875
|
}, [event, eventTradingState]);
|
|
11516
11876
|
const scopedSelectedMarket = (tradingContext == null ? void 0 : tradingContext.selectedEventId) === event.id ? (_a = tradingContext.selectedMarket) != null ? _a : resolvedEventTradingState.primaryMarket : resolvedEventTradingState.primaryMarket;
|
|
11517
11877
|
const venueMarkets = (0, import_react16.useMemo)(
|
|
@@ -11522,12 +11882,12 @@ var EventListItemDetailsContent = ({
|
|
|
11522
11882
|
return normalizeVenueMarketCluster(venueMarkets);
|
|
11523
11883
|
}, [venueMarkets]);
|
|
11524
11884
|
const scopedSelectedMarketId = (tradingContext == null ? void 0 : tradingContext.selectedEventId) === event.id ? tradingContext.selectedMarketId : null;
|
|
11525
|
-
(0,
|
|
11885
|
+
(0, import_hooks43.useEventOrderbookData)(
|
|
11526
11886
|
resolvedEventTradingState.isTradingDisabled ? [] : resolvedEventTradingState.displayMarkets,
|
|
11527
11887
|
scopedSelectedMarketId
|
|
11528
11888
|
);
|
|
11529
|
-
const wsLivePrices = (0,
|
|
11530
|
-
const wsBestPrices = (0,
|
|
11889
|
+
const wsLivePrices = (0, import_hooks43.useLiveOutcomePrices)(eventDetailVenueMarkets);
|
|
11890
|
+
const wsBestPrices = (0, import_hooks43.useLiveBestPrices)(eventDetailVenueMarkets);
|
|
11531
11891
|
const resolvedMidpointsResult = midpointsResult != null ? midpointsResult : {
|
|
11532
11892
|
prices: /* @__PURE__ */ new Map(),
|
|
11533
11893
|
bestMidpointsByOutcomeId: /* @__PURE__ */ new Map(),
|
|
@@ -11542,7 +11902,7 @@ var EventListItemDetailsContent = ({
|
|
|
11542
11902
|
const bestMidpoint = resolvedMidpointsResult.bestMidpoint;
|
|
11543
11903
|
const restBestPrices = resolvedMidpointsResult.bestPrices;
|
|
11544
11904
|
const bestPrices = (0, import_react16.useMemo)(
|
|
11545
|
-
() => (0,
|
|
11905
|
+
() => (0, import_hooks43.mergeBestPricesPreferringLive)(restBestPrices, wsBestPrices),
|
|
11546
11906
|
[restBestPrices, wsBestPrices]
|
|
11547
11907
|
);
|
|
11548
11908
|
const livePrices = (0, import_react16.useMemo)(() => {
|
|
@@ -11622,7 +11982,9 @@ var EventListItemDetailsContent = ({
|
|
|
11622
11982
|
structureType: event.structureType,
|
|
11623
11983
|
gameStartTime: event.gameStartTime,
|
|
11624
11984
|
endDate: event.endDate,
|
|
11625
|
-
venueMarkets: event.venueMarkets
|
|
11985
|
+
venueMarkets: event.venueMarkets,
|
|
11986
|
+
recurringCryptoWindowStart: recurringMarkets ? null : void 0,
|
|
11987
|
+
recurringCryptoDuration: recurringMarkets == null ? void 0 : recurringMarkets.duration
|
|
11626
11988
|
});
|
|
11627
11989
|
}, [
|
|
11628
11990
|
event.categories,
|
|
@@ -11630,18 +11992,19 @@ var EventListItemDetailsContent = ({
|
|
|
11630
11992
|
event.gameStartTime,
|
|
11631
11993
|
event.structureType,
|
|
11632
11994
|
event.title,
|
|
11633
|
-
event.venueMarkets
|
|
11995
|
+
event.venueMarkets,
|
|
11996
|
+
recurringMarkets
|
|
11634
11997
|
]);
|
|
11635
|
-
return /* @__PURE__ */ (0,
|
|
11998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
11636
11999
|
Card,
|
|
11637
12000
|
{
|
|
11638
12001
|
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(" "),
|
|
12002
|
+
"aria-label": ariaLabel != null ? ariaLabel : [resolvedTitle.title, (_c = recurringMarkets == null ? void 0 : recurringMarkets.windowLabel) != null ? _c : resolvedTitle.timestampLabel].filter(Boolean).join(" "),
|
|
11640
12003
|
onClick: () => {
|
|
11641
12004
|
onClick == null ? void 0 : onClick(event);
|
|
11642
12005
|
},
|
|
11643
12006
|
children: [
|
|
11644
|
-
/* @__PURE__ */ (0,
|
|
12007
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
11645
12008
|
"div",
|
|
11646
12009
|
{
|
|
11647
12010
|
className: cn(
|
|
@@ -11652,44 +12015,109 @@ var EventListItemDetailsContent = ({
|
|
|
11652
12015
|
classNames == null ? void 0 : classNames.header
|
|
11653
12016
|
),
|
|
11654
12017
|
children: [
|
|
11655
|
-
/* @__PURE__ */ (0,
|
|
12018
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11656
12019
|
RemoteImage,
|
|
11657
12020
|
{
|
|
11658
|
-
src: (0,
|
|
12021
|
+
src: (0, import_hooks43.optimizedImageUrl)(event.image, 60),
|
|
11659
12022
|
alt: "",
|
|
11660
12023
|
className: "agg-event-image size-10 rounded-agg-lg object-cover md:size-[60px]"
|
|
11661
12024
|
}
|
|
11662
12025
|
),
|
|
11663
|
-
/* @__PURE__ */ (0,
|
|
11664
|
-
/* @__PURE__ */ (0,
|
|
11665
|
-
|
|
11666
|
-
|
|
11667
|
-
|
|
11668
|
-
|
|
11669
|
-
|
|
11670
|
-
|
|
11671
|
-
|
|
11672
|
-
|
|
11673
|
-
|
|
12026
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: cn("flex min-w-0 flex-1 flex-col", recurringMarkets ? "gap-3" : "gap-2"), children: [
|
|
12027
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
12028
|
+
"div",
|
|
12029
|
+
{
|
|
12030
|
+
className: cn(
|
|
12031
|
+
"min-w-0",
|
|
12032
|
+
recurringMarkets ? "flex flex-col gap-1 md:flex-row md:items-baseline md:justify-between" : null
|
|
12033
|
+
),
|
|
12034
|
+
children: [
|
|
12035
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
12036
|
+
Typography,
|
|
12037
|
+
{
|
|
12038
|
+
variant: "body-strong",
|
|
12039
|
+
className: cn(
|
|
12040
|
+
"agg-event-title",
|
|
12041
|
+
"min-w-0 text-agg-base font-agg-bold! leading-agg-6 md:text-agg-2xl md:leading-agg-8",
|
|
12042
|
+
resolvedTitle.timestampLabel && !recurringMarkets ? "truncate whitespace-nowrap" : "truncate text-wrap wrap-break-word line-clamp-2",
|
|
12043
|
+
classNames == null ? void 0 : classNames.title
|
|
12044
|
+
),
|
|
12045
|
+
children: resolvedTitle.title
|
|
12046
|
+
}
|
|
11674
12047
|
),
|
|
11675
|
-
|
|
12048
|
+
(recurringMarkets == null ? void 0 : recurringMarkets.windowLabel) ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
12049
|
+
Typography,
|
|
12050
|
+
{
|
|
12051
|
+
variant: "body",
|
|
12052
|
+
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",
|
|
12053
|
+
children: recurringMarkets.windowLabel
|
|
12054
|
+
}
|
|
12055
|
+
) : resolvedTitle.timestampLabel ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
12056
|
+
Typography,
|
|
12057
|
+
{
|
|
12058
|
+
variant: "body",
|
|
12059
|
+
className: "agg-event-timestamp mt-0.5 min-w-0 truncate text-agg-sm leading-agg-5 text-agg-muted-foreground",
|
|
12060
|
+
children: resolvedTitle.timestampLabel
|
|
12061
|
+
}
|
|
12062
|
+
) : null
|
|
12063
|
+
]
|
|
12064
|
+
}
|
|
12065
|
+
),
|
|
12066
|
+
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: [
|
|
12067
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
12068
|
+
EventListItemDetailsMarketSelector,
|
|
12069
|
+
{
|
|
12070
|
+
className: cn("min-w-0 flex-1", classNames == null ? void 0 : classNames.headerPills),
|
|
12071
|
+
options: recurringMarkets.visibleOptions,
|
|
12072
|
+
browseOptions: recurringMarkets.browseOptions,
|
|
12073
|
+
selectedValue: recurringMarkets.selectedValue,
|
|
12074
|
+
liveValue: recurringMarkets.liveValue,
|
|
12075
|
+
alwaysShowMore: true,
|
|
12076
|
+
onChange: recurringMarkets.onSelect
|
|
11676
12077
|
}
|
|
11677
12078
|
),
|
|
11678
|
-
|
|
11679
|
-
|
|
12079
|
+
recurringMarkets.isResolving ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
12080
|
+
Button,
|
|
12081
|
+
{
|
|
12082
|
+
variant: "secondary",
|
|
12083
|
+
size: "small",
|
|
12084
|
+
disabled: !recurringMarkets.canGoToLive,
|
|
12085
|
+
"aria-label": recurringMarkets.canGoToLive ? labels.eventMarketPage.goToLive : labels.eventMarketPage.liveMarketUnavailable,
|
|
12086
|
+
className: "h-8 shrink-0",
|
|
12087
|
+
onClick: (eventToHandle) => {
|
|
12088
|
+
eventToHandle.preventDefault();
|
|
12089
|
+
eventToHandle.stopPropagation();
|
|
12090
|
+
recurringMarkets.onGoToLive();
|
|
12091
|
+
},
|
|
12092
|
+
children: labels.eventMarketPage.goToLive
|
|
12093
|
+
}
|
|
12094
|
+
) : recurringMarkets.countdownLabel ? /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
12095
|
+
"div",
|
|
11680
12096
|
{
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
|
|
12097
|
+
role: "timer",
|
|
12098
|
+
"aria-live": "off",
|
|
12099
|
+
"aria-label": (_d = recurringMarkets.countdownAriaLabel) != null ? _d : void 0,
|
|
12100
|
+
className: "flex shrink-0 items-center gap-1.5 text-agg-foreground",
|
|
12101
|
+
children: [
|
|
12102
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
12103
|
+
Icon,
|
|
12104
|
+
{
|
|
12105
|
+
name: "hourglass-start",
|
|
12106
|
+
size: "small",
|
|
12107
|
+
className: "size-3.5",
|
|
12108
|
+
"aria-hidden": "true"
|
|
12109
|
+
}
|
|
12110
|
+
),
|
|
12111
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Typography, { variant: "body-strong", className: "text-agg-base leading-agg-6", children: recurringMarkets.countdownLabel })
|
|
12112
|
+
]
|
|
11684
12113
|
}
|
|
11685
12114
|
) : null
|
|
11686
|
-
] }),
|
|
11687
|
-
venueMarkets.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
12115
|
+
] }) : venueMarkets.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11688
12116
|
EventListItemDetailsMarketSelector,
|
|
11689
12117
|
{
|
|
11690
12118
|
className: classNames == null ? void 0 : classNames.headerPills,
|
|
11691
12119
|
options: marketOptions,
|
|
11692
|
-
selectedValue: (
|
|
12120
|
+
selectedValue: (_e = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.id) != null ? _e : "",
|
|
11693
12121
|
onChange: (marketId) => {
|
|
11694
12122
|
tradingContext == null ? void 0 : tradingContext.selectMarket(marketId);
|
|
11695
12123
|
}
|
|
@@ -11699,7 +12127,8 @@ var EventListItemDetailsContent = ({
|
|
|
11699
12127
|
]
|
|
11700
12128
|
}
|
|
11701
12129
|
),
|
|
11702
|
-
|
|
12130
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(SportsLiveScore, { state: sportsLiveState, className: classNames == null ? void 0 : classNames.sportsLive }),
|
|
12131
|
+
detailsStats && detailsStats.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11703
12132
|
"div",
|
|
11704
12133
|
{
|
|
11705
12134
|
className: cn(
|
|
@@ -11708,14 +12137,14 @@ var EventListItemDetailsContent = ({
|
|
|
11708
12137
|
),
|
|
11709
12138
|
children: detailsStats.map((statItem) => {
|
|
11710
12139
|
const deltaClassName = statItem.deltaTone === "positive" ? "text-agg-success!" : statItem.deltaTone === "negative" ? "text-agg-error!" : "text-agg-muted-foreground";
|
|
11711
|
-
return /* @__PURE__ */ (0,
|
|
12140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
11712
12141
|
"div",
|
|
11713
12142
|
{
|
|
11714
12143
|
className: "agg-event-stat flex flex-col gap-1",
|
|
11715
12144
|
children: [
|
|
11716
|
-
/* @__PURE__ */ (0,
|
|
11717
|
-
/* @__PURE__ */ (0,
|
|
11718
|
-
/* @__PURE__ */ (0,
|
|
12145
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Typography, { variant: "caption-caps", className: "text-agg-muted-foreground", children: statItem.label }),
|
|
12146
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "flex items-baseline gap-1", children: [
|
|
12147
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11719
12148
|
Typography,
|
|
11720
12149
|
{
|
|
11721
12150
|
variant: "body",
|
|
@@ -11723,7 +12152,7 @@ var EventListItemDetailsContent = ({
|
|
|
11723
12152
|
children: statItem.value
|
|
11724
12153
|
}
|
|
11725
12154
|
),
|
|
11726
|
-
statItem.delta ? /* @__PURE__ */ (0,
|
|
12155
|
+
statItem.delta ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Typography, { variant: "label", className: cn(deltaClassName), children: statItem.delta }) : null
|
|
11727
12156
|
] })
|
|
11728
12157
|
]
|
|
11729
12158
|
},
|
|
@@ -11732,15 +12161,15 @@ var EventListItemDetailsContent = ({
|
|
|
11732
12161
|
})
|
|
11733
12162
|
}
|
|
11734
12163
|
) : null,
|
|
11735
|
-
/* @__PURE__ */ (0,
|
|
11736
|
-
/* @__PURE__ */ (0,
|
|
12164
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: cn("agg-event-details-chart", "flex flex-col gap-2"), children: [
|
|
12165
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11737
12166
|
EventListItemDetailsGraphSection,
|
|
11738
12167
|
{
|
|
11739
12168
|
classNames,
|
|
11740
12169
|
selectedChartType,
|
|
11741
12170
|
venueInfo,
|
|
11742
12171
|
venueMarkets,
|
|
11743
|
-
selectedMarketId: (
|
|
12172
|
+
selectedMarketId: (_f = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.id) != null ? _f : null,
|
|
11744
12173
|
livePrices,
|
|
11745
12174
|
restMidpoints,
|
|
11746
12175
|
bestMidpoint,
|
|
@@ -11750,7 +12179,7 @@ var EventListItemDetailsContent = ({
|
|
|
11750
12179
|
onRangeOverrideChange: setChartRangeOverride
|
|
11751
12180
|
}
|
|
11752
12181
|
),
|
|
11753
|
-
/* @__PURE__ */ (0,
|
|
12182
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
11754
12183
|
"div",
|
|
11755
12184
|
{
|
|
11756
12185
|
className: cn(
|
|
@@ -11758,8 +12187,8 @@ var EventListItemDetailsContent = ({
|
|
|
11758
12187
|
classNames == null ? void 0 : classNames.footer
|
|
11759
12188
|
),
|
|
11760
12189
|
children: [
|
|
11761
|
-
/* @__PURE__ */ (0,
|
|
11762
|
-
/* @__PURE__ */ (0,
|
|
12190
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Typography, { variant: "label", className: "agg-chart-volume text-agg-muted-foreground", children: volumeLabel || "-" }),
|
|
12191
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
11763
12192
|
"div",
|
|
11764
12193
|
{
|
|
11765
12194
|
className: cn(
|
|
@@ -11767,7 +12196,7 @@ var EventListItemDetailsContent = ({
|
|
|
11767
12196
|
classNames == null ? void 0 : classNames.timeRange
|
|
11768
12197
|
),
|
|
11769
12198
|
children: [
|
|
11770
|
-
/* @__PURE__ */ (0,
|
|
12199
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11771
12200
|
ChartTypeSwitch,
|
|
11772
12201
|
{
|
|
11773
12202
|
className: "agg-chart-type-switch",
|
|
@@ -11775,11 +12204,11 @@ var EventListItemDetailsContent = ({
|
|
|
11775
12204
|
onValueChange: setSelectedChartType
|
|
11776
12205
|
}
|
|
11777
12206
|
),
|
|
11778
|
-
/* @__PURE__ */ (0,
|
|
11779
|
-
|
|
12207
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { "aria-hidden": "true", className: "hidden h-4 w-px bg-agg-separator md:block" }),
|
|
12208
|
+
import_hooks43.CHART_TIME_RANGES.map((timeRange) => {
|
|
11780
12209
|
const effectiveRange = chartRangeOverride != null ? chartRangeOverride : config.chart.selectedChartTimeRange;
|
|
11781
12210
|
const isActive = timeRange === effectiveRange;
|
|
11782
|
-
return /* @__PURE__ */ (0,
|
|
12211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11783
12212
|
Button,
|
|
11784
12213
|
{
|
|
11785
12214
|
size: "small",
|
|
@@ -11810,7 +12239,7 @@ var EventListItemDetailsContent = ({
|
|
|
11810
12239
|
}
|
|
11811
12240
|
)
|
|
11812
12241
|
] }),
|
|
11813
|
-
event.description || event.settlementDiff ? /* @__PURE__ */ (0,
|
|
12242
|
+
event.description || event.settlementDiff ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(SettlementSummary, { content: event.description, settlementDiff: event.settlementDiff }) : null
|
|
11814
12243
|
]
|
|
11815
12244
|
}
|
|
11816
12245
|
);
|
|
@@ -11827,12 +12256,12 @@ var EventListItemDetailsByEventId = (_a) => {
|
|
|
11827
12256
|
error,
|
|
11828
12257
|
isError,
|
|
11829
12258
|
isLoading
|
|
11830
|
-
} = (0,
|
|
12259
|
+
} = (0, import_hooks43.useVenueEvent)({
|
|
11831
12260
|
eventId: resolvedEventId,
|
|
11832
12261
|
enabled: !!resolvedEventId
|
|
11833
12262
|
});
|
|
11834
12263
|
if (!resolvedEventId) {
|
|
11835
|
-
return /* @__PURE__ */ (0,
|
|
12264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11836
12265
|
EventListItemDetailsUnavailableState,
|
|
11837
12266
|
{
|
|
11838
12267
|
classNames: rest.classNames,
|
|
@@ -11841,16 +12270,16 @@ var EventListItemDetailsByEventId = (_a) => {
|
|
|
11841
12270
|
);
|
|
11842
12271
|
}
|
|
11843
12272
|
if (isLoading) {
|
|
11844
|
-
return /* @__PURE__ */ (0,
|
|
12273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(EventListItemDetailsLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
11845
12274
|
}
|
|
11846
12275
|
if (isErrorWithStatus(error, 404)) {
|
|
11847
|
-
return /* @__PURE__ */ (0,
|
|
12276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(EventListItemDetailsNotFoundState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
11848
12277
|
}
|
|
11849
12278
|
if (!fetchedEvent && !isError) {
|
|
11850
|
-
return /* @__PURE__ */ (0,
|
|
12279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(EventListItemDetailsLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
|
|
11851
12280
|
}
|
|
11852
12281
|
if (!fetchedEvent) {
|
|
11853
|
-
return /* @__PURE__ */ (0,
|
|
12282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11854
12283
|
EventListItemDetailsUnavailableState,
|
|
11855
12284
|
{
|
|
11856
12285
|
classNames: rest.classNames,
|
|
@@ -11858,15 +12287,15 @@ var EventListItemDetailsByEventId = (_a) => {
|
|
|
11858
12287
|
}
|
|
11859
12288
|
);
|
|
11860
12289
|
}
|
|
11861
|
-
return /* @__PURE__ */ (0,
|
|
12290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(EventListItemDetailsContent, __spreadValues({ event: fetchedEvent }, rest));
|
|
11862
12291
|
};
|
|
11863
12292
|
var EventListItemDetails = (props) => {
|
|
11864
12293
|
if (props.isLoading) {
|
|
11865
|
-
return /* @__PURE__ */ (0,
|
|
12294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(EventListItemDetailsLoadingState, { classNames: props.classNames, ariaLabel: props.ariaLabel });
|
|
11866
12295
|
}
|
|
11867
12296
|
if ("event" in props && props.event) {
|
|
11868
12297
|
const _a = props, { event } = _a, rest = __objRest(_a, ["event"]);
|
|
11869
|
-
return /* @__PURE__ */ (0,
|
|
12298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(EventListItemDetailsContent, __spreadValues({ event }, rest));
|
|
11870
12299
|
}
|
|
11871
12300
|
if ("eventId" in props && typeof props.eventId === "string") {
|
|
11872
12301
|
const {
|
|
@@ -11889,9 +12318,9 @@ var EventListItemDetails = (props) => {
|
|
|
11889
12318
|
ariaLabel: ariaLabelOverride,
|
|
11890
12319
|
onClick
|
|
11891
12320
|
};
|
|
11892
|
-
return /* @__PURE__ */ (0,
|
|
12321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(EventListItemDetailsByEventId, __spreadValues({}, byEventIdProps));
|
|
11893
12322
|
}
|
|
11894
|
-
return /* @__PURE__ */ (0,
|
|
12323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
11895
12324
|
EventListItemDetailsUnavailableState,
|
|
11896
12325
|
{
|
|
11897
12326
|
classNames: props.classNames,
|
|
@@ -11902,11 +12331,11 @@ var EventListItemDetails = (props) => {
|
|
|
11902
12331
|
EventListItemDetails.displayName = "EventListItemDetails";
|
|
11903
12332
|
|
|
11904
12333
|
// src/events/market-details/index.tsx
|
|
11905
|
-
var
|
|
12334
|
+
var import_hooks47 = require("@agg-build/hooks");
|
|
11906
12335
|
var import_react20 = require("react");
|
|
11907
12336
|
|
|
11908
12337
|
// src/events/orderbook/index.tsx
|
|
11909
|
-
var
|
|
12338
|
+
var import_hooks44 = require("@agg-build/hooks");
|
|
11910
12339
|
var import_react18 = require("react");
|
|
11911
12340
|
|
|
11912
12341
|
// src/events/orderbook/orderbook.constants.ts
|
|
@@ -12070,7 +12499,7 @@ var useCenterOrderbookSpread = ({
|
|
|
12070
12499
|
};
|
|
12071
12500
|
|
|
12072
12501
|
// src/events/orderbook/orderbook-with-states.tsx
|
|
12073
|
-
var
|
|
12502
|
+
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
12074
12503
|
var stateMessageMinHeight = "min-h-[248px] px-5 py-10 md:min-h-[272px]";
|
|
12075
12504
|
var OrderbookWithStates = (_a) => {
|
|
12076
12505
|
var _b = _a, {
|
|
@@ -12082,65 +12511,65 @@ var OrderbookWithStates = (_a) => {
|
|
|
12082
12511
|
]);
|
|
12083
12512
|
var _a2;
|
|
12084
12513
|
if (state.kind === "loading") {
|
|
12085
|
-
return /* @__PURE__ */ (0,
|
|
12514
|
+
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
12515
|
}
|
|
12087
12516
|
if (state.kind === "disabled") {
|
|
12088
|
-
return /* @__PURE__ */ (0,
|
|
12517
|
+
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
12518
|
StateMessage,
|
|
12090
12519
|
{
|
|
12091
12520
|
title: state.title,
|
|
12092
12521
|
description: state.description,
|
|
12093
|
-
icon: (_a2 = state.icon) != null ? _a2 : /* @__PURE__ */ (0,
|
|
12522
|
+
icon: (_a2 = state.icon) != null ? _a2 : /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(WarningIcon, {}),
|
|
12094
12523
|
classNames: { root: stateMessageMinHeight }
|
|
12095
12524
|
}
|
|
12096
12525
|
) });
|
|
12097
12526
|
}
|
|
12098
12527
|
if (state.kind === "error") {
|
|
12099
|
-
return /* @__PURE__ */ (0,
|
|
12528
|
+
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
12529
|
StateMessage,
|
|
12101
12530
|
{
|
|
12102
12531
|
title: state.title,
|
|
12103
12532
|
description: state.description,
|
|
12104
|
-
icon: /* @__PURE__ */ (0,
|
|
12533
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(WarningIcon, {}),
|
|
12105
12534
|
onAction: state.onRetry,
|
|
12106
12535
|
classNames: { root: stateMessageMinHeight }
|
|
12107
12536
|
}
|
|
12108
12537
|
) });
|
|
12109
12538
|
}
|
|
12110
12539
|
if (state.kind === "resolved") {
|
|
12111
|
-
return /* @__PURE__ */ (0,
|
|
12540
|
+
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
12541
|
StateMessage,
|
|
12113
12542
|
{
|
|
12114
12543
|
title: state.title,
|
|
12115
12544
|
description: state.description,
|
|
12116
|
-
icon: /* @__PURE__ */ (0,
|
|
12545
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(WarningIcon, {}),
|
|
12117
12546
|
classNames: { root: stateMessageMinHeight }
|
|
12118
12547
|
}
|
|
12119
12548
|
) });
|
|
12120
12549
|
}
|
|
12121
12550
|
if (state.kind === "empty") {
|
|
12122
|
-
return /* @__PURE__ */ (0,
|
|
12551
|
+
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
12552
|
StateMessage,
|
|
12124
12553
|
{
|
|
12125
12554
|
title: state.title,
|
|
12126
12555
|
description: state.description,
|
|
12127
|
-
icon: /* @__PURE__ */ (0,
|
|
12556
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(SearchEmptyIcon, {}),
|
|
12128
12557
|
classNames: { root: stateMessageMinHeight }
|
|
12129
12558
|
}
|
|
12130
12559
|
) });
|
|
12131
12560
|
}
|
|
12132
|
-
return /* @__PURE__ */ (0,
|
|
12561
|
+
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
12562
|
};
|
|
12134
12563
|
OrderbookWithStates.displayName = "OrderbookWithStates";
|
|
12135
12564
|
|
|
12136
12565
|
// src/events/orderbook/index.tsx
|
|
12137
|
-
var
|
|
12566
|
+
var import_jsx_runtime133 = require("react/jsx-runtime");
|
|
12138
12567
|
var OrderbookVenueLogos = ({ venues }) => {
|
|
12139
|
-
const visible = (0,
|
|
12568
|
+
const visible = (0, import_hooks44.sortVenues)(venues).slice(0, orderbookMaxVisibleVenues);
|
|
12140
12569
|
const overflow = venues.length - visible.length;
|
|
12141
|
-
return /* @__PURE__ */ (0,
|
|
12142
|
-
visible.map((venue) => /* @__PURE__ */ (0,
|
|
12143
|
-
overflow > 0 ? /* @__PURE__ */ (0,
|
|
12570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "flex flex-row items-center justify-start gap-0.5 md:gap-1", children: [
|
|
12571
|
+
visible.map((venue) => /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(VenueLogo, { venue, size: "small" }, venue)),
|
|
12572
|
+
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
12573
|
"+",
|
|
12145
12574
|
overflow
|
|
12146
12575
|
] }) : null
|
|
@@ -12167,8 +12596,8 @@ var OrderbookRow = ({
|
|
|
12167
12596
|
}).map(([venue]) => venue);
|
|
12168
12597
|
const venues = entry.row.venues && entry.row.venues.length > 0 ? entry.row.venues : venuesFromBreakdown.length > 0 ? venuesFromBreakdown : [entry.row.venue];
|
|
12169
12598
|
const barPercent = Math.max(2, Number((entry.unifiedBarScale * 100).toFixed(2)));
|
|
12170
|
-
return /* @__PURE__ */ (0,
|
|
12171
|
-
/* @__PURE__ */ (0,
|
|
12599
|
+
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: [
|
|
12600
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
12172
12601
|
"div",
|
|
12173
12602
|
{
|
|
12174
12603
|
"aria-hidden": "true",
|
|
@@ -12180,8 +12609,8 @@ var OrderbookRow = ({
|
|
|
12180
12609
|
style: { width: `${barPercent}%` }
|
|
12181
12610
|
}
|
|
12182
12611
|
),
|
|
12183
|
-
/* @__PURE__ */ (0,
|
|
12184
|
-
/* @__PURE__ */ (0,
|
|
12612
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "hidden md:block md:relative min-w-0 flex-1 self-stretch", children: [
|
|
12613
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
12185
12614
|
"div",
|
|
12186
12615
|
{
|
|
12187
12616
|
"aria-hidden": "true",
|
|
@@ -12193,14 +12622,14 @@ var OrderbookRow = ({
|
|
|
12193
12622
|
style: { width: `${barPercent}%` }
|
|
12194
12623
|
}
|
|
12195
12624
|
),
|
|
12196
|
-
showBadge && badgeLabel ? /* @__PURE__ */ (0,
|
|
12625
|
+
showBadge && badgeLabel ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
12197
12626
|
"div",
|
|
12198
12627
|
{
|
|
12199
12628
|
className: cn(
|
|
12200
12629
|
"absolute flex left-5 top-1/2 -translate-y-1/2 rounded-[4px] border px-2 py-0.5",
|
|
12201
12630
|
badgeBorderClassName
|
|
12202
12631
|
),
|
|
12203
|
-
children: /* @__PURE__ */ (0,
|
|
12632
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
12204
12633
|
"span",
|
|
12205
12634
|
{
|
|
12206
12635
|
className: cn("text-[10px] font-bold uppercase leading-[14px]", badgeTextClassName),
|
|
@@ -12210,8 +12639,8 @@ var OrderbookRow = ({
|
|
|
12210
12639
|
}
|
|
12211
12640
|
) : null
|
|
12212
12641
|
] }),
|
|
12213
|
-
/* @__PURE__ */ (0,
|
|
12214
|
-
/* @__PURE__ */ (0,
|
|
12642
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "flex w-20 shrink-0 items-center justify-start gap-2 md:w-[120px]", children: [
|
|
12643
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
12215
12644
|
"span",
|
|
12216
12645
|
{
|
|
12217
12646
|
className: cn(
|
|
@@ -12222,10 +12651,10 @@ var OrderbookRow = ({
|
|
|
12222
12651
|
children: formatProbabilityCents(entry.row.price, formatPrice)
|
|
12223
12652
|
}
|
|
12224
12653
|
),
|
|
12225
|
-
/* @__PURE__ */ (0,
|
|
12654
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(OrderbookVenueLogos, { venues })
|
|
12226
12655
|
] }),
|
|
12227
|
-
/* @__PURE__ */ (0,
|
|
12228
|
-
/* @__PURE__ */ (0,
|
|
12656
|
+
/* @__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) }),
|
|
12657
|
+
/* @__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
12658
|
] });
|
|
12230
12659
|
};
|
|
12231
12660
|
var Orderbook = ({
|
|
@@ -12244,7 +12673,7 @@ var Orderbook = ({
|
|
|
12244
12673
|
const {
|
|
12245
12674
|
enableWebsocketsLogs,
|
|
12246
12675
|
formatting: { formatPrice }
|
|
12247
|
-
} = (0,
|
|
12676
|
+
} = (0, import_hooks44.useAggUiConfig)();
|
|
12248
12677
|
const labels = __spreadValues(__spreadValues({}, orderbookDefaultLabels), labelsProp);
|
|
12249
12678
|
const scrollContainerRef = (0, import_react18.useRef)(null);
|
|
12250
12679
|
const spreadRowRef = (0, import_react18.useRef)(null);
|
|
@@ -12285,15 +12714,15 @@ var Orderbook = ({
|
|
|
12285
12714
|
snapshotKey,
|
|
12286
12715
|
spreadEntry
|
|
12287
12716
|
]);
|
|
12288
|
-
return /* @__PURE__ */ (0,
|
|
12289
|
-
/* @__PURE__ */ (0,
|
|
12290
|
-
/* @__PURE__ */ (0,
|
|
12291
|
-
/* @__PURE__ */ (0,
|
|
12292
|
-
/* @__PURE__ */ (0,
|
|
12293
|
-
/* @__PURE__ */ (0,
|
|
12717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: cn("agg-orderbook-unified flex flex-col", className), children: [
|
|
12718
|
+
/* @__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: [
|
|
12719
|
+
/* @__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 }) }),
|
|
12720
|
+
/* @__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 }),
|
|
12721
|
+
/* @__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 }),
|
|
12722
|
+
/* @__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
12723
|
] }),
|
|
12295
|
-
/* @__PURE__ */ (0,
|
|
12296
|
-
/* @__PURE__ */ (0,
|
|
12724
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "relative", children: [
|
|
12725
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
|
|
12297
12726
|
"div",
|
|
12298
12727
|
{
|
|
12299
12728
|
ref: scrollContainerRef,
|
|
@@ -12303,7 +12732,7 @@ var Orderbook = ({
|
|
|
12303
12732
|
"aria-label": "Order book",
|
|
12304
12733
|
tabIndex: 0,
|
|
12305
12734
|
children: [
|
|
12306
|
-
askEntries.length > 0 ? /* @__PURE__ */ (0,
|
|
12735
|
+
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
12736
|
OrderbookRow,
|
|
12308
12737
|
{
|
|
12309
12738
|
entry,
|
|
@@ -12316,7 +12745,7 @@ var Orderbook = ({
|
|
|
12316
12745
|
},
|
|
12317
12746
|
entry.row.id
|
|
12318
12747
|
)) }) : null,
|
|
12319
|
-
/* @__PURE__ */ (0,
|
|
12748
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
|
|
12320
12749
|
"div",
|
|
12321
12750
|
{
|
|
12322
12751
|
ref: spreadRowRef,
|
|
@@ -12324,7 +12753,7 @@ var Orderbook = ({
|
|
|
12324
12753
|
role: "separator",
|
|
12325
12754
|
"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
12755
|
children: [
|
|
12327
|
-
/* @__PURE__ */ (0,
|
|
12756
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
|
|
12328
12757
|
Typography,
|
|
12329
12758
|
{
|
|
12330
12759
|
variant: "label",
|
|
@@ -12336,7 +12765,7 @@ var Orderbook = ({
|
|
|
12336
12765
|
]
|
|
12337
12766
|
}
|
|
12338
12767
|
),
|
|
12339
|
-
/* @__PURE__ */ (0,
|
|
12768
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
|
|
12340
12769
|
Typography,
|
|
12341
12770
|
{
|
|
12342
12771
|
variant: "label",
|
|
@@ -12348,12 +12777,12 @@ var Orderbook = ({
|
|
|
12348
12777
|
]
|
|
12349
12778
|
}
|
|
12350
12779
|
),
|
|
12351
|
-
/* @__PURE__ */ (0,
|
|
12352
|
-
/* @__PURE__ */ (0,
|
|
12780
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { className: "hidden md:inline-flex w-20 shrink-0 md:w-[120px]" }),
|
|
12781
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { className: "hidden md:inline-flex w-20 shrink-0 md:w-[120px]" })
|
|
12353
12782
|
]
|
|
12354
12783
|
}
|
|
12355
12784
|
),
|
|
12356
|
-
bidEntries.length > 0 ? /* @__PURE__ */ (0,
|
|
12785
|
+
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
12786
|
OrderbookRow,
|
|
12358
12787
|
{
|
|
12359
12788
|
entry,
|
|
@@ -12369,14 +12798,14 @@ var Orderbook = ({
|
|
|
12369
12798
|
]
|
|
12370
12799
|
}
|
|
12371
12800
|
),
|
|
12372
|
-
/* @__PURE__ */ (0,
|
|
12801
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
12373
12802
|
"button",
|
|
12374
12803
|
{
|
|
12375
12804
|
type: "button",
|
|
12376
12805
|
onClick: recenter,
|
|
12377
12806
|
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
12807
|
"aria-label": "Re-center orderbook",
|
|
12379
|
-
children: /* @__PURE__ */ (0,
|
|
12808
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Icon, { name: "recenter", size: "small", className: "!size-4 text-current" })
|
|
12380
12809
|
}
|
|
12381
12810
|
)
|
|
12382
12811
|
] })
|
|
@@ -12536,8 +12965,8 @@ var resolveTradingStateBadgeClassName = (kind) => {
|
|
|
12536
12965
|
};
|
|
12537
12966
|
|
|
12538
12967
|
// src/events/market-details/market-details-outcome-button.tsx
|
|
12539
|
-
var
|
|
12540
|
-
var
|
|
12968
|
+
var import_hooks45 = require("@agg-build/hooks");
|
|
12969
|
+
var import_jsx_runtime134 = require("react/jsx-runtime");
|
|
12541
12970
|
var marketDetailsOutcomeButtonToneClasses = {
|
|
12542
12971
|
positive: {
|
|
12543
12972
|
activeSurface: "bg-agg-success/15",
|
|
@@ -12587,9 +13016,9 @@ var OutcomePriceContent = ({
|
|
|
12587
13016
|
value,
|
|
12588
13017
|
textClassName
|
|
12589
13018
|
}) => {
|
|
12590
|
-
const { formatPrice } = (0,
|
|
13019
|
+
const { formatPrice } = (0, import_hooks45.useAggUiConfig)().formatting;
|
|
12591
13020
|
if (isLoading) {
|
|
12592
|
-
return /* @__PURE__ */ (0,
|
|
13021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12593
13022
|
"span",
|
|
12594
13023
|
{
|
|
12595
13024
|
"aria-hidden": "true",
|
|
@@ -12600,7 +13029,7 @@ var OutcomePriceContent = ({
|
|
|
12600
13029
|
}
|
|
12601
13030
|
);
|
|
12602
13031
|
}
|
|
12603
|
-
return /* @__PURE__ */ (0,
|
|
13032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12604
13033
|
Typography,
|
|
12605
13034
|
{
|
|
12606
13035
|
as: "span",
|
|
@@ -12628,7 +13057,7 @@ var MarketDetailsOutcomeButton = ({
|
|
|
12628
13057
|
});
|
|
12629
13058
|
const itemLabel = (_a = item.title) != null ? _a : item.label;
|
|
12630
13059
|
const isLineVariant = item.variant === "line";
|
|
12631
|
-
return /* @__PURE__ */ (0,
|
|
13060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12632
13061
|
"button",
|
|
12633
13062
|
{
|
|
12634
13063
|
type: "button",
|
|
@@ -12644,9 +13073,9 @@ var MarketDetailsOutcomeButton = ({
|
|
|
12644
13073
|
enforceFixedWidth ? "flex-none" : "flex-1 md:flex-auto"
|
|
12645
13074
|
),
|
|
12646
13075
|
onClick: () => onSelect(item.label),
|
|
12647
|
-
children: isLineVariant ? /* @__PURE__ */ (0,
|
|
12648
|
-
/* @__PURE__ */ (0,
|
|
12649
|
-
/* @__PURE__ */ (0,
|
|
13076
|
+
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: [
|
|
13077
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(VenueLogo, { venue: item.venue, size: "small" }),
|
|
13078
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12650
13079
|
Typography,
|
|
12651
13080
|
{
|
|
12652
13081
|
as: "span",
|
|
@@ -12655,7 +13084,7 @@ var MarketDetailsOutcomeButton = ({
|
|
|
12655
13084
|
children: itemLabel
|
|
12656
13085
|
}
|
|
12657
13086
|
),
|
|
12658
|
-
item.lineLabel ? /* @__PURE__ */ (0,
|
|
13087
|
+
item.lineLabel ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12659
13088
|
Typography,
|
|
12660
13089
|
{
|
|
12661
13090
|
as: "span",
|
|
@@ -12664,7 +13093,7 @@ var MarketDetailsOutcomeButton = ({
|
|
|
12664
13093
|
children: item.lineLabel
|
|
12665
13094
|
}
|
|
12666
13095
|
) : null,
|
|
12667
|
-
/* @__PURE__ */ (0,
|
|
13096
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12668
13097
|
OutcomePriceContent,
|
|
12669
13098
|
{
|
|
12670
13099
|
isLoading: item.isPriceLoading,
|
|
@@ -12673,9 +13102,9 @@ var MarketDetailsOutcomeButton = ({
|
|
|
12673
13102
|
textClassName: classNames.text
|
|
12674
13103
|
}
|
|
12675
13104
|
)
|
|
12676
|
-
] }) : /* @__PURE__ */ (0,
|
|
12677
|
-
/* @__PURE__ */ (0,
|
|
12678
|
-
/* @__PURE__ */ (0,
|
|
13105
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "inline-flex max-w-full items-center justify-center gap-1.5", children: [
|
|
13106
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(VenueLogo, { venue: item.venue, size: "small" }),
|
|
13107
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12679
13108
|
Typography,
|
|
12680
13109
|
{
|
|
12681
13110
|
as: "span",
|
|
@@ -12684,7 +13113,7 @@ var MarketDetailsOutcomeButton = ({
|
|
|
12684
13113
|
children: itemLabel
|
|
12685
13114
|
}
|
|
12686
13115
|
),
|
|
12687
|
-
/* @__PURE__ */ (0,
|
|
13116
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12688
13117
|
OutcomePriceContent,
|
|
12689
13118
|
{
|
|
12690
13119
|
isLoading: item.isPriceLoading,
|
|
@@ -12700,9 +13129,9 @@ var MarketDetailsOutcomeButton = ({
|
|
|
12700
13129
|
MarketDetailsOutcomeButton.displayName = "MarketDetailsOutcomeButton";
|
|
12701
13130
|
|
|
12702
13131
|
// src/events/market-details/market-details-graph-panel.tsx
|
|
12703
|
-
var
|
|
13132
|
+
var import_hooks46 = require("@agg-build/hooks");
|
|
12704
13133
|
var import_react19 = require("react");
|
|
12705
|
-
var
|
|
13134
|
+
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
12706
13135
|
var MarketDetailsGraphPanel = ({
|
|
12707
13136
|
venueMarkets,
|
|
12708
13137
|
selectedOutcomeLabel,
|
|
@@ -12717,13 +13146,13 @@ var MarketDetailsGraphPanel = ({
|
|
|
12717
13146
|
classNames
|
|
12718
13147
|
}) => {
|
|
12719
13148
|
var _a, _b, _c;
|
|
12720
|
-
const config = (0,
|
|
13149
|
+
const config = (0, import_hooks46.useSdkUiConfig)();
|
|
12721
13150
|
const {
|
|
12722
13151
|
formatting: { formatPercent, formatCompactCurrency, formatPrice },
|
|
12723
13152
|
general: { theme }
|
|
12724
13153
|
} = config;
|
|
12725
13154
|
const isDarkTheme = theme === "dark";
|
|
12726
|
-
const labels = (0,
|
|
13155
|
+
const labels = (0, import_hooks46.useLabels)();
|
|
12727
13156
|
const selectedTimeRange = config.chart.selectedChartTimeRange;
|
|
12728
13157
|
const setSelectedTimeRange = config.chart.setSelectedChartTimeRange;
|
|
12729
13158
|
const [chartRangeOverride, setChartRangeOverride] = (0, import_react19.useState)(null);
|
|
@@ -12743,7 +13172,7 @@ var MarketDetailsGraphPanel = ({
|
|
|
12743
13172
|
livePrices
|
|
12744
13173
|
});
|
|
12745
13174
|
}, [livePrices, venueMarkets, resolvedChartOutcomeLabel, chartSelectedOutcomeId]);
|
|
12746
|
-
const rollingWindow = (0,
|
|
13175
|
+
const rollingWindow = (0, import_hooks46.useRollingChartWindow)({ range: effectiveChartTimeRange });
|
|
12747
13176
|
const chartPrimaryOutcomeId = (_b = (_a = chartOutcomesByVenue[0]) == null ? void 0 : _a.outcome.id) != null ? _b : null;
|
|
12748
13177
|
const chartVenueOutcomeIds = (0, import_react19.useMemo)(() => {
|
|
12749
13178
|
return chartOutcomesByVenue.map((item) => item.outcome.id);
|
|
@@ -12753,7 +13182,7 @@ var MarketDetailsGraphPanel = ({
|
|
|
12753
13182
|
isLoading: isMarketChartLoading,
|
|
12754
13183
|
error: marketChartError,
|
|
12755
13184
|
refetch: refetchMarketChart
|
|
12756
|
-
} = (0,
|
|
13185
|
+
} = (0, import_hooks46.useMarketChart)({
|
|
12757
13186
|
marketId: chartPrimaryOutcomeId,
|
|
12758
13187
|
venueMarketIds: chartVenueOutcomeIds,
|
|
12759
13188
|
interval: rollingWindow.interval,
|
|
@@ -12857,17 +13286,17 @@ var MarketDetailsGraphPanel = ({
|
|
|
12857
13286
|
const handleRetryMarketChart = () => {
|
|
12858
13287
|
void refetchMarketChart();
|
|
12859
13288
|
};
|
|
12860
|
-
return /* @__PURE__ */ (0,
|
|
12861
|
-
hasChartError ? /* @__PURE__ */ (0,
|
|
13289
|
+
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: [
|
|
13290
|
+
hasChartError ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12862
13291
|
StateMessage,
|
|
12863
13292
|
{
|
|
12864
13293
|
title: labels.marketDetails.chartUnavailableTitle,
|
|
12865
13294
|
description: labels.marketDetails.chartUnavailableDescription,
|
|
12866
|
-
icon: /* @__PURE__ */ (0,
|
|
13295
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(WarningIcon, {}),
|
|
12867
13296
|
onAction: handleRetryMarketChart,
|
|
12868
13297
|
classNames: { root: "min-h-[248px] px-5 py-10 md:min-h-[272px]" }
|
|
12869
13298
|
}
|
|
12870
|
-
) : /* @__PURE__ */ (0,
|
|
13299
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12871
13300
|
LineChart,
|
|
12872
13301
|
{
|
|
12873
13302
|
series: graphSeries,
|
|
@@ -12880,14 +13309,14 @@ var MarketDetailsGraphPanel = ({
|
|
|
12880
13309
|
showSeriesControls: chartAvailableOutcomesByVenue.length > 0 || headerOutcomeItems.length > 0,
|
|
12881
13310
|
renderSeriesControls: () => {
|
|
12882
13311
|
var _a2, _b2, _c2, _d;
|
|
12883
|
-
return /* @__PURE__ */ (0,
|
|
12884
|
-
/* @__PURE__ */ (0,
|
|
13312
|
+
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: [
|
|
13313
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "agg-market-venues flex flex-wrap gap-2", children: chartAvailableOutcomesByVenue.map((item) => {
|
|
12885
13314
|
const probability = formatProbabilityPercent(
|
|
12886
13315
|
wsLivePrices.get(item.outcome.id),
|
|
12887
13316
|
formatPercent
|
|
12888
13317
|
);
|
|
12889
13318
|
const isActiveVenue = selectedGraphVenue === item.venue;
|
|
12890
|
-
return /* @__PURE__ */ (0,
|
|
13319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
12891
13320
|
"button",
|
|
12892
13321
|
{
|
|
12893
13322
|
type: "button",
|
|
@@ -12906,14 +13335,14 @@ var MarketDetailsGraphPanel = ({
|
|
|
12906
13335
|
handleGraphVenueToggle(item.venue);
|
|
12907
13336
|
},
|
|
12908
13337
|
children: [
|
|
12909
|
-
/* @__PURE__ */ (0,
|
|
12910
|
-
/* @__PURE__ */ (0,
|
|
13338
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(VenueLogo, { venue: item.venue, size: "small" }),
|
|
13339
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: probability })
|
|
12911
13340
|
]
|
|
12912
13341
|
},
|
|
12913
13342
|
`${item.market.id}-${item.outcome.id}`
|
|
12914
13343
|
);
|
|
12915
13344
|
}) }),
|
|
12916
|
-
!isOutcomeSelectionLocked ? /* @__PURE__ */ (0,
|
|
13345
|
+
!isOutcomeSelectionLocked ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12917
13346
|
SwitchButton,
|
|
12918
13347
|
{
|
|
12919
13348
|
ariaLabel: labels.marketDetails.outcomeSelectorAria,
|
|
@@ -12943,7 +13372,7 @@ var MarketDetailsGraphPanel = ({
|
|
|
12943
13372
|
}
|
|
12944
13373
|
}
|
|
12945
13374
|
),
|
|
12946
|
-
/* @__PURE__ */ (0,
|
|
13375
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
12947
13376
|
"div",
|
|
12948
13377
|
{
|
|
12949
13378
|
className: cn(
|
|
@@ -12952,9 +13381,9 @@ var MarketDetailsGraphPanel = ({
|
|
|
12952
13381
|
classNames == null ? void 0 : classNames.footer
|
|
12953
13382
|
),
|
|
12954
13383
|
children: [
|
|
12955
|
-
/* @__PURE__ */ (0,
|
|
12956
|
-
/* @__PURE__ */ (0,
|
|
12957
|
-
/* @__PURE__ */ (0,
|
|
13384
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { children: typeof volume !== "number" ? labels.marketDetails.volumeUnavailable : volume > 0 ? `${formatCompactCurrency(volume)} ${labels.marketDetails.meta.volumeSuffix}` : "" }),
|
|
13385
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex flex-wrap items-center gap-3 md:gap-4", children: [
|
|
13386
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12958
13387
|
ChartTypeSwitch,
|
|
12959
13388
|
{
|
|
12960
13389
|
className: "agg-chart-type-switch shrink-0",
|
|
@@ -12962,11 +13391,11 @@ var MarketDetailsGraphPanel = ({
|
|
|
12962
13391
|
onValueChange: setSelectedChartType
|
|
12963
13392
|
}
|
|
12964
13393
|
),
|
|
12965
|
-
/* @__PURE__ */ (0,
|
|
12966
|
-
|
|
13394
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { "aria-hidden": "true", className: "hidden h-4 w-px bg-agg-separator md:block" }),
|
|
13395
|
+
import_hooks46.CHART_TIME_RANGES.map((timeRange) => {
|
|
12967
13396
|
const isActive = effectiveChartTimeRange === timeRange;
|
|
12968
13397
|
const isDisabled = isResolvedMarket && timeRange !== "ALL";
|
|
12969
|
-
return /* @__PURE__ */ (0,
|
|
13398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12970
13399
|
"button",
|
|
12971
13400
|
{
|
|
12972
13401
|
type: "button",
|
|
@@ -13000,14 +13429,14 @@ var MarketDetailsGraphPanel = ({
|
|
|
13000
13429
|
MarketDetailsGraphPanel.displayName = "MarketDetailsGraphPanel";
|
|
13001
13430
|
|
|
13002
13431
|
// src/events/market-details/index.tsx
|
|
13003
|
-
var
|
|
13432
|
+
var import_jsx_runtime136 = require("react/jsx-runtime");
|
|
13004
13433
|
var MarketDetailsUnavailableState = ({
|
|
13005
13434
|
marketId,
|
|
13006
13435
|
ariaLabel,
|
|
13007
13436
|
classNames
|
|
13008
13437
|
}) => {
|
|
13009
|
-
const labels = (0,
|
|
13010
|
-
return /* @__PURE__ */ (0,
|
|
13438
|
+
const labels = (0, import_hooks47.useLabels)();
|
|
13439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13011
13440
|
Card,
|
|
13012
13441
|
{
|
|
13013
13442
|
"data-market-id": marketId || void 0,
|
|
@@ -13018,9 +13447,9 @@ var MarketDetailsUnavailableState = ({
|
|
|
13018
13447
|
),
|
|
13019
13448
|
role: "status",
|
|
13020
13449
|
"aria-label": ariaLabel != null ? ariaLabel : labels.marketDetails.unavailableAria,
|
|
13021
|
-
children: /* @__PURE__ */ (0,
|
|
13022
|
-
/* @__PURE__ */ (0,
|
|
13023
|
-
/* @__PURE__ */ (0,
|
|
13450
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { className: "flex flex-col gap-1 p-5", children: [
|
|
13451
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Typography, { variant: "body-large-strong", children: labels.marketDetails.unavailableTitle }),
|
|
13452
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: labels.marketDetails.unavailableDescription })
|
|
13024
13453
|
] })
|
|
13025
13454
|
}
|
|
13026
13455
|
);
|
|
@@ -13030,14 +13459,14 @@ var MarketDetailsNotFoundState = ({
|
|
|
13030
13459
|
ariaLabel: _ariaLabel,
|
|
13031
13460
|
classNames: _classNames
|
|
13032
13461
|
}) => {
|
|
13033
|
-
const labels = (0,
|
|
13034
|
-
return /* @__PURE__ */ (0,
|
|
13462
|
+
const labels = (0, import_hooks47.useLabels)();
|
|
13463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13035
13464
|
StateMessage,
|
|
13036
13465
|
{
|
|
13037
13466
|
"data-market-id": marketId || void 0,
|
|
13038
13467
|
title: labels.marketDetails.notFoundTitle,
|
|
13039
13468
|
description: labels.marketDetails.notFoundDescription,
|
|
13040
|
-
icon: /* @__PURE__ */ (0,
|
|
13469
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(SearchEmptyIcon, {}),
|
|
13041
13470
|
classNames: { root: "min-h-[280px] md:min-h-[320px]" }
|
|
13042
13471
|
}
|
|
13043
13472
|
);
|
|
@@ -13062,39 +13491,40 @@ var MarketDetailsContent = ({
|
|
|
13062
13491
|
headerOutcomeItemsOverride,
|
|
13063
13492
|
onOutcomeSelect,
|
|
13064
13493
|
live,
|
|
13494
|
+
showResolvingState = false,
|
|
13065
13495
|
midpointsFallback,
|
|
13066
13496
|
midpointsFallbackVenues,
|
|
13067
13497
|
suppressOutcomeFallbackSelection,
|
|
13068
13498
|
midpointsResult
|
|
13069
13499
|
}) => {
|
|
13070
13500
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
13071
|
-
const config = (0,
|
|
13501
|
+
const config = (0, import_hooks47.useSdkUiConfig)();
|
|
13072
13502
|
const {
|
|
13073
13503
|
features: { enableAnimations },
|
|
13074
13504
|
formatting: { formatPercent }
|
|
13075
13505
|
} = config;
|
|
13076
|
-
const labels = (0,
|
|
13077
|
-
const tradingContext = (0,
|
|
13506
|
+
const labels = (0, import_hooks47.useLabels)();
|
|
13507
|
+
const tradingContext = (0, import_hooks47.useEventTradingContext)();
|
|
13078
13508
|
const detailsContentId = (0, import_react20.useId)();
|
|
13079
13509
|
const tradeSide = (_a = tradingContext == null ? void 0 : tradingContext.tradeSide) != null ? _a : "buy";
|
|
13080
13510
|
const resolvedMarket = (0, import_react20.useMemo)(() => {
|
|
13081
13511
|
return resolveMarketFromVenueMarkets(venueMarkets, marketId);
|
|
13082
13512
|
}, [venueMarkets, marketId]);
|
|
13083
13513
|
const clusterVenueMarkets = resolvedMarket == null ? void 0 : resolvedMarket.venueMarkets;
|
|
13084
|
-
const wsLivePrices = (0,
|
|
13085
|
-
const wsBestPrices = (0,
|
|
13086
|
-
const wsBestCandidates = (0,
|
|
13514
|
+
const wsLivePrices = (0, import_hooks47.useLiveOutcomePrices)(clusterVenueMarkets);
|
|
13515
|
+
const wsBestPrices = (0, import_hooks47.useLiveBestPrices)(clusterVenueMarkets);
|
|
13516
|
+
const wsBestCandidates = (0, import_hooks47.useLiveBestPriceCandidates)(clusterVenueMarkets);
|
|
13087
13517
|
const scopedResolvedMarket = (0, import_react20.useMemo)(() => {
|
|
13088
13518
|
var _a2, _b2;
|
|
13089
13519
|
if (!resolvedMarket) return null;
|
|
13090
13520
|
return (_b2 = (_a2 = resolvedMarket.venueMarkets.find((venueMarket) => venueMarket.id === resolvedMarket.id)) != null ? _a2 : resolvedMarket.venueMarkets[0]) != null ? _b2 : null;
|
|
13091
13521
|
}, [resolvedMarket]);
|
|
13092
|
-
const isResolvedMarket = (0,
|
|
13093
|
-
(0,
|
|
13522
|
+
const isResolvedMarket = (0, import_hooks47.resolveMarketTradingState)(scopedResolvedMarket).kind === "resolved";
|
|
13523
|
+
(0, import_hooks47.useEventOrderbookData)(
|
|
13094
13524
|
isResolvedMarket ? [] : resolvedMarket == null ? void 0 : resolvedMarket.venueMarkets,
|
|
13095
13525
|
(_b = scopedResolvedMarket == null ? void 0 : scopedResolvedMarket.id) != null ? _b : null
|
|
13096
13526
|
);
|
|
13097
|
-
const fetchedClusterMidpointResult = (0,
|
|
13527
|
+
const fetchedClusterMidpointResult = (0, import_hooks47.useMidpoints)(midpointsResult ? [] : clusterVenueMarkets);
|
|
13098
13528
|
const clusterMidpointResult = midpointsResult != null ? midpointsResult : fetchedClusterMidpointResult;
|
|
13099
13529
|
const clusterMidpoints = (_c = clusterMidpointResult.bestMidpointsByOutcomeId) != null ? _c : clusterMidpointResult.prices;
|
|
13100
13530
|
const clusterBestMidpointsByOutcomeId = clusterMidpoints;
|
|
@@ -13103,30 +13533,10 @@ var MarketDetailsContent = ({
|
|
|
13103
13533
|
const clusterBestMidpointVenue = clusterMidpointResult.bestMidpointVenue;
|
|
13104
13534
|
const clusterBestPricesRest = clusterMidpointResult.bestPrices;
|
|
13105
13535
|
const clusterBestPrices = (0, import_react20.useMemo)(
|
|
13106
|
-
() => (0,
|
|
13536
|
+
() => (0, import_hooks47.mergeBestPricesPreferringLive)(clusterBestPricesRest, wsBestPrices),
|
|
13107
13537
|
[clusterBestPricesRest, wsBestPrices]
|
|
13108
13538
|
);
|
|
13109
13539
|
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
13540
|
const model = (0, import_react20.useMemo)(() => {
|
|
13131
13541
|
return buildMarketDetailsModel({
|
|
13132
13542
|
venueMarkets,
|
|
@@ -13158,9 +13568,9 @@ var MarketDetailsContent = ({
|
|
|
13158
13568
|
return (_a2 = model.market.venueMarkets.find((venueMarket) => venueMarket.id === model.market.id)) != null ? _a2 : model.primaryVenueMarket;
|
|
13159
13569
|
}, [model]);
|
|
13160
13570
|
const marketTradingState = (0, import_react20.useMemo)(() => {
|
|
13161
|
-
return (0,
|
|
13571
|
+
return (0, import_hooks47.resolveMarketTradingState)(scopedMarketForCard);
|
|
13162
13572
|
}, [scopedMarketForCard]);
|
|
13163
|
-
const isOutcomeSelectionLocked = marketTradingState.isTradingDisabled;
|
|
13573
|
+
const isOutcomeSelectionLocked = showResolvingState || marketTradingState.isTradingDisabled;
|
|
13164
13574
|
const isUpcomingMarket = marketTradingState.kind === "unopened";
|
|
13165
13575
|
const marketStatePresentation = resolveTradingStatePresentation(labels, marketTradingState);
|
|
13166
13576
|
const resolvedWinningOutcomeLabel = resolveResolvedOutcomeLabel({
|
|
@@ -13284,6 +13694,7 @@ var MarketDetailsContent = ({
|
|
|
13284
13694
|
clusterBestMidpointsByOutcomeId,
|
|
13285
13695
|
clusterBestPricesRest,
|
|
13286
13696
|
clusterBestPriceVenuesByOutcomeId,
|
|
13697
|
+
clusterMidpointResult.isLoading,
|
|
13287
13698
|
headerOutcomeItemsOverride,
|
|
13288
13699
|
model,
|
|
13289
13700
|
scopedMarketForCard,
|
|
@@ -13319,7 +13730,7 @@ var MarketDetailsContent = ({
|
|
|
13319
13730
|
fallbackPrice: midpointsFallback == null ? void 0 : midpointsFallback.get(displayOutcome.id)
|
|
13320
13731
|
});
|
|
13321
13732
|
if (referencePrice != null) return referencePrice;
|
|
13322
|
-
return (0,
|
|
13733
|
+
return (0, import_hooks47.findLivePriceById)(wsLivePrices, displayOutcome.id);
|
|
13323
13734
|
}, [
|
|
13324
13735
|
clusterBestMidpoint,
|
|
13325
13736
|
clusterBestMidpointsByOutcomeId,
|
|
@@ -13345,7 +13756,7 @@ var MarketDetailsContent = ({
|
|
|
13345
13756
|
const orderBookEnabled = isOpened && effectiveSelectedTab === "order-book" && !marketTradingState.isTradingDisabled;
|
|
13346
13757
|
const primaryVenueMarketId = (_g = (_f = selectedOutcomesByVenue[0]) == null ? void 0 : _f.market.id) != null ? _g : null;
|
|
13347
13758
|
const primaryOutcomeId = (_i = (_h = selectedOutcomesByVenue[0]) == null ? void 0 : _h.outcome.id) != null ? _i : null;
|
|
13348
|
-
const marketOrderbookResult = (0,
|
|
13759
|
+
const marketOrderbookResult = (0, import_hooks47.useMarketOrderbook)({
|
|
13349
13760
|
marketId: primaryVenueMarketId,
|
|
13350
13761
|
enabled: orderBookEnabled && !!primaryVenueMarketId,
|
|
13351
13762
|
venueOutcomes: selectedOutcomesByVenue.map((item) => ({
|
|
@@ -13447,11 +13858,16 @@ var MarketDetailsContent = ({
|
|
|
13447
13858
|
const handleRetryOrderBook = () => {
|
|
13448
13859
|
void refetchOrderBook();
|
|
13449
13860
|
};
|
|
13450
|
-
const orderbookState =
|
|
13861
|
+
const orderbookState = showResolvingState ? {
|
|
13862
|
+
kind: "disabled",
|
|
13863
|
+
title: labels.marketDetails.resolvingTitle,
|
|
13864
|
+
description: labels.marketDetails.resolvingDescription,
|
|
13865
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(LoadingIcon, { size: "small" })
|
|
13866
|
+
} : marketTradingState.isTradingDisabled ? {
|
|
13451
13867
|
kind: "disabled",
|
|
13452
13868
|
title: marketStatePresentation.title,
|
|
13453
13869
|
description: marketStatePresentation.description,
|
|
13454
|
-
icon: /* @__PURE__ */ (0,
|
|
13870
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Icon, { name: marketStatePresentation.iconName, className: "h-5 w-5", "aria-hidden": "true" })
|
|
13455
13871
|
} : isOrderBookLoading ? { kind: "loading" } : hasOrderBookError ? {
|
|
13456
13872
|
kind: "error",
|
|
13457
13873
|
title: labels.marketDetails.orderBookUnavailableTitle,
|
|
@@ -13467,7 +13883,7 @@ var MarketDetailsContent = ({
|
|
|
13467
13883
|
description: labels.marketDetails.orderBookEmptyDescription
|
|
13468
13884
|
} : { kind: "data" };
|
|
13469
13885
|
if (marketId && !resolvedMarket) {
|
|
13470
|
-
return /* @__PURE__ */ (0,
|
|
13886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13471
13887
|
MarketDetailsNotFoundState,
|
|
13472
13888
|
{
|
|
13473
13889
|
marketId,
|
|
@@ -13477,7 +13893,7 @@ var MarketDetailsContent = ({
|
|
|
13477
13893
|
);
|
|
13478
13894
|
}
|
|
13479
13895
|
if (!model) {
|
|
13480
|
-
return /* @__PURE__ */ (0,
|
|
13896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13481
13897
|
MarketDetailsUnavailableState,
|
|
13482
13898
|
{
|
|
13483
13899
|
marketId,
|
|
@@ -13486,18 +13902,18 @@ var MarketDetailsContent = ({
|
|
|
13486
13902
|
}
|
|
13487
13903
|
);
|
|
13488
13904
|
}
|
|
13489
|
-
return /* @__PURE__ */ (0,
|
|
13905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
|
|
13490
13906
|
Card,
|
|
13491
13907
|
{
|
|
13492
13908
|
className: cn(
|
|
13493
13909
|
"group/agg-market-card",
|
|
13494
13910
|
"w-full rounded-agg-2xl text-left outline-none",
|
|
13495
|
-
marketTradingState.isTradingDisabled && "agg-market-card-readonly",
|
|
13911
|
+
(showResolvingState || marketTradingState.isTradingDisabled) && "agg-market-card-readonly",
|
|
13496
13912
|
marketDetailsBaseCardClassName,
|
|
13497
13913
|
classNames == null ? void 0 : classNames.root
|
|
13498
13914
|
),
|
|
13499
13915
|
children: [
|
|
13500
|
-
/* @__PURE__ */ (0,
|
|
13916
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
|
|
13501
13917
|
"div",
|
|
13502
13918
|
{
|
|
13503
13919
|
"data-market-id": marketId || void 0,
|
|
@@ -13508,7 +13924,7 @@ var MarketDetailsContent = ({
|
|
|
13508
13924
|
classNames == null ? void 0 : classNames.header
|
|
13509
13925
|
),
|
|
13510
13926
|
children: [
|
|
13511
|
-
/* @__PURE__ */ (0,
|
|
13927
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
|
|
13512
13928
|
"button",
|
|
13513
13929
|
{
|
|
13514
13930
|
className: cn(
|
|
@@ -13522,17 +13938,17 @@ var MarketDetailsContent = ({
|
|
|
13522
13938
|
"aria-controls": detailsContentId,
|
|
13523
13939
|
"aria-label": isOpened ? labels.marketDetails.toggleCloseDetailsAria(model.title) : labels.marketDetails.toggleOpenDetailsAria(model.title),
|
|
13524
13940
|
children: [
|
|
13525
|
-
/* @__PURE__ */ (0,
|
|
13526
|
-
!compactHeader ? /* @__PURE__ */ (0,
|
|
13941
|
+
/* @__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: [
|
|
13942
|
+
!compactHeader ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13527
13943
|
RemoteImage,
|
|
13528
13944
|
{
|
|
13529
|
-
src: (0,
|
|
13945
|
+
src: (0, import_hooks47.optimizedImageUrl)(model.image, 60),
|
|
13530
13946
|
alt: "",
|
|
13531
13947
|
className: "agg-market-image size-12 rounded-agg-lg object-cover md:size-[60px]"
|
|
13532
13948
|
}
|
|
13533
13949
|
) : null,
|
|
13534
|
-
/* @__PURE__ */ (0,
|
|
13535
|
-
/* @__PURE__ */ (0,
|
|
13950
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { className: "flex min-w-24 flex-col", children: [
|
|
13951
|
+
/* @__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
13952
|
Typography,
|
|
13537
13953
|
{
|
|
13538
13954
|
as: "h3",
|
|
@@ -13541,7 +13957,7 @@ var MarketDetailsContent = ({
|
|
|
13541
13957
|
children: model.title
|
|
13542
13958
|
}
|
|
13543
13959
|
) }) }),
|
|
13544
|
-
/* @__PURE__ */ (0,
|
|
13960
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13545
13961
|
Typography,
|
|
13546
13962
|
{
|
|
13547
13963
|
variant: "label",
|
|
@@ -13549,8 +13965,8 @@ var MarketDetailsContent = ({
|
|
|
13549
13965
|
children: subtitleOverride != null ? subtitleOverride : model.subtitle
|
|
13550
13966
|
}
|
|
13551
13967
|
) }),
|
|
13552
|
-
marketTradingState.isTradingDisabled && marketTradingState.kind !== "resolved" && !isUpcomingMarket ? /* @__PURE__ */ (0,
|
|
13553
|
-
/* @__PURE__ */ (0,
|
|
13968
|
+
!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: [
|
|
13969
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
|
|
13554
13970
|
"span",
|
|
13555
13971
|
{
|
|
13556
13972
|
className: cn(
|
|
@@ -13558,7 +13974,7 @@ var MarketDetailsContent = ({
|
|
|
13558
13974
|
resolveTradingStateBadgeClassName(marketTradingState.kind)
|
|
13559
13975
|
),
|
|
13560
13976
|
children: [
|
|
13561
|
-
/* @__PURE__ */ (0,
|
|
13977
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13562
13978
|
Icon,
|
|
13563
13979
|
{
|
|
13564
13980
|
name: marketStatePresentation.iconName,
|
|
@@ -13566,20 +13982,23 @@ var MarketDetailsContent = ({
|
|
|
13566
13982
|
className: "h-3.5 w-3.5"
|
|
13567
13983
|
}
|
|
13568
13984
|
),
|
|
13569
|
-
/* @__PURE__ */ (0,
|
|
13985
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("span", { children: marketStatePresentation.badgeLabel })
|
|
13570
13986
|
]
|
|
13571
13987
|
}
|
|
13572
13988
|
),
|
|
13573
|
-
marketStatePresentation.timestampLabel ? /* @__PURE__ */ (0,
|
|
13574
|
-
marketStatePresentation.winningOutcomeLabel ? /* @__PURE__ */ (0,
|
|
13989
|
+
marketStatePresentation.timestampLabel ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: marketStatePresentation.timestampLabel }) : null,
|
|
13990
|
+
marketStatePresentation.winningOutcomeLabel ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: marketStatePresentation.winningOutcomeLabel }) : null
|
|
13575
13991
|
] }) : null
|
|
13576
13992
|
] })
|
|
13577
13993
|
] }),
|
|
13578
|
-
!compactHeader ? /* @__PURE__ */ (0,
|
|
13994
|
+
!compactHeader ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Typography, { as: "div", variant: "heading", className: "agg-market-headline shrink-0", children: formatProbabilityPercent(headlineProbability, formatPercent) }) : null
|
|
13579
13995
|
]
|
|
13580
13996
|
}
|
|
13581
13997
|
),
|
|
13582
|
-
|
|
13998
|
+
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: [
|
|
13999
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(LoadingIcon, { size: "small" }),
|
|
14000
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Typography, { variant: "body", children: labels.marketDetails.resolvingBadge })
|
|
14001
|
+
] }) }) : 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
14002
|
"span",
|
|
13584
14003
|
{
|
|
13585
14004
|
className: cn(
|
|
@@ -13592,7 +14011,7 @@ var MarketDetailsContent = ({
|
|
|
13592
14011
|
"border-transparent bg-agg-secondary-hover"
|
|
13593
14012
|
),
|
|
13594
14013
|
children: [
|
|
13595
|
-
/* @__PURE__ */ (0,
|
|
14014
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13596
14015
|
Icon,
|
|
13597
14016
|
{
|
|
13598
14017
|
name: marketTradingState.winningOutcome.label.trim().toLowerCase() === "yes" ? "check-circle" : "cross-circle",
|
|
@@ -13603,12 +14022,12 @@ var MarketDetailsContent = ({
|
|
|
13603
14022
|
)
|
|
13604
14023
|
}
|
|
13605
14024
|
),
|
|
13606
|
-
/* @__PURE__ */ (0,
|
|
14025
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Typography, { variant: "body", children: labels.eventMarketPage.resolvedOutcome(
|
|
13607
14026
|
resolvedWinningOutcomeLabel != null ? resolvedWinningOutcomeLabel : marketTradingState.winningOutcome.label
|
|
13608
14027
|
) })
|
|
13609
14028
|
]
|
|
13610
14029
|
}
|
|
13611
|
-
) }) : isUpcomingMarket ? /* @__PURE__ */ (0,
|
|
14030
|
+
) }) : 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
14031
|
"span",
|
|
13613
14032
|
{
|
|
13614
14033
|
className: cn(
|
|
@@ -13617,7 +14036,7 @@ var MarketDetailsContent = ({
|
|
|
13617
14036
|
resolveTradingStateBadgeClassName(marketTradingState.kind)
|
|
13618
14037
|
),
|
|
13619
14038
|
children: [
|
|
13620
|
-
/* @__PURE__ */ (0,
|
|
14039
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13621
14040
|
Icon,
|
|
13622
14041
|
{
|
|
13623
14042
|
name: marketStatePresentation.iconName,
|
|
@@ -13626,10 +14045,10 @@ var MarketDetailsContent = ({
|
|
|
13626
14045
|
"aria-hidden": "true"
|
|
13627
14046
|
}
|
|
13628
14047
|
),
|
|
13629
|
-
/* @__PURE__ */ (0,
|
|
14048
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("span", { children: marketStatePresentation.badgeLabel })
|
|
13630
14049
|
]
|
|
13631
14050
|
}
|
|
13632
|
-
) }) : /* @__PURE__ */ (0,
|
|
14051
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13633
14052
|
"div",
|
|
13634
14053
|
{
|
|
13635
14054
|
className: "agg-outcomes flex w-full flex-wrap gap-2 md:w-auto md:shrink-0 md:flex-nowrap",
|
|
@@ -13638,7 +14057,7 @@ var MarketDetailsContent = ({
|
|
|
13638
14057
|
onKeyDown: (eventToHandle) => handleOutcomeKeyDown(eventToHandle),
|
|
13639
14058
|
children: headerOutcomeItems.map((item) => {
|
|
13640
14059
|
const isActiveOutcome = item.id === selectedOutcomeId;
|
|
13641
|
-
return /* @__PURE__ */ (0,
|
|
14060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13642
14061
|
MarketDetailsOutcomeButton,
|
|
13643
14062
|
{
|
|
13644
14063
|
enforceFixedWidth: headerOutcomeVariant != null,
|
|
@@ -13665,8 +14084,8 @@ var MarketDetailsContent = ({
|
|
|
13665
14084
|
]
|
|
13666
14085
|
}
|
|
13667
14086
|
),
|
|
13668
|
-
headerAccessory ? /* @__PURE__ */ (0,
|
|
13669
|
-
/* @__PURE__ */ (0,
|
|
14087
|
+
headerAccessory ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "agg-market-card-accessory border-t border-agg-separator", children: headerAccessory }) : null,
|
|
14088
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13670
14089
|
"div",
|
|
13671
14090
|
{
|
|
13672
14091
|
id: detailsContentId,
|
|
@@ -13680,9 +14099,9 @@ var MarketDetailsContent = ({
|
|
|
13680
14099
|
isOpened ? "grid-rows-[1fr] opacity-100" : "pointer-events-none grid-rows-[0fr] opacity-0"
|
|
13681
14100
|
),
|
|
13682
14101
|
"aria-hidden": !isOpened,
|
|
13683
|
-
children: /* @__PURE__ */ (0,
|
|
13684
|
-
/* @__PURE__ */ (0,
|
|
13685
|
-
/* @__PURE__ */ (0,
|
|
14102
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { className: "min-h-0", children: [
|
|
14103
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
|
|
14104
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
|
|
13686
14105
|
"div",
|
|
13687
14106
|
{
|
|
13688
14107
|
className: cn(
|
|
@@ -13696,8 +14115,8 @@ var MarketDetailsContent = ({
|
|
|
13696
14115
|
) : "translate-y-5 opacity-0"
|
|
13697
14116
|
),
|
|
13698
14117
|
children: [
|
|
13699
|
-
!isResolvedMarket ? /* @__PURE__ */ (0,
|
|
13700
|
-
/* @__PURE__ */ (0,
|
|
14118
|
+
!isResolvedMarket ? /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_jsx_runtime136.Fragment, { children: [
|
|
14119
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: cn("block", classNames == null ? void 0 : classNames.tabs), children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13701
14120
|
Tabs,
|
|
13702
14121
|
{
|
|
13703
14122
|
ariaLabel: labels.marketDetails.tabsAria,
|
|
@@ -13708,10 +14127,10 @@ var MarketDetailsContent = ({
|
|
|
13708
14127
|
className: "agg-market-tabs flex! w-full px-5"
|
|
13709
14128
|
}
|
|
13710
14129
|
) }),
|
|
13711
|
-
/* @__PURE__ */ (0,
|
|
14130
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "h-px w-full bg-agg-separator" })
|
|
13712
14131
|
] }) : null,
|
|
13713
|
-
/* @__PURE__ */ (0,
|
|
13714
|
-
effectiveSelectedTab === "order-book" ? /* @__PURE__ */ (0,
|
|
14132
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { className: cn("agg-market-card-body p-0", classNames == null ? void 0 : classNames.content), children: [
|
|
14133
|
+
effectiveSelectedTab === "order-book" ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13715
14134
|
OrderbookWithStates,
|
|
13716
14135
|
{
|
|
13717
14136
|
state: orderbookState,
|
|
@@ -13737,7 +14156,7 @@ var MarketDetailsContent = ({
|
|
|
13737
14156
|
wrapperClassName: classNames == null ? void 0 : classNames.orderBook
|
|
13738
14157
|
}
|
|
13739
14158
|
) : null,
|
|
13740
|
-
isOpened && effectiveSelectedTab === "graph" ? /* @__PURE__ */ (0,
|
|
14159
|
+
isOpened && effectiveSelectedTab === "graph" ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13741
14160
|
MarketDetailsGraphPanel,
|
|
13742
14161
|
{
|
|
13743
14162
|
venueMarkets: model.market.venueMarkets,
|
|
@@ -13753,13 +14172,13 @@ var MarketDetailsContent = ({
|
|
|
13753
14172
|
classNames: { graph: classNames == null ? void 0 : classNames.graph, footer: classNames == null ? void 0 : classNames.footer }
|
|
13754
14173
|
}
|
|
13755
14174
|
) : null,
|
|
13756
|
-
effectiveSelectedTab === "other" ? /* @__PURE__ */ (0,
|
|
14175
|
+
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
14176
|
"div",
|
|
13758
14177
|
{
|
|
13759
14178
|
className: "agg-market-meta-row flex items-center justify-between rounded-agg-xl bg-agg-secondary-hover px-4 py-3",
|
|
13760
14179
|
children: [
|
|
13761
|
-
/* @__PURE__ */ (0,
|
|
13762
|
-
/* @__PURE__ */ (0,
|
|
14180
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: row.label }),
|
|
14181
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Typography, { variant: "body", className: "text-right", children: row.value })
|
|
13763
14182
|
]
|
|
13764
14183
|
},
|
|
13765
14184
|
row.label
|
|
@@ -13777,9 +14196,9 @@ var MarketDetailsContent = ({
|
|
|
13777
14196
|
};
|
|
13778
14197
|
var MarketDetails = (_a) => {
|
|
13779
14198
|
var _b = _a, { isOpened } = _b, props = __objRest(_b, ["isOpened"]);
|
|
13780
|
-
const labels = (0,
|
|
14199
|
+
const labels = (0, import_hooks47.useLabels)();
|
|
13781
14200
|
if (props.isLoading) {
|
|
13782
|
-
return /* @__PURE__ */ (0,
|
|
14201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13783
14202
|
Skeleton,
|
|
13784
14203
|
{
|
|
13785
14204
|
view: "market-details-minified",
|
|
@@ -13789,7 +14208,7 @@ var MarketDetails = (_a) => {
|
|
|
13789
14208
|
);
|
|
13790
14209
|
}
|
|
13791
14210
|
if ("venueMarkets" in props && props.venueMarkets) {
|
|
13792
|
-
return /* @__PURE__ */ (0,
|
|
14211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13793
14212
|
MarketDetailsContent,
|
|
13794
14213
|
__spreadProps(__spreadValues({}, props), {
|
|
13795
14214
|
isOpened,
|
|
@@ -13801,7 +14220,7 @@ var MarketDetails = (_a) => {
|
|
|
13801
14220
|
);
|
|
13802
14221
|
}
|
|
13803
14222
|
const { classNames: fallbackClassNames } = props;
|
|
13804
|
-
return /* @__PURE__ */ (0,
|
|
14223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(MarketDetailsUnavailableState, { classNames: fallbackClassNames });
|
|
13805
14224
|
};
|
|
13806
14225
|
MarketDetails.displayName = "MarketDetails";
|
|
13807
14226
|
var AFFIRMATIVE_WINNER_LABELS = /* @__PURE__ */ new Set(["yes", "up", "buy", "long", "true"]);
|
|
@@ -13832,13 +14251,13 @@ var resolveIsResolvedEvent = (sourceMarkets, eventTradingState) => {
|
|
|
13832
14251
|
return eventTradingState.kind === "resolved";
|
|
13833
14252
|
}
|
|
13834
14253
|
if (sourceMarkets.length === 0) return false;
|
|
13835
|
-
return sourceMarkets.every((market) => (0,
|
|
14254
|
+
return sourceMarkets.every((market) => (0, import_hooks47.resolveMarketTradingState)(market).kind === "resolved");
|
|
13836
14255
|
};
|
|
13837
14256
|
var resolveResolvedWinnerMarketId = (sourceMarkets, eventTradingState) => {
|
|
13838
14257
|
var _a, _b, _c, _d, _e;
|
|
13839
14258
|
const preferredMarket = (_a = eventTradingState == null ? void 0 : eventTradingState.primaryMarket) != null ? _a : null;
|
|
13840
14259
|
if (preferredMarket && sourceMarkets.some((market) => market.id === preferredMarket.id)) {
|
|
13841
|
-
if ((0,
|
|
14260
|
+
if ((0, import_hooks47.resolveMarketTradingState)(preferredMarket).kind === "resolved") {
|
|
13842
14261
|
return preferredMarket.id;
|
|
13843
14262
|
}
|
|
13844
14263
|
}
|
|
@@ -13855,11 +14274,12 @@ var MarketDetailsList = ({
|
|
|
13855
14274
|
defaultTab,
|
|
13856
14275
|
classNames,
|
|
13857
14276
|
live,
|
|
14277
|
+
showResolvingState = false,
|
|
13858
14278
|
midpointsResult
|
|
13859
14279
|
}) => {
|
|
13860
14280
|
var _a, _b;
|
|
13861
|
-
const labels = (0,
|
|
13862
|
-
const tradingContext = (0,
|
|
14281
|
+
const labels = (0, import_hooks47.useLabels)();
|
|
14282
|
+
const tradingContext = (0, import_hooks47.useEventTradingContext)();
|
|
13863
14283
|
const selectedMarketId = (_a = tradingContext == null ? void 0 : tradingContext.selectedMarketId) != null ? _a : null;
|
|
13864
14284
|
const [expandedMarketId, setExpandedMarketId] = (0, import_react20.useState)(null);
|
|
13865
14285
|
const [areResolvedMarketsVisible, setAreResolvedMarketsVisible] = (0, import_react20.useState)(false);
|
|
@@ -13868,10 +14288,10 @@ var MarketDetailsList = ({
|
|
|
13868
14288
|
markets: rawMarkets,
|
|
13869
14289
|
isLoading,
|
|
13870
14290
|
error
|
|
13871
|
-
} = (0,
|
|
14291
|
+
} = (0, import_hooks47.useVenueMarkets)({
|
|
13872
14292
|
venueEventId: resolvedEventId,
|
|
13873
14293
|
enabled: !providedMarkets && !!resolvedEventId,
|
|
13874
|
-
status:
|
|
14294
|
+
status: import_hooks47.MarketStatus.open,
|
|
13875
14295
|
// Keep in lockstep with useEnrichedVenueEvent: limit is part of the React
|
|
13876
14296
|
// Query key, so a mismatch would fork the shared cache into two requests.
|
|
13877
14297
|
// fetchAll drains every page — events can exceed any single-page limit
|
|
@@ -13906,6 +14326,7 @@ var MarketDetailsList = ({
|
|
|
13906
14326
|
const winnerMarketId = resolveResolvedWinnerMarketId(sourceMarkets, eventTradingState);
|
|
13907
14327
|
return {
|
|
13908
14328
|
primary: moveMarketToFront(sourceMarkets, winnerMarketId),
|
|
14329
|
+
closed: [],
|
|
13909
14330
|
upcoming: [],
|
|
13910
14331
|
resolved: []
|
|
13911
14332
|
};
|
|
@@ -13915,7 +14336,7 @@ var MarketDetailsList = ({
|
|
|
13915
14336
|
const resolved = [];
|
|
13916
14337
|
const closed = [];
|
|
13917
14338
|
sourceMarkets.forEach((market) => {
|
|
13918
|
-
const marketStateKind = (0,
|
|
14339
|
+
const marketStateKind = (0, import_hooks47.resolveMarketTradingState)(market).kind;
|
|
13919
14340
|
if (marketStateKind === "resolved") {
|
|
13920
14341
|
resolved.push(market);
|
|
13921
14342
|
return;
|
|
@@ -13938,15 +14359,19 @@ var MarketDetailsList = ({
|
|
|
13938
14359
|
return [];
|
|
13939
14360
|
}, [areResolvedMarketsVisible, groupedMarkets.resolved, isResolvedEvent]);
|
|
13940
14361
|
const displayedMarkets = (0, import_react20.useMemo)(() => {
|
|
13941
|
-
return [
|
|
13942
|
-
|
|
14362
|
+
return [
|
|
14363
|
+
...groupedMarkets.primary,
|
|
14364
|
+
...showResolvingState ? groupedMarkets.closed : [],
|
|
14365
|
+
...visibleResolvedMarkets
|
|
14366
|
+
];
|
|
14367
|
+
}, [groupedMarkets.closed, groupedMarkets.primary, showResolvingState, visibleResolvedMarkets]);
|
|
13943
14368
|
const hasPrefetchedMarkets = !!providedMarkets || !!((_b = eventTradingState == null ? void 0 : eventTradingState.marketStates) == null ? void 0 : _b.length);
|
|
13944
14369
|
const midpointEligibleMarkets = (0, import_react20.useMemo)(() => {
|
|
13945
14370
|
return displayedMarkets.filter(
|
|
13946
|
-
(market) => (0,
|
|
14371
|
+
(market) => (0, import_hooks47.resolveMarketTradingState)(market).kind !== "resolved"
|
|
13947
14372
|
);
|
|
13948
14373
|
}, [displayedMarkets]);
|
|
13949
|
-
const { prices: midpointsFallback, venueByOutcomeId: midpointsFallbackVenues } = (0,
|
|
14374
|
+
const { prices: midpointsFallback, venueByOutcomeId: midpointsFallbackVenues } = (0, import_hooks47.useViewportMidpoints)(midpointEligibleMarkets);
|
|
13950
14375
|
(0, import_react20.useEffect)(() => {
|
|
13951
14376
|
if (isResolvedEvent) {
|
|
13952
14377
|
setAreResolvedMarketsVisible(false);
|
|
@@ -13965,7 +14390,7 @@ var MarketDetailsList = ({
|
|
|
13965
14390
|
return;
|
|
13966
14391
|
}
|
|
13967
14392
|
const fallbackSelectableMarket = displayedMarkets.find(
|
|
13968
|
-
(market) => !(0,
|
|
14393
|
+
(market) => !(0, import_hooks47.resolveMarketTradingState)(market).isTradingDisabled
|
|
13969
14394
|
);
|
|
13970
14395
|
if (!fallbackSelectableMarket) {
|
|
13971
14396
|
return;
|
|
@@ -13987,11 +14412,11 @@ var MarketDetailsList = ({
|
|
|
13987
14412
|
setExpandedMarketId(marketId);
|
|
13988
14413
|
onExpandedMarketChange == null ? void 0 : onExpandedMarketChange(marketId);
|
|
13989
14414
|
if (marketId === selectedMarketId) return;
|
|
13990
|
-
if ((0,
|
|
14415
|
+
if ((0, import_hooks47.resolveMarketTradingState)(market).isTradingDisabled) return;
|
|
13991
14416
|
tradingContext == null ? void 0 : tradingContext.selectMarket(market.id, market);
|
|
13992
14417
|
};
|
|
13993
14418
|
if (!hasPrefetchedMarkets && isLoading) {
|
|
13994
|
-
return /* @__PURE__ */ (0,
|
|
14419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13995
14420
|
Skeleton,
|
|
13996
14421
|
{
|
|
13997
14422
|
view: "market-details-minified",
|
|
@@ -14001,29 +14426,29 @@ var MarketDetailsList = ({
|
|
|
14001
14426
|
);
|
|
14002
14427
|
}
|
|
14003
14428
|
if (!hasPrefetchedMarkets && error) {
|
|
14004
|
-
return /* @__PURE__ */ (0,
|
|
14429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
14005
14430
|
StateMessage,
|
|
14006
14431
|
{
|
|
14007
14432
|
title: labels.marketDetails.unavailableTitle,
|
|
14008
14433
|
description: labels.marketDetails.unavailableDescription,
|
|
14009
|
-
icon: /* @__PURE__ */ (0,
|
|
14434
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(SearchEmptyIcon, {}),
|
|
14010
14435
|
classNames: { root: "min-h-[280px] md:min-h-[320px]" }
|
|
14011
14436
|
}
|
|
14012
14437
|
);
|
|
14013
14438
|
}
|
|
14014
14439
|
if (displayedMarkets.length === 0 && !shouldShowResolvedToggle) {
|
|
14015
14440
|
const hasSourceMarkets = sourceMarkets.length > 0;
|
|
14016
|
-
return /* @__PURE__ */ (0,
|
|
14441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
14017
14442
|
StateMessage,
|
|
14018
14443
|
{
|
|
14019
14444
|
title: hasSourceMarkets ? isResolvedEvent ? labels.markets.emptyResolved : labels.markets.emptyNoOpen : labels.marketDetails.notFoundTitle,
|
|
14020
14445
|
description: hasSourceMarkets ? void 0 : labels.marketDetails.notFoundDescription,
|
|
14021
|
-
icon: /* @__PURE__ */ (0,
|
|
14446
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(SearchEmptyIcon, {}),
|
|
14022
14447
|
classNames: { root: "min-h-[280px] md:min-h-[320px]" }
|
|
14023
14448
|
}
|
|
14024
14449
|
);
|
|
14025
14450
|
}
|
|
14026
|
-
const renderMarketCard = (market) => /* @__PURE__ */ (0,
|
|
14451
|
+
const renderMarketCard = (market) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
14027
14452
|
MarketDetails,
|
|
14028
14453
|
{
|
|
14029
14454
|
marketId: market.id,
|
|
@@ -14045,14 +14470,16 @@ var MarketDetailsList = ({
|
|
|
14045
14470
|
ariaLabel: market.question,
|
|
14046
14471
|
classNames: { root: cn("agg-market-list-item", classNames == null ? void 0 : classNames.item) },
|
|
14047
14472
|
live,
|
|
14473
|
+
showResolvingState,
|
|
14048
14474
|
midpointsFallback,
|
|
14049
14475
|
midpointsFallbackVenues,
|
|
14050
14476
|
midpointsResult
|
|
14051
14477
|
}
|
|
14052
14478
|
) }, market.id);
|
|
14053
|
-
return /* @__PURE__ */ (0,
|
|
14479
|
+
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
14480
|
groupedMarkets.primary.map((market) => renderMarketCard(market)),
|
|
14055
|
-
|
|
14481
|
+
showResolvingState ? groupedMarkets.closed.map((market) => renderMarketCard(market)) : null,
|
|
14482
|
+
shouldShowResolvedToggle ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
14056
14483
|
Button,
|
|
14057
14484
|
{
|
|
14058
14485
|
variant: "tertiary",
|
|
@@ -14062,7 +14489,7 @@ var MarketDetailsList = ({
|
|
|
14062
14489
|
setAreResolvedMarketsVisible((isVisible) => !isVisible);
|
|
14063
14490
|
},
|
|
14064
14491
|
"aria-expanded": areResolvedMarketsVisible,
|
|
14065
|
-
suffix: /* @__PURE__ */ (0,
|
|
14492
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
14066
14493
|
Icon,
|
|
14067
14494
|
{
|
|
14068
14495
|
name: areResolvedMarketsVisible ? "chevron-up" : "chevron-down",
|
|
@@ -14080,14 +14507,14 @@ var MarketDetailsList = ({
|
|
|
14080
14507
|
MarketDetailsList.displayName = "MarketDetailsList";
|
|
14081
14508
|
|
|
14082
14509
|
// src/events/list/index.tsx
|
|
14083
|
-
var
|
|
14510
|
+
var import_hooks49 = require("@agg-build/hooks");
|
|
14084
14511
|
var import_sdk16 = require("@agg-build/sdk");
|
|
14085
14512
|
var Dialog2 = __toESM(require("@radix-ui/react-dialog"));
|
|
14086
14513
|
var import_react23 = require("react");
|
|
14087
14514
|
|
|
14088
14515
|
// src/events/list/category-sidebar.tsx
|
|
14089
14516
|
var import_react21 = require("react");
|
|
14090
|
-
var
|
|
14517
|
+
var import_jsx_runtime137 = require("react/jsx-runtime");
|
|
14091
14518
|
var rowBase = cn(
|
|
14092
14519
|
"flex min-h-11 w-full items-center gap-3 rounded-[6px] px-3 py-3",
|
|
14093
14520
|
"text-left text-agg-sm font-agg-normal leading-agg-5",
|
|
@@ -14129,7 +14556,7 @@ var CategorySidebar = ({
|
|
|
14129
14556
|
}) => {
|
|
14130
14557
|
var _a, _b;
|
|
14131
14558
|
const hasKnownChildren = ((_b = (_a = childrenByParentId.get(entry.id)) == null ? void 0 : _a.length) != null ? _b : 0) > 0;
|
|
14132
|
-
return /* @__PURE__ */ (0,
|
|
14559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(
|
|
14133
14560
|
"button",
|
|
14134
14561
|
{
|
|
14135
14562
|
type: "button",
|
|
@@ -14137,8 +14564,8 @@ var CategorySidebar = ({
|
|
|
14137
14564
|
className: isSelected ? selectedRowClassName : idleRowClassName,
|
|
14138
14565
|
onClick,
|
|
14139
14566
|
children: [
|
|
14140
|
-
/* @__PURE__ */ (0,
|
|
14141
|
-
hasKnownChildren ? /* @__PURE__ */ (0,
|
|
14567
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "min-w-0 flex-1 truncate first-letter:uppercase", children: entry.label }),
|
|
14568
|
+
hasKnownChildren ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
|
|
14142
14569
|
Icon,
|
|
14143
14570
|
{
|
|
14144
14571
|
name: isExpanded ? "chevron-up" : "chevron-down",
|
|
@@ -14146,7 +14573,7 @@ var CategorySidebar = ({
|
|
|
14146
14573
|
color: "currentColor",
|
|
14147
14574
|
className: "shrink-0 text-agg-muted-foreground"
|
|
14148
14575
|
}
|
|
14149
|
-
) : /* @__PURE__ */ (0,
|
|
14576
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "shrink-0 text-agg-muted-foreground", children: entry.eventCount })
|
|
14150
14577
|
]
|
|
14151
14578
|
},
|
|
14152
14579
|
entry.id
|
|
@@ -14164,27 +14591,27 @@ var CategorySidebar = ({
|
|
|
14164
14591
|
const hasKnownChildren = childCategories.length > 0;
|
|
14165
14592
|
const isExpanded = ((_d = categoryPath[depth]) == null ? void 0 : _d.id) === category.id && !collapsedCategoryIds.has(category.id);
|
|
14166
14593
|
const isSelected = ((_e = categoryPath[depth]) == null ? void 0 : _e.id) === category.id && categoryPath.length === depth + 1;
|
|
14167
|
-
return /* @__PURE__ */ (0,
|
|
14594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("div", { className: "flex w-full flex-col", children: [
|
|
14168
14595
|
renderRow({
|
|
14169
14596
|
entry,
|
|
14170
14597
|
isExpanded,
|
|
14171
14598
|
isSelected,
|
|
14172
14599
|
onClick: () => onToggleCategory({ entry, depth, hasKnownChildren, isExpanded, isSelected })
|
|
14173
14600
|
}),
|
|
14174
|
-
/* @__PURE__ */ (0,
|
|
14601
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
|
|
14175
14602
|
"div",
|
|
14176
14603
|
{
|
|
14177
14604
|
className: cn(
|
|
14178
14605
|
"grid transition-[grid-template-rows] duration-150 ease-in-out motion-reduce:transition-none",
|
|
14179
14606
|
isExpanded ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
14180
14607
|
),
|
|
14181
|
-
children: /* @__PURE__ */ (0,
|
|
14608
|
+
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
14609
|
}
|
|
14183
14610
|
)
|
|
14184
14611
|
] }, category.id);
|
|
14185
14612
|
};
|
|
14186
|
-
return /* @__PURE__ */ (0,
|
|
14187
|
-
/* @__PURE__ */ (0,
|
|
14613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("div", { className: "flex w-full flex-col gap-1", children: [
|
|
14614
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(
|
|
14188
14615
|
"button",
|
|
14189
14616
|
{
|
|
14190
14617
|
type: "button",
|
|
@@ -14192,8 +14619,8 @@ var CategorySidebar = ({
|
|
|
14192
14619
|
className: !isDrilledIn ? selectedRowClassName : idleRowClassName,
|
|
14193
14620
|
onClick: onSelectAll,
|
|
14194
14621
|
children: [
|
|
14195
|
-
/* @__PURE__ */ (0,
|
|
14196
|
-
/* @__PURE__ */ (0,
|
|
14622
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "min-w-0 flex-1 truncate", children: labels.subcategoriesAll }),
|
|
14623
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "shrink-0 text-agg-muted-foreground", children: totalEventCount })
|
|
14197
14624
|
]
|
|
14198
14625
|
}
|
|
14199
14626
|
),
|
|
@@ -14203,13 +14630,14 @@ var CategorySidebar = ({
|
|
|
14203
14630
|
CategorySidebar.displayName = "CategorySidebar";
|
|
14204
14631
|
|
|
14205
14632
|
// src/events/list/event-list-tabs.tsx
|
|
14206
|
-
var
|
|
14633
|
+
var import_hooks48 = require("@agg-build/hooks");
|
|
14207
14634
|
var import_sdk15 = require("@agg-build/sdk");
|
|
14208
14635
|
var import_react22 = require("react");
|
|
14209
14636
|
|
|
14210
14637
|
// src/events/list/event-list.constants.ts
|
|
14211
14638
|
var import_sdk14 = require("@agg-build/sdk");
|
|
14212
14639
|
var DEFAULT_EVENTS_LIMIT = 50;
|
|
14640
|
+
var DEFAULT_EVENT_LIST_SORT = "volume24hr";
|
|
14213
14641
|
var getDefaultEventListTabs = (labels) => {
|
|
14214
14642
|
return [
|
|
14215
14643
|
{
|
|
@@ -14278,16 +14706,17 @@ var getDefaultEventListTabs = (labels) => {
|
|
|
14278
14706
|
};
|
|
14279
14707
|
|
|
14280
14708
|
// src/events/list/event-list-tabs.tsx
|
|
14281
|
-
var
|
|
14709
|
+
var import_jsx_runtime138 = require("react/jsx-runtime");
|
|
14710
|
+
var DEFAULT_HIDDEN_VENUES = new Set((0, import_sdk15.getEffectiveDisabledVenues)(void 0));
|
|
14282
14711
|
var renderTabIcon = (tab, isActive) => {
|
|
14283
14712
|
if (tab.iconName === "warning-filled") {
|
|
14284
|
-
return /* @__PURE__ */ (0,
|
|
14713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(Icon, { name: "warning-filled", size: "small", color: "currentColor" });
|
|
14285
14714
|
}
|
|
14286
14715
|
if (tab.venueLogo) {
|
|
14287
|
-
return /* @__PURE__ */ (0,
|
|
14716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(VenueLogo, { venue: tab.venueLogo, size: "small" });
|
|
14288
14717
|
}
|
|
14289
14718
|
if (!tab.iconName) return null;
|
|
14290
|
-
return /* @__PURE__ */ (0,
|
|
14719
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
14291
14720
|
Icon,
|
|
14292
14721
|
{
|
|
14293
14722
|
name: tab.iconName,
|
|
@@ -14297,24 +14726,21 @@ var renderTabIcon = (tab, isActive) => {
|
|
|
14297
14726
|
);
|
|
14298
14727
|
};
|
|
14299
14728
|
var useEventListTabs = (tabs) => {
|
|
14300
|
-
const labels = (0,
|
|
14301
|
-
const { disabledVenues, isLoading: isAppConfigLoading } = (0,
|
|
14302
|
-
const { isLocationBlocked } = (0,
|
|
14729
|
+
const labels = (0, import_hooks48.useLabels)();
|
|
14730
|
+
const { disabledVenues, isLoading: isAppConfigLoading } = (0, import_hooks48.useAppConfig)();
|
|
14731
|
+
const { isLocationBlocked } = (0, import_hooks48.useGeoBlock)();
|
|
14303
14732
|
return (0, import_react22.useMemo)(() => {
|
|
14304
14733
|
const baseTabs = tabs != null ? tabs : getDefaultEventListTabs(labels);
|
|
14305
14734
|
return baseTabs.flatMap((tab) => {
|
|
14306
14735
|
if (!tab.venueLogo) return [tab];
|
|
14307
|
-
const availabilityState = (0,
|
|
14736
|
+
const availabilityState = (0, import_hooks48.getVenueAvailabilityState)({
|
|
14308
14737
|
venueId: tab.venueLogo,
|
|
14309
14738
|
disabledVenues,
|
|
14310
|
-
//
|
|
14311
|
-
//
|
|
14312
|
-
//
|
|
14313
|
-
//
|
|
14314
|
-
|
|
14315
|
-
// rather than a venue name, so adding or retiring one needs no
|
|
14316
|
-
// change here.
|
|
14317
|
-
isConfigLoading: isAppConfigLoading && (0, import_sdk15.isVenueInactive)(tab.venueLogo),
|
|
14739
|
+
// A globally inactive or default-disabled venue is hidden until
|
|
14740
|
+
// `/app/config` resolves. That prevents partner-opt-in venues such as
|
|
14741
|
+
// Novig from flashing briefly for apps that still disable them, while
|
|
14742
|
+
// ordinary active venues continue rendering immediately.
|
|
14743
|
+
isConfigLoading: isAppConfigLoading && ((0, import_sdk15.isVenueInactive)(tab.venueLogo) || DEFAULT_HIDDEN_VENUES.has(tab.venueLogo)),
|
|
14318
14744
|
isLocationBlocked
|
|
14319
14745
|
});
|
|
14320
14746
|
if (availabilityState === "hidden") return [];
|
|
@@ -14355,7 +14781,7 @@ var EventListTabs = ({
|
|
|
14355
14781
|
};
|
|
14356
14782
|
});
|
|
14357
14783
|
}, [activeTab, resolvedTabs]);
|
|
14358
|
-
return /* @__PURE__ */ (0,
|
|
14784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
14359
14785
|
Tabs,
|
|
14360
14786
|
{
|
|
14361
14787
|
ariaLabel,
|
|
@@ -14370,7 +14796,7 @@ var EventListTabs = ({
|
|
|
14370
14796
|
EventListTabs.displayName = "EventListTabs";
|
|
14371
14797
|
|
|
14372
14798
|
// src/events/list/index.tsx
|
|
14373
|
-
var
|
|
14799
|
+
var import_jsx_runtime139 = require("react/jsx-runtime");
|
|
14374
14800
|
var SORT_ICON_BY_VALUE = {
|
|
14375
14801
|
volume24hr: "sort-volume-24hr",
|
|
14376
14802
|
topArbitrage: "sort-top-arbitrage",
|
|
@@ -14421,49 +14847,79 @@ var EventList = ({
|
|
|
14421
14847
|
getMarketHref,
|
|
14422
14848
|
getEventHref,
|
|
14423
14849
|
initialVenueTab,
|
|
14850
|
+
activeVenueTab: controlledActiveVenueTab,
|
|
14851
|
+
onActiveVenueTabChange,
|
|
14852
|
+
selectedSort: controlledSelectedSort,
|
|
14853
|
+
onSelectedSortChange,
|
|
14854
|
+
categoryPath: controlledCategoryPath,
|
|
14855
|
+
onCategoryPathChange,
|
|
14424
14856
|
initialLoadedPageCount,
|
|
14425
14857
|
stateRef
|
|
14426
14858
|
}) => {
|
|
14427
|
-
var _a, _b, _c, _d, _e;
|
|
14428
|
-
const labels = (0,
|
|
14429
|
-
const { disabledVenues } = (0,
|
|
14859
|
+
var _a, _b, _c, _d, _e, _f;
|
|
14860
|
+
const labels = (0, import_hooks49.useLabels)();
|
|
14861
|
+
const { disabledVenues } = (0, import_hooks49.useAppConfig)();
|
|
14430
14862
|
const {
|
|
14431
14863
|
features: { enableVenueEventDiscoveryFilters, showSportsMarkets }
|
|
14432
|
-
} = (0,
|
|
14864
|
+
} = (0, import_hooks49.useSdkUiConfig)();
|
|
14433
14865
|
const isDiscoveryFiltersEnabled = enableVenueEventDiscoveryFilters && !search;
|
|
14434
14866
|
const resolvedTabs = useEventListTabs();
|
|
14435
14867
|
const visibleVenues = (0, import_react23.useMemo)(
|
|
14436
|
-
() => disabledVenues.length === 0 ? void 0 : (0,
|
|
14868
|
+
() => disabledVenues.length === 0 ? void 0 : (0, import_hooks49.getVisibleVenueIdsByConfig)(import_sdk16.VENUES, disabledVenues),
|
|
14437
14869
|
[disabledVenues]
|
|
14438
14870
|
);
|
|
14439
|
-
const [
|
|
14871
|
+
const [internalActiveTabValue, setInternalActiveTabValue] = (0, import_react23.useState)(
|
|
14440
14872
|
(_b = initialVenueTab != null ? initialVenueTab : (_a = resolvedTabs[0]) == null ? void 0 : _a.value) != null ? _b : "matched"
|
|
14441
14873
|
);
|
|
14442
|
-
const
|
|
14874
|
+
const activeTabValue = controlledActiveVenueTab != null ? controlledActiveVenueTab : internalActiveTabValue;
|
|
14875
|
+
const [internalSelectedSort, setInternalSelectedSort] = (0, import_react23.useState)(DEFAULT_EVENT_LIST_SORT);
|
|
14876
|
+
const selectedSort = controlledSelectedSort != null ? controlledSelectedSort : internalSelectedSort;
|
|
14443
14877
|
const [isSubcategoriesModalOpen, setIsSubcategoriesModalOpen] = (0, import_react23.useState)(false);
|
|
14444
|
-
const [
|
|
14878
|
+
const [internalCategoryPath, setInternalCategoryPath] = (0, import_react23.useState)([]);
|
|
14879
|
+
const categoryPath = controlledCategoryPath != null ? controlledCategoryPath : internalCategoryPath;
|
|
14445
14880
|
const [collapsedCategoryIds, setCollapsedCategoryIds] = (0, import_react23.useState)(() => /* @__PURE__ */ new Set());
|
|
14881
|
+
const handleActiveTabChange = (0, import_react23.useCallback)(
|
|
14882
|
+
(value) => {
|
|
14883
|
+
if (controlledActiveVenueTab == null) setInternalActiveTabValue(value);
|
|
14884
|
+
onActiveVenueTabChange == null ? void 0 : onActiveVenueTabChange(value, { history: "push" });
|
|
14885
|
+
},
|
|
14886
|
+
[controlledActiveVenueTab, onActiveVenueTabChange]
|
|
14887
|
+
);
|
|
14888
|
+
const handleSelectedSortChange = (0, import_react23.useCallback)(
|
|
14889
|
+
(value) => {
|
|
14890
|
+
if (controlledSelectedSort == null) setInternalSelectedSort(value);
|
|
14891
|
+
onSelectedSortChange == null ? void 0 : onSelectedSortChange(value, { history: "push" });
|
|
14892
|
+
},
|
|
14893
|
+
[controlledSelectedSort, onSelectedSortChange]
|
|
14894
|
+
);
|
|
14895
|
+
const handleCategoryPathChange = (0, import_react23.useCallback)(
|
|
14896
|
+
(value, options) => {
|
|
14897
|
+
if (controlledCategoryPath == null) setInternalCategoryPath(value);
|
|
14898
|
+
onCategoryPathChange == null ? void 0 : onCategoryPathChange(value, options);
|
|
14899
|
+
},
|
|
14900
|
+
[controlledCategoryPath, onCategoryPathChange]
|
|
14901
|
+
);
|
|
14446
14902
|
const sortItems = (0, import_react23.useMemo)(() => {
|
|
14447
14903
|
return [
|
|
14448
14904
|
{
|
|
14449
14905
|
value: "volume24hr",
|
|
14450
14906
|
label: labels.eventList.sortBy24hVolume,
|
|
14451
|
-
icon: /* @__PURE__ */ (0,
|
|
14907
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Icon, { name: SORT_ICON_BY_VALUE.volume24hr, size: "small", color: "currentColor" })
|
|
14452
14908
|
},
|
|
14453
14909
|
{
|
|
14454
14910
|
value: "topArbitrage",
|
|
14455
14911
|
label: labels.eventList.sortByTopArbitrage,
|
|
14456
|
-
icon: /* @__PURE__ */ (0,
|
|
14912
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Icon, { name: SORT_ICON_BY_VALUE.topArbitrage, size: "small", color: "currentColor" })
|
|
14457
14913
|
},
|
|
14458
14914
|
{
|
|
14459
14915
|
value: "volume",
|
|
14460
14916
|
label: labels.eventList.sortByTotalVolume,
|
|
14461
|
-
icon: /* @__PURE__ */ (0,
|
|
14917
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Icon, { name: SORT_ICON_BY_VALUE.volume, size: "small", color: "currentColor" })
|
|
14462
14918
|
},
|
|
14463
14919
|
{
|
|
14464
14920
|
value: "endDate",
|
|
14465
14921
|
label: labels.eventList.sortByEndingSoon,
|
|
14466
|
-
icon: /* @__PURE__ */ (0,
|
|
14922
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Icon, { name: SORT_ICON_BY_VALUE.endDate, size: "small", color: "currentColor" })
|
|
14467
14923
|
}
|
|
14468
14924
|
];
|
|
14469
14925
|
}, [
|
|
@@ -14475,10 +14931,10 @@ var EventList = ({
|
|
|
14475
14931
|
const baseCategoryId = (_c = categoryIds == null ? void 0 : categoryIds[0]) != null ? _c : null;
|
|
14476
14932
|
(0, import_react23.useEffect)(() => {
|
|
14477
14933
|
if (!isDiscoveryFiltersEnabled) return;
|
|
14478
|
-
|
|
14934
|
+
if (controlledCategoryPath == null) setInternalCategoryPath([]);
|
|
14479
14935
|
setCollapsedCategoryIds(/* @__PURE__ */ new Set());
|
|
14480
|
-
}, [baseCategoryId, isDiscoveryFiltersEnabled]);
|
|
14481
|
-
const { categories: topLevelCategories } = (0,
|
|
14936
|
+
}, [baseCategoryId, controlledCategoryPath, isDiscoveryFiltersEnabled]);
|
|
14937
|
+
const { categories: topLevelCategories } = (0, import_hooks49.useCategories)({
|
|
14482
14938
|
queryKeyScope: "event-list-top-categories",
|
|
14483
14939
|
enabled: isDiscoveryFiltersEnabled,
|
|
14484
14940
|
limit: 100
|
|
@@ -14489,12 +14945,13 @@ var EventList = ({
|
|
|
14489
14945
|
const baseCategoryChildPrefetchIds = (0, import_react23.useMemo)(() => {
|
|
14490
14946
|
return Array.from(
|
|
14491
14947
|
/* @__PURE__ */ new Set([
|
|
14948
|
+
...baseCategoryId ? [baseCategoryId] : [],
|
|
14492
14949
|
...sortedTopLevelCategories.map((category) => category.id),
|
|
14493
14950
|
...categoryPath.map((category) => category.id)
|
|
14494
14951
|
])
|
|
14495
14952
|
);
|
|
14496
|
-
}, [categoryPath, sortedTopLevelCategories]);
|
|
14497
|
-
const { childrenByParentId: baseChildrenByParentId } = (0,
|
|
14953
|
+
}, [baseCategoryId, categoryPath, sortedTopLevelCategories]);
|
|
14954
|
+
const { childrenByParentId: baseChildrenByParentId, isLoading: isBaseCategoryChildrenLoading } = (0, import_hooks49.useCategoryChildren)({
|
|
14498
14955
|
queryKeyScope: "event-list-category-children",
|
|
14499
14956
|
enabled: isDiscoveryFiltersEnabled,
|
|
14500
14957
|
parentIds: baseCategoryChildPrefetchIds,
|
|
@@ -14515,7 +14972,7 @@ var EventList = ({
|
|
|
14515
14972
|
}
|
|
14516
14973
|
return Array.from(ids);
|
|
14517
14974
|
}, [baseCategoryId, baseChildrenByParentId, categoryPath]);
|
|
14518
|
-
const { childrenByParentId: visibleChildrenByParentId } = (0,
|
|
14975
|
+
const { childrenByParentId: visibleChildrenByParentId } = (0, import_hooks49.useCategoryChildren)({
|
|
14519
14976
|
queryKeyScope: "event-list-category-children",
|
|
14520
14977
|
enabled: isDiscoveryFiltersEnabled,
|
|
14521
14978
|
parentIds: visibleChildPrefetchIds,
|
|
@@ -14531,7 +14988,7 @@ var EventList = ({
|
|
|
14531
14988
|
}
|
|
14532
14989
|
return Array.from(ids);
|
|
14533
14990
|
}, [categoryPath, visibleChildrenByParentId]);
|
|
14534
|
-
const { childrenByParentId: visibleGrandchildrenByParentId } = (0,
|
|
14991
|
+
const { childrenByParentId: visibleGrandchildrenByParentId } = (0, import_hooks49.useCategoryChildren)({
|
|
14535
14992
|
queryKeyScope: "event-list-category-children",
|
|
14536
14993
|
enabled: isDiscoveryFiltersEnabled,
|
|
14537
14994
|
parentIds: visibleGrandchildPrefetchIds,
|
|
@@ -14544,7 +15001,36 @@ var EventList = ({
|
|
|
14544
15001
|
...visibleGrandchildrenByParentId
|
|
14545
15002
|
]);
|
|
14546
15003
|
}, [baseChildrenByParentId, visibleChildrenByParentId, visibleGrandchildrenByParentId]);
|
|
14547
|
-
const
|
|
15004
|
+
const controlledCategoryPathKey = (_d = controlledCategoryPath == null ? void 0 : controlledCategoryPath.map((entry) => entry.id).join(",")) != null ? _d : "";
|
|
15005
|
+
const controlledCategoryPathValidationKey = `${baseCategoryId != null ? baseCategoryId : ""}|${controlledCategoryPathKey}`;
|
|
15006
|
+
const [validatedCategoryPathKey, setValidatedCategoryPathKey] = (0, import_react23.useState)(
|
|
15007
|
+
() => controlledCategoryPath == null || controlledCategoryPath.length === 0 ? controlledCategoryPathValidationKey : ""
|
|
15008
|
+
);
|
|
15009
|
+
(0, import_react23.useEffect)(() => {
|
|
15010
|
+
if (controlledCategoryPath == null || controlledCategoryPath.length === 0) {
|
|
15011
|
+
setValidatedCategoryPathKey(controlledCategoryPathValidationKey);
|
|
15012
|
+
return;
|
|
15013
|
+
}
|
|
15014
|
+
if (isBaseCategoryChildrenLoading) return;
|
|
15015
|
+
const requestedIds = controlledCategoryPath.map((entry) => entry.id);
|
|
15016
|
+
const validIds = validateSubcategoryPath(requestedIds, baseCategoryId, baseChildrenByParentId);
|
|
15017
|
+
if (validIds.length !== requestedIds.length) {
|
|
15018
|
+
handleCategoryPathChange(controlledCategoryPath.slice(0, validIds.length), {
|
|
15019
|
+
history: "replace"
|
|
15020
|
+
});
|
|
15021
|
+
return;
|
|
15022
|
+
}
|
|
15023
|
+
setValidatedCategoryPathKey(controlledCategoryPathValidationKey);
|
|
15024
|
+
}, [
|
|
15025
|
+
baseCategoryId,
|
|
15026
|
+
baseChildrenByParentId,
|
|
15027
|
+
controlledCategoryPath,
|
|
15028
|
+
controlledCategoryPathKey,
|
|
15029
|
+
controlledCategoryPathValidationKey,
|
|
15030
|
+
handleCategoryPathChange,
|
|
15031
|
+
isBaseCategoryChildrenLoading
|
|
15032
|
+
]);
|
|
15033
|
+
const shouldRenderSubcategoryFilters = isDiscoveryFiltersEnabled && baseCategoryId !== null && (((_f = (_e = childrenByParentId.get(baseCategoryId)) == null ? void 0 : _e.length) != null ? _f : 0) > 0 || categoryPath.length > 0);
|
|
14548
15034
|
const baseCategoryEventCount = (0, import_react23.useMemo)(() => {
|
|
14549
15035
|
var _a2, _b2;
|
|
14550
15036
|
return (_b2 = (_a2 = sortedTopLevelCategories.find((c) => c.id === baseCategoryId)) == null ? void 0 : _a2.eventCount) != null ? _b2 : 0;
|
|
@@ -14587,14 +15073,14 @@ var EventList = ({
|
|
|
14587
15073
|
isFetchingNextPage,
|
|
14588
15074
|
isPlaceholderData,
|
|
14589
15075
|
loadedPageCount
|
|
14590
|
-
} = (0,
|
|
15076
|
+
} = (0, import_hooks49.useVenueEvents)({
|
|
14591
15077
|
queryKeyScope: "event-list",
|
|
14592
15078
|
venues,
|
|
14593
15079
|
search,
|
|
14594
15080
|
categoryIds: resolvedCategoryIds,
|
|
14595
15081
|
matchStatus,
|
|
14596
15082
|
limit: requestLimit,
|
|
14597
|
-
status: [
|
|
15083
|
+
status: [import_hooks49.MarketStatus.open],
|
|
14598
15084
|
sortBy: sortQueryParams.sortBy,
|
|
14599
15085
|
sortDir: sortQueryParams.sortDir,
|
|
14600
15086
|
endDateFrom,
|
|
@@ -14602,7 +15088,8 @@ var EventList = ({
|
|
|
14602
15088
|
// markets experience is enabled (the sports event-detail view loads the
|
|
14603
15089
|
// folded companions via aggKey). Gated on the same flag as that view.
|
|
14604
15090
|
grouped: showSportsMarkets,
|
|
14605
|
-
initialPages: initialLoadedPageCount
|
|
15091
|
+
initialPages: initialLoadedPageCount,
|
|
15092
|
+
enabled: controlledCategoryPath == null || validatedCategoryPathKey === controlledCategoryPathValidationKey
|
|
14606
15093
|
});
|
|
14607
15094
|
(0, import_react23.useEffect)(() => {
|
|
14608
15095
|
if (stateRef) {
|
|
@@ -14629,7 +15116,7 @@ var EventList = ({
|
|
|
14629
15116
|
const visibleMidpointVenueMarketIds = (0, import_react23.useMemo)(() => {
|
|
14630
15117
|
return collectMidpointVenueMarketIds(visibleVenueMarkets);
|
|
14631
15118
|
}, [visibleVenueMarkets]);
|
|
14632
|
-
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0,
|
|
15119
|
+
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0, import_hooks49.useVenueMarketMidpoints)({
|
|
14633
15120
|
venueMarketIds: visibleMidpointVenueMarketIds,
|
|
14634
15121
|
enabled: visibleMidpointVenueMarketIds.length > 0
|
|
14635
15122
|
});
|
|
@@ -14663,7 +15150,7 @@ var EventList = ({
|
|
|
14663
15150
|
"grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] md:grid-cols-[repeat(auto-fill,minmax(360px,1fr))] gap-4"
|
|
14664
15151
|
);
|
|
14665
15152
|
const handleSelectAllCategories = () => {
|
|
14666
|
-
|
|
15153
|
+
handleCategoryPathChange([], { history: "push" });
|
|
14667
15154
|
setCollapsedCategoryIds(/* @__PURE__ */ new Set());
|
|
14668
15155
|
onCategoryRootChange == null ? void 0 : onCategoryRootChange(baseCategoryId != null ? baseCategoryId : void 0);
|
|
14669
15156
|
setIsSubcategoriesModalOpen(false);
|
|
@@ -14675,7 +15162,7 @@ var EventList = ({
|
|
|
14675
15162
|
isExpanded,
|
|
14676
15163
|
isSelected
|
|
14677
15164
|
}) => {
|
|
14678
|
-
|
|
15165
|
+
handleCategoryPathChange([...categoryPath.slice(0, depth), entry], { history: "push" });
|
|
14679
15166
|
setCollapsedCategoryIds((prev) => {
|
|
14680
15167
|
const next = new Set(prev);
|
|
14681
15168
|
if (hasKnownChildren && isExpanded && isSelected) {
|
|
@@ -14688,7 +15175,7 @@ var EventList = ({
|
|
|
14688
15175
|
onCategoryRootChange == null ? void 0 : onCategoryRootChange(baseCategoryId != null ? baseCategoryId : void 0);
|
|
14689
15176
|
};
|
|
14690
15177
|
if (shouldRenderLoadingState) {
|
|
14691
|
-
return /* @__PURE__ */ (0,
|
|
15178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14692
15179
|
Skeleton,
|
|
14693
15180
|
{
|
|
14694
15181
|
view: "event-list",
|
|
@@ -14697,8 +15184,8 @@ var EventList = ({
|
|
|
14697
15184
|
}
|
|
14698
15185
|
);
|
|
14699
15186
|
}
|
|
14700
|
-
return /* @__PURE__ */ (0,
|
|
14701
|
-
/* @__PURE__ */ (0,
|
|
15187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("section", { className: "agg-event-list flex w-full flex-col gap-2 md:gap-5 t", children: [
|
|
15188
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(
|
|
14702
15189
|
"header",
|
|
14703
15190
|
{
|
|
14704
15191
|
className: cn(
|
|
@@ -14707,25 +15194,25 @@ var EventList = ({
|
|
|
14707
15194
|
"gap-2 sm:flex-row sm:items-center sm:gap-4"
|
|
14708
15195
|
),
|
|
14709
15196
|
children: [
|
|
14710
|
-
/* @__PURE__ */ (0,
|
|
14711
|
-
/* @__PURE__ */ (0,
|
|
14712
|
-
/* @__PURE__ */ (0,
|
|
15197
|
+
/* @__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 }) }),
|
|
15198
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "hidden min-w-0 max-w-full items-center gap-3 md:flex", children: [
|
|
15199
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14713
15200
|
EventListTabs,
|
|
14714
15201
|
{
|
|
14715
15202
|
ariaLabel: labels.eventList.tabsAria(title2),
|
|
14716
15203
|
className: "agg-event-list-tabs min-w-0 flex-1 max-w-[600px]!",
|
|
14717
15204
|
activeTab: activeTabValue,
|
|
14718
|
-
onTabChange:
|
|
15205
|
+
onTabChange: handleActiveTabChange,
|
|
14719
15206
|
overflowBehavior: "scroll"
|
|
14720
15207
|
}
|
|
14721
15208
|
),
|
|
14722
|
-
/* @__PURE__ */ (0,
|
|
15209
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14723
15210
|
Select,
|
|
14724
15211
|
{
|
|
14725
15212
|
ariaLabel: labels.eventList.sortByLabel,
|
|
14726
15213
|
className: "min-w-[200px] w-auto! shrink-0 min-h-10.5",
|
|
14727
15214
|
value: selectedSort,
|
|
14728
|
-
onChange:
|
|
15215
|
+
onChange: handleSelectedSortChange,
|
|
14729
15216
|
items: sortItems,
|
|
14730
15217
|
contentClassName: "py-2",
|
|
14731
15218
|
triggerClassName: "rounded-agg-lg!"
|
|
@@ -14735,45 +15222,45 @@ var EventList = ({
|
|
|
14735
15222
|
]
|
|
14736
15223
|
}
|
|
14737
15224
|
),
|
|
14738
|
-
/* @__PURE__ */ (0,
|
|
14739
|
-
/* @__PURE__ */ (0,
|
|
15225
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "flex w-full gap-2 md:hidden mb-3", children: [
|
|
15226
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14740
15227
|
EventListTabs,
|
|
14741
15228
|
{
|
|
14742
15229
|
ariaLabel: labels.eventList.tabsAria(title2),
|
|
14743
15230
|
className: "agg-event-list-tabs min-w-0 flex-1",
|
|
14744
15231
|
activeTab: activeTabValue,
|
|
14745
|
-
onTabChange:
|
|
15232
|
+
onTabChange: handleActiveTabChange,
|
|
14746
15233
|
overflowBehavior: "select"
|
|
14747
15234
|
}
|
|
14748
15235
|
),
|
|
14749
|
-
/* @__PURE__ */ (0,
|
|
15236
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14750
15237
|
Select,
|
|
14751
15238
|
{
|
|
14752
15239
|
ariaLabel: labels.eventList.sortByLabel,
|
|
14753
15240
|
className: "min-w-0 flex-1 md:min-w-[144px]",
|
|
14754
15241
|
value: selectedSort,
|
|
14755
|
-
onChange:
|
|
15242
|
+
onChange: handleSelectedSortChange,
|
|
14756
15243
|
items: sortItems,
|
|
14757
15244
|
contentClassName: "rounded-[12px] py-2 shadow-[0_8px_16px_rgba(0,0,0,0.1)]"
|
|
14758
15245
|
}
|
|
14759
15246
|
),
|
|
14760
|
-
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0,
|
|
15247
|
+
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14761
15248
|
"button",
|
|
14762
15249
|
{
|
|
14763
15250
|
type: "button",
|
|
14764
15251
|
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
15252
|
"aria-label": labels.eventList.subcategoriesOpenAria,
|
|
14766
15253
|
onClick: () => setIsSubcategoriesModalOpen(true),
|
|
14767
|
-
children: /* @__PURE__ */ (0,
|
|
15254
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Icon, { name: "apps", size: "small", color: "currentColor" })
|
|
14768
15255
|
}
|
|
14769
15256
|
) : null
|
|
14770
15257
|
] }),
|
|
14771
|
-
/* @__PURE__ */ (0,
|
|
15258
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(
|
|
14772
15259
|
"div",
|
|
14773
15260
|
{
|
|
14774
15261
|
className: cn("flex w-full gap-6", shouldRenderSubcategoryFilters ? "md:items-start" : ""),
|
|
14775
15262
|
children: [
|
|
14776
|
-
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0,
|
|
15263
|
+
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
15264
|
CategorySidebar,
|
|
14778
15265
|
{
|
|
14779
15266
|
baseCategoryId,
|
|
@@ -14786,7 +15273,7 @@ var EventList = ({
|
|
|
14786
15273
|
onToggleCategory: handleToggleSubcategory
|
|
14787
15274
|
}
|
|
14788
15275
|
) }) }) : null,
|
|
14789
|
-
/* @__PURE__ */ (0,
|
|
15276
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(
|
|
14790
15277
|
"div",
|
|
14791
15278
|
{
|
|
14792
15279
|
className: cn(
|
|
@@ -14797,7 +15284,7 @@ var EventList = ({
|
|
|
14797
15284
|
gridClassName
|
|
14798
15285
|
),
|
|
14799
15286
|
children: [
|
|
14800
|
-
tileEvents.map((event) => /* @__PURE__ */ (0,
|
|
15287
|
+
tileEvents.map((event) => /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14801
15288
|
EventListItem,
|
|
14802
15289
|
{
|
|
14803
15290
|
event,
|
|
@@ -14810,11 +15297,11 @@ var EventList = ({
|
|
|
14810
15297
|
onMarketClick,
|
|
14811
15298
|
getMarketHref,
|
|
14812
15299
|
href: getEventHref == null ? void 0 : getEventHref(event),
|
|
14813
|
-
marketStatus:
|
|
15300
|
+
marketStatus: import_hooks49.MarketStatus.open
|
|
14814
15301
|
},
|
|
14815
15302
|
event.id
|
|
14816
15303
|
)),
|
|
14817
|
-
shouldRenderPaginationLoadingItems ? Array.from({ length: 6 }).map((_, index) => /* @__PURE__ */ (0,
|
|
15304
|
+
shouldRenderPaginationLoadingItems ? Array.from({ length: 6 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14818
15305
|
EventListItem,
|
|
14819
15306
|
{
|
|
14820
15307
|
isLoading: true,
|
|
@@ -14824,20 +15311,20 @@ var EventList = ({
|
|
|
14824
15311
|
},
|
|
14825
15312
|
`loading-${index}`
|
|
14826
15313
|
)) : null,
|
|
14827
|
-
shouldRenderEmptyState ? /* @__PURE__ */ (0,
|
|
15314
|
+
shouldRenderEmptyState ? /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "col-span-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14828
15315
|
StateMessage,
|
|
14829
15316
|
{
|
|
14830
15317
|
title: labels.eventList.emptyTitle,
|
|
14831
15318
|
description: labels.eventList.emptyDescription,
|
|
14832
|
-
icon: /* @__PURE__ */ (0,
|
|
15319
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Icon, { name: "search-empty" })
|
|
14833
15320
|
}
|
|
14834
15321
|
) }) : null,
|
|
14835
|
-
isError ? /* @__PURE__ */ (0,
|
|
15322
|
+
isError ? /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "col-span-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14836
15323
|
StateMessage,
|
|
14837
15324
|
{
|
|
14838
15325
|
title: labels.eventList.errorTitle,
|
|
14839
15326
|
description: labels.eventList.errorDescription,
|
|
14840
|
-
icon: /* @__PURE__ */ (0,
|
|
15327
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Icon, { name: "warning" })
|
|
14841
15328
|
}
|
|
14842
15329
|
) }) : null
|
|
14843
15330
|
]
|
|
@@ -14846,7 +15333,7 @@ var EventList = ({
|
|
|
14846
15333
|
]
|
|
14847
15334
|
}
|
|
14848
15335
|
),
|
|
14849
|
-
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0,
|
|
15336
|
+
shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Modal, { open: isSubcategoriesModalOpen, onOpenChange: setIsSubcategoriesModalOpen, children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14850
15337
|
Modal.Container,
|
|
14851
15338
|
{
|
|
14852
15339
|
classNames: {
|
|
@@ -14855,20 +15342,20 @@ var EventList = ({
|
|
|
14855
15342
|
content: "items-end p-0 pointer-events-none",
|
|
14856
15343
|
container: "w-full max-w-none border-0 bg-transparent shadow-none"
|
|
14857
15344
|
},
|
|
14858
|
-
children: /* @__PURE__ */ (0,
|
|
14859
|
-
/* @__PURE__ */ (0,
|
|
14860
|
-
/* @__PURE__ */ (0,
|
|
14861
|
-
/* @__PURE__ */ (0,
|
|
14862
|
-
/* @__PURE__ */ (0,
|
|
15345
|
+
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: [
|
|
15346
|
+
/* @__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" }) }),
|
|
15347
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "flex items-center justify-between px-4 pb-2 pt-1", children: [
|
|
15348
|
+
/* @__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 }),
|
|
15349
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
14863
15350
|
Dialog2.Close,
|
|
14864
15351
|
{
|
|
14865
15352
|
className: "flex cursor-pointer items-center justify-center rounded-full p-1 text-agg-muted-foreground hover:bg-agg-secondary-hover",
|
|
14866
15353
|
"aria-label": labels.common.close,
|
|
14867
|
-
children: /* @__PURE__ */ (0,
|
|
15354
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(CloseIcon, { className: "h-5 w-5" })
|
|
14868
15355
|
}
|
|
14869
15356
|
)
|
|
14870
15357
|
] }),
|
|
14871
|
-
/* @__PURE__ */ (0,
|
|
15358
|
+
/* @__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
15359
|
CategorySidebar,
|
|
14873
15360
|
{
|
|
14874
15361
|
baseCategoryId,
|
|
@@ -14884,7 +15371,7 @@ var EventList = ({
|
|
|
14884
15371
|
] })
|
|
14885
15372
|
}
|
|
14886
15373
|
) }) : null,
|
|
14887
|
-
shouldPaginate && hasNextPage ? /* @__PURE__ */ (0,
|
|
15374
|
+
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
15375
|
] });
|
|
14889
15376
|
};
|
|
14890
15377
|
EventList.displayName = "EventList";
|
|
@@ -14899,6 +15386,7 @@ EventList.displayName = "EventList";
|
|
|
14899
15386
|
Orderbook,
|
|
14900
15387
|
OrderbookWithStates,
|
|
14901
15388
|
SettlementSummary,
|
|
15389
|
+
SportsLiveScore,
|
|
14902
15390
|
collectEligibleVenueOutcomeIds,
|
|
14903
15391
|
collectEligibleVenueOutcomes,
|
|
14904
15392
|
formatProbabilityCents,
|