@agg-build/ui 2.1.2 → 2.1.4

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.
Files changed (65) hide show
  1. package/dist/{chunk-ZOECARZW.mjs → chunk-BW7S2YR3.mjs} +798 -312
  2. package/dist/{chunk-7ZR5JYB3.mjs → chunk-FLESSOSU.mjs} +2077 -533
  3. package/dist/{chunk-5RBHMMY3.mjs → chunk-R2YNZJZ3.mjs} +69 -27
  4. package/dist/{chunk-75AMJAWR.mjs → chunk-T4YZGAYS.mjs} +22 -1
  5. package/dist/{chunk-JJDYOBVG.mjs → chunk-TBZWRUFB.mjs} +654 -560
  6. package/dist/{chunk-TBD3N4T4.mjs → chunk-VP76G6PN.mjs} +41 -41
  7. package/dist/{chunk-NRNBJPYK.mjs → chunk-XHE2VO3S.mjs} +4 -21
  8. package/dist/events.js +776 -638
  9. package/dist/events.mjs +5 -3
  10. package/dist/index.js +5665 -3867
  11. package/dist/index.mjs +112 -455
  12. package/dist/modals.mjs +3 -3
  13. package/dist/pages.js +8330 -6452
  14. package/dist/pages.mjs +6 -6
  15. package/dist/primitives.js +40 -41
  16. package/dist/primitives.mjs +1 -1
  17. package/dist/styles.css +1 -1
  18. package/dist/tailwind.css +1 -1
  19. package/dist/trading.js +652 -415
  20. package/dist/trading.mjs +4 -4
  21. package/dist/types/events/item/event-list-item.utils.d.mts +1 -25
  22. package/dist/types/events/item/event-list-item.utils.d.ts +1 -25
  23. package/dist/types/events/item-details/index.d.mts +2 -1
  24. package/dist/types/events/item-details/index.d.ts +2 -1
  25. package/dist/types/events/market-details/market-details-graph-panel.d.mts +39 -0
  26. package/dist/types/events/market-details/market-details-graph-panel.d.ts +39 -0
  27. package/dist/types/events/market-details/market-details-outcome-button.d.mts +2 -1
  28. package/dist/types/events/market-details/market-details-outcome-button.d.ts +2 -1
  29. package/dist/types/events/market-details/market-details.types.d.mts +31 -0
  30. package/dist/types/events/market-details/market-details.types.d.ts +31 -0
  31. package/dist/types/events/market-details/market-details.utils.d.mts +3 -16
  32. package/dist/types/events/market-details/market-details.utils.d.ts +3 -16
  33. package/dist/types/events/shared/format-event-title.d.mts +1 -2
  34. package/dist/types/events/shared/format-event-title.d.ts +1 -2
  35. package/dist/types/events/shared/format-sports-event-time.d.mts +2 -0
  36. package/dist/types/events/shared/format-sports-event-time.d.ts +2 -0
  37. package/dist/types/notifications/agg-notification-events-provider.d.mts +10 -1
  38. package/dist/types/notifications/agg-notification-events-provider.d.ts +10 -1
  39. package/dist/types/pages/event-market/event-market.shared.d.mts +30 -0
  40. package/dist/types/pages/event-market/event-market.shared.d.ts +30 -0
  41. package/dist/types/pages/event-market/sports-event-market-page.d.mts +8 -0
  42. package/dist/types/pages/event-market/sports-event-market-page.d.ts +8 -0
  43. package/dist/types/pages/event-market/sports-event-market.fixtures.d.mts +13 -0
  44. package/dist/types/pages/event-market/sports-event-market.fixtures.d.ts +13 -0
  45. package/dist/types/pages/event-market/sports-event-market.utils.d.mts +156 -0
  46. package/dist/types/pages/event-market/sports-event-market.utils.d.ts +156 -0
  47. package/dist/types/pages/event-market/sports-line-rail.d.mts +17 -0
  48. package/dist/types/pages/event-market/sports-line-rail.d.ts +17 -0
  49. package/dist/types/pages/event-market/sports-market-card.d.mts +22 -0
  50. package/dist/types/pages/event-market/sports-market-card.d.ts +22 -0
  51. package/dist/types/pages/event-market/sports-markets.d.mts +13 -0
  52. package/dist/types/pages/event-market/sports-markets.d.ts +13 -0
  53. package/dist/types/primitives/search/search.utils.d.mts +1 -3
  54. package/dist/types/primitives/search/search.utils.d.ts +1 -3
  55. package/dist/types/primitives/state-message/index.d.mts +1 -1
  56. package/dist/types/primitives/state-message/index.d.ts +1 -1
  57. package/dist/types/primitives/state-message/state-message.types.d.mts +1 -1
  58. package/dist/types/primitives/state-message/state-message.types.d.ts +1 -1
  59. package/dist/types/trading/place-order/index.d.mts +1 -1
  60. package/dist/types/trading/place-order/index.d.ts +1 -1
  61. package/dist/types/trading/place-order/index.place-order.types.d.mts +7 -0
  62. package/dist/types/trading/place-order/index.place-order.types.d.ts +7 -0
  63. package/dist/types/trading/settlement/settlement-text.utils.d.mts +5 -2
  64. package/dist/types/trading/settlement/settlement-text.utils.d.ts +5 -2
  65. package/package.json +3 -3
package/dist/events.js CHANGED
@@ -74,6 +74,7 @@ __export(events_exports, {
74
74
  formatProbabilityCents: () => formatProbabilityCents,
75
75
  mergeVenueOutcomeOrderbooks: () => mergeVenueOutcomeOrderbooks,
76
76
  orderbookRowLimitDefault: () => orderbookRowLimitDefault,
77
+ resolveEventDetailsSyncKey: () => resolveEventDetailsSyncKey,
77
78
  resolveOrderBookRows: () => resolveOrderBookRows,
78
79
  resolveUnifiedOrderBookEntries: () => resolveUnifiedOrderBookEntries,
79
80
  useCenterOrderbookSpread: () => useCenterOrderbookSpread
@@ -5491,8 +5492,23 @@ var VenueLogo = ({
5491
5492
  };
5492
5493
  VenueLogo.displayName = "VenueLogo";
5493
5494
 
5494
- // src/events/shared/format-event-title.ts
5495
+ // src/events/shared/format-sports-event-time.ts
5495
5496
  var import_dayjs2 = __toESM(require("dayjs"));
5497
+ var import_timezone = __toESM(require("dayjs/plugin/timezone"));
5498
+ var import_utc = __toESM(require("dayjs/plugin/utc"));
5499
+ import_dayjs2.default.extend(import_utc.default);
5500
+ import_dayjs2.default.extend(import_timezone.default);
5501
+ var SPORTS_EVENT_TIMEZONE = "America/New_York";
5502
+ var SPORTS_EVENT_TIME_FORMAT = "MMM D, h:mm A";
5503
+ var formatSportsEventTimeEt = (value) => {
5504
+ const resolvedValue = value.trim();
5505
+ if (!resolvedValue) return null;
5506
+ const parsedValue = import_dayjs2.default.utc(resolvedValue);
5507
+ if (!parsedValue.isValid()) return null;
5508
+ return `${parsedValue.tz(SPORTS_EVENT_TIMEZONE).format(SPORTS_EVENT_TIME_FORMAT)} ET`;
5509
+ };
5510
+
5511
+ // src/events/shared/format-event-title.ts
5496
5512
  var SPORT_CATEGORY_TOKENS = /* @__PURE__ */ new Set(["sport", "sports"]);
5497
5513
  var normalizeCategoryToken = (value) => {
5498
5514
  if (typeof value !== "string") return null;
@@ -5513,28 +5529,19 @@ var isSportEvent = (categories, structureType) => {
5513
5529
  return isSportCategoryToken(categoryEntry.id) || isSportCategoryToken((_a2 = categoryEntry.category) == null ? void 0 : _a2.id) || isSportCategoryToken((_b = categoryEntry.category) == null ? void 0 : _b.name) || isSportCategoryToken((_c = categoryEntry.category) == null ? void 0 : _c.displayName) || isSportCategoryToken((_d = categoryEntry.category) == null ? void 0 : _d.parentId);
5514
5530
  })) != null ? _a : false;
5515
5531
  };
5516
- var formatEventDateSuffix = (value, locale) => {
5517
- if (!(0, import_dayjs2.default)(value).isValid()) return null;
5518
- return new Intl.DateTimeFormat(locale, {
5519
- month: "long",
5520
- day: "numeric",
5521
- timeZone: "UTC"
5522
- }).format(new Date(value));
5523
- };
5524
5532
  var formatEventTitleWithDateSuffix = ({
5525
5533
  title: title2,
5526
5534
  categories,
5527
5535
  structureType,
5528
5536
  gameStartTime,
5529
- endDate,
5530
- locale = "en-US"
5537
+ endDate
5531
5538
  }) => {
5532
5539
  const resolvedTitle = title2.trim();
5533
5540
  if (!resolvedTitle) return resolvedTitle;
5534
5541
  if (!isSportEvent(categories, structureType)) return resolvedTitle;
5535
5542
  const dateSource = gameStartTime != null ? gameStartTime : endDate;
5536
5543
  if (!dateSource) return resolvedTitle;
5537
- const formattedDate = formatEventDateSuffix(dateSource, locale);
5544
+ const formattedDate = formatSportsEventTimeEt(dateSource);
5538
5545
  if (!formattedDate) return resolvedTitle;
5539
5546
  const suffix = ` - ${formattedDate}`;
5540
5547
  if (resolvedTitle.endsWith(suffix)) return resolvedTitle;
@@ -5759,18 +5766,9 @@ var selectPrimaryVenueMarket = (venueMarkets) => {
5759
5766
  return bVolume - aVolume;
5760
5767
  })[0];
5761
5768
  };
5762
- var getVenueSummary = (venueMarkets, options) => {
5769
+ var getVenueSummary = (venueMarkets) => {
5763
5770
  const normalizedVenueMarkets = normalizeVenueMarketCluster(venueMarkets);
5764
- const tradableVenues = options == null ? void 0 : options.tradableVenues;
5765
- const isVenueTradable = (venue) => {
5766
- if (tradableVenues == null) return true;
5767
- return tradableVenues.has(venue);
5768
- };
5769
- const uniqueVenues = Array.from(
5770
- new Set(
5771
- normalizedVenueMarkets.filter((market) => isVenueTradable(market.venue)).map((market) => market.venue)
5772
- )
5773
- );
5771
+ const uniqueVenues = Array.from(new Set(normalizedVenueMarkets.map((market) => market.venue)));
5774
5772
  return {
5775
5773
  marketCount: normalizedVenueMarkets.length,
5776
5774
  venueCount: uniqueVenues.length,
@@ -6382,13 +6380,20 @@ var resolveStateMessageHasAction = ({ onAction }) => {
6382
6380
 
6383
6381
  // src/primitives/state-message/index.tsx
6384
6382
  var import_jsx_runtime116 = require("react/jsx-runtime");
6385
- var StateMessage = ({
6386
- icon,
6387
- title: title2,
6388
- description,
6389
- onAction,
6390
- classNames
6391
- }) => {
6383
+ var StateMessage = (_a) => {
6384
+ var _b = _a, {
6385
+ icon,
6386
+ title: title2,
6387
+ description,
6388
+ onAction,
6389
+ classNames
6390
+ } = _b, rest = __objRest(_b, [
6391
+ "icon",
6392
+ "title",
6393
+ "description",
6394
+ "onAction",
6395
+ "classNames"
6396
+ ]);
6392
6397
  const labels = (0, import_hooks28.useLabels)();
6393
6398
  const hasAction = resolveStateMessageHasAction({ onAction });
6394
6399
  const resolvedIcon = (0, import_react6.cloneElement)(icon, {
@@ -6397,7 +6402,7 @@ var StateMessage = ({
6397
6402
  });
6398
6403
  return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
6399
6404
  "div",
6400
- {
6405
+ __spreadProps(__spreadValues({}, rest), {
6401
6406
  className: cn(
6402
6407
  "agg-state-message",
6403
6408
  "flex min-h-[240px] w-full flex-col items-center justify-center px-5 py-10 text-center md:px-10",
@@ -6456,7 +6461,7 @@ var StateMessage = ({
6456
6461
  ]
6457
6462
  }
6458
6463
  )
6459
- }
6464
+ })
6460
6465
  );
6461
6466
  };
6462
6467
  StateMessage.displayName = "StateMessage";
@@ -7300,7 +7305,7 @@ var normalizeEventListItemV2Comparison = ({
7300
7305
  return __spreadProps(__spreadValues({}, row), {
7301
7306
  prices
7302
7307
  });
7303
- });
7308
+ }).filter((row) => row.prices.length === 0 || row.prices.some((price) => price.price > 0));
7304
7309
  const matchedVenues = collectMatchedVenues(rows);
7305
7310
  return {
7306
7311
  rows,
@@ -7426,8 +7431,7 @@ var EventListItemContent = ({
7426
7431
  categories: event.categories,
7427
7432
  structureType: event.structureType,
7428
7433
  gameStartTime: event.gameStartTime,
7429
- endDate: event.endDate,
7430
- locale: config.general.locale
7434
+ endDate: event.endDate
7431
7435
  });
7432
7436
  const resolvedImage = event.image;
7433
7437
  const visibleVenueLogos = (0, import_react10.useMemo)(() => {
@@ -7454,8 +7458,10 @@ var EventListItemContent = ({
7454
7458
  } = (0, import_hooks31.useVenueMarkets)({
7455
7459
  venueEventId: event.id,
7456
7460
  enabled: shouldEnableLazyMarketLoading && isLazyMarketsQueryEnabled,
7457
- sortBy: "yesPrice",
7458
- sortDir: "desc",
7461
+ // List/tile surface: axis/dates sort by volume so the scroll tail matches
7462
+ // the volume-sorted top-3 (the detail page omits context and keeps the
7463
+ // structured threshold/date order).
7464
+ context: "list",
7459
7465
  status: marketStatus
7460
7466
  });
7461
7467
  const resolvedOutcomeMarkets = (0, import_react10.useMemo)(() => {
@@ -8467,6 +8473,42 @@ var resolveDisplayOutcomeLabels = (labels) => {
8467
8473
  (label2) => labels.some((value) => normalizeLabel2(value) === normalizeLabel2(label2))
8468
8474
  );
8469
8475
  };
8476
+ var TRAILING_LINE_VALUE_PATTERN = /^(.*?)(\s+[+-]?\d+(?:\.\d+)?)$/;
8477
+ var resolveLineOutcomeDisplayParts = (label2, title2) => {
8478
+ var _a, _b;
8479
+ const sourceText = (title2 == null ? void 0 : title2.trim()) || label2.trim();
8480
+ const match = TRAILING_LINE_VALUE_PATTERN.exec(sourceText);
8481
+ if (!match) {
8482
+ return {
8483
+ title: (title2 == null ? void 0 : title2.trim()) || null,
8484
+ lineLabel: null
8485
+ };
8486
+ }
8487
+ const baseTitle = ((_a = match[1]) == null ? void 0 : _a.trim()) || null;
8488
+ const lineLabel = ((_b = match[2]) == null ? void 0 : _b.trim()) || null;
8489
+ return {
8490
+ title: baseTitle,
8491
+ lineLabel
8492
+ };
8493
+ };
8494
+ var formatScopedLineValue = (value) => {
8495
+ return Number.isInteger(value) ? String(value) : value.toFixed(1);
8496
+ };
8497
+ var resolveScopedMarketLineLabel = ({
8498
+ outcomeIndex,
8499
+ scopedMarket
8500
+ }) => {
8501
+ var _a;
8502
+ const lineValue = scopedMarket == null ? void 0 : scopedMarket.lineValue;
8503
+ if (lineValue == null) return null;
8504
+ const sportsMarketType = normalizeLabel2((_a = scopedMarket == null ? void 0 : scopedMarket.sportsMarketType) != null ? _a : "");
8505
+ if (sportsMarketType === "spread") {
8506
+ const directionalLineValue = outcomeIndex === 0 ? lineValue : lineValue * -1;
8507
+ const prefix = directionalLineValue > 0 ? "+" : "";
8508
+ return `${prefix}${formatScopedLineValue(directionalLineValue)}`;
8509
+ }
8510
+ return formatScopedLineValue(lineValue);
8511
+ };
8470
8512
  var resolveMarketDetailsOutcomeLabels = (venueMarkets) => {
8471
8513
  var _a;
8472
8514
  const primaryMarket = selectPrimaryVenueMarket(venueMarkets);
@@ -8519,12 +8561,12 @@ var resolveScopedSelectedOutcome = ({
8519
8561
  outcomeLabel: matchingOutcome.label
8520
8562
  };
8521
8563
  }
8522
- if (suppressFallbackWhenSelectedOutcomeOutOfScope) {
8523
- return {
8524
- outcomeId: null,
8525
- outcomeLabel: void 0
8526
- };
8527
- }
8564
+ }
8565
+ if (suppressFallbackWhenSelectedOutcomeOutOfScope) {
8566
+ return {
8567
+ outcomeId: null,
8568
+ outcomeLabel: void 0
8569
+ };
8528
8570
  }
8529
8571
  const outcomeLabels = resolveDisplayOutcomeLabels(
8530
8572
  resolveMarketDetailsOutcomeLabels(venueMarkets).map((outcome) => outcome.label)
@@ -8562,28 +8604,36 @@ var resolveOutcomeTone = (label2, index) => {
8562
8604
  }
8563
8605
  return index === 0 ? "positive" : "negative";
8564
8606
  };
8565
- var resolveHeaderOutcomeItems = (venueMarkets, scopedMarket) => {
8607
+ var resolveHeaderOutcomeItems = (venueMarkets, scopedMarket, variant) => {
8566
8608
  const outcomes = resolveMarketDetailsOutcomeLabels(venueMarkets);
8567
8609
  const labels = resolveDisplayOutcomeLabels(outcomes.map((outcome) => outcome.label));
8568
8610
  const probabilityByLabel = resolveAverageProbabilityByLabel(venueMarkets, labels);
8569
- return labels.slice(0, 2).map((label2, index) => {
8570
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
8611
+ return labels.map((label2, index) => {
8612
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
8571
8613
  const scopedOutcome = (_a = scopedMarket == null ? void 0 : scopedMarket.venueMarketOutcomes) == null ? void 0 : _a.find(
8572
8614
  (outcome) => normalizeLabel2(outcome.label) === normalizeLabel2(label2)
8573
8615
  );
8574
8616
  const scopedTitle = ((_b = scopedOutcome == null ? void 0 : scopedOutcome.title) == null ? void 0 : _b.trim()) || null;
8575
8617
  const fallbackTitle = (_d = (_c = outcomes.find((outcome) => normalizeLabel2(outcome.label) === normalizeLabel2(label2))) == null ? void 0 : _c.title) != null ? _d : null;
8576
- const title2 = scopedOutcome ? scopedTitle : fallbackTitle;
8618
+ const resolvedTitle = scopedOutcome ? scopedTitle : fallbackTitle;
8619
+ const lineDisplayParts = variant === "line" ? resolveLineOutcomeDisplayParts(label2, resolvedTitle) : { title: resolvedTitle, lineLabel: null };
8620
+ const fallbackLineLabel = variant === "line" ? resolveScopedMarketLineLabel({
8621
+ outcomeIndex: index,
8622
+ scopedMarket
8623
+ }) : null;
8624
+ const sportsMarketType = normalizeLabel2((_e = scopedMarket == null ? void 0 : scopedMarket.sportsMarketType) != null ? _e : "");
8577
8625
  const fallbackOutcomeByVenue = resolveOutcomesByVenue(venueMarkets, label2)[0];
8578
- const outcomeId = (_f = (_e = scopedOutcome == null ? void 0 : scopedOutcome.id) != null ? _e : fallbackOutcomeByVenue == null ? void 0 : fallbackOutcomeByVenue.outcome.id) != null ? _f : "";
8579
- const venue = (_j = (_i = (_g = scopedMarket == null ? void 0 : scopedMarket.venue) != null ? _g : fallbackOutcomeByVenue == null ? void 0 : fallbackOutcomeByVenue.venue) != null ? _i : (_h = venueMarkets[0]) == null ? void 0 : _h.venue) != null ? _j : "polymarket";
8626
+ const outcomeId = (_g = (_f = scopedOutcome == null ? void 0 : scopedOutcome.id) != null ? _f : fallbackOutcomeByVenue == null ? void 0 : fallbackOutcomeByVenue.outcome.id) != null ? _g : "";
8627
+ const venue = (_k = (_j = (_h = scopedMarket == null ? void 0 : scopedMarket.venue) != null ? _h : fallbackOutcomeByVenue == null ? void 0 : fallbackOutcomeByVenue.venue) != null ? _j : (_i = venueMarkets[0]) == null ? void 0 : _i.venue) != null ? _k : "polymarket";
8580
8628
  return {
8581
- title: title2,
8629
+ title: lineDisplayParts.title,
8582
8630
  id: outcomeId,
8583
8631
  venue,
8584
8632
  label: label2,
8633
+ lineLabel: sportsMarketType === "total" ? fallbackLineLabel != null ? fallbackLineLabel : lineDisplayParts.lineLabel : (_l = lineDisplayParts.lineLabel) != null ? _l : fallbackLineLabel,
8585
8634
  probability: probabilityByLabel.get(label2),
8586
- tone: resolveOutcomeTone(label2, index)
8635
+ tone: resolveOutcomeTone(label2, index),
8636
+ variant
8587
8637
  };
8588
8638
  });
8589
8639
  };
@@ -8591,10 +8641,9 @@ var resolveSubtitle = ({
8591
8641
  venueMarkets,
8592
8642
  volume,
8593
8643
  formatCompactCurrency,
8594
- labels,
8595
- tradableVenues
8644
+ labels
8596
8645
  }) => {
8597
- const { venueCount } = getVenueSummary(venueMarkets, { tradableVenues });
8646
+ const { venueCount } = getVenueSummary(venueMarkets);
8598
8647
  const parts = [
8599
8648
  `${venueCount} ${venueCount === 1 ? labels.marketDetails.meta.venueSingular : labels.marketDetails.meta.venuePlural}`
8600
8649
  ];
@@ -8642,8 +8691,7 @@ var buildMarketDetailsModel = ({
8642
8691
  title: title2,
8643
8692
  image,
8644
8693
  formatCompactCurrency,
8645
- labels,
8646
- tradableVenues
8694
+ labels
8647
8695
  }) => {
8648
8696
  var _a, _b, _c, _d;
8649
8697
  const market = resolveMarketFromVenueMarkets(venueMarkets, marketId);
@@ -8658,8 +8706,7 @@ var buildMarketDetailsModel = ({
8658
8706
  venueMarkets: market.venueMarkets,
8659
8707
  volume: resolvedVolume,
8660
8708
  formatCompactCurrency,
8661
- labels,
8662
- tradableVenues
8709
+ labels
8663
8710
  });
8664
8711
  const outcomeLabels = resolveDisplayOutcomeLabels(
8665
8712
  resolveMarketDetailsOutcomeLabels(market.venueMarkets).map((outcome) => outcome.label)
@@ -9752,7 +9799,6 @@ var normalizeSettlementForCompare = (input) => {
9752
9799
  };
9753
9800
  var dedupeSettlementSources = (sources) => {
9754
9801
  const order = ["eventDescription", "marketDescription", "primaryRules"];
9755
- const seen = /* @__PURE__ */ new Set();
9756
9802
  const result = [];
9757
9803
  for (const key of order) {
9758
9804
  const value = sources[key];
@@ -9761,11 +9807,13 @@ var dedupeSettlementSources = (sources) => {
9761
9807
  if (!trimmed) continue;
9762
9808
  const fingerprint = normalizeSettlementForCompare(trimmed);
9763
9809
  if (!fingerprint) continue;
9764
- if (seen.has(fingerprint)) continue;
9765
- seen.add(fingerprint);
9766
- result.push({ key, content: trimmed });
9810
+ if (result.some((block) => block.fingerprint.includes(fingerprint))) continue;
9811
+ for (let i = result.length - 1; i >= 0; i -= 1) {
9812
+ if (fingerprint.includes(result[i].fingerprint)) result.splice(i, 1);
9813
+ }
9814
+ result.push({ key, content: trimmed, fingerprint });
9767
9815
  }
9768
- return result;
9816
+ return result.map(({ key, content }) => ({ key, content }));
9769
9817
  };
9770
9818
 
9771
9819
  // src/trading/settlement/settlement-text-renderer.tsx
@@ -10567,17 +10615,9 @@ var EventListItemDetailsContent = ({
10567
10615
  categories: event.categories,
10568
10616
  structureType: event.structureType,
10569
10617
  gameStartTime: event.gameStartTime,
10570
- endDate: event.endDate,
10571
- locale: config.general.locale
10618
+ endDate: event.endDate
10572
10619
  });
10573
- }, [
10574
- config.general.locale,
10575
- event.categories,
10576
- event.gameStartTime,
10577
- event.endDate,
10578
- event.structureType,
10579
- event.title
10580
- ]);
10620
+ }, [event.categories, event.gameStartTime, event.endDate, event.structureType, event.title]);
10581
10621
  return /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(
10582
10622
  Card,
10583
10623
  {
@@ -10839,8 +10879,8 @@ var EventListItemDetails = (props) => {
10839
10879
  EventListItemDetails.displayName = "EventListItemDetails";
10840
10880
 
10841
10881
  // src/events/market-details/index.tsx
10842
- var import_hooks42 = require("@agg-build/hooks");
10843
- var import_react19 = require("react");
10882
+ var import_hooks43 = require("@agg-build/hooks");
10883
+ var import_react20 = require("react");
10844
10884
 
10845
10885
  // src/events/orderbook/index.tsx
10846
10886
  var import_hooks41 = require("@agg-build/hooks");
@@ -11483,14 +11523,17 @@ var marketDetailsOutcomeButtonToneClasses = {
11483
11523
  };
11484
11524
  var getMarketDetailsOutcomeButtonClassNames = ({
11485
11525
  enableAnimations,
11526
+ enforceFixedWidth,
11486
11527
  isSelected,
11487
- tone
11528
+ tone,
11529
+ variant
11488
11530
  }) => {
11489
11531
  const toneClasses = marketDetailsOutcomeButtonToneClasses[tone];
11532
+ const widthClassName = variant === "line" ? "w-[200px]" : variant === "outcome" ? "w-[160px]" : "w-[140px]";
11490
11533
  return {
11491
11534
  root: cn(
11492
- "w-[140px]",
11493
- "flex h-9 shrink-0 cursor-pointer select-none items-center justify-center gap-2 rounded-agg-full border px-5 py-1.5 text-left shadow-none",
11535
+ enforceFixedWidth ? widthClassName : "w-[140px]",
11536
+ "flex h-9 shrink-0 cursor-pointer select-none items-center justify-center gap-2 rounded-agg-full border px-4 py-1.5 text-left shadow-none",
11494
11537
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-0 focus-visible:ring-offset-agg-secondary",
11495
11538
  "disabled:cursor-not-allowed disabled:opacity-60",
11496
11539
  getMotionClassName(
@@ -11506,6 +11549,7 @@ var getMarketDetailsOutcomeButtonClassNames = ({
11506
11549
  var MarketDetailsOutcomeButton = ({
11507
11550
  ariaControls,
11508
11551
  enableAnimations,
11552
+ enforceFixedWidth,
11509
11553
  isSelected,
11510
11554
  item,
11511
11555
  onSelect
@@ -11513,10 +11557,14 @@ var MarketDetailsOutcomeButton = ({
11513
11557
  var _a;
11514
11558
  const classNames = getMarketDetailsOutcomeButtonClassNames({
11515
11559
  enableAnimations,
11560
+ enforceFixedWidth,
11516
11561
  isSelected,
11517
- tone: item.tone
11562
+ tone: item.tone,
11563
+ variant: item.variant
11518
11564
  });
11519
- return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
11565
+ const itemLabel = (_a = item.title) != null ? _a : item.label;
11566
+ const isLineVariant = item.variant === "line";
11567
+ return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
11520
11568
  "button",
11521
11569
  {
11522
11570
  type: "button",
@@ -11526,46 +11574,380 @@ var MarketDetailsOutcomeButton = ({
11526
11574
  "aria-controls": ariaControls,
11527
11575
  "aria-selected": isSelected,
11528
11576
  tabIndex: isSelected ? 0 : -1,
11529
- className: cn(classNames.root, "flex-1 md:flex-auto", "gap-1!"),
11577
+ className: cn(
11578
+ classNames.root,
11579
+ "overflow-hidden",
11580
+ enforceFixedWidth ? "flex-none" : "flex-1 md:flex-auto"
11581
+ ),
11530
11582
  onClick: () => onSelect(item.label),
11531
- children: [
11583
+ children: isLineVariant ? /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex min-w-0 max-w-full items-center justify-center gap-1.5 overflow-hidden", children: [
11532
11584
  /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(VenueLogo, { venue: item.venue, size: "small" }),
11533
- /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex flex-row items-center gap-1 min-w-0", children: [
11534
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
11535
- Typography,
11536
- {
11537
- as: "span",
11538
- variant: isSelected ? "body-strong" : "body",
11539
- className: cn("whitespace-nowrap truncate", classNames.text),
11540
- children: (_a = item.title) != null ? _a : item.label
11541
- }
11542
- ),
11543
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
11544
- Typography,
11545
- {
11546
- as: "span",
11547
- variant: isSelected ? "body-strong" : "body",
11548
- className: cn(classNames.text),
11549
- children: formatProbabilityCents(item.probability)
11550
- }
11551
- )
11552
- ] })
11553
- ]
11585
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
11586
+ Typography,
11587
+ {
11588
+ as: "span",
11589
+ variant: isSelected ? "body-strong" : "body",
11590
+ className: cn("min-w-0 truncate whitespace-nowrap text-center", classNames.text),
11591
+ children: itemLabel
11592
+ }
11593
+ ),
11594
+ item.lineLabel ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
11595
+ Typography,
11596
+ {
11597
+ as: "span",
11598
+ variant: isSelected ? "body-strong" : "body",
11599
+ className: cn("shrink-0 whitespace-nowrap", classNames.text),
11600
+ children: item.lineLabel
11601
+ }
11602
+ ) : null,
11603
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
11604
+ Typography,
11605
+ {
11606
+ as: "span",
11607
+ variant: isSelected ? "body-strong" : "body",
11608
+ className: cn("shrink-0 whitespace-nowrap", classNames.text),
11609
+ children: formatProbabilityCents(item.probability)
11610
+ }
11611
+ )
11612
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "inline-flex max-w-full items-center justify-center gap-1.5", children: [
11613
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(VenueLogo, { venue: item.venue, size: "small" }),
11614
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
11615
+ Typography,
11616
+ {
11617
+ as: "span",
11618
+ variant: isSelected ? "body-strong" : "body",
11619
+ className: cn("truncate whitespace-nowrap text-center", classNames.text),
11620
+ children: itemLabel
11621
+ }
11622
+ ),
11623
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
11624
+ Typography,
11625
+ {
11626
+ as: "span",
11627
+ variant: isSelected ? "body-strong" : "body",
11628
+ className: cn("shrink-0 whitespace-nowrap", classNames.text),
11629
+ children: formatProbabilityCents(item.probability)
11630
+ }
11631
+ )
11632
+ ] })
11554
11633
  }
11555
11634
  );
11556
11635
  };
11557
11636
  MarketDetailsOutcomeButton.displayName = "MarketDetailsOutcomeButton";
11558
11637
 
11559
- // src/events/market-details/index.tsx
11638
+ // src/events/market-details/market-details-graph-panel.tsx
11639
+ var import_hooks42 = require("@agg-build/hooks");
11640
+ var import_react19 = require("react");
11560
11641
  var import_jsx_runtime129 = require("react/jsx-runtime");
11642
+ var MarketDetailsGraphPanel = ({
11643
+ venueMarkets,
11644
+ selectedOutcomeLabel,
11645
+ selectedOutcomeId,
11646
+ livePrices,
11647
+ wsLivePrices,
11648
+ headerOutcomeItems,
11649
+ isResolvedMarket,
11650
+ isOutcomeSelectionLocked,
11651
+ volume,
11652
+ live,
11653
+ classNames
11654
+ }) => {
11655
+ var _a, _b, _c;
11656
+ const config = (0, import_hooks42.useSdkUiConfig)();
11657
+ const {
11658
+ formatting: { formatPercent, formatCompactCurrency },
11659
+ general: { theme }
11660
+ } = config;
11661
+ const isDarkTheme = theme === "dark";
11662
+ const labels = (0, import_hooks42.useLabels)();
11663
+ const selectedTimeRange = config.chart.selectedChartTimeRange;
11664
+ const setSelectedTimeRange = config.chart.setSelectedChartTimeRange;
11665
+ const [chartRangeOverride, setChartRangeOverride] = (0, import_react19.useState)(null);
11666
+ const effectiveChartTimeRange = isResolvedMarket ? "ALL" : chartRangeOverride != null ? chartRangeOverride : selectedTimeRange;
11667
+ const [selectedChartType, setSelectedChartType] = (0, import_react19.useState)("line");
11668
+ const [selectedGraphVenue, setSelectedGraphVenue] = (0, import_react19.useState)(null);
11669
+ const [chartOutcomeLabel, setChartOutcomeLabel] = (0, import_react19.useState)(selectedOutcomeLabel);
11670
+ const resolvedChartOutcomeLabel = chartOutcomeLabel != null ? chartOutcomeLabel : selectedOutcomeLabel;
11671
+ const chartSelectedOutcomeId = selectedOutcomeId && resolvedChartOutcomeLabel === selectedOutcomeLabel ? selectedOutcomeId : null;
11672
+ const chartOutcomesByVenue = (0, import_react19.useMemo)(() => {
11673
+ return resolveChartVenueOutcomes({
11674
+ eligibleVenueOutcomes: collectEligibleVenueOutcomes({
11675
+ venueMarkets,
11676
+ selectedOutcomeLabel: resolvedChartOutcomeLabel,
11677
+ selectedOutcomeId: chartSelectedOutcomeId
11678
+ }),
11679
+ livePrices
11680
+ });
11681
+ }, [livePrices, venueMarkets, resolvedChartOutcomeLabel, chartSelectedOutcomeId]);
11682
+ const rollingWindow = (0, import_hooks42.useRollingChartWindow)({ range: effectiveChartTimeRange });
11683
+ const chartPrimaryOutcomeId = (_b = (_a = chartOutcomesByVenue[0]) == null ? void 0 : _a.outcome.id) != null ? _b : null;
11684
+ const chartVenueOutcomeIds = (0, import_react19.useMemo)(() => {
11685
+ return chartOutcomesByVenue.map((item) => item.outcome.id);
11686
+ }, [chartOutcomesByVenue]);
11687
+ const {
11688
+ data: marketChartData,
11689
+ isLoading: isMarketChartLoading,
11690
+ error: marketChartError,
11691
+ refetch: refetchMarketChart
11692
+ } = (0, import_hooks42.useMarketChart)({
11693
+ marketId: chartPrimaryOutcomeId,
11694
+ venueMarketIds: chartVenueOutcomeIds,
11695
+ interval: rollingWindow.interval,
11696
+ startTs: rollingWindow.startTs * 1e3,
11697
+ endTs: rollingWindow.endTs * 1e3,
11698
+ // The panel only mounts when the chart is actually visible, so enable as
11699
+ // soon as we have an outcome to chart.
11700
+ enabled: !!chartPrimaryOutcomeId,
11701
+ live,
11702
+ refetchIntervalMs: rollingWindow.refetchIntervalMs,
11703
+ // Stable cache key per user-selected range so tab/page revisits hit cache
11704
+ // instead of refetching on every bucket-boundary rollover.
11705
+ rangeKey: rollingWindow.range
11706
+ });
11707
+ const hasAutoFallenBackRangeRef = (0, import_react19.useRef)(false);
11708
+ (0, import_react19.useEffect)(() => {
11709
+ hasAutoFallenBackRangeRef.current = false;
11710
+ setChartRangeOverride(null);
11711
+ }, [chartPrimaryOutcomeId]);
11712
+ (0, import_react19.useEffect)(() => {
11713
+ if (!shouldAutoFallbackToAllRange({
11714
+ chartData: marketChartData,
11715
+ isLoading: isMarketChartLoading,
11716
+ error: marketChartError,
11717
+ currentRange: effectiveChartTimeRange,
11718
+ hasAlreadyFallenBack: hasAutoFallenBackRangeRef.current,
11719
+ domainStartTs: rollingWindow.startTs
11720
+ })) {
11721
+ return;
11722
+ }
11723
+ hasAutoFallenBackRangeRef.current = true;
11724
+ setChartRangeOverride("ALL");
11725
+ }, [
11726
+ marketChartData,
11727
+ isMarketChartLoading,
11728
+ marketChartError,
11729
+ effectiveChartTimeRange,
11730
+ rollingWindow.startTs
11731
+ ]);
11732
+ const chartAvailableOutcomesByVenue = (0, import_react19.useMemo)(() => {
11733
+ return filterChartVenueOutcomesByRenderableVenues({
11734
+ chartData: marketChartData,
11735
+ venueOutcomes: chartOutcomesByVenue
11736
+ });
11737
+ }, [chartOutcomesByVenue, marketChartData]);
11738
+ const graphSeries = (0, import_react19.useMemo)(() => {
11739
+ var _a2, _b2, _c2, _d;
11740
+ const baseColor = resolveSeriesColor(
11741
+ (_d = (_c2 = selectedGraphVenue != null ? selectedGraphVenue : (_a2 = chartAvailableOutcomesByVenue[0]) == null ? void 0 : _a2.venue) != null ? _c2 : (_b2 = chartOutcomesByVenue[0]) == null ? void 0 : _b2.venue) != null ? _d : "polymarket",
11742
+ 0,
11743
+ isDarkTheme
11744
+ );
11745
+ const domainStartTs = rollingWindow.startTs;
11746
+ return resolveMarketChartDisplaySeries({
11747
+ chartData: marketChartData,
11748
+ selectedVenue: selectedGraphVenue,
11749
+ transformProbability: (value) => value
11750
+ }).map((seriesItem) => {
11751
+ return {
11752
+ id: `${resolvedChartOutcomeLabel != null ? resolvedChartOutcomeLabel : "graph"}-${seriesItem.venue}-${chartPrimaryOutcomeId != null ? chartPrimaryOutcomeId : "chart"}`,
11753
+ venue: selectedGraphVenue != null ? selectedGraphVenue : seriesItem.venue,
11754
+ color: seriesItem.venue === "aggregate" ? baseColor : resolveSeriesColor(seriesItem.venue, 0, isDarkTheme),
11755
+ // Constrain to the rolling [nowSec - rangeSeconds, …] domain so stale
11756
+ // bars don't bleed in across a range shrink or long mount.
11757
+ points: seriesItem.points.filter((point) => point.time >= domainStartTs)
11758
+ };
11759
+ });
11760
+ }, [
11761
+ isDarkTheme,
11762
+ chartPrimaryOutcomeId,
11763
+ marketChartData,
11764
+ rollingWindow.startTs,
11765
+ selectedGraphVenue,
11766
+ resolvedChartOutcomeLabel,
11767
+ chartAvailableOutcomesByVenue,
11768
+ chartOutcomesByVenue
11769
+ ]);
11770
+ const graphLiveState = (0, import_react19.useMemo)(() => {
11771
+ return resolveMarketChartLiveState({
11772
+ chartData: marketChartData,
11773
+ selectedVenue: selectedGraphVenue,
11774
+ transformProbability: (value) => value
11775
+ });
11776
+ }, [marketChartData, selectedGraphVenue]);
11777
+ const hasChartError = !!marketChartError;
11778
+ (0, import_react19.useEffect)(() => {
11779
+ if (!selectedGraphVenue) {
11780
+ return;
11781
+ }
11782
+ if (chartAvailableOutcomesByVenue.some((item) => item.venue === selectedGraphVenue)) {
11783
+ return;
11784
+ }
11785
+ setSelectedGraphVenue(null);
11786
+ }, [selectedGraphVenue, chartAvailableOutcomesByVenue]);
11787
+ const handleGraphVenueToggle = (venue) => {
11788
+ setSelectedGraphVenue((currentVenue) => {
11789
+ if (currentVenue === venue) return null;
11790
+ return venue;
11791
+ });
11792
+ };
11793
+ const handleRetryMarketChart = () => {
11794
+ void refetchMarketChart();
11795
+ };
11796
+ return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: cn("agg-price-chart flex flex-col gap-5 p-5", classNames == null ? void 0 : classNames.graph), children: [
11797
+ hasChartError ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
11798
+ StateMessage,
11799
+ {
11800
+ title: labels.marketDetails.chartUnavailableTitle,
11801
+ description: labels.marketDetails.chartUnavailableDescription,
11802
+ icon: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(WarningIcon, {}),
11803
+ onAction: handleRetryMarketChart,
11804
+ classNames: { root: "min-h-[248px] px-5 py-10 md:min-h-[272px]" }
11805
+ }
11806
+ ) : /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
11807
+ LineChart,
11808
+ {
11809
+ series: graphSeries,
11810
+ height: 260,
11811
+ isLoading: isMarketChartLoading,
11812
+ chartType: selectedChartType,
11813
+ liveCandle: selectedChartType === "candlestick" ? (_c = graphLiveState.liveCandle) != null ? _c : void 0 : void 0,
11814
+ lineValue: graphLiveState.lineValue,
11815
+ classNames: { root: "agg-chart-region w-full" },
11816
+ showSeriesControls: chartAvailableOutcomesByVenue.length > 0 || headerOutcomeItems.length > 0,
11817
+ renderSeriesControls: () => {
11818
+ var _a2, _b2, _c2, _d;
11819
+ return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "agg-chart-toolbar w-full flex flex-col gap-4 md:flex-row md:items-center md:justify-between", children: [
11820
+ /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "agg-market-venues flex flex-wrap gap-2", children: chartAvailableOutcomesByVenue.map((item) => {
11821
+ var _a3;
11822
+ const probability = formatProbabilityPercent(
11823
+ (_a3 = wsLivePrices.get(item.outcome.id)) != null ? _a3 : item.outcome.price,
11824
+ formatPercent
11825
+ );
11826
+ const isActiveVenue = selectedGraphVenue === item.venue;
11827
+ return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
11828
+ "button",
11829
+ {
11830
+ type: "button",
11831
+ "aria-label": `${item.venue} ${probability}`,
11832
+ "aria-pressed": isActiveVenue,
11833
+ className: cn(
11834
+ "agg-market-venue",
11835
+ "cursor-pointer",
11836
+ "inline-flex items-center gap-2 rounded-agg-full border px-4 py-2",
11837
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-0 focus-visible:ring-offset-agg-secondary-hover",
11838
+ isActiveVenue ? "border-agg-primary bg-agg-secondary" : "border-transparent bg-agg-secondary-hover"
11839
+ ),
11840
+ onClick: (e) => {
11841
+ e.preventDefault();
11842
+ e.stopPropagation();
11843
+ handleGraphVenueToggle(item.venue);
11844
+ },
11845
+ children: [
11846
+ /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(VenueLogo, { venue: item.venue, size: "small" }),
11847
+ /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: probability })
11848
+ ]
11849
+ },
11850
+ `${item.market.id}-${item.outcome.id}`
11851
+ );
11852
+ }) }),
11853
+ !isOutcomeSelectionLocked ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
11854
+ SwitchButton,
11855
+ {
11856
+ ariaLabel: labels.marketDetails.outcomeSelectorAria,
11857
+ className: "agg-outcome-switch w-full shrink-0 md:w-fit",
11858
+ value: (_d = (_c2 = (_a2 = headerOutcomeItems.find(
11859
+ (outcome) => outcome.label === resolvedChartOutcomeLabel
11860
+ )) == null ? void 0 : _a2.id) != null ? _c2 : (_b2 = headerOutcomeItems[0]) == null ? void 0 : _b2.id) != null ? _d : "",
11861
+ onValueChange: (outcomeId) => {
11862
+ const outcome = headerOutcomeItems.find(
11863
+ (headerOutcomeItem) => headerOutcomeItem.id === outcomeId
11864
+ );
11865
+ if (!outcome) return;
11866
+ setChartOutcomeLabel(outcome.label);
11867
+ },
11868
+ options: headerOutcomeItems.map((outcome) => {
11869
+ var _a3, _b3;
11870
+ const price = outcome.probability;
11871
+ return {
11872
+ value: outcome.id,
11873
+ label: `${(_a3 = outcome == null ? void 0 : outcome.title) != null ? _a3 : outcome.label} ${formatProbabilityCents(price)}`,
11874
+ ariaLabel: `${(_b3 = outcome == null ? void 0 : outcome.title) != null ? _b3 : outcome.label} ${formatProbabilityCents(price)}`
11875
+ };
11876
+ })
11877
+ }
11878
+ ) : null
11879
+ ] });
11880
+ }
11881
+ }
11882
+ ),
11883
+ /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
11884
+ "div",
11885
+ {
11886
+ className: cn(
11887
+ "agg-chart-footer",
11888
+ "flex flex-row justify-between gap-2 text-agg-sm leading-agg-5 text-agg-muted-foreground md:flex-row md:items-center md:justify-between",
11889
+ classNames == null ? void 0 : classNames.footer
11890
+ ),
11891
+ children: [
11892
+ /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { children: typeof volume !== "number" ? labels.marketDetails.volumeUnavailable : volume > 0 ? `${formatCompactCurrency(volume)} ${labels.marketDetails.meta.volumeSuffix}` : "" }),
11893
+ /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-wrap items-center gap-3 md:gap-4", children: [
11894
+ /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
11895
+ ChartTypeSwitch,
11896
+ {
11897
+ className: "agg-chart-type-switch shrink-0",
11898
+ value: selectedChartType,
11899
+ onValueChange: setSelectedChartType
11900
+ }
11901
+ ),
11902
+ /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { "aria-hidden": "true", className: "hidden h-4 w-px bg-agg-separator md:block" }),
11903
+ import_hooks42.CHART_TIME_RANGES.map((timeRange) => {
11904
+ const isActive = effectiveChartTimeRange === timeRange;
11905
+ const isDisabled = isResolvedMarket && timeRange !== "ALL";
11906
+ return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
11907
+ "button",
11908
+ {
11909
+ type: "button",
11910
+ disabled: isDisabled,
11911
+ className: cn(
11912
+ "agg-chart-time-range-trigger",
11913
+ "cursor-pointer text-agg-sm leading-agg-5",
11914
+ isDisabled && "cursor-not-allowed opacity-50",
11915
+ isActive ? "font-agg-bold text-agg-foreground" : "font-agg-normal text-agg-muted-foreground"
11916
+ ),
11917
+ "aria-pressed": isActive,
11918
+ "aria-disabled": isDisabled,
11919
+ onClick: (e) => {
11920
+ e.preventDefault();
11921
+ e.stopPropagation();
11922
+ if (isDisabled) return;
11923
+ setChartRangeOverride(null);
11924
+ setSelectedTimeRange(timeRange);
11925
+ },
11926
+ children: timeRange === "ALL" ? labels.eventItemDetails.allTimeRange : timeRange
11927
+ },
11928
+ timeRange
11929
+ );
11930
+ })
11931
+ ] })
11932
+ ]
11933
+ }
11934
+ )
11935
+ ] });
11936
+ };
11937
+ MarketDetailsGraphPanel.displayName = "MarketDetailsGraphPanel";
11938
+
11939
+ // src/events/market-details/index.tsx
11940
+ var import_jsx_runtime130 = require("react/jsx-runtime");
11561
11941
  var MarketDetailsUnavailableState = ({
11942
+ marketId,
11562
11943
  ariaLabel,
11563
11944
  classNames
11564
11945
  }) => {
11565
- const labels = (0, import_hooks42.useLabels)();
11566
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
11946
+ const labels = (0, import_hooks43.useLabels)();
11947
+ return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
11567
11948
  Card,
11568
11949
  {
11950
+ "data-market-id": marketId || void 0,
11569
11951
  className: cn(
11570
11952
  "group/agg-market-card agg-market-card-unavailable",
11571
11953
  marketDetailsBaseCardClassName,
@@ -11573,24 +11955,26 @@ var MarketDetailsUnavailableState = ({
11573
11955
  ),
11574
11956
  role: "status",
11575
11957
  "aria-label": ariaLabel != null ? ariaLabel : labels.marketDetails.unavailableAria,
11576
- children: /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col gap-1 p-5", children: [
11577
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Typography, { variant: "body-large-strong", children: labels.marketDetails.unavailableTitle }),
11578
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: labels.marketDetails.unavailableDescription })
11958
+ children: /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex flex-col gap-1 p-5", children: [
11959
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Typography, { variant: "body-large-strong", children: labels.marketDetails.unavailableTitle }),
11960
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: labels.marketDetails.unavailableDescription })
11579
11961
  ] })
11580
11962
  }
11581
11963
  );
11582
11964
  };
11583
11965
  var MarketDetailsNotFoundState = ({
11966
+ marketId,
11584
11967
  ariaLabel: _ariaLabel,
11585
11968
  classNames: _classNames
11586
11969
  }) => {
11587
- const labels = (0, import_hooks42.useLabels)();
11588
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
11970
+ const labels = (0, import_hooks43.useLabels)();
11971
+ return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
11589
11972
  StateMessage,
11590
11973
  {
11974
+ "data-market-id": marketId || void 0,
11591
11975
  title: labels.marketDetails.notFoundTitle,
11592
11976
  description: labels.marketDetails.notFoundDescription,
11593
- icon: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(SearchEmptyIcon, {}),
11977
+ icon: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(SearchEmptyIcon, {}),
11594
11978
  classNames: { root: "min-h-[280px] md:min-h-[320px]" }
11595
11979
  }
11596
11980
  );
@@ -11608,6 +11992,11 @@ var MarketDetailsContent = ({
11608
11992
  ariaLabel,
11609
11993
  classNames,
11610
11994
  otherContent,
11995
+ headerAccessory,
11996
+ compactHeader = false,
11997
+ subtitleOverride,
11998
+ headerOutcomeVariant,
11999
+ headerOutcomeItemsOverride,
11611
12000
  onOutcomeSelect,
11612
12001
  live,
11613
12002
  midpointsFallback,
@@ -11615,31 +12004,30 @@ var MarketDetailsContent = ({
11615
12004
  suppressOutcomeFallbackSelection,
11616
12005
  midpointsResult
11617
12006
  }) => {
11618
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
11619
- const config = (0, import_hooks42.useSdkUiConfig)();
12007
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
12008
+ const config = (0, import_hooks43.useSdkUiConfig)();
11620
12009
  const {
11621
12010
  features: { enableAnimations },
11622
- formatting: { formatPercent },
11623
- general: { theme }
12011
+ formatting: { formatPercent }
11624
12012
  } = config;
11625
- const isDarkTheme = theme === "dark";
11626
- const labels = (0, import_hooks42.useLabels)();
11627
- const tradingContext = (0, import_hooks42.useEventTradingContext)();
11628
- const detailsContentId = (0, import_react19.useId)();
12013
+ const labels = (0, import_hooks43.useLabels)();
12014
+ const tradingContext = (0, import_hooks43.useEventTradingContext)();
12015
+ const detailsContentId = (0, import_react20.useId)();
11629
12016
  const tradeSide = (_a = tradingContext == null ? void 0 : tradingContext.tradeSide) != null ? _a : "buy";
11630
- const wsLivePrices = (0, import_hooks42.useLiveOutcomePrices)(venueMarkets);
11631
- const wsBestPrices = (0, import_hooks42.useLiveBestPrices)(venueMarkets);
11632
- const wsBestCandidates = (0, import_hooks42.useLiveBestPriceCandidates)(venueMarkets);
11633
- const resolvedMarket = (0, import_react19.useMemo)(() => {
12017
+ const resolvedMarket = (0, import_react20.useMemo)(() => {
11634
12018
  return resolveMarketFromVenueMarkets(venueMarkets, marketId);
11635
12019
  }, [venueMarkets, marketId]);
11636
- const scopedResolvedMarket = (0, import_react19.useMemo)(() => {
12020
+ const clusterVenueMarkets = resolvedMarket == null ? void 0 : resolvedMarket.venueMarkets;
12021
+ const wsLivePrices = (0, import_hooks43.useLiveOutcomePrices)(clusterVenueMarkets);
12022
+ const wsBestPrices = (0, import_hooks43.useLiveBestPrices)(clusterVenueMarkets);
12023
+ const wsBestCandidates = (0, import_hooks43.useLiveBestPriceCandidates)(clusterVenueMarkets);
12024
+ const scopedResolvedMarket = (0, import_react20.useMemo)(() => {
11637
12025
  var _a2, _b2;
11638
12026
  if (!resolvedMarket) return null;
11639
12027
  return (_b2 = (_a2 = resolvedMarket.venueMarkets.find((venueMarket) => venueMarket.id === resolvedMarket.id)) != null ? _a2 : resolvedMarket.venueMarkets[0]) != null ? _b2 : null;
11640
12028
  }, [resolvedMarket]);
11641
- const isResolvedMarket = (0, import_hooks42.resolveMarketTradingState)(scopedResolvedMarket).kind === "resolved";
11642
- (0, import_hooks42.useEventOrderbookData)(
12029
+ const isResolvedMarket = (0, import_hooks43.resolveMarketTradingState)(scopedResolvedMarket).kind === "resolved";
12030
+ (0, import_hooks43.useEventOrderbookData)(
11643
12031
  isResolvedMarket ? [] : resolvedMarket == null ? void 0 : resolvedMarket.venueMarkets,
11644
12032
  (_b = scopedResolvedMarket == null ? void 0 : scopedResolvedMarket.id) != null ? _b : null
11645
12033
  );
@@ -11659,20 +12047,19 @@ var MarketDetailsContent = ({
11659
12047
  const clusterBestMidpoint = clusterMidpointResult.bestMidpoint;
11660
12048
  const clusterBestMidpointVenue = clusterMidpointResult.bestMidpointVenue;
11661
12049
  const clusterBestPricesRest = clusterMidpointResult.bestPrices;
11662
- const clusterBestPrices = (0, import_react19.useMemo)(
11663
- () => (0, import_hooks42.mergeBestPricesPreferringLive)(clusterBestPricesRest, wsBestPrices),
12050
+ const clusterBestPrices = (0, import_react20.useMemo)(
12051
+ () => (0, import_hooks43.mergeBestPricesPreferringLive)(clusterBestPricesRest, wsBestPrices),
11664
12052
  [clusterBestPricesRest, wsBestPrices]
11665
12053
  );
11666
12054
  const clusterBestPriceVenuesByOutcomeId = clusterMidpointResult.bestPriceVenuesByOutcomeId;
11667
- const clusterMidpointMarkets = (0, import_react19.useMemo)(() => {
12055
+ const clusterMidpointMarkets = (0, import_react20.useMemo)(() => {
11668
12056
  var _a2;
11669
12057
  if (!resolvedMarket) return [];
11670
12058
  return (_a2 = resolvedMarket.venueMarkets) != null ? _a2 : [];
11671
12059
  }, [resolvedMarket]);
11672
- const tradableVenues = (0, import_react19.useMemo)(() => {
12060
+ const tradableVenues = (0, import_react20.useMemo)(() => {
11673
12061
  var _a2;
11674
12062
  if (clusterMidpointMarkets.length === 0) return null;
11675
- if (clusterMidpoints.size === 0) return null;
11676
12063
  const set = /* @__PURE__ */ new Set();
11677
12064
  for (const market of clusterMidpointMarkets) {
11678
12065
  for (const outcome of (_a2 = market.venueMarketOutcomes) != null ? _a2 : []) {
@@ -11682,28 +12069,20 @@ var MarketDetailsContent = ({
11682
12069
  }
11683
12070
  }
11684
12071
  }
12072
+ if (set.size === 0) return null;
11685
12073
  return set;
11686
12074
  }, [clusterMidpointMarkets, clusterMidpoints]);
11687
- const model = (0, import_react19.useMemo)(() => {
12075
+ const model = (0, import_react20.useMemo)(() => {
11688
12076
  return buildMarketDetailsModel({
11689
12077
  venueMarkets,
11690
12078
  marketId,
11691
12079
  title: title2,
11692
12080
  image,
11693
12081
  formatCompactCurrency: config.formatting.formatCompactCurrency,
11694
- labels,
11695
- tradableVenues
12082
+ labels
11696
12083
  });
11697
- }, [
11698
- config.formatting.formatCompactCurrency,
11699
- venueMarkets,
11700
- image,
11701
- labels,
11702
- marketId,
11703
- title2,
11704
- tradableVenues
11705
- ]);
11706
- const livePrices = (0, import_react19.useMemo)(() => {
12084
+ }, [config.formatting.formatCompactCurrency, venueMarkets, image, labels, marketId, title2]);
12085
+ const livePrices = (0, import_react20.useMemo)(() => {
11707
12086
  const merged = /* @__PURE__ */ new Map();
11708
12087
  if (midpointsFallback == null ? void 0 : midpointsFallback.size) {
11709
12088
  for (const [outcomeId, price] of midpointsFallback) {
@@ -11718,37 +12097,32 @@ var MarketDetailsContent = ({
11718
12097
  for (const [k, v] of wsLivePrices) merged.set(k, v);
11719
12098
  return merged;
11720
12099
  }, [clusterMidpoints, midpointsFallback, wsLivePrices]);
11721
- const scopedMarketForCard = (0, import_react19.useMemo)(() => {
12100
+ const scopedMarketForCard = (0, import_react20.useMemo)(() => {
11722
12101
  var _a2;
11723
12102
  if (!model) return null;
11724
12103
  return (_a2 = model.market.venueMarkets.find((venueMarket) => venueMarket.id === model.market.id)) != null ? _a2 : model.primaryVenueMarket;
11725
12104
  }, [model]);
11726
- const marketTradingState = (0, import_react19.useMemo)(() => {
11727
- return (0, import_hooks42.resolveMarketTradingState)(scopedMarketForCard);
12105
+ const marketTradingState = (0, import_react20.useMemo)(() => {
12106
+ return (0, import_hooks43.resolveMarketTradingState)(scopedMarketForCard);
11728
12107
  }, [scopedMarketForCard]);
11729
12108
  const isOutcomeSelectionLocked = marketTradingState.isTradingDisabled;
11730
12109
  const isUpcomingMarket = marketTradingState.kind === "unopened";
11731
12110
  const marketStatePresentation = resolveTradingStatePresentation(labels, marketTradingState);
11732
- const marketDetailsTabs = (0, import_react19.useMemo)(() => {
12111
+ const marketDetailsTabs = (0, import_react20.useMemo)(() => {
11733
12112
  return getMarketDetailsTabs(labels);
11734
12113
  }, [labels]);
11735
- const [selectedTab, setSelectedTab] = (0, import_react19.useState)(
12114
+ const [selectedTab, setSelectedTab] = (0, import_react20.useState)(
11736
12115
  () => resolveInitialTab(defaultTab)
11737
12116
  );
11738
- const [isOpened, setIsOpened] = (0, import_react19.useState)(controlledIsOpened);
11739
- (0, import_react19.useEffect)(() => {
12117
+ const [isOpened, setIsOpened] = (0, import_react20.useState)(controlledIsOpened);
12118
+ (0, import_react20.useEffect)(() => {
11740
12119
  setSelectedTab(resolveInitialTab(defaultTab));
11741
12120
  }, [defaultTab]);
11742
- (0, import_react19.useEffect)(() => {
12121
+ (0, import_react20.useEffect)(() => {
11743
12122
  setIsOpened(controlledIsOpened);
11744
12123
  }, [controlledIsOpened]);
11745
- const selectedTimeRange = config.chart.selectedChartTimeRange;
11746
- const setSelectedTimeRange = config.chart.setSelectedChartTimeRange;
11747
12124
  const effectiveSelectedTab = isResolvedMarket ? "graph" : selectedTab;
11748
- const [chartRangeOverride, setChartRangeOverride] = (0, import_react19.useState)(null);
11749
- const effectiveChartTimeRange = isResolvedMarket ? "ALL" : chartRangeOverride != null ? chartRangeOverride : selectedTimeRange;
11750
- const [selectedChartType, setSelectedChartType] = (0, import_react19.useState)("line");
11751
- const scopedSelectedOutcomeState = (0, import_react19.useMemo)(() => {
12125
+ const scopedSelectedOutcomeState = (0, import_react20.useMemo)(() => {
11752
12126
  if (!model) {
11753
12127
  return {
11754
12128
  outcomeId: null,
@@ -11770,15 +12144,7 @@ var MarketDetailsContent = ({
11770
12144
  const selectedOutcomeId = scopedSelectedOutcomeState.outcomeId;
11771
12145
  const selectedOutcomeLabel = (_d = scopedSelectedOutcomeState.outcomeLabel) != null ? _d : null;
11772
12146
  const selectOutcome = tradingContext == null ? void 0 : tradingContext.selectOutcome;
11773
- const [selectedGraphVenue, setSelectedGraphVenue] = (0, import_react19.useState)(null);
11774
- const [chartOutcomeLabel, setChartOutcomeLabel] = (0, import_react19.useState)(selectedOutcomeLabel);
11775
- (0, import_react19.useEffect)(() => {
11776
- if (!isOpened) return;
11777
- if (selectedOutcomeLabel) {
11778
- setChartOutcomeLabel(selectedOutcomeLabel);
11779
- }
11780
- }, [isOpened]);
11781
- (0, import_react19.useEffect)(() => {
12147
+ (0, import_react20.useEffect)(() => {
11782
12148
  var _a2;
11783
12149
  if (!isOpened || !model) return;
11784
12150
  if (isOutcomeSelectionLocked) return;
@@ -11802,13 +12168,18 @@ var MarketDetailsContent = ({
11802
12168
  tradingContext == null ? void 0 : tradingContext.selectedMarketId,
11803
12169
  selectOutcome
11804
12170
  ]);
11805
- const venueMarketIdByVenue = (0, import_react19.useMemo)(
12171
+ const venueMarketIdByVenue = (0, import_react20.useMemo)(
11806
12172
  () => buildVenueMarketIdByVenue(model == null ? void 0 : model.market.venueMarkets),
11807
12173
  [model]
11808
12174
  );
11809
- const headerOutcomeItems = (0, import_react19.useMemo)(() => {
12175
+ const headerOutcomeItems = (0, import_react20.useMemo)(() => {
11810
12176
  if (!model) return [];
11811
- const items = resolveHeaderOutcomeItems(model.market.venueMarkets, scopedMarketForCard);
12177
+ if (headerOutcomeItemsOverride) return headerOutcomeItemsOverride;
12178
+ const items = resolveHeaderOutcomeItems(
12179
+ model.market.venueMarkets,
12180
+ scopedMarketForCard,
12181
+ headerOutcomeVariant
12182
+ );
11812
12183
  return items.map((item) => {
11813
12184
  var _a2;
11814
12185
  const fallbackPrice = midpointsFallback == null ? void 0 : midpointsFallback.get(item.id);
@@ -11848,8 +12219,10 @@ var MarketDetailsContent = ({
11848
12219
  clusterBestMidpointsByOutcomeId,
11849
12220
  clusterBestPricesRest,
11850
12221
  clusterBestPriceVenuesByOutcomeId,
12222
+ headerOutcomeItemsOverride,
11851
12223
  model,
11852
12224
  scopedMarketForCard,
12225
+ headerOutcomeVariant,
11853
12226
  clusterVenueByOutcomeId,
11854
12227
  isResolvedMarket,
11855
12228
  (_e = marketTradingState.winningOutcome) == null ? void 0 : _e.id,
@@ -11859,7 +12232,7 @@ var MarketDetailsContent = ({
11859
12232
  venueMarketIdByVenue,
11860
12233
  wsBestCandidates
11861
12234
  ]);
11862
- const headlineProbability = (0, import_react19.useMemo)(() => {
12235
+ const headlineProbability = (0, import_react20.useMemo)(() => {
11863
12236
  var _a2, _b2, _c2, _d2;
11864
12237
  if (!model || !scopedMarketForCard) return void 0;
11865
12238
  if (isResolvedMarket) {
@@ -11884,7 +12257,7 @@ var MarketDetailsContent = ({
11884
12257
  fallbackPrice: (_c2 = midpointsFallback == null ? void 0 : midpointsFallback.get(displayOutcome.id)) != null ? _c2 : displayOutcome.price
11885
12258
  });
11886
12259
  if (referencePrice != null) return referencePrice;
11887
- return (_d2 = (0, import_hooks42.findLivePriceById)(wsLivePrices, displayOutcome.id)) != null ? _d2 : displayOutcome.price;
12260
+ return (_d2 = (0, import_hooks43.findLivePriceById)(wsLivePrices, displayOutcome.id)) != null ? _d2 : displayOutcome.price;
11888
12261
  }, [
11889
12262
  clusterBestMidpoint,
11890
12263
  clusterBestMidpointsByOutcomeId,
@@ -11895,7 +12268,7 @@ var MarketDetailsContent = ({
11895
12268
  midpointsFallback,
11896
12269
  wsLivePrices
11897
12270
  ]);
11898
- const selectedOutcomesByVenue = (0, import_react19.useMemo)(() => {
12271
+ const selectedOutcomesByVenue = (0, import_react20.useMemo)(() => {
11899
12272
  if (!model) return [];
11900
12273
  return collectEligibleVenueOutcomes({
11901
12274
  venueMarkets: model.market.venueMarkets,
@@ -11907,74 +12280,10 @@ var MarketDetailsContent = ({
11907
12280
  selectedOutcomeId
11908
12281
  });
11909
12282
  }, [model, selectedOutcomeLabel, selectedOutcomeId]);
11910
- const resolvedChartOutcomeLabel = chartOutcomeLabel != null ? chartOutcomeLabel : selectedOutcomeLabel;
11911
- const chartSelectedOutcomeId = selectedOutcomeId && resolvedChartOutcomeLabel === selectedOutcomeLabel ? selectedOutcomeId : null;
11912
- const chartOutcomesByVenue = (0, import_react19.useMemo)(() => {
11913
- if (!model) return [];
11914
- return resolveChartVenueOutcomes({
11915
- eligibleVenueOutcomes: collectEligibleVenueOutcomes({
11916
- venueMarkets: model.market.venueMarkets,
11917
- selectedOutcomeLabel: resolvedChartOutcomeLabel,
11918
- selectedOutcomeId: chartSelectedOutcomeId
11919
- }),
11920
- livePrices
11921
- });
11922
- }, [livePrices, model, resolvedChartOutcomeLabel, chartSelectedOutcomeId]);
11923
- const chartEnabled = isOpened && effectiveSelectedTab === "graph";
11924
12283
  const orderBookEnabled = isOpened && effectiveSelectedTab === "order-book" && !marketTradingState.isTradingDisabled;
11925
- const rollingWindow = (0, import_hooks42.useRollingChartWindow)({ range: effectiveChartTimeRange });
11926
12284
  const primaryVenueMarketId = (_g = (_f = selectedOutcomesByVenue[0]) == null ? void 0 : _f.market.id) != null ? _g : null;
11927
12285
  const primaryOutcomeId = (_i = (_h = selectedOutcomesByVenue[0]) == null ? void 0 : _h.outcome.id) != null ? _i : null;
11928
- const chartPrimaryOutcomeId = (_k = (_j = chartOutcomesByVenue[0]) == null ? void 0 : _j.outcome.id) != null ? _k : null;
11929
- const chartVenueOutcomeIds = (0, import_react19.useMemo)(() => {
11930
- return chartOutcomesByVenue.map((item) => item.outcome.id);
11931
- }, [chartOutcomesByVenue]);
11932
- const {
11933
- data: marketChartData,
11934
- isLoading: isMarketChartLoading,
11935
- error: marketChartError,
11936
- refetch: refetchMarketChart
11937
- } = (0, import_hooks42.useMarketChart)({
11938
- marketId: chartPrimaryOutcomeId,
11939
- venueMarketIds: chartVenueOutcomeIds,
11940
- interval: rollingWindow.interval,
11941
- startTs: rollingWindow.startTs * 1e3,
11942
- endTs: rollingWindow.endTs * 1e3,
11943
- enabled: chartEnabled && !!chartPrimaryOutcomeId,
11944
- live,
11945
- refetchIntervalMs: rollingWindow.refetchIntervalMs,
11946
- // Stable cache key per user-selected range so tab/page revisits hit cache
11947
- // instead of refetching on every bucket-boundary rollover.
11948
- rangeKey: rollingWindow.range
11949
- });
11950
- const hasAutoFallenBackRangeRef = (0, import_react19.useRef)(false);
11951
- (0, import_react19.useEffect)(() => {
11952
- hasAutoFallenBackRangeRef.current = false;
11953
- setChartRangeOverride(null);
11954
- }, [chartPrimaryOutcomeId]);
11955
- (0, import_react19.useEffect)(() => {
11956
- if (!shouldAutoFallbackToAllRange({
11957
- chartData: marketChartData,
11958
- isLoading: isMarketChartLoading,
11959
- error: marketChartError,
11960
- currentRange: effectiveChartTimeRange,
11961
- hasAlreadyFallenBack: hasAutoFallenBackRangeRef.current,
11962
- // Ignore stale bars outside the rolling window — see comment on the
11963
- // matching effect in event-list-item-details.
11964
- domainStartTs: rollingWindow.startTs
11965
- })) {
11966
- return;
11967
- }
11968
- hasAutoFallenBackRangeRef.current = true;
11969
- setChartRangeOverride("ALL");
11970
- }, [
11971
- marketChartData,
11972
- isMarketChartLoading,
11973
- marketChartError,
11974
- effectiveChartTimeRange,
11975
- rollingWindow.startTs
11976
- ]);
11977
- const marketOrderbookResult = (0, import_hooks42.useMarketOrderbook)({
12286
+ const marketOrderbookResult = (0, import_hooks43.useMarketOrderbook)({
11978
12287
  marketId: primaryVenueMarketId,
11979
12288
  enabled: orderBookEnabled && !!primaryVenueMarketId,
11980
12289
  venueOutcomes: selectedOutcomesByVenue.map((item) => ({
@@ -11983,14 +12292,14 @@ var MarketDetailsContent = ({
11983
12292
  })),
11984
12293
  live
11985
12294
  });
11986
- const marketOrderbookDataById = (0, import_react19.useMemo)(() => {
12295
+ const marketOrderbookDataById = (0, import_react20.useMemo)(() => {
11987
12296
  var _a2;
11988
12297
  return (_a2 = marketOrderbookResult.dataById) != null ? _a2 : {};
11989
12298
  }, [marketOrderbookResult]);
11990
12299
  const isOrderBookLoading = marketOrderbookResult.isLoading;
11991
12300
  const orderBookError = marketOrderbookResult.error;
11992
12301
  const refetchOrderBook = marketOrderbookResult.refetch;
11993
- const aggregatedOrderbookRows = (0, import_react19.useMemo)(() => {
12302
+ const aggregatedOrderbookRows = (0, import_react20.useMemo)(() => {
11994
12303
  return mergeVenueOutcomeOrderbooks({
11995
12304
  eligibleOutcomes: selectedOutcomesByVenue,
11996
12305
  orderbooksByOutcomeId: marketOrderbookDataById
@@ -11998,7 +12307,7 @@ var MarketDetailsContent = ({
11998
12307
  }, [marketOrderbookDataById, selectedOutcomesByVenue]);
11999
12308
  const askRows = aggregatedOrderbookRows.askRows;
12000
12309
  const bidRows = aggregatedOrderbookRows.bidRows;
12001
- const unifiedEntries = (0, import_react19.useMemo)(() => {
12310
+ const unifiedEntries = (0, import_react20.useMemo)(() => {
12002
12311
  return resolveUnifiedOrderBookEntries({
12003
12312
  askRows,
12004
12313
  bidRows,
@@ -12006,7 +12315,7 @@ var MarketDetailsContent = ({
12006
12315
  spread: aggregatedOrderbookRows.spread
12007
12316
  });
12008
12317
  }, [aggregatedOrderbookRows.midpoint, aggregatedOrderbookRows.spread, askRows, bidRows]);
12009
- const orderbookSnapshotKey = (0, import_react19.useMemo)(() => {
12318
+ const orderbookSnapshotKey = (0, import_react20.useMemo)(() => {
12010
12319
  if (selectedOutcomesByVenue.length === 0) return null;
12011
12320
  return selectedOutcomesByVenue.map((item) => {
12012
12321
  var _a2, _b2;
@@ -12014,52 +12323,7 @@ var MarketDetailsContent = ({
12014
12323
  return `${item.outcomeId}:${snapshotVersion}`;
12015
12324
  }).join("|");
12016
12325
  }, [marketOrderbookDataById, selectedOutcomesByVenue]);
12017
- const chartAvailableOutcomesByVenue = (0, import_react19.useMemo)(() => {
12018
- return filterChartVenueOutcomesByRenderableVenues({
12019
- chartData: marketChartData,
12020
- venueOutcomes: chartOutcomesByVenue
12021
- });
12022
- }, [chartOutcomesByVenue, marketChartData]);
12023
- const graphSeries = (0, import_react19.useMemo)(() => {
12024
- var _a2, _b2, _c2, _d2;
12025
- const baseColor = resolveSeriesColor(
12026
- (_d2 = (_c2 = selectedGraphVenue != null ? selectedGraphVenue : (_a2 = chartAvailableOutcomesByVenue[0]) == null ? void 0 : _a2.venue) != null ? _c2 : (_b2 = chartOutcomesByVenue[0]) == null ? void 0 : _b2.venue) != null ? _d2 : "polymarket",
12027
- 0,
12028
- isDarkTheme
12029
- );
12030
- const domainStartTs = rollingWindow.startTs;
12031
- return resolveMarketChartDisplaySeries({
12032
- chartData: marketChartData,
12033
- selectedVenue: selectedGraphVenue,
12034
- transformProbability: (value) => value
12035
- }).map((seriesItem) => {
12036
- return {
12037
- id: `${resolvedChartOutcomeLabel != null ? resolvedChartOutcomeLabel : "graph"}-${seriesItem.venue}-${chartPrimaryOutcomeId != null ? chartPrimaryOutcomeId : "chart"}`,
12038
- venue: selectedGraphVenue != null ? selectedGraphVenue : seriesItem.venue,
12039
- color: seriesItem.venue === "aggregate" ? baseColor : resolveSeriesColor(seriesItem.venue, 0, isDarkTheme),
12040
- // Constrain to the rolling [nowSec - rangeSeconds, …] domain so stale
12041
- // bars don't bleed in across a range shrink or long mount.
12042
- points: seriesItem.points.filter((point) => point.time >= domainStartTs)
12043
- };
12044
- });
12045
- }, [
12046
- isDarkTheme,
12047
- chartPrimaryOutcomeId,
12048
- marketChartData,
12049
- rollingWindow.startTs,
12050
- selectedGraphVenue,
12051
- resolvedChartOutcomeLabel,
12052
- chartAvailableOutcomesByVenue,
12053
- chartOutcomesByVenue
12054
- ]);
12055
- const graphLiveState = (0, import_react19.useMemo)(() => {
12056
- return resolveMarketChartLiveState({
12057
- chartData: marketChartData,
12058
- selectedVenue: selectedGraphVenue,
12059
- transformProbability: (value) => value
12060
- });
12061
- }, [marketChartData, selectedGraphVenue]);
12062
- const otherRows = (0, import_react19.useMemo)(() => {
12326
+ const otherRows = (0, import_react20.useMemo)(() => {
12063
12327
  if (!model) return [];
12064
12328
  return resolveOtherTabRows(model.market, labels);
12065
12329
  }, [labels, model]);
@@ -12069,7 +12333,6 @@ var MarketDetailsContent = ({
12069
12333
  const isSnapshotUnavailableError = typeof orderBookError === "object" && orderBookError != null && "message" in orderBookError && typeof orderBookError.message === "string" && /^snapshot unavailable for\s+\S+/i.test(orderBookError.message);
12070
12334
  const orderBookErrorDescription = isSnapshotUnavailableError ? labels.marketDetails.orderBookUnavailableDescription : typeof orderBookError === "object" && orderBookError != null && "message" in orderBookError && typeof orderBookError.message === "string" && orderBookError.message.trim().length > 0 ? orderBookError.message : labels.marketDetails.orderBookUnavailableDescription;
12071
12335
  const hasNoOrderBook = isOrderBookNotFound && !isMarketResolved || !isOrderBookLoading && !hasOrderBookError && (selectedOutcomesByVenue.length === 0 || aggregatedOrderbookRows.hasNoOrderBook);
12072
- const hasChartError = !!marketChartError;
12073
12336
  const selectHeaderOutcome = ({
12074
12337
  item,
12075
12338
  shouldNotifyOutcomeSelect = false
@@ -12077,7 +12340,7 @@ var MarketDetailsContent = ({
12077
12340
  var _a2, _b2;
12078
12341
  if (isOutcomeSelectionLocked) return;
12079
12342
  if (item == null ? void 0 : item.id) {
12080
- const targetMarket = (_a2 = model == null ? void 0 : model.market.venueMarkets.find(
12343
+ const targetMarket = (_a2 = venueMarkets.find(
12081
12344
  (venueMarket) => venueMarket.venueMarketOutcomes.some((outcome) => outcome.id === item.id)
12082
12345
  )) != null ? _a2 : null;
12083
12346
  if ((targetMarket == null ? void 0 : targetMarket.id) && targetMarket.id !== (tradingContext == null ? void 0 : tradingContext.selectedMarketId)) {
@@ -12119,23 +12382,14 @@ var MarketDetailsContent = ({
12119
12382
  if (!marketId) return;
12120
12383
  onOpenChange == null ? void 0 : onOpenChange(marketId);
12121
12384
  };
12122
- const handleGraphVenueToggle = (venue) => {
12123
- setSelectedGraphVenue((currentVenue) => {
12124
- if (currentVenue === venue) return null;
12125
- return venue;
12126
- });
12127
- };
12128
12385
  const handleRetryOrderBook = () => {
12129
12386
  void refetchOrderBook();
12130
12387
  };
12131
- const handleRetryMarketChart = () => {
12132
- void refetchMarketChart();
12133
- };
12134
12388
  const orderbookState = marketTradingState.isTradingDisabled ? {
12135
12389
  kind: "disabled",
12136
12390
  title: marketStatePresentation.title,
12137
12391
  description: marketStatePresentation.description,
12138
- icon: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Icon, { name: marketStatePresentation.iconName, className: "h-5 w-5", "aria-hidden": "true" })
12392
+ icon: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Icon, { name: marketStatePresentation.iconName, className: "h-5 w-5", "aria-hidden": "true" })
12139
12393
  } : isOrderBookLoading ? { kind: "loading" } : hasOrderBookError ? {
12140
12394
  kind: "error",
12141
12395
  title: labels.marketDetails.orderBookUnavailableTitle,
@@ -12150,22 +12404,27 @@ var MarketDetailsContent = ({
12150
12404
  title: labels.marketDetails.orderBookEmptyTitle,
12151
12405
  description: labels.marketDetails.orderBookEmptyDescription
12152
12406
  } : { kind: "data" };
12153
- (0, import_react19.useEffect)(() => {
12154
- if (!selectedGraphVenue) {
12155
- return;
12156
- }
12157
- if (chartAvailableOutcomesByVenue.some((item) => item.venue === selectedGraphVenue)) {
12158
- return;
12159
- }
12160
- setSelectedGraphVenue(null);
12161
- }, [selectedGraphVenue, chartAvailableOutcomesByVenue]);
12162
12407
  if (marketId && !resolvedMarket) {
12163
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(MarketDetailsNotFoundState, { ariaLabel, classNames });
12408
+ return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12409
+ MarketDetailsNotFoundState,
12410
+ {
12411
+ marketId,
12412
+ ariaLabel,
12413
+ classNames
12414
+ }
12415
+ );
12164
12416
  }
12165
12417
  if (!model) {
12166
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(MarketDetailsUnavailableState, { ariaLabel, classNames });
12418
+ return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12419
+ MarketDetailsUnavailableState,
12420
+ {
12421
+ marketId,
12422
+ ariaLabel,
12423
+ classNames
12424
+ }
12425
+ );
12167
12426
  }
12168
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
12427
+ return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
12169
12428
  Card,
12170
12429
  {
12171
12430
  className: cn(
@@ -12176,9 +12435,10 @@ var MarketDetailsContent = ({
12176
12435
  classNames == null ? void 0 : classNames.root
12177
12436
  ),
12178
12437
  children: [
12179
- /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
12438
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
12180
12439
  "div",
12181
12440
  {
12441
+ "data-market-id": marketId || void 0,
12182
12442
  className: cn(
12183
12443
  "agg-market-card-header",
12184
12444
  "flex flex-col items-stretch gap-3 px-5 py-3 md:flex-row md:flex-nowrap md:items-center md:justify-between",
@@ -12186,7 +12446,7 @@ var MarketDetailsContent = ({
12186
12446
  classNames == null ? void 0 : classNames.header
12187
12447
  ),
12188
12448
  children: [
12189
- /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
12449
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
12190
12450
  "button",
12191
12451
  {
12192
12452
  className: cn(
@@ -12200,17 +12460,17 @@ var MarketDetailsContent = ({
12200
12460
  "aria-controls": detailsContentId,
12201
12461
  "aria-label": isOpened ? labels.marketDetails.toggleCloseDetailsAria(model.title) : labels.marketDetails.toggleOpenDetailsAria(model.title),
12202
12462
  children: [
12203
- /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "agg-market-summary flex min-w-24 flex-1 items-center gap-3 md:gap-4", children: [
12204
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12463
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "agg-market-summary flex min-w-24 flex-1 items-center gap-3 md:gap-4", children: [
12464
+ !compactHeader ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12205
12465
  RemoteImage,
12206
12466
  {
12207
- src: (0, import_hooks42.optimizedImageUrl)(model.image, 60),
12467
+ src: (0, import_hooks43.optimizedImageUrl)(model.image, 60),
12208
12468
  alt: "",
12209
12469
  className: "agg-market-image size-12 rounded-agg-lg object-cover md:size-[60px]"
12210
12470
  }
12211
- ),
12212
- /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex min-w-24 flex-col", children: [
12213
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Tooltip, { content: model.title, side: "top", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12471
+ ) : null,
12472
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex min-w-24 flex-col", children: [
12473
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Tooltip, { content: model.title, side: "top", children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12214
12474
  Typography,
12215
12475
  {
12216
12476
  as: "h3",
@@ -12219,16 +12479,16 @@ var MarketDetailsContent = ({
12219
12479
  children: model.title
12220
12480
  }
12221
12481
  ) }) }),
12222
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12482
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12223
12483
  Typography,
12224
12484
  {
12225
12485
  variant: "label",
12226
12486
  className: "agg-market-meta truncate text-agg-muted-foreground",
12227
- children: model.subtitle
12487
+ children: subtitleOverride != null ? subtitleOverride : model.subtitle
12228
12488
  }
12229
12489
  ) }),
12230
- marketTradingState.isTradingDisabled && marketTradingState.kind !== "resolved" && !isUpcomingMarket ? /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "mt-2 flex flex-wrap items-center gap-2 justify-center md:justify-start", children: [
12231
- /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
12490
+ marketTradingState.isTradingDisabled && marketTradingState.kind !== "resolved" && !isUpcomingMarket ? /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "mt-2 flex flex-wrap items-center gap-2 justify-center md:justify-start", children: [
12491
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
12232
12492
  "span",
12233
12493
  {
12234
12494
  className: cn(
@@ -12236,7 +12496,7 @@ var MarketDetailsContent = ({
12236
12496
  resolveTradingStateBadgeClassName(marketTradingState.kind)
12237
12497
  ),
12238
12498
  children: [
12239
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12499
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12240
12500
  Icon,
12241
12501
  {
12242
12502
  name: marketStatePresentation.iconName,
@@ -12244,20 +12504,20 @@ var MarketDetailsContent = ({
12244
12504
  className: "h-3.5 w-3.5"
12245
12505
  }
12246
12506
  ),
12247
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { children: marketStatePresentation.badgeLabel })
12507
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { children: marketStatePresentation.badgeLabel })
12248
12508
  ]
12249
12509
  }
12250
12510
  ),
12251
- marketStatePresentation.timestampLabel ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: marketStatePresentation.timestampLabel }) : null,
12252
- marketStatePresentation.winningOutcomeLabel ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: marketStatePresentation.winningOutcomeLabel }) : null
12511
+ marketStatePresentation.timestampLabel ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: marketStatePresentation.timestampLabel }) : null,
12512
+ marketStatePresentation.winningOutcomeLabel ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: marketStatePresentation.winningOutcomeLabel }) : null
12253
12513
  ] }) : null
12254
12514
  ] })
12255
12515
  ] }),
12256
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Typography, { as: "div", variant: "heading", className: "agg-market-headline shrink-0", children: formatProbabilityPercent(headlineProbability, formatPercent) })
12516
+ !compactHeader ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Typography, { as: "div", variant: "heading", className: "agg-market-headline shrink-0", children: formatProbabilityPercent(headlineProbability, formatPercent) }) : null
12257
12517
  ]
12258
12518
  }
12259
12519
  ),
12260
- marketTradingState.kind === "resolved" && marketTradingState.winningOutcome ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "agg-outcomes flex w-full items-center justify-end md:w-auto md:shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
12520
+ marketTradingState.kind === "resolved" && marketTradingState.winningOutcome ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "agg-outcomes flex w-full items-center justify-end md:w-auto md:shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
12261
12521
  "span",
12262
12522
  {
12263
12523
  className: cn(
@@ -12270,7 +12530,7 @@ var MarketDetailsContent = ({
12270
12530
  "border-transparent bg-agg-secondary-hover"
12271
12531
  ),
12272
12532
  children: [
12273
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12533
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12274
12534
  Icon,
12275
12535
  {
12276
12536
  name: marketTradingState.winningOutcome.label.trim().toLowerCase() === "yes" ? "check-circle" : "cross-circle",
@@ -12281,10 +12541,10 @@ var MarketDetailsContent = ({
12281
12541
  )
12282
12542
  }
12283
12543
  ),
12284
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Typography, { variant: "body", children: labels.eventMarketPage.resolvedOutcome(marketTradingState.winningOutcome.label) })
12544
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Typography, { variant: "body", children: labels.eventMarketPage.resolvedOutcome(marketTradingState.winningOutcome.label) })
12285
12545
  ]
12286
12546
  }
12287
- ) }) : isUpcomingMarket ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "agg-outcomes flex w-full items-center justify-end md:w-auto md:shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
12547
+ ) }) : isUpcomingMarket ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "agg-outcomes flex w-full items-center justify-end md:w-auto md:shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
12288
12548
  "span",
12289
12549
  {
12290
12550
  className: cn(
@@ -12293,7 +12553,7 @@ var MarketDetailsContent = ({
12293
12553
  resolveTradingStateBadgeClassName(marketTradingState.kind)
12294
12554
  ),
12295
12555
  children: [
12296
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12556
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12297
12557
  Icon,
12298
12558
  {
12299
12559
  name: marketStatePresentation.iconName,
@@ -12302,10 +12562,10 @@ var MarketDetailsContent = ({
12302
12562
  "aria-hidden": "true"
12303
12563
  }
12304
12564
  ),
12305
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { children: marketStatePresentation.badgeLabel })
12565
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { children: marketStatePresentation.badgeLabel })
12306
12566
  ]
12307
12567
  }
12308
- ) }) : /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12568
+ ) }) : /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12309
12569
  "div",
12310
12570
  {
12311
12571
  className: "agg-outcomes flex w-full flex-wrap gap-2 md:w-auto md:shrink-0 md:flex-nowrap",
@@ -12314,9 +12574,10 @@ var MarketDetailsContent = ({
12314
12574
  onKeyDown: (eventToHandle) => handleOutcomeKeyDown(eventToHandle),
12315
12575
  children: headerOutcomeItems.map((item) => {
12316
12576
  const isActiveOutcome = item.id === selectedOutcomeId;
12317
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12577
+ return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12318
12578
  MarketDetailsOutcomeButton,
12319
12579
  {
12580
+ enforceFixedWidth: headerOutcomeVariant != null,
12320
12581
  item,
12321
12582
  isSelected: isActiveOutcome,
12322
12583
  enableAnimations: config.features.enableAnimations,
@@ -12340,7 +12601,8 @@ var MarketDetailsContent = ({
12340
12601
  ]
12341
12602
  }
12342
12603
  ),
12343
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12604
+ headerAccessory ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "agg-market-card-accessory border-t border-agg-separator", children: headerAccessory }) : null,
12605
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12344
12606
  "div",
12345
12607
  {
12346
12608
  id: detailsContentId,
@@ -12354,9 +12616,9 @@ var MarketDetailsContent = ({
12354
12616
  isOpened ? "grid-rows-[1fr] opacity-100" : "pointer-events-none grid-rows-[0fr] opacity-0"
12355
12617
  ),
12356
12618
  "aria-hidden": !isOpened,
12357
- children: /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "min-h-0", children: [
12358
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
12359
- /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
12619
+ children: /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "min-h-0", children: [
12620
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
12621
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
12360
12622
  "div",
12361
12623
  {
12362
12624
  className: cn(
@@ -12370,8 +12632,8 @@ var MarketDetailsContent = ({
12370
12632
  ) : "translate-y-5 opacity-0"
12371
12633
  ),
12372
12634
  children: [
12373
- !isResolvedMarket ? /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(import_jsx_runtime129.Fragment, { children: [
12374
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: cn("block", classNames == null ? void 0 : classNames.tabs), children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12635
+ !isResolvedMarket ? /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [
12636
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: cn("block", classNames == null ? void 0 : classNames.tabs), children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12375
12637
  Tabs,
12376
12638
  {
12377
12639
  ariaLabel: labels.marketDetails.tabsAria,
@@ -12382,10 +12644,10 @@ var MarketDetailsContent = ({
12382
12644
  className: "agg-market-tabs w-full px-5"
12383
12645
  }
12384
12646
  ) }),
12385
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "h-px w-full bg-agg-separator" })
12647
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "h-px w-full bg-agg-separator" })
12386
12648
  ] }) : null,
12387
- /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: cn("agg-market-card-body p-0", classNames == null ? void 0 : classNames.content), children: [
12388
- effectiveSelectedTab === "order-book" ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12649
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: cn("agg-market-card-body p-0", classNames == null ? void 0 : classNames.content), children: [
12650
+ effectiveSelectedTab === "order-book" ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12389
12651
  OrderbookWithStates,
12390
12652
  {
12391
12653
  state: orderbookState,
@@ -12411,159 +12673,29 @@ var MarketDetailsContent = ({
12411
12673
  wrapperClassName: classNames == null ? void 0 : classNames.orderBook
12412
12674
  }
12413
12675
  ) : null,
12414
- effectiveSelectedTab === "graph" ? /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: cn("agg-price-chart flex flex-col gap-5 p-5", classNames == null ? void 0 : classNames.graph), children: [
12415
- hasChartError ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12416
- StateMessage,
12417
- {
12418
- title: labels.marketDetails.chartUnavailableTitle,
12419
- description: labels.marketDetails.chartUnavailableDescription,
12420
- icon: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(WarningIcon, {}),
12421
- onAction: handleRetryMarketChart,
12422
- classNames: { root: "min-h-[248px] px-5 py-10 md:min-h-[272px]" }
12423
- }
12424
- ) : /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12425
- LineChart,
12426
- {
12427
- series: graphSeries,
12428
- height: 260,
12429
- isLoading: isMarketChartLoading,
12430
- chartType: selectedChartType,
12431
- liveCandle: selectedChartType === "candlestick" ? (_l = graphLiveState.liveCandle) != null ? _l : void 0 : void 0,
12432
- lineValue: graphLiveState.lineValue,
12433
- classNames: { root: "agg-chart-region w-full" },
12434
- showSeriesControls: chartAvailableOutcomesByVenue.length > 0 || headerOutcomeItems.length > 0,
12435
- renderSeriesControls: () => {
12436
- var _a2, _b2, _c2, _d2;
12437
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "agg-chart-toolbar w-full flex flex-col gap-4 md:flex-row md:items-center md:justify-between", children: [
12438
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "agg-market-venues flex flex-wrap gap-2", children: chartAvailableOutcomesByVenue.map((item) => {
12439
- var _a3;
12440
- const probability = formatProbabilityPercent(
12441
- (_a3 = wsLivePrices.get(item.outcome.id)) != null ? _a3 : item.outcome.price,
12442
- formatPercent
12443
- );
12444
- const isActiveVenue = selectedGraphVenue === item.venue;
12445
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
12446
- "button",
12447
- {
12448
- type: "button",
12449
- "aria-label": `${item.venue} ${probability}`,
12450
- "aria-pressed": isActiveVenue,
12451
- className: cn(
12452
- "agg-market-venue",
12453
- "cursor-pointer",
12454
- "inline-flex items-center gap-2 rounded-agg-full border px-4 py-2",
12455
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-0 focus-visible:ring-offset-agg-secondary-hover",
12456
- isActiveVenue ? "border-agg-primary bg-agg-secondary" : "border-transparent bg-agg-secondary-hover"
12457
- ),
12458
- onClick: (e) => {
12459
- e.preventDefault();
12460
- e.stopPropagation();
12461
- handleGraphVenueToggle(item.venue);
12462
- },
12463
- children: [
12464
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(VenueLogo, { venue: item.venue, size: "small" }),
12465
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: probability })
12466
- ]
12467
- },
12468
- `${item.market.id}-${item.outcome.id}`
12469
- );
12470
- }) }),
12471
- !isOutcomeSelectionLocked ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12472
- SwitchButton,
12473
- {
12474
- ariaLabel: labels.marketDetails.outcomeSelectorAria,
12475
- className: "agg-outcome-switch w-full shrink-0 md:w-fit",
12476
- value: (_d2 = (_c2 = (_a2 = headerOutcomeItems.find(
12477
- (outcome) => outcome.label === resolvedChartOutcomeLabel
12478
- )) == null ? void 0 : _a2.id) != null ? _c2 : (_b2 = headerOutcomeItems[0]) == null ? void 0 : _b2.id) != null ? _d2 : "",
12479
- onValueChange: (outcomeId) => {
12480
- const outcome = headerOutcomeItems.find(
12481
- (headerOutcomeItem) => headerOutcomeItem.id === outcomeId
12482
- );
12483
- if (!outcome) return;
12484
- setChartOutcomeLabel(outcome.label);
12485
- },
12486
- options: headerOutcomeItems.map((outcome) => {
12487
- var _a3, _b3;
12488
- const price = outcome.probability;
12489
- return {
12490
- value: outcome.id,
12491
- label: `${(_a3 = outcome == null ? void 0 : outcome.title) != null ? _a3 : outcome.label} ${formatProbabilityCents(price)}`,
12492
- ariaLabel: `${(_b3 = outcome == null ? void 0 : outcome.title) != null ? _b3 : outcome.label} ${formatProbabilityCents(price)}`
12493
- };
12494
- })
12495
- }
12496
- ) : null
12497
- ] });
12498
- }
12499
- }
12500
- ),
12501
- /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
12502
- "div",
12503
- {
12504
- className: cn(
12505
- "agg-chart-footer",
12506
- "flex flex-row justify-between gap-2 text-agg-sm leading-agg-5 text-agg-muted-foreground md:flex-row md:items-center md:justify-between",
12507
- classNames == null ? void 0 : classNames.footer
12508
- ),
12509
- children: [
12510
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { children: typeof model.market.volume !== "number" ? labels.marketDetails.volumeUnavailable : model.market.volume > 0 ? `${config.formatting.formatCompactCurrency(model.market.volume)} ${labels.marketDetails.meta.volumeSuffix}` : "" }),
12511
- /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-wrap items-center gap-3 md:gap-4", children: [
12512
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12513
- ChartTypeSwitch,
12514
- {
12515
- className: "agg-chart-type-switch shrink-0",
12516
- value: selectedChartType,
12517
- onValueChange: setSelectedChartType
12518
- }
12519
- ),
12520
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12521
- "span",
12522
- {
12523
- "aria-hidden": "true",
12524
- className: "hidden h-4 w-px bg-agg-separator md:block"
12525
- }
12526
- ),
12527
- import_hooks42.CHART_TIME_RANGES.map((timeRange) => {
12528
- const isActive = effectiveChartTimeRange === timeRange;
12529
- const isDisabled = isResolvedMarket && timeRange !== "ALL";
12530
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12531
- "button",
12532
- {
12533
- type: "button",
12534
- disabled: isDisabled,
12535
- className: cn(
12536
- "agg-chart-time-range-trigger",
12537
- "cursor-pointer text-agg-sm leading-agg-5",
12538
- isDisabled && "cursor-not-allowed opacity-50",
12539
- isActive ? "font-agg-bold text-agg-foreground" : "font-agg-normal text-agg-muted-foreground"
12540
- ),
12541
- "aria-pressed": isActive,
12542
- "aria-disabled": isDisabled,
12543
- onClick: (e) => {
12544
- e.preventDefault();
12545
- e.stopPropagation();
12546
- if (isDisabled) return;
12547
- setChartRangeOverride(null);
12548
- setSelectedTimeRange(timeRange);
12549
- },
12550
- children: timeRange === "ALL" ? labels.eventItemDetails.allTimeRange : timeRange
12551
- },
12552
- timeRange
12553
- );
12554
- })
12555
- ] })
12556
- ]
12557
- }
12558
- )
12559
- ] }) : null,
12560
- effectiveSelectedTab === "other" ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "agg-market-meta flex flex-col gap-4", children: otherContent != null ? otherContent : /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "agg-market-meta-list grid grid-cols-1 gap-3", children: otherRows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
12676
+ isOpened && effectiveSelectedTab === "graph" ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12677
+ MarketDetailsGraphPanel,
12678
+ {
12679
+ venueMarkets: model.market.venueMarkets,
12680
+ selectedOutcomeLabel,
12681
+ selectedOutcomeId,
12682
+ livePrices,
12683
+ wsLivePrices,
12684
+ headerOutcomeItems,
12685
+ isResolvedMarket,
12686
+ isOutcomeSelectionLocked,
12687
+ volume: model.market.volume,
12688
+ live,
12689
+ classNames: { graph: classNames == null ? void 0 : classNames.graph, footer: classNames == null ? void 0 : classNames.footer }
12690
+ }
12691
+ ) : null,
12692
+ effectiveSelectedTab === "other" ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "agg-market-meta flex flex-col gap-4", children: otherContent != null ? otherContent : /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "agg-market-meta-list grid grid-cols-1 gap-3", children: otherRows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
12561
12693
  "div",
12562
12694
  {
12563
12695
  className: "agg-market-meta-row flex items-center justify-between rounded-agg-xl bg-agg-secondary-hover px-4 py-3",
12564
12696
  children: [
12565
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: row.label }),
12566
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Typography, { variant: "body", className: "text-right", children: row.value })
12697
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: row.label }),
12698
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Typography, { variant: "body", className: "text-right", children: row.value })
12567
12699
  ]
12568
12700
  },
12569
12701
  row.label
@@ -12581,9 +12713,9 @@ var MarketDetailsContent = ({
12581
12713
  };
12582
12714
  var MarketDetails = (_a) => {
12583
12715
  var _b = _a, { isOpened } = _b, props = __objRest(_b, ["isOpened"]);
12584
- const labels = (0, import_hooks42.useLabels)();
12716
+ const labels = (0, import_hooks43.useLabels)();
12585
12717
  if (props.isLoading) {
12586
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12718
+ return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12587
12719
  Skeleton,
12588
12720
  {
12589
12721
  view: "market-details-minified",
@@ -12593,7 +12725,7 @@ var MarketDetails = (_a) => {
12593
12725
  );
12594
12726
  }
12595
12727
  if ("venueMarkets" in props && props.venueMarkets) {
12596
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12728
+ return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12597
12729
  MarketDetailsContent,
12598
12730
  __spreadProps(__spreadValues({}, props), {
12599
12731
  isOpened,
@@ -12605,7 +12737,7 @@ var MarketDetails = (_a) => {
12605
12737
  );
12606
12738
  }
12607
12739
  const { classNames: fallbackClassNames } = props;
12608
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(MarketDetailsUnavailableState, { classNames: fallbackClassNames });
12740
+ return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(MarketDetailsUnavailableState, { classNames: fallbackClassNames });
12609
12741
  };
12610
12742
  MarketDetails.displayName = "MarketDetails";
12611
12743
  var AFFIRMATIVE_WINNER_LABELS = /* @__PURE__ */ new Set(["yes", "up", "buy", "long", "true"]);
@@ -12636,13 +12768,13 @@ var resolveIsResolvedEvent = (sourceMarkets, eventTradingState) => {
12636
12768
  return eventTradingState.kind === "resolved";
12637
12769
  }
12638
12770
  if (sourceMarkets.length === 0) return false;
12639
- return sourceMarkets.every((market) => (0, import_hooks42.resolveMarketTradingState)(market).kind === "resolved");
12771
+ return sourceMarkets.every((market) => (0, import_hooks43.resolveMarketTradingState)(market).kind === "resolved");
12640
12772
  };
12641
12773
  var resolveResolvedWinnerMarketId = (sourceMarkets, eventTradingState) => {
12642
12774
  var _a, _b, _c, _d, _e;
12643
12775
  const preferredMarket = (_a = eventTradingState == null ? void 0 : eventTradingState.primaryMarket) != null ? _a : null;
12644
12776
  if (preferredMarket && sourceMarkets.some((market) => market.id === preferredMarket.id)) {
12645
- if ((0, import_hooks42.resolveMarketTradingState)(preferredMarket).kind === "resolved") {
12777
+ if ((0, import_hooks43.resolveMarketTradingState)(preferredMarket).kind === "resolved") {
12646
12778
  return preferredMarket.id;
12647
12779
  }
12648
12780
  }
@@ -12662,24 +12794,25 @@ var MarketDetailsList = ({
12662
12794
  midpointsResult
12663
12795
  }) => {
12664
12796
  var _a, _b;
12665
- const labels = (0, import_hooks42.useLabels)();
12666
- const tradingContext = (0, import_hooks42.useEventTradingContext)();
12797
+ const labels = (0, import_hooks43.useLabels)();
12798
+ const tradingContext = (0, import_hooks43.useEventTradingContext)();
12667
12799
  const selectedMarketId = (_a = tradingContext == null ? void 0 : tradingContext.selectedMarketId) != null ? _a : null;
12668
- const [expandedMarketId, setExpandedMarketId] = (0, import_react19.useState)(null);
12669
- const [areResolvedMarketsVisible, setAreResolvedMarketsVisible] = (0, import_react19.useState)(false);
12800
+ const [expandedMarketId, setExpandedMarketId] = (0, import_react20.useState)(null);
12801
+ const [areResolvedMarketsVisible, setAreResolvedMarketsVisible] = (0, import_react20.useState)(false);
12670
12802
  const resolvedEventId = eventId || "";
12671
12803
  const {
12672
12804
  markets: rawMarkets,
12673
12805
  isLoading,
12674
12806
  error
12675
- } = (0, import_hooks42.useVenueMarkets)({
12807
+ } = (0, import_hooks43.useVenueMarkets)({
12676
12808
  venueEventId: resolvedEventId,
12677
12809
  enabled: !providedMarkets && !!resolvedEventId,
12678
- status: import_hooks42.MarketStatus.open,
12679
- sortBy: "yesPrice",
12680
- sortDir: "desc"
12810
+ status: import_hooks43.MarketStatus.open
12811
+ // No explicit sortBy: event-scoped /venue-markets sorts by the event's
12812
+ // type-aware order (structureOrderBy), matching the home-card top-3 and the
12813
+ // markets-under-an-event ordering. Passing sortBy here would override it.
12681
12814
  });
12682
- const sourceMarkets = (0, import_react19.useMemo)(() => {
12815
+ const sourceMarkets = (0, import_react20.useMemo)(() => {
12683
12816
  var _a2;
12684
12817
  if ((_a2 = eventTradingState == null ? void 0 : eventTradingState.marketStates) == null ? void 0 : _a2.length) {
12685
12818
  return eventTradingState.marketStates.map((item) => item.market);
@@ -12687,10 +12820,10 @@ var MarketDetailsList = ({
12687
12820
  if (providedMarkets) return providedMarkets;
12688
12821
  return rawMarkets;
12689
12822
  }, [eventTradingState == null ? void 0 : eventTradingState.marketStates, providedMarkets, rawMarkets]);
12690
- const isResolvedEvent = (0, import_react19.useMemo)(() => {
12823
+ const isResolvedEvent = (0, import_react20.useMemo)(() => {
12691
12824
  return resolveIsResolvedEvent(sourceMarkets, eventTradingState);
12692
12825
  }, [eventTradingState, sourceMarkets]);
12693
- const groupedMarkets = (0, import_react19.useMemo)(() => {
12826
+ const groupedMarkets = (0, import_react20.useMemo)(() => {
12694
12827
  if (sourceMarkets.length === 0) {
12695
12828
  return {
12696
12829
  primary: [],
@@ -12712,7 +12845,7 @@ var MarketDetailsList = ({
12712
12845
  const resolved = [];
12713
12846
  const closed = [];
12714
12847
  sourceMarkets.forEach((market) => {
12715
- const marketStateKind = (0, import_hooks42.resolveMarketTradingState)(market).kind;
12848
+ const marketStateKind = (0, import_hooks43.resolveMarketTradingState)(market).kind;
12716
12849
  if (marketStateKind === "resolved") {
12717
12850
  resolved.push(market);
12718
12851
  return;
@@ -12730,21 +12863,21 @@ var MarketDetailsList = ({
12730
12863
  return { primary, upcoming, resolved, closed };
12731
12864
  }, [eventTradingState, isResolvedEvent, sourceMarkets]);
12732
12865
  const shouldShowResolvedToggle = !isResolvedEvent && groupedMarkets.resolved.length > 0;
12733
- const visibleResolvedMarkets = (0, import_react19.useMemo)(() => {
12866
+ const visibleResolvedMarkets = (0, import_react20.useMemo)(() => {
12734
12867
  if (isResolvedEvent || areResolvedMarketsVisible) return groupedMarkets.resolved;
12735
12868
  return [];
12736
12869
  }, [areResolvedMarketsVisible, groupedMarkets.resolved, isResolvedEvent]);
12737
- const displayedMarkets = (0, import_react19.useMemo)(() => {
12870
+ const displayedMarkets = (0, import_react20.useMemo)(() => {
12738
12871
  return [...groupedMarkets.primary, ...visibleResolvedMarkets];
12739
12872
  }, [groupedMarkets.primary, visibleResolvedMarkets]);
12740
12873
  const hasPrefetchedMarkets = !!providedMarkets || !!((_b = eventTradingState == null ? void 0 : eventTradingState.marketStates) == null ? void 0 : _b.length);
12741
- const midpointEligibleMarkets = (0, import_react19.useMemo)(() => {
12874
+ const midpointEligibleMarkets = (0, import_react20.useMemo)(() => {
12742
12875
  return displayedMarkets.filter(
12743
- (market) => (0, import_hooks42.resolveMarketTradingState)(market).kind !== "resolved"
12876
+ (market) => (0, import_hooks43.resolveMarketTradingState)(market).kind !== "resolved"
12744
12877
  );
12745
12878
  }, [displayedMarkets]);
12746
- const { prices: midpointsFallback, venueByOutcomeId: midpointsFallbackVenues } = (0, import_hooks42.useViewportMidpoints)(midpointEligibleMarkets);
12747
- (0, import_react19.useEffect)(() => {
12879
+ const { prices: midpointsFallback, venueByOutcomeId: midpointsFallbackVenues } = (0, import_hooks43.useViewportMidpoints)(midpointEligibleMarkets);
12880
+ (0, import_react20.useEffect)(() => {
12748
12881
  if (isResolvedEvent) {
12749
12882
  setAreResolvedMarketsVisible(false);
12750
12883
  return;
@@ -12753,7 +12886,7 @@ var MarketDetailsList = ({
12753
12886
  setAreResolvedMarketsVisible(false);
12754
12887
  }
12755
12888
  }, [groupedMarkets.resolved.length, isResolvedEvent]);
12756
- (0, import_react19.useEffect)(() => {
12889
+ (0, import_react20.useEffect)(() => {
12757
12890
  if (displayedMarkets.length === 0) return;
12758
12891
  if (selectedMarketId && displayedMarkets.some((market) => market.id === selectedMarketId)) {
12759
12892
  return;
@@ -12762,7 +12895,7 @@ var MarketDetailsList = ({
12762
12895
  return;
12763
12896
  }
12764
12897
  const fallbackSelectableMarket = displayedMarkets.find(
12765
- (market) => !(0, import_hooks42.resolveMarketTradingState)(market).isTradingDisabled
12898
+ (market) => !(0, import_hooks43.resolveMarketTradingState)(market).isTradingDisabled
12766
12899
  );
12767
12900
  if (!fallbackSelectableMarket) {
12768
12901
  return;
@@ -12770,7 +12903,7 @@ var MarketDetailsList = ({
12770
12903
  if (!autoSelectFallbackMarket) return;
12771
12904
  tradingContext == null ? void 0 : tradingContext.selectMarket(fallbackSelectableMarket.id, fallbackSelectableMarket);
12772
12905
  }, [autoSelectFallbackMarket, displayedMarkets, selectedMarketId, sourceMarkets, tradingContext]);
12773
- (0, import_react19.useEffect)(() => {
12906
+ (0, import_react20.useEffect)(() => {
12774
12907
  if (!expandedMarketId) return;
12775
12908
  if (displayedMarkets.some((market) => market.id === expandedMarketId)) return;
12776
12909
  setExpandedMarketId(null);
@@ -12784,11 +12917,11 @@ var MarketDetailsList = ({
12784
12917
  setExpandedMarketId(marketId);
12785
12918
  onExpandedMarketChange == null ? void 0 : onExpandedMarketChange(marketId);
12786
12919
  if (marketId === selectedMarketId) return;
12787
- if ((0, import_hooks42.resolveMarketTradingState)(market).isTradingDisabled) return;
12920
+ if ((0, import_hooks43.resolveMarketTradingState)(market).isTradingDisabled) return;
12788
12921
  tradingContext == null ? void 0 : tradingContext.selectMarket(market.id, market);
12789
12922
  };
12790
12923
  if (!hasPrefetchedMarkets && isLoading) {
12791
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12924
+ return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12792
12925
  Skeleton,
12793
12926
  {
12794
12927
  view: "market-details-minified",
@@ -12798,29 +12931,29 @@ var MarketDetailsList = ({
12798
12931
  );
12799
12932
  }
12800
12933
  if (!hasPrefetchedMarkets && error) {
12801
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12934
+ return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12802
12935
  StateMessage,
12803
12936
  {
12804
12937
  title: labels.marketDetails.unavailableTitle,
12805
12938
  description: labels.marketDetails.unavailableDescription,
12806
- icon: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(SearchEmptyIcon, {}),
12939
+ icon: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(SearchEmptyIcon, {}),
12807
12940
  classNames: { root: "min-h-[280px] md:min-h-[320px]" }
12808
12941
  }
12809
12942
  );
12810
12943
  }
12811
12944
  if (displayedMarkets.length === 0 && !shouldShowResolvedToggle) {
12812
12945
  const hasSourceMarkets = sourceMarkets.length > 0;
12813
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12946
+ return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12814
12947
  StateMessage,
12815
12948
  {
12816
12949
  title: hasSourceMarkets ? isResolvedEvent ? labels.markets.emptyResolved : labels.markets.emptyNoOpen : labels.marketDetails.notFoundTitle,
12817
12950
  description: hasSourceMarkets ? void 0 : labels.marketDetails.notFoundDescription,
12818
- icon: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(SearchEmptyIcon, {}),
12951
+ icon: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(SearchEmptyIcon, {}),
12819
12952
  classNames: { root: "min-h-[280px] md:min-h-[320px]" }
12820
12953
  }
12821
12954
  );
12822
12955
  }
12823
- const renderMarketCard = (market) => /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12956
+ const renderMarketCard = (market) => /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12824
12957
  MarketDetails,
12825
12958
  {
12826
12959
  marketId: market.id,
@@ -12847,9 +12980,9 @@ var MarketDetailsList = ({
12847
12980
  midpointsResult
12848
12981
  }
12849
12982
  ) }, market.id);
12850
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: cn("agg-market-list flex flex-col gap-3", classNames == null ? void 0 : classNames.root), children: [
12983
+ return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: cn("agg-market-list flex flex-col gap-3", classNames == null ? void 0 : classNames.root), children: [
12851
12984
  groupedMarkets.primary.map((market) => renderMarketCard(market)),
12852
- shouldShowResolvedToggle ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12985
+ shouldShowResolvedToggle ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12853
12986
  Button,
12854
12987
  {
12855
12988
  variant: "tertiary",
@@ -12859,7 +12992,7 @@ var MarketDetailsList = ({
12859
12992
  setAreResolvedMarketsVisible((isVisible) => !isVisible);
12860
12993
  },
12861
12994
  "aria-expanded": areResolvedMarketsVisible,
12862
- suffix: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
12995
+ suffix: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
12863
12996
  Icon,
12864
12997
  {
12865
12998
  name: areResolvedMarketsVisible ? "chevron-up" : "chevron-down",
@@ -12877,14 +13010,14 @@ var MarketDetailsList = ({
12877
13010
  MarketDetailsList.displayName = "MarketDetailsList";
12878
13011
 
12879
13012
  // src/events/list/index.tsx
12880
- var import_hooks44 = require("@agg-build/hooks");
13013
+ var import_hooks45 = require("@agg-build/hooks");
12881
13014
  var import_sdk14 = require("@agg-build/sdk");
12882
13015
  var Dialog2 = __toESM(require("@radix-ui/react-dialog"));
12883
- var import_react22 = require("react");
13016
+ var import_react23 = require("react");
12884
13017
 
12885
13018
  // src/events/list/category-sidebar.tsx
12886
- var import_react20 = require("react");
12887
- var import_jsx_runtime130 = require("react/jsx-runtime");
13019
+ var import_react21 = require("react");
13020
+ var import_jsx_runtime131 = require("react/jsx-runtime");
12888
13021
  var rowBase = cn(
12889
13022
  "flex min-h-11 w-full items-center gap-3 rounded-[6px] px-3 py-3",
12890
13023
  "text-left text-agg-sm font-agg-normal leading-agg-5",
@@ -12906,7 +13039,7 @@ var CategorySidebar = ({
12906
13039
  onToggleCategory
12907
13040
  }) => {
12908
13041
  const isDrilledIn = categoryPath.length > 0;
12909
- const sortedBaseChildren = (0, import_react20.useMemo)(() => {
13042
+ const sortedBaseChildren = (0, import_react21.useMemo)(() => {
12910
13043
  var _a;
12911
13044
  if (!baseCategoryId) return [];
12912
13045
  const children = [...(_a = childrenByParentId.get(baseCategoryId)) != null ? _a : []];
@@ -12926,7 +13059,7 @@ var CategorySidebar = ({
12926
13059
  }) => {
12927
13060
  var _a, _b;
12928
13061
  const hasKnownChildren = ((_b = (_a = childrenByParentId.get(entry.id)) == null ? void 0 : _a.length) != null ? _b : 0) > 0;
12929
- return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
13062
+ return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
12930
13063
  "button",
12931
13064
  {
12932
13065
  type: "button",
@@ -12934,8 +13067,8 @@ var CategorySidebar = ({
12934
13067
  className: isSelected ? selectedRowClassName : idleRowClassName,
12935
13068
  onClick,
12936
13069
  children: [
12937
- /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "min-w-0 flex-1 truncate first-letter:uppercase", children: entry.label }),
12938
- hasKnownChildren ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
13070
+ /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "min-w-0 flex-1 truncate first-letter:uppercase", children: entry.label }),
13071
+ hasKnownChildren ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
12939
13072
  Icon,
12940
13073
  {
12941
13074
  name: isExpanded ? "chevron-up" : "chevron-down",
@@ -12943,7 +13076,7 @@ var CategorySidebar = ({
12943
13076
  color: "currentColor",
12944
13077
  className: "shrink-0 text-agg-muted-foreground"
12945
13078
  }
12946
- ) : /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "shrink-0 text-agg-muted-foreground", children: entry.eventCount })
13079
+ ) : /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "shrink-0 text-agg-muted-foreground", children: entry.eventCount })
12947
13080
  ]
12948
13081
  },
12949
13082
  entry.id
@@ -12961,27 +13094,27 @@ var CategorySidebar = ({
12961
13094
  const hasKnownChildren = childCategories.length > 0;
12962
13095
  const isExpanded = ((_d = categoryPath[depth]) == null ? void 0 : _d.id) === category.id && !collapsedCategoryIds.has(category.id);
12963
13096
  const isSelected = ((_e = categoryPath[depth]) == null ? void 0 : _e.id) === category.id && categoryPath.length === depth + 1;
12964
- return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex w-full flex-col", children: [
13097
+ return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "flex w-full flex-col", children: [
12965
13098
  renderRow({
12966
13099
  entry,
12967
13100
  isExpanded,
12968
13101
  isSelected,
12969
13102
  onClick: () => onToggleCategory({ entry, depth, hasKnownChildren, isExpanded, isSelected })
12970
13103
  }),
12971
- /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
13104
+ /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
12972
13105
  "div",
12973
13106
  {
12974
13107
  className: cn(
12975
13108
  "grid transition-[grid-template-rows] duration-150 ease-in-out motion-reduce:transition-none",
12976
13109
  isExpanded ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
12977
13110
  ),
12978
- children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "flex w-full flex-col gap-1 pl-4 pt-1", children: childCategories.map((child) => renderBranch(child, depth + 1)) }) })
13111
+ children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "flex w-full flex-col gap-1 pl-4 pt-1", children: childCategories.map((child) => renderBranch(child, depth + 1)) }) })
12979
13112
  }
12980
13113
  )
12981
13114
  ] }, category.id);
12982
13115
  };
12983
- return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex w-full flex-col gap-1", children: [
12984
- /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
13116
+ return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "flex w-full flex-col gap-1", children: [
13117
+ /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
12985
13118
  "button",
12986
13119
  {
12987
13120
  type: "button",
@@ -12989,8 +13122,8 @@ var CategorySidebar = ({
12989
13122
  className: !isDrilledIn ? selectedRowClassName : idleRowClassName,
12990
13123
  onClick: onSelectAll,
12991
13124
  children: [
12992
- /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "min-w-0 flex-1 truncate", children: labels.subcategoriesAll }),
12993
- /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "shrink-0 text-agg-muted-foreground", children: totalEventCount })
13125
+ /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "min-w-0 flex-1 truncate", children: labels.subcategoriesAll }),
13126
+ /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "shrink-0 text-agg-muted-foreground", children: totalEventCount })
12994
13127
  ]
12995
13128
  }
12996
13129
  ),
@@ -13000,8 +13133,8 @@ var CategorySidebar = ({
13000
13133
  CategorySidebar.displayName = "CategorySidebar";
13001
13134
 
13002
13135
  // src/events/list/event-list-tabs.tsx
13003
- var import_hooks43 = require("@agg-build/hooks");
13004
- var import_react21 = require("react");
13136
+ var import_hooks44 = require("@agg-build/hooks");
13137
+ var import_react22 = require("react");
13005
13138
 
13006
13139
  // src/events/list/event-list.constants.ts
13007
13140
  var import_sdk13 = require("@agg-build/sdk");
@@ -13068,16 +13201,16 @@ var getDefaultEventListTabs = (labels) => {
13068
13201
  };
13069
13202
 
13070
13203
  // src/events/list/event-list-tabs.tsx
13071
- var import_jsx_runtime131 = require("react/jsx-runtime");
13204
+ var import_jsx_runtime132 = require("react/jsx-runtime");
13072
13205
  var renderTabIcon = (tab, isActive) => {
13073
13206
  if (tab.iconName === "warning-filled") {
13074
- return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Icon, { name: "warning-filled", size: "small", color: "currentColor" });
13207
+ return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Icon, { name: "warning-filled", size: "small", color: "currentColor" });
13075
13208
  }
13076
13209
  if (tab.venueLogo) {
13077
- return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(VenueLogo, { venue: tab.venueLogo, size: "small" });
13210
+ return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(VenueLogo, { venue: tab.venueLogo, size: "small" });
13078
13211
  }
13079
13212
  if (!tab.iconName) return null;
13080
- return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
13213
+ return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
13081
13214
  Icon,
13082
13215
  {
13083
13216
  name: tab.iconName,
@@ -13087,14 +13220,14 @@ var renderTabIcon = (tab, isActive) => {
13087
13220
  );
13088
13221
  };
13089
13222
  var useEventListTabs = (tabs) => {
13090
- const labels = (0, import_hooks43.useLabels)();
13091
- const { disabledVenues } = (0, import_hooks43.useAppConfig)();
13092
- const { isLocationBlocked } = (0, import_hooks43.useGeoBlock)();
13093
- return (0, import_react21.useMemo)(() => {
13223
+ const labels = (0, import_hooks44.useLabels)();
13224
+ const { disabledVenues } = (0, import_hooks44.useAppConfig)();
13225
+ const { isLocationBlocked } = (0, import_hooks44.useGeoBlock)();
13226
+ return (0, import_react22.useMemo)(() => {
13094
13227
  const baseTabs = tabs != null ? tabs : getDefaultEventListTabs(labels);
13095
13228
  return baseTabs.flatMap((tab) => {
13096
13229
  if (!tab.venueLogo) return [tab];
13097
- const availabilityState = (0, import_hooks43.getVenueAvailabilityState)({
13230
+ const availabilityState = (0, import_hooks44.getVenueAvailabilityState)({
13098
13231
  venueId: tab.venueLogo,
13099
13232
  disabledVenues,
13100
13233
  isLocationBlocked
@@ -13119,13 +13252,13 @@ var EventListTabs = ({
13119
13252
  overflowBehavior
13120
13253
  }) => {
13121
13254
  const resolvedTabs = useEventListTabs(tabs);
13122
- (0, import_react21.useEffect)(() => {
13255
+ (0, import_react22.useEffect)(() => {
13123
13256
  const fallbackTab = resolvedTabs.find((tab) => !tab.disabled);
13124
13257
  if (!fallbackTab) return;
13125
13258
  if (resolvedTabs.some((tab) => tab.value === activeTab && !tab.disabled)) return;
13126
13259
  onTabChange(fallbackTab.value);
13127
13260
  }, [activeTab, onTabChange, resolvedTabs]);
13128
- const items = (0, import_react21.useMemo)(() => {
13261
+ const items = (0, import_react22.useMemo)(() => {
13129
13262
  return resolvedTabs.map((tab) => {
13130
13263
  const isActive = tab.value === activeTab;
13131
13264
  return {
@@ -13137,7 +13270,7 @@ var EventListTabs = ({
13137
13270
  };
13138
13271
  });
13139
13272
  }, [activeTab, resolvedTabs]);
13140
- return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
13273
+ return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
13141
13274
  Tabs,
13142
13275
  {
13143
13276
  ariaLabel,
@@ -13152,7 +13285,7 @@ var EventListTabs = ({
13152
13285
  EventListTabs.displayName = "EventListTabs";
13153
13286
 
13154
13287
  // src/events/list/index.tsx
13155
- var import_jsx_runtime132 = require("react/jsx-runtime");
13288
+ var import_jsx_runtime133 = require("react/jsx-runtime");
13156
13289
  var SORT_ICON_BY_VALUE = {
13157
13290
  volume24hr: "sort-volume-24hr",
13158
13291
  topArbitrage: "sort-top-arbitrage",
@@ -13190,45 +13323,45 @@ var EventList = ({
13190
13323
  stateRef
13191
13324
  }) => {
13192
13325
  var _a, _b, _c, _d, _e;
13193
- const labels = (0, import_hooks44.useLabels)();
13194
- const { disabledVenues } = (0, import_hooks44.useAppConfig)();
13326
+ const labels = (0, import_hooks45.useLabels)();
13327
+ const { disabledVenues } = (0, import_hooks45.useAppConfig)();
13195
13328
  const {
13196
- features: { enableVenueEventDiscoveryFilters }
13197
- } = (0, import_hooks44.useSdkUiConfig)();
13329
+ features: { enableVenueEventDiscoveryFilters, showSportsMarkets }
13330
+ } = (0, import_hooks45.useSdkUiConfig)();
13198
13331
  const isDiscoveryFiltersEnabled = enableVenueEventDiscoveryFilters && !search;
13199
13332
  const resolvedTabs = useEventListTabs();
13200
- const visibleVenues = (0, import_react22.useMemo)(
13201
- () => disabledVenues.length === 0 ? void 0 : (0, import_hooks44.getVisibleVenueIdsByConfig)(import_sdk14.VENUES, disabledVenues),
13333
+ const visibleVenues = (0, import_react23.useMemo)(
13334
+ () => disabledVenues.length === 0 ? void 0 : (0, import_hooks45.getVisibleVenueIdsByConfig)(import_sdk14.VENUES, disabledVenues),
13202
13335
  [disabledVenues]
13203
13336
  );
13204
- const [activeTabValue, setActiveTabValue] = (0, import_react22.useState)(
13337
+ const [activeTabValue, setActiveTabValue] = (0, import_react23.useState)(
13205
13338
  (_b = initialVenueTab != null ? initialVenueTab : (_a = resolvedTabs[0]) == null ? void 0 : _a.value) != null ? _b : "matched"
13206
13339
  );
13207
- const [selectedSort, setSelectedSort] = (0, import_react22.useState)("volume24hr");
13208
- const [isSubcategoriesModalOpen, setIsSubcategoriesModalOpen] = (0, import_react22.useState)(false);
13209
- const [categoryPath, setCategoryPath] = (0, import_react22.useState)([]);
13210
- const [collapsedCategoryIds, setCollapsedCategoryIds] = (0, import_react22.useState)(() => /* @__PURE__ */ new Set());
13211
- const sortItems = (0, import_react22.useMemo)(() => {
13340
+ const [selectedSort, setSelectedSort] = (0, import_react23.useState)("volume24hr");
13341
+ const [isSubcategoriesModalOpen, setIsSubcategoriesModalOpen] = (0, import_react23.useState)(false);
13342
+ const [categoryPath, setCategoryPath] = (0, import_react23.useState)([]);
13343
+ const [collapsedCategoryIds, setCollapsedCategoryIds] = (0, import_react23.useState)(() => /* @__PURE__ */ new Set());
13344
+ const sortItems = (0, import_react23.useMemo)(() => {
13212
13345
  return [
13213
13346
  {
13214
13347
  value: "volume24hr",
13215
13348
  label: labels.eventList.sortBy24hVolume,
13216
- icon: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Icon, { name: SORT_ICON_BY_VALUE.volume24hr, size: "small", color: "currentColor" })
13349
+ icon: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Icon, { name: SORT_ICON_BY_VALUE.volume24hr, size: "small", color: "currentColor" })
13217
13350
  },
13218
13351
  {
13219
13352
  value: "topArbitrage",
13220
13353
  label: labels.eventList.sortByTopArbitrage,
13221
- icon: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Icon, { name: SORT_ICON_BY_VALUE.topArbitrage, size: "small", color: "currentColor" })
13354
+ icon: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Icon, { name: SORT_ICON_BY_VALUE.topArbitrage, size: "small", color: "currentColor" })
13222
13355
  },
13223
13356
  {
13224
13357
  value: "volume",
13225
13358
  label: labels.eventList.sortByTotalVolume,
13226
- icon: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Icon, { name: SORT_ICON_BY_VALUE.volume, size: "small", color: "currentColor" })
13359
+ icon: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Icon, { name: SORT_ICON_BY_VALUE.volume, size: "small", color: "currentColor" })
13227
13360
  },
13228
13361
  {
13229
13362
  value: "endDate",
13230
13363
  label: labels.eventList.sortByEndingSoon,
13231
- icon: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Icon, { name: SORT_ICON_BY_VALUE.endDate, size: "small", color: "currentColor" })
13364
+ icon: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Icon, { name: SORT_ICON_BY_VALUE.endDate, size: "small", color: "currentColor" })
13232
13365
  }
13233
13366
  ];
13234
13367
  }, [
@@ -13238,20 +13371,20 @@ var EventList = ({
13238
13371
  labels.eventList.sortByTotalVolume
13239
13372
  ]);
13240
13373
  const baseCategoryId = (_c = categoryIds == null ? void 0 : categoryIds[0]) != null ? _c : null;
13241
- (0, import_react22.useEffect)(() => {
13374
+ (0, import_react23.useEffect)(() => {
13242
13375
  if (!isDiscoveryFiltersEnabled) return;
13243
13376
  setCategoryPath([]);
13244
13377
  setCollapsedCategoryIds(/* @__PURE__ */ new Set());
13245
13378
  }, [baseCategoryId, isDiscoveryFiltersEnabled]);
13246
- const { categories: topLevelCategories } = (0, import_hooks44.useCategories)({
13379
+ const { categories: topLevelCategories } = (0, import_hooks45.useCategories)({
13247
13380
  queryKeyScope: "event-list-top-categories",
13248
13381
  enabled: isDiscoveryFiltersEnabled,
13249
13382
  limit: 100
13250
13383
  });
13251
- const sortedTopLevelCategories = (0, import_react22.useMemo)(() => {
13384
+ const sortedTopLevelCategories = (0, import_react23.useMemo)(() => {
13252
13385
  return sortCategoriesForNavigation(topLevelCategories);
13253
13386
  }, [topLevelCategories]);
13254
- const baseCategoryChildPrefetchIds = (0, import_react22.useMemo)(() => {
13387
+ const baseCategoryChildPrefetchIds = (0, import_react23.useMemo)(() => {
13255
13388
  return Array.from(
13256
13389
  /* @__PURE__ */ new Set([
13257
13390
  ...sortedTopLevelCategories.map((category) => category.id),
@@ -13259,13 +13392,13 @@ var EventList = ({
13259
13392
  ])
13260
13393
  );
13261
13394
  }, [categoryPath, sortedTopLevelCategories]);
13262
- const { childrenByParentId: baseChildrenByParentId } = (0, import_hooks44.useCategoryChildren)({
13395
+ const { childrenByParentId: baseChildrenByParentId } = (0, import_hooks45.useCategoryChildren)({
13263
13396
  queryKeyScope: "event-list-category-children",
13264
13397
  enabled: isDiscoveryFiltersEnabled,
13265
13398
  parentIds: baseCategoryChildPrefetchIds,
13266
13399
  limit: 100
13267
13400
  });
13268
- const visibleChildPrefetchIds = (0, import_react22.useMemo)(() => {
13401
+ const visibleChildPrefetchIds = (0, import_react23.useMemo)(() => {
13269
13402
  var _a2, _b2;
13270
13403
  const ids = /* @__PURE__ */ new Set();
13271
13404
  if (baseCategoryId) {
@@ -13280,13 +13413,13 @@ var EventList = ({
13280
13413
  }
13281
13414
  return Array.from(ids);
13282
13415
  }, [baseCategoryId, baseChildrenByParentId, categoryPath]);
13283
- const { childrenByParentId: visibleChildrenByParentId } = (0, import_hooks44.useCategoryChildren)({
13416
+ const { childrenByParentId: visibleChildrenByParentId } = (0, import_hooks45.useCategoryChildren)({
13284
13417
  queryKeyScope: "event-list-category-children",
13285
13418
  enabled: isDiscoveryFiltersEnabled,
13286
13419
  parentIds: visibleChildPrefetchIds,
13287
13420
  limit: 100
13288
13421
  });
13289
- const visibleGrandchildPrefetchIds = (0, import_react22.useMemo)(() => {
13422
+ const visibleGrandchildPrefetchIds = (0, import_react23.useMemo)(() => {
13290
13423
  var _a2;
13291
13424
  const ids = /* @__PURE__ */ new Set();
13292
13425
  for (const expandedCategory of categoryPath) {
@@ -13296,13 +13429,13 @@ var EventList = ({
13296
13429
  }
13297
13430
  return Array.from(ids);
13298
13431
  }, [categoryPath, visibleChildrenByParentId]);
13299
- const { childrenByParentId: visibleGrandchildrenByParentId } = (0, import_hooks44.useCategoryChildren)({
13432
+ const { childrenByParentId: visibleGrandchildrenByParentId } = (0, import_hooks45.useCategoryChildren)({
13300
13433
  queryKeyScope: "event-list-category-children",
13301
13434
  enabled: isDiscoveryFiltersEnabled,
13302
13435
  parentIds: visibleGrandchildPrefetchIds,
13303
13436
  limit: 100
13304
13437
  });
13305
- const childrenByParentId = (0, import_react22.useMemo)(() => {
13438
+ const childrenByParentId = (0, import_react23.useMemo)(() => {
13306
13439
  return new Map([
13307
13440
  ...baseChildrenByParentId,
13308
13441
  ...visibleChildrenByParentId,
@@ -13310,33 +13443,33 @@ var EventList = ({
13310
13443
  ]);
13311
13444
  }, [baseChildrenByParentId, visibleChildrenByParentId, visibleGrandchildrenByParentId]);
13312
13445
  const shouldRenderSubcategoryFilters = isDiscoveryFiltersEnabled && baseCategoryId !== null && (((_e = (_d = childrenByParentId.get(baseCategoryId)) == null ? void 0 : _d.length) != null ? _e : 0) > 0 || categoryPath.length > 0);
13313
- const baseCategoryEventCount = (0, import_react22.useMemo)(() => {
13446
+ const baseCategoryEventCount = (0, import_react23.useMemo)(() => {
13314
13447
  var _a2, _b2;
13315
13448
  return (_b2 = (_a2 = sortedTopLevelCategories.find((c) => c.id === baseCategoryId)) == null ? void 0 : _a2.eventCount) != null ? _b2 : 0;
13316
13449
  }, [baseCategoryId, sortedTopLevelCategories]);
13317
- const resolvedCategoryIds = (0, import_react22.useMemo)(() => {
13450
+ const resolvedCategoryIds = (0, import_react23.useMemo)(() => {
13318
13451
  if (!isDiscoveryFiltersEnabled) return categoryIds;
13319
13452
  return resolveCategoryIdsFromPath(categoryPath, baseCategoryId ? [baseCategoryId] : void 0);
13320
13453
  }, [baseCategoryId, categoryIds, categoryPath, isDiscoveryFiltersEnabled]);
13321
- const sortQueryParams = (0, import_react22.useMemo)(() => {
13454
+ const sortQueryParams = (0, import_react23.useMemo)(() => {
13322
13455
  return resolveSortQueryParams(selectedSort);
13323
13456
  }, [selectedSort]);
13324
- const activeTab = (0, import_react22.useMemo)(() => {
13457
+ const activeTab = (0, import_react23.useMemo)(() => {
13325
13458
  return resolvedTabs.find((tab) => tab.value === activeTabValue);
13326
13459
  }, [activeTabValue, resolvedTabs]);
13327
- const venues = (0, import_react22.useMemo)(() => {
13460
+ const venues = (0, import_react23.useMemo)(() => {
13328
13461
  return resolveTabVenus(activeTab, visibleVenues);
13329
13462
  }, [activeTab, visibleVenues]);
13330
- const matchStatus = (0, import_react22.useMemo)(() => {
13463
+ const matchStatus = (0, import_react23.useMemo)(() => {
13331
13464
  return activeTabValue === "matched" ? activeTab == null ? void 0 : activeTab.matchStatus : void 0;
13332
13465
  }, [activeTabValue, activeTab]);
13333
- const resolvedMaxVisibleItems = (0, import_react22.useMemo)(() => {
13466
+ const resolvedMaxVisibleItems = (0, import_react23.useMemo)(() => {
13334
13467
  if (!Number.isFinite(maxVisibleItems)) return void 0;
13335
13468
  return Math.max(1, Math.floor(maxVisibleItems));
13336
13469
  }, [maxVisibleItems]);
13337
13470
  const requestLimit = resolvedMaxVisibleItems != null ? resolvedMaxVisibleItems : limit;
13338
13471
  const shouldPaginate = resolvedMaxVisibleItems == null;
13339
- const endDateFrom = (0, import_react22.useMemo)(() => {
13472
+ const endDateFrom = (0, import_react23.useMemo)(() => {
13340
13473
  if (search) return void 0;
13341
13474
  const BUCKET_MINUTES = 5;
13342
13475
  const bucket = /* @__PURE__ */ new Date();
@@ -13352,34 +13485,38 @@ var EventList = ({
13352
13485
  isFetchingNextPage,
13353
13486
  isPlaceholderData,
13354
13487
  loadedPageCount
13355
- } = (0, import_hooks44.useVenueEvents)({
13488
+ } = (0, import_hooks45.useVenueEvents)({
13356
13489
  queryKeyScope: "event-list",
13357
13490
  venues,
13358
13491
  search,
13359
13492
  categoryIds: resolvedCategoryIds,
13360
13493
  matchStatus,
13361
13494
  limit: requestLimit,
13362
- status: [import_hooks44.MarketStatus.open],
13495
+ status: [import_hooks45.MarketStatus.open],
13363
13496
  sortBy: sortQueryParams.sortBy,
13364
13497
  sortDir: sortQueryParams.sortDir,
13365
13498
  endDateFrom,
13499
+ // Fold same-venue companion events into one tile per game when the sports
13500
+ // markets experience is enabled (the sports event-detail view loads the
13501
+ // folded companions via aggKey). Gated on the same flag as that view.
13502
+ grouped: showSportsMarkets,
13366
13503
  initialPages: initialLoadedPageCount
13367
13504
  });
13368
- (0, import_react22.useEffect)(() => {
13505
+ (0, import_react23.useEffect)(() => {
13369
13506
  if (stateRef) {
13370
13507
  stateRef.current = { venueTab: activeTabValue, loadedPageCount };
13371
13508
  }
13372
13509
  }, [stateRef, activeTabValue, loadedPageCount]);
13373
- const filteredEvents = (0, import_react22.useMemo)(() => {
13510
+ const filteredEvents = (0, import_react23.useMemo)(() => {
13374
13511
  return filterEventsByTabValue(events, activeTabValue);
13375
13512
  }, [events, activeTabValue]);
13376
- const groupedEvents = (0, import_react22.useMemo)(() => {
13513
+ const groupedEvents = (0, import_react23.useMemo)(() => {
13377
13514
  return splitEventsByLifecycle(filteredEvents);
13378
13515
  }, [filteredEvents]);
13379
- const orderedEvents = (0, import_react22.useMemo)(() => {
13516
+ const orderedEvents = (0, import_react23.useMemo)(() => {
13380
13517
  return groupedEvents.open;
13381
13518
  }, [groupedEvents.open]);
13382
- const tileEvents = (0, import_react22.useMemo)(() => {
13519
+ const tileEvents = (0, import_react23.useMemo)(() => {
13383
13520
  const normalizedEvents = orderedEvents.map((event) => mapEventToEventListItemEvent(event)).filter((event) => event != null);
13384
13521
  if (resolvedMaxVisibleItems == null) return normalizedEvents;
13385
13522
  return normalizedEvents.slice(0, resolvedMaxVisibleItems);
@@ -13387,8 +13524,8 @@ var EventList = ({
13387
13524
  const shouldRenderLoadingState = isLoading && !isPlaceholderData && tileEvents.length === 0;
13388
13525
  const shouldRenderEmptyState = !isLoading && !isError && tileEvents.length === 0;
13389
13526
  const shouldRenderPaginationLoadingItems = shouldPaginate && hasNextPage;
13390
- const loadMoreRef = (0, import_react22.useRef)(null);
13391
- (0, import_react22.useEffect)(() => {
13527
+ const loadMoreRef = (0, import_react23.useRef)(null);
13528
+ (0, import_react23.useEffect)(() => {
13392
13529
  if (!shouldPaginate) return;
13393
13530
  if (!hasNextPage) return;
13394
13531
  if (typeof IntersectionObserver === "undefined") return;
@@ -13439,7 +13576,7 @@ var EventList = ({
13439
13576
  onCategoryRootChange == null ? void 0 : onCategoryRootChange(baseCategoryId != null ? baseCategoryId : void 0);
13440
13577
  };
13441
13578
  if (shouldRenderLoadingState) {
13442
- return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
13579
+ return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
13443
13580
  Skeleton,
13444
13581
  {
13445
13582
  view: "event-list",
@@ -13448,8 +13585,8 @@ var EventList = ({
13448
13585
  }
13449
13586
  );
13450
13587
  }
13451
- return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("section", { className: "agg-event-list flex w-full flex-col gap-2 md:gap-5 t", children: [
13452
- /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(
13588
+ return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("section", { className: "agg-event-list flex w-full flex-col gap-2 md:gap-5 t", children: [
13589
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
13453
13590
  "header",
13454
13591
  {
13455
13592
  className: cn(
@@ -13458,9 +13595,9 @@ var EventList = ({
13458
13595
  "gap-2 sm:flex-row sm:items-center sm:gap-4"
13459
13596
  ),
13460
13597
  children: [
13461
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "agg-event-list-title min-w-32", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Typography, { as: "h2", variant: "title", className: "truncate first-letter:uppercase", children: title2 }) }),
13462
- /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "hidden min-w-0 max-w-full items-center gap-3 md:flex", children: [
13463
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
13598
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { className: "agg-event-list-title min-w-32", children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Typography, { as: "h2", variant: "title", className: "truncate first-letter:uppercase", children: title2 }) }),
13599
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "hidden min-w-0 max-w-full items-center gap-3 md:flex", children: [
13600
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
13464
13601
  EventListTabs,
13465
13602
  {
13466
13603
  ariaLabel: labels.eventList.tabsAria(title2),
@@ -13470,7 +13607,7 @@ var EventList = ({
13470
13607
  overflowBehavior: "scroll"
13471
13608
  }
13472
13609
  ),
13473
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
13610
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
13474
13611
  Select,
13475
13612
  {
13476
13613
  ariaLabel: labels.eventList.sortByLabel,
@@ -13486,8 +13623,8 @@ var EventList = ({
13486
13623
  ]
13487
13624
  }
13488
13625
  ),
13489
- /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex w-full gap-2 md:hidden mb-3", children: [
13490
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
13626
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "flex w-full gap-2 md:hidden mb-3", children: [
13627
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
13491
13628
  EventListTabs,
13492
13629
  {
13493
13630
  ariaLabel: labels.eventList.tabsAria(title2),
@@ -13497,7 +13634,7 @@ var EventList = ({
13497
13634
  overflowBehavior: "select"
13498
13635
  }
13499
13636
  ),
13500
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
13637
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
13501
13638
  Select,
13502
13639
  {
13503
13640
  ariaLabel: labels.eventList.sortByLabel,
@@ -13508,23 +13645,23 @@ var EventList = ({
13508
13645
  contentClassName: "rounded-[12px] py-2 shadow-[0_8px_16px_rgba(0,0,0,0.1)]"
13509
13646
  }
13510
13647
  ),
13511
- shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
13648
+ shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
13512
13649
  "button",
13513
13650
  {
13514
13651
  type: "button",
13515
13652
  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",
13516
13653
  "aria-label": labels.eventList.subcategoriesOpenAria,
13517
13654
  onClick: () => setIsSubcategoriesModalOpen(true),
13518
- children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Icon, { name: "apps", size: "small", color: "currentColor" })
13655
+ children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Icon, { name: "apps", size: "small", color: "currentColor" })
13519
13656
  }
13520
13657
  ) : null
13521
13658
  ] }),
13522
- /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(
13659
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
13523
13660
  "div",
13524
13661
  {
13525
13662
  className: cn("flex w-full gap-6", shouldRenderSubcategoryFilters ? "md:items-start" : ""),
13526
13663
  children: [
13527
- shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("aside", { className: "hidden w-[200px] shrink-0 md:block self-start sticky top-4", children: /* @__PURE__ */ (0, import_jsx_runtime132.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_runtime132.jsx)(
13664
+ shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("aside", { className: "hidden w-[200px] shrink-0 md:block self-start sticky top-4", children: /* @__PURE__ */ (0, import_jsx_runtime133.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_runtime133.jsx)(
13528
13665
  CategorySidebar,
13529
13666
  {
13530
13667
  baseCategoryId,
@@ -13537,7 +13674,7 @@ var EventList = ({
13537
13674
  onToggleCategory: handleToggleSubcategory
13538
13675
  }
13539
13676
  ) }) }) : null,
13540
- /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(
13677
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
13541
13678
  "div",
13542
13679
  {
13543
13680
  className: cn(
@@ -13548,7 +13685,7 @@ var EventList = ({
13548
13685
  gridClassName
13549
13686
  ),
13550
13687
  children: [
13551
- tileEvents.map((event) => /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
13688
+ tileEvents.map((event) => /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
13552
13689
  EventListItem,
13553
13690
  {
13554
13691
  event,
@@ -13559,11 +13696,11 @@ var EventList = ({
13559
13696
  onMarketClick,
13560
13697
  getMarketHref,
13561
13698
  href: getEventHref == null ? void 0 : getEventHref(event),
13562
- marketStatus: import_hooks44.MarketStatus.open
13699
+ marketStatus: import_hooks45.MarketStatus.open
13563
13700
  },
13564
13701
  event.id
13565
13702
  )),
13566
- shouldRenderPaginationLoadingItems ? Array.from({ length: 6 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
13703
+ shouldRenderPaginationLoadingItems ? Array.from({ length: 6 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
13567
13704
  EventListItem,
13568
13705
  {
13569
13706
  isLoading: true,
@@ -13573,20 +13710,20 @@ var EventList = ({
13573
13710
  },
13574
13711
  `loading-${index}`
13575
13712
  )) : null,
13576
- shouldRenderEmptyState ? /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "col-span-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
13713
+ shouldRenderEmptyState ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { className: "col-span-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
13577
13714
  StateMessage,
13578
13715
  {
13579
13716
  title: labels.eventList.emptyTitle,
13580
13717
  description: labels.eventList.emptyDescription,
13581
- icon: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Icon, { name: "search-empty" })
13718
+ icon: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Icon, { name: "search-empty" })
13582
13719
  }
13583
13720
  ) }) : null,
13584
- isError ? /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "col-span-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
13721
+ isError ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { className: "col-span-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
13585
13722
  StateMessage,
13586
13723
  {
13587
13724
  title: labels.eventList.errorTitle,
13588
13725
  description: labels.eventList.errorDescription,
13589
- icon: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Icon, { name: "warning" })
13726
+ icon: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Icon, { name: "warning" })
13590
13727
  }
13591
13728
  ) }) : null
13592
13729
  ]
@@ -13595,7 +13732,7 @@ var EventList = ({
13595
13732
  ]
13596
13733
  }
13597
13734
  ),
13598
- shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Modal, { open: isSubcategoriesModalOpen, onOpenChange: setIsSubcategoriesModalOpen, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
13735
+ shouldRenderSubcategoryFilters ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Modal, { open: isSubcategoriesModalOpen, onOpenChange: setIsSubcategoriesModalOpen, children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
13599
13736
  Modal.Container,
13600
13737
  {
13601
13738
  classNames: {
@@ -13604,20 +13741,20 @@ var EventList = ({
13604
13741
  content: "items-end p-0 pointer-events-none",
13605
13742
  container: "w-full max-w-none border-0 bg-transparent shadow-none"
13606
13743
  },
13607
- children: /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "pointer-events-auto w-full rounded-t-[12px] border border-agg-separator bg-agg-secondary", children: [
13608
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "flex justify-center pb-1 pt-3", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "h-1 w-10 rounded-full bg-agg-muted-foreground/30" }) }),
13609
- /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex items-center justify-between px-4 pb-2 pt-1", children: [
13610
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Dialog2.Title, { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.eventList.subcategoriesLabel }),
13611
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
13744
+ children: /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "pointer-events-auto w-full rounded-t-[12px] border border-agg-separator bg-agg-secondary", children: [
13745
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { className: "flex justify-center pb-1 pt-3", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { className: "h-1 w-10 rounded-full bg-agg-muted-foreground/30" }) }),
13746
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "flex items-center justify-between px-4 pb-2 pt-1", children: [
13747
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Dialog2.Title, { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.eventList.subcategoriesLabel }),
13748
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
13612
13749
  Dialog2.Close,
13613
13750
  {
13614
13751
  className: "flex cursor-pointer items-center justify-center rounded-full p-1 text-agg-muted-foreground hover:bg-agg-secondary-hover",
13615
13752
  "aria-label": labels.common.close,
13616
- children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(CloseIcon, { className: "h-5 w-5" })
13753
+ children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(CloseIcon, { className: "h-5 w-5" })
13617
13754
  }
13618
13755
  )
13619
13756
  ] }),
13620
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "flex flex-col gap-1 px-4 pb-4", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
13757
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { className: "flex flex-col gap-1 px-4 pb-4", children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
13621
13758
  CategorySidebar,
13622
13759
  {
13623
13760
  baseCategoryId,
@@ -13633,7 +13770,7 @@ var EventList = ({
13633
13770
  ] })
13634
13771
  }
13635
13772
  ) }) : null,
13636
- shouldPaginate && hasNextPage ? /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { ref: loadMoreRef, className: "agg-event-list-sentinel h-px w-full", "aria-hidden": true }) : null
13773
+ shouldPaginate && hasNextPage ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { ref: loadMoreRef, className: "agg-event-list-sentinel h-px w-full", "aria-hidden": true }) : null
13637
13774
  ] });
13638
13775
  };
13639
13776
  EventList.displayName = "EventList";
@@ -13653,6 +13790,7 @@ EventList.displayName = "EventList";
13653
13790
  formatProbabilityCents,
13654
13791
  mergeVenueOutcomeOrderbooks,
13655
13792
  orderbookRowLimitDefault,
13793
+ resolveEventDetailsSyncKey,
13656
13794
  resolveOrderBookRows,
13657
13795
  resolveUnifiedOrderBookEntries,
13658
13796
  useCenterOrderbookSpread