@agg-build/ui 4.7.2 → 4.7.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.
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  ConnectKalshiModal,
4
4
  dispatchAggDepositNotification
5
- } from "./chunk-XN2NB2NP.mjs";
5
+ } from "./chunk-XR6C3MZX.mjs";
6
6
  import {
7
7
  BoltIcon,
8
8
  Button,
@@ -35,7 +35,7 @@ import {
35
35
  shortenAddress,
36
36
  useOptionalToast,
37
37
  venueLogoLabels
38
- } from "./chunk-RDBMHBR2.mjs";
38
+ } from "./chunk-UQ7XJIAZ.mjs";
39
39
 
40
40
  // src/deposit/index.tsx
41
41
  import { useAggAuthState, useAggUiConfig, useDepositAddresses, useLabels as useLabels11 } from "@agg-build/hooks";
@@ -24,7 +24,7 @@ import {
24
24
  resolveUnifiedOrderBookEntries,
25
25
  sortOutcomeSelectorOutcomes,
26
26
  useEventTradingContext
27
- } from "./chunk-WYCSTAN7.mjs";
27
+ } from "./chunk-MAQ52KM5.mjs";
28
28
  import {
29
29
  AutocompleteSelect,
30
30
  Badge,
@@ -78,7 +78,7 @@ import {
78
78
  sortOutcomes,
79
79
  splitEventsByLifecycle,
80
80
  validateSubcategoryPath
81
- } from "./chunk-RDBMHBR2.mjs";
81
+ } from "./chunk-UQ7XJIAZ.mjs";
82
82
 
83
83
  // src/events/item/index.tsx
84
84
  import {
@@ -1427,7 +1427,16 @@ var mergeVenueOutcomeOrderbooks = ({
1427
1427
 
1428
1428
  // src/events/shared/sports-live-score.tsx
1429
1429
  import { useLabels as useLabels2 } from "@agg-build/hooks";
1430
+ import { Fragment as Fragment2 } from "react";
1430
1431
  import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
1432
+ var SPORTS_SCORE_LAYOUTS = {
1433
+ tennis: "sets"
1434
+ };
1435
+ var getSportsScoreLayout = (sport) => {
1436
+ var _a;
1437
+ return (_a = SPORTS_SCORE_LAYOUTS[sport.toLowerCase()]) != null ? _a : "aggregate";
1438
+ };
1439
+ var splitTennisSetScores = (score) => score.trim().split(/\s+/).filter(Boolean);
1431
1440
  var SportsLiveScore = ({
1432
1441
  state,
1433
1442
  variant = "detail",
@@ -1451,12 +1460,28 @@ var SportsLiveScore = ({
1451
1460
  const statusText = [state.period, state.clock].filter(Boolean).join(" \xB7 ") || statusLabels[state.status];
1452
1461
  const isLiveIndicatorVisible = state.status === "live" || state.status === "paused";
1453
1462
  const isCard = variant === "card";
1454
- const renderParticipant = (participant) => {
1463
+ const scoreClassName = cn(
1464
+ "font-agg-bold tabular-nums text-agg-foreground",
1465
+ isCard ? "text-agg-xl leading-agg-7" : "text-agg-3xl leading-agg-9"
1466
+ );
1467
+ const scoreAriaLabel = labels.sportsLive.scoreAria(
1468
+ firstParticipant.name,
1469
+ firstScore,
1470
+ secondParticipant.name,
1471
+ secondScore,
1472
+ statusText
1473
+ );
1474
+ const tennisSetScores = getSportsScoreLayout(state.sport) === "sets" ? [splitTennisSetScores(firstScore), splitTennisSetScores(secondScore)] : null;
1475
+ const renderParticipant = (participant, orientation = "stacked") => {
1455
1476
  var _a;
1456
1477
  return /* @__PURE__ */ jsxs2(
1457
1478
  "div",
1458
1479
  {
1459
- className: cn("flex min-w-0 flex-col items-center", isCard ? "gap-1.5" : "gap-3"),
1480
+ className: cn(
1481
+ "flex min-w-0 items-center",
1482
+ orientation === "stacked" ? "flex-col" : null,
1483
+ isCard ? "gap-1.5" : "gap-3"
1484
+ ),
1460
1485
  title: participant.name,
1461
1486
  children: [
1462
1487
  /* @__PURE__ */ jsx2(
@@ -1481,7 +1506,8 @@ var SportsLiveScore = ({
1481
1506
  {
1482
1507
  variant: "body",
1483
1508
  className: cn(
1484
- "max-w-full truncate text-center text-agg-foreground",
1509
+ "max-w-full truncate text-agg-foreground",
1510
+ orientation === "stacked" ? "text-center" : "min-w-0",
1485
1511
  isCard ? "text-agg-xs leading-agg-4" : "text-agg-base leading-agg-6"
1486
1512
  ),
1487
1513
  children: (_a = participant.shortName) != null ? _a : participant.name
@@ -1491,17 +1517,96 @@ var SportsLiveScore = ({
1491
1517
  }
1492
1518
  );
1493
1519
  };
1520
+ const renderStatus = () => /* @__PURE__ */ jsxs2("div", { className: "flex min-w-0 items-center gap-2 text-agg-primary", children: [
1521
+ isLiveIndicatorVisible ? /* @__PURE__ */ jsx2(
1522
+ "span",
1523
+ {
1524
+ "aria-hidden": "true",
1525
+ className: "flex size-3.5 shrink-0 items-center justify-center rounded-agg-full bg-agg-primary/10",
1526
+ children: /* @__PURE__ */ jsx2("span", { className: "size-1.5 rounded-agg-full bg-agg-primary" })
1527
+ }
1528
+ ) : null,
1529
+ /* @__PURE__ */ jsx2(
1530
+ Typography,
1531
+ {
1532
+ variant: "label-strong",
1533
+ className: cn(
1534
+ "max-w-full truncate uppercase text-agg-primary",
1535
+ isCard ? "text-agg-2xs leading-agg-4" : "text-agg-sm leading-agg-5"
1536
+ ),
1537
+ children: statusText
1538
+ }
1539
+ )
1540
+ ] });
1541
+ if (tennisSetScores && tennisSetScores[0].length > 0 && tennisSetScores[0].length === tennisSetScores[1].length) {
1542
+ const renderTennisParticipant = (participant, setScores, opponentSetScores) => /* @__PURE__ */ jsxs2("div", { className: "contents", "data-testid": `tennis-score-row-${participant.position}`, children: [
1543
+ renderParticipant(participant, "inline"),
1544
+ setScores.map((setScore, setIndex) => {
1545
+ var _a;
1546
+ const setScoreValue = Number.parseInt(setScore, 10);
1547
+ const opponentSetScoreValue = Number.parseInt((_a = opponentSetScores[setIndex]) != null ? _a : "", 10);
1548
+ const isCompletedSet = state.status === "finished" || setIndex < setScores.length - 1;
1549
+ const isLosingCompletedSet = isCompletedSet && Number.isInteger(setScoreValue) && Number.isInteger(opponentSetScoreValue) && setScoreValue < opponentSetScoreValue;
1550
+ return /* @__PURE__ */ jsxs2(Fragment2, { children: [
1551
+ setIndex > 0 ? /* @__PURE__ */ jsx2(
1552
+ "span",
1553
+ {
1554
+ "aria-hidden": "true",
1555
+ className: cn(
1556
+ "text-center text-agg-muted-foreground",
1557
+ isCard ? "text-agg-xs" : "text-agg-sm"
1558
+ ),
1559
+ children: "-"
1560
+ }
1561
+ ) : null,
1562
+ /* @__PURE__ */ jsx2(
1563
+ Typography,
1564
+ {
1565
+ variant: "body-strong",
1566
+ className: cn(scoreClassName, "text-center", isLosingCompletedSet && "opacity-60"),
1567
+ children: setScore
1568
+ }
1569
+ )
1570
+ ] }, `${participant.position}-${setIndex}`);
1571
+ })
1572
+ ] });
1573
+ return /* @__PURE__ */ jsxs2(
1574
+ "div",
1575
+ {
1576
+ role: "status",
1577
+ "aria-label": scoreAriaLabel,
1578
+ className: cn(
1579
+ "agg-sports-live-score flex w-full flex-col items-center",
1580
+ isCard ? "gap-1 py-1" : "gap-3",
1581
+ className
1582
+ ),
1583
+ children: [
1584
+ /* @__PURE__ */ jsxs2(
1585
+ "div",
1586
+ {
1587
+ className: cn(
1588
+ "mx-auto grid w-fit max-w-full items-center",
1589
+ isCard ? "gap-x-2 gap-y-1.5" : "gap-x-3 gap-y-3"
1590
+ ),
1591
+ style: {
1592
+ gridTemplateColumns: `fit-content(${isCard ? "10rem" : "14rem"}) repeat(${tennisSetScores[0].length * 2 - 1}, auto)`
1593
+ },
1594
+ children: [
1595
+ renderTennisParticipant(firstParticipant, tennisSetScores[0], tennisSetScores[1]),
1596
+ renderTennisParticipant(secondParticipant, tennisSetScores[1], tennisSetScores[0])
1597
+ ]
1598
+ }
1599
+ ),
1600
+ renderStatus()
1601
+ ]
1602
+ }
1603
+ );
1604
+ }
1494
1605
  return /* @__PURE__ */ jsxs2(
1495
1606
  "div",
1496
1607
  {
1497
1608
  role: "status",
1498
- "aria-label": labels.sportsLive.scoreAria(
1499
- firstParticipant.name,
1500
- firstScore,
1501
- secondParticipant.name,
1502
- secondScore,
1503
- statusText
1504
- ),
1609
+ "aria-label": scoreAriaLabel,
1505
1610
  className: cn(
1506
1611
  "agg-sports-live-score grid w-full grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center",
1507
1612
  isCard ? "gap-3 py-1" : "gap-6 md:gap-10",
@@ -1511,17 +1616,7 @@ var SportsLiveScore = ({
1511
1616
  renderParticipant(firstParticipant),
1512
1617
  /* @__PURE__ */ jsxs2("div", { className: cn("flex flex-col items-center", isCard ? "gap-1" : "gap-3"), children: [
1513
1618
  /* @__PURE__ */ jsxs2("div", { className: cn("flex items-center", isCard ? "gap-2" : "gap-3"), children: [
1514
- /* @__PURE__ */ jsx2(
1515
- Typography,
1516
- {
1517
- variant: "body-strong",
1518
- className: cn(
1519
- "font-agg-bold tabular-nums text-agg-foreground",
1520
- isCard ? "text-agg-xl leading-agg-7" : "text-agg-3xl leading-agg-9"
1521
- ),
1522
- children: firstScore
1523
- }
1524
- ),
1619
+ /* @__PURE__ */ jsx2(Typography, { variant: "body-strong", className: scoreClassName, children: firstScore }),
1525
1620
  /* @__PURE__ */ jsx2(
1526
1621
  "span",
1527
1622
  {
@@ -1529,39 +1624,9 @@ var SportsLiveScore = ({
1529
1624
  className: cn("shrink-0 bg-agg-separator", isCard ? "h-0.5 w-2" : "h-0.5 w-3")
1530
1625
  }
1531
1626
  ),
1532
- /* @__PURE__ */ jsx2(
1533
- Typography,
1534
- {
1535
- variant: "body-strong",
1536
- className: cn(
1537
- "font-agg-bold tabular-nums text-agg-foreground",
1538
- isCard ? "text-agg-xl leading-agg-7" : "text-agg-3xl leading-agg-9"
1539
- ),
1540
- children: secondScore
1541
- }
1542
- )
1627
+ /* @__PURE__ */ jsx2(Typography, { variant: "body-strong", className: scoreClassName, children: secondScore })
1543
1628
  ] }),
1544
- /* @__PURE__ */ jsxs2("div", { className: "flex min-w-0 items-center gap-2 text-agg-primary", children: [
1545
- isLiveIndicatorVisible ? /* @__PURE__ */ jsx2(
1546
- "span",
1547
- {
1548
- "aria-hidden": "true",
1549
- className: "flex size-3.5 shrink-0 items-center justify-center rounded-agg-full bg-agg-primary/10",
1550
- children: /* @__PURE__ */ jsx2("span", { className: "size-1.5 rounded-agg-full bg-agg-primary" })
1551
- }
1552
- ) : null,
1553
- /* @__PURE__ */ jsx2(
1554
- Typography,
1555
- {
1556
- variant: "label-strong",
1557
- className: cn(
1558
- "max-w-full truncate uppercase text-agg-primary",
1559
- isCard ? "text-agg-2xs leading-agg-4" : "text-agg-sm leading-agg-5"
1560
- ),
1561
- children: statusText
1562
- }
1563
- )
1564
- ] })
1629
+ renderStatus()
1565
1630
  ] }),
1566
1631
  renderParticipant(secondParticipant)
1567
1632
  ]
@@ -4337,7 +4402,7 @@ var MarketDetailsGraphPanel = ({
4337
4402
  MarketDetailsGraphPanel.displayName = "MarketDetailsGraphPanel";
4338
4403
 
4339
4404
  // src/events/market-details/index.tsx
4340
- import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
4405
+ import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
4341
4406
  var MarketDetailsUnavailableState = ({
4342
4407
  marketId,
4343
4408
  ariaLabel,
@@ -5023,7 +5088,7 @@ var MarketDetailsContent = ({
5023
5088
  ) : "translate-y-5 opacity-0"
5024
5089
  ),
5025
5090
  children: [
5026
- !isResolvedMarket ? /* @__PURE__ */ jsxs9(Fragment2, { children: [
5091
+ !isResolvedMarket ? /* @__PURE__ */ jsxs9(Fragment3, { children: [
5027
5092
  /* @__PURE__ */ jsx11("div", { className: cn("block", classNames == null ? void 0 : classNames.tabs), children: /* @__PURE__ */ jsx11(
5028
5093
  Tabs,
5029
5094
  {
@@ -5619,6 +5684,12 @@ var getDefaultEventListTabs = (labels) => {
5619
5684
  venueLogo: Venue2.novig,
5620
5685
  venues: [Venue2.novig]
5621
5686
  },
5687
+ {
5688
+ value: Venue2.prophetx,
5689
+ label: labels.venues.prophetx,
5690
+ venueLogo: Venue2.prophetx,
5691
+ venues: [Venue2.prophetx]
5692
+ },
5622
5693
  {
5623
5694
  value: Venue2.opinion,
5624
5695
  label: labels.venues.opinion,
@@ -9,12 +9,12 @@ import {
9
9
  getTradingVenueLabel,
10
10
  prepareSettlementDifferences,
11
11
  resolveOrderEligibilityMessage
12
- } from "./chunk-WYCSTAN7.mjs";
12
+ } from "./chunk-MAQ52KM5.mjs";
13
13
  import {
14
14
  ConnectKalshiModal,
15
15
  GeoBlockBanner,
16
16
  subscribeAggDepositNotification
17
- } from "./chunk-XN2NB2NP.mjs";
17
+ } from "./chunk-XR6C3MZX.mjs";
18
18
  import {
19
19
  AGG_TERMS_OF_SERVICE_URL,
20
20
  Button,
@@ -47,7 +47,7 @@ import {
47
47
  resolveResolvedOutcomeLabel,
48
48
  skeletonViews,
49
49
  useOptionalToast
50
- } from "./chunk-RDBMHBR2.mjs";
50
+ } from "./chunk-UQ7XJIAZ.mjs";
51
51
 
52
52
  // src/trading/types.ts
53
53
  import { Venue, enumGuard, isFiniteNonNeg, safeParse } from "@agg-build/sdk";
@@ -2741,7 +2741,9 @@ var deriveExecutionOrderGroups = ({
2741
2741
  fallbackDestinationChainId: fill.chain
2742
2742
  });
2743
2743
  const setupCosts = ((_b = (_a = quoteData.feeBreakdown) == null ? void 0 : _a.setupCosts) != null ? _b : []).filter(
2744
- (setupCost) => !setupCost.alreadyPaid && normalizeIdentity(setupCost.venue) === normalizeIdentity(fill.venue)
2744
+ (setupCost) => !setupCost.alreadyPaid && // Hyperliquid's activation fee is deducted inside the bridge leg — no
2745
+ // DAG step ever runs for it, so a "setup" step would never complete.
2746
+ setupCost.kind !== "hyperliquidActivation" && normalizeIdentity(setupCost.venue) === normalizeIdentity(fill.venue)
2745
2747
  );
2746
2748
  const venueRawSteps = rawExecutionSteps.filter(
2747
2749
  (step) => isVenueExecutionRawStep(step, fill.venue)
@@ -19,7 +19,7 @@ import {
19
19
  selectPrimaryVenueMarket,
20
20
  skeletonViews,
21
21
  sortOutcomes
22
- } from "./chunk-RDBMHBR2.mjs";
22
+ } from "./chunk-UQ7XJIAZ.mjs";
23
23
 
24
24
  // src/trading/trading-context/index.tsx
25
25
  import { useEventTradingContext } from "@agg-build/hooks";