@agg-build/ui 2.0.0 → 2.1.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.
Files changed (50) hide show
  1. package/dist/{chunk-RF2EPYLN.mjs → chunk-IQT4I5B4.mjs} +405 -318
  2. package/dist/{chunk-RWOF44TC.mjs → chunk-NK57KMYN.mjs} +239 -183
  3. package/dist/{chunk-HH7L3KLS.mjs → chunk-RPXRTXCY.mjs} +1 -1
  4. package/dist/{chunk-4CM4F4S6.mjs → chunk-TERG43WW.mjs} +1 -1
  5. package/dist/{chunk-2UKDQ7WP.mjs → chunk-WU2C3C6K.mjs} +94 -39
  6. package/dist/{chunk-R3U6YXSQ.mjs → chunk-XHDGSRG7.mjs} +36 -21
  7. package/dist/{chunk-2ZS3BPSF.mjs → chunk-YJO6LMRT.mjs} +906 -827
  8. package/dist/events.js +1376 -1314
  9. package/dist/events.mjs +3 -3
  10. package/dist/index.js +3701 -3408
  11. package/dist/index.mjs +13 -7
  12. package/dist/modals.js +1117 -983
  13. package/dist/modals.mjs +5 -3
  14. package/dist/pages.js +2664 -2429
  15. package/dist/pages.mjs +8 -6
  16. package/dist/primitives.js +912 -832
  17. package/dist/primitives.mjs +3 -1
  18. package/dist/styles.css +1 -1
  19. package/dist/tailwind.css +1 -1
  20. package/dist/trading.js +554 -510
  21. package/dist/trading.mjs +4 -4
  22. package/dist/types/events/list/category-sidebar.d.mts +33 -0
  23. package/dist/types/events/list/category-sidebar.d.ts +33 -0
  24. package/dist/types/events/list/event-list-tabs.d.mts +2 -0
  25. package/dist/types/events/list/event-list-tabs.d.ts +2 -0
  26. package/dist/types/events/list/index.d.mts +1 -0
  27. package/dist/types/events/list/index.d.ts +1 -0
  28. package/dist/types/pages/event-market/event-market.types.d.mts +1 -0
  29. package/dist/types/pages/event-market/event-market.types.d.ts +1 -0
  30. package/dist/types/pages/user-profile/index.d.mts +2 -1
  31. package/dist/types/pages/user-profile/index.d.ts +2 -1
  32. package/dist/types/pages/user-profile/transaction-explorer.d.mts +1 -0
  33. package/dist/types/pages/user-profile/transaction-explorer.d.ts +1 -0
  34. package/dist/types/pages/user-profile/user-profile.types.d.mts +9 -2
  35. package/dist/types/pages/user-profile/user-profile.types.d.ts +9 -2
  36. package/dist/types/primitives/icon/index.d.mts +2 -1
  37. package/dist/types/primitives/icon/index.d.ts +2 -1
  38. package/dist/types/primitives/icon/registry.d.mts +4 -0
  39. package/dist/types/primitives/icon/registry.d.ts +4 -0
  40. package/dist/types/primitives/icon/svg/paper-mode.d.mts +5 -0
  41. package/dist/types/primitives/icon/svg/paper-mode.d.ts +5 -0
  42. package/dist/types/shared/use-horizontal-scroll-state.d.mts +15 -0
  43. package/dist/types/shared/use-horizontal-scroll-state.d.ts +15 -0
  44. package/dist/types/withdraw/index.d.mts +9 -1
  45. package/dist/types/withdraw/index.d.ts +9 -1
  46. package/dist/types/withdraw/steps/withdraw-amount.d.mts +10 -1
  47. package/dist/types/withdraw/steps/withdraw-amount.d.ts +10 -1
  48. package/dist/types/withdraw/withdraw-modal.types.d.mts +8 -0
  49. package/dist/types/withdraw/withdraw-modal.types.d.ts +8 -0
  50. package/package.json +3 -3
@@ -10,13 +10,13 @@ import {
10
10
  isErrorWithStatus,
11
11
  useEventListTabs,
12
12
  useEventListTabsHeaderOverflow
13
- } from "./chunk-RWOF44TC.mjs";
13
+ } from "./chunk-NK57KMYN.mjs";
14
14
  import {
15
15
  DEPOSIT_MODAL_OPEN_EVENT,
16
16
  PlaceOrder,
17
17
  SettlementDetails,
18
18
  WITHDRAW_MODAL_OPEN_EVENT
19
- } from "./chunk-R3U6YXSQ.mjs";
19
+ } from "./chunk-XHDGSRG7.mjs";
20
20
  import {
21
21
  AggErrorBoundary,
22
22
  Button,
@@ -47,7 +47,7 @@ import {
47
47
  shortenAddress,
48
48
  sortCategoriesForNavigation,
49
49
  useOptionalToast
50
- } from "./chunk-2ZS3BPSF.mjs";
50
+ } from "./chunk-YJO6LMRT.mjs";
51
51
 
52
52
  // src/pages/home/index.tsx
53
53
  import {
@@ -56,7 +56,7 @@ import {
56
56
  useCategories,
57
57
  useEventListState,
58
58
  useLabels as useLabels2,
59
- useSdkUiConfig,
59
+ useSdkUiConfig as useSdkUiConfig2,
60
60
  useSearch
61
61
  } from "@agg-build/hooks";
62
62
  import { VENUES } from "@agg-build/sdk";
@@ -69,7 +69,8 @@ import {
69
69
  useEnrichedVenueEvent,
70
70
  useEventTradingContext,
71
71
  useLabels,
72
- useMidpoints
72
+ useMidpoints,
73
+ useSdkUiConfig
73
74
  } from "@agg-build/hooks";
74
75
  import * as Dialog from "@radix-ui/react-dialog";
75
76
  import { useEffect, useMemo, useRef, useState } from "react";
@@ -185,6 +186,7 @@ var resolveMobileTradePlaceOrderClassNames = (classNames) => {
185
186
  var EventMarketPageMobileTrade = ({
186
187
  classNames,
187
188
  eventTradingState,
189
+ executionMode,
188
190
  showPlaceOrder = true,
189
191
  isOpen,
190
192
  onOpenChange,
@@ -226,6 +228,7 @@ var EventMarketPageMobileTrade = ({
226
228
  PlaceOrder,
227
229
  {
228
230
  eventTradingState,
231
+ executionMode,
229
232
  midpointsResult,
230
233
  className: cn(
231
234
  "agg-mobile-trade-panel w-full overflow-hidden rounded-t-agg-2xl sm:rounded-agg-xl",
@@ -281,7 +284,7 @@ var EventMarketPageLoadingState = ({
281
284
  {
282
285
  className: cn(
283
286
  "agg-event-market-page",
284
- "w-full mx-auto max-w-[1360px] px-6 lg:px-10 pb-10",
287
+ "w-full mx-auto max-w-[1440px] px-6 lg:px-10 pb-10",
285
288
  classNames == null ? void 0 : classNames.root
286
289
  ),
287
290
  children: /* @__PURE__ */ jsxs(
@@ -353,6 +356,7 @@ var EventMarketPageContent = ({
353
356
  classNames,
354
357
  ariaLabel,
355
358
  showPlaceOrder,
359
+ executionMode,
356
360
  stickyOrderPanel,
357
361
  resolvedClaim
358
362
  }) => {
@@ -360,6 +364,10 @@ var EventMarketPageContent = ({
360
364
  const stickyOrderPanelState = resolveEventMarketPageStickyState({
361
365
  stickyOrderPanel
362
366
  });
367
+ const {
368
+ trading: { executionMode: configuredExecutionMode }
369
+ } = useSdkUiConfig();
370
+ const resolvedExecutionMode = executionMode != null ? executionMode : configuredExecutionMode;
363
371
  const [isMobileTradeOpen, setIsMobileTradeOpen] = useState(false);
364
372
  const isMobileViewport = useIsMobileEventMarketViewport();
365
373
  const tradingContext = useEventTradingContext();
@@ -380,7 +388,7 @@ var EventMarketPageContent = ({
380
388
  {
381
389
  className: cn(
382
390
  "agg-event-market-page",
383
- "w-full mx-auto max-w-[1360px] px-6 lg:px-10 pb-10",
391
+ "w-full mx-auto max-w-[1440px] px-6 lg:px-10 pb-10",
384
392
  classNames == null ? void 0 : classNames.root
385
393
  ),
386
394
  "aria-label": ariaLabel != null ? ariaLabel : event.title,
@@ -440,6 +448,7 @@ var EventMarketPageContent = ({
440
448
  PlaceOrder,
441
449
  {
442
450
  eventTradingState,
451
+ executionMode: resolvedExecutionMode,
443
452
  resolvedClaim,
444
453
  midpointsResult,
445
454
  className: cn(
@@ -465,6 +474,7 @@ var EventMarketPageContent = ({
465
474
  PlaceOrder,
466
475
  {
467
476
  eventTradingState,
477
+ executionMode: resolvedExecutionMode,
468
478
  resolvedClaim,
469
479
  midpointsResult,
470
480
  className: cn(stickyOrderPanelState == null ? void 0 : stickyOrderPanelState.placeOrder, classNames == null ? void 0 : classNames.trade),
@@ -481,6 +491,7 @@ var EventMarketPageContent = ({
481
491
  {
482
492
  classNames,
483
493
  eventTradingState,
494
+ executionMode: resolvedExecutionMode,
484
495
  showPlaceOrder,
485
496
  isOpen: isMobileTradeOpen,
486
497
  onOpenChange: setIsMobileTradeOpen,
@@ -664,7 +675,7 @@ var HomeSearchResults = ({
664
675
  onMarketClick
665
676
  }) => {
666
677
  const labels = useLabels2();
667
- const { search: searchConfig } = useSdkUiConfig();
678
+ const { search: searchConfig } = useSdkUiConfig2();
668
679
  const { disabledVenues } = useAppConfig();
669
680
  const [activeVenueTabValue, setActiveVenueTabValue] = useState4("matched");
670
681
  const eventListTabs = useEventListTabs();
@@ -858,8 +869,9 @@ var HomePage = ({
858
869
  isShowingAllResults,
859
870
  onChange: onSearchChange,
860
871
  onSelect: onSelectEventInternal
861
- }
862
- } = useSdkUiConfig();
872
+ },
873
+ trading: { executionMode }
874
+ } = useSdkUiConfig2();
863
875
  const { capture, consume } = useEventListState();
864
876
  const [snapshot] = useState4(() => consume());
865
877
  const eventListStateRef = useRef3(null);
@@ -1043,7 +1055,7 @@ var HomePage = ({
1043
1055
  "w-full bg-agg-secondary border-b border-agg-separator h-14! md:h-15!",
1044
1056
  classNames == null ? void 0 : classNames.header
1045
1057
  ),
1046
- children: /* @__PURE__ */ jsx2("div", { className: "mx-auto h-full w-full max-w-[1360px] px-6 lg:px-10", children: /* @__PURE__ */ jsx2(
1058
+ children: /* @__PURE__ */ jsx2("div", { className: "mx-auto h-full w-full max-w-[1440px] px-6 lg:px-10", children: /* @__PURE__ */ jsx2(
1047
1059
  Tabs,
1048
1060
  {
1049
1061
  ariaLabel: labels.home.categoryTabsAria,
@@ -1057,11 +1069,18 @@ var HomePage = ({
1057
1069
  ) })
1058
1070
  }
1059
1071
  ) : null,
1060
- resolvedSelectedEvent ? /* @__PURE__ */ jsx2(EventMarketPage, { eventId: resolvedSelectedEvent.id, stickyOrderPanel }) : /* @__PURE__ */ jsxs2(
1072
+ resolvedSelectedEvent ? /* @__PURE__ */ jsx2(
1073
+ EventMarketPage,
1074
+ {
1075
+ eventId: resolvedSelectedEvent.id,
1076
+ executionMode,
1077
+ stickyOrderPanel
1078
+ }
1079
+ ) : /* @__PURE__ */ jsxs2(
1061
1080
  "div",
1062
1081
  {
1063
1082
  className: cn(
1064
- "w-full mx-auto px-6 lg:px-10 max-w-[1360px]",
1083
+ "w-full mx-auto px-6 lg:px-10 max-w-[1440px]",
1065
1084
  "pt-4 sm:pt-6 md:pt-8 pb-10"
1066
1085
  ),
1067
1086
  children: [
@@ -1143,14 +1162,14 @@ import {
1143
1162
  useAggAuthState,
1144
1163
  useAggBalance,
1145
1164
  useAggClient,
1146
- useDepositAddresses,
1147
1165
  useExecutionOrders,
1148
1166
  useExecutionPositions,
1149
1167
  useGeoBlock,
1150
- useLabels as useLabels6,
1168
+ useLabels as useLabels7,
1151
1169
  useQueryClient,
1152
1170
  useRedeem,
1153
1171
  useRedeemLifecycles,
1172
+ useSdkUiConfig as useSdkUiConfig3,
1154
1173
  useUserActivity
1155
1174
  } from "@agg-build/hooks";
1156
1175
  import { Venue } from "@agg-build/sdk";
@@ -1177,6 +1196,7 @@ var formatChainIdLabel = (chainId) => {
1177
1196
  };
1178
1197
 
1179
1198
  // src/pages/user-profile/components/available-balance-card.tsx
1199
+ import { useLabels as useLabels3 } from "@agg-build/hooks";
1180
1200
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
1181
1201
  var BASE_URL = "https://assets.snagsolutions.io";
1182
1202
  var CHAIN_ID_TO_ICON_URL = {
@@ -1205,6 +1225,9 @@ var CHAIN_VENUE_MAP = {
1205
1225
  "1337": ["hyperliquid"]
1206
1226
  // HyperCore
1207
1227
  };
1228
+ var isPaperChain = (row) => {
1229
+ return row.key === "0" || row.label.trim().toLowerCase() === "paper";
1230
+ };
1208
1231
  var chainIconUrl = (label, key) => {
1209
1232
  if (key && CHAIN_ID_TO_ICON_URL[key]) return CHAIN_ID_TO_ICON_URL[key];
1210
1233
  const k = label.trim().toLowerCase();
@@ -1222,12 +1245,16 @@ var chainIconUrl = (label, key) => {
1222
1245
  return void 0;
1223
1246
  };
1224
1247
  var AvailableBalanceCard = ({
1225
- label = "Available Balance",
1248
+ label,
1226
1249
  valueLabel,
1227
1250
  chains,
1228
1251
  isLoading = false,
1229
1252
  className
1230
1253
  }) => {
1254
+ const labels = useLabels3();
1255
+ const balanceLabels = labels.userProfile.balance;
1256
+ const resolvedLabel = label != null ? label : balanceLabels.availableBalance;
1257
+ const hasPaperBalance = chains.some(isPaperChain);
1231
1258
  return /* @__PURE__ */ jsxs3(
1232
1259
  "div",
1233
1260
  {
@@ -1257,21 +1284,23 @@ var AvailableBalanceCard = ({
1257
1284
  )
1258
1285
  }
1259
1286
  ),
1260
- /* @__PURE__ */ jsx3("span", { className: "font-agg-sans text-agg-base leading-6 font-agg-normal text-agg-foreground", children: label })
1287
+ /* @__PURE__ */ jsx3("span", { className: "font-agg-sans text-agg-base leading-6 font-agg-normal text-agg-foreground", children: resolvedLabel })
1261
1288
  ] }) }),
1262
1289
  /* @__PURE__ */ jsxs3("div", { className: "agg-balance-summary flex items-center justify-between gap-3", children: [
1263
1290
  /* @__PURE__ */ jsx3("div", { className: "agg-balance-value font-agg-sans text-agg-2xl leading-8 font-agg-bold text-agg-foreground", children: isLoading ? /* @__PURE__ */ jsx3("div", { role: "status", "aria-label": "Loading available balance", children: /* @__PURE__ */ jsx3(SkeletonBlock, { className: "h-8 w-24 rounded-agg-sm" }) }) : valueLabel }),
1264
1291
  /* @__PURE__ */ jsx3(
1265
1292
  Tooltip,
1266
1293
  {
1267
- "aria-label": "Balance by network",
1294
+ "aria-label": balanceLabels.balanceByNetwork,
1268
1295
  size: "medium",
1269
1296
  side: "bottom",
1270
1297
  content: /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-4 items-start justify-start", children: [
1271
- /* @__PURE__ */ jsx3("div", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: "Balance by network" }),
1298
+ /* @__PURE__ */ jsx3("div", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: balanceLabels.balanceByNetwork }),
1272
1299
  /* @__PURE__ */ jsx3("div", { role: "list", className: "agg-balance-list flex flex-col gap-3 w-full", children: chains.map((row) => {
1273
1300
  var _a;
1274
1301
  const iconUrl = chainIconUrl(row.label, row.key);
1302
+ const isPaper = isPaperChain(row);
1303
+ const rowLabel = isPaper ? balanceLabels.paperModeNetwork : row.label;
1275
1304
  return /* @__PURE__ */ jsxs3(
1276
1305
  "div",
1277
1306
  {
@@ -1287,8 +1316,8 @@ var AvailableBalanceCard = ({
1287
1316
  "aria-hidden": true,
1288
1317
  className: "size-full object-contain"
1289
1318
  }
1290
- ) }) : /* @__PURE__ */ jsx3("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border border-agg-separator text-[10px] leading-3 text-agg-muted-foreground", children: row.label.slice(0, 2).toUpperCase() }),
1291
- /* @__PURE__ */ jsx3("span", { className: "truncate font-agg-sans text-agg-sm leading-5 font-agg-normal text-agg-foreground", children: row.label })
1319
+ ) }) : isPaper ? /* @__PURE__ */ jsx3("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] bg-agg-secondary-hover text-agg-primary", children: /* @__PURE__ */ jsx3(Icon, { name: "paper-mode", size: "small", className: "h-4 w-4" }) }) : /* @__PURE__ */ jsx3("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border border-agg-separator text-[10px] leading-3 text-agg-muted-foreground", children: rowLabel.slice(0, 2).toUpperCase() }),
1320
+ /* @__PURE__ */ jsx3("span", { className: "truncate font-agg-sans text-agg-sm leading-5 font-agg-normal text-agg-foreground", children: rowLabel })
1292
1321
  ] }),
1293
1322
  /* @__PURE__ */ jsx3("span", { className: "w-[100px] shrink-0 whitespace-nowrap text-right tabular-nums font-agg-sans text-agg-sm leading-agg-5 font-agg-bold text-agg-foreground", children: row.balance.toLocaleString("en-US", {
1294
1323
  style: "currency",
@@ -1310,17 +1339,29 @@ var AvailableBalanceCard = ({
1310
1339
  row.key
1311
1340
  );
1312
1341
  }) }),
1313
- /* @__PURE__ */ jsx3("div", { className: "agg-balance-note rounded-agg-lg bg-agg-secondary-hover p-3", children: /* @__PURE__ */ jsx3("p", { className: "font-agg-sans text-agg-xs leading-agg-4 font-agg-normal text-agg-foreground", children: "Funds are stored across networks. We handle routing automatically, but keeping funds on the right network enables faster trades and lower fees. When depositing, you can choose your preferred network." }) })
1342
+ hasPaperBalance ? /* @__PURE__ */ jsx3("div", { className: "agg-balance-paper-warning rounded-agg-lg bg-agg-primary/10 p-3", children: /* @__PURE__ */ jsxs3("div", { className: "flex items-start gap-2", children: [
1343
+ /* @__PURE__ */ jsx3(
1344
+ Icon,
1345
+ {
1346
+ name: "paper-mode",
1347
+ size: "small",
1348
+ className: "mt-0.5 h-4 w-4 shrink-0 text-agg-primary"
1349
+ }
1350
+ ),
1351
+ /* @__PURE__ */ jsx3("p", { className: "font-agg-sans text-agg-xs leading-agg-4 font-agg-normal text-agg-foreground", children: balanceLabels.paperModeWarning })
1352
+ ] }) }) : null,
1353
+ /* @__PURE__ */ jsx3("div", { className: "agg-balance-note rounded-agg-lg bg-agg-secondary-hover p-3", children: /* @__PURE__ */ jsx3("p", { className: "font-agg-sans text-agg-xs leading-agg-4 font-agg-normal text-agg-foreground", children: balanceLabels.networkTooltipDescription }) })
1314
1354
  ] }),
1315
1355
  children: /* @__PURE__ */ jsxs3(
1316
1356
  "button",
1317
1357
  {
1318
1358
  type: "button",
1319
- "aria-label": "Balance by network",
1359
+ "aria-label": balanceLabels.balanceByNetwork,
1320
1360
  className: "agg-balance-trigger flex min-h-[20px] min-w-[20px] items-center gap-1 rounded-[6px] border-0 bg-agg-secondary-hover p-1.5",
1321
1361
  children: [
1322
1362
  (chains.slice(0, 4).length > 0 ? chains.slice(0, 4) : [{ key: "placeholder", label: "", balance: 0, accountCount: 0 }]).map((row) => {
1323
1363
  const iconUrl = chainIconUrl(row.label, row.key);
1364
+ const isPaper = isPaperChain(row);
1324
1365
  return iconUrl ? /* @__PURE__ */ jsx3(
1325
1366
  "span",
1326
1367
  {
@@ -1328,6 +1369,21 @@ var AvailableBalanceCard = ({
1328
1369
  children: /* @__PURE__ */ jsx3("img", { src: iconUrl, alt: row.label, className: "size-full object-contain" })
1329
1370
  },
1330
1371
  `icon-${row.key}`
1372
+ ) : isPaper ? /* @__PURE__ */ jsx3(
1373
+ "span",
1374
+ {
1375
+ className: "relative flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] bg-agg-secondary text-agg-primary",
1376
+ children: /* @__PURE__ */ jsx3(
1377
+ Icon,
1378
+ {
1379
+ name: "paper-mode",
1380
+ size: "small",
1381
+ className: "h-4 w-4",
1382
+ title: balanceLabels.paperModeNetwork
1383
+ }
1384
+ )
1385
+ },
1386
+ `icon-${row.key}`
1331
1387
  ) : /* @__PURE__ */ jsx3(
1332
1388
  "span",
1333
1389
  {
@@ -1354,7 +1410,7 @@ var AvailableBalanceCard = ({
1354
1410
  AvailableBalanceCard.displayName = "AvailableBalanceCard";
1355
1411
 
1356
1412
  // src/pages/user-profile/components/positions-activity.tsx
1357
- import { optimizedImageUrl as optimizedImageUrl2, useLabels as useLabels4 } from "@agg-build/hooks";
1413
+ import { optimizedImageUrl as optimizedImageUrl2, useLabels as useLabels5 } from "@agg-build/hooks";
1358
1414
  import { Fragment as Fragment4, useEffect as useEffect4, useMemo as useMemo3, useRef as useRef4, useState as useState5 } from "react";
1359
1415
 
1360
1416
  // src/pages/user-profile/user-profile.constants.ts
@@ -1561,18 +1617,31 @@ ConditionalWrapper.displayName = "ConditionalWrapper";
1561
1617
 
1562
1618
  // src/pages/user-profile/components/activity-row.tsx
1563
1619
  import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
1620
+ var shouldOpenInNewTab = (activity) => {
1621
+ return activity.kind === "redeem" || activity.kind === "deposit" || activity.kind === "withdrawal";
1622
+ };
1564
1623
  var shouldUseNativeLinkNavigation = (event) => {
1565
1624
  return event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.button === 1;
1566
1625
  };
1567
- var RowWrapper = ({ className, href, onClick, children }) => {
1626
+ var RowWrapper = ({
1627
+ className,
1628
+ href,
1629
+ target,
1630
+ rel,
1631
+ onClick,
1632
+ children
1633
+ }) => {
1568
1634
  if (href) {
1635
+ const opensInNewTab = target === "_blank";
1569
1636
  return /* @__PURE__ */ jsx4(
1570
1637
  "a",
1571
1638
  {
1572
1639
  href,
1573
1640
  className,
1641
+ target,
1642
+ rel,
1574
1643
  onClick: (event) => {
1575
- if (shouldUseNativeLinkNavigation(event)) return;
1644
+ if (shouldUseNativeLinkNavigation(event) || opensInNewTab) return;
1576
1645
  event.preventDefault();
1577
1646
  onClick();
1578
1647
  },
@@ -1754,141 +1823,152 @@ var TradeOutcomeShares = ({
1754
1823
  var RedeemRow = ({
1755
1824
  activity,
1756
1825
  className,
1826
+ href,
1757
1827
  onClick
1758
1828
  }) => {
1759
1829
  const tone = resolveToneClasses(activity);
1760
1830
  const statusVisual = getStatusVisual(activity);
1761
1831
  const activityStatus = resolveActivityStatus(activity);
1762
1832
  const shouldShowInlineStatus = activityStatus !== "completed";
1763
- return /* @__PURE__ */ jsx4("button", { type: "button", className, onClick, children: /* @__PURE__ */ jsx4(
1764
- ConditionalWrapper,
1833
+ return /* @__PURE__ */ jsx4(
1834
+ RowWrapper,
1765
1835
  {
1766
- condition: !!activity.errorMessage,
1767
- wrapper: (children) => /* @__PURE__ */ jsx4(
1768
- Tooltip,
1836
+ className,
1837
+ href,
1838
+ target: href ? "_blank" : void 0,
1839
+ rel: href ? "noopener noreferrer" : void 0,
1840
+ onClick,
1841
+ children: /* @__PURE__ */ jsx4(
1842
+ ConditionalWrapper,
1769
1843
  {
1770
- size: "medium",
1771
- content: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-4", children: [
1772
- /* @__PURE__ */ jsx4(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
1773
- /* @__PURE__ */ jsx4("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
1774
- ] }),
1775
- sideOffset: 4,
1776
- children
1777
- }
1778
- ),
1779
- children: /* @__PURE__ */ jsxs4(
1780
- "div",
1781
- {
1782
- className: cn(
1783
- "flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
1784
- "relative z-10"
1785
- ),
1786
- "data-status": activityStatus,
1787
- children: [
1788
- /* @__PURE__ */ jsx4(RedeemTypeCell, { activity, tone }),
1789
- /* @__PURE__ */ jsxs4("div", { className: "flex w-full items-center justify-between sm:hidden", children: [
1790
- /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
1791
- /* @__PURE__ */ jsx4(
1792
- Icon,
1793
- {
1794
- name: "gift-bonus",
1795
- size: "small",
1796
- className: cn(
1797
- "shrink-0 text-agg-foreground",
1798
- activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
1799
- )
1800
- }
1801
- ),
1802
- /* @__PURE__ */ jsx4(
1803
- "p",
1804
- {
1805
- className: cn(
1806
- "agg-activity-type font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
1807
- tone.primary,
1808
- activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
1809
- ),
1810
- children: activity.type
1811
- }
1812
- )
1844
+ condition: !!activity.errorMessage,
1845
+ wrapper: (children) => /* @__PURE__ */ jsx4(
1846
+ Tooltip,
1847
+ {
1848
+ size: "medium",
1849
+ content: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-4", children: [
1850
+ /* @__PURE__ */ jsx4(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
1851
+ /* @__PURE__ */ jsx4("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
1813
1852
  ] }),
1814
- /* @__PURE__ */ jsx4(OutcomeBadge, { label: activity.outcomeLabel, tone })
1815
- ] }),
1816
- /* @__PURE__ */ jsxs4("div", { className: "flex w-full items-center justify-between sm:contents", children: [
1817
- /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
1818
- /* @__PURE__ */ jsx4("div", { className: "agg-activity-image flex h-10 w-10 shrink-0 items-center justify-center sm:h-15 sm:w-15", children: /* @__PURE__ */ jsx4(
1819
- RemoteImage,
1820
- {
1821
- src: activity.thumbnailSrc,
1822
- alt: "",
1823
- className: "h-full w-full rounded-agg-sm object-cover sm:rounded-agg-lg",
1824
- classNames: { placeholder: "rounded-agg-sm sm:rounded-agg-lg" }
1825
- }
1826
- ) }),
1827
- /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1 sm:gap-2", children: [
1828
- /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 items-center gap-2", children: [
1853
+ sideOffset: 4,
1854
+ children
1855
+ }
1856
+ ),
1857
+ children: /* @__PURE__ */ jsxs4(
1858
+ "div",
1859
+ {
1860
+ className: cn(
1861
+ "flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
1862
+ "relative z-10"
1863
+ ),
1864
+ "data-status": activityStatus,
1865
+ children: [
1866
+ /* @__PURE__ */ jsx4(RedeemTypeCell, { activity, tone }),
1867
+ /* @__PURE__ */ jsxs4("div", { className: "flex w-full items-center justify-between sm:hidden", children: [
1868
+ /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
1829
1869
  /* @__PURE__ */ jsx4(
1830
- "p",
1831
- {
1832
- className: cn(
1833
- "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-bold sm:text-agg-base sm:leading-agg-6",
1834
- tone.primary
1835
- ),
1836
- children: activity.title
1837
- }
1838
- ),
1839
- shouldShowInlineStatus ? statusVisual.spin ? /* @__PURE__ */ jsx4(
1840
- LoadingIcon,
1841
- {
1842
- size: "small",
1843
- className: cn("shrink-0", statusVisual.iconClassName)
1844
- }
1845
- ) : /* @__PURE__ */ jsx4(
1846
1870
  Icon,
1847
1871
  {
1848
- name: statusVisual.icon,
1872
+ name: "gift-bonus",
1849
1873
  size: "small",
1850
- className: cn("shrink-0", statusVisual.iconClassName)
1874
+ className: cn(
1875
+ "shrink-0 text-agg-foreground",
1876
+ activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
1877
+ )
1851
1878
  }
1852
- ) : null
1853
- ] }),
1854
- /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 items-center gap-2 sm:gap-3", children: [
1855
- /* @__PURE__ */ jsx4("div", { className: "hidden sm:block", children: /* @__PURE__ */ jsx4(OutcomeBadge, { label: activity.outcomeLabel, tone }) }),
1879
+ ),
1856
1880
  /* @__PURE__ */ jsx4(
1857
1881
  "p",
1858
1882
  {
1859
1883
  className: cn(
1860
- "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
1861
- tone.meta
1884
+ "agg-activity-type font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
1885
+ tone.primary,
1886
+ activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
1862
1887
  ),
1863
- children: activity.marketTitle
1888
+ children: activity.type
1864
1889
  }
1865
1890
  )
1866
- ] })
1867
- ] })
1868
- ] }),
1869
- /* @__PURE__ */ jsx4(
1870
- AmountTimeStack,
1871
- {
1872
- amountLabel: activity.amountLabel,
1873
- timeLabel: activity.timeLabel,
1874
- tone,
1875
- mobile: true
1876
- }
1877
- )
1878
- ] }),
1879
- /* @__PURE__ */ jsx4(
1880
- AmountTimeStack,
1881
- {
1882
- amountLabel: activity.amountLabel,
1883
- timeLabel: activity.timeLabel,
1884
- tone
1885
- }
1886
- )
1887
- ]
1891
+ ] }),
1892
+ /* @__PURE__ */ jsx4(OutcomeBadge, { label: activity.outcomeLabel, tone })
1893
+ ] }),
1894
+ /* @__PURE__ */ jsxs4("div", { className: "flex w-full items-center justify-between sm:contents", children: [
1895
+ /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
1896
+ /* @__PURE__ */ jsx4("div", { className: "agg-activity-image flex h-10 w-10 shrink-0 items-center justify-center sm:h-15 sm:w-15", children: /* @__PURE__ */ jsx4(
1897
+ RemoteImage,
1898
+ {
1899
+ src: activity.thumbnailSrc,
1900
+ alt: "",
1901
+ className: "h-full w-full rounded-agg-sm object-cover sm:rounded-agg-lg",
1902
+ classNames: { placeholder: "rounded-agg-sm sm:rounded-agg-lg" }
1903
+ }
1904
+ ) }),
1905
+ /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1 sm:gap-2", children: [
1906
+ /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 items-center gap-2", children: [
1907
+ /* @__PURE__ */ jsx4(
1908
+ "p",
1909
+ {
1910
+ className: cn(
1911
+ "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-bold sm:text-agg-base sm:leading-agg-6",
1912
+ tone.primary
1913
+ ),
1914
+ children: activity.title
1915
+ }
1916
+ ),
1917
+ shouldShowInlineStatus ? statusVisual.spin ? /* @__PURE__ */ jsx4(
1918
+ LoadingIcon,
1919
+ {
1920
+ size: "small",
1921
+ className: cn("shrink-0", statusVisual.iconClassName)
1922
+ }
1923
+ ) : /* @__PURE__ */ jsx4(
1924
+ Icon,
1925
+ {
1926
+ name: statusVisual.icon,
1927
+ size: "small",
1928
+ className: cn("shrink-0", statusVisual.iconClassName)
1929
+ }
1930
+ ) : null
1931
+ ] }),
1932
+ /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 items-center gap-2 sm:gap-3", children: [
1933
+ /* @__PURE__ */ jsx4("div", { className: "hidden sm:block", children: /* @__PURE__ */ jsx4(OutcomeBadge, { label: activity.outcomeLabel, tone }) }),
1934
+ /* @__PURE__ */ jsx4(
1935
+ "p",
1936
+ {
1937
+ className: cn(
1938
+ "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
1939
+ tone.meta
1940
+ ),
1941
+ children: activity.marketTitle
1942
+ }
1943
+ )
1944
+ ] })
1945
+ ] })
1946
+ ] }),
1947
+ /* @__PURE__ */ jsx4(
1948
+ AmountTimeStack,
1949
+ {
1950
+ amountLabel: activity.amountLabel,
1951
+ timeLabel: activity.timeLabel,
1952
+ tone,
1953
+ mobile: true
1954
+ }
1955
+ )
1956
+ ] }),
1957
+ /* @__PURE__ */ jsx4(
1958
+ AmountTimeStack,
1959
+ {
1960
+ amountLabel: activity.amountLabel,
1961
+ timeLabel: activity.timeLabel,
1962
+ tone
1963
+ }
1964
+ )
1965
+ ]
1966
+ }
1967
+ )
1888
1968
  }
1889
1969
  )
1890
1970
  }
1891
- ) });
1971
+ );
1892
1972
  };
1893
1973
  var TradeRow = ({
1894
1974
  activity,
@@ -1991,124 +2071,135 @@ var TradeRow = ({
1991
2071
  var TransferRow = ({
1992
2072
  activity,
1993
2073
  className,
2074
+ href,
1994
2075
  onClick
1995
2076
  }) => {
1996
2077
  const tone = resolveToneClasses(activity);
1997
2078
  const transferStatus = resolveActivityStatus(activity);
1998
2079
  const transferIconName = TRANSFER_ICON[activity.kind];
1999
2080
  const statusVisual = getStatusVisual(activity);
2000
- return /* @__PURE__ */ jsx4("button", { type: "button", className, onClick, children: /* @__PURE__ */ jsx4(
2001
- ConditionalWrapper,
2081
+ return /* @__PURE__ */ jsx4(
2082
+ RowWrapper,
2002
2083
  {
2003
- condition: !!activity.errorMessage,
2004
- wrapper: (children) => /* @__PURE__ */ jsx4(
2005
- Tooltip,
2006
- {
2007
- size: "medium",
2008
- content: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-4", children: [
2009
- /* @__PURE__ */ jsx4(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
2010
- /* @__PURE__ */ jsx4("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
2011
- ] }),
2012
- sideOffset: 4,
2013
- children
2014
- }
2015
- ),
2016
- children: /* @__PURE__ */ jsxs4(
2017
- "div",
2084
+ className,
2085
+ href,
2086
+ target: href ? "_blank" : void 0,
2087
+ rel: href ? "noopener noreferrer" : void 0,
2088
+ onClick,
2089
+ children: /* @__PURE__ */ jsx4(
2090
+ ConditionalWrapper,
2018
2091
  {
2019
- className: cn(
2020
- "flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
2021
- "relative z-10"
2092
+ condition: !!activity.errorMessage,
2093
+ wrapper: (children) => /* @__PURE__ */ jsx4(
2094
+ Tooltip,
2095
+ {
2096
+ size: "medium",
2097
+ content: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-4", children: [
2098
+ /* @__PURE__ */ jsx4(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
2099
+ /* @__PURE__ */ jsx4("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
2100
+ ] }),
2101
+ sideOffset: 4,
2102
+ children
2103
+ }
2022
2104
  ),
2023
- children: [
2024
- /* @__PURE__ */ jsx4(TransferTypeCell, { activity, tone }),
2025
- /* @__PURE__ */ jsx4("div", { className: "flex w-full items-center justify-between sm:hidden", children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
2026
- /* @__PURE__ */ jsx4(
2027
- Icon,
2028
- {
2029
- name: transferIconName,
2030
- size: "small",
2031
- className: cn(
2032
- "shrink-0 text-agg-foreground",
2033
- activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
2034
- )
2035
- }
2105
+ children: /* @__PURE__ */ jsxs4(
2106
+ "div",
2107
+ {
2108
+ className: cn(
2109
+ "flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
2110
+ "relative z-10"
2036
2111
  ),
2037
- /* @__PURE__ */ jsx4(
2038
- "p",
2039
- {
2040
- className: cn(
2041
- "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
2042
- tone.primary,
2043
- activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
2044
- ),
2045
- children: activity.type
2046
- }
2047
- )
2048
- ] }) }),
2049
- /* @__PURE__ */ jsxs4("div", { className: "flex w-full items-center justify-between sm:contents", children: [
2050
- /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
2051
- /* @__PURE__ */ jsx4(
2052
- "div",
2053
- {
2054
- className: "agg-activity-deposit-square hidden h-15 w-15 shrink-0 items-center justify-center rounded-agg-lg bg-agg-secondary-hover sm:flex",
2055
- "data-status": transferStatus,
2056
- children: statusVisual.spin ? /* @__PURE__ */ jsx4(LoadingIcon, { size: "medium", className: cn(statusVisual.iconClassName) }) : /* @__PURE__ */ jsx4(
2057
- Icon,
2058
- {
2059
- name: statusVisual.icon,
2060
- size: "medium",
2061
- className: cn(statusVisual.iconClassName)
2062
- }
2063
- )
2064
- }
2065
- ),
2066
- /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1", children: [
2112
+ children: [
2113
+ /* @__PURE__ */ jsx4(TransferTypeCell, { activity, tone }),
2114
+ /* @__PURE__ */ jsx4("div", { className: "flex w-full items-center justify-between sm:hidden", children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
2067
2115
  /* @__PURE__ */ jsx4(
2068
- "p",
2116
+ Icon,
2069
2117
  {
2118
+ name: transferIconName,
2119
+ size: "small",
2070
2120
  className: cn(
2071
- "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-bold sm:text-agg-base sm:leading-agg-6",
2072
- tone.primary
2073
- ),
2074
- children: activity.title
2121
+ "shrink-0 text-agg-foreground",
2122
+ activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
2123
+ )
2075
2124
  }
2076
2125
  ),
2077
2126
  /* @__PURE__ */ jsx4(
2078
2127
  "p",
2079
2128
  {
2080
2129
  className: cn(
2081
- "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
2082
- tone.meta
2130
+ "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
2131
+ tone.primary,
2132
+ activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
2083
2133
  ),
2084
- children: activity.subtitleLabel
2134
+ children: activity.type
2085
2135
  }
2086
2136
  )
2087
- ] })
2088
- ] }),
2089
- /* @__PURE__ */ jsx4(
2090
- AmountTimeStack,
2091
- {
2092
- amountLabel: activity.amountLabel,
2093
- timeLabel: activity.timeLabel,
2094
- tone,
2095
- mobile: true
2096
- }
2097
- )
2098
- ] }),
2099
- /* @__PURE__ */ jsx4(
2100
- AmountTimeStack,
2101
- {
2102
- amountLabel: activity.amountLabel,
2103
- timeLabel: activity.timeLabel,
2104
- tone
2105
- }
2106
- )
2107
- ]
2137
+ ] }) }),
2138
+ /* @__PURE__ */ jsxs4("div", { className: "flex w-full items-center justify-between sm:contents", children: [
2139
+ /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
2140
+ /* @__PURE__ */ jsx4(
2141
+ "div",
2142
+ {
2143
+ className: "agg-activity-deposit-square hidden h-15 w-15 shrink-0 items-center justify-center rounded-agg-lg bg-agg-secondary-hover sm:flex",
2144
+ "data-status": transferStatus,
2145
+ children: statusVisual.spin ? /* @__PURE__ */ jsx4(LoadingIcon, { size: "medium", className: cn(statusVisual.iconClassName) }) : /* @__PURE__ */ jsx4(
2146
+ Icon,
2147
+ {
2148
+ name: statusVisual.icon,
2149
+ size: "medium",
2150
+ className: cn(statusVisual.iconClassName)
2151
+ }
2152
+ )
2153
+ }
2154
+ ),
2155
+ /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1", children: [
2156
+ /* @__PURE__ */ jsx4(
2157
+ "p",
2158
+ {
2159
+ className: cn(
2160
+ "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-bold sm:text-agg-base sm:leading-agg-6",
2161
+ tone.primary
2162
+ ),
2163
+ children: activity.title
2164
+ }
2165
+ ),
2166
+ /* @__PURE__ */ jsx4(
2167
+ "p",
2168
+ {
2169
+ className: cn(
2170
+ "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
2171
+ tone.meta
2172
+ ),
2173
+ children: activity.subtitleLabel
2174
+ }
2175
+ )
2176
+ ] })
2177
+ ] }),
2178
+ /* @__PURE__ */ jsx4(
2179
+ AmountTimeStack,
2180
+ {
2181
+ amountLabel: activity.amountLabel,
2182
+ timeLabel: activity.timeLabel,
2183
+ tone,
2184
+ mobile: true
2185
+ }
2186
+ )
2187
+ ] }),
2188
+ /* @__PURE__ */ jsx4(
2189
+ AmountTimeStack,
2190
+ {
2191
+ amountLabel: activity.amountLabel,
2192
+ timeLabel: activity.timeLabel,
2193
+ tone
2194
+ }
2195
+ )
2196
+ ]
2197
+ }
2198
+ )
2108
2199
  }
2109
2200
  )
2110
2201
  }
2111
- ) });
2202
+ );
2112
2203
  };
2113
2204
  var ActivityRow = ({ activity, href, onClick }) => {
2114
2205
  const handleClick = () => {
@@ -2125,9 +2216,25 @@ var ActivityRow = ({ activity, href, onClick }) => {
2125
2216
  return /* @__PURE__ */ jsx4(TradeRow, { activity, className: sharedClassName, href, onClick: handleClick });
2126
2217
  }
2127
2218
  if (activity.kind === "redeem") {
2128
- return /* @__PURE__ */ jsx4(RedeemRow, { activity, className: sharedClassName, onClick: handleClick });
2219
+ return /* @__PURE__ */ jsx4(
2220
+ RedeemRow,
2221
+ {
2222
+ activity,
2223
+ className: sharedClassName,
2224
+ href: shouldOpenInNewTab(activity) ? href : void 0,
2225
+ onClick: handleClick
2226
+ }
2227
+ );
2129
2228
  }
2130
- return /* @__PURE__ */ jsx4(TransferRow, { activity, className: sharedClassName, onClick: handleClick });
2229
+ return /* @__PURE__ */ jsx4(
2230
+ TransferRow,
2231
+ {
2232
+ activity,
2233
+ className: sharedClassName,
2234
+ href: shouldOpenInNewTab(activity) ? href : void 0,
2235
+ onClick: handleClick
2236
+ }
2237
+ );
2131
2238
  };
2132
2239
  ActivityRow.displayName = "ActivityRow";
2133
2240
 
@@ -2153,7 +2260,7 @@ var EmptyState = ({ title, description, className }) => {
2153
2260
  EmptyState.displayName = "EmptyState";
2154
2261
 
2155
2262
  // src/pages/user-profile/components/position-row.tsx
2156
- import { optimizedImageUrl, useLabels as useLabels3 } from "@agg-build/hooks";
2263
+ import { optimizedImageUrl, useLabels as useLabels4 } from "@agg-build/hooks";
2157
2264
  import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
2158
2265
  var shouldUseNativeLinkNavigation2 = (event) => {
2159
2266
  return event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.button === 1;
@@ -2291,7 +2398,7 @@ var PositionRow = ({
2291
2398
  onClaim,
2292
2399
  isClaiming = false
2293
2400
  }) => {
2294
- const labels = useLabels3().userProfile.positions;
2401
+ const labels = useLabels4().userProfile.positions;
2295
2402
  const model = toPositionRowViewModel(position, {
2296
2403
  avgPrefix: labels.avgPrefix,
2297
2404
  nowPrefix: labels.nowPrefix,
@@ -2504,7 +2611,7 @@ var PositionsActivity = ({
2504
2611
  initialPositionFilter = "active",
2505
2612
  className
2506
2613
  }) => {
2507
- const positionsLabels = useLabels4().userProfile.positions;
2614
+ const positionsLabels = useLabels5().userProfile.positions;
2508
2615
  const isTabControlled = tab !== void 0;
2509
2616
  const [internalActiveTab, setInternalActiveTab] = useState5(
2510
2617
  tab != null ? tab : USER_PROFILE_TAB_POSITIONS
@@ -2974,7 +3081,7 @@ var PositionsValueCard = ({
2974
3081
  PositionsValueCard.displayName = "PositionsValueCard";
2975
3082
 
2976
3083
  // src/pages/user-profile/components/user-info-card.tsx
2977
- import { optimizedImageUrl as optimizedImageUrl3, useLabels as useLabels5 } from "@agg-build/hooks";
3084
+ import { optimizedImageUrl as optimizedImageUrl3, useLabels as useLabels6 } from "@agg-build/hooks";
2978
3085
 
2979
3086
  // src/pages/user-profile/components/default-avatar.tsx
2980
3087
  import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
@@ -3033,7 +3140,7 @@ var UserInfoCard = ({
3033
3140
  className
3034
3141
  }) => {
3035
3142
  var _a;
3036
- const labels = useLabels5();
3143
+ const labels = useLabels6();
3037
3144
  const wallets = (_a = user.connectedWallets) != null ? _a : [];
3038
3145
  const hasWallets = wallets.length > 0;
3039
3146
  return /* @__PURE__ */ jsxs10(
@@ -3166,6 +3273,27 @@ var UserInfoCard = ({
3166
3273
  };
3167
3274
  UserInfoCard.displayName = "UserInfoCard";
3168
3275
 
3276
+ // src/pages/user-profile/transaction-explorer.ts
3277
+ var AGG_TX_EXPLORER_URLS = {
3278
+ "1": "https://etherscan.io/tx/",
3279
+ "56": "https://bscscan.com/tx/",
3280
+ "137": "https://polygonscan.com/tx/",
3281
+ "1337": "https://app.hyperliquid.xyz/explorer/tx/",
3282
+ "8453": "https://basescan.org/tx/",
3283
+ "42161": "https://arbiscan.io/tx/",
3284
+ "792703809": "https://solscan.io/tx/"
3285
+ };
3286
+ var buildAggTxExplorerHref = (chainId, txHash) => {
3287
+ if (chainId === null || chainId === void 0) return void 0;
3288
+ if (!txHash) return void 0;
3289
+ const normalizedChainId = String(chainId).trim();
3290
+ const normalizedTxHash = txHash.trim();
3291
+ if (!normalizedChainId || !normalizedTxHash) return void 0;
3292
+ const baseUrl = AGG_TX_EXPLORER_URLS[normalizedChainId];
3293
+ if (!baseUrl) return void 0;
3294
+ return `${baseUrl}${normalizedTxHash}`;
3295
+ };
3296
+
3169
3297
  // src/pages/user-profile/index.tsx
3170
3298
  import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
3171
3299
  var currencyFormatter = new Intl.NumberFormat("en-US", {
@@ -3205,7 +3333,11 @@ var TOKEN_DECIMALS_BY_SYMBOL = {
3205
3333
  var TOKEN_DECIMALS_BY_CHAIN_AND_SYMBOL = {
3206
3334
  "56": {
3207
3335
  USDC: 18,
3208
- USDT: 18
3336
+ USDT: 18,
3337
+ // USD1 (World Liberty Financial) is the Myriad settlement token on BNB and
3338
+ // is 18-dec like the other BNB stables. Without this it falls back to 6-dec
3339
+ // and renders an 18-dec amount inflated by ~10^12 (e.g. $3.90 → trillions).
3340
+ USD1: 18
3209
3341
  }
3210
3342
  };
3211
3343
  var parseRawMicroValue = (value) => {
@@ -3354,7 +3486,6 @@ var toSignedAmountLabel = (sign, executionPrice, filledAmountRaw) => {
3354
3486
  const amountLabel = toAmountLabel(executionPrice, filledAmountRaw);
3355
3487
  return amountLabel === "-" ? amountLabel : `${sign}${amountLabel}`;
3356
3488
  };
3357
- var SVM_CHAIN_IDS = /* @__PURE__ */ new Set(["792703809"]);
3358
3489
  var OPEN_ORDER_STATUSES = /* @__PURE__ */ new Set([
3359
3490
  "pending",
3360
3491
  "signing",
@@ -3465,44 +3596,6 @@ var shouldFetchFullUserProfile = (userProfile) => {
3465
3596
  if (!userProfile) return true;
3466
3597
  return !userProfile.username && !userProfile.avatarUrl && ((_b = (_a = userProfile.accounts) == null ? void 0 : _a.length) != null ? _b : 0) === 0 && ((_d = (_c = userProfile.wallets) == null ? void 0 : _c.length) != null ? _d : 0) === 0;
3467
3598
  };
3468
- var normalizeAddress = (address) => {
3469
- const trimmed = address == null ? void 0 : address.trim();
3470
- return trimmed ? trimmed.toLowerCase() : void 0;
3471
- };
3472
- var toNumericChainId = (chainId) => {
3473
- const parsed = Number(chainId);
3474
- return Number.isFinite(parsed) ? parsed : void 0;
3475
- };
3476
- var getConnectedWalletAccountAddresses = (userProfile) => {
3477
- var _a;
3478
- const accounts = (_a = userProfile == null ? void 0 : userProfile.accounts) != null ? _a : [];
3479
- const walletAccounts = accounts.filter((account) => {
3480
- var _a2;
3481
- const provider = (_a2 = account.provider) == null ? void 0 : _a2.toLowerCase();
3482
- return provider === "wallet" || provider === "solana_wallet";
3483
- });
3484
- return new Set(
3485
- walletAccounts.map((account) => normalizeAddress(account.providerAccountId)).filter((address) => !!address)
3486
- );
3487
- };
3488
- var resolveDepositActivitySource = ({
3489
- fromAddress,
3490
- chainId,
3491
- connectedWalletAddresses,
3492
- depositAddress
3493
- }) => {
3494
- const normalizedFromAddress = normalizeAddress(fromAddress);
3495
- if (normalizedFromAddress && connectedWalletAddresses.has(normalizedFromAddress)) {
3496
- return "wallet";
3497
- }
3498
- if (normalizedFromAddress && normalizedFromAddress === normalizeAddress(depositAddress)) {
3499
- return "crypto";
3500
- }
3501
- if (SVM_CHAIN_IDS.has(chainId.trim())) {
3502
- return "wallet";
3503
- }
3504
- return "crypto";
3505
- };
3506
3599
  var toTradeThumbnailSrc = (item, orders) => {
3507
3600
  var _a, _b, _c;
3508
3601
  if ((_a = item.venueMarket) == null ? void 0 : _a.image) return item.venueMarket.image;
@@ -3571,6 +3664,7 @@ var UserProfilePage = ({
3571
3664
  activePositions,
3572
3665
  closedPositions,
3573
3666
  activities,
3667
+ executionMode,
3574
3668
  onEditProfile,
3575
3669
  onDeposit,
3576
3670
  onWithdraw,
@@ -3619,7 +3713,10 @@ var UserProfilePage = ({
3619
3713
  const { isDepositBlocked } = useGeoBlock();
3620
3714
  const balanceState = useAggBalance();
3621
3715
  const client = useAggClient();
3622
- const labels = useLabels6();
3716
+ const labels = useLabels7();
3717
+ const {
3718
+ trading: { executionMode: configuredExecutionMode }
3719
+ } = useSdkUiConfig3();
3623
3720
  const claimNotificationLabels = labels.notifications.claim;
3624
3721
  const toastCtx = useOptionalToast();
3625
3722
  const queryClient = useQueryClient();
@@ -3652,15 +3749,19 @@ var UserProfilePage = ({
3652
3749
  return [...new Set(fromBalance)].sort((a, b) => a.localeCompare(b));
3653
3750
  }, [balanceState, shouldUseHookData]);
3654
3751
  const [positionFilter, setPositionFilter] = useState6(initialPositionFilter);
3752
+ const resolvedExecutionMode = executionMode != null ? executionMode : configuredExecutionMode;
3753
+ const queryExecutionMode = resolvedExecutionMode === "paper" ? "paper" : void 0;
3655
3754
  const activePositionsQuery = useExecutionPositions({
3656
3755
  enabled: shouldUseHookData && isAuthenticated,
3657
3756
  status: "active",
3658
- limit: 25
3757
+ limit: 25,
3758
+ mode: queryExecutionMode
3659
3759
  });
3660
3760
  const closedPositionsQuery = useExecutionPositions({
3661
3761
  enabled: shouldUseHookData && isAuthenticated,
3662
3762
  status: "closed",
3663
- limit: 25
3763
+ limit: 25,
3764
+ mode: queryExecutionMode
3664
3765
  });
3665
3766
  const handlePositionFilterChange = useCallback3(
3666
3767
  (filter) => {
@@ -3674,16 +3775,13 @@ var UserProfilePage = ({
3674
3775
  }, [initialPositionFilter]);
3675
3776
  const ordersQuery = useExecutionOrders({
3676
3777
  enabled: shouldUseHookData && isAuthenticated,
3677
- limit: 25
3778
+ limit: 25,
3779
+ mode: queryExecutionMode
3678
3780
  });
3679
3781
  const activityQuery = useUserActivity({
3680
3782
  enabled: shouldUseHookData && isAuthenticated,
3681
3783
  limit: 25
3682
3784
  });
3683
- const depositAddressesQuery = useDepositAddresses({
3684
- enabled: shouldUseHookData && isAuthenticated,
3685
- poll: false
3686
- });
3687
3785
  const handleCancelOrder = useCallback3(
3688
3786
  (order) => __async(null, null, function* () {
3689
3787
  if (onCancelOrder) {
@@ -3983,10 +4081,8 @@ var UserProfilePage = ({
3983
4081
  const resolvedActivities = useMemo4(() => {
3984
4082
  if (activities) return activities.filter(isVisibleUserProfileActivity);
3985
4083
  const formatTime = isHydrated ? toRelativeTimeLabel : toAbsoluteTimeLabel;
3986
- const fullUser = profileUser != null ? profileUser : currentUser;
3987
- const connectedWalletAddresses = getConnectedWalletAccountAddresses(fullUser);
3988
4084
  return activityQuery.activities.filter(isVisibleActivityItem).map((item, index) => {
3989
- 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;
4085
+ 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;
3990
4086
  const timeLabel = formatTime(getRuntimeActivityCreatedAt(item));
3991
4087
  if (item.type === "trade") {
3992
4088
  const tradeItem = item;
@@ -4041,13 +4137,15 @@ var UserProfilePage = ({
4041
4137
  return {
4042
4138
  kind: "withdrawal",
4043
4139
  id: withdrawalItem.id,
4140
+ chainId: (_p = withdrawalItem.chainId) != null ? _p : void 0,
4141
+ txHash: (_q = withdrawalItem.txHash) != null ? _q : void 0,
4044
4142
  isFailed,
4045
4143
  hasError,
4046
4144
  errorMessage,
4047
4145
  status,
4048
4146
  type: labels.userProfile.activity.withdrawalType,
4049
4147
  title: titleByStatus[status],
4050
- subtitleLabel: `to ${(_p = shortenAddress(withdrawalItem.destinationAddress)) != null ? _p : withdrawalItem.destinationAddress} \xB7 ${formatChainIdLabel(withdrawalItem.destinationChainId)}`,
4148
+ subtitleLabel: `to ${(_r = shortenAddress(withdrawalItem.destinationAddress)) != null ? _r : withdrawalItem.destinationAddress} \xB7 ${formatChainIdLabel(withdrawalItem.destinationChainId)}`,
4051
4149
  amountLabel,
4052
4150
  timeLabel
4053
4151
  };
@@ -4057,19 +4155,13 @@ var UserProfilePage = ({
4057
4155
  const normalizedStatus = normalizeDepositStatus(depositItem.status);
4058
4156
  const timedOut = normalizedStatus === "pending" && isPendingTransferTimedOut(depositItem.createdAt);
4059
4157
  const status = timedOut ? "failed" : normalizedStatus;
4060
- const errorMessage = timedOut ? PENDING_TRANSFER_TIMEOUT_ERROR_MESSAGE : (_q = getActivityErrorMessage(depositItem)) != null ? _q : void 0;
4158
+ const errorMessage = timedOut ? PENDING_TRANSFER_TIMEOUT_ERROR_MESSAGE : (_s = getActivityErrorMessage(depositItem)) != null ? _s : void 0;
4061
4159
  const isFailed = status === "failed";
4062
4160
  const hasError = timedOut || hasActivityError(depositItem);
4063
- const depositSource = resolveDepositActivitySource({
4064
- fromAddress: depositItem.fromAddress,
4065
- chainId: depositItem.chainId,
4066
- connectedWalletAddresses,
4067
- depositAddress: depositAddressesQuery.getAddress(toNumericChainId(depositItem.chainId))
4068
- });
4161
+ const depositSource = depositItem.source;
4069
4162
  const depositTitlesBySource = {
4070
- wallet: labels.userProfile.activity.depositStatusTitles.connectedWallet,
4071
- crypto: labels.userProfile.activity.depositStatusTitles.externalWallet,
4072
- card: labels.userProfile.activity.depositStatusTitles.card
4163
+ connected_wallet: labels.userProfile.activity.depositStatusTitles.connectedWallet,
4164
+ external_wallet: labels.userProfile.activity.depositStatusTitles.externalWallet
4073
4165
  };
4074
4166
  const amountLabel = status === "failed" || status === "canceled" ? ZERO_AMOUNT_LABEL : toTokenAmountLabel({
4075
4167
  amountRaw: depositItem.amountRaw,
@@ -4080,17 +4172,18 @@ var UserProfilePage = ({
4080
4172
  return {
4081
4173
  kind: "deposit",
4082
4174
  id: depositItem.id,
4175
+ chainId: depositItem.chainId,
4176
+ txHash: depositItem.txHash,
4083
4177
  isFailed,
4084
4178
  hasError,
4085
4179
  errorMessage,
4086
4180
  status,
4087
4181
  type: labels.userProfile.activity.depositType,
4088
4182
  title: depositTitlesBySource[depositSource][status],
4089
- subtitleLabel: `from ${(_r = shortenAddress(depositItem.fromAddress)) != null ? _r : depositItem.fromAddress} \xB7 ${formatChainIdLabel(depositItem.chainId)}`,
4183
+ subtitleLabel: `from ${(_t = shortenAddress(depositItem.fromAddress)) != null ? _t : depositItem.fromAddress} \xB7 ${formatChainIdLabel(depositItem.chainId)}`,
4090
4184
  amountLabel,
4091
4185
  timeLabel,
4092
- depositSource,
4093
- chainId: depositItem.chainId
4186
+ depositSource: depositSource === "connected_wallet" ? "wallet" : "crypto"
4094
4187
  };
4095
4188
  }
4096
4189
  if (item.type === "redeem") {
@@ -4098,23 +4191,25 @@ var UserProfilePage = ({
4098
4191
  const redeemLegs = Array.isArray(redeemItem.legs) ? redeemItem.legs : [];
4099
4192
  const firstLeg = redeemLegs[0];
4100
4193
  const status = getDerivedRedeemStatus(redeemItem);
4101
- const firstLegErrorMessage = (_t = (_s = redeemLegs.find((leg) => typeof leg.errorMessage === "string" && leg.errorMessage)) == null ? void 0 : _s.errorMessage) != null ? _t : void 0;
4102
- const errorMessage = (_u = getActivityErrorMessage(redeemItem)) != null ? _u : firstLegErrorMessage;
4194
+ const firstLegErrorMessage = (_v = (_u = redeemLegs.find((leg) => typeof leg.errorMessage === "string" && leg.errorMessage)) == null ? void 0 : _u.errorMessage) != null ? _v : void 0;
4195
+ const errorMessage = (_w = getActivityErrorMessage(redeemItem)) != null ? _w : firstLegErrorMessage;
4103
4196
  const isFailed = status === "failed";
4104
4197
  const hasError = isFailed || !!(errorMessage == null ? void 0 : errorMessage.trim());
4105
4198
  const titleByStatus = labels.userProfile.activity.redeemStatusTitles;
4106
4199
  return {
4107
4200
  kind: "redeem",
4108
4201
  id: redeemItem.id,
4202
+ chainId: (_x = firstLeg == null ? void 0 : firstLeg.chainId) != null ? _x : void 0,
4203
+ txHash: (_y = firstLeg == null ? void 0 : firstLeg.txHash) != null ? _y : void 0,
4109
4204
  isFailed,
4110
4205
  hasError,
4111
4206
  errorMessage: errorMessage != null ? errorMessage : void 0,
4112
4207
  status,
4113
4208
  type: labels.userProfile.activity.redeemType,
4114
4209
  title: titleByStatus[status],
4115
- thumbnailSrc: (_w = (_v = firstLeg == null ? void 0 : firstLeg.venueMarket) == null ? void 0 : _v.image) != null ? _w : fallbackThumbnailSrc,
4116
- marketTitle: (_y = (_x = firstLeg == null ? void 0 : firstLeg.venueMarket) == null ? void 0 : _x.question) != null ? _y : "Market",
4117
- outcomeLabel: (_C = (_B = (_z = firstLeg == null ? void 0 : firstLeg.venueMarketOutcome) == null ? void 0 : _z.title) != null ? _B : (_A = firstLeg == null ? void 0 : firstLeg.venueMarketOutcome) == null ? void 0 : _A.label) != null ? _C : "",
4210
+ thumbnailSrc: (_A = (_z = firstLeg == null ? void 0 : firstLeg.venueMarket) == null ? void 0 : _z.image) != null ? _A : fallbackThumbnailSrc,
4211
+ marketTitle: (_C = (_B = firstLeg == null ? void 0 : firstLeg.venueMarket) == null ? void 0 : _B.question) != null ? _C : "Market",
4212
+ outcomeLabel: (_G = (_F = (_D = firstLeg == null ? void 0 : firstLeg.venueMarketOutcome) == null ? void 0 : _D.title) != null ? _F : (_E = firstLeg == null ? void 0 : firstLeg.venueMarketOutcome) == null ? void 0 : _E.label) != null ? _G : "",
4118
4213
  amountLabel: status === "failed" || status === "canceled" ? ZERO_AMOUNT_LABEL : toRedeemPayoutAmountLabel(redeemItem),
4119
4214
  timeLabel
4120
4215
  };
@@ -4131,16 +4226,7 @@ var UserProfilePage = ({
4131
4226
  timeLabel
4132
4227
  };
4133
4228
  });
4134
- }, [
4135
- activities,
4136
- activityQuery.activities,
4137
- currentUser,
4138
- depositAddressesQuery,
4139
- isHydrated,
4140
- labels,
4141
- ordersQuery.orders,
4142
- profileUser
4143
- ]);
4229
+ }, [activities, activityQuery.activities, isHydrated, labels, ordersQuery.orders]);
4144
4230
  const resolvedOpenOrders = useMemo4(() => {
4145
4231
  if (openOrders) return openOrders;
4146
4232
  return ordersQuery.orders.filter((order) => isOpenOrderStatus(order.status)).map((order) => {
@@ -4241,7 +4327,7 @@ var UserProfilePage = ({
4241
4327
  {
4242
4328
  className: cn(
4243
4329
  "agg-user-profile-page",
4244
- "w-full mx-auto px-6 lg:px-10 pb-10 max-w-[1360px]",
4330
+ "w-full mx-auto px-6 lg:px-10 pb-10 max-w-[1440px]",
4245
4331
  classNames == null ? void 0 : classNames.root
4246
4332
  ),
4247
4333
  children: /* @__PURE__ */ jsxs11(
@@ -4375,5 +4461,6 @@ export {
4375
4461
  USER_PROFILE_TAB_POSITIONS,
4376
4462
  USER_PROFILE_TAB_OPEN_ORDERS,
4377
4463
  USER_PROFILE_TAB_ACTIVITY,
4464
+ buildAggTxExplorerHref,
4378
4465
  UserProfilePage
4379
4466
  };