@agg-build/ui 4.10.0 → 4.11.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/{chunk-H5LCCV2J.mjs → chunk-EYJS45RP.mjs} +13 -1
- package/dist/{chunk-SMQRUNMZ.mjs → chunk-VMG6BUHI.mjs} +2 -2
- package/dist/{chunk-4HTE5IEZ.mjs → chunk-WWIVSROM.mjs} +30 -10
- package/dist/events.js +31 -19
- package/dist/events.mjs +1 -1
- package/dist/index.js +293 -261
- package/dist/index.mjs +3 -3
- package/dist/pages.js +315 -283
- package/dist/pages.mjs +3 -3
- package/dist/trading.js +30 -10
- package/dist/trading.mjs +1 -1
- package/dist/types/events/list/event-list.constants.d.mts +1 -1
- package/dist/types/events/list/event-list.constants.d.ts +1 -1
- package/package.json +3 -3
package/dist/pages.js
CHANGED
|
@@ -101,7 +101,7 @@ __export(pages_exports, {
|
|
|
101
101
|
module.exports = __toCommonJS(pages_exports);
|
|
102
102
|
|
|
103
103
|
// src/pages/home/index.tsx
|
|
104
|
-
var
|
|
104
|
+
var import_hooks75 = require("@agg-build/hooks");
|
|
105
105
|
var import_sdk25 = require("@agg-build/sdk");
|
|
106
106
|
var import_react48 = require("react");
|
|
107
107
|
|
|
@@ -10548,7 +10548,7 @@ var EventListItemV2 = (props) => {
|
|
|
10548
10548
|
EventListItemV2.displayName = "EventListItemV2";
|
|
10549
10549
|
|
|
10550
10550
|
// src/events/list/index.tsx
|
|
10551
|
-
var
|
|
10551
|
+
var import_hooks41 = require("@agg-build/hooks");
|
|
10552
10552
|
var import_sdk16 = require("@agg-build/sdk");
|
|
10553
10553
|
var Dialog2 = __toESM(require("@radix-ui/react-dialog"));
|
|
10554
10554
|
var import_react18 = require("react");
|
|
@@ -10671,11 +10671,12 @@ var CategorySidebar = ({
|
|
|
10671
10671
|
CategorySidebar.displayName = "CategorySidebar";
|
|
10672
10672
|
|
|
10673
10673
|
// src/events/list/event-list-tabs.tsx
|
|
10674
|
-
var
|
|
10674
|
+
var import_hooks40 = require("@agg-build/hooks");
|
|
10675
10675
|
var import_sdk15 = require("@agg-build/sdk");
|
|
10676
10676
|
var import_react17 = require("react");
|
|
10677
10677
|
|
|
10678
10678
|
// src/events/list/event-list.constants.ts
|
|
10679
|
+
var import_hooks39 = require("@agg-build/hooks");
|
|
10679
10680
|
var import_sdk14 = require("@agg-build/sdk");
|
|
10680
10681
|
var DEFAULT_EVENTS_LIMIT = 50;
|
|
10681
10682
|
var DEFAULT_EVENT_LIST_SORT = "volume24hr";
|
|
@@ -10686,7 +10687,7 @@ var EVENT_LIST_SORT_VALUES = [
|
|
|
10686
10687
|
"endDate"
|
|
10687
10688
|
];
|
|
10688
10689
|
var getDefaultEventListTabs = (labels) => {
|
|
10689
|
-
|
|
10690
|
+
const tabs = [
|
|
10690
10691
|
{
|
|
10691
10692
|
value: "matched",
|
|
10692
10693
|
label: labels.eventList.matchedTab,
|
|
@@ -10762,6 +10763,17 @@ var getDefaultEventListTabs = (labels) => {
|
|
|
10762
10763
|
isComingSoon: true
|
|
10763
10764
|
}
|
|
10764
10765
|
];
|
|
10766
|
+
const venueRank = new Map(
|
|
10767
|
+
(0, import_hooks39.sortVenues)(tabs.flatMap((tab) => tab.venueLogo ? [tab.venueLogo] : [])).map((venue, i) => [
|
|
10768
|
+
venue,
|
|
10769
|
+
i
|
|
10770
|
+
])
|
|
10771
|
+
);
|
|
10772
|
+
const rank = (tab) => {
|
|
10773
|
+
var _a;
|
|
10774
|
+
return tab.venueLogo ? 1 + ((_a = venueRank.get(tab.venueLogo)) != null ? _a : venueRank.size) : 0;
|
|
10775
|
+
};
|
|
10776
|
+
return [...tabs].sort((a, b) => rank(a) - rank(b));
|
|
10765
10777
|
};
|
|
10766
10778
|
|
|
10767
10779
|
// src/events/list/event-list-tabs.tsx
|
|
@@ -10785,14 +10797,14 @@ var renderTabIcon = (tab, isActive) => {
|
|
|
10785
10797
|
);
|
|
10786
10798
|
};
|
|
10787
10799
|
var useEventListTabs = (tabs) => {
|
|
10788
|
-
const labels = (0,
|
|
10789
|
-
const { disabledVenues, isLoading: isAppConfigLoading } = (0,
|
|
10790
|
-
const { isLocationBlocked } = (0,
|
|
10800
|
+
const labels = (0, import_hooks40.useLabels)();
|
|
10801
|
+
const { disabledVenues, isLoading: isAppConfigLoading } = (0, import_hooks40.useAppConfig)();
|
|
10802
|
+
const { isLocationBlocked } = (0, import_hooks40.useGeoBlock)();
|
|
10791
10803
|
return (0, import_react17.useMemo)(() => {
|
|
10792
10804
|
const baseTabs = tabs != null ? tabs : getDefaultEventListTabs(labels);
|
|
10793
10805
|
return baseTabs.flatMap((tab) => {
|
|
10794
10806
|
if (!tab.venueLogo) return [tab];
|
|
10795
|
-
const availabilityState = (0,
|
|
10807
|
+
const availabilityState = (0, import_hooks40.getVenueAvailabilityState)({
|
|
10796
10808
|
venueId: tab.venueLogo,
|
|
10797
10809
|
disabledVenues,
|
|
10798
10810
|
// A globally inactive or default-disabled venue is hidden until
|
|
@@ -10987,15 +10999,15 @@ var EventList = ({
|
|
|
10987
10999
|
stateRef
|
|
10988
11000
|
}) => {
|
|
10989
11001
|
var _a, _b, _c, _d, _e, _f;
|
|
10990
|
-
const labels = (0,
|
|
10991
|
-
const { disabledVenues } = (0,
|
|
11002
|
+
const labels = (0, import_hooks41.useLabels)();
|
|
11003
|
+
const { disabledVenues } = (0, import_hooks41.useAppConfig)();
|
|
10992
11004
|
const {
|
|
10993
11005
|
features: { enableVenueEventDiscoveryFilters, showSportsMarkets }
|
|
10994
|
-
} = (0,
|
|
11006
|
+
} = (0, import_hooks41.useSdkUiConfig)();
|
|
10995
11007
|
const isDiscoveryFiltersEnabled = enableVenueEventDiscoveryFilters && !search;
|
|
10996
11008
|
const resolvedTabs = useEventListTabs();
|
|
10997
11009
|
const visibleVenues = (0, import_react18.useMemo)(
|
|
10998
|
-
() => disabledVenues.length === 0 ? void 0 : (0,
|
|
11010
|
+
() => disabledVenues.length === 0 ? void 0 : (0, import_hooks41.getVisibleVenueIdsByConfig)(import_sdk16.VENUES, disabledVenues),
|
|
10999
11011
|
[disabledVenues]
|
|
11000
11012
|
);
|
|
11001
11013
|
const [internalActiveTabValue, setInternalActiveTabValue] = (0, import_react18.useState)(
|
|
@@ -11064,7 +11076,7 @@ var EventList = ({
|
|
|
11064
11076
|
if (controlledCategoryPath == null) setInternalCategoryPath([]);
|
|
11065
11077
|
setCollapsedCategoryIds(/* @__PURE__ */ new Set());
|
|
11066
11078
|
}, [baseCategoryId, controlledCategoryPath, isDiscoveryFiltersEnabled]);
|
|
11067
|
-
const { categories: topLevelCategories } = (0,
|
|
11079
|
+
const { categories: topLevelCategories } = (0, import_hooks41.useCategories)({
|
|
11068
11080
|
queryKeyScope: "event-list-top-categories",
|
|
11069
11081
|
enabled: isDiscoveryFiltersEnabled,
|
|
11070
11082
|
limit: 100
|
|
@@ -11081,7 +11093,7 @@ var EventList = ({
|
|
|
11081
11093
|
])
|
|
11082
11094
|
);
|
|
11083
11095
|
}, [baseCategoryId, categoryPath, sortedTopLevelCategories]);
|
|
11084
|
-
const { childrenByParentId: baseChildrenByParentId, isLoading: isBaseCategoryChildrenLoading } = (0,
|
|
11096
|
+
const { childrenByParentId: baseChildrenByParentId, isLoading: isBaseCategoryChildrenLoading } = (0, import_hooks41.useCategoryChildren)({
|
|
11085
11097
|
queryKeyScope: "event-list-category-children",
|
|
11086
11098
|
enabled: isDiscoveryFiltersEnabled,
|
|
11087
11099
|
parentIds: baseCategoryChildPrefetchIds,
|
|
@@ -11102,7 +11114,7 @@ var EventList = ({
|
|
|
11102
11114
|
}
|
|
11103
11115
|
return Array.from(ids);
|
|
11104
11116
|
}, [baseCategoryId, baseChildrenByParentId, categoryPath]);
|
|
11105
|
-
const { childrenByParentId: visibleChildrenByParentId } = (0,
|
|
11117
|
+
const { childrenByParentId: visibleChildrenByParentId } = (0, import_hooks41.useCategoryChildren)({
|
|
11106
11118
|
queryKeyScope: "event-list-category-children",
|
|
11107
11119
|
enabled: isDiscoveryFiltersEnabled,
|
|
11108
11120
|
parentIds: visibleChildPrefetchIds,
|
|
@@ -11118,7 +11130,7 @@ var EventList = ({
|
|
|
11118
11130
|
}
|
|
11119
11131
|
return Array.from(ids);
|
|
11120
11132
|
}, [categoryPath, visibleChildrenByParentId]);
|
|
11121
|
-
const { childrenByParentId: visibleGrandchildrenByParentId } = (0,
|
|
11133
|
+
const { childrenByParentId: visibleGrandchildrenByParentId } = (0, import_hooks41.useCategoryChildren)({
|
|
11122
11134
|
queryKeyScope: "event-list-category-children",
|
|
11123
11135
|
enabled: isDiscoveryFiltersEnabled,
|
|
11124
11136
|
parentIds: visibleGrandchildPrefetchIds,
|
|
@@ -11203,14 +11215,14 @@ var EventList = ({
|
|
|
11203
11215
|
isFetchingNextPage,
|
|
11204
11216
|
isPlaceholderData,
|
|
11205
11217
|
loadedPageCount
|
|
11206
|
-
} = (0,
|
|
11218
|
+
} = (0, import_hooks41.useVenueEvents)({
|
|
11207
11219
|
queryKeyScope: "event-list",
|
|
11208
11220
|
venues,
|
|
11209
11221
|
search,
|
|
11210
11222
|
categoryIds: resolvedCategoryIds,
|
|
11211
11223
|
matchStatus,
|
|
11212
11224
|
limit: requestLimit,
|
|
11213
|
-
status: [
|
|
11225
|
+
status: [import_hooks41.MarketStatus.open],
|
|
11214
11226
|
sortBy: sortQueryParams.sortBy,
|
|
11215
11227
|
sortDir: sortQueryParams.sortDir,
|
|
11216
11228
|
endDateFrom,
|
|
@@ -11246,7 +11258,7 @@ var EventList = ({
|
|
|
11246
11258
|
const visibleMidpointVenueMarketIds = (0, import_react18.useMemo)(() => {
|
|
11247
11259
|
return collectMidpointVenueMarketIds(visibleVenueMarkets);
|
|
11248
11260
|
}, [visibleVenueMarkets]);
|
|
11249
|
-
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0,
|
|
11261
|
+
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0, import_hooks41.useVenueMarketMidpoints)({
|
|
11250
11262
|
venueMarketIds: visibleMidpointVenueMarketIds,
|
|
11251
11263
|
enabled: visibleMidpointVenueMarketIds.length > 0
|
|
11252
11264
|
});
|
|
@@ -11427,7 +11439,7 @@ var EventList = ({
|
|
|
11427
11439
|
onMarketClick,
|
|
11428
11440
|
getMarketHref,
|
|
11429
11441
|
href: getEventHref == null ? void 0 : getEventHref(event),
|
|
11430
|
-
marketStatus:
|
|
11442
|
+
marketStatus: import_hooks41.MarketStatus.open
|
|
11431
11443
|
},
|
|
11432
11444
|
event.id
|
|
11433
11445
|
)),
|
|
@@ -11507,15 +11519,15 @@ var EventList = ({
|
|
|
11507
11519
|
EventList.displayName = "EventList";
|
|
11508
11520
|
|
|
11509
11521
|
// src/pages/event-market/index.tsx
|
|
11510
|
-
var
|
|
11522
|
+
var import_hooks74 = require("@agg-build/hooks");
|
|
11511
11523
|
var import_react45 = require("react");
|
|
11512
11524
|
|
|
11513
11525
|
// src/events/item-details/index.tsx
|
|
11514
|
-
var
|
|
11526
|
+
var import_hooks51 = require("@agg-build/hooks");
|
|
11515
11527
|
var import_react25 = require("react");
|
|
11516
11528
|
|
|
11517
11529
|
// src/primitives/chart/chart-type-switch.tsx
|
|
11518
|
-
var
|
|
11530
|
+
var import_hooks42 = require("@agg-build/hooks");
|
|
11519
11531
|
var import_react19 = require("react");
|
|
11520
11532
|
|
|
11521
11533
|
// src/primitives/chart/chart-type-switch.constants.ts
|
|
@@ -11547,7 +11559,7 @@ var ChartTypeSwitch = ({
|
|
|
11547
11559
|
onValueChange,
|
|
11548
11560
|
className
|
|
11549
11561
|
}) => {
|
|
11550
|
-
const labels = (0,
|
|
11562
|
+
const labels = (0, import_hooks42.useLabels)();
|
|
11551
11563
|
const options = (0, import_react19.useMemo)(
|
|
11552
11564
|
() => CHART_TYPE_SWITCH_OPTION_KEYS.map((chartType) => ({
|
|
11553
11565
|
value: chartType,
|
|
@@ -11623,7 +11635,7 @@ var ChartTypeSwitch = ({
|
|
|
11623
11635
|
ChartTypeSwitch.displayName = "ChartTypeSwitch";
|
|
11624
11636
|
|
|
11625
11637
|
// src/trading/trading-context/index.tsx
|
|
11626
|
-
var
|
|
11638
|
+
var import_hooks43 = require("@agg-build/hooks");
|
|
11627
11639
|
|
|
11628
11640
|
// src/events/market-details/market-details.utils.ts
|
|
11629
11641
|
var import_sdk18 = require("@agg-build/sdk");
|
|
@@ -12329,7 +12341,7 @@ var buildMarketDetailsModel = ({
|
|
|
12329
12341
|
};
|
|
12330
12342
|
|
|
12331
12343
|
// src/events/market-details/orderbook-aggregation.ts
|
|
12332
|
-
var
|
|
12344
|
+
var import_hooks44 = require("@agg-build/hooks");
|
|
12333
12345
|
var PRICE_PRECISION = 1e6;
|
|
12334
12346
|
var SIZE_PRECISION = 1e8;
|
|
12335
12347
|
var POSITIVE_OUTCOME_KEYS = /* @__PURE__ */ new Set(["yes", "y", "true", "up", "buy", "long"]);
|
|
@@ -12450,7 +12462,7 @@ var buildRowsFromAccumulator = ({
|
|
|
12450
12462
|
const venueBreakdown = Object.fromEntries(
|
|
12451
12463
|
Object.entries(level.venueBreakdownScaled).filter(([, scaledSize]) => scaledSize > 0).map(([venue2, scaledSize]) => [venue2, fromScaled(scaledSize, SIZE_PRECISION)])
|
|
12452
12464
|
);
|
|
12453
|
-
const resolvedFallbackVenue = fallbackVenue != null ? fallbackVenue :
|
|
12465
|
+
const resolvedFallbackVenue = fallbackVenue != null ? fallbackVenue : import_hooks44.Venue.polymarket;
|
|
12454
12466
|
const venues = resolveVenues(venueBreakdown, resolvedFallbackVenue);
|
|
12455
12467
|
const venue = resolvePrimaryVenue(venueBreakdown, resolvedFallbackVenue);
|
|
12456
12468
|
return {
|
|
@@ -12737,7 +12749,7 @@ var shouldAutoFallbackToAllRange = ({
|
|
|
12737
12749
|
};
|
|
12738
12750
|
|
|
12739
12751
|
// src/events/shared/chart-venue-selection.ts
|
|
12740
|
-
var
|
|
12752
|
+
var import_hooks45 = require("@agg-build/hooks");
|
|
12741
12753
|
var resolveChartVenueOutcomes = ({
|
|
12742
12754
|
eligibleVenueOutcomes,
|
|
12743
12755
|
livePrices
|
|
@@ -12749,7 +12761,7 @@ var resolveChartVenueOutcomes = ({
|
|
|
12749
12761
|
const probabilityDifference = (leftProbability != null ? leftProbability : 2) - (rightProbability != null ? rightProbability : 2);
|
|
12750
12762
|
if (probabilityDifference !== 0) return probabilityDifference;
|
|
12751
12763
|
if (left.venue === right.venue) return 0;
|
|
12752
|
-
const sortedVenues = (0,
|
|
12764
|
+
const sortedVenues = (0, import_hooks45.sortVenues)([left.venue, right.venue]);
|
|
12753
12765
|
return sortedVenues[0] === left.venue ? -1 : 1;
|
|
12754
12766
|
});
|
|
12755
12767
|
const venueOutcomesByVenue = /* @__PURE__ */ new Map();
|
|
@@ -12844,7 +12856,7 @@ var getDisplayOutcomePrice = ({
|
|
|
12844
12856
|
};
|
|
12845
12857
|
|
|
12846
12858
|
// src/events/shared/sports-live-score.tsx
|
|
12847
|
-
var
|
|
12859
|
+
var import_hooks46 = require("@agg-build/hooks");
|
|
12848
12860
|
var import_react20 = require("react");
|
|
12849
12861
|
var import_jsx_runtime144 = require("react/jsx-runtime");
|
|
12850
12862
|
var SPORTS_SCORE_LAYOUTS = {
|
|
@@ -12860,7 +12872,7 @@ var SportsLiveScore = ({
|
|
|
12860
12872
|
variant = "detail",
|
|
12861
12873
|
className
|
|
12862
12874
|
}) => {
|
|
12863
|
-
const labels = (0,
|
|
12875
|
+
const labels = (0, import_hooks46.useLabels)();
|
|
12864
12876
|
if (!state || state.participants.length !== 2) return null;
|
|
12865
12877
|
const [firstParticipant, secondParticipant] = state.participants;
|
|
12866
12878
|
const firstScore = firstParticipant == null ? void 0 : firstParticipant.score;
|
|
@@ -13054,7 +13066,7 @@ var SportsLiveScore = ({
|
|
|
13054
13066
|
SportsLiveScore.displayName = "SportsLiveScore";
|
|
13055
13067
|
|
|
13056
13068
|
// src/events/item-details/event-list-item-details-market-selector.tsx
|
|
13057
|
-
var
|
|
13069
|
+
var import_hooks47 = require("@agg-build/hooks");
|
|
13058
13070
|
var import_react21 = require("react");
|
|
13059
13071
|
var import_jsx_runtime145 = require("react/jsx-runtime");
|
|
13060
13072
|
var MARKET_PILL_MAX_ROWS = 2;
|
|
@@ -13153,10 +13165,10 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
13153
13165
|
onChange
|
|
13154
13166
|
}) => {
|
|
13155
13167
|
var _a;
|
|
13156
|
-
const labels = (0,
|
|
13168
|
+
const labels = (0, import_hooks47.useLabels)();
|
|
13157
13169
|
const {
|
|
13158
13170
|
features: { enableAnimations }
|
|
13159
|
-
} = (0,
|
|
13171
|
+
} = (0, import_hooks47.useSdkUiConfig)();
|
|
13160
13172
|
const containerRef = (0, import_react21.useRef)(null);
|
|
13161
13173
|
const measurementContainerRef = (0, import_react21.useRef)(null);
|
|
13162
13174
|
const moreButtonRef = (0, import_react21.useRef)(null);
|
|
@@ -13607,17 +13619,17 @@ var EventListItemDetailsMarketSelector = ({
|
|
|
13607
13619
|
};
|
|
13608
13620
|
|
|
13609
13621
|
// src/events/item-details/settlement-summary.tsx
|
|
13610
|
-
var
|
|
13622
|
+
var import_hooks50 = require("@agg-build/hooks");
|
|
13611
13623
|
var import_react24 = require("react");
|
|
13612
13624
|
|
|
13613
13625
|
// src/trading/settlement/index.tsx
|
|
13614
|
-
var
|
|
13626
|
+
var import_hooks49 = require("@agg-build/hooks");
|
|
13615
13627
|
var import_react23 = require("react");
|
|
13616
13628
|
|
|
13617
13629
|
// src/trading/utils.ts
|
|
13618
|
-
var
|
|
13630
|
+
var import_hooks48 = require("@agg-build/hooks");
|
|
13619
13631
|
var import_dayjs6 = __toESM(require("dayjs"));
|
|
13620
|
-
var defaultLabels = (0,
|
|
13632
|
+
var defaultLabels = (0, import_hooks48.resolveAggUiLabels)("en-US");
|
|
13621
13633
|
var defaultSettlementSectionLabel = defaultLabels.trading.settlementSection;
|
|
13622
13634
|
var defaultTradingDisclaimer = defaultLabels.trading.disclaimer;
|
|
13623
13635
|
var getTradingDateLabel = (value) => {
|
|
@@ -14055,7 +14067,7 @@ var Settlement = ({
|
|
|
14055
14067
|
isLoading = false
|
|
14056
14068
|
}) => {
|
|
14057
14069
|
var _a, _b, _c, _d, _e;
|
|
14058
|
-
const labels = (0,
|
|
14070
|
+
const labels = (0, import_hooks49.useLabels)();
|
|
14059
14071
|
const blocks = (0, import_react23.useMemo)(
|
|
14060
14072
|
() => dedupeSettlementSources({
|
|
14061
14073
|
eventDescription,
|
|
@@ -14242,7 +14254,7 @@ var SettlementSummary = ({
|
|
|
14242
14254
|
settlementSectionId = SETTLEMENT_SECTION_ID,
|
|
14243
14255
|
className
|
|
14244
14256
|
}) => {
|
|
14245
|
-
const labels = (0,
|
|
14257
|
+
const labels = (0, import_hooks50.useLabels)();
|
|
14246
14258
|
const settlementDifferences = (0, import_react24.useMemo)(
|
|
14247
14259
|
() => prepareSettlementDifferences(settlementDiff == null ? void 0 : settlementDiff.differences),
|
|
14248
14260
|
[settlementDiff == null ? void 0 : settlementDiff.differences]
|
|
@@ -14377,7 +14389,7 @@ var EventListItemDetailsLoadingState = ({
|
|
|
14377
14389
|
classNames,
|
|
14378
14390
|
ariaLabel
|
|
14379
14391
|
}) => {
|
|
14380
|
-
const labels = (0,
|
|
14392
|
+
const labels = (0, import_hooks51.useLabels)();
|
|
14381
14393
|
return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
14382
14394
|
Skeleton,
|
|
14383
14395
|
{
|
|
@@ -14391,7 +14403,7 @@ var EventListItemDetailsUnavailableState = ({
|
|
|
14391
14403
|
classNames,
|
|
14392
14404
|
ariaLabel
|
|
14393
14405
|
}) => {
|
|
14394
|
-
const labels = (0,
|
|
14406
|
+
const labels = (0, import_hooks51.useLabels)();
|
|
14395
14407
|
return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
14396
14408
|
Card,
|
|
14397
14409
|
{
|
|
@@ -14409,7 +14421,7 @@ var EventListItemDetailsNotFoundState = ({
|
|
|
14409
14421
|
classNames: _classNames,
|
|
14410
14422
|
ariaLabel: _ariaLabel
|
|
14411
14423
|
}) => {
|
|
14412
|
-
const labels = (0,
|
|
14424
|
+
const labels = (0, import_hooks51.useLabels)();
|
|
14413
14425
|
return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
14414
14426
|
StateMessage,
|
|
14415
14427
|
{
|
|
@@ -14440,8 +14452,8 @@ var EventListItemDetailsGraphSection = ({
|
|
|
14440
14452
|
onRangeOverrideChange
|
|
14441
14453
|
}) => {
|
|
14442
14454
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
14443
|
-
const labels = (0,
|
|
14444
|
-
const tradingContext = (0,
|
|
14455
|
+
const labels = (0, import_hooks51.useLabels)();
|
|
14456
|
+
const tradingContext = (0, import_hooks43.useEventTradingContext)();
|
|
14445
14457
|
const [selectedGraphVenue, setSelectedGraphVenue] = (0, import_react25.useState)(null);
|
|
14446
14458
|
const [chartOutcomeLabel, setChartOutcomeLabel] = (0, import_react25.useState)(
|
|
14447
14459
|
(_c = (_b = (_a = tradingContext == null ? void 0 : tradingContext.selectedOutcome) == null ? void 0 : _a.label) == null ? void 0 : _b.trim()) != null ? _c : null
|
|
@@ -14458,10 +14470,10 @@ var EventListItemDetailsGraphSection = ({
|
|
|
14458
14470
|
chart: { selectedChartTimeRange },
|
|
14459
14471
|
formatting: { formatPercent, formatPrice },
|
|
14460
14472
|
general: { theme }
|
|
14461
|
-
} = (0,
|
|
14473
|
+
} = (0, import_hooks51.useSdkUiConfig)();
|
|
14462
14474
|
const isDarkTheme = theme === "dark";
|
|
14463
14475
|
const effectiveChartTimeRange = rangeOverride != null ? rangeOverride : selectedChartTimeRange;
|
|
14464
|
-
const rollingWindow = (0,
|
|
14476
|
+
const rollingWindow = (0, import_hooks51.useRollingChartWindow)({ range: effectiveChartTimeRange });
|
|
14465
14477
|
const availableMarkets = (0, import_react25.useMemo)(() => {
|
|
14466
14478
|
var _a2, _b2, _c2, _d2;
|
|
14467
14479
|
if (venueMarkets.length === 0) return [];
|
|
@@ -14492,7 +14504,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
14492
14504
|
isLoading: isScopedMarketChartLoading,
|
|
14493
14505
|
error: scopedMarketChartError,
|
|
14494
14506
|
refetch: refetchScopedMarketChart
|
|
14495
|
-
} = (0,
|
|
14507
|
+
} = (0, import_hooks51.useMarketChart)({
|
|
14496
14508
|
marketId: chartPrimaryOutcomeId,
|
|
14497
14509
|
venueMarketIds: availableVenueOutcomes.map((item) => item.outcome.id),
|
|
14498
14510
|
interval: rollingWindow.interval,
|
|
@@ -14549,7 +14561,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
14549
14561
|
const resolvedOutcomePriceByMarketId = (0, import_react25.useMemo)(() => {
|
|
14550
14562
|
const map = /* @__PURE__ */ new Map();
|
|
14551
14563
|
for (const market of availableMarkets) {
|
|
14552
|
-
const marketTradingState = (0,
|
|
14564
|
+
const marketTradingState = (0, import_hooks51.resolveMarketTradingState)(market);
|
|
14553
14565
|
if (marketTradingState.kind !== "resolved") continue;
|
|
14554
14566
|
const outcomePriceMap = resolveResolvedOutcomePriceMap(market.venueMarketOutcomes);
|
|
14555
14567
|
if (outcomePriceMap) {
|
|
@@ -14765,12 +14777,12 @@ var EventListItemDetailsContent = ({
|
|
|
14765
14777
|
const lastAppliedEventSyncKeyRef = (0, import_react25.useRef)(null);
|
|
14766
14778
|
const lastAppliedDefaultRef = (0, import_react25.useRef)(null);
|
|
14767
14779
|
const [chartRangeOverride, setChartRangeOverride] = (0, import_react25.useState)(null);
|
|
14768
|
-
const config = (0,
|
|
14769
|
-
const labels = (0,
|
|
14770
|
-
const tradingContext = (0,
|
|
14780
|
+
const config = (0, import_hooks51.useSdkUiConfig)();
|
|
14781
|
+
const labels = (0, import_hooks51.useLabels)();
|
|
14782
|
+
const tradingContext = (0, import_hooks43.useEventTradingContext)();
|
|
14771
14783
|
const eventSyncKey = (0, import_react25.useMemo)(() => resolveEventDetailsSyncKey(event), [event]);
|
|
14772
14784
|
const resolvedEventTradingState = (0, import_react25.useMemo)(() => {
|
|
14773
|
-
return eventTradingState != null ? eventTradingState : (0,
|
|
14785
|
+
return eventTradingState != null ? eventTradingState : (0, import_hooks51.resolveEventTradingState)(event);
|
|
14774
14786
|
}, [event, eventTradingState]);
|
|
14775
14787
|
const scopedSelectedMarket = (tradingContext == null ? void 0 : tradingContext.selectedEventId) === event.id ? (_a = tradingContext.selectedMarket) != null ? _a : resolvedEventTradingState.primaryMarket : resolvedEventTradingState.primaryMarket;
|
|
14776
14788
|
const venueMarkets = (0, import_react25.useMemo)(
|
|
@@ -14781,12 +14793,12 @@ var EventListItemDetailsContent = ({
|
|
|
14781
14793
|
return normalizeVenueMarketCluster(venueMarkets);
|
|
14782
14794
|
}, [venueMarkets]);
|
|
14783
14795
|
const scopedSelectedMarketId = (tradingContext == null ? void 0 : tradingContext.selectedEventId) === event.id ? tradingContext.selectedMarketId : null;
|
|
14784
|
-
(0,
|
|
14796
|
+
(0, import_hooks51.useEventOrderbookData)(
|
|
14785
14797
|
resolvedEventTradingState.isTradingDisabled ? [] : resolvedEventTradingState.displayMarkets,
|
|
14786
14798
|
scopedSelectedMarketId
|
|
14787
14799
|
);
|
|
14788
|
-
const wsLivePrices = (0,
|
|
14789
|
-
const wsBestPrices = (0,
|
|
14800
|
+
const wsLivePrices = (0, import_hooks51.useLiveOutcomePrices)(eventDetailVenueMarkets);
|
|
14801
|
+
const wsBestPrices = (0, import_hooks51.useLiveBestPrices)(eventDetailVenueMarkets);
|
|
14790
14802
|
const resolvedMidpointsResult = midpointsResult != null ? midpointsResult : {
|
|
14791
14803
|
prices: /* @__PURE__ */ new Map(),
|
|
14792
14804
|
bestMidpointsByOutcomeId: /* @__PURE__ */ new Map(),
|
|
@@ -14801,7 +14813,7 @@ var EventListItemDetailsContent = ({
|
|
|
14801
14813
|
const bestMidpoint = resolvedMidpointsResult.bestMidpoint;
|
|
14802
14814
|
const restBestPrices = resolvedMidpointsResult.bestPrices;
|
|
14803
14815
|
const bestPrices = (0, import_react25.useMemo)(
|
|
14804
|
-
() => (0,
|
|
14816
|
+
() => (0, import_hooks51.mergeBestPricesPreferringLive)(restBestPrices, wsBestPrices),
|
|
14805
14817
|
[restBestPrices, wsBestPrices]
|
|
14806
14818
|
);
|
|
14807
14819
|
const livePrices = (0, import_react25.useMemo)(() => {
|
|
@@ -14920,7 +14932,7 @@ var EventListItemDetailsContent = ({
|
|
|
14920
14932
|
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
14921
14933
|
RemoteImage,
|
|
14922
14934
|
{
|
|
14923
|
-
src: (0,
|
|
14935
|
+
src: (0, import_hooks51.optimizedImageUrl)(event.image, 60),
|
|
14924
14936
|
alt: "",
|
|
14925
14937
|
className: "agg-event-image size-10 rounded-agg-lg object-cover md:size-[60px]"
|
|
14926
14938
|
}
|
|
@@ -15107,7 +15119,7 @@ var EventListItemDetailsContent = ({
|
|
|
15107
15119
|
}
|
|
15108
15120
|
),
|
|
15109
15121
|
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("span", { "aria-hidden": "true", className: "hidden h-4 w-px bg-agg-separator md:block" }),
|
|
15110
|
-
|
|
15122
|
+
import_hooks51.CHART_TIME_RANGES.map((timeRange) => {
|
|
15111
15123
|
const effectiveRange = chartRangeOverride != null ? chartRangeOverride : config.chart.selectedChartTimeRange;
|
|
15112
15124
|
const isActive = timeRange === effectiveRange;
|
|
15113
15125
|
return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
@@ -15158,7 +15170,7 @@ var EventListItemDetailsByEventId = (_a) => {
|
|
|
15158
15170
|
error,
|
|
15159
15171
|
isError,
|
|
15160
15172
|
isLoading
|
|
15161
|
-
} = (0,
|
|
15173
|
+
} = (0, import_hooks51.useVenueEvent)({
|
|
15162
15174
|
eventId: resolvedEventId,
|
|
15163
15175
|
enabled: !!resolvedEventId
|
|
15164
15176
|
});
|
|
@@ -15235,11 +15247,11 @@ var EventListItemDetails = (props) => {
|
|
|
15235
15247
|
EventListItemDetails.displayName = "EventListItemDetails";
|
|
15236
15248
|
|
|
15237
15249
|
// src/events/market-details/index.tsx
|
|
15238
|
-
var
|
|
15250
|
+
var import_hooks55 = require("@agg-build/hooks");
|
|
15239
15251
|
var import_react29 = require("react");
|
|
15240
15252
|
|
|
15241
15253
|
// src/events/orderbook/index.tsx
|
|
15242
|
-
var
|
|
15254
|
+
var import_hooks52 = require("@agg-build/hooks");
|
|
15243
15255
|
var import_react27 = require("react");
|
|
15244
15256
|
|
|
15245
15257
|
// src/events/orderbook/orderbook.constants.ts
|
|
@@ -15469,7 +15481,7 @@ OrderbookWithStates.displayName = "OrderbookWithStates";
|
|
|
15469
15481
|
// src/events/orderbook/index.tsx
|
|
15470
15482
|
var import_jsx_runtime151 = require("react/jsx-runtime");
|
|
15471
15483
|
var OrderbookVenueLogos = ({ venues }) => {
|
|
15472
|
-
const visible = (0,
|
|
15484
|
+
const visible = (0, import_hooks52.sortVenues)(venues).slice(0, orderbookMaxVisibleVenues);
|
|
15473
15485
|
const overflow = venues.length - visible.length;
|
|
15474
15486
|
return /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex flex-row items-center justify-start gap-0.5 md:gap-1", children: [
|
|
15475
15487
|
visible.map((venue) => /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(VenueLogo, { venue, size: "small" }, venue)),
|
|
@@ -15577,7 +15589,7 @@ var Orderbook = ({
|
|
|
15577
15589
|
const {
|
|
15578
15590
|
enableWebsocketsLogs,
|
|
15579
15591
|
formatting: { formatPrice }
|
|
15580
|
-
} = (0,
|
|
15592
|
+
} = (0, import_hooks52.useAggUiConfig)();
|
|
15581
15593
|
const labels = __spreadValues(__spreadValues({}, orderbookDefaultLabels), labelsProp);
|
|
15582
15594
|
const scrollContainerRef = (0, import_react27.useRef)(null);
|
|
15583
15595
|
const spreadRowRef = (0, import_react27.useRef)(null);
|
|
@@ -15888,7 +15900,7 @@ var resolveOrderEligibilityMessage = (labels, reason) => {
|
|
|
15888
15900
|
};
|
|
15889
15901
|
|
|
15890
15902
|
// src/events/market-details/market-details-outcome-button.tsx
|
|
15891
|
-
var
|
|
15903
|
+
var import_hooks53 = require("@agg-build/hooks");
|
|
15892
15904
|
var import_jsx_runtime152 = require("react/jsx-runtime");
|
|
15893
15905
|
var marketDetailsOutcomeButtonToneClasses = {
|
|
15894
15906
|
positive: {
|
|
@@ -15939,7 +15951,7 @@ var OutcomePriceContent = ({
|
|
|
15939
15951
|
value,
|
|
15940
15952
|
textClassName
|
|
15941
15953
|
}) => {
|
|
15942
|
-
const { formatPrice } = (0,
|
|
15954
|
+
const { formatPrice } = (0, import_hooks53.useAggUiConfig)().formatting;
|
|
15943
15955
|
if (isLoading) {
|
|
15944
15956
|
return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
|
|
15945
15957
|
"span",
|
|
@@ -16052,7 +16064,7 @@ var MarketDetailsOutcomeButton = ({
|
|
|
16052
16064
|
MarketDetailsOutcomeButton.displayName = "MarketDetailsOutcomeButton";
|
|
16053
16065
|
|
|
16054
16066
|
// src/events/market-details/market-details-graph-panel.tsx
|
|
16055
|
-
var
|
|
16067
|
+
var import_hooks54 = require("@agg-build/hooks");
|
|
16056
16068
|
var import_react28 = require("react");
|
|
16057
16069
|
var import_jsx_runtime153 = require("react/jsx-runtime");
|
|
16058
16070
|
var MarketDetailsGraphPanel = ({
|
|
@@ -16069,13 +16081,13 @@ var MarketDetailsGraphPanel = ({
|
|
|
16069
16081
|
classNames
|
|
16070
16082
|
}) => {
|
|
16071
16083
|
var _a, _b, _c;
|
|
16072
|
-
const config = (0,
|
|
16084
|
+
const config = (0, import_hooks54.useSdkUiConfig)();
|
|
16073
16085
|
const {
|
|
16074
16086
|
formatting: { formatPercent, formatCompactCurrency, formatPrice },
|
|
16075
16087
|
general: { theme }
|
|
16076
16088
|
} = config;
|
|
16077
16089
|
const isDarkTheme = theme === "dark";
|
|
16078
|
-
const labels = (0,
|
|
16090
|
+
const labels = (0, import_hooks54.useLabels)();
|
|
16079
16091
|
const selectedTimeRange = config.chart.selectedChartTimeRange;
|
|
16080
16092
|
const setSelectedTimeRange = config.chart.setSelectedChartTimeRange;
|
|
16081
16093
|
const [chartRangeOverride, setChartRangeOverride] = (0, import_react28.useState)(null);
|
|
@@ -16095,7 +16107,7 @@ var MarketDetailsGraphPanel = ({
|
|
|
16095
16107
|
livePrices
|
|
16096
16108
|
});
|
|
16097
16109
|
}, [livePrices, venueMarkets, resolvedChartOutcomeLabel, chartSelectedOutcomeId]);
|
|
16098
|
-
const rollingWindow = (0,
|
|
16110
|
+
const rollingWindow = (0, import_hooks54.useRollingChartWindow)({ range: effectiveChartTimeRange });
|
|
16099
16111
|
const chartPrimaryOutcomeId = (_b = (_a = chartOutcomesByVenue[0]) == null ? void 0 : _a.outcome.id) != null ? _b : null;
|
|
16100
16112
|
const chartVenueOutcomeIds = (0, import_react28.useMemo)(() => {
|
|
16101
16113
|
return chartOutcomesByVenue.map((item) => item.outcome.id);
|
|
@@ -16105,7 +16117,7 @@ var MarketDetailsGraphPanel = ({
|
|
|
16105
16117
|
isLoading: isMarketChartLoading,
|
|
16106
16118
|
error: marketChartError,
|
|
16107
16119
|
refetch: refetchMarketChart
|
|
16108
|
-
} = (0,
|
|
16120
|
+
} = (0, import_hooks54.useMarketChart)({
|
|
16109
16121
|
marketId: chartPrimaryOutcomeId,
|
|
16110
16122
|
venueMarketIds: chartVenueOutcomeIds,
|
|
16111
16123
|
interval: rollingWindow.interval,
|
|
@@ -16315,7 +16327,7 @@ var MarketDetailsGraphPanel = ({
|
|
|
16315
16327
|
}
|
|
16316
16328
|
),
|
|
16317
16329
|
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)("span", { "aria-hidden": "true", className: "hidden h-4 w-px bg-agg-separator md:block" }),
|
|
16318
|
-
|
|
16330
|
+
import_hooks54.CHART_TIME_RANGES.map((timeRange) => {
|
|
16319
16331
|
const isActive = effectiveChartTimeRange === timeRange;
|
|
16320
16332
|
const isDisabled = isResolvedMarket && timeRange !== "ALL";
|
|
16321
16333
|
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
@@ -16358,7 +16370,7 @@ var MarketDetailsUnavailableState = ({
|
|
|
16358
16370
|
ariaLabel,
|
|
16359
16371
|
classNames
|
|
16360
16372
|
}) => {
|
|
16361
|
-
const labels = (0,
|
|
16373
|
+
const labels = (0, import_hooks55.useLabels)();
|
|
16362
16374
|
return /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
|
|
16363
16375
|
Card,
|
|
16364
16376
|
{
|
|
@@ -16382,7 +16394,7 @@ var MarketDetailsNotFoundState = ({
|
|
|
16382
16394
|
ariaLabel: _ariaLabel,
|
|
16383
16395
|
classNames: _classNames
|
|
16384
16396
|
}) => {
|
|
16385
|
-
const labels = (0,
|
|
16397
|
+
const labels = (0, import_hooks55.useLabels)();
|
|
16386
16398
|
return /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
|
|
16387
16399
|
StateMessage,
|
|
16388
16400
|
{
|
|
@@ -16421,33 +16433,33 @@ var MarketDetailsContent = ({
|
|
|
16421
16433
|
midpointsResult
|
|
16422
16434
|
}) => {
|
|
16423
16435
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
16424
|
-
const config = (0,
|
|
16436
|
+
const config = (0, import_hooks55.useSdkUiConfig)();
|
|
16425
16437
|
const {
|
|
16426
16438
|
features: { enableAnimations },
|
|
16427
16439
|
formatting: { formatPercent }
|
|
16428
16440
|
} = config;
|
|
16429
|
-
const labels = (0,
|
|
16430
|
-
const tradingContext = (0,
|
|
16441
|
+
const labels = (0, import_hooks55.useLabels)();
|
|
16442
|
+
const tradingContext = (0, import_hooks55.useEventTradingContext)();
|
|
16431
16443
|
const detailsContentId = (0, import_react29.useId)();
|
|
16432
16444
|
const tradeSide = (_a = tradingContext == null ? void 0 : tradingContext.tradeSide) != null ? _a : "buy";
|
|
16433
16445
|
const resolvedMarket = (0, import_react29.useMemo)(() => {
|
|
16434
16446
|
return resolveMarketFromVenueMarkets(venueMarkets, marketId);
|
|
16435
16447
|
}, [venueMarkets, marketId]);
|
|
16436
16448
|
const clusterVenueMarkets = resolvedMarket == null ? void 0 : resolvedMarket.venueMarkets;
|
|
16437
|
-
const wsLivePrices = (0,
|
|
16438
|
-
const wsBestPrices = (0,
|
|
16439
|
-
const wsBestCandidates = (0,
|
|
16449
|
+
const wsLivePrices = (0, import_hooks55.useLiveOutcomePrices)(clusterVenueMarkets);
|
|
16450
|
+
const wsBestPrices = (0, import_hooks55.useLiveBestPrices)(clusterVenueMarkets);
|
|
16451
|
+
const wsBestCandidates = (0, import_hooks55.useLiveBestPriceCandidates)(clusterVenueMarkets);
|
|
16440
16452
|
const scopedResolvedMarket = (0, import_react29.useMemo)(() => {
|
|
16441
16453
|
var _a2, _b2;
|
|
16442
16454
|
if (!resolvedMarket) return null;
|
|
16443
16455
|
return (_b2 = (_a2 = resolvedMarket.venueMarkets.find((venueMarket) => venueMarket.id === resolvedMarket.id)) != null ? _a2 : resolvedMarket.venueMarkets[0]) != null ? _b2 : null;
|
|
16444
16456
|
}, [resolvedMarket]);
|
|
16445
|
-
const isResolvedMarket = (0,
|
|
16446
|
-
(0,
|
|
16457
|
+
const isResolvedMarket = (0, import_hooks55.resolveMarketTradingState)(scopedResolvedMarket).kind === "resolved";
|
|
16458
|
+
(0, import_hooks55.useEventOrderbookData)(
|
|
16447
16459
|
isResolvedMarket ? [] : resolvedMarket == null ? void 0 : resolvedMarket.venueMarkets,
|
|
16448
16460
|
(_b = scopedResolvedMarket == null ? void 0 : scopedResolvedMarket.id) != null ? _b : null
|
|
16449
16461
|
);
|
|
16450
|
-
const fetchedClusterMidpointResult = (0,
|
|
16462
|
+
const fetchedClusterMidpointResult = (0, import_hooks55.useMidpoints)(midpointsResult ? [] : clusterVenueMarkets);
|
|
16451
16463
|
const clusterMidpointResult = midpointsResult != null ? midpointsResult : fetchedClusterMidpointResult;
|
|
16452
16464
|
const clusterMidpoints = (_c = clusterMidpointResult.bestMidpointsByOutcomeId) != null ? _c : clusterMidpointResult.prices;
|
|
16453
16465
|
const clusterBestMidpointsByOutcomeId = clusterMidpoints;
|
|
@@ -16456,7 +16468,7 @@ var MarketDetailsContent = ({
|
|
|
16456
16468
|
const clusterBestMidpointVenue = clusterMidpointResult.bestMidpointVenue;
|
|
16457
16469
|
const clusterBestPricesRest = clusterMidpointResult.bestPrices;
|
|
16458
16470
|
const clusterBestPrices = (0, import_react29.useMemo)(
|
|
16459
|
-
() => (0,
|
|
16471
|
+
() => (0, import_hooks55.mergeBestPricesPreferringLive)(clusterBestPricesRest, wsBestPrices),
|
|
16460
16472
|
[clusterBestPricesRest, wsBestPrices]
|
|
16461
16473
|
);
|
|
16462
16474
|
const clusterBestPriceVenuesByOutcomeId = clusterMidpointResult.bestPriceVenuesByOutcomeId;
|
|
@@ -16491,7 +16503,7 @@ var MarketDetailsContent = ({
|
|
|
16491
16503
|
return (_a2 = model.market.venueMarkets.find((venueMarket) => venueMarket.id === model.market.id)) != null ? _a2 : model.primaryVenueMarket;
|
|
16492
16504
|
}, [model]);
|
|
16493
16505
|
const marketTradingState = (0, import_react29.useMemo)(() => {
|
|
16494
|
-
return (0,
|
|
16506
|
+
return (0, import_hooks55.resolveMarketTradingState)(scopedMarketForCard);
|
|
16495
16507
|
}, [scopedMarketForCard]);
|
|
16496
16508
|
const isOutcomeSelectionLocked = showResolvingState || marketTradingState.isTradingDisabled;
|
|
16497
16509
|
const isUpcomingMarket = marketTradingState.kind === "unopened";
|
|
@@ -16653,7 +16665,7 @@ var MarketDetailsContent = ({
|
|
|
16653
16665
|
fallbackPrice: midpointsFallback == null ? void 0 : midpointsFallback.get(displayOutcome.id)
|
|
16654
16666
|
});
|
|
16655
16667
|
if (referencePrice != null) return referencePrice;
|
|
16656
|
-
return (0,
|
|
16668
|
+
return (0, import_hooks55.findLivePriceById)(wsLivePrices, displayOutcome.id);
|
|
16657
16669
|
}, [
|
|
16658
16670
|
clusterBestMidpoint,
|
|
16659
16671
|
clusterBestMidpointsByOutcomeId,
|
|
@@ -16678,7 +16690,7 @@ var MarketDetailsContent = ({
|
|
|
16678
16690
|
}, [model, selectedOutcomeLabel, selectedOutcomeId]);
|
|
16679
16691
|
const orderBookEnabled = isOpened && effectiveSelectedTab === "order-book" && !marketTradingState.isTradingDisabled;
|
|
16680
16692
|
const primaryOutcomeId = (_g = (_f = selectedOutcomesByVenue[0]) == null ? void 0 : _f.outcome.id) != null ? _g : null;
|
|
16681
|
-
const marketOrderbookResult = (0,
|
|
16693
|
+
const marketOrderbookResult = (0, import_hooks55.useMarketOrderbook)({
|
|
16682
16694
|
venueMarketOutcomeId: primaryOutcomeId,
|
|
16683
16695
|
enabled: orderBookEnabled && !!primaryOutcomeId,
|
|
16684
16696
|
venueOutcomes: selectedOutcomesByVenue.map((item) => ({
|
|
@@ -16864,7 +16876,7 @@ var MarketDetailsContent = ({
|
|
|
16864
16876
|
!compactHeader ? /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
|
|
16865
16877
|
RemoteImage,
|
|
16866
16878
|
{
|
|
16867
|
-
src: (0,
|
|
16879
|
+
src: (0, import_hooks55.optimizedImageUrl)(model.image, 60),
|
|
16868
16880
|
alt: "",
|
|
16869
16881
|
className: "agg-market-image size-12 rounded-agg-lg object-cover md:size-[60px]"
|
|
16870
16882
|
}
|
|
@@ -17118,7 +17130,7 @@ var MarketDetailsContent = ({
|
|
|
17118
17130
|
};
|
|
17119
17131
|
var MarketDetails = (_a) => {
|
|
17120
17132
|
var _b = _a, { isOpened } = _b, props = __objRest(_b, ["isOpened"]);
|
|
17121
|
-
const labels = (0,
|
|
17133
|
+
const labels = (0, import_hooks55.useLabels)();
|
|
17122
17134
|
if (props.isLoading) {
|
|
17123
17135
|
return /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
|
|
17124
17136
|
Skeleton,
|
|
@@ -17173,13 +17185,13 @@ var resolveIsResolvedEvent = (sourceMarkets, eventTradingState) => {
|
|
|
17173
17185
|
return eventTradingState.kind === "resolved";
|
|
17174
17186
|
}
|
|
17175
17187
|
if (sourceMarkets.length === 0) return false;
|
|
17176
|
-
return sourceMarkets.every((market) => (0,
|
|
17188
|
+
return sourceMarkets.every((market) => (0, import_hooks55.resolveMarketTradingState)(market).kind === "resolved");
|
|
17177
17189
|
};
|
|
17178
17190
|
var resolveResolvedWinnerMarketId = (sourceMarkets, eventTradingState) => {
|
|
17179
17191
|
var _a, _b, _c, _d, _e;
|
|
17180
17192
|
const preferredMarket = (_a = eventTradingState == null ? void 0 : eventTradingState.primaryMarket) != null ? _a : null;
|
|
17181
17193
|
if (preferredMarket && sourceMarkets.some((market) => market.id === preferredMarket.id)) {
|
|
17182
|
-
if ((0,
|
|
17194
|
+
if ((0, import_hooks55.resolveMarketTradingState)(preferredMarket).kind === "resolved") {
|
|
17183
17195
|
return preferredMarket.id;
|
|
17184
17196
|
}
|
|
17185
17197
|
}
|
|
@@ -17200,8 +17212,8 @@ var MarketDetailsList = ({
|
|
|
17200
17212
|
midpointsResult
|
|
17201
17213
|
}) => {
|
|
17202
17214
|
var _a, _b;
|
|
17203
|
-
const labels = (0,
|
|
17204
|
-
const tradingContext = (0,
|
|
17215
|
+
const labels = (0, import_hooks55.useLabels)();
|
|
17216
|
+
const tradingContext = (0, import_hooks55.useEventTradingContext)();
|
|
17205
17217
|
const selectedMarketId = (_a = tradingContext == null ? void 0 : tradingContext.selectedMarketId) != null ? _a : null;
|
|
17206
17218
|
const [expandedMarketId, setExpandedMarketId] = (0, import_react29.useState)(null);
|
|
17207
17219
|
const [areResolvedMarketsVisible, setAreResolvedMarketsVisible] = (0, import_react29.useState)(false);
|
|
@@ -17210,10 +17222,10 @@ var MarketDetailsList = ({
|
|
|
17210
17222
|
markets: rawMarkets,
|
|
17211
17223
|
isLoading,
|
|
17212
17224
|
error
|
|
17213
|
-
} = (0,
|
|
17225
|
+
} = (0, import_hooks55.useVenueMarkets)({
|
|
17214
17226
|
venueEventId: resolvedEventId,
|
|
17215
17227
|
enabled: !providedMarkets && !!resolvedEventId,
|
|
17216
|
-
status:
|
|
17228
|
+
status: import_hooks55.MarketStatus.open,
|
|
17217
17229
|
// Keep in lockstep with useEnrichedVenueEvent: limit is part of the React
|
|
17218
17230
|
// Query key, so a mismatch would fork the shared cache into two requests.
|
|
17219
17231
|
// fetchAll drains every page — events can exceed any single-page limit
|
|
@@ -17258,7 +17270,7 @@ var MarketDetailsList = ({
|
|
|
17258
17270
|
const resolved = [];
|
|
17259
17271
|
const closed = [];
|
|
17260
17272
|
sourceMarkets.forEach((market) => {
|
|
17261
|
-
const marketStateKind = (0,
|
|
17273
|
+
const marketStateKind = (0, import_hooks55.resolveMarketTradingState)(market).kind;
|
|
17262
17274
|
if (marketStateKind === "resolved") {
|
|
17263
17275
|
resolved.push(market);
|
|
17264
17276
|
return;
|
|
@@ -17290,10 +17302,10 @@ var MarketDetailsList = ({
|
|
|
17290
17302
|
const hasPrefetchedMarkets = !!providedMarkets || !!((_b = eventTradingState == null ? void 0 : eventTradingState.marketStates) == null ? void 0 : _b.length);
|
|
17291
17303
|
const midpointEligibleMarkets = (0, import_react29.useMemo)(() => {
|
|
17292
17304
|
return displayedMarkets.filter(
|
|
17293
|
-
(market) => (0,
|
|
17305
|
+
(market) => (0, import_hooks55.resolveMarketTradingState)(market).kind !== "resolved"
|
|
17294
17306
|
);
|
|
17295
17307
|
}, [displayedMarkets]);
|
|
17296
|
-
const { prices: midpointsFallback, venueByOutcomeId: midpointsFallbackVenues } = (0,
|
|
17308
|
+
const { prices: midpointsFallback, venueByOutcomeId: midpointsFallbackVenues } = (0, import_hooks55.useViewportMidpoints)(midpointEligibleMarkets);
|
|
17297
17309
|
(0, import_react29.useEffect)(() => {
|
|
17298
17310
|
if (isResolvedEvent) {
|
|
17299
17311
|
setAreResolvedMarketsVisible(false);
|
|
@@ -17312,7 +17324,7 @@ var MarketDetailsList = ({
|
|
|
17312
17324
|
return;
|
|
17313
17325
|
}
|
|
17314
17326
|
const fallbackSelectableMarket = displayedMarkets.find(
|
|
17315
|
-
(market) => !(0,
|
|
17327
|
+
(market) => !(0, import_hooks55.resolveMarketTradingState)(market).isTradingDisabled
|
|
17316
17328
|
);
|
|
17317
17329
|
if (!fallbackSelectableMarket) {
|
|
17318
17330
|
return;
|
|
@@ -17334,7 +17346,7 @@ var MarketDetailsList = ({
|
|
|
17334
17346
|
setExpandedMarketId(marketId);
|
|
17335
17347
|
onExpandedMarketChange == null ? void 0 : onExpandedMarketChange(marketId);
|
|
17336
17348
|
if (marketId === selectedMarketId) return;
|
|
17337
|
-
if ((0,
|
|
17349
|
+
if ((0, import_hooks55.resolveMarketTradingState)(market).isTradingDisabled) return;
|
|
17338
17350
|
tradingContext == null ? void 0 : tradingContext.selectMarket(market.id, market);
|
|
17339
17351
|
};
|
|
17340
17352
|
if (!hasPrefetchedMarkets && isLoading) {
|
|
@@ -17434,7 +17446,7 @@ var isVenue = (0, import_sdk19.enumGuard)(import_sdk19.Venue);
|
|
|
17434
17446
|
var parseVenue = (v) => (0, import_sdk19.safeParse)(v, isVenue);
|
|
17435
17447
|
|
|
17436
17448
|
// src/trading/settlement/settlement-details.tsx
|
|
17437
|
-
var
|
|
17449
|
+
var import_hooks56 = require("@agg-build/hooks");
|
|
17438
17450
|
var import_jsx_runtime155 = require("react/jsx-runtime");
|
|
17439
17451
|
var hasContent = (value) => {
|
|
17440
17452
|
return typeof value === "string" && value.trim().length > 0;
|
|
@@ -17458,11 +17470,11 @@ var buildVenueSettlementRules = (venueMarkets) => {
|
|
|
17458
17470
|
};
|
|
17459
17471
|
var SettlementDetails = ({ className }) => {
|
|
17460
17472
|
var _a, _b, _c, _d, _e, _f;
|
|
17461
|
-
const tradingContext = (0,
|
|
17473
|
+
const tradingContext = (0, import_hooks56.useEventTradingContext)();
|
|
17462
17474
|
const selectedEvent = (_a = tradingContext == null ? void 0 : tradingContext.selectedEvent) != null ? _a : null;
|
|
17463
17475
|
const selectedMarket = (_b = tradingContext == null ? void 0 : tradingContext.selectedMarket) != null ? _b : null;
|
|
17464
17476
|
if (!selectedEvent) return null;
|
|
17465
|
-
const activeMarket = selectedMarket != null ? selectedMarket : (0,
|
|
17477
|
+
const activeMarket = selectedMarket != null ? selectedMarket : (0, import_hooks56.resolveDefaultTradingMarket)(selectedEvent);
|
|
17466
17478
|
if (!activeMarket) return null;
|
|
17467
17479
|
const allVenueMarkets = normalizeVenueMarketCluster(selectedEvent.venueMarkets);
|
|
17468
17480
|
const activeMarketCluster = normalizeVenueMarketCluster(
|
|
@@ -17503,7 +17515,7 @@ var SettlementDetails = ({ className }) => {
|
|
|
17503
17515
|
SettlementDetails.displayName = "SettlementDetails";
|
|
17504
17516
|
|
|
17505
17517
|
// src/trading/place-order/index.tsx
|
|
17506
|
-
var
|
|
17518
|
+
var import_hooks67 = require("@agg-build/hooks");
|
|
17507
17519
|
var import_sdk24 = require("@agg-build/sdk");
|
|
17508
17520
|
var import_react37 = __toESM(require("@number-flow/react"));
|
|
17509
17521
|
var Popover = __toESM(require("@radix-ui/react-popover"));
|
|
@@ -17513,14 +17525,14 @@ var import_utc2 = __toESM(require("dayjs/plugin/utc"));
|
|
|
17513
17525
|
var import_react38 = require("react");
|
|
17514
17526
|
|
|
17515
17527
|
// src/geo-block-banner/index.tsx
|
|
17516
|
-
var
|
|
17528
|
+
var import_hooks57 = require("@agg-build/hooks");
|
|
17517
17529
|
var import_jsx_runtime156 = require("react/jsx-runtime");
|
|
17518
17530
|
var GeoBlockBanner = ({
|
|
17519
17531
|
venue,
|
|
17520
17532
|
termsUrl = AGG_TERMS_OF_SERVICE_URL,
|
|
17521
17533
|
className
|
|
17522
17534
|
}) => {
|
|
17523
|
-
const labels = (0,
|
|
17535
|
+
const labels = (0, import_hooks57.useLabels)();
|
|
17524
17536
|
const message = venue ? labels.trading.geoBlockVenueMessage(venue) : labels.trading.geoBlockGenericMessage;
|
|
17525
17537
|
return /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(
|
|
17526
17538
|
"div",
|
|
@@ -17553,7 +17565,7 @@ var venueRequiresSharedKyc = ({
|
|
|
17553
17565
|
};
|
|
17554
17566
|
|
|
17555
17567
|
// src/kyc/shared-kyc-modal.tsx
|
|
17556
|
-
var
|
|
17568
|
+
var import_hooks58 = require("@agg-build/hooks");
|
|
17557
17569
|
var Dialog3 = __toESM(require("@radix-ui/react-dialog"));
|
|
17558
17570
|
var import_jsx_runtime157 = require("react/jsx-runtime");
|
|
17559
17571
|
var SharedKycModal = ({
|
|
@@ -17563,7 +17575,7 @@ var SharedKycModal = ({
|
|
|
17563
17575
|
onOpenChange,
|
|
17564
17576
|
onStartVerification
|
|
17565
17577
|
}) => {
|
|
17566
|
-
const labels = (0,
|
|
17578
|
+
const labels = (0, import_hooks58.useLabels)();
|
|
17567
17579
|
const modalLabels = labels.trading.sharedKyc.modal;
|
|
17568
17580
|
const isInitiating = state === "initiating";
|
|
17569
17581
|
const handleOpenChange = (nextOpen) => {
|
|
@@ -17840,7 +17852,7 @@ var useSharedKycFlow = ({
|
|
|
17840
17852
|
};
|
|
17841
17853
|
|
|
17842
17854
|
// src/notifications/agg-notification-events-provider.tsx
|
|
17843
|
-
var
|
|
17855
|
+
var import_hooks59 = require("@agg-build/hooks");
|
|
17844
17856
|
var import_react31 = require("react");
|
|
17845
17857
|
var import_jsx_runtime158 = require("react/jsx-runtime");
|
|
17846
17858
|
var firedOrderNotificationKeys = /* @__PURE__ */ new Set();
|
|
@@ -17933,7 +17945,7 @@ var CLIENT_DEPOSIT_ACTIVITY_SUPPRESSION_MS = 2 * 60 * 1e3;
|
|
|
17933
17945
|
|
|
17934
17946
|
// src/onboarding/index.tsx
|
|
17935
17947
|
var import_react36 = require("react");
|
|
17936
|
-
var
|
|
17948
|
+
var import_hooks65 = require("@agg-build/hooks");
|
|
17937
17949
|
var Dialog6 = __toESM(require("@radix-ui/react-dialog"));
|
|
17938
17950
|
|
|
17939
17951
|
// src/onboarding/onboarding-modal.constants.ts
|
|
@@ -17958,7 +17970,7 @@ var ONCHAIN_VENUES = [
|
|
|
17958
17970
|
|
|
17959
17971
|
// src/onboarding/steps/how-it-works.tsx
|
|
17960
17972
|
var import_react32 = require("react");
|
|
17961
|
-
var
|
|
17973
|
+
var import_hooks60 = require("@agg-build/hooks");
|
|
17962
17974
|
var import_jsx_runtime159 = require("react/jsx-runtime");
|
|
17963
17975
|
var defaultIcons = {
|
|
17964
17976
|
createAccount: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(CreateAccountIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" }),
|
|
@@ -17967,7 +17979,7 @@ var defaultIcons = {
|
|
|
17967
17979
|
stayInControl: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(StayInControlIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" })
|
|
17968
17980
|
};
|
|
17969
17981
|
var HowItWorksStep = ({ onContinue, icons }) => {
|
|
17970
|
-
const labels = (0,
|
|
17982
|
+
const labels = (0, import_hooks60.useLabels)();
|
|
17971
17983
|
const scrollRef = (0, import_react32.useRef)(null);
|
|
17972
17984
|
const [showTopGradient, setShowTopGradient] = (0, import_react32.useState)(false);
|
|
17973
17985
|
const [showBottomGradient, setShowBottomGradient] = (0, import_react32.useState)(true);
|
|
@@ -18041,10 +18053,10 @@ HowItWorksStep.displayName = "HowItWorksStep";
|
|
|
18041
18053
|
|
|
18042
18054
|
// src/onboarding/steps/profile-setup.tsx
|
|
18043
18055
|
var import_react33 = require("react");
|
|
18044
|
-
var
|
|
18056
|
+
var import_hooks61 = require("@agg-build/hooks");
|
|
18045
18057
|
var import_jsx_runtime160 = require("react/jsx-runtime");
|
|
18046
18058
|
var ProfileSetupStep = ({ onContinue }) => {
|
|
18047
|
-
const labels = (0,
|
|
18059
|
+
const labels = (0, import_hooks61.useLabels)();
|
|
18048
18060
|
const [username, setUsername] = (0, import_react33.useState)("");
|
|
18049
18061
|
const [avatarFile, setAvatarFile] = (0, import_react33.useState)();
|
|
18050
18062
|
const [avatarPreview, setAvatarPreview] = (0, import_react33.useState)();
|
|
@@ -18174,7 +18186,7 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
18174
18186
|
ProfileSetupStep.displayName = "ProfileSetupStep";
|
|
18175
18187
|
|
|
18176
18188
|
// src/onboarding/steps/connect-accounts.tsx
|
|
18177
|
-
var
|
|
18189
|
+
var import_hooks62 = require("@agg-build/hooks");
|
|
18178
18190
|
var import_jsx_runtime161 = require("react/jsx-runtime");
|
|
18179
18191
|
var OnchainVenueLogos = () => {
|
|
18180
18192
|
return /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("div", { className: "flex gap-1 sm:gap-0 sm:-space-x-5", children: ONCHAIN_VENUES.map((venue, index) => /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("div", { style: { zIndex: ONCHAIN_VENUES.length - index }, children: /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(VenueLogo, { venue, variant: "logo", size: "medium", className: "sm:h-8 sm:w-8" }) }, venue)) });
|
|
@@ -18188,7 +18200,7 @@ var VenueCard = ({
|
|
|
18188
18200
|
onConnect,
|
|
18189
18201
|
connected = false
|
|
18190
18202
|
}) => {
|
|
18191
|
-
const labels = (0,
|
|
18203
|
+
const labels = (0, import_hooks62.useLabels)();
|
|
18192
18204
|
const action = connected ? /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(CheckCircleIcon, { className: "h-6 w-6 text-agg-success" }) : /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
|
|
18193
18205
|
Button,
|
|
18194
18206
|
{
|
|
@@ -18247,7 +18259,7 @@ var ConnectAccountsStep = ({
|
|
|
18247
18259
|
onContinue,
|
|
18248
18260
|
connectedOnchain = false
|
|
18249
18261
|
}) => {
|
|
18250
|
-
const labels = (0,
|
|
18262
|
+
const labels = (0, import_hooks62.useLabels)();
|
|
18251
18263
|
const canContinue = connectedOnchain;
|
|
18252
18264
|
return /* @__PURE__ */ (0, import_jsx_runtime161.jsxs)("div", { className: "flex flex-col gap-6", children: [
|
|
18253
18265
|
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.connectAccounts.title }),
|
|
@@ -18282,7 +18294,7 @@ ConnectAccountsStep.displayName = "ConnectAccountsStep";
|
|
|
18282
18294
|
|
|
18283
18295
|
// src/onboarding/steps/connect-onchain-modal.tsx
|
|
18284
18296
|
var import_react34 = require("react");
|
|
18285
|
-
var
|
|
18297
|
+
var import_hooks63 = require("@agg-build/hooks");
|
|
18286
18298
|
var Dialog4 = __toESM(require("@radix-ui/react-dialog"));
|
|
18287
18299
|
var import_jsx_runtime162 = require("react/jsx-runtime");
|
|
18288
18300
|
var ConnectOnchainModal = ({
|
|
@@ -18290,7 +18302,7 @@ var ConnectOnchainModal = ({
|
|
|
18290
18302
|
onOpenChange,
|
|
18291
18303
|
onConnect
|
|
18292
18304
|
}) => {
|
|
18293
|
-
const labels = (0,
|
|
18305
|
+
const labels = (0, import_hooks63.useLabels)();
|
|
18294
18306
|
const [connecting, setConnecting] = (0, import_react34.useState)(false);
|
|
18295
18307
|
const [error, setError] = (0, import_react34.useState)();
|
|
18296
18308
|
const handleCancel = (0, import_react34.useCallback)(() => {
|
|
@@ -18389,7 +18401,7 @@ var ConnectOnchainModal = ({
|
|
|
18389
18401
|
ConnectOnchainModal.displayName = "ConnectOnchainModal";
|
|
18390
18402
|
|
|
18391
18403
|
// src/onboarding/steps/connect-kalshi-modal.tsx
|
|
18392
|
-
var
|
|
18404
|
+
var import_hooks64 = require("@agg-build/hooks");
|
|
18393
18405
|
var import_sdk22 = require("@agg-build/sdk");
|
|
18394
18406
|
var Dialog5 = __toESM(require("@radix-ui/react-dialog"));
|
|
18395
18407
|
var import_react35 = require("react");
|
|
@@ -18416,8 +18428,8 @@ var ConnectKalshiModal = ({
|
|
|
18416
18428
|
onOpenChange,
|
|
18417
18429
|
onVerify
|
|
18418
18430
|
}) => {
|
|
18419
|
-
const labels = (0,
|
|
18420
|
-
const { disabledVenues, isLoading: isAppConfigLoading } = (0,
|
|
18431
|
+
const labels = (0, import_hooks64.useLabels)();
|
|
18432
|
+
const { disabledVenues, isLoading: isAppConfigLoading } = (0, import_hooks64.useAppConfig)();
|
|
18421
18433
|
const apiKeyInputRef = (0, import_react35.useRef)(null);
|
|
18422
18434
|
const errorId = (0, import_react35.useId)();
|
|
18423
18435
|
const [apiKeyId, setApiKeyId] = (0, import_react35.useState)("");
|
|
@@ -18425,7 +18437,7 @@ var ConnectKalshiModal = ({
|
|
|
18425
18437
|
const [isVerifying, setIsVerifying] = (0, import_react35.useState)(false);
|
|
18426
18438
|
const [isConnected, setIsConnected] = (0, import_react35.useState)(false);
|
|
18427
18439
|
const [error, setError] = (0, import_react35.useState)();
|
|
18428
|
-
const availabilityState = (0,
|
|
18440
|
+
const availabilityState = (0, import_hooks64.getVenueAvailabilityState)({
|
|
18429
18441
|
venueId: import_sdk22.Venue.kalshi,
|
|
18430
18442
|
disabledVenues,
|
|
18431
18443
|
isConfigLoading: isAppConfigLoading
|
|
@@ -18727,7 +18739,7 @@ var OnboardingModal = ({
|
|
|
18727
18739
|
connectedOnchain = false
|
|
18728
18740
|
}) => {
|
|
18729
18741
|
var _a;
|
|
18730
|
-
const labels = (0,
|
|
18742
|
+
const labels = (0, import_hooks65.useLabels)();
|
|
18731
18743
|
const [step, setStep] = (0, import_react36.useState)(ONBOARDING_STEPS.HOW_IT_WORKS);
|
|
18732
18744
|
const stepLabels = {
|
|
18733
18745
|
[ONBOARDING_STEPS.HOW_IT_WORKS]: labels.onboarding.modal.stepHowItWorks,
|
|
@@ -18812,12 +18824,12 @@ var requestAggWithdrawModalOpen = () => {
|
|
|
18812
18824
|
};
|
|
18813
18825
|
|
|
18814
18826
|
// src/trading/fund-kalshi-modal.tsx
|
|
18815
|
-
var
|
|
18827
|
+
var import_hooks66 = require("@agg-build/hooks");
|
|
18816
18828
|
var import_sdk23 = require("@agg-build/sdk");
|
|
18817
18829
|
var Dialog7 = __toESM(require("@radix-ui/react-dialog"));
|
|
18818
18830
|
var import_jsx_runtime165 = require("react/jsx-runtime");
|
|
18819
18831
|
var FundKalshiModal = ({ open, onOpenChange }) => {
|
|
18820
|
-
const labels = (0,
|
|
18832
|
+
const labels = (0, import_hooks66.useLabels)();
|
|
18821
18833
|
const modalLabels = labels.trading.fundKalshiModal;
|
|
18822
18834
|
return /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(Modal, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime165.jsxs)(
|
|
18823
18835
|
Modal.Container,
|
|
@@ -19380,8 +19392,14 @@ var extractGeoBlockedVenues = (warnings) => {
|
|
|
19380
19392
|
);
|
|
19381
19393
|
};
|
|
19382
19394
|
var getSmartRouteTotalFees = (feeBreakdown) => {
|
|
19395
|
+
var _a, _b;
|
|
19383
19396
|
if (!feeBreakdown) return null;
|
|
19384
|
-
const feeParts = [
|
|
19397
|
+
const feeParts = [
|
|
19398
|
+
feeBreakdown.venueFees + ((_a = feeBreakdown.builderFee) != null ? _a : 0),
|
|
19399
|
+
feeBreakdown.bridgeFees,
|
|
19400
|
+
feeBreakdown.executionGas,
|
|
19401
|
+
(_b = feeBreakdown.appFee) != null ? _b : 0
|
|
19402
|
+
];
|
|
19385
19403
|
if (!feeParts.every(Number.isFinite)) return null;
|
|
19386
19404
|
return feeParts.reduce((total, fee) => total + Math.round(fee * 100) / 100, 0);
|
|
19387
19405
|
};
|
|
@@ -21784,7 +21802,7 @@ var PlaceOrderSlippageControl = ({
|
|
|
21784
21802
|
minimumValue: slippageMinimumValue
|
|
21785
21803
|
}) => {
|
|
21786
21804
|
var _a, _b;
|
|
21787
|
-
const labels = (0,
|
|
21805
|
+
const labels = (0, import_hooks67.useLabels)();
|
|
21788
21806
|
const containerRef = (0, import_react38.useRef)(null);
|
|
21789
21807
|
const triggerRef = (0, import_react38.useRef)(null);
|
|
21790
21808
|
const inputRef = (0, import_react38.useRef)(null);
|
|
@@ -22058,7 +22076,7 @@ var PlaceOrderResolvedView = ({
|
|
|
22058
22076
|
showResolvingState = false
|
|
22059
22077
|
}) => {
|
|
22060
22078
|
var _a, _b;
|
|
22061
|
-
const labels = (0,
|
|
22079
|
+
const labels = (0, import_hooks67.useLabels)();
|
|
22062
22080
|
const tradingLabels = labels.trading;
|
|
22063
22081
|
const resolvingTimestamp = (_a = resolutionTimestamp != null ? resolutionTimestamp : tradingState.resolvesAt) != null ? _a : tradingState.endsAt;
|
|
22064
22082
|
const isResolvingMarket = showResolvingState && !tradingState.winningOutcome;
|
|
@@ -22354,23 +22372,23 @@ var PlaceOrder = ({
|
|
|
22354
22372
|
showResolvingState = false,
|
|
22355
22373
|
midpointsResult
|
|
22356
22374
|
}) => {
|
|
22357
|
-
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, _Z, __, _$, _aa, _ba, _ca;
|
|
22375
|
+
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, _Z, __, _$, _aa, _ba, _ca, _da;
|
|
22358
22376
|
const {
|
|
22359
22377
|
enableDebug: isExecutionDebugEnabled,
|
|
22360
22378
|
features: { enableAnimations, showFeesBreakdown, showLimitOrders: limitOrdersFeature },
|
|
22361
22379
|
formatting: { formatPrice },
|
|
22362
22380
|
general: { locale }
|
|
22363
|
-
} = (0,
|
|
22364
|
-
const labels = (0,
|
|
22381
|
+
} = (0, import_hooks67.useSdkUiConfig)();
|
|
22382
|
+
const labels = (0, import_hooks67.useLabels)();
|
|
22365
22383
|
const tradingLabels = labels.trading;
|
|
22366
22384
|
const toastCtx = useOptionalToast();
|
|
22367
|
-
const { isTradingBlocked } = (0,
|
|
22368
|
-
const tradingContext = (0,
|
|
22385
|
+
const { isTradingBlocked } = (0, import_hooks67.useGeoBlock)();
|
|
22386
|
+
const tradingContext = (0, import_hooks67.useEventTradingContext)();
|
|
22369
22387
|
const selectedEvent = (_a = tradingContext == null ? void 0 : tradingContext.selectedEvent) != null ? _a : null;
|
|
22370
22388
|
const selectedMarket = (_b = tradingContext == null ? void 0 : tradingContext.selectedMarket) != null ? _b : null;
|
|
22371
22389
|
const selectedOutcomeId = (_c = tradingContext == null ? void 0 : tradingContext.selectedOutcomeId) != null ? _c : null;
|
|
22372
22390
|
const resolvedEventTradingState = (0, import_react38.useMemo)(() => {
|
|
22373
|
-
return eventTradingState != null ? eventTradingState : (0,
|
|
22391
|
+
return eventTradingState != null ? eventTradingState : (0, import_hooks67.resolveEventTradingState)(selectedEvent);
|
|
22374
22392
|
}, [eventTradingState, selectedEvent]);
|
|
22375
22393
|
const scopedSelectedEvent = (0, import_react38.useMemo)(() => {
|
|
22376
22394
|
var _a2;
|
|
@@ -22398,7 +22416,7 @@ var PlaceOrder = ({
|
|
|
22398
22416
|
)) != null ? _f : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venueMarketOutcomes[0]) != null ? _g : null;
|
|
22399
22417
|
const scopedSelectedOutcomeId = (_h = scopedSelectedOutcome == null ? void 0 : scopedSelectedOutcome.id) != null ? _h : null;
|
|
22400
22418
|
const resolvedTradingState = (0, import_react38.useMemo)(() => {
|
|
22401
|
-
return (0,
|
|
22419
|
+
return (0, import_hooks67.resolveMarketTradingState)(scopedSelectedMarket);
|
|
22402
22420
|
}, [scopedSelectedMarket]);
|
|
22403
22421
|
const resolvedReadOnlyMarket = (0, import_react38.useMemo)(() => {
|
|
22404
22422
|
var _a2;
|
|
@@ -22412,11 +22430,11 @@ var PlaceOrder = ({
|
|
|
22412
22430
|
scopedSelectedMarket
|
|
22413
22431
|
]);
|
|
22414
22432
|
const resolvedReadOnlyTradingState = (0, import_react38.useMemo)(() => {
|
|
22415
|
-
return (0,
|
|
22433
|
+
return (0, import_hooks67.resolveMarketTradingState)(resolvedReadOnlyMarket);
|
|
22416
22434
|
}, [resolvedReadOnlyMarket]);
|
|
22417
22435
|
const isEndedWithoutKnownWinner = showResolvingState && !resolvedEventTradingState.winningOutcome && !resolvedReadOnlyTradingState.winningOutcome;
|
|
22418
22436
|
const orderEligibility = (0, import_react38.useMemo)(
|
|
22419
|
-
() => (0,
|
|
22437
|
+
() => (0, import_hooks67.resolveOrderEligibility)({
|
|
22420
22438
|
event: scopedSelectedEvent,
|
|
22421
22439
|
market: scopedSelectedMarket,
|
|
22422
22440
|
outcome: scopedSelectedOutcome,
|
|
@@ -22425,16 +22443,16 @@ var PlaceOrder = ({
|
|
|
22425
22443
|
[scopedSelectedEvent, scopedSelectedMarket, scopedSelectedOutcome, resolvedEventTradingState]
|
|
22426
22444
|
);
|
|
22427
22445
|
const isResolvedOutcomeCtaLocked = resolvedEventTradingState.kind === "resolved" || resolvedTradingState.kind === "resolved";
|
|
22428
|
-
const { isAuthenticated, user } = (0,
|
|
22446
|
+
const { isAuthenticated, user } = (0, import_hooks67.useAggAuthContext)();
|
|
22429
22447
|
const sharedKycFlow = useSharedKycFlow({
|
|
22430
22448
|
integration: sharedKyc,
|
|
22431
22449
|
userId: isAuthenticated ? user == null ? void 0 : user.id : null,
|
|
22432
22450
|
fallbackErrorMessage: tradingLabels.sharedKyc.modal.error
|
|
22433
22451
|
});
|
|
22434
|
-
const { executionMode: resolvedExecutionMode, isPaperMode } = (0,
|
|
22452
|
+
const { executionMode: resolvedExecutionMode, isPaperMode } = (0, import_hooks67.useResolvedExecutionMode)(executionMode);
|
|
22435
22453
|
const showLimitOrders = limitOrdersFeature && !isPaperMode;
|
|
22436
|
-
const liveBalanceState = (0,
|
|
22437
|
-
const paperBalancesQuery = (0,
|
|
22454
|
+
const liveBalanceState = (0, import_hooks67.useAggBalanceState)();
|
|
22455
|
+
const paperBalancesQuery = (0, import_hooks67.useManagedBalances)({
|
|
22438
22456
|
enabled: Boolean(isAuthenticated && isPaperMode),
|
|
22439
22457
|
mode: "paper"
|
|
22440
22458
|
});
|
|
@@ -22454,22 +22472,22 @@ var PlaceOrder = ({
|
|
|
22454
22472
|
const liveAvailableBalance = (_i = liveBalanceState.availableBalance) != null ? _i : liveBalanceState.totalBalance;
|
|
22455
22473
|
const totalBalance = isPaperMode ? paperTotalBalance : liveAvailableBalance;
|
|
22456
22474
|
const isBalanceLoading = isPaperMode ? paperBalancesQuery.isLoading : liveBalanceState.isLoading;
|
|
22457
|
-
const executeManaged = (0,
|
|
22458
|
-
const placeLimitOrder = (0,
|
|
22459
|
-
const aggClient = (0,
|
|
22460
|
-
const queryClient = (0,
|
|
22461
|
-
const { disabledVenues, isLoading: isAppConfigLoading } = (0,
|
|
22462
|
-
const { data: kalshiKeyStatus, refetch: refetchKalshiKeyStatus } = (0,
|
|
22475
|
+
const executeManaged = (0, import_hooks67.useExecuteManaged)();
|
|
22476
|
+
const placeLimitOrder = (0, import_hooks67.usePlaceLimitOrder)();
|
|
22477
|
+
const aggClient = (0, import_hooks67.useAggClient)();
|
|
22478
|
+
const queryClient = (0, import_hooks67.useQueryClient)();
|
|
22479
|
+
const { disabledVenues, isLoading: isAppConfigLoading } = (0, import_hooks67.useAppConfig)();
|
|
22480
|
+
const { data: kalshiKeyStatus, refetch: refetchKalshiKeyStatus } = (0, import_hooks67.useVenueKeyStatus)(
|
|
22463
22481
|
import_sdk24.Venue.kalshi,
|
|
22464
22482
|
isAuthenticated
|
|
22465
22483
|
);
|
|
22466
22484
|
const [isConnectKalshiModalOpen, setIsConnectKalshiModalOpen] = (0, import_react38.useState)(false);
|
|
22467
22485
|
const [isFundKalshiModalOpen, setIsFundKalshiModalOpen] = (0, import_react38.useState)(false);
|
|
22468
|
-
const livePrices = (0,
|
|
22486
|
+
const livePrices = (0, import_hooks67.useLiveOutcomePrices)(
|
|
22469
22487
|
scopedSelectedMarket ? [scopedSelectedMarket] : void 0
|
|
22470
22488
|
);
|
|
22471
|
-
const wsBestPrices = (0,
|
|
22472
|
-
const fetchedClusterMidpointResult = (0,
|
|
22489
|
+
const wsBestPrices = (0, import_hooks67.useLiveBestPrices)(scopedSelectedMarket ? [scopedSelectedMarket] : void 0);
|
|
22490
|
+
const fetchedClusterMidpointResult = (0, import_hooks67.useMidpoints)(
|
|
22473
22491
|
midpointsResult ? [] : scopedSelectedMarket ? [scopedSelectedMarket] : []
|
|
22474
22492
|
);
|
|
22475
22493
|
const clusterMidpointResult = midpointsResult != null ? midpointsResult : fetchedClusterMidpointResult;
|
|
@@ -22477,7 +22495,7 @@ var PlaceOrder = ({
|
|
|
22477
22495
|
const clusterBestMidpoint = clusterMidpointResult.bestMidpoint;
|
|
22478
22496
|
const clusterBestPricesRest = clusterMidpointResult.bestPrices;
|
|
22479
22497
|
const clusterBestPrices = (0, import_react38.useMemo)(
|
|
22480
|
-
() => (0,
|
|
22498
|
+
() => (0, import_hooks67.mergeBestPricesPreferringLive)(clusterBestPricesRest, wsBestPrices),
|
|
22481
22499
|
[clusterBestPricesRest, wsBestPrices]
|
|
22482
22500
|
);
|
|
22483
22501
|
const [internalTab, setInternalTab] = (0, import_react38.useState)("buy");
|
|
@@ -22571,7 +22589,7 @@ var PlaceOrder = ({
|
|
|
22571
22589
|
scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.id,
|
|
22572
22590
|
scopedSelectedOutcomeId
|
|
22573
22591
|
]);
|
|
22574
|
-
const debouncedAmount = (0,
|
|
22592
|
+
const debouncedAmount = (0, import_hooks67.useDebouncedValue)(internalAmount, 300);
|
|
22575
22593
|
const isQuoteInputEditing = internalAmount !== debouncedAmount;
|
|
22576
22594
|
const isLimitOrder = showLimitOrders && executionType === "limit";
|
|
22577
22595
|
const isSell = (0, import_react38.useMemo)(() => internalTab === "sell", [internalTab]);
|
|
@@ -22589,7 +22607,7 @@ var PlaceOrder = ({
|
|
|
22589
22607
|
);
|
|
22590
22608
|
const visibleLimitVenueOptions = (0, import_react38.useMemo)(() => {
|
|
22591
22609
|
return limitVenueOptions.filter((option) => {
|
|
22592
|
-
return (0,
|
|
22610
|
+
return (0, import_hooks67.getVenueAvailabilityState)({
|
|
22593
22611
|
venueId: option.venue,
|
|
22594
22612
|
disabledVenues,
|
|
22595
22613
|
isConfigLoading: isAppConfigLoading
|
|
@@ -22601,7 +22619,7 @@ var PlaceOrder = ({
|
|
|
22601
22619
|
dataUpdatedAt: executionPositionsUpdatedAt,
|
|
22602
22620
|
isLoading: isExecutionPositionsLoading,
|
|
22603
22621
|
isFetching: isExecutionPositionsFetching
|
|
22604
|
-
} = (0,
|
|
22622
|
+
} = (0, import_hooks67.useExecutionPositions)({
|
|
22605
22623
|
enabled: Boolean(isAuthenticated && isSell),
|
|
22606
22624
|
mode: isPaperMode ? "paper" : void 0
|
|
22607
22625
|
});
|
|
@@ -22635,7 +22653,7 @@ var PlaceOrder = ({
|
|
|
22635
22653
|
);
|
|
22636
22654
|
const hasValidLimitVenueQuoteAmount = debouncedAmount > 0;
|
|
22637
22655
|
const isLimitVenueQuoteEnabled = isLimitOrder && isQuotePanelActive && !isEndedWithoutKnownWinner && !submissionProgressState && !isBeforeActionPending && !placeLimitOrder.isPending && hasValidLimitVenueQuoteAmount && orderEligibility.canPlaceOrder && (!isSell || sellFilledForOutcomeId === scopedSelectedOutcomeId && !isQuoteInputEditing);
|
|
22638
|
-
const limitVenueQuotes = (0,
|
|
22656
|
+
const limitVenueQuotes = (0, import_hooks67.useLimitOrderVenueQuotes)({
|
|
22639
22657
|
requests: limitVenueQuoteRequests,
|
|
22640
22658
|
tradeSide: internalTab,
|
|
22641
22659
|
amount: debouncedAmount,
|
|
@@ -22669,7 +22687,7 @@ var PlaceOrder = ({
|
|
|
22669
22687
|
// server's reservation check — and the automatic pick, which sorts on
|
|
22670
22688
|
// price alone, would happily choose one. Only narrow once we know
|
|
22671
22689
|
// where the shares are; an empty map means positions haven't resolved.
|
|
22672
|
-
(!isSell || sellableSharesByVenue.size === 0 || ((_a2 = sellableSharesByVenue.get(option.venue)) != null ? _a2 : 0) > 0) && (0,
|
|
22690
|
+
(!isSell || sellableSharesByVenue.size === 0 || ((_a2 = sellableSharesByVenue.get(option.venue)) != null ? _a2 : 0) > 0) && (0, import_hooks67.getVenueAvailabilityState)({
|
|
22673
22691
|
venueId: option.venue,
|
|
22674
22692
|
disabledVenues,
|
|
22675
22693
|
isConfigLoading: isAppConfigLoading
|
|
@@ -22700,7 +22718,7 @@ var PlaceOrder = ({
|
|
|
22700
22718
|
if (!selectedLimitVenue || !geoBlockedLimitVenues.has(selectedLimitVenue)) return;
|
|
22701
22719
|
setSelectedLimitVenue(null);
|
|
22702
22720
|
}, [geoBlockedLimitVenues, selectedLimitVenue]);
|
|
22703
|
-
const smartRoute = (0,
|
|
22721
|
+
const smartRoute = (0, import_hooks67.useSmartRoute)(__spreadProps(__spreadValues({
|
|
22704
22722
|
venueMarketOutcomeId: scopedSelectedOutcomeId,
|
|
22705
22723
|
maxSpend: isSell ? void 0 : debouncedAmount,
|
|
22706
22724
|
sellShares: isSell ? debouncedAmount : void 0,
|
|
@@ -22773,7 +22791,7 @@ var PlaceOrder = ({
|
|
|
22773
22791
|
},
|
|
22774
22792
|
[debouncedAmount, isSell, scopedSelectedOutcomeId, smartRoute.data, smartRoute.isLoading]
|
|
22775
22793
|
);
|
|
22776
|
-
const venueSellQuotes = (0,
|
|
22794
|
+
const venueSellQuotes = (0, import_hooks67.useVenueSellQuotes)({
|
|
22777
22795
|
venueMarketOutcomeId: scopedSelectedOutcomeId,
|
|
22778
22796
|
accountId: (_n = user == null ? void 0 : user.id) != null ? _n : null,
|
|
22779
22797
|
positionVersion: executionPositionsUpdatedAt,
|
|
@@ -22998,7 +23016,7 @@ var PlaceOrder = ({
|
|
|
22998
23016
|
);
|
|
22999
23017
|
const isKalshiAccountActive = (_F = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.connected) != null ? _F : (legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.status) === "active";
|
|
23000
23018
|
const hasKalshiConnectionState = kalshiKeyStatus !== void 0 || (user == null ? void 0 : user.venueAccounts) != null;
|
|
23001
|
-
const isKalshiAvailable = (0,
|
|
23019
|
+
const isKalshiAvailable = (0, import_hooks67.getVenueAvailabilityState)({
|
|
23002
23020
|
venueId: "kalshi",
|
|
23003
23021
|
disabledVenues,
|
|
23004
23022
|
isConfigLoading: isAppConfigLoading
|
|
@@ -23053,7 +23071,7 @@ var PlaceOrder = ({
|
|
|
23053
23071
|
scopedSelectedOutcomeId
|
|
23054
23072
|
]
|
|
23055
23073
|
);
|
|
23056
|
-
const executionProgress = (0,
|
|
23074
|
+
const executionProgress = (0, import_hooks67.useExecutionProgress)({
|
|
23057
23075
|
orderIds: (_G = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) != null ? _G : null,
|
|
23058
23076
|
quoteId: (_H = submissionProgressState == null ? void 0 : submissionProgressState.quoteId) != null ? _H : null,
|
|
23059
23077
|
mode: isPaperMode ? "paper" : void 0,
|
|
@@ -23401,8 +23419,8 @@ var PlaceOrder = ({
|
|
|
23401
23419
|
}
|
|
23402
23420
|
if (submissionProgressState.phase === "success" && submissionProgressState.summary) {
|
|
23403
23421
|
emitTerminalOrderNotifications();
|
|
23404
|
-
(0,
|
|
23405
|
-
(0,
|
|
23422
|
+
(0, import_hooks67.invalidateBalanceQueries)(queryClient);
|
|
23423
|
+
(0, import_hooks67.invalidatePositionQueries)(queryClient);
|
|
23406
23424
|
if (debugStore && debugAttemptId) {
|
|
23407
23425
|
debugStore.updateAttempt(debugAttemptId, {
|
|
23408
23426
|
status: "succeeded",
|
|
@@ -23706,7 +23724,7 @@ var PlaceOrder = ({
|
|
|
23706
23724
|
limitPriceRaw: effectiveLimitPriceRaw,
|
|
23707
23725
|
side: internalTab
|
|
23708
23726
|
});
|
|
23709
|
-
const availabilityState = (0,
|
|
23727
|
+
const availabilityState = (0, import_hooks67.getVenueAvailabilityState)({
|
|
23710
23728
|
venueId: option.venue,
|
|
23711
23729
|
disabledVenues,
|
|
23712
23730
|
isConfigLoading: isAppConfigLoading
|
|
@@ -23775,13 +23793,17 @@ var PlaceOrder = ({
|
|
|
23775
23793
|
if (totalFees == null) return null;
|
|
23776
23794
|
return formatUsd(totalFees, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
23777
23795
|
}, [activeFeeBreakdown]);
|
|
23796
|
+
const appFeeValue = (__ = activeFeeBreakdown == null ? void 0 : activeFeeBreakdown.appFee) != null ? __ : 0;
|
|
23778
23797
|
const feeBreakdownRows = (0, import_react38.useMemo)(() => {
|
|
23798
|
+
var _a2;
|
|
23779
23799
|
if (!activeFeeBreakdown) return [];
|
|
23780
23800
|
return [
|
|
23781
23801
|
{
|
|
23802
|
+
// The builder slice (Hyperliquid only today) is a separate field on the
|
|
23803
|
+
// wire but reads as one cost to the user, so it renders inside "Venue".
|
|
23782
23804
|
kind: "amount",
|
|
23783
23805
|
label: tradingLabels.feeBreakdownVenueFees,
|
|
23784
|
-
value: formatUsd(activeFeeBreakdown.venueFees, {
|
|
23806
|
+
value: formatUsd(activeFeeBreakdown.venueFees + ((_a2 = activeFeeBreakdown.builderFee) != null ? _a2 : 0), {
|
|
23785
23807
|
minimumFractionDigits: 2,
|
|
23786
23808
|
maximumFractionDigits: 2
|
|
23787
23809
|
})
|
|
@@ -23802,23 +23824,33 @@ var PlaceOrder = ({
|
|
|
23802
23824
|
maximumFractionDigits: 2
|
|
23803
23825
|
})
|
|
23804
23826
|
},
|
|
23805
|
-
|
|
23827
|
+
// A partner charging a non-zero app fee gets a plain dollar row like every
|
|
23828
|
+
// other cost above it — the "0% fee" badge is only true, and only worth
|
|
23829
|
+
// highlighting, when the fee really is zero.
|
|
23830
|
+
appFeeValue > 0 ? {
|
|
23831
|
+
kind: "amount",
|
|
23832
|
+
label: tradingLabels.feeBreakdownAggMarket,
|
|
23833
|
+
value: formatUsd(appFeeValue, {
|
|
23834
|
+
minimumFractionDigits: 2,
|
|
23835
|
+
maximumFractionDigits: 2
|
|
23836
|
+
})
|
|
23837
|
+
} : {
|
|
23806
23838
|
kind: "badge",
|
|
23807
23839
|
label: tradingLabels.feeBreakdownAggMarket,
|
|
23808
23840
|
badgeLabel: tradingLabels.feeBreakdownPlatformFeeBadge
|
|
23809
23841
|
}
|
|
23810
23842
|
];
|
|
23811
|
-
}, [activeFeeBreakdown, tradingLabels]);
|
|
23843
|
+
}, [activeFeeBreakdown, appFeeValue, tradingLabels]);
|
|
23812
23844
|
const isActionLoading = isPrimaryActionLoading || executeManaged.isPending || placeLimitOrder.isPending || isBeforeActionPending;
|
|
23813
23845
|
const selectedLimitRouteCardId = selectedLimitVenueOption ? `limit-venue-${selectedLimitVenueOption.venue}-${selectedLimitVenueOption.venueMarketOutcomeId}` : null;
|
|
23814
|
-
const selectedLimitRouteCard = selectedLimitRouteCardId ? (
|
|
23815
|
-
const selectedRouteGeoBlocked = isLimitOrder ? (
|
|
23846
|
+
const selectedLimitRouteCard = selectedLimitRouteCardId ? (_$ = limitRouteCards.find((card) => card.id === selectedLimitRouteCardId)) != null ? _$ : null : null;
|
|
23847
|
+
const selectedRouteGeoBlocked = isLimitOrder ? (_aa = selectedLimitRouteCard == null ? void 0 : selectedLimitRouteCard.isUnavailable) != null ? _aa : false : (_ba = selectedRouteCard == null ? void 0 : selectedRouteCard.isUnavailable) != null ? _ba : false;
|
|
23816
23848
|
const geoBlockedVenuesFromWarnings = (0, import_react38.useMemo)(
|
|
23817
23849
|
() => {
|
|
23818
23850
|
var _a2;
|
|
23819
23851
|
return extractGeoBlockedVenues((_a2 = smartRoute.data) == null ? void 0 : _a2.warnings);
|
|
23820
23852
|
},
|
|
23821
|
-
[(
|
|
23853
|
+
[(_ca = smartRoute.data) == null ? void 0 : _ca.warnings]
|
|
23822
23854
|
);
|
|
23823
23855
|
const isPrimaryVenueGeoBlocked = (0, import_react38.useMemo)(() => {
|
|
23824
23856
|
var _a2, _b2;
|
|
@@ -24503,7 +24535,7 @@ var PlaceOrder = ({
|
|
|
24503
24535
|
PlaceOrderResolvedView,
|
|
24504
24536
|
{
|
|
24505
24537
|
tradingState: resolvedReadOnlyTradingState,
|
|
24506
|
-
resolutionTimestamp: (
|
|
24538
|
+
resolutionTimestamp: (_da = resolvedEventTradingState.resolvesAt) != null ? _da : resolvedReadOnlyTradingState.resolvesAt,
|
|
24507
24539
|
resolvedClaim,
|
|
24508
24540
|
classNames,
|
|
24509
24541
|
className,
|
|
@@ -25237,7 +25269,7 @@ var PlaceOrder = ({
|
|
|
25237
25269
|
className: "agg-order-submit h-12 w-full px-8 text-agg-base leading-agg-6 shadow-none",
|
|
25238
25270
|
disabled: !orderEligibility.canPlaceOrder || shouldShowGeoBlockBanner,
|
|
25239
25271
|
"aria-label": tradingLabels.signInToTrade,
|
|
25240
|
-
onClick:
|
|
25272
|
+
onClick: import_hooks67.requestAggAuthChooserOpen,
|
|
25241
25273
|
children: tradingLabels.signInToTrade
|
|
25242
25274
|
}
|
|
25243
25275
|
) : /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(
|
|
@@ -25264,7 +25296,7 @@ var PlaceOrder = ({
|
|
|
25264
25296
|
message: internalTab === "buy" ? tradingLabels.lowLiquidityWarning : tradingLabels.lowLiquiditySellWarning
|
|
25265
25297
|
}
|
|
25266
25298
|
) : null,
|
|
25267
|
-
!shouldShowGeoBlockBanner && internalTab === "buy" && showFeesBreakdown ? /* @__PURE__ */ (0, import_jsx_runtime169.jsxs)("div", { className: "agg-order-platform-fee mt-1 flex items-center justify-center gap-1.5 text-agg-sm leading-agg-5 text-agg-muted-foreground", children: [
|
|
25299
|
+
!shouldShowGeoBlockBanner && internalTab === "buy" && showFeesBreakdown && appFeeValue === 0 ? /* @__PURE__ */ (0, import_jsx_runtime169.jsxs)("div", { className: "agg-order-platform-fee mt-1 flex items-center justify-center gap-1.5 text-agg-sm leading-agg-5 text-agg-muted-foreground", children: [
|
|
25268
25300
|
/* @__PURE__ */ (0, import_jsx_runtime169.jsx)(
|
|
25269
25301
|
Icon,
|
|
25270
25302
|
{
|
|
@@ -25313,7 +25345,7 @@ var PlaceOrder = ({
|
|
|
25313
25345
|
PlaceOrder.displayName = "PlaceOrder";
|
|
25314
25346
|
|
|
25315
25347
|
// src/trading/use-claim-winnings.ts
|
|
25316
|
-
var
|
|
25348
|
+
var import_hooks68 = require("@agg-build/hooks");
|
|
25317
25349
|
var import_react39 = require("react");
|
|
25318
25350
|
var toClaimError = (err) => {
|
|
25319
25351
|
if (err instanceof Error) return err;
|
|
@@ -25321,11 +25353,11 @@ var toClaimError = (err) => {
|
|
|
25321
25353
|
};
|
|
25322
25354
|
function useClaimWinnings(options = {}) {
|
|
25323
25355
|
const { onClaim, onClaimResult, onClaimSubmitError, externalClaimingKeys } = options;
|
|
25324
|
-
const labels = (0,
|
|
25356
|
+
const labels = (0, import_hooks68.useLabels)();
|
|
25325
25357
|
const claimNotificationLabels = labels.notifications.claim;
|
|
25326
25358
|
const toastCtx = useOptionalToast();
|
|
25327
|
-
const queryClient = (0,
|
|
25328
|
-
const redeemMutation = (0,
|
|
25359
|
+
const queryClient = (0, import_hooks68.useQueryClient)();
|
|
25360
|
+
const redeemMutation = (0, import_hooks68.useRedeem)();
|
|
25329
25361
|
const [activeRedeems, setActiveRedeems] = (0, import_react39.useState)({});
|
|
25330
25362
|
const activeClaimKeysRef = (0, import_react39.useRef)(/* @__PURE__ */ new Set());
|
|
25331
25363
|
const pendingClaimToastIdsRef = (0, import_react39.useRef)({});
|
|
@@ -25335,7 +25367,7 @@ function useClaimWinnings(options = {}) {
|
|
|
25335
25367
|
() => Object.values(activeRedeems),
|
|
25336
25368
|
[activeRedeems]
|
|
25337
25369
|
);
|
|
25338
|
-
const lifecycleStates = (0,
|
|
25370
|
+
const lifecycleStates = (0, import_hooks68.useRedeemLifecycles)(lifecycleInputs);
|
|
25339
25371
|
const internalClaimingIds = (0, import_react39.useMemo)(() => {
|
|
25340
25372
|
const out = __spreadValues({}, submittingClaimKeys);
|
|
25341
25373
|
for (const [claimKey, active] of Object.entries(activeRedeems)) {
|
|
@@ -25350,13 +25382,13 @@ function useClaimWinnings(options = {}) {
|
|
|
25350
25382
|
[externalClaimingKeys, internalClaimingIds]
|
|
25351
25383
|
);
|
|
25352
25384
|
const invalidateClaimUiState = (0, import_react39.useCallback)(() => {
|
|
25353
|
-
(0,
|
|
25354
|
-
(0,
|
|
25385
|
+
(0, import_hooks68.invalidateBalanceQueries)(queryClient);
|
|
25386
|
+
(0, import_hooks68.invalidatePositionQueries)(queryClient);
|
|
25355
25387
|
queryClient.invalidateQueries({
|
|
25356
|
-
queryKey:
|
|
25388
|
+
queryKey: import_hooks68.executionKeys.claimablePositionsCount(),
|
|
25357
25389
|
refetchType: "active"
|
|
25358
25390
|
});
|
|
25359
|
-
(0,
|
|
25391
|
+
(0, import_hooks68.invalidateUserActivityQueries)(queryClient);
|
|
25360
25392
|
}, [queryClient]);
|
|
25361
25393
|
const claim = (0, import_react39.useCallback)(
|
|
25362
25394
|
(_0) => __async(null, [_0], function* ({ claimKey, winningOutcomeIds, payload }) {
|
|
@@ -25553,7 +25585,7 @@ function useClaimWinnings(options = {}) {
|
|
|
25553
25585
|
}
|
|
25554
25586
|
|
|
25555
25587
|
// src/trading/use-resolved-market-claim.ts
|
|
25556
|
-
var
|
|
25588
|
+
var import_hooks69 = require("@agg-build/hooks");
|
|
25557
25589
|
var import_react40 = require("react");
|
|
25558
25590
|
var sharesFormatter = new Intl.NumberFormat("en-US", { maximumFractionDigits: 2 });
|
|
25559
25591
|
var dateFormatter = new Intl.DateTimeFormat("en-US", {
|
|
@@ -25570,12 +25602,12 @@ var formatResolutionDate = (value) => {
|
|
|
25570
25602
|
function useResolvedMarketClaim(options = {}) {
|
|
25571
25603
|
var _a;
|
|
25572
25604
|
const { market, enabled = true, executionMode } = options;
|
|
25573
|
-
const { isAuthenticated } = (0,
|
|
25574
|
-
const tradingState = (0, import_react40.useMemo)(() => (0,
|
|
25605
|
+
const { isAuthenticated } = (0, import_hooks69.useAggAuthState)();
|
|
25606
|
+
const tradingState = (0, import_react40.useMemo)(() => (0, import_hooks69.resolveMarketTradingState)(market), [market]);
|
|
25575
25607
|
const isResolved = tradingState.kind === "resolved";
|
|
25576
25608
|
const marketId = (_a = market == null ? void 0 : market.id) != null ? _a : null;
|
|
25577
25609
|
const shouldFetch = Boolean(enabled && isAuthenticated && isResolved && marketId);
|
|
25578
|
-
const { positions } = (0,
|
|
25610
|
+
const { positions } = (0, import_hooks69.useExecutionPositions)(__spreadValues({
|
|
25579
25611
|
enabled: shouldFetch,
|
|
25580
25612
|
status: "active",
|
|
25581
25613
|
limit: 50
|
|
@@ -25592,7 +25624,7 @@ function useResolvedMarketClaim(options = {}) {
|
|
|
25592
25624
|
(outcome) => outcome.winner === true && outcome.totalSize > 0
|
|
25593
25625
|
);
|
|
25594
25626
|
if (winningOutcomes.length === 0) return void 0;
|
|
25595
|
-
const totals = (0,
|
|
25627
|
+
const totals = (0, import_hooks69.computeClosedPositionTotals)(group);
|
|
25596
25628
|
const winningShares = winningOutcomes.reduce((sum, outcome) => sum + outcome.totalSize, 0);
|
|
25597
25629
|
const winningOutcomeLabel = (_a2 = resolveResolvedOutcomeLabel({
|
|
25598
25630
|
market: market != null ? market : group.venueMarket,
|
|
@@ -25676,7 +25708,7 @@ var resolveEventMarketPageStickyState = ({
|
|
|
25676
25708
|
};
|
|
25677
25709
|
|
|
25678
25710
|
// src/pages/event-market/event-market.shared.tsx
|
|
25679
|
-
var
|
|
25711
|
+
var import_hooks70 = require("@agg-build/hooks");
|
|
25680
25712
|
var Dialog8 = __toESM(require("@radix-ui/react-dialog"));
|
|
25681
25713
|
var import_react41 = require("react");
|
|
25682
25714
|
var import_jsx_runtime170 = require("react/jsx-runtime");
|
|
@@ -25746,7 +25778,7 @@ var EventMarketPageMobileTrade = ({
|
|
|
25746
25778
|
onBeforePrimaryAction,
|
|
25747
25779
|
sharedKyc
|
|
25748
25780
|
}) => {
|
|
25749
|
-
const labels = (0,
|
|
25781
|
+
const labels = (0, import_hooks70.useLabels)();
|
|
25750
25782
|
if (!showPlaceOrder) return null;
|
|
25751
25783
|
const handleOpenChange = (nextOpen) => {
|
|
25752
25784
|
onOpenChange(nextOpen);
|
|
@@ -25802,7 +25834,7 @@ var EventMarketPageMobileTrade = ({
|
|
|
25802
25834
|
var EventMarketPageUnavailableState = ({
|
|
25803
25835
|
ariaLabel: _ariaLabel
|
|
25804
25836
|
}) => {
|
|
25805
|
-
const labels = (0,
|
|
25837
|
+
const labels = (0, import_hooks70.useLabels)();
|
|
25806
25838
|
return /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(
|
|
25807
25839
|
StateMessage,
|
|
25808
25840
|
{
|
|
@@ -25818,7 +25850,7 @@ var EventMarketPageUnavailableState = ({
|
|
|
25818
25850
|
var EventMarketPageNotFoundState = ({
|
|
25819
25851
|
ariaLabel: _ariaLabel
|
|
25820
25852
|
}) => {
|
|
25821
|
-
const labels = (0,
|
|
25853
|
+
const labels = (0, import_hooks70.useLabels)();
|
|
25822
25854
|
return /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(
|
|
25823
25855
|
StateMessage,
|
|
25824
25856
|
{
|
|
@@ -25915,11 +25947,11 @@ var EventMarketPageLoadingState = ({
|
|
|
25915
25947
|
};
|
|
25916
25948
|
|
|
25917
25949
|
// src/pages/event-market/sports-event-market-page.tsx
|
|
25918
|
-
var
|
|
25950
|
+
var import_hooks73 = require("@agg-build/hooks");
|
|
25919
25951
|
var import_react44 = require("react");
|
|
25920
25952
|
|
|
25921
25953
|
// src/pages/event-market/sports-markets.tsx
|
|
25922
|
-
var
|
|
25954
|
+
var import_hooks72 = require("@agg-build/hooks");
|
|
25923
25955
|
var import_react43 = require("react");
|
|
25924
25956
|
|
|
25925
25957
|
// src/pages/event-market/sports-event-market.utils.ts
|
|
@@ -26924,7 +26956,7 @@ var mergeSportsSectionMarketsIntoEvent = ({
|
|
|
26924
26956
|
};
|
|
26925
26957
|
|
|
26926
26958
|
// src/pages/event-market/sports-market-card.tsx
|
|
26927
|
-
var
|
|
26959
|
+
var import_hooks71 = require("@agg-build/hooks");
|
|
26928
26960
|
var import_react42 = require("react");
|
|
26929
26961
|
|
|
26930
26962
|
// src/pages/event-market/sports-line-rail.tsx
|
|
@@ -27273,11 +27305,11 @@ var SportsMarketCard = ({
|
|
|
27273
27305
|
midpointsResult
|
|
27274
27306
|
}) => {
|
|
27275
27307
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
27276
|
-
const labels = (0,
|
|
27308
|
+
const labels = (0, import_hooks71.useLabels)();
|
|
27277
27309
|
const {
|
|
27278
27310
|
formatting: { formatCompactCurrency }
|
|
27279
|
-
} = (0,
|
|
27280
|
-
const tradingContext = (0,
|
|
27311
|
+
} = (0, import_hooks71.useSdkUiConfig)();
|
|
27312
|
+
const tradingContext = (0, import_hooks71.useEventTradingContext)();
|
|
27281
27313
|
const slide = (0, import_react42.useMemo)(() => buildSportsSlideFromGroup(group), [group]);
|
|
27282
27314
|
const [selectedLineIndex, setSelectedLineIndex] = (0, import_react42.useState)(slide.defaultStopIndex);
|
|
27283
27315
|
const combinedLegs = (0, import_react42.useMemo)(() => resolveSportsCombinedLegs(group), [group]);
|
|
@@ -27318,7 +27350,7 @@ var SportsMarketCard = ({
|
|
|
27318
27350
|
const justOpened = isExpanded && !wasExpandedRef.current;
|
|
27319
27351
|
wasExpandedRef.current = isExpanded;
|
|
27320
27352
|
if (!justOpened || !activeMarket) return;
|
|
27321
|
-
if ((0,
|
|
27353
|
+
if ((0, import_hooks71.resolveMarketTradingState)(activeMarket).isTradingDisabled) return;
|
|
27322
27354
|
const selectedOutcomeId = tradingContext == null ? void 0 : tradingContext.selectedOutcomeId;
|
|
27323
27355
|
const hasInScopeOutcome = selectedOutcomeId != null && activeMarket.venueMarketOutcomes.some((outcome) => outcome.id === selectedOutcomeId);
|
|
27324
27356
|
if (hasInScopeOutcome) return;
|
|
@@ -27438,7 +27470,7 @@ var SportsMarketCard = ({
|
|
|
27438
27470
|
stops: slide.stops.map((stop) => ({
|
|
27439
27471
|
value: stop.value,
|
|
27440
27472
|
venues: stop.venues,
|
|
27441
|
-
disabled: stop.market.status !==
|
|
27473
|
+
disabled: stop.market.status !== import_hooks71.MarketStatus.open
|
|
27442
27474
|
})),
|
|
27443
27475
|
selectedIndex: selectedLineIndex,
|
|
27444
27476
|
onSelect: handleLineSelect,
|
|
@@ -27542,7 +27574,7 @@ var SportsTabButton = ({
|
|
|
27542
27574
|
);
|
|
27543
27575
|
};
|
|
27544
27576
|
var SportsMarketsLoadingState = () => {
|
|
27545
|
-
const labels = (0,
|
|
27577
|
+
const labels = (0, import_hooks72.useLabels)();
|
|
27546
27578
|
return /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)(
|
|
27547
27579
|
"div",
|
|
27548
27580
|
{
|
|
@@ -27580,13 +27612,13 @@ var SportsMarkets = ({
|
|
|
27580
27612
|
midpointsResult
|
|
27581
27613
|
}) => {
|
|
27582
27614
|
var _a, _b;
|
|
27583
|
-
const labels = (0,
|
|
27584
|
-
const tradingContext = (0,
|
|
27615
|
+
const labels = (0, import_hooks72.useLabels)();
|
|
27616
|
+
const tradingContext = (0, import_hooks72.useEventTradingContext)();
|
|
27585
27617
|
const hasAggKey = Boolean(event.aggKey);
|
|
27586
|
-
const gameMarketsQuery = (0,
|
|
27618
|
+
const gameMarketsQuery = (0, import_hooks72.useVenueMarkets)({
|
|
27587
27619
|
aggKey: event.aggKey ? [event.aggKey] : void 0,
|
|
27588
27620
|
limit: 100,
|
|
27589
|
-
status:
|
|
27621
|
+
status: import_hooks72.MarketStatus.open,
|
|
27590
27622
|
enabled: hasAggKey
|
|
27591
27623
|
});
|
|
27592
27624
|
const {
|
|
@@ -27622,7 +27654,7 @@ var SportsMarkets = ({
|
|
|
27622
27654
|
const [stableMarketsByTab, setStableMarketsByTab] = (0, import_react43.useState)({});
|
|
27623
27655
|
const activeTabLabel = resolveSportsSectionLabel(labels, activeTab);
|
|
27624
27656
|
const sectionFilters = resolveSportsSectionFilters(activeTab);
|
|
27625
|
-
const sectionMarketsQuery = (0,
|
|
27657
|
+
const sectionMarketsQuery = (0, import_hooks72.useVenueMarkets)({
|
|
27626
27658
|
aggKey: event.aggKey ? [event.aggKey] : void 0,
|
|
27627
27659
|
sportsMarketType: sectionFilters.sportsMarketType,
|
|
27628
27660
|
period: sectionFilters.period,
|
|
@@ -27632,7 +27664,7 @@ var SportsMarkets = ({
|
|
|
27632
27664
|
// heavy tab (e.g. "Other" spans other/team_props/player_props/specials/
|
|
27633
27665
|
// completion — hundreds of markets on prop-rich events) from ~15 calls to 1-3.
|
|
27634
27666
|
limit: 100,
|
|
27635
|
-
status:
|
|
27667
|
+
status: import_hooks72.MarketStatus.open,
|
|
27636
27668
|
enabled: hasAggKey
|
|
27637
27669
|
});
|
|
27638
27670
|
const {
|
|
@@ -27718,7 +27750,7 @@ var SportsMarkets = ({
|
|
|
27718
27750
|
return;
|
|
27719
27751
|
}
|
|
27720
27752
|
setExpandedGroupId(groupId);
|
|
27721
|
-
if ((0,
|
|
27753
|
+
if ((0, import_hooks72.resolveMarketTradingState)(market).isTradingDisabled) return;
|
|
27722
27754
|
if (market.id !== (tradingContext == null ? void 0 : tradingContext.selectedMarketId)) {
|
|
27723
27755
|
tradingContext == null ? void 0 : tradingContext.selectMarket(market.id, market);
|
|
27724
27756
|
}
|
|
@@ -27834,7 +27866,7 @@ var SportsEventMarketPage = ({
|
|
|
27834
27866
|
sectionMarketsByKey
|
|
27835
27867
|
});
|
|
27836
27868
|
}, [event, sectionMarketsByKey]);
|
|
27837
|
-
const eventTradingState = (0, import_react44.useMemo)(() => (0,
|
|
27869
|
+
const eventTradingState = (0, import_react44.useMemo)(() => (0, import_hooks73.resolveEventTradingState)(composedEvent), [composedEvent]);
|
|
27838
27870
|
const hasSportsSections = (0, import_react44.useMemo)(
|
|
27839
27871
|
() => resolveVisibleSportsSectionTabs(event).length > 0,
|
|
27840
27872
|
[event]
|
|
@@ -27842,12 +27874,12 @@ var SportsEventMarketPage = ({
|
|
|
27842
27874
|
const stickyOrderPanelState = resolveEventMarketPageStickyState({
|
|
27843
27875
|
stickyOrderPanel
|
|
27844
27876
|
});
|
|
27845
|
-
const { executionMode: resolvedExecutionMode } = (0,
|
|
27877
|
+
const { executionMode: resolvedExecutionMode } = (0, import_hooks73.useResolvedExecutionMode)(executionMode);
|
|
27846
27878
|
const [isMobileTradeOpen, setIsMobileTradeOpen] = (0, import_react44.useState)(false);
|
|
27847
27879
|
const isMobileViewport = useIsMobileEventMarketViewport(SPORTS_EVENT_MARKET_MEDIA_QUERY);
|
|
27848
|
-
const tradingContext = (0,
|
|
27849
|
-
const { stateByEventId: sportsLiveStateByEventId } = (0,
|
|
27850
|
-
const midpointsResult = (0,
|
|
27880
|
+
const tradingContext = (0, import_hooks73.useEventTradingContext)();
|
|
27881
|
+
const { stateByEventId: sportsLiveStateByEventId } = (0, import_hooks73.useSportsLive)([event.id]);
|
|
27882
|
+
const midpointsResult = (0, import_hooks73.useMidpoints)(composedEvent.venueMarkets);
|
|
27851
27883
|
const internalResolvedClaim = useResolvedMarketClaim({
|
|
27852
27884
|
market: eventTradingState.primaryMarket,
|
|
27853
27885
|
enabled: eventTradingState.kind === "resolved",
|
|
@@ -27859,7 +27891,7 @@ var SportsEventMarketPage = ({
|
|
|
27859
27891
|
(0, import_react44.useEffect)(() => {
|
|
27860
27892
|
return () => {
|
|
27861
27893
|
var _a;
|
|
27862
|
-
(_a = setTradeSideRef.current) == null ? void 0 : _a.call(setTradeSideRef,
|
|
27894
|
+
(_a = setTradeSideRef.current) == null ? void 0 : _a.call(setTradeSideRef, import_hooks73.TradeSide.Buy);
|
|
27863
27895
|
};
|
|
27864
27896
|
}, []);
|
|
27865
27897
|
const handleSectionMarketsChange = (0, import_react44.useCallback)(
|
|
@@ -28070,19 +28102,19 @@ var EventMarketPageContent = ({
|
|
|
28070
28102
|
onRecurringMarketNavigate
|
|
28071
28103
|
}) => {
|
|
28072
28104
|
var _a;
|
|
28073
|
-
const eventTradingState = (0, import_react45.useMemo)(() => (0,
|
|
28105
|
+
const eventTradingState = (0, import_react45.useMemo)(() => (0, import_hooks74.resolveEventTradingState)(event), [event]);
|
|
28074
28106
|
const stickyOrderPanelState = resolveEventMarketPageStickyState({
|
|
28075
28107
|
stickyOrderPanel
|
|
28076
28108
|
});
|
|
28077
|
-
const { executionMode: resolvedExecutionMode } = (0,
|
|
28109
|
+
const { executionMode: resolvedExecutionMode } = (0, import_hooks74.useResolvedExecutionMode)(executionMode);
|
|
28078
28110
|
const [isMobileTradeOpen, setIsMobileTradeOpen] = (0, import_react45.useState)(false);
|
|
28079
28111
|
const isMobileViewport = useIsMobileEventMarketViewport();
|
|
28080
|
-
const tradingContext = (0,
|
|
28081
|
-
const labels = (0,
|
|
28082
|
-
const recurringQuery = (0,
|
|
28112
|
+
const tradingContext = (0, import_hooks74.useEventTradingContext)();
|
|
28113
|
+
const labels = (0, import_hooks74.useLabels)();
|
|
28114
|
+
const recurringQuery = (0, import_hooks74.useRecurringCryptoMarkets)({ event });
|
|
28083
28115
|
const currentTimestamp = useCurrentTimestamp(recurringQuery.isRecurringCryptoMarket);
|
|
28084
28116
|
const recurringTimeline = (0, import_react45.useMemo)(
|
|
28085
|
-
() => currentTimestamp == null ? null : (0,
|
|
28117
|
+
() => currentTimestamp == null ? null : (0, import_hooks74.resolveRecurringCryptoTimeline)(recurringQuery.windows, event, currentTimestamp),
|
|
28086
28118
|
[currentTimestamp, event, recurringQuery.windows]
|
|
28087
28119
|
);
|
|
28088
28120
|
const isRecurringCryptoMarket = (recurringTimeline == null ? void 0 : recurringTimeline.viewed) != null;
|
|
@@ -28162,7 +28194,7 @@ var EventMarketPageContent = ({
|
|
|
28162
28194
|
() => normalizeVenueMarketCluster(event.venueMarkets),
|
|
28163
28195
|
[event.venueMarkets]
|
|
28164
28196
|
);
|
|
28165
|
-
const midpointsResult = (0,
|
|
28197
|
+
const midpointsResult = (0, import_hooks74.useMidpoints)(
|
|
28166
28198
|
recurringQuery.isRecurringCryptoMarket && eventTradingState.kind !== "open" ? [] : eventDetailVenueMarkets
|
|
28167
28199
|
);
|
|
28168
28200
|
const internalResolvedClaim = useResolvedMarketClaim({
|
|
@@ -28176,7 +28208,7 @@ var EventMarketPageContent = ({
|
|
|
28176
28208
|
(0, import_react45.useEffect)(() => {
|
|
28177
28209
|
return () => {
|
|
28178
28210
|
var _a2;
|
|
28179
|
-
(_a2 = setTradeSideRef.current) == null ? void 0 : _a2.call(setTradeSideRef,
|
|
28211
|
+
(_a2 = setTradeSideRef.current) == null ? void 0 : _a2.call(setTradeSideRef, import_hooks74.TradeSide.Buy);
|
|
28180
28212
|
};
|
|
28181
28213
|
}, []);
|
|
28182
28214
|
if (!event.venueMarkets.length) {
|
|
@@ -28318,14 +28350,14 @@ var EventMarketPage = (props) => {
|
|
|
28318
28350
|
var _a;
|
|
28319
28351
|
const {
|
|
28320
28352
|
features: { showSportsMarkets }
|
|
28321
|
-
} = (0,
|
|
28353
|
+
} = (0, import_hooks74.useSdkUiConfig)();
|
|
28322
28354
|
const hasEventProp = "event" in props && !!props.event;
|
|
28323
28355
|
const {
|
|
28324
28356
|
event: fetchedEvent,
|
|
28325
28357
|
error: eventError,
|
|
28326
28358
|
isLoading: isFetchingEvent,
|
|
28327
28359
|
isEnriching
|
|
28328
|
-
} = (0,
|
|
28360
|
+
} = (0, import_hooks74.useEnrichedVenueEvent)({
|
|
28329
28361
|
eventId: hasEventProp ? "" : (_a = props.eventId) != null ? _a : "",
|
|
28330
28362
|
enabled: !props.isLoading && !hasEventProp && !!props.eventId
|
|
28331
28363
|
});
|
|
@@ -28591,14 +28623,14 @@ var HomeSearchResults = ({
|
|
|
28591
28623
|
onEventClick,
|
|
28592
28624
|
onMarketClick
|
|
28593
28625
|
}) => {
|
|
28594
|
-
const labels = (0,
|
|
28595
|
-
const { search: searchConfig } = (0,
|
|
28596
|
-
const { disabledVenues } = (0,
|
|
28626
|
+
const labels = (0, import_hooks75.useLabels)();
|
|
28627
|
+
const { search: searchConfig } = (0, import_hooks75.useSdkUiConfig)();
|
|
28628
|
+
const { disabledVenues } = (0, import_hooks75.useAppConfig)();
|
|
28597
28629
|
const [activeVenueTabValue, setActiveVenueTabValue] = (0, import_react48.useState)("all");
|
|
28598
28630
|
const eventListTabs = useEventListTabs();
|
|
28599
28631
|
const { headerRef, titleRef, shouldUseSelectOverflow } = useEventListTabsHeaderOverflow(eventListTabs);
|
|
28600
28632
|
const visibleVenues = (0, import_react48.useMemo)(
|
|
28601
|
-
() => disabledVenues.length === 0 ? void 0 : (0,
|
|
28633
|
+
() => disabledVenues.length === 0 ? void 0 : (0, import_hooks75.getVisibleVenueIdsByConfig)(import_sdk25.VENUES, disabledVenues),
|
|
28602
28634
|
[disabledVenues]
|
|
28603
28635
|
);
|
|
28604
28636
|
const activeVenueTab = (0, import_react48.useMemo)(() => {
|
|
@@ -28616,7 +28648,7 @@ var HomeSearchResults = ({
|
|
|
28616
28648
|
hasNextPage,
|
|
28617
28649
|
isFetchingNextPage,
|
|
28618
28650
|
isPlaceholderData
|
|
28619
|
-
} = (0,
|
|
28651
|
+
} = (0, import_hooks75.useSearch)({
|
|
28620
28652
|
q: query,
|
|
28621
28653
|
type: "events",
|
|
28622
28654
|
categoryIds: activeTabValue === ALL_CATEGORIES_TAB_VALUE ? void 0 : activeCategoryTab == null ? void 0 : activeCategoryTab.categoryIds,
|
|
@@ -28644,7 +28676,7 @@ var HomeSearchResults = ({
|
|
|
28644
28676
|
const visibleMidpointVenueMarketIds = (0, import_react48.useMemo)(() => {
|
|
28645
28677
|
return collectVisibleVenueMarketIds(visibleVenueMarkets);
|
|
28646
28678
|
}, [visibleVenueMarkets]);
|
|
28647
|
-
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0,
|
|
28679
|
+
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0, import_hooks75.useVenueMarketMidpoints)({
|
|
28648
28680
|
venueMarketIds: visibleMidpointVenueMarketIds,
|
|
28649
28681
|
enabled: visibleMidpointVenueMarketIds.length > 0
|
|
28650
28682
|
});
|
|
@@ -28793,7 +28825,7 @@ var HomePage = ({
|
|
|
28793
28825
|
stickyOrderPanel
|
|
28794
28826
|
}) => {
|
|
28795
28827
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
28796
|
-
const labels = (0,
|
|
28828
|
+
const labels = (0, import_hooks75.useLabels)();
|
|
28797
28829
|
const {
|
|
28798
28830
|
search: {
|
|
28799
28831
|
value: searchValue,
|
|
@@ -28803,11 +28835,11 @@ var HomePage = ({
|
|
|
28803
28835
|
onSelect: onSelectEventInternal
|
|
28804
28836
|
},
|
|
28805
28837
|
features: { enableEventDiscoveryUrlPersistence }
|
|
28806
|
-
} = (0,
|
|
28807
|
-
const { executionMode } = (0,
|
|
28808
|
-
const { isLoading: isAppConfigLoading } = (0,
|
|
28838
|
+
} = (0, import_hooks75.useSdkUiConfig)();
|
|
28839
|
+
const { executionMode } = (0, import_hooks75.useResolvedExecutionMode)();
|
|
28840
|
+
const { isLoading: isAppConfigLoading } = (0, import_hooks75.useAppConfig)();
|
|
28809
28841
|
const primaryEventListTabs = useEventListTabs();
|
|
28810
|
-
const { capture, consume } = (0,
|
|
28842
|
+
const { capture, consume } = (0, import_hooks75.useEventListState)();
|
|
28811
28843
|
const [snapshot] = (0, import_react48.useState)(() => consume());
|
|
28812
28844
|
const eventListStateRef = (0, import_react48.useRef)(null);
|
|
28813
28845
|
const handleSelectEvent = (0, import_react48.useCallback)(
|
|
@@ -28877,7 +28909,7 @@ var HomePage = ({
|
|
|
28877
28909
|
}, [isShowingAllResults, normalizedSearchValue, selectedEvent]);
|
|
28878
28910
|
const resolvedSelectedEvent = selectedEvent != null ? selectedEvent : stickySelectedEvent;
|
|
28879
28911
|
const resolvedAllCategoryTabLabel = allCategoryTabLabel === DEFAULT_ALL_CATEGORY_TAB_LABEL ? labels.home.trending : allCategoryTabLabel;
|
|
28880
|
-
const { categories, isLoading: isCategoriesLoading } = (0,
|
|
28912
|
+
const { categories, isLoading: isCategoriesLoading } = (0, import_hooks75.useCategories)({
|
|
28881
28913
|
limit: categoriesLimit,
|
|
28882
28914
|
enabled: !hasCustomTabs
|
|
28883
28915
|
});
|
|
@@ -29279,13 +29311,13 @@ var HomePage = ({
|
|
|
29279
29311
|
HomePage.displayName = "HomePage";
|
|
29280
29312
|
|
|
29281
29313
|
// src/pages/user-profile/index.tsx
|
|
29282
|
-
var
|
|
29314
|
+
var import_hooks83 = require("@agg-build/hooks");
|
|
29283
29315
|
var import_sdk29 = require("@agg-build/sdk");
|
|
29284
29316
|
var import_dayjs9 = __toESM(require("dayjs"));
|
|
29285
29317
|
var import_react51 = require("react");
|
|
29286
29318
|
|
|
29287
29319
|
// src/pages/user-profile/components/available-balance-card.tsx
|
|
29288
|
-
var
|
|
29320
|
+
var import_hooks76 = require("@agg-build/hooks");
|
|
29289
29321
|
var import_sdk26 = require("@agg-build/sdk");
|
|
29290
29322
|
var import_jsx_runtime177 = require("react/jsx-runtime");
|
|
29291
29323
|
var BASE_URL = "https://assets.snagsolutions.io";
|
|
@@ -29336,7 +29368,7 @@ var AvailableBalanceCard = ({
|
|
|
29336
29368
|
onManage,
|
|
29337
29369
|
manageButtonRef
|
|
29338
29370
|
}) => {
|
|
29339
|
-
const labels = (0,
|
|
29371
|
+
const labels = (0, import_hooks76.useLabels)();
|
|
29340
29372
|
const balanceLabels = labels.userProfile.balance;
|
|
29341
29373
|
const resolvedLabel = label2 != null ? label2 : balanceLabels.availableBalance;
|
|
29342
29374
|
const hasPaperBalance = chains.some(isPaperChain);
|
|
@@ -29490,7 +29522,7 @@ var AvailableBalanceCard = ({
|
|
|
29490
29522
|
AvailableBalanceCard.displayName = "AvailableBalanceCard";
|
|
29491
29523
|
|
|
29492
29524
|
// src/pages/user-profile/components/claim-activity-breakdown-modal.tsx
|
|
29493
|
-
var
|
|
29525
|
+
var import_hooks77 = require("@agg-build/hooks");
|
|
29494
29526
|
var import_sdk27 = require("@agg-build/sdk");
|
|
29495
29527
|
var import_jsx_runtime178 = require("react/jsx-runtime");
|
|
29496
29528
|
var CLAIM_VENUE_LABELS = {
|
|
@@ -29512,7 +29544,7 @@ var ClaimActivityBreakdownModal = ({
|
|
|
29512
29544
|
onTransactionSelect
|
|
29513
29545
|
}) => {
|
|
29514
29546
|
var _a;
|
|
29515
|
-
const labels = (0,
|
|
29547
|
+
const labels = (0, import_hooks77.useLabels)();
|
|
29516
29548
|
return /* @__PURE__ */ (0, import_jsx_runtime178.jsx)(
|
|
29517
29549
|
Modal,
|
|
29518
29550
|
{
|
|
@@ -29621,7 +29653,7 @@ var ClaimActivityBreakdownModal = ({
|
|
|
29621
29653
|
};
|
|
29622
29654
|
|
|
29623
29655
|
// src/pages/user-profile/components/manage-balances-modal.tsx
|
|
29624
|
-
var
|
|
29656
|
+
var import_hooks78 = require("@agg-build/hooks");
|
|
29625
29657
|
var import_sdk28 = require("@agg-build/sdk");
|
|
29626
29658
|
var Dialog9 = __toESM(require("@radix-ui/react-dialog"));
|
|
29627
29659
|
var import_react49 = require("react");
|
|
@@ -29702,11 +29734,11 @@ var ManageBalancesModal = ({
|
|
|
29702
29734
|
open,
|
|
29703
29735
|
onOpenChange
|
|
29704
29736
|
}) => {
|
|
29705
|
-
const labels = (0,
|
|
29737
|
+
const labels = (0, import_hooks78.useLabels)();
|
|
29706
29738
|
const refillLabels = labels.balanceRefill;
|
|
29707
|
-
const balanceState = (0,
|
|
29708
|
-
const depositAddressesQuery = (0,
|
|
29709
|
-
const policiesQuery = (0,
|
|
29739
|
+
const balanceState = (0, import_hooks78.useAggBalance)();
|
|
29740
|
+
const depositAddressesQuery = (0, import_hooks78.useDepositAddresses)({ enabled: open });
|
|
29741
|
+
const policiesQuery = (0, import_hooks78.useBalanceRefillPolicies)({ enabled: open });
|
|
29710
29742
|
const toastContext = useOptionalToast();
|
|
29711
29743
|
const descriptionId = (0, import_react49.useId)();
|
|
29712
29744
|
const savingRef = (0, import_react49.useRef)(false);
|
|
@@ -30327,7 +30359,7 @@ var ManageBalancesModal = ({
|
|
|
30327
30359
|
ManageBalancesModal.displayName = "ManageBalancesModal";
|
|
30328
30360
|
|
|
30329
30361
|
// src/pages/user-profile/components/positions-activity.tsx
|
|
30330
|
-
var
|
|
30362
|
+
var import_hooks81 = require("@agg-build/hooks");
|
|
30331
30363
|
var import_react50 = require("react");
|
|
30332
30364
|
|
|
30333
30365
|
// src/pages/user-profile/user-profile.constants.ts
|
|
@@ -31118,7 +31150,7 @@ var EmptyState = ({ title: title2, description, className }) => {
|
|
|
31118
31150
|
EmptyState.displayName = "EmptyState";
|
|
31119
31151
|
|
|
31120
31152
|
// src/pages/user-profile/components/open-order-row.tsx
|
|
31121
|
-
var
|
|
31153
|
+
var import_hooks79 = require("@agg-build/hooks");
|
|
31122
31154
|
var import_jsx_runtime182 = require("react/jsx-runtime");
|
|
31123
31155
|
var shouldUseNativeLinkNavigation2 = (event) => {
|
|
31124
31156
|
return event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.button === 1;
|
|
@@ -31160,7 +31192,7 @@ var OpenOrderRow = ({
|
|
|
31160
31192
|
expirationHeader
|
|
31161
31193
|
}) => {
|
|
31162
31194
|
var _a, _b, _c, _d;
|
|
31163
|
-
const labels = (0,
|
|
31195
|
+
const labels = (0, import_hooks79.useLabels)().userProfile.openOrders;
|
|
31164
31196
|
const resolvedCancelLabel = cancelLabel != null ? cancelLabel : labels.cancel;
|
|
31165
31197
|
const resolvedCancelAriaLabel = cancelAriaLabel != null ? cancelAriaLabel : labels.cancelOrderAria(order.id);
|
|
31166
31198
|
const resolvedLimitPriceHeader = limitPriceHeader != null ? limitPriceHeader : labels.limitPriceHeader;
|
|
@@ -31214,7 +31246,7 @@ var OpenOrderRow = ({
|
|
|
31214
31246
|
/* @__PURE__ */ (0, import_jsx_runtime182.jsx)("div", { className: "agg-open-order-image flex h-10 w-10 shrink-0 items-center justify-center lg:h-15 lg:w-15", children: /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
|
|
31215
31247
|
RemoteImage,
|
|
31216
31248
|
{
|
|
31217
|
-
src: (0,
|
|
31249
|
+
src: (0, import_hooks79.optimizedImageUrl)(order.thumbnailSrc, 60),
|
|
31218
31250
|
alt: "",
|
|
31219
31251
|
className: "h-full w-full rounded-agg-sm object-cover"
|
|
31220
31252
|
}
|
|
@@ -31272,7 +31304,7 @@ var OpenOrderRow = ({
|
|
|
31272
31304
|
OpenOrderRow.displayName = "OpenOrderRow";
|
|
31273
31305
|
|
|
31274
31306
|
// src/pages/user-profile/components/position-row.tsx
|
|
31275
|
-
var
|
|
31307
|
+
var import_hooks80 = require("@agg-build/hooks");
|
|
31276
31308
|
var import_jsx_runtime183 = require("react/jsx-runtime");
|
|
31277
31309
|
var shouldUseNativeLinkNavigation3 = (event) => {
|
|
31278
31310
|
return event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.button === 1;
|
|
@@ -31410,8 +31442,8 @@ var PositionRow = ({
|
|
|
31410
31442
|
onClaim,
|
|
31411
31443
|
isClaiming = false
|
|
31412
31444
|
}) => {
|
|
31413
|
-
const labels = (0,
|
|
31414
|
-
const { formatCurrency: formatCurrency2, formatPrice } = (0,
|
|
31445
|
+
const labels = (0, import_hooks80.useLabels)().userProfile.positions;
|
|
31446
|
+
const { formatCurrency: formatCurrency2, formatPrice } = (0, import_hooks80.useAggUiConfig)().formatting;
|
|
31415
31447
|
const model = toPositionRowViewModel(
|
|
31416
31448
|
position,
|
|
31417
31449
|
{
|
|
@@ -31469,7 +31501,7 @@ var PositionRow = ({
|
|
|
31469
31501
|
/* @__PURE__ */ (0, import_jsx_runtime183.jsx)("div", { className: "agg-position-image flex h-10 w-10 shrink-0 items-center justify-center md:h-15 md:w-15", children: /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(
|
|
31470
31502
|
RemoteImage,
|
|
31471
31503
|
{
|
|
31472
|
-
src: (0,
|
|
31504
|
+
src: (0, import_hooks80.optimizedImageUrl)(model.thumbnailSrc, 60),
|
|
31473
31505
|
alt: "",
|
|
31474
31506
|
className: "h-full w-full rounded-agg-sm object-cover"
|
|
31475
31507
|
}
|
|
@@ -31638,10 +31670,10 @@ var PositionsActivity = ({
|
|
|
31638
31670
|
initialPositionFilter = "active",
|
|
31639
31671
|
className
|
|
31640
31672
|
}) => {
|
|
31641
|
-
const userProfileLabels = (0,
|
|
31673
|
+
const userProfileLabels = (0, import_hooks81.useLabels)().userProfile;
|
|
31642
31674
|
const positionsLabels = userProfileLabels.positions;
|
|
31643
31675
|
const openOrdersLabels = userProfileLabels.openOrders;
|
|
31644
|
-
const { formatCurrency: formatCurrency2, formatPrice } = (0,
|
|
31676
|
+
const { formatCurrency: formatCurrency2, formatPrice } = (0, import_hooks81.useAggUiConfig)().formatting;
|
|
31645
31677
|
const tabItems = (0, import_react50.useMemo)(
|
|
31646
31678
|
() => getTabItems(userProfileLabels.tabs, showOpenOrders),
|
|
31647
31679
|
[showOpenOrders, userProfileLabels.tabs]
|
|
@@ -31909,7 +31941,7 @@ var PositionsActivity = ({
|
|
|
31909
31941
|
/* @__PURE__ */ (0, import_jsx_runtime184.jsx)(
|
|
31910
31942
|
"img",
|
|
31911
31943
|
{
|
|
31912
|
-
src: (0,
|
|
31944
|
+
src: (0, import_hooks81.optimizedImageUrl)(item.thumbnailSrc, 48),
|
|
31913
31945
|
alt: "",
|
|
31914
31946
|
className: "size-12 shrink-0 rounded-agg-lg object-cover"
|
|
31915
31947
|
}
|
|
@@ -32272,7 +32304,7 @@ var buildAggTxExplorerHref = (chainId, txHash) => {
|
|
|
32272
32304
|
};
|
|
32273
32305
|
|
|
32274
32306
|
// src/pages/user-profile/components/user-info-card.tsx
|
|
32275
|
-
var
|
|
32307
|
+
var import_hooks82 = require("@agg-build/hooks");
|
|
32276
32308
|
|
|
32277
32309
|
// src/primitives/conditional-wrapper.tsx
|
|
32278
32310
|
var ConditionalWrapper = ({
|
|
@@ -32340,7 +32372,7 @@ var UserInfoCard = ({
|
|
|
32340
32372
|
className
|
|
32341
32373
|
}) => {
|
|
32342
32374
|
var _a;
|
|
32343
|
-
const labels = (0,
|
|
32375
|
+
const labels = (0, import_hooks82.useLabels)();
|
|
32344
32376
|
const wallets = (_a = user.connectedWallets) != null ? _a : [];
|
|
32345
32377
|
const hasWallets = wallets.length > 0;
|
|
32346
32378
|
return /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)(
|
|
@@ -32356,7 +32388,7 @@ var UserInfoCard = ({
|
|
|
32356
32388
|
/* @__PURE__ */ (0, import_jsx_runtime187.jsx)("div", { className: "agg-profile-avatar shrink-0", children: user.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
|
|
32357
32389
|
RemoteImage,
|
|
32358
32390
|
{
|
|
32359
|
-
src: (0,
|
|
32391
|
+
src: (0, import_hooks82.optimizedImageUrl)(user.avatarUrl, 120),
|
|
32360
32392
|
alt: user.username,
|
|
32361
32393
|
className: "h-20 w-20 rounded-full object-cover sm:h-[120px] sm:w-[120px]"
|
|
32362
32394
|
}
|
|
@@ -32989,15 +33021,15 @@ var UserProfilePage = ({
|
|
|
32989
33021
|
(0, import_react51.useEffect)(() => {
|
|
32990
33022
|
setIsHydrated(true);
|
|
32991
33023
|
}, []);
|
|
32992
|
-
const { user: currentUser, isAuthenticated } = (0,
|
|
32993
|
-
const { isDepositBlocked } = (0,
|
|
32994
|
-
const balanceState = (0,
|
|
32995
|
-
const labels = (0,
|
|
33024
|
+
const { user: currentUser, isAuthenticated } = (0, import_hooks83.useAggAuthState)();
|
|
33025
|
+
const { isDepositBlocked } = (0, import_hooks83.useGeoBlock)();
|
|
33026
|
+
const balanceState = (0, import_hooks83.useAggBalance)();
|
|
33027
|
+
const labels = (0, import_hooks83.useLabels)();
|
|
32996
33028
|
const {
|
|
32997
33029
|
features: { showLimitOrders }
|
|
32998
|
-
} = (0,
|
|
32999
|
-
const client = (0,
|
|
33000
|
-
const cancelOrderMutation = (0,
|
|
33030
|
+
} = (0, import_hooks83.useSdkUiConfig)();
|
|
33031
|
+
const client = (0, import_hooks83.useAggClient)();
|
|
33032
|
+
const cancelOrderMutation = (0, import_hooks83.useCancelManagedOrder)();
|
|
33001
33033
|
const toastContext = useOptionalToast();
|
|
33002
33034
|
const [internalCancellingIds, setInternalCancellingIds] = (0, import_react51.useState)({});
|
|
33003
33035
|
const { claim: startClaim, claimingKeys } = useClaimWinnings({
|
|
@@ -33018,7 +33050,7 @@ var UserProfilePage = ({
|
|
|
33018
33050
|
const [selectedClaimActivity, setSelectedClaimActivity] = (0, import_react51.useState)(null);
|
|
33019
33051
|
const [isManageBalancesOpen, setIsManageBalancesOpen] = (0, import_react51.useState)(false);
|
|
33020
33052
|
const manageBalancesButtonRef = (0, import_react51.useRef)(null);
|
|
33021
|
-
const { executionMode: resolvedExecutionMode, isPaperMode } = (0,
|
|
33053
|
+
const { executionMode: resolvedExecutionMode, isPaperMode } = (0, import_hooks83.useResolvedExecutionMode)(executionMode);
|
|
33022
33054
|
const queryExecutionMode = resolvedExecutionMode === "paper" ? "paper" : void 0;
|
|
33023
33055
|
const handleManageBalancesOpenChange = (0, import_react51.useCallback)((open) => {
|
|
33024
33056
|
setIsManageBalancesOpen(open);
|
|
@@ -33028,13 +33060,13 @@ var UserProfilePage = ({
|
|
|
33028
33060
|
return (_a2 = manageBalancesButtonRef.current) == null ? void 0 : _a2.focus();
|
|
33029
33061
|
});
|
|
33030
33062
|
}, []);
|
|
33031
|
-
const activePositionsQuery = (0,
|
|
33063
|
+
const activePositionsQuery = (0, import_hooks83.useExecutionPositions)({
|
|
33032
33064
|
enabled: shouldUseHookData && isAuthenticated,
|
|
33033
33065
|
status: "active",
|
|
33034
33066
|
limit: 25,
|
|
33035
33067
|
mode: queryExecutionMode
|
|
33036
33068
|
});
|
|
33037
|
-
const closedPositionsQuery = (0,
|
|
33069
|
+
const closedPositionsQuery = (0, import_hooks83.useExecutionPositions)({
|
|
33038
33070
|
enabled: shouldUseHookData && isAuthenticated,
|
|
33039
33071
|
status: "closed",
|
|
33040
33072
|
limit: 25,
|
|
@@ -33050,62 +33082,62 @@ var UserProfilePage = ({
|
|
|
33050
33082
|
(0, import_react51.useEffect)(() => {
|
|
33051
33083
|
setPositionFilter(initialPositionFilter);
|
|
33052
33084
|
}, [initialPositionFilter]);
|
|
33053
|
-
const ordersQuery = (0,
|
|
33085
|
+
const ordersQuery = (0, import_hooks83.useExecutionOrders)({
|
|
33054
33086
|
enabled: shouldUseHookData && isAuthenticated,
|
|
33055
33087
|
limit: 25,
|
|
33056
33088
|
mode: queryExecutionMode,
|
|
33057
33089
|
refetchIntervalMs: 5e3
|
|
33058
33090
|
});
|
|
33059
|
-
const pendingOpenOrdersQuery = (0,
|
|
33091
|
+
const pendingOpenOrdersQuery = (0, import_hooks83.useExecutionOrders)({
|
|
33060
33092
|
enabled: shouldUseHookData && isAuthenticated && !openOrders,
|
|
33061
33093
|
status: OPEN_ORDER_QUERY_STATUSES[0],
|
|
33062
33094
|
orderType: "limit",
|
|
33063
33095
|
limit: 25,
|
|
33064
33096
|
mode: queryExecutionMode
|
|
33065
33097
|
});
|
|
33066
|
-
const signingOpenOrdersQuery = (0,
|
|
33098
|
+
const signingOpenOrdersQuery = (0, import_hooks83.useExecutionOrders)({
|
|
33067
33099
|
enabled: shouldUseHookData && isAuthenticated && !openOrders,
|
|
33068
33100
|
status: OPEN_ORDER_QUERY_STATUSES[1],
|
|
33069
33101
|
orderType: "limit",
|
|
33070
33102
|
limit: 25,
|
|
33071
33103
|
mode: queryExecutionMode
|
|
33072
33104
|
});
|
|
33073
|
-
const pendingBridgeOpenOrdersQuery = (0,
|
|
33105
|
+
const pendingBridgeOpenOrdersQuery = (0, import_hooks83.useExecutionOrders)({
|
|
33074
33106
|
enabled: shouldUseHookData && isAuthenticated && !openOrders,
|
|
33075
33107
|
status: OPEN_ORDER_QUERY_STATUSES[2],
|
|
33076
33108
|
orderType: "limit",
|
|
33077
33109
|
limit: 25,
|
|
33078
33110
|
mode: queryExecutionMode
|
|
33079
33111
|
});
|
|
33080
|
-
const submittingOpenOrdersQuery = (0,
|
|
33112
|
+
const submittingOpenOrdersQuery = (0, import_hooks83.useExecutionOrders)({
|
|
33081
33113
|
enabled: shouldUseHookData && isAuthenticated && !openOrders,
|
|
33082
33114
|
status: OPEN_ORDER_QUERY_STATUSES[3],
|
|
33083
33115
|
orderType: "limit",
|
|
33084
33116
|
limit: 25,
|
|
33085
33117
|
mode: queryExecutionMode
|
|
33086
33118
|
});
|
|
33087
|
-
const submittedOpenOrdersQuery = (0,
|
|
33119
|
+
const submittedOpenOrdersQuery = (0, import_hooks83.useExecutionOrders)({
|
|
33088
33120
|
enabled: shouldUseHookData && isAuthenticated && !openOrders,
|
|
33089
33121
|
status: OPEN_ORDER_QUERY_STATUSES[4],
|
|
33090
33122
|
orderType: "limit",
|
|
33091
33123
|
limit: 25,
|
|
33092
33124
|
mode: queryExecutionMode
|
|
33093
33125
|
});
|
|
33094
|
-
const openOpenOrdersQuery = (0,
|
|
33126
|
+
const openOpenOrdersQuery = (0, import_hooks83.useExecutionOrders)({
|
|
33095
33127
|
enabled: shouldUseHookData && isAuthenticated && !openOrders,
|
|
33096
33128
|
status: OPEN_ORDER_QUERY_STATUSES[5],
|
|
33097
33129
|
orderType: "limit",
|
|
33098
33130
|
limit: 25,
|
|
33099
33131
|
mode: queryExecutionMode
|
|
33100
33132
|
});
|
|
33101
|
-
const partiallyFilledOpenOrdersQuery = (0,
|
|
33133
|
+
const partiallyFilledOpenOrdersQuery = (0, import_hooks83.useExecutionOrders)({
|
|
33102
33134
|
enabled: shouldUseHookData && isAuthenticated && !openOrders,
|
|
33103
33135
|
status: OPEN_ORDER_QUERY_STATUSES[6],
|
|
33104
33136
|
orderType: "limit",
|
|
33105
33137
|
limit: 25,
|
|
33106
33138
|
mode: queryExecutionMode
|
|
33107
33139
|
});
|
|
33108
|
-
const cancelPendingOpenOrdersQuery = (0,
|
|
33140
|
+
const cancelPendingOpenOrdersQuery = (0, import_hooks83.useExecutionOrders)({
|
|
33109
33141
|
enabled: shouldUseHookData && isAuthenticated && !openOrders,
|
|
33110
33142
|
status: OPEN_ORDER_QUERY_STATUSES[7],
|
|
33111
33143
|
orderType: "limit",
|
|
@@ -33134,7 +33166,7 @@ var UserProfilePage = ({
|
|
|
33134
33166
|
submittingOpenOrdersQuery
|
|
33135
33167
|
]
|
|
33136
33168
|
);
|
|
33137
|
-
const activityQuery = (0,
|
|
33169
|
+
const activityQuery = (0, import_hooks83.useUserActivity)({
|
|
33138
33170
|
enabled: shouldUseHookData && isAuthenticated,
|
|
33139
33171
|
limit: 25
|
|
33140
33172
|
});
|
|
@@ -33221,7 +33253,7 @@ var UserProfilePage = ({
|
|
|
33221
33253
|
var _a2, _b2, _c2, _d, _e, _f;
|
|
33222
33254
|
if (user) return user;
|
|
33223
33255
|
const fullUser = profileUser != null ? profileUser : currentUser;
|
|
33224
|
-
const walletAddress = (0,
|
|
33256
|
+
const walletAddress = (0, import_hooks83.getWalletAddressFromUserProfile)(fullUser);
|
|
33225
33257
|
const fallbackUsername = walletAddress && shortenAddress(walletAddress) || "username";
|
|
33226
33258
|
const twitterAccount = (_a2 = fullUser == null ? void 0 : fullUser.accounts) == null ? void 0 : _a2.find(
|
|
33227
33259
|
(account) => String(account.provider).toLowerCase() === "twitter"
|
|
@@ -33283,8 +33315,8 @@ var UserProfilePage = ({
|
|
|
33283
33315
|
},
|
|
33284
33316
|
[paperSummary == null ? void 0 : paperSummary.earnings]
|
|
33285
33317
|
);
|
|
33286
|
-
const { disabledVenues, isLoading: isAppConfigLoading } = (0,
|
|
33287
|
-
const isKalshiAvailable = (0,
|
|
33318
|
+
const { disabledVenues, isLoading: isAppConfigLoading } = (0, import_hooks83.useAppConfig)();
|
|
33319
|
+
const isKalshiAvailable = (0, import_hooks83.getVenueAvailabilityState)({
|
|
33288
33320
|
venueId: import_sdk29.Venue.kalshi,
|
|
33289
33321
|
disabledVenues,
|
|
33290
33322
|
isConfigLoading: isAppConfigLoading
|
|
@@ -33512,7 +33544,7 @@ var UserProfilePage = ({
|
|
|
33512
33544
|
(groups) => {
|
|
33513
33545
|
return groups.flatMap((group) => {
|
|
33514
33546
|
var _a2, _b2, _c2, _d;
|
|
33515
|
-
const closedTotals = (0,
|
|
33547
|
+
const closedTotals = (0, import_hooks83.computeClosedPositionTotals)(group);
|
|
33516
33548
|
const winningOutcome = group.venueMarket.venueMarketOutcomes.find(
|
|
33517
33549
|
(outcome) => outcome.winner === true
|
|
33518
33550
|
);
|