@agg-build/ui 2.6.0 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  UserProfilePage,
12
12
  buildAggTxExplorerHref,
13
13
  useHomePageModals
14
- } from "./chunk-TQL5I4GX.mjs";
14
+ } from "./chunk-KFNTS2TV.mjs";
15
15
  import {
16
16
  EventList,
17
17
  EventListItem,
@@ -28,7 +28,7 @@ import {
28
28
  orderbookRowLimitDefault,
29
29
  resolveEventDetailsSyncKey,
30
30
  useCenterOrderbookSpread
31
- } from "./chunk-XAG432PJ.mjs";
31
+ } from "./chunk-BVNXMHSL.mjs";
32
32
  import {
33
33
  CARD_NETWORK_OPTIONS,
34
34
  DepositModal,
@@ -54,7 +54,7 @@ import {
54
54
  requestAggWithdrawModalOpen,
55
55
  useClaimWinnings,
56
56
  useResolvedMarketClaim
57
- } from "./chunk-FAU2VOL6.mjs";
57
+ } from "./chunk-O27JUYCF.mjs";
58
58
  import {
59
59
  SETTLEMENT_SECTION_ID,
60
60
  Settlement,
package/dist/pages.js CHANGED
@@ -16213,7 +16213,10 @@ var MarketDetailsList = ({
16213
16213
  } = (0, import_hooks49.useVenueMarkets)({
16214
16214
  venueEventId: resolvedEventId,
16215
16215
  enabled: !providedMarkets && !!resolvedEventId,
16216
- status: import_hooks49.MarketStatus.open
16216
+ status: import_hooks49.MarketStatus.open,
16217
+ // Keep in lockstep with useEnrichedVenueEvent: limit is part of the React
16218
+ // Query key, so a mismatch would fork the shared cache into two requests.
16219
+ limit: 40
16217
16220
  // No explicit sortBy: event-scoped /venue-markets sorts by the event's
16218
16221
  // type-aware order (structureOrderBy), matching the home-card top-3 and the
16219
16222
  // markets-under-an-event ordering. Passing sortBy here would override it.
@@ -18331,7 +18334,7 @@ var buildLiveRouteCards = ({
18331
18334
  };
18332
18335
  }
18333
18336
  const avgPrice = sq.avgPrice;
18334
- const soloQuoteData = __spreadProps(__spreadValues({}, quoteData), {
18337
+ const soloQuoteData = __spreadValues(__spreadProps(__spreadValues({}, quoteData), {
18335
18338
  // Preview-only solos intentionally carry no executable quoteId; the card
18336
18339
  // should still render for comparison, while the CTA stays disabled until
18337
18340
  // the user is funded and requotes.
@@ -18344,7 +18347,7 @@ var buildLiveRouteCards = ({
18344
18347
  returnPct: sq.returnPct,
18345
18348
  // venueSoloQuotes stripped on solo card's quoteData (only the primary needs them)
18346
18349
  venueSoloQuotes: void 0
18347
- });
18350
+ }), sq.quoteId ? { status: "ok", error: void 0 } : null);
18348
18351
  return {
18349
18352
  id: `live-solo-${sq.venue}`,
18350
18353
  hint: labels.averagePrice(avgPrice),
@@ -18400,6 +18403,17 @@ var buildLiveRouteCards = ({
18400
18403
  })() : [];
18401
18404
  return [...baseCards, ...unavailableCards, ...warningOnlyUnavailableCards];
18402
18405
  };
18406
+ var resolveDefaultRouteCardId = (routeCards, primaryStatus) => {
18407
+ var _a, _b, _c, _d;
18408
+ if (routeCards.length === 0) return null;
18409
+ if (primaryStatus === "insufficient_balance") {
18410
+ const executableCard = routeCards.find(
18411
+ (card) => !card.isUnavailable && card.quoteData.status === "ok" && card.quoteData.quoteId
18412
+ );
18413
+ if (executableCard) return executableCard.id;
18414
+ }
18415
+ return (_d = (_c = (_a = routeCards.find((card) => !card.isUnavailable)) == null ? void 0 : _a.id) != null ? _c : (_b = routeCards[0]) == null ? void 0 : _b.id) != null ? _d : null;
18416
+ };
18403
18417
  var sellSharesToAtomicUnits = (shares) => {
18404
18418
  if (!Number.isFinite(shares) || shares <= 0) return BigInt(0);
18405
18419
  const [whole = "0", fraction = ""] = shares.toFixed(12).split(".");
@@ -20334,7 +20348,7 @@ var PlaceOrder = ({
20334
20348
  resolvedClaim,
20335
20349
  midpointsResult
20336
20350
  }) => {
20337
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X;
20351
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y;
20338
20352
  const {
20339
20353
  enableDebug: isExecutionDebugEnabled,
20340
20354
  features: { enableAnimations, showFeesBreakdown, showLimitOrders },
@@ -20765,13 +20779,13 @@ var PlaceOrder = ({
20765
20779
  venueSellQuotes.quotes
20766
20780
  ]);
20767
20781
  const resolvedSelectedRouteCardId = (0, import_react36.useMemo)(() => {
20768
- var _a2, _b2, _c2, _d2;
20782
+ var _a2;
20769
20783
  if (routeCards.length === 0) return null;
20770
20784
  if (selectedRouteCardId && routeCards.some((card) => card.id === selectedRouteCardId && !card.isUnavailable)) {
20771
20785
  return selectedRouteCardId;
20772
20786
  }
20773
- return (_d2 = (_c2 = (_a2 = routeCards.find((card) => !card.isUnavailable)) == null ? void 0 : _a2.id) != null ? _c2 : (_b2 = routeCards[0]) == null ? void 0 : _b2.id) != null ? _d2 : null;
20774
- }, [routeCards, selectedRouteCardId]);
20787
+ return resolveDefaultRouteCardId(routeCards, isSell ? void 0 : (_a2 = smartRoute.data) == null ? void 0 : _a2.status);
20788
+ }, [routeCards, selectedRouteCardId, isSell, (_w = smartRoute.data) == null ? void 0 : _w.status]);
20775
20789
  (0, import_react36.useEffect)(() => {
20776
20790
  if (routeCards.length === 0) {
20777
20791
  setSelectedRouteCardId(null);
@@ -20811,14 +20825,14 @@ var PlaceOrder = ({
20811
20825
  setLimitPriceInputError(null);
20812
20826
  }, [executionType, scopedSelectedOutcomeId, selectedOutcomeDisplayPrice]);
20813
20827
  const orderedRouteCards = routeCards;
20814
- const selectedRouteCard = (_x = (_w = orderedRouteCards.find((card) => card.id === resolvedSelectedRouteCardId)) != null ? _w : orderedRouteCards[0]) != null ? _x : null;
20828
+ const selectedRouteCard = (_y = (_x = orderedRouteCards.find((card) => card.id === resolvedSelectedRouteCardId)) != null ? _x : orderedRouteCards[0]) != null ? _y : null;
20815
20829
  const isKalshiRoute = (0, import_react36.useMemo)(() => {
20816
20830
  if (selectedRouteCard) {
20817
20831
  return selectedRouteCard.venue === "kalshi" || selectedRouteCard.quoteData.fills.some((f) => f.venue === "kalshi");
20818
20832
  }
20819
20833
  return (scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) === "kalshi";
20820
20834
  }, [selectedRouteCard, scopedSelectedMarket]);
20821
- const displayedBalance = isPaperMode ? paperTotalBalance : isKalshiRoute ? (_y = liveBalanceState.kalshiBalance) != null ? _y : 0 : liveAvailableBalance;
20835
+ const displayedBalance = isPaperMode ? paperTotalBalance : isKalshiRoute ? (_z = liveBalanceState.kalshiBalance) != null ? _z : 0 : liveAvailableBalance;
20822
20836
  const legacyKalshiAccount = (0, import_react36.useMemo)(
20823
20837
  () => {
20824
20838
  var _a2;
@@ -20826,8 +20840,8 @@ var PlaceOrder = ({
20826
20840
  },
20827
20841
  [user == null ? void 0 : user.venueAccounts]
20828
20842
  );
20829
- const isKalshiAccountActive = (_z = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.connected) != null ? _z : (legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.status) === "active";
20830
- const isKalshiVerified = ((_A = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.kycStatus) != null ? _A : legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.kycStatus) === "verified";
20843
+ const isKalshiAccountActive = (_A = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.connected) != null ? _A : (legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.status) === "active";
20844
+ const isKalshiVerified = ((_B = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.kycStatus) != null ? _B : legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.kycStatus) === "verified";
20831
20845
  const hasKalshiConnectionState = kalshiKeyStatus !== void 0 || (user == null ? void 0 : user.venueAccounts) != null;
20832
20846
  const isKalshiAvailable = (0, import_hooks60.getVenueAvailabilityState)({
20833
20847
  venueId: "kalshi",
@@ -20854,7 +20868,7 @@ var PlaceOrder = ({
20854
20868
  [aggClient, onConnectKalshi, refetchKalshiKeyStatus]
20855
20869
  );
20856
20870
  const needsKycVerification = isAuthenticated && hasKalshiConnectionState && isKalshiRoute && isKalshiAccountActive && !isKalshiVerified;
20857
- const verifyKalshiConnectionLabel = (_E = (_D = (_C = (_B = labels.onboarding) == null ? void 0 : _B.connectKalshiModal) == null ? void 0 : _C.actions) == null ? void 0 : _D.verifyConnection) != null ? _E : tradingLabels.kycRequired;
20871
+ const verifyKalshiConnectionLabel = (_F = (_E = (_D = (_C = labels.onboarding) == null ? void 0 : _C.connectKalshiModal) == null ? void 0 : _D.actions) == null ? void 0 : _E.verifyConnection) != null ? _F : tradingLabels.kycRequired;
20858
20872
  const handleRouteCardSelect = (0, import_react36.useCallback)(
20859
20873
  (cardId) => {
20860
20874
  if (cardId === resolvedSelectedRouteCardId) {
@@ -20869,15 +20883,15 @@ var PlaceOrder = ({
20869
20883
  [resolvedSelectedRouteCardId, routeCards]
20870
20884
  );
20871
20885
  const executionProgress = (0, import_hooks60.useExecutionProgress)({
20872
- orderIds: (_F = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) != null ? _F : null,
20873
- quoteId: (_G = submissionProgressState == null ? void 0 : submissionProgressState.quoteId) != null ? _G : null,
20886
+ orderIds: (_G = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) != null ? _G : null,
20887
+ quoteId: (_H = submissionProgressState == null ? void 0 : submissionProgressState.quoteId) != null ? _H : null,
20874
20888
  mode: isPaperMode ? "paper" : void 0,
20875
- enabled: ((submissionProgressState == null ? void 0 : submissionProgressState.phase) === "submitting" || (submissionProgressState == null ? void 0 : submissionProgressState.phase) === "executing") && !!((_H = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) == null ? void 0 : _H.length)
20889
+ enabled: ((submissionProgressState == null ? void 0 : submissionProgressState.phase) === "submitting" || (submissionProgressState == null ? void 0 : submissionProgressState.phase) === "executing") && !!((_I = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) == null ? void 0 : _I.length)
20876
20890
  });
20877
- const selectedOutcomeLabel = (_K = (_J = (_I = outcomes.find((outcome) => outcome.id === scopedSelectedOutcomeId)) == null ? void 0 : _I.label) != null ? _J : scopedSelectedOutcome == null ? void 0 : scopedSelectedOutcome.label) != null ? _K : "";
20878
- const headerImage = (_M = (_L = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.image) != null ? _L : scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.image) != null ? _M : null;
20879
- const headerTitle = (_O = (_N = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.title) != null ? _N : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _O : "";
20880
- const headerSubtitle = (_P = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _P : "";
20891
+ const selectedOutcomeLabel = (_L = (_K = (_J = outcomes.find((outcome) => outcome.id === scopedSelectedOutcomeId)) == null ? void 0 : _J.label) != null ? _K : scopedSelectedOutcome == null ? void 0 : scopedSelectedOutcome.label) != null ? _L : "";
20892
+ const headerImage = (_N = (_M = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.image) != null ? _M : scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.image) != null ? _N : null;
20893
+ const headerTitle = (_P = (_O = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.title) != null ? _O : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _P : "";
20894
+ const headerSubtitle = (_Q = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _Q : "";
20881
20895
  const buildExecutionSummary = (0, import_react36.useCallback)(
20882
20896
  (quoteData, executionVenue, orderId, partialFillSummary) => {
20883
20897
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
@@ -21175,19 +21189,19 @@ var PlaceOrder = ({
21175
21189
  queryClient,
21176
21190
  submissionProgressState
21177
21191
  ]);
21178
- const activeQuoteData = (_R = (_Q = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData) != null ? _Q : smartRoute.data) != null ? _R : null;
21192
+ const activeQuoteData = (_S = (_R = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData) != null ? _R : smartRoute.data) != null ? _S : null;
21179
21193
  const visibleRouteCards = orderedRouteCards.length > PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT && !isRoutesExpanded ? orderedRouteCards.slice(0, PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT) : orderedRouteCards;
21180
21194
  const hasEnteredAmount = internalAmount > 0;
21181
21195
  const isQuoteLoading = !isLimitOrder && hasEnteredAmount && (smartRoute.isFetching || smartRoute.isLoading || isSell && (venueSellQuotes.isFetching || venueSellQuotes.isLoading));
21182
21196
  const routeLoadingMessage = isQuoteLoading ? smartRoute.loadingReason === "updating-route" ? tradingLabels.updatingRoute : smartRoute.loadingReason === "refreshing-quotes" ? tradingLabels.refreshingQuotes : tradingLabels.findingBestOdds : null;
21183
- const selectedRouteFills = (_S = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData.fills) != null ? _S : [];
21197
+ const selectedRouteFills = (_T = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData.fills) != null ? _T : [];
21184
21198
  const isKalshiOnlyRoute = isKalshiRoute && ((selectedRouteCard == null ? void 0 : selectedRouteCard.venue) === import_sdk22.Venue.kalshi || selectedRouteFills.length > 0 && selectedRouteFills.every((fill) => fill.venue === import_sdk22.Venue.kalshi));
21185
21199
  const isOnchainOnlyRoute = !isKalshiRoute || selectedRouteFills.length > 0 && selectedRouteFills.every((fill) => fill.venue !== import_sdk22.Venue.kalshi);
21186
21200
  const kalshiRequiredAmount = isSell ? 0 : selectedRouteFills.filter((fill) => fill.venue === import_sdk22.Venue.kalshi).reduce((total, fill) => total + fill.venueQty * fill.avgPrice, 0);
21187
21201
  const onchainRequiredAmount = isSell ? 0 : selectedRouteFills.filter((fill) => fill.venue !== import_sdk22.Venue.kalshi).reduce((total, fill) => total + fill.venueQty * fill.avgPrice, 0);
21188
21202
  const resolvedKalshiRequiredAmount = isKalshiOnlyRoute || isKalshiRoute && selectedRouteFills.length === 0 ? internalAmount : kalshiRequiredAmount;
21189
21203
  const resolvedOnchainRequiredAmount = isOnchainOnlyRoute || !isKalshiRoute && selectedRouteFills.length === 0 ? internalAmount : onchainRequiredAmount;
21190
- const isKalshiBalanceInsufficient = !isPaperMode && isKalshiRoute && resolvedKalshiRequiredAmount > ((_T = liveBalanceState.kalshiBalance) != null ? _T : 0);
21204
+ const isKalshiBalanceInsufficient = !isPaperMode && isKalshiRoute && resolvedKalshiRequiredAmount > ((_U = liveBalanceState.kalshiBalance) != null ? _U : 0);
21191
21205
  const isOnchainBalanceInsufficient = resolvedOnchainRequiredAmount > liveAvailableBalance;
21192
21206
  const isInsufficientBalance = !isSell && isAuthenticated && hasEnteredAmount && !isBalanceLoading && (isLimitOrder ? internalAmount > totalBalance : isPaperMode ? internalAmount > paperTotalBalance : isKalshiBalanceInsufficient || isOnchainBalanceInsufficient);
21193
21207
  const isQuoteInsufficientBalance = !isLimitOrder && (activeQuoteData == null ? void 0 : activeQuoteData.status) === "insufficient_balance";
@@ -21281,7 +21295,7 @@ var PlaceOrder = ({
21281
21295
  }
21282
21296
  return (_d2 = selectedRouteCard.hint) != null ? _d2 : "";
21283
21297
  }, [selectedRouteCard, tradingLabels]);
21284
- const displayedToWinValue = (_U = selectedRouteCard == null ? void 0 : selectedRouteCard.numericValue) != null ? _U : 0;
21298
+ const displayedToWinValue = (_V = selectedRouteCard == null ? void 0 : selectedRouteCard.numericValue) != null ? _V : 0;
21285
21299
  const limitOrderPayload = (0, import_react36.useMemo)(() => {
21286
21300
  if (!scopedSelectedMarket || !scopedSelectedOutcomeId || internalAmount <= 0) return null;
21287
21301
  if (limitPriceInputError) return null;
@@ -21400,13 +21414,13 @@ var PlaceOrder = ({
21400
21414
  ];
21401
21415
  }, [activeFeeBreakdown, tradingLabels]);
21402
21416
  const isActionLoading = isPrimaryActionLoading || executeManaged.isPending || placeLimitOrder.isPending || isBeforeActionPending;
21403
- const selectedRouteGeoBlocked = (_V = selectedRouteCard == null ? void 0 : selectedRouteCard.isUnavailable) != null ? _V : false;
21417
+ const selectedRouteGeoBlocked = (_W = selectedRouteCard == null ? void 0 : selectedRouteCard.isUnavailable) != null ? _W : false;
21404
21418
  const geoBlockedVenuesFromWarnings = (0, import_react36.useMemo)(
21405
21419
  () => {
21406
21420
  var _a2;
21407
21421
  return extractGeoBlockedVenues((_a2 = smartRoute.data) == null ? void 0 : _a2.warnings);
21408
21422
  },
21409
- [(_W = smartRoute.data) == null ? void 0 : _W.warnings]
21423
+ [(_X = smartRoute.data) == null ? void 0 : _X.warnings]
21410
21424
  );
21411
21425
  const isPrimaryVenueGeoBlocked = (0, import_react36.useMemo)(() => {
21412
21426
  var _a2, _b2;
@@ -22064,7 +22078,7 @@ var PlaceOrder = ({
22064
22078
  PlaceOrderResolvedView,
22065
22079
  {
22066
22080
  tradingState: resolvedReadOnlyTradingState,
22067
- resolutionTimestamp: (_X = resolvedEventTradingState.resolvesAt) != null ? _X : resolvedReadOnlyTradingState.resolvesAt,
22081
+ resolutionTimestamp: (_Y = resolvedEventTradingState.resolvesAt) != null ? _Y : resolvedReadOnlyTradingState.resolvesAt,
22068
22082
  resolvedClaim,
22069
22083
  classNames,
22070
22084
  className,
@@ -23528,9 +23542,9 @@ var SPORTS_PERIOD_ORDER = [
23528
23542
  "first_inning",
23529
23543
  "second_inning",
23530
23544
  "third_inning",
23531
- "first_5_innings",
23532
23545
  "other"
23533
23546
  ];
23547
+ var FIRST_N_INNINGS_PATTERN = /^first_(\d{1,2})_innings$/;
23534
23548
  var SPORTS_MARKET_TYPE_ORDER = [
23535
23549
  "to_advance",
23536
23550
  "moneyline",
@@ -23561,6 +23575,10 @@ var stripLineValueFromQuestion = (question) => {
23561
23575
  var SPORTS_PERIOD_FAMILY_ORDER = ["period", "inning", "set", "map", "game"];
23562
23576
  var getSportsPeriodOrderIndex = (period) => {
23563
23577
  var _a, _b;
23578
+ const inningsMatch = FIRST_N_INNINGS_PATTERN.exec(period);
23579
+ if (inningsMatch) {
23580
+ return SPORTS_PERIOD_ORDER.indexOf("third_inning") + 1 + Number(inningsMatch[1]) / 100;
23581
+ }
23564
23582
  const periodIndex = SPORTS_PERIOD_ORDER.indexOf(period);
23565
23583
  if (periodIndex >= 0) {
23566
23584
  return period === "other" ? Number.MAX_SAFE_INTEGER : periodIndex;
@@ -23663,6 +23681,28 @@ var resolveMarketSectionTabKey = (market) => {
23663
23681
  if (category === "other") return "other";
23664
23682
  return null;
23665
23683
  };
23684
+ var SPORTS_PERIOD_FAMILY_ALLOWED_SPORTS = {
23685
+ halves: /* @__PURE__ */ new Set(["soccer", "basketball", "american_football", "rugby", "aussie_rules"]),
23686
+ quarters: /* @__PURE__ */ new Set(["basketball", "american_football", "lacrosse", "aussie_rules"]),
23687
+ innings: /* @__PURE__ */ new Set(["baseball"]),
23688
+ sets: /* @__PURE__ */ new Set(["tennis", "table_tennis", "volleyball"]),
23689
+ maps: /* @__PURE__ */ new Set(["esports"]),
23690
+ ot: /* @__PURE__ */ new Set(["basketball", "american_football", "hockey", "soccer"])
23691
+ };
23692
+ var PERIOD_N_FAMILY_PATTERN = /^period_\d{1,2}$/;
23693
+ var isPeriodFamilyAllowedForSport = (family, sport) => {
23694
+ if (!sport || sport === "other_sport") return true;
23695
+ if (PERIOD_N_FAMILY_PATTERN.test(family)) return sport === "hockey";
23696
+ const normalizedFamily = FIRST_N_INNINGS_PATTERN.test(family) ? "innings" : family;
23697
+ const allowedSports = SPORTS_PERIOD_FAMILY_ALLOWED_SPORTS[normalizedFamily];
23698
+ return !allowedSports || allowedSports.has(sport);
23699
+ };
23700
+ var resolveEffectiveMarketSectionTabKey = (market, sport) => {
23701
+ const key = resolveMarketSectionTabKey(market);
23702
+ if (!key || !key.startsWith("period:")) return key;
23703
+ const family = key.slice("period:".length);
23704
+ return isPeriodFamilyAllowedForSport(family, sport) ? key : "other";
23705
+ };
23666
23706
  var resolveVisibleSportsSectionTabs = (event) => {
23667
23707
  var _a, _b, _c;
23668
23708
  const periodsByFamily = /* @__PURE__ */ new Map();
@@ -23671,7 +23711,7 @@ var resolveVisibleSportsSectionTabs = (event) => {
23671
23711
  let hasExactScore = false;
23672
23712
  let hasOther = false;
23673
23713
  for (const market of event.venueMarkets) {
23674
- const key = resolveMarketSectionTabKey(market);
23714
+ const key = resolveEffectiveMarketSectionTabKey(market, event.sport);
23675
23715
  if (!key) continue;
23676
23716
  if (key === "game_lines") hasGameLines = true;
23677
23717
  else if (key === "exact_score") hasExactScore = true;
@@ -23793,16 +23833,19 @@ var dropDecomposedLegsMergedIntoSingle = (markets) => {
23793
23833
  var resolveSportsSectionMarkets = ({
23794
23834
  tab,
23795
23835
  eventMarkets,
23796
- sectionMarkets
23836
+ sectionMarkets,
23837
+ sport
23797
23838
  }) => {
23798
- const effectiveSectionMarkets = sectionMarkets.length > 0 ? sectionMarkets : eventMarkets.filter((market) => resolveMarketSectionTabKey(market) === tab.key);
23839
+ const effectiveSectionMarkets = sectionMarkets.length > 0 ? sectionMarkets : eventMarkets.filter(
23840
+ (market) => resolveEffectiveMarketSectionTabKey(market, sport) === tab.key
23841
+ );
23799
23842
  const filteredSectionMarkets = effectiveSectionMarkets.filter(
23800
- (market) => resolveMarketSectionTabKey(market) === tab.key
23843
+ (market) => resolveEffectiveMarketSectionTabKey(market, sport) === tab.key
23801
23844
  );
23802
23845
  if (tab.key === "other" || tab.key === `stat:${SPORTS_GENERIC_STAT}`) {
23803
23846
  const seenIds = new Set(filteredSectionMarkets.map((market) => market.id));
23804
23847
  const strayMarkets = eventMarkets.filter(
23805
- (market) => !seenIds.has(market.id) && resolveMarketSectionTabKey(market) === tab.key
23848
+ (market) => !seenIds.has(market.id) && resolveEffectiveMarketSectionTabKey(market, sport) === tab.key
23806
23849
  );
23807
23850
  return [...filteredSectionMarkets, ...strayMarkets];
23808
23851
  }
@@ -24899,9 +24942,10 @@ var SportsMarkets = ({
24899
24942
  () => resolveSportsSectionMarkets({
24900
24943
  tab: activeTab,
24901
24944
  eventMarkets: tabSourceMarkets,
24902
- sectionMarkets
24945
+ sectionMarkets,
24946
+ sport: event.sport
24903
24947
  }),
24904
- [activeTab, tabSourceMarkets, sectionMarkets]
24948
+ [activeTab, tabSourceMarkets, sectionMarkets, event.sport]
24905
24949
  );
24906
24950
  const isSectionSettled = !isSectionLoading && !hasNextPage && !isFetchingNextPage;
24907
24951
  const stableSectionMarkets = stableMarketsByTab[activeTabKey];
package/dist/pages.mjs CHANGED
@@ -8,14 +8,14 @@ import {
8
8
  UserProfilePage,
9
9
  buildAggTxExplorerHref,
10
10
  useHomePageModals
11
- } from "./chunk-TQL5I4GX.mjs";
12
- import "./chunk-XAG432PJ.mjs";
11
+ } from "./chunk-KFNTS2TV.mjs";
12
+ import "./chunk-BVNXMHSL.mjs";
13
13
  import {
14
14
  DEPOSIT_MODAL_OPEN_EVENT,
15
15
  WITHDRAW_MODAL_OPEN_EVENT,
16
16
  requestAggDepositModalOpen,
17
17
  requestAggWithdrawModalOpen
18
- } from "./chunk-FAU2VOL6.mjs";
18
+ } from "./chunk-O27JUYCF.mjs";
19
19
  import "./chunk-JQKJDSTW.mjs";
20
20
  import "./chunk-AHQA3B7D.mjs";
21
21
  import "./chunk-FMYYPNZZ.mjs";
package/dist/trading.js CHANGED
@@ -8467,7 +8467,7 @@ var buildLiveRouteCards = ({
8467
8467
  };
8468
8468
  }
8469
8469
  const avgPrice = sq.avgPrice;
8470
- const soloQuoteData = __spreadProps(__spreadValues({}, quoteData), {
8470
+ const soloQuoteData = __spreadValues(__spreadProps(__spreadValues({}, quoteData), {
8471
8471
  // Preview-only solos intentionally carry no executable quoteId; the card
8472
8472
  // should still render for comparison, while the CTA stays disabled until
8473
8473
  // the user is funded and requotes.
@@ -8480,7 +8480,7 @@ var buildLiveRouteCards = ({
8480
8480
  returnPct: sq.returnPct,
8481
8481
  // venueSoloQuotes stripped on solo card's quoteData (only the primary needs them)
8482
8482
  venueSoloQuotes: void 0
8483
- });
8483
+ }), sq.quoteId ? { status: "ok", error: void 0 } : null);
8484
8484
  return {
8485
8485
  id: `live-solo-${sq.venue}`,
8486
8486
  hint: labels.averagePrice(avgPrice),
@@ -8536,6 +8536,17 @@ var buildLiveRouteCards = ({
8536
8536
  })() : [];
8537
8537
  return [...baseCards, ...unavailableCards, ...warningOnlyUnavailableCards];
8538
8538
  };
8539
+ var resolveDefaultRouteCardId = (routeCards, primaryStatus) => {
8540
+ var _a, _b, _c, _d;
8541
+ if (routeCards.length === 0) return null;
8542
+ if (primaryStatus === "insufficient_balance") {
8543
+ const executableCard = routeCards.find(
8544
+ (card) => !card.isUnavailable && card.quoteData.status === "ok" && card.quoteData.quoteId
8545
+ );
8546
+ if (executableCard) return executableCard.id;
8547
+ }
8548
+ return (_d = (_c = (_a = routeCards.find((card) => !card.isUnavailable)) == null ? void 0 : _a.id) != null ? _c : (_b = routeCards[0]) == null ? void 0 : _b.id) != null ? _d : null;
8549
+ };
8539
8550
  var sellSharesToAtomicUnits = (shares) => {
8540
8551
  if (!Number.isFinite(shares) || shares <= 0) return BigInt(0);
8541
8552
  const [whole = "0", fraction = ""] = shares.toFixed(12).split(".");
@@ -10470,7 +10481,7 @@ var PlaceOrder = ({
10470
10481
  resolvedClaim,
10471
10482
  midpointsResult
10472
10483
  }) => {
10473
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X;
10484
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y;
10474
10485
  const {
10475
10486
  enableDebug: isExecutionDebugEnabled,
10476
10487
  features: { enableAnimations, showFeesBreakdown, showLimitOrders },
@@ -10901,13 +10912,13 @@ var PlaceOrder = ({
10901
10912
  venueSellQuotes.quotes
10902
10913
  ]);
10903
10914
  const resolvedSelectedRouteCardId = (0, import_react15.useMemo)(() => {
10904
- var _a2, _b2, _c2, _d2;
10915
+ var _a2;
10905
10916
  if (routeCards.length === 0) return null;
10906
10917
  if (selectedRouteCardId && routeCards.some((card) => card.id === selectedRouteCardId && !card.isUnavailable)) {
10907
10918
  return selectedRouteCardId;
10908
10919
  }
10909
- return (_d2 = (_c2 = (_a2 = routeCards.find((card) => !card.isUnavailable)) == null ? void 0 : _a2.id) != null ? _c2 : (_b2 = routeCards[0]) == null ? void 0 : _b2.id) != null ? _d2 : null;
10910
- }, [routeCards, selectedRouteCardId]);
10920
+ return resolveDefaultRouteCardId(routeCards, isSell ? void 0 : (_a2 = smartRoute.data) == null ? void 0 : _a2.status);
10921
+ }, [routeCards, selectedRouteCardId, isSell, (_w = smartRoute.data) == null ? void 0 : _w.status]);
10911
10922
  (0, import_react15.useEffect)(() => {
10912
10923
  if (routeCards.length === 0) {
10913
10924
  setSelectedRouteCardId(null);
@@ -10947,14 +10958,14 @@ var PlaceOrder = ({
10947
10958
  setLimitPriceInputError(null);
10948
10959
  }, [executionType, scopedSelectedOutcomeId, selectedOutcomeDisplayPrice]);
10949
10960
  const orderedRouteCards = routeCards;
10950
- const selectedRouteCard = (_x = (_w = orderedRouteCards.find((card) => card.id === resolvedSelectedRouteCardId)) != null ? _w : orderedRouteCards[0]) != null ? _x : null;
10961
+ const selectedRouteCard = (_y = (_x = orderedRouteCards.find((card) => card.id === resolvedSelectedRouteCardId)) != null ? _x : orderedRouteCards[0]) != null ? _y : null;
10951
10962
  const isKalshiRoute = (0, import_react15.useMemo)(() => {
10952
10963
  if (selectedRouteCard) {
10953
10964
  return selectedRouteCard.venue === "kalshi" || selectedRouteCard.quoteData.fills.some((f) => f.venue === "kalshi");
10954
10965
  }
10955
10966
  return (scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) === "kalshi";
10956
10967
  }, [selectedRouteCard, scopedSelectedMarket]);
10957
- const displayedBalance = isPaperMode ? paperTotalBalance : isKalshiRoute ? (_y = liveBalanceState.kalshiBalance) != null ? _y : 0 : liveAvailableBalance;
10968
+ const displayedBalance = isPaperMode ? paperTotalBalance : isKalshiRoute ? (_z = liveBalanceState.kalshiBalance) != null ? _z : 0 : liveAvailableBalance;
10958
10969
  const legacyKalshiAccount = (0, import_react15.useMemo)(
10959
10970
  () => {
10960
10971
  var _a2;
@@ -10962,8 +10973,8 @@ var PlaceOrder = ({
10962
10973
  },
10963
10974
  [user == null ? void 0 : user.venueAccounts]
10964
10975
  );
10965
- const isKalshiAccountActive = (_z = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.connected) != null ? _z : (legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.status) === "active";
10966
- const isKalshiVerified = ((_A = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.kycStatus) != null ? _A : legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.kycStatus) === "verified";
10976
+ const isKalshiAccountActive = (_A = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.connected) != null ? _A : (legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.status) === "active";
10977
+ const isKalshiVerified = ((_B = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.kycStatus) != null ? _B : legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.kycStatus) === "verified";
10967
10978
  const hasKalshiConnectionState = kalshiKeyStatus !== void 0 || (user == null ? void 0 : user.venueAccounts) != null;
10968
10979
  const isKalshiAvailable = (0, import_hooks36.getVenueAvailabilityState)({
10969
10980
  venueId: "kalshi",
@@ -10990,7 +11001,7 @@ var PlaceOrder = ({
10990
11001
  [aggClient, onConnectKalshi, refetchKalshiKeyStatus]
10991
11002
  );
10992
11003
  const needsKycVerification = isAuthenticated && hasKalshiConnectionState && isKalshiRoute && isKalshiAccountActive && !isKalshiVerified;
10993
- const verifyKalshiConnectionLabel = (_E = (_D = (_C = (_B = labels.onboarding) == null ? void 0 : _B.connectKalshiModal) == null ? void 0 : _C.actions) == null ? void 0 : _D.verifyConnection) != null ? _E : tradingLabels.kycRequired;
11004
+ const verifyKalshiConnectionLabel = (_F = (_E = (_D = (_C = labels.onboarding) == null ? void 0 : _C.connectKalshiModal) == null ? void 0 : _D.actions) == null ? void 0 : _E.verifyConnection) != null ? _F : tradingLabels.kycRequired;
10994
11005
  const handleRouteCardSelect = (0, import_react15.useCallback)(
10995
11006
  (cardId) => {
10996
11007
  if (cardId === resolvedSelectedRouteCardId) {
@@ -11005,15 +11016,15 @@ var PlaceOrder = ({
11005
11016
  [resolvedSelectedRouteCardId, routeCards]
11006
11017
  );
11007
11018
  const executionProgress = (0, import_hooks36.useExecutionProgress)({
11008
- orderIds: (_F = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) != null ? _F : null,
11009
- quoteId: (_G = submissionProgressState == null ? void 0 : submissionProgressState.quoteId) != null ? _G : null,
11019
+ orderIds: (_G = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) != null ? _G : null,
11020
+ quoteId: (_H = submissionProgressState == null ? void 0 : submissionProgressState.quoteId) != null ? _H : null,
11010
11021
  mode: isPaperMode ? "paper" : void 0,
11011
- enabled: ((submissionProgressState == null ? void 0 : submissionProgressState.phase) === "submitting" || (submissionProgressState == null ? void 0 : submissionProgressState.phase) === "executing") && !!((_H = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) == null ? void 0 : _H.length)
11022
+ enabled: ((submissionProgressState == null ? void 0 : submissionProgressState.phase) === "submitting" || (submissionProgressState == null ? void 0 : submissionProgressState.phase) === "executing") && !!((_I = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) == null ? void 0 : _I.length)
11012
11023
  });
11013
- const selectedOutcomeLabel = (_K = (_J = (_I = outcomes.find((outcome) => outcome.id === scopedSelectedOutcomeId)) == null ? void 0 : _I.label) != null ? _J : scopedSelectedOutcome == null ? void 0 : scopedSelectedOutcome.label) != null ? _K : "";
11014
- const headerImage = (_M = (_L = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.image) != null ? _L : scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.image) != null ? _M : null;
11015
- const headerTitle = (_O = (_N = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.title) != null ? _N : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _O : "";
11016
- const headerSubtitle = (_P = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _P : "";
11024
+ const selectedOutcomeLabel = (_L = (_K = (_J = outcomes.find((outcome) => outcome.id === scopedSelectedOutcomeId)) == null ? void 0 : _J.label) != null ? _K : scopedSelectedOutcome == null ? void 0 : scopedSelectedOutcome.label) != null ? _L : "";
11025
+ const headerImage = (_N = (_M = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.image) != null ? _M : scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.image) != null ? _N : null;
11026
+ const headerTitle = (_P = (_O = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.title) != null ? _O : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _P : "";
11027
+ const headerSubtitle = (_Q = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _Q : "";
11017
11028
  const buildExecutionSummary = (0, import_react15.useCallback)(
11018
11029
  (quoteData, executionVenue, orderId, partialFillSummary) => {
11019
11030
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
@@ -11311,19 +11322,19 @@ var PlaceOrder = ({
11311
11322
  queryClient,
11312
11323
  submissionProgressState
11313
11324
  ]);
11314
- const activeQuoteData = (_R = (_Q = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData) != null ? _Q : smartRoute.data) != null ? _R : null;
11325
+ const activeQuoteData = (_S = (_R = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData) != null ? _R : smartRoute.data) != null ? _S : null;
11315
11326
  const visibleRouteCards = orderedRouteCards.length > PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT && !isRoutesExpanded ? orderedRouteCards.slice(0, PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT) : orderedRouteCards;
11316
11327
  const hasEnteredAmount = internalAmount > 0;
11317
11328
  const isQuoteLoading = !isLimitOrder && hasEnteredAmount && (smartRoute.isFetching || smartRoute.isLoading || isSell && (venueSellQuotes.isFetching || venueSellQuotes.isLoading));
11318
11329
  const routeLoadingMessage = isQuoteLoading ? smartRoute.loadingReason === "updating-route" ? tradingLabels.updatingRoute : smartRoute.loadingReason === "refreshing-quotes" ? tradingLabels.refreshingQuotes : tradingLabels.findingBestOdds : null;
11319
- const selectedRouteFills = (_S = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData.fills) != null ? _S : [];
11330
+ const selectedRouteFills = (_T = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData.fills) != null ? _T : [];
11320
11331
  const isKalshiOnlyRoute = isKalshiRoute && ((selectedRouteCard == null ? void 0 : selectedRouteCard.venue) === import_sdk17.Venue.kalshi || selectedRouteFills.length > 0 && selectedRouteFills.every((fill) => fill.venue === import_sdk17.Venue.kalshi));
11321
11332
  const isOnchainOnlyRoute = !isKalshiRoute || selectedRouteFills.length > 0 && selectedRouteFills.every((fill) => fill.venue !== import_sdk17.Venue.kalshi);
11322
11333
  const kalshiRequiredAmount = isSell ? 0 : selectedRouteFills.filter((fill) => fill.venue === import_sdk17.Venue.kalshi).reduce((total, fill) => total + fill.venueQty * fill.avgPrice, 0);
11323
11334
  const onchainRequiredAmount = isSell ? 0 : selectedRouteFills.filter((fill) => fill.venue !== import_sdk17.Venue.kalshi).reduce((total, fill) => total + fill.venueQty * fill.avgPrice, 0);
11324
11335
  const resolvedKalshiRequiredAmount = isKalshiOnlyRoute || isKalshiRoute && selectedRouteFills.length === 0 ? internalAmount : kalshiRequiredAmount;
11325
11336
  const resolvedOnchainRequiredAmount = isOnchainOnlyRoute || !isKalshiRoute && selectedRouteFills.length === 0 ? internalAmount : onchainRequiredAmount;
11326
- const isKalshiBalanceInsufficient = !isPaperMode && isKalshiRoute && resolvedKalshiRequiredAmount > ((_T = liveBalanceState.kalshiBalance) != null ? _T : 0);
11337
+ const isKalshiBalanceInsufficient = !isPaperMode && isKalshiRoute && resolvedKalshiRequiredAmount > ((_U = liveBalanceState.kalshiBalance) != null ? _U : 0);
11327
11338
  const isOnchainBalanceInsufficient = resolvedOnchainRequiredAmount > liveAvailableBalance;
11328
11339
  const isInsufficientBalance = !isSell && isAuthenticated && hasEnteredAmount && !isBalanceLoading && (isLimitOrder ? internalAmount > totalBalance : isPaperMode ? internalAmount > paperTotalBalance : isKalshiBalanceInsufficient || isOnchainBalanceInsufficient);
11329
11340
  const isQuoteInsufficientBalance = !isLimitOrder && (activeQuoteData == null ? void 0 : activeQuoteData.status) === "insufficient_balance";
@@ -11417,7 +11428,7 @@ var PlaceOrder = ({
11417
11428
  }
11418
11429
  return (_d2 = selectedRouteCard.hint) != null ? _d2 : "";
11419
11430
  }, [selectedRouteCard, tradingLabels]);
11420
- const displayedToWinValue = (_U = selectedRouteCard == null ? void 0 : selectedRouteCard.numericValue) != null ? _U : 0;
11431
+ const displayedToWinValue = (_V = selectedRouteCard == null ? void 0 : selectedRouteCard.numericValue) != null ? _V : 0;
11421
11432
  const limitOrderPayload = (0, import_react15.useMemo)(() => {
11422
11433
  if (!scopedSelectedMarket || !scopedSelectedOutcomeId || internalAmount <= 0) return null;
11423
11434
  if (limitPriceInputError) return null;
@@ -11536,13 +11547,13 @@ var PlaceOrder = ({
11536
11547
  ];
11537
11548
  }, [activeFeeBreakdown, tradingLabels]);
11538
11549
  const isActionLoading = isPrimaryActionLoading || executeManaged.isPending || placeLimitOrder.isPending || isBeforeActionPending;
11539
- const selectedRouteGeoBlocked = (_V = selectedRouteCard == null ? void 0 : selectedRouteCard.isUnavailable) != null ? _V : false;
11550
+ const selectedRouteGeoBlocked = (_W = selectedRouteCard == null ? void 0 : selectedRouteCard.isUnavailable) != null ? _W : false;
11540
11551
  const geoBlockedVenuesFromWarnings = (0, import_react15.useMemo)(
11541
11552
  () => {
11542
11553
  var _a2;
11543
11554
  return extractGeoBlockedVenues((_a2 = smartRoute.data) == null ? void 0 : _a2.warnings);
11544
11555
  },
11545
- [(_W = smartRoute.data) == null ? void 0 : _W.warnings]
11556
+ [(_X = smartRoute.data) == null ? void 0 : _X.warnings]
11546
11557
  );
11547
11558
  const isPrimaryVenueGeoBlocked = (0, import_react15.useMemo)(() => {
11548
11559
  var _a2, _b2;
@@ -12200,7 +12211,7 @@ var PlaceOrder = ({
12200
12211
  PlaceOrderResolvedView,
12201
12212
  {
12202
12213
  tradingState: resolvedReadOnlyTradingState,
12203
- resolutionTimestamp: (_X = resolvedEventTradingState.resolvesAt) != null ? _X : resolvedReadOnlyTradingState.resolvesAt,
12214
+ resolutionTimestamp: (_Y = resolvedEventTradingState.resolvesAt) != null ? _Y : resolvedReadOnlyTradingState.resolvesAt,
12204
12215
  resolvedClaim,
12205
12216
  classNames,
12206
12217
  className,
package/dist/trading.mjs CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  parseVenue,
10
10
  useClaimWinnings,
11
11
  useResolvedMarketClaim
12
- } from "./chunk-FAU2VOL6.mjs";
12
+ } from "./chunk-O27JUYCF.mjs";
13
13
  import {
14
14
  SETTLEMENT_SECTION_ID,
15
15
  Settlement,
@@ -44,6 +44,7 @@ export type SportsPeriodGroup = {
44
44
  markets: VenueMarket[];
45
45
  groups: SportsMarketDisplayGroup[];
46
46
  };
47
+ export declare const getSportsPeriodOrderIndex: (period: SportsPeriodKey) => number;
47
48
  /**
48
49
  * Collapse a period into its display FAMILY, so one tab covers the periods a
49
50
  * viewer thinks of together: soccer's 1h+2h are a single "Halves" tab (as
@@ -73,17 +74,26 @@ export declare const resolveSportsStatToken: (market: Pick<VenueMarket, "marketS
73
74
  * ungrouped market list instead of inventing an empty tab.
74
75
  */
75
76
  export declare const resolveMarketSectionTabKey: (market: Pick<VenueMarket, "marketGroup" | "marketCategory" | "marketSubtype" | "question" | "sportsMarketType" | "period">) => string | null;
76
- export declare const resolveVisibleSportsSectionTabs: (event: Pick<VenueEventWithMarkets, "categories" | "title" | "venueMarkets">) => SportsSectionTab[];
77
+ /**
78
+ * `resolveMarketSectionTabKey`, sport-gated: a "period:<family>" key whose
79
+ * family isn't plausible for the event's sport demotes to "other" so the
80
+ * market surfaces under the Other tab instead of a nonsense period tab. Used
81
+ * by both the visible-tabs builder and the section-market filter so a
82
+ * demoted market is never silently dropped from either.
83
+ */
84
+ export declare const resolveEffectiveMarketSectionTabKey: (market: Parameters<typeof resolveMarketSectionTabKey>[0], sport?: string | null) => string | null;
85
+ export declare const resolveVisibleSportsSectionTabs: (event: Pick<VenueEventWithMarkets, "categories" | "title" | "venueMarkets" | "sport">) => SportsSectionTab[];
77
86
  export declare const resolveSportsSectionFilters: (tab: SportsSectionTab) => {
78
87
  marketGroup?: SportsMarketGroupKey[];
79
88
  marketCategory?: SportsMarketCategoryKey[];
80
89
  sportsMarketType?: SportsMarketTypeKey[];
81
90
  period?: SportsPeriodKey[];
82
91
  };
83
- export declare const resolveSportsSectionMarkets: ({ tab, eventMarkets, sectionMarkets, }: {
92
+ export declare const resolveSportsSectionMarkets: ({ tab, eventMarkets, sectionMarkets, sport, }: {
84
93
  tab: SportsSectionTab;
85
94
  eventMarkets: VenueMarket[];
86
95
  sectionMarkets: VenueMarket[];
96
+ sport?: string | null;
87
97
  }) => VenueMarket[];
88
98
  export declare const resolveSportsMarketCardVariant: (market: VenueMarket) => SportsMarketCardVariant;
89
99
  export declare const isBinarySportsMoneylineMarket: (market: VenueMarket) => boolean;
@@ -44,6 +44,7 @@ export type SportsPeriodGroup = {
44
44
  markets: VenueMarket[];
45
45
  groups: SportsMarketDisplayGroup[];
46
46
  };
47
+ export declare const getSportsPeriodOrderIndex: (period: SportsPeriodKey) => number;
47
48
  /**
48
49
  * Collapse a period into its display FAMILY, so one tab covers the periods a
49
50
  * viewer thinks of together: soccer's 1h+2h are a single "Halves" tab (as
@@ -73,17 +74,26 @@ export declare const resolveSportsStatToken: (market: Pick<VenueMarket, "marketS
73
74
  * ungrouped market list instead of inventing an empty tab.
74
75
  */
75
76
  export declare const resolveMarketSectionTabKey: (market: Pick<VenueMarket, "marketGroup" | "marketCategory" | "marketSubtype" | "question" | "sportsMarketType" | "period">) => string | null;
76
- export declare const resolveVisibleSportsSectionTabs: (event: Pick<VenueEventWithMarkets, "categories" | "title" | "venueMarkets">) => SportsSectionTab[];
77
+ /**
78
+ * `resolveMarketSectionTabKey`, sport-gated: a "period:<family>" key whose
79
+ * family isn't plausible for the event's sport demotes to "other" so the
80
+ * market surfaces under the Other tab instead of a nonsense period tab. Used
81
+ * by both the visible-tabs builder and the section-market filter so a
82
+ * demoted market is never silently dropped from either.
83
+ */
84
+ export declare const resolveEffectiveMarketSectionTabKey: (market: Parameters<typeof resolveMarketSectionTabKey>[0], sport?: string | null) => string | null;
85
+ export declare const resolveVisibleSportsSectionTabs: (event: Pick<VenueEventWithMarkets, "categories" | "title" | "venueMarkets" | "sport">) => SportsSectionTab[];
77
86
  export declare const resolveSportsSectionFilters: (tab: SportsSectionTab) => {
78
87
  marketGroup?: SportsMarketGroupKey[];
79
88
  marketCategory?: SportsMarketCategoryKey[];
80
89
  sportsMarketType?: SportsMarketTypeKey[];
81
90
  period?: SportsPeriodKey[];
82
91
  };
83
- export declare const resolveSportsSectionMarkets: ({ tab, eventMarkets, sectionMarkets, }: {
92
+ export declare const resolveSportsSectionMarkets: ({ tab, eventMarkets, sectionMarkets, sport, }: {
84
93
  tab: SportsSectionTab;
85
94
  eventMarkets: VenueMarket[];
86
95
  sectionMarkets: VenueMarket[];
96
+ sport?: string | null;
87
97
  }) => VenueMarket[];
88
98
  export declare const resolveSportsMarketCardVariant: (market: VenueMarket) => SportsMarketCardVariant;
89
99
  export declare const isBinarySportsMoneylineMarket: (market: VenueMarket) => boolean;
@@ -38,6 +38,15 @@ export declare const getTradingRoutePriceLabel: (value: number) => string;
38
38
  export declare const isQuoteBelowVenueMinimum: (quoteData: SmartRouteResponse | null | undefined) => boolean;
39
39
  export declare const resolvePlaceOrderQuoteStatus: ({ amount, labels, quoteData, selectedMarket, }: ResolvePlaceOrderQuoteStatusParams) => PlaceOrderQuoteStatus;
40
40
  export declare const buildLiveRouteCards: ({ labels, quoteData, tradeSide, eventVenues, geoBlockedVenues: inheritedGeoBlockedVenues, }: BuildLiveRouteCardsParams) => PlaceOrderRouteCard[];
41
+ /**
42
+ * Default route-card pick when the user hasn't selected one (or their selection
43
+ * disappeared from the list). Normally the first available card wins, but when
44
+ * the primary route is blocked on funding (`insufficient_balance`) the panel
45
+ * must not park on it with a blocking alert while an executable solo (status
46
+ * "ok" + real quoteId) sits in the same response — default to that solo so a
47
+ * Kalshi-funded user with no on-chain balance lands on a submittable route.
48
+ */
49
+ export declare const resolveDefaultRouteCardId: (routeCards: PlaceOrderRouteCard[], primaryStatus?: SmartRouteResponse["status"]) => string | null;
41
50
  export declare const clampSellSharesToAvailability: (requestedSellShares: number, availableShares: number) => number;
42
51
  export declare const getRemainingVenueSellShares: (availableShares: number, filledShares: number) => number;
43
52
  export declare const buildVenueSellQuoteRequests: ({ quoteData, requestedSellShares, }: {