@agg-build/ui 4.18.0 → 4.18.2
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-ZNOAKSPT.mjs → chunk-47CCGQH6.mjs} +2 -2
- package/dist/{chunk-2OBJ7DYT.mjs → chunk-5YHKIJ23.mjs} +21 -10
- package/dist/{chunk-2UPO6G3S.mjs → chunk-DWPBGMVJ.mjs} +50 -6
- package/dist/{chunk-WSZYDOZN.mjs → chunk-DXASFSVL.mjs} +15 -2
- package/dist/{chunk-HFL3CEWG.mjs → chunk-NSQQ62QK.mjs} +4 -4
- package/dist/{chunk-FTWJRLJQ.mjs → chunk-RFMA5ABT.mjs} +5 -5
- package/dist/{chunk-NRPS2D3Q.mjs → chunk-ROA5K67W.mjs} +1 -1
- package/dist/{chunk-JJ3VVCEP.mjs → chunk-WOCZ4TVT.mjs} +12 -8
- package/dist/{chunk-WIGSRHUG.mjs → chunk-XZVGHKMW.mjs} +3 -2
- package/dist/{event-market-GX24AP2H.mjs → event-market-2BAMDM5I.mjs} +6 -6
- package/dist/events.js +72 -11
- package/dist/events.mjs +4 -4
- package/dist/index.js +90 -18
- package/dist/index.mjs +9 -9
- package/dist/modals.js +3 -2
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +90 -18
- package/dist/pages.mjs +8 -8
- package/dist/primitives.js +3 -2
- package/dist/primitives.mjs +1 -1
- package/dist/trading.js +21 -9
- package/dist/trading.mjs +4 -4
- package/dist/types/primitives/remote-image/index.d.mts +1 -1
- package/dist/types/primitives/remote-image/index.d.ts +1 -1
- package/dist/types/primitives/remote-image/remote-image.types.d.mts +6 -0
- package/dist/types/primitives/remote-image/remote-image.types.d.ts +6 -0
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ConnectKalshiModal,
|
|
4
4
|
dispatchAggDepositNotification
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ROA5K67W.mjs";
|
|
6
6
|
import {
|
|
7
7
|
BoltIcon,
|
|
8
8
|
Button,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
shortenAddress,
|
|
37
37
|
useOptionalToast,
|
|
38
38
|
venueLogoLabels
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-XZVGHKMW.mjs";
|
|
40
40
|
|
|
41
41
|
// src/deposit/index.tsx
|
|
42
42
|
import { useAggAuthState, useAggUiConfig, useDepositAddresses, useLabels as useLabels11 } from "@agg-build/hooks";
|
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
getTradingVenueLabel,
|
|
10
10
|
prepareSettlementDifferences,
|
|
11
11
|
resolveOrderEligibilityMessage
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WOCZ4TVT.mjs";
|
|
13
13
|
import {
|
|
14
14
|
ConnectKalshiModal,
|
|
15
15
|
ConnectProphetxModal,
|
|
16
16
|
GeoBlockBanner,
|
|
17
17
|
SharedKycModal,
|
|
18
18
|
subscribeAggDepositNotification
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-ROA5K67W.mjs";
|
|
20
20
|
import {
|
|
21
21
|
AGG_TERMS_OF_SERVICE_URL,
|
|
22
22
|
Button,
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
resolveResolvedOutcomeLabel,
|
|
61
61
|
skeletonViews,
|
|
62
62
|
useOptionalToast
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-XZVGHKMW.mjs";
|
|
64
64
|
|
|
65
65
|
// src/trading/types.ts
|
|
66
66
|
import { Venue, enumGuard, isFiniteNonNeg, safeParse } from "@agg-build/sdk";
|
|
@@ -1983,7 +1983,7 @@ var resolvePlaceOrderQuoteStatus = ({
|
|
|
1983
1983
|
selectedMarket,
|
|
1984
1984
|
tradeSide = "buy"
|
|
1985
1985
|
}) => {
|
|
1986
|
-
var _a, _b, _c, _d, _e;
|
|
1986
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1987
1987
|
if (!selectedMarket) {
|
|
1988
1988
|
return {
|
|
1989
1989
|
tone: "warning",
|
|
@@ -2003,7 +2003,15 @@ var resolvePlaceOrderQuoteStatus = ({
|
|
|
2003
2003
|
};
|
|
2004
2004
|
}
|
|
2005
2005
|
if (quoteData.status === "no_orderbooks") {
|
|
2006
|
-
const
|
|
2006
|
+
const warnings = (_a = quoteData.warnings) != null ? _a : [];
|
|
2007
|
+
if (warnings.length > 0 && warnings.every((warning) => warning.reason === "hosted_cash_unavailable")) {
|
|
2008
|
+
return {
|
|
2009
|
+
tone: "warning",
|
|
2010
|
+
message: labels.betdexBalanceUnavailable,
|
|
2011
|
+
placement: "above-action"
|
|
2012
|
+
};
|
|
2013
|
+
}
|
|
2014
|
+
const serverError = (_b = quoteData.error) == null ? void 0 : _b.trim();
|
|
2007
2015
|
return {
|
|
2008
2016
|
tone: "error",
|
|
2009
2017
|
message: serverError || labels.noOrderbooks,
|
|
@@ -2020,24 +2028,24 @@ var resolvePlaceOrderQuoteStatus = ({
|
|
|
2020
2028
|
if (quoteData.status === "insufficient_input_amount") {
|
|
2021
2029
|
return {
|
|
2022
2030
|
tone: "error",
|
|
2023
|
-
message: (
|
|
2031
|
+
message: (_c = quoteData.message) != null ? _c : labels.insufficientInputAmount,
|
|
2024
2032
|
placement: "above-action"
|
|
2025
2033
|
};
|
|
2026
2034
|
}
|
|
2027
2035
|
if (quoteData.status === "invalid_input") {
|
|
2028
2036
|
return {
|
|
2029
2037
|
tone: "error",
|
|
2030
|
-
message: (
|
|
2038
|
+
message: (_d = quoteData.message) != null ? _d : labels.quoteUnavailable,
|
|
2031
2039
|
placement: "above-action"
|
|
2032
2040
|
};
|
|
2033
2041
|
}
|
|
2034
2042
|
if (quoteData.status === "insufficient_position") {
|
|
2035
|
-
const total = (
|
|
2043
|
+
const total = (_e = quoteData.positionAvailability) == null ? void 0 : _e.totalSellableShares;
|
|
2036
2044
|
const message = total != null ? labels.insufficientPosition(total) : labels.insufficientPositionGeneric;
|
|
2037
2045
|
return { tone: "error", message, placement: "above-action" };
|
|
2038
2046
|
}
|
|
2039
2047
|
if (quoteData.status === "insufficient_depth") {
|
|
2040
|
-
const serverError = (
|
|
2048
|
+
const serverError = (_f = quoteData.error) == null ? void 0 : _f.trim();
|
|
2041
2049
|
return {
|
|
2042
2050
|
tone: "error",
|
|
2043
2051
|
message: tradeSide === "sell" ? serverError || labels.insufficientSellDepth : serverError || labels.insufficientLiquidity,
|
|
@@ -4625,6 +4633,7 @@ var renderCardHeader = ({
|
|
|
4625
4633
|
headerSubtitle,
|
|
4626
4634
|
headerImage,
|
|
4627
4635
|
headerTitle,
|
|
4636
|
+
headerVenue,
|
|
4628
4637
|
onClose
|
|
4629
4638
|
}) => {
|
|
4630
4639
|
if (!headerTitle) return null;
|
|
@@ -4635,6 +4644,7 @@ var renderCardHeader = ({
|
|
|
4635
4644
|
{
|
|
4636
4645
|
src: headerImage,
|
|
4637
4646
|
alt: "",
|
|
4647
|
+
fallback: headerVenue ? /* @__PURE__ */ jsx11(VenueLogo, { venue: headerVenue, size: "large" }) : void 0,
|
|
4638
4648
|
className: "agg-order-market-image h-12 w-12 shrink-0 overflow-hidden rounded-agg-lg object-cover"
|
|
4639
4649
|
}
|
|
4640
4650
|
),
|
|
@@ -4961,7 +4971,7 @@ var PlaceOrder = ({
|
|
|
4961
4971
|
showResolvingState = false,
|
|
4962
4972
|
midpointsResult
|
|
4963
4973
|
}) => {
|
|
4964
|
-
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, _ea, _fa, _ga, _ha;
|
|
4974
|
+
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, _ea, _fa, _ga, _ha, _ia;
|
|
4965
4975
|
const {
|
|
4966
4976
|
enableDebug: isExecutionDebugEnabled,
|
|
4967
4977
|
features: { enableAnimations, showFeesBreakdown, showLimitOrders: limitOrdersFeature },
|
|
@@ -7247,6 +7257,7 @@ var PlaceOrder = ({
|
|
|
7247
7257
|
headerSubtitle,
|
|
7248
7258
|
headerImage,
|
|
7249
7259
|
headerTitle,
|
|
7260
|
+
headerVenue: (_ia = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) != null ? _ia : scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.venue,
|
|
7250
7261
|
onClose
|
|
7251
7262
|
}),
|
|
7252
7263
|
/* @__PURE__ */ jsxs11("div", { className: cn("agg-order-panel-content flex flex-col gap-6", classNames == null ? void 0 : classNames.content), children: [
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
resolveUnifiedOrderBookEntries,
|
|
24
24
|
sortOutcomeSelectorOutcomes,
|
|
25
25
|
useEventTradingContext
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-WOCZ4TVT.mjs";
|
|
27
27
|
import {
|
|
28
28
|
AutocompleteSelect,
|
|
29
29
|
Badge,
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
resolveResolvedOutcomeLabel,
|
|
64
64
|
resolveYesOutcome,
|
|
65
65
|
sortOutcomes
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-XZVGHKMW.mjs";
|
|
67
67
|
|
|
68
68
|
// src/shared/query-error.ts
|
|
69
69
|
var getErrorStatus = (error) => {
|
|
@@ -803,6 +803,7 @@ import {
|
|
|
803
803
|
useLiveBestPrices,
|
|
804
804
|
useLiveOutcomePrices,
|
|
805
805
|
useMarketChart,
|
|
806
|
+
useMarketOrderbook as useMarketOrderbook2,
|
|
806
807
|
useRollingChartWindow as useRollingChartWindow2,
|
|
807
808
|
useSdkUiConfig as useSdkUiConfig4,
|
|
808
809
|
useVenueEvent
|
|
@@ -2461,6 +2462,20 @@ var EventListItemDetailsContent = ({
|
|
|
2461
2462
|
resolvedEventTradingState.isTradingDisabled ? [] : resolvedEventTradingState.displayMarkets,
|
|
2462
2463
|
scopedSelectedMarketId
|
|
2463
2464
|
);
|
|
2465
|
+
const selectedBetdexOutcomes = useMemo6(
|
|
2466
|
+
() => eventDetailVenueMarkets.filter((market) => market.venue === "betdex").flatMap(
|
|
2467
|
+
(market) => market.venueMarketOutcomes.map((outcome) => ({
|
|
2468
|
+
venue: market.venue,
|
|
2469
|
+
venueMarketOutcomeId: outcome.id
|
|
2470
|
+
}))
|
|
2471
|
+
),
|
|
2472
|
+
[eventDetailVenueMarkets]
|
|
2473
|
+
);
|
|
2474
|
+
useMarketOrderbook2({
|
|
2475
|
+
venueOutcomes: selectedBetdexOutcomes,
|
|
2476
|
+
enabled: !resolvedEventTradingState.isTradingDisabled && selectedBetdexOutcomes.length > 0,
|
|
2477
|
+
live: false
|
|
2478
|
+
});
|
|
2464
2479
|
const wsLivePrices = useLiveOutcomePrices(eventDetailVenueMarkets);
|
|
2465
2480
|
const wsBestPrices = useLiveBestPrices(eventDetailVenueMarkets);
|
|
2466
2481
|
const resolvedMidpointsResult = midpointsResult != null ? midpointsResult : {
|
|
@@ -2598,6 +2613,7 @@ var EventListItemDetailsContent = ({
|
|
|
2598
2613
|
src: optimizedImageUrl(event.image, 60),
|
|
2599
2614
|
retinaSrc: retinaImageUrl(event.image, 60),
|
|
2600
2615
|
alt: "",
|
|
2616
|
+
fallback: event.venue ? /* @__PURE__ */ jsx7(VenueLogo, { venue: event.venue, size: "large" }) : void 0,
|
|
2601
2617
|
className: "agg-event-image size-10 rounded-agg-lg object-cover md:size-[60px]"
|
|
2602
2618
|
}
|
|
2603
2619
|
),
|
|
@@ -2749,7 +2765,7 @@ var EventListItemDetailsContent = ({
|
|
|
2749
2765
|
selectedOutcomeId: (tradingContext == null ? void 0 : tradingContext.selectedEventId) === event.id ? tradingContext.selectedOutcomeId : (_f = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venueMarketOutcomes[0]) == null ? void 0 : _f.id,
|
|
2750
2766
|
eventEndDate: event.endDate,
|
|
2751
2767
|
contractWindow,
|
|
2752
|
-
range: config.chart.selectedChartTimeRange,
|
|
2768
|
+
range: chartRangeOverride != null ? chartRangeOverride : config.chart.selectedChartTimeRange,
|
|
2753
2769
|
live: !resolvedEventTradingState.isTradingDisabled && config.features.enableLiveUpdates
|
|
2754
2770
|
},
|
|
2755
2771
|
event.id
|
|
@@ -2799,7 +2815,7 @@ var EventListItemDetailsContent = ({
|
|
|
2799
2815
|
) : null,
|
|
2800
2816
|
!contractWindow ? /* @__PURE__ */ jsx7("span", { "aria-hidden": "true", className: "hidden h-4 w-px bg-agg-separator md:block" }) : null,
|
|
2801
2817
|
!contractWindow && CHART_TIME_RANGES.map((timeRange) => {
|
|
2802
|
-
const effectiveRange =
|
|
2818
|
+
const effectiveRange = chartRangeOverride != null ? chartRangeOverride : config.chart.selectedChartTimeRange;
|
|
2803
2819
|
const isActive = timeRange === effectiveRange;
|
|
2804
2820
|
return /* @__PURE__ */ jsx7(
|
|
2805
2821
|
Button,
|
|
@@ -3419,7 +3435,7 @@ import {
|
|
|
3419
3435
|
useLiveBestPrices as useLiveBestPrices2,
|
|
3420
3436
|
useLiveBestPriceCandidates,
|
|
3421
3437
|
useLiveOutcomePrices as useLiveOutcomePrices2,
|
|
3422
|
-
useMarketOrderbook as
|
|
3438
|
+
useMarketOrderbook as useMarketOrderbook3,
|
|
3423
3439
|
useMidpoints,
|
|
3424
3440
|
useSdkUiConfig as useSdkUiConfig6,
|
|
3425
3441
|
useVenueMarkets,
|
|
@@ -4180,6 +4196,13 @@ var MarketDetailsContent = ({
|
|
|
4180
4196
|
labels
|
|
4181
4197
|
});
|
|
4182
4198
|
}, [config.formatting.formatCompactCurrency, venueMarkets, image, labels, marketId, title]);
|
|
4199
|
+
const primaryVenue = useMemo9(
|
|
4200
|
+
() => {
|
|
4201
|
+
var _a2, _b2;
|
|
4202
|
+
return (_b2 = (_a2 = venueMarkets.find((venueMarket) => venueMarket.id === marketId)) != null ? _a2 : venueMarkets[0]) == null ? void 0 : _b2.venue;
|
|
4203
|
+
},
|
|
4204
|
+
[venueMarkets, marketId]
|
|
4205
|
+
);
|
|
4183
4206
|
const livePrices = useMemo9(() => {
|
|
4184
4207
|
const merged = /* @__PURE__ */ new Map();
|
|
4185
4208
|
if (midpointsFallback == null ? void 0 : midpointsFallback.size) {
|
|
@@ -4386,12 +4409,32 @@ var MarketDetailsContent = ({
|
|
|
4386
4409
|
});
|
|
4387
4410
|
}, [model, selectedOutcomeLabel, selectedOutcomeId]);
|
|
4388
4411
|
const orderBookEnabled = isOpened && effectiveSelectedTab === "order-book" && !marketTradingState.isTradingDisabled;
|
|
4412
|
+
const betdexSeedOutcomes = useMemo9(
|
|
4413
|
+
() => {
|
|
4414
|
+
var _a2;
|
|
4415
|
+
return ((_a2 = model == null ? void 0 : model.market.venueMarkets) != null ? _a2 : []).filter((venueMarket) => venueMarket.venue === "betdex").flatMap(
|
|
4416
|
+
(venueMarket) => {
|
|
4417
|
+
var _a3;
|
|
4418
|
+
return ((_a3 = venueMarket.venueMarketOutcomes) != null ? _a3 : []).map((outcome) => ({
|
|
4419
|
+
venue: venueMarket.venue,
|
|
4420
|
+
venueMarketOutcomeId: outcome.id
|
|
4421
|
+
}));
|
|
4422
|
+
}
|
|
4423
|
+
);
|
|
4424
|
+
},
|
|
4425
|
+
[model]
|
|
4426
|
+
);
|
|
4427
|
+
useMarketOrderbook3({
|
|
4428
|
+
venueOutcomes: betdexSeedOutcomes,
|
|
4429
|
+
enabled: !orderBookEnabled && !marketTradingState.isTradingDisabled && betdexSeedOutcomes.length > 0,
|
|
4430
|
+
live: false
|
|
4431
|
+
});
|
|
4389
4432
|
const selectedVenueOutcome = selectedOutcomesByVenue.find(
|
|
4390
4433
|
(item) => item.outcomeId === selectedOutcomeId
|
|
4391
4434
|
);
|
|
4392
4435
|
const orderbookOutcomeLabel = (selectedVenueOutcome == null ? void 0 : selectedVenueOutcome.venue) === "betdex" ? ((_f = selectedVenueOutcome.outcome.title) == null ? void 0 : _f.trim()) || selectedOutcomeLabel : selectedOutcomeLabel;
|
|
4393
4436
|
const primaryOutcomeId = (_h = (_g = selectedOutcomesByVenue[0]) == null ? void 0 : _g.outcome.id) != null ? _h : null;
|
|
4394
|
-
const marketOrderbookResult =
|
|
4437
|
+
const marketOrderbookResult = useMarketOrderbook3({
|
|
4395
4438
|
venueMarketOutcomeId: primaryOutcomeId,
|
|
4396
4439
|
enabled: orderBookEnabled && !!primaryOutcomeId,
|
|
4397
4440
|
venueOutcomes: selectedOutcomesByVenue.map((item) => ({
|
|
@@ -4580,6 +4623,7 @@ var MarketDetailsContent = ({
|
|
|
4580
4623
|
src: optimizedImageUrl2(model.image, 60),
|
|
4581
4624
|
retinaSrc: retinaImageUrl2(model.image, 60),
|
|
4582
4625
|
alt: "",
|
|
4626
|
+
fallback: primaryVenue ? /* @__PURE__ */ jsx12(VenueLogo, { venue: primaryVenue, size: "large" }) : void 0,
|
|
4583
4627
|
className: "agg-market-image size-12 rounded-agg-lg object-cover md:size-[60px]"
|
|
4584
4628
|
}
|
|
4585
4629
|
) : null,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
isErrorWithStatus
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DWPBGMVJ.mjs";
|
|
5
5
|
import {
|
|
6
6
|
Badge,
|
|
7
7
|
Card,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
sortOutcomes,
|
|
41
41
|
splitEventsByLifecycle,
|
|
42
42
|
validateSubcategoryPath
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-XZVGHKMW.mjs";
|
|
44
44
|
|
|
45
45
|
// src/events/item/index.tsx
|
|
46
46
|
import {
|
|
@@ -747,6 +747,7 @@ var EventListItemContent = ({
|
|
|
747
747
|
src: optimizedImageUrl(resolvedImage, 40),
|
|
748
748
|
retinaSrc: retinaImageUrl(resolvedImage, 40),
|
|
749
749
|
alt: "",
|
|
750
|
+
fallback: event.venue ? /* @__PURE__ */ jsx(VenueLogo, { venue: event.venue, size: "medium" }) : void 0,
|
|
750
751
|
classNames: {
|
|
751
752
|
root: "agg-event-image h-10 w-10 shrink-0 rounded-agg-lg object-cover",
|
|
752
753
|
image: "transition-transform duration-300 group-hover/agg-event-card:scale-110"
|
|
@@ -1239,6 +1240,18 @@ var getDefaultEventListTabs = (labels) => {
|
|
|
1239
1240
|
venueLogo: Venue.prophetx,
|
|
1240
1241
|
venues: [Venue.prophetx]
|
|
1241
1242
|
},
|
|
1243
|
+
{
|
|
1244
|
+
value: Venue.tiprun,
|
|
1245
|
+
label: labels.venues.tiprun,
|
|
1246
|
+
venueLogo: Venue.tiprun,
|
|
1247
|
+
venues: [Venue.tiprun]
|
|
1248
|
+
},
|
|
1249
|
+
{
|
|
1250
|
+
value: Venue.betdex,
|
|
1251
|
+
label: labels.venues.betdex,
|
|
1252
|
+
venueLogo: Venue.betdex,
|
|
1253
|
+
venues: [Venue.betdex]
|
|
1254
|
+
},
|
|
1242
1255
|
{
|
|
1243
1256
|
value: Venue.opinion,
|
|
1244
1257
|
label: labels.venues.opinion,
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
MarketDetails,
|
|
5
5
|
MarketDetailsList,
|
|
6
6
|
isErrorWithStatus
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DWPBGMVJ.mjs";
|
|
8
8
|
import {
|
|
9
9
|
PlaceOrder,
|
|
10
10
|
SettlementDetails,
|
|
11
11
|
useResolvedMarketClaim
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-5YHKIJ23.mjs";
|
|
13
13
|
import {
|
|
14
14
|
getDisplayOutcomePrice,
|
|
15
15
|
resolveHeaderOutcomeItems,
|
|
16
16
|
resolveMarketFromVenueMarkets
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-WOCZ4TVT.mjs";
|
|
18
18
|
import {
|
|
19
19
|
AggErrorBoundary,
|
|
20
20
|
Button,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
normalizeVenueMarketCluster,
|
|
39
39
|
skeletonViews,
|
|
40
40
|
useOptionalToast
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-XZVGHKMW.mjs";
|
|
42
42
|
|
|
43
43
|
// src/pages/event-market/index.tsx
|
|
44
44
|
import {
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
EventListTabs,
|
|
9
9
|
useEventListTabs,
|
|
10
10
|
useEventListTabsHeaderOverflow
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-DXASFSVL.mjs";
|
|
12
12
|
import {
|
|
13
13
|
OPEN_ORDER_FALLBACK_THUMBNAIL_SRC,
|
|
14
14
|
OPEN_ORDER_QUERY_STATUSES,
|
|
@@ -21,14 +21,14 @@ import {
|
|
|
21
21
|
parseRawMicroValue,
|
|
22
22
|
selectOpenLimitOrders,
|
|
23
23
|
useOpenOrderCancellation
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-NSQQ62QK.mjs";
|
|
25
25
|
import {
|
|
26
26
|
BetdexAccountCard,
|
|
27
27
|
DEPOSIT_MODAL_OPEN_EVENT,
|
|
28
28
|
WITHDRAW_MODAL_OPEN_EVENT,
|
|
29
29
|
formatChainIdLabel,
|
|
30
30
|
useClaimWinnings
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-5YHKIJ23.mjs";
|
|
32
32
|
import {
|
|
33
33
|
AggErrorBoundary,
|
|
34
34
|
Button,
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
skeletonViews,
|
|
60
60
|
sortCategoriesForNavigation,
|
|
61
61
|
useOptionalToast
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-XZVGHKMW.mjs";
|
|
63
63
|
|
|
64
64
|
// src/pages/home/index.tsx
|
|
65
65
|
import {
|
|
@@ -267,7 +267,7 @@ var useHomePageModals = () => {
|
|
|
267
267
|
// src/pages/home/index.tsx
|
|
268
268
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
269
269
|
var DeferredEventMarketPage = lazy(
|
|
270
|
-
() => import("./event-market-
|
|
270
|
+
() => import("./event-market-2BAMDM5I.mjs").then((module) => ({ default: module.EventMarketPage }))
|
|
271
271
|
);
|
|
272
272
|
var MIN_SEARCH_LENGTH = 3;
|
|
273
273
|
var SEARCH_DEBOUNCE_MS = 300;
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
selectPrimaryVenueMarket,
|
|
20
20
|
skeletonViews,
|
|
21
21
|
sortOutcomes
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-XZVGHKMW.mjs";
|
|
23
23
|
|
|
24
24
|
// src/trading/trading-context/index.tsx
|
|
25
25
|
import { useEventTradingContext } from "@agg-build/hooks";
|
|
@@ -855,13 +855,17 @@ var resolveInitialEventDetailsChartRange = ({
|
|
|
855
855
|
nowSec = dayjs2().unix(),
|
|
856
856
|
selectedMarket
|
|
857
857
|
}) => {
|
|
858
|
-
var _a
|
|
858
|
+
var _a;
|
|
859
859
|
const scopedMarkets = selectedMarket ? [selectedMarket] : event.venueMarkets;
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
860
|
+
const resolveHistoryStart = (startDate, creationDate) => {
|
|
861
|
+
const start = toUnixTimestamp(startDate);
|
|
862
|
+
if (start != null && start <= nowSec) return start;
|
|
863
|
+
const created = toUnixTimestamp(creationDate);
|
|
864
|
+
if (created != null && created <= nowSec) return created;
|
|
865
|
+
return null;
|
|
866
|
+
};
|
|
867
|
+
const preferredEventStart = resolveHistoryStart(event.startDate, event.creationDate);
|
|
868
|
+
const marketStartCandidates = scopedMarkets.map((market) => resolveHistoryStart(market.startDate, market.creationDate)).filter((value) => value != null);
|
|
865
869
|
const metadataStarts = [preferredEventStart, ...marketStartCandidates].filter(
|
|
866
870
|
(value) => value != null
|
|
867
871
|
);
|
|
@@ -899,7 +903,7 @@ var resolveInitialEventDetailsChartRange = ({
|
|
|
899
903
|
const matchingRange = CHART_RANGE_PRIORITY.find((range) => {
|
|
900
904
|
return RANGE_SECONDS_BY_TIME_RANGE[range] >= requiredSeconds;
|
|
901
905
|
});
|
|
902
|
-
return (
|
|
906
|
+
return (_a = matchingRange != null ? matchingRange : fallbackRange) != null ? _a : "ALL";
|
|
903
907
|
};
|
|
904
908
|
var matchOutcomeByLabel = (outcome, selectedOutcomeLabel) => {
|
|
905
909
|
const normalizedSelectedLabel = normalizeLabel(selectedOutcomeLabel);
|
|
@@ -6218,7 +6218,8 @@ var RemoteImage = ({
|
|
|
6218
6218
|
width,
|
|
6219
6219
|
height,
|
|
6220
6220
|
onClick,
|
|
6221
|
-
ariaLabel
|
|
6221
|
+
ariaLabel,
|
|
6222
|
+
fallback
|
|
6222
6223
|
}) => {
|
|
6223
6224
|
const {
|
|
6224
6225
|
general: { theme }
|
|
@@ -6275,7 +6276,7 @@ var RemoteImage = ({
|
|
|
6275
6276
|
className: cn(placeholderClasses, classNames == null ? void 0 : classNames.placeholder),
|
|
6276
6277
|
"aria-hidden": true,
|
|
6277
6278
|
"aria-errormessage": "Image failed to load",
|
|
6278
|
-
children: /* @__PURE__ */ jsx109(
|
|
6279
|
+
children: fallback != null ? fallback : /* @__PURE__ */ jsx109(
|
|
6279
6280
|
Icon,
|
|
6280
6281
|
{
|
|
6281
6282
|
name: "image",
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
EventOpenOrdersCard,
|
|
7
7
|
formatRecurringCountdown,
|
|
8
8
|
useEventOpenOrders
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-NSQQ62QK.mjs";
|
|
10
|
+
import "./chunk-DWPBGMVJ.mjs";
|
|
11
|
+
import "./chunk-5YHKIJ23.mjs";
|
|
12
|
+
import "./chunk-WOCZ4TVT.mjs";
|
|
13
|
+
import "./chunk-ROA5K67W.mjs";
|
|
14
|
+
import "./chunk-XZVGHKMW.mjs";
|
|
15
15
|
export {
|
|
16
16
|
EventMarketPage,
|
|
17
17
|
EventOpenOrders,
|
package/dist/events.js
CHANGED
|
@@ -5073,7 +5073,8 @@ var RemoteImage = ({
|
|
|
5073
5073
|
width,
|
|
5074
5074
|
height,
|
|
5075
5075
|
onClick,
|
|
5076
|
-
ariaLabel
|
|
5076
|
+
ariaLabel,
|
|
5077
|
+
fallback
|
|
5077
5078
|
}) => {
|
|
5078
5079
|
const {
|
|
5079
5080
|
general: { theme }
|
|
@@ -5130,7 +5131,7 @@ var RemoteImage = ({
|
|
|
5130
5131
|
className: cn(placeholderClasses, classNames == null ? void 0 : classNames.placeholder),
|
|
5131
5132
|
"aria-hidden": true,
|
|
5132
5133
|
"aria-errormessage": "Image failed to load",
|
|
5133
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
5134
|
+
children: fallback != null ? fallback : /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
5134
5135
|
Icon,
|
|
5135
5136
|
{
|
|
5136
5137
|
name: "image",
|
|
@@ -9530,6 +9531,7 @@ var EventListItemContent = ({
|
|
|
9530
9531
|
src: (0, import_hooks36.optimizedImageUrl)(resolvedImage, 40),
|
|
9531
9532
|
retinaSrc: (0, import_hooks36.retinaImageUrl)(resolvedImage, 40),
|
|
9532
9533
|
alt: "",
|
|
9534
|
+
fallback: event.venue ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(VenueLogo, { venue: event.venue, size: "medium" }) : void 0,
|
|
9533
9535
|
classNames: {
|
|
9534
9536
|
root: "agg-event-image h-10 w-10 shrink-0 rounded-agg-lg object-cover",
|
|
9535
9537
|
image: "transition-transform duration-300 group-hover/agg-event-card:scale-110"
|
|
@@ -10006,13 +10008,17 @@ var resolveInitialEventDetailsChartRange = ({
|
|
|
10006
10008
|
nowSec = (0, import_dayjs3.default)().unix(),
|
|
10007
10009
|
selectedMarket
|
|
10008
10010
|
}) => {
|
|
10009
|
-
var _a
|
|
10011
|
+
var _a;
|
|
10010
10012
|
const scopedMarkets = selectedMarket ? [selectedMarket] : event.venueMarkets;
|
|
10011
|
-
const
|
|
10012
|
-
|
|
10013
|
-
|
|
10014
|
-
|
|
10015
|
-
|
|
10013
|
+
const resolveHistoryStart = (startDate, creationDate) => {
|
|
10014
|
+
const start = toUnixTimestamp(startDate);
|
|
10015
|
+
if (start != null && start <= nowSec) return start;
|
|
10016
|
+
const created = toUnixTimestamp(creationDate);
|
|
10017
|
+
if (created != null && created <= nowSec) return created;
|
|
10018
|
+
return null;
|
|
10019
|
+
};
|
|
10020
|
+
const preferredEventStart = resolveHistoryStart(event.startDate, event.creationDate);
|
|
10021
|
+
const marketStartCandidates = scopedMarkets.map((market) => resolveHistoryStart(market.startDate, market.creationDate)).filter((value) => value != null);
|
|
10016
10022
|
const metadataStarts = [preferredEventStart, ...marketStartCandidates].filter(
|
|
10017
10023
|
(value) => value != null
|
|
10018
10024
|
);
|
|
@@ -10050,7 +10056,7 @@ var resolveInitialEventDetailsChartRange = ({
|
|
|
10050
10056
|
const matchingRange = CHART_RANGE_PRIORITY.find((range) => {
|
|
10051
10057
|
return RANGE_SECONDS_BY_TIME_RANGE[range] >= requiredSeconds;
|
|
10052
10058
|
});
|
|
10053
|
-
return (
|
|
10059
|
+
return (_a = matchingRange != null ? matchingRange : fallbackRange) != null ? _a : "ALL";
|
|
10054
10060
|
};
|
|
10055
10061
|
var matchOutcomeByLabel = (outcome, selectedOutcomeLabel) => {
|
|
10056
10062
|
const normalizedSelectedLabel = normalizeLabel(selectedOutcomeLabel);
|
|
@@ -13597,6 +13603,20 @@ var EventListItemDetailsContent = ({
|
|
|
13597
13603
|
resolvedEventTradingState.isTradingDisabled ? [] : resolvedEventTradingState.displayMarkets,
|
|
13598
13604
|
scopedSelectedMarketId
|
|
13599
13605
|
);
|
|
13606
|
+
const selectedBetdexOutcomes = (0, import_react23.useMemo)(
|
|
13607
|
+
() => eventDetailVenueMarkets.filter((market) => market.venue === "betdex").flatMap(
|
|
13608
|
+
(market) => market.venueMarketOutcomes.map((outcome) => ({
|
|
13609
|
+
venue: market.venue,
|
|
13610
|
+
venueMarketOutcomeId: outcome.id
|
|
13611
|
+
}))
|
|
13612
|
+
),
|
|
13613
|
+
[eventDetailVenueMarkets]
|
|
13614
|
+
);
|
|
13615
|
+
(0, import_hooks51.useMarketOrderbook)({
|
|
13616
|
+
venueOutcomes: selectedBetdexOutcomes,
|
|
13617
|
+
enabled: !resolvedEventTradingState.isTradingDisabled && selectedBetdexOutcomes.length > 0,
|
|
13618
|
+
live: false
|
|
13619
|
+
});
|
|
13600
13620
|
const wsLivePrices = (0, import_hooks51.useLiveOutcomePrices)(eventDetailVenueMarkets);
|
|
13601
13621
|
const wsBestPrices = (0, import_hooks51.useLiveBestPrices)(eventDetailVenueMarkets);
|
|
13602
13622
|
const resolvedMidpointsResult = midpointsResult != null ? midpointsResult : {
|
|
@@ -13734,6 +13754,7 @@ var EventListItemDetailsContent = ({
|
|
|
13734
13754
|
src: (0, import_hooks51.optimizedImageUrl)(event.image, 60),
|
|
13735
13755
|
retinaSrc: (0, import_hooks51.retinaImageUrl)(event.image, 60),
|
|
13736
13756
|
alt: "",
|
|
13757
|
+
fallback: event.venue ? /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(VenueLogo, { venue: event.venue, size: "large" }) : void 0,
|
|
13737
13758
|
className: "agg-event-image size-10 rounded-agg-lg object-cover md:size-[60px]"
|
|
13738
13759
|
}
|
|
13739
13760
|
),
|
|
@@ -13885,7 +13906,7 @@ var EventListItemDetailsContent = ({
|
|
|
13885
13906
|
selectedOutcomeId: (tradingContext == null ? void 0 : tradingContext.selectedEventId) === event.id ? tradingContext.selectedOutcomeId : (_f = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venueMarketOutcomes[0]) == null ? void 0 : _f.id,
|
|
13886
13907
|
eventEndDate: event.endDate,
|
|
13887
13908
|
contractWindow,
|
|
13888
|
-
range: config.chart.selectedChartTimeRange,
|
|
13909
|
+
range: chartRangeOverride != null ? chartRangeOverride : config.chart.selectedChartTimeRange,
|
|
13889
13910
|
live: !resolvedEventTradingState.isTradingDisabled && config.features.enableLiveUpdates
|
|
13890
13911
|
},
|
|
13891
13912
|
event.id
|
|
@@ -13935,7 +13956,7 @@ var EventListItemDetailsContent = ({
|
|
|
13935
13956
|
) : null,
|
|
13936
13957
|
!contractWindow ? /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { "aria-hidden": "true", className: "hidden h-4 w-px bg-agg-separator md:block" }) : null,
|
|
13937
13958
|
!contractWindow && import_hooks51.CHART_TIME_RANGES.map((timeRange) => {
|
|
13938
|
-
const effectiveRange =
|
|
13959
|
+
const effectiveRange = chartRangeOverride != null ? chartRangeOverride : config.chart.selectedChartTimeRange;
|
|
13939
13960
|
const isActive = timeRange === effectiveRange;
|
|
13940
13961
|
return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
13941
13962
|
Button,
|
|
@@ -15385,6 +15406,13 @@ var MarketDetailsContent = ({
|
|
|
15385
15406
|
labels
|
|
15386
15407
|
});
|
|
15387
15408
|
}, [config.formatting.formatCompactCurrency, venueMarkets, image, labels, marketId, title2]);
|
|
15409
|
+
const primaryVenue = (0, import_react28.useMemo)(
|
|
15410
|
+
() => {
|
|
15411
|
+
var _a2, _b2;
|
|
15412
|
+
return (_b2 = (_a2 = venueMarkets.find((venueMarket) => venueMarket.id === marketId)) != null ? _a2 : venueMarkets[0]) == null ? void 0 : _b2.venue;
|
|
15413
|
+
},
|
|
15414
|
+
[venueMarkets, marketId]
|
|
15415
|
+
);
|
|
15388
15416
|
const livePrices = (0, import_react28.useMemo)(() => {
|
|
15389
15417
|
const merged = /* @__PURE__ */ new Map();
|
|
15390
15418
|
if (midpointsFallback == null ? void 0 : midpointsFallback.size) {
|
|
@@ -15591,6 +15619,26 @@ var MarketDetailsContent = ({
|
|
|
15591
15619
|
});
|
|
15592
15620
|
}, [model, selectedOutcomeLabel, selectedOutcomeId]);
|
|
15593
15621
|
const orderBookEnabled = isOpened && effectiveSelectedTab === "order-book" && !marketTradingState.isTradingDisabled;
|
|
15622
|
+
const betdexSeedOutcomes = (0, import_react28.useMemo)(
|
|
15623
|
+
() => {
|
|
15624
|
+
var _a2;
|
|
15625
|
+
return ((_a2 = model == null ? void 0 : model.market.venueMarkets) != null ? _a2 : []).filter((venueMarket) => venueMarket.venue === "betdex").flatMap(
|
|
15626
|
+
(venueMarket) => {
|
|
15627
|
+
var _a3;
|
|
15628
|
+
return ((_a3 = venueMarket.venueMarketOutcomes) != null ? _a3 : []).map((outcome) => ({
|
|
15629
|
+
venue: venueMarket.venue,
|
|
15630
|
+
venueMarketOutcomeId: outcome.id
|
|
15631
|
+
}));
|
|
15632
|
+
}
|
|
15633
|
+
);
|
|
15634
|
+
},
|
|
15635
|
+
[model]
|
|
15636
|
+
);
|
|
15637
|
+
(0, import_hooks55.useMarketOrderbook)({
|
|
15638
|
+
venueOutcomes: betdexSeedOutcomes,
|
|
15639
|
+
enabled: !orderBookEnabled && !marketTradingState.isTradingDisabled && betdexSeedOutcomes.length > 0,
|
|
15640
|
+
live: false
|
|
15641
|
+
});
|
|
15594
15642
|
const selectedVenueOutcome = selectedOutcomesByVenue.find(
|
|
15595
15643
|
(item) => item.outcomeId === selectedOutcomeId
|
|
15596
15644
|
);
|
|
@@ -15785,6 +15833,7 @@ var MarketDetailsContent = ({
|
|
|
15785
15833
|
src: (0, import_hooks55.optimizedImageUrl)(model.image, 60),
|
|
15786
15834
|
retinaSrc: (0, import_hooks55.retinaImageUrl)(model.image, 60),
|
|
15787
15835
|
alt: "",
|
|
15836
|
+
fallback: primaryVenue ? /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(VenueLogo, { venue: primaryVenue, size: "large" }) : void 0,
|
|
15788
15837
|
className: "agg-market-image size-12 rounded-agg-lg object-cover md:size-[60px]"
|
|
15789
15838
|
}
|
|
15790
15839
|
) : null,
|
|
@@ -16569,6 +16618,18 @@ var getDefaultEventListTabs = (labels) => {
|
|
|
16569
16618
|
venueLogo: import_sdk15.Venue.prophetx,
|
|
16570
16619
|
venues: [import_sdk15.Venue.prophetx]
|
|
16571
16620
|
},
|
|
16621
|
+
{
|
|
16622
|
+
value: import_sdk15.Venue.tiprun,
|
|
16623
|
+
label: labels.venues.tiprun,
|
|
16624
|
+
venueLogo: import_sdk15.Venue.tiprun,
|
|
16625
|
+
venues: [import_sdk15.Venue.tiprun]
|
|
16626
|
+
},
|
|
16627
|
+
{
|
|
16628
|
+
value: import_sdk15.Venue.betdex,
|
|
16629
|
+
label: labels.venues.betdex,
|
|
16630
|
+
venueLogo: import_sdk15.Venue.betdex,
|
|
16631
|
+
venues: [import_sdk15.Venue.betdex]
|
|
16632
|
+
},
|
|
16572
16633
|
{
|
|
16573
16634
|
value: import_sdk15.Venue.opinion,
|
|
16574
16635
|
label: labels.venues.opinion,
|