@agg-build/ui 2.1.5 → 2.2.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-T4YZGAYS.mjs → chunk-4QGZ3FWI.mjs} +1 -1
- package/dist/{chunk-XUBIJI4R.mjs → chunk-JGBEQ4IV.mjs} +1079 -872
- package/dist/{chunk-BW7S2YR3.mjs → chunk-JOZPXDNZ.mjs} +48 -21
- package/dist/{chunk-R2YNZJZ3.mjs → chunk-LPIAEKSZ.mjs} +82 -2
- package/dist/{chunk-TBZWRUFB.mjs → chunk-QM3WWPCV.mjs} +201 -87
- package/dist/{chunk-VP76G6PN.mjs → chunk-UTXQUOU3.mjs} +177 -27
- package/dist/{chunk-XHE2VO3S.mjs → chunk-ZRYHWHTD.mjs} +2 -2
- package/dist/events.js +369 -82
- package/dist/events.mjs +3 -3
- package/dist/index.js +2180 -1621
- package/dist/index.mjs +9 -7
- package/dist/modals.js +2 -2
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +1552 -995
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +74 -26
- package/dist/primitives.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +131 -20
- package/dist/trading.mjs +4 -4
- package/dist/types/events/item/event-list-item.types.d.mts +6 -2
- package/dist/types/events/item/event-list-item.types.d.ts +6 -2
- package/dist/types/events/item/event-list-item.utils.d.mts +3 -2
- package/dist/types/events/item/event-list-item.utils.d.ts +3 -2
- package/dist/types/events/item-details/event-list-item-details.types.d.mts +0 -6
- package/dist/types/events/item-details/event-list-item-details.types.d.ts +0 -6
- package/dist/types/events/item-details/event-list-item-details.utils.d.mts +9 -0
- package/dist/types/events/item-details/event-list-item-details.utils.d.ts +9 -0
- package/dist/types/events/market-details/market-details.types.d.mts +1 -0
- package/dist/types/events/market-details/market-details.types.d.ts +1 -0
- package/dist/types/events/shared/chart-venue-selection.d.mts +2 -1
- package/dist/types/events/shared/chart-venue-selection.d.ts +2 -1
- package/dist/types/events/shared/event-trading-state.utils.d.mts +4 -2
- package/dist/types/events/shared/event-trading-state.utils.d.ts +4 -2
- package/dist/types/pages/event-market/sports-event-market.utils.d.mts +1 -1
- package/dist/types/pages/event-market/sports-event-market.utils.d.ts +1 -1
- package/dist/types/pages/user-profile/components/claim-activity-breakdown-modal.d.mts +8 -0
- package/dist/types/pages/user-profile/components/claim-activity-breakdown-modal.d.ts +8 -0
- package/dist/types/pages/user-profile/index.d.mts +1 -1
- package/dist/types/pages/user-profile/index.d.ts +1 -1
- package/dist/types/pages/user-profile/user-profile.types.d.mts +14 -0
- package/dist/types/pages/user-profile/user-profile.types.d.ts +14 -0
- package/dist/types/primitives/search/search.types.d.mts +1 -0
- package/dist/types/primitives/search/search.types.d.ts +1 -0
- package/dist/types/primitives/search/search.utils.d.mts +4 -1
- package/dist/types/primitives/search/search.utils.d.ts +4 -1
- package/dist/types/shared/utils.d.mts +16 -0
- package/dist/types/shared/utils.d.ts +16 -0
- package/dist/types/trading/types.d.mts +2 -1
- package/dist/types/trading/types.d.ts +2 -1
- package/package.json +3 -3
|
@@ -140,6 +140,92 @@ var formatAmountDisplay = (value) => {
|
|
|
140
140
|
}
|
|
141
141
|
return num.toLocaleString("en-US");
|
|
142
142
|
};
|
|
143
|
+
var GENERIC_BINARY_OUTCOME_LABELS = /* @__PURE__ */ new Set(["yes", "no"]);
|
|
144
|
+
var TOTAL_OUTCOME_LABELS = /* @__PURE__ */ new Set(["over", "under"]);
|
|
145
|
+
var DIRECTIONAL_OUTCOME_LABELS = /* @__PURE__ */ new Set(["up", "down"]);
|
|
146
|
+
var NUMERIC_TOKEN_RE = /[-+]?\d+(?:\.\d+)?/;
|
|
147
|
+
var UP_OR_DOWN_QUESTION_RE = /\bup or down\b/i;
|
|
148
|
+
var normalizeResolvedOutcomeLabel = (value) => {
|
|
149
|
+
const trimmedValue = value == null ? void 0 : value.trim();
|
|
150
|
+
return trimmedValue ? trimmedValue : null;
|
|
151
|
+
};
|
|
152
|
+
var readOutcomeMetadataLabel = (outcome) => {
|
|
153
|
+
const outcomeRecord = outcome;
|
|
154
|
+
for (const key of ["displayName", "name", "title"]) {
|
|
155
|
+
const value = outcomeRecord[key];
|
|
156
|
+
if (typeof value !== "string") continue;
|
|
157
|
+
const normalizedValue = normalizeResolvedOutcomeLabel(value);
|
|
158
|
+
if (normalizedValue) return normalizedValue;
|
|
159
|
+
}
|
|
160
|
+
return null;
|
|
161
|
+
};
|
|
162
|
+
var formatLineValue = (value) => {
|
|
163
|
+
return Number.isInteger(value) ? String(value) : String(value);
|
|
164
|
+
};
|
|
165
|
+
var readMarketLabel = (market) => {
|
|
166
|
+
var _a;
|
|
167
|
+
const rawLabel = (_a = normalizeResolvedOutcomeLabel(market == null ? void 0 : market.shortTitle)) != null ? _a : normalizeResolvedOutcomeLabel(market == null ? void 0 : market.question);
|
|
168
|
+
if (!rawLabel) return null;
|
|
169
|
+
if (/^draw\s*\(/i.test(rawLabel)) return "Draw";
|
|
170
|
+
return rawLabel;
|
|
171
|
+
};
|
|
172
|
+
var deriveTotalOutcomeLabel = (outcome, metadataLabel) => {
|
|
173
|
+
const normalizedMetadataLabel = metadataLabel == null ? void 0 : metadataLabel.trim().toLowerCase();
|
|
174
|
+
if (normalizedMetadataLabel && TOTAL_OUTCOME_LABELS.has(normalizedMetadataLabel)) {
|
|
175
|
+
return metadataLabel;
|
|
176
|
+
}
|
|
177
|
+
const normalizedRawLabel = outcome.label.trim().toLowerCase();
|
|
178
|
+
if (normalizedRawLabel === "yes") return "Over";
|
|
179
|
+
if (normalizedRawLabel === "no") return "Under";
|
|
180
|
+
return metadataLabel;
|
|
181
|
+
};
|
|
182
|
+
var resolveResolvedOutcomeLabel = ({
|
|
183
|
+
market,
|
|
184
|
+
outcome,
|
|
185
|
+
allowSportsMoneylineMarketFallback = true
|
|
186
|
+
}) => {
|
|
187
|
+
var _a;
|
|
188
|
+
if (!outcome) return null;
|
|
189
|
+
const rawLabel = normalizeResolvedOutcomeLabel(outcome.label);
|
|
190
|
+
const metadataLabel = readOutcomeMetadataLabel(outcome);
|
|
191
|
+
const normalizedRawLabel = (_a = rawLabel == null ? void 0 : rawLabel.toLowerCase()) != null ? _a : "";
|
|
192
|
+
const isGenericBinary = GENERIC_BINARY_OUTCOME_LABELS.has(normalizedRawLabel);
|
|
193
|
+
const isSportsMarket = Boolean(
|
|
194
|
+
(market == null ? void 0 : market.sportsMarketType) || (market == null ? void 0 : market.marketGroup) || (market == null ? void 0 : market.lineValue) != null
|
|
195
|
+
);
|
|
196
|
+
if (!isSportsMarket) {
|
|
197
|
+
const isDirectionalBinaryMarket = Boolean((market == null ? void 0 : market.question) && UP_OR_DOWN_QUESTION_RE.test(market.question)) && Boolean(metadataLabel && DIRECTIONAL_OUTCOME_LABELS.has(metadataLabel.trim().toLowerCase()));
|
|
198
|
+
if (isDirectionalBinaryMarket) return metadataLabel;
|
|
199
|
+
if (isGenericBinary) return rawLabel;
|
|
200
|
+
return metadataLabel != null ? metadataLabel : rawLabel;
|
|
201
|
+
}
|
|
202
|
+
const lineValue = typeof (market == null ? void 0 : market.lineValue) === "number" ? market.lineValue : null;
|
|
203
|
+
const isMoneylineMarket = (market == null ? void 0 : market.sportsMarketType) === "moneyline" || (market == null ? void 0 : market.marketGroup) === "game_lines";
|
|
204
|
+
const isTotalMarket = (market == null ? void 0 : market.sportsMarketType) === "total" || (market == null ? void 0 : market.marketGroup) === "totals";
|
|
205
|
+
if (isMoneylineMarket && metadataLabel) return metadataLabel;
|
|
206
|
+
if (allowSportsMoneylineMarketFallback && isMoneylineMarket && isGenericBinary) {
|
|
207
|
+
const marketLabel = readMarketLabel(market);
|
|
208
|
+
if (marketLabel) return marketLabel;
|
|
209
|
+
}
|
|
210
|
+
if (isTotalMarket) {
|
|
211
|
+
const totalLabel = deriveTotalOutcomeLabel(outcome, metadataLabel);
|
|
212
|
+
if (totalLabel && lineValue != null && !NUMERIC_TOKEN_RE.test(totalLabel)) {
|
|
213
|
+
return `${totalLabel} ${formatLineValue(Math.abs(lineValue))}`;
|
|
214
|
+
}
|
|
215
|
+
if (totalLabel) return totalLabel;
|
|
216
|
+
}
|
|
217
|
+
const isSpreadMarket = (market == null ? void 0 : market.sportsMarketType) === "spread" || (market == null ? void 0 : market.marketGroup) === "spreads";
|
|
218
|
+
if (isSpreadMarket && metadataLabel) {
|
|
219
|
+
if (lineValue != null && !NUMERIC_TOKEN_RE.test(metadataLabel)) {
|
|
220
|
+
const resolvedLineValue = normalizedRawLabel === "no" ? Math.abs(lineValue) : lineValue;
|
|
221
|
+
const formattedLineValue = resolvedLineValue > 0 ? `+${formatLineValue(resolvedLineValue)}` : formatLineValue(resolvedLineValue);
|
|
222
|
+
return `${metadataLabel} ${formattedLineValue}`;
|
|
223
|
+
}
|
|
224
|
+
return metadataLabel;
|
|
225
|
+
}
|
|
226
|
+
if (metadataLabel) return metadataLabel;
|
|
227
|
+
return rawLabel;
|
|
228
|
+
};
|
|
143
229
|
|
|
144
230
|
// src/primitives/error-boundary/index.tsx
|
|
145
231
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -3945,7 +4031,8 @@ var normalizeSeries = (series) => {
|
|
|
3945
4031
|
}).filter((seriesItem) => seriesItem.points.length > 0);
|
|
3946
4032
|
};
|
|
3947
4033
|
var formatDefaultChartValue = (value) => {
|
|
3948
|
-
|
|
4034
|
+
const roundedValue = Number(value.toFixed(1));
|
|
4035
|
+
return `${Number.isInteger(roundedValue) ? String(roundedValue) : roundedValue.toFixed(1)}%`;
|
|
3949
4036
|
};
|
|
3950
4037
|
var resolveChartTimeFormatter = (windowSeconds) => {
|
|
3951
4038
|
return (timestamp) => {
|
|
@@ -5111,7 +5198,13 @@ Footer.displayName = "Footer";
|
|
|
5111
5198
|
import { useLabels as useLabels11 } from "@agg-build/hooks";
|
|
5112
5199
|
|
|
5113
5200
|
// src/primitives/search/index.tsx
|
|
5114
|
-
import {
|
|
5201
|
+
import {
|
|
5202
|
+
useLabels as useLabels10,
|
|
5203
|
+
useLiveOutcomePrices,
|
|
5204
|
+
useMidpoints,
|
|
5205
|
+
useSdkUiConfig as useSdkUiConfig10,
|
|
5206
|
+
useSearch
|
|
5207
|
+
} from "@agg-build/hooks";
|
|
5115
5208
|
import {
|
|
5116
5209
|
useCallback as useCallback3,
|
|
5117
5210
|
useEffect as useEffect6,
|
|
@@ -6480,7 +6573,7 @@ var sizeClasses2 = {
|
|
|
6480
6573
|
var lineColorByVenue = {
|
|
6481
6574
|
light: {
|
|
6482
6575
|
[Venue9.kalshi]: "#00D295",
|
|
6483
|
-
[Venue9.limitless]: "#
|
|
6576
|
+
[Venue9.limitless]: "#C4FF00",
|
|
6484
6577
|
[Venue9.opinion]: "#000000",
|
|
6485
6578
|
[Venue9.polymarket]: "#2E5CFF",
|
|
6486
6579
|
[Venue9.predict]: "#6D57F8",
|
|
@@ -6490,7 +6583,7 @@ var lineColorByVenue = {
|
|
|
6490
6583
|
},
|
|
6491
6584
|
dark: {
|
|
6492
6585
|
[Venue9.kalshi]: "#00D295",
|
|
6493
|
-
[Venue9.limitless]: "#
|
|
6586
|
+
[Venue9.limitless]: "#C4FF00",
|
|
6494
6587
|
[Venue9.opinion]: "#FFFFFF",
|
|
6495
6588
|
[Venue9.polymarket]: "#2E5CFF",
|
|
6496
6589
|
[Venue9.predict]: "#6D57F8",
|
|
@@ -6818,13 +6911,26 @@ var formatMarketProbabilityPercent = (value, formatPercent = formatWholePercent)
|
|
|
6818
6911
|
}
|
|
6819
6912
|
return formattedValue;
|
|
6820
6913
|
};
|
|
6821
|
-
var formatPriceGapPercent = (value) => {
|
|
6914
|
+
var formatPriceGapPercent = (value, mode = "percent") => {
|
|
6822
6915
|
if (typeof value !== "number" || !Number.isFinite(value)) return void 0;
|
|
6916
|
+
if (value <= 0) return void 0;
|
|
6917
|
+
if (mode === "fraction") {
|
|
6918
|
+
const percentageValue = value * 100;
|
|
6919
|
+
if (percentageValue < MIN_PRICE_GAP_PCT) return void 0;
|
|
6920
|
+
return `${Math.round(percentageValue)}%`;
|
|
6921
|
+
}
|
|
6823
6922
|
if (value < MIN_PRICE_GAP_PCT) return void 0;
|
|
6824
6923
|
if (value > MAX_PRICE_GAP_PCT) return void 0;
|
|
6825
6924
|
return `${Math.round(value)}%`;
|
|
6826
6925
|
};
|
|
6827
6926
|
var sortOutcomes = (outcomes) => {
|
|
6927
|
+
return sortOutcomesWithPrices(outcomes);
|
|
6928
|
+
};
|
|
6929
|
+
var resolveOutcomeProbability = (outcome, priceByOutcomeId) => {
|
|
6930
|
+
const resolvedPrice = priceByOutcomeId === void 0 ? outcome.price : priceByOutcomeId.has(outcome.id) ? priceByOutcomeId.get(outcome.id) : void 0;
|
|
6931
|
+
return normalizeProbability(resolvedPrice);
|
|
6932
|
+
};
|
|
6933
|
+
var sortOutcomesWithPrices = (outcomes, priceByOutcomeId) => {
|
|
6828
6934
|
if (outcomes.length <= 1) return outcomes;
|
|
6829
6935
|
if (hasBinaryOutcomes(outcomes)) {
|
|
6830
6936
|
return sortYesFirst(outcomes);
|
|
@@ -6840,38 +6946,41 @@ var sortOutcomes = (outcomes) => {
|
|
|
6840
6946
|
}
|
|
6841
6947
|
return [...outcomes].sort((a, b) => {
|
|
6842
6948
|
var _a, _b;
|
|
6843
|
-
const aPrice = (_a =
|
|
6844
|
-
const bPrice = (_b =
|
|
6949
|
+
const aPrice = (_a = resolveOutcomeProbability(a, priceByOutcomeId)) != null ? _a : 0;
|
|
6950
|
+
const bPrice = (_b = resolveOutcomeProbability(b, priceByOutcomeId)) != null ? _b : 0;
|
|
6845
6951
|
return bPrice - aPrice;
|
|
6846
6952
|
});
|
|
6847
6953
|
};
|
|
6848
|
-
var compareVisibleOutcomeRows = (left, right) => {
|
|
6954
|
+
var compareVisibleOutcomeRows = (left, right, priceByOutcomeId) => {
|
|
6849
6955
|
var _a, _b;
|
|
6850
6956
|
const leftDate = toDate(resolveOutcomeTitle(left.outcome));
|
|
6851
6957
|
const rightDate = toDate(resolveOutcomeTitle(right.outcome));
|
|
6852
6958
|
if (leftDate && rightDate) {
|
|
6853
6959
|
return leftDate.getTime() - rightDate.getTime();
|
|
6854
6960
|
}
|
|
6855
|
-
const leftProbability = (_a =
|
|
6856
|
-
const rightProbability = (_b =
|
|
6961
|
+
const leftProbability = (_a = resolveOutcomeProbability(left.outcome, priceByOutcomeId)) != null ? _a : -1;
|
|
6962
|
+
const rightProbability = (_b = resolveOutcomeProbability(right.outcome, priceByOutcomeId)) != null ? _b : -1;
|
|
6857
6963
|
return rightProbability - leftProbability;
|
|
6858
6964
|
};
|
|
6859
|
-
var shouldReplaceVisibleOutcome = (current, next) => {
|
|
6965
|
+
var shouldReplaceVisibleOutcome = (current, next, priceByOutcomeId) => {
|
|
6860
6966
|
var _a, _b;
|
|
6861
6967
|
const currentVolume = typeof current.market.volume === "number" ? current.market.volume : -1;
|
|
6862
6968
|
const nextVolume = typeof next.market.volume === "number" ? next.market.volume : -1;
|
|
6863
6969
|
if (currentVolume !== nextVolume) {
|
|
6864
6970
|
return nextVolume > currentVolume;
|
|
6865
6971
|
}
|
|
6866
|
-
const currentProbability = (_a =
|
|
6867
|
-
const nextProbability = (_b =
|
|
6972
|
+
const currentProbability = (_a = resolveOutcomeProbability(current.outcome, priceByOutcomeId)) != null ? _a : -1;
|
|
6973
|
+
const nextProbability = (_b = resolveOutcomeProbability(next.outcome, priceByOutcomeId)) != null ? _b : -1;
|
|
6868
6974
|
return nextProbability > currentProbability;
|
|
6869
6975
|
};
|
|
6870
|
-
var resolveVisibleOutcomes = (venueMarkets) => {
|
|
6976
|
+
var resolveVisibleOutcomes = (venueMarkets, priceByOutcomeId) => {
|
|
6871
6977
|
const visibleOutcomesByLabel = /* @__PURE__ */ new Map();
|
|
6872
6978
|
venueMarkets.forEach((market) => {
|
|
6873
6979
|
const title2 = market.question;
|
|
6874
|
-
const canonicalOutcome =
|
|
6980
|
+
const canonicalOutcome = sortOutcomesWithPrices(
|
|
6981
|
+
market.venueMarketOutcomes,
|
|
6982
|
+
priceByOutcomeId
|
|
6983
|
+
)[0];
|
|
6875
6984
|
if (!canonicalOutcome) return;
|
|
6876
6985
|
const normalizedTitle = title2.trim().toLowerCase();
|
|
6877
6986
|
const nextVisibleOutcome = {
|
|
@@ -6881,11 +6990,11 @@ var resolveVisibleOutcomes = (venueMarkets) => {
|
|
|
6881
6990
|
title: title2
|
|
6882
6991
|
};
|
|
6883
6992
|
const currentVisibleOutcome = visibleOutcomesByLabel.get(normalizedTitle);
|
|
6884
|
-
if (!currentVisibleOutcome || shouldReplaceVisibleOutcome(currentVisibleOutcome, nextVisibleOutcome)) {
|
|
6993
|
+
if (!currentVisibleOutcome || shouldReplaceVisibleOutcome(currentVisibleOutcome, nextVisibleOutcome, priceByOutcomeId)) {
|
|
6885
6994
|
visibleOutcomesByLabel.set(normalizedTitle, nextVisibleOutcome);
|
|
6886
6995
|
}
|
|
6887
6996
|
});
|
|
6888
|
-
return [...visibleOutcomesByLabel.values()].sort(compareVisibleOutcomeRows).slice(0, Math.max(1, 2));
|
|
6997
|
+
return [...visibleOutcomesByLabel.values()].sort((left, right) => compareVisibleOutcomeRows(left, right, priceByOutcomeId)).slice(0, Math.max(1, 2));
|
|
6889
6998
|
};
|
|
6890
6999
|
var dedupeVenueMarketsById = (venueMarkets) => {
|
|
6891
7000
|
const seenClusterIds = /* @__PURE__ */ new Set();
|
|
@@ -6965,18 +7074,19 @@ var toVenueLogoName = (value) => {
|
|
|
6965
7074
|
if (!venueLogoNameSet.has(value)) return null;
|
|
6966
7075
|
return value;
|
|
6967
7076
|
};
|
|
6968
|
-
var mapVenueEventToSearchResult = (event, labels, formatPercent, formatCompactCurrency) => {
|
|
6969
|
-
var _a, _b;
|
|
7077
|
+
var mapVenueEventToSearchResult = (event, labels, formatPercent, formatCompactCurrency, options) => {
|
|
7078
|
+
var _a, _b, _c;
|
|
6970
7079
|
const primaryVenueMarket = selectPrimaryVenueMarket(event.venueMarkets);
|
|
6971
7080
|
if (!primaryVenueMarket) return null;
|
|
6972
7081
|
const primaryVenue = toVenueLogoName(primaryVenueMarket.venue);
|
|
6973
7082
|
if (!primaryVenue) return null;
|
|
6974
|
-
const visibleOutcome = resolveVisibleOutcomes(event.venueMarkets)[0];
|
|
7083
|
+
const visibleOutcome = resolveVisibleOutcomes(event.venueMarkets, options == null ? void 0 : options.priceByOutcomeId)[0];
|
|
6975
7084
|
if (!visibleOutcome) return null;
|
|
6976
|
-
const probability = normalizeProbability(
|
|
6977
|
-
|
|
7085
|
+
const probability = normalizeProbability(
|
|
7086
|
+
(_a = options == null ? void 0 : options.priceByOutcomeId) == null ? void 0 : _a.get(visibleOutcome.outcome.id)
|
|
7087
|
+
);
|
|
6978
7088
|
const resolvedTitle = formatEventTitleWithDateSuffix({
|
|
6979
|
-
title: (
|
|
7089
|
+
title: (_b = event == null ? void 0 : event.title) != null ? _b : "",
|
|
6980
7090
|
categories: event.categories,
|
|
6981
7091
|
structureType: event.structureType,
|
|
6982
7092
|
gameStartTime: event.gameStartTime,
|
|
@@ -6998,13 +7108,14 @@ var mapVenueEventToSearchResult = (event, labels, formatPercent, formatCompactCu
|
|
|
6998
7108
|
return {
|
|
6999
7109
|
id: event.id,
|
|
7000
7110
|
title: resolvedTitle,
|
|
7001
|
-
thumbnailSrc: (
|
|
7111
|
+
thumbnailSrc: (_c = resolveTileImage(event, primaryVenueMarket, void 0)) != null ? _c : "",
|
|
7002
7112
|
thumbnailAlt: resolvedTitle,
|
|
7003
7113
|
venue: primaryVenue,
|
|
7004
7114
|
visibleVenues,
|
|
7005
7115
|
marketSummaryLabel,
|
|
7006
7116
|
volumeLabel,
|
|
7007
7117
|
valueLabel: formatMarketProbabilityPercent(probability, formatPercent),
|
|
7118
|
+
isValueLoading: probability == null && (options == null ? void 0 : options.isPriceLoading) === true,
|
|
7008
7119
|
contextLabel: formatSearchContextLabel(visibleOutcome.title)
|
|
7009
7120
|
};
|
|
7010
7121
|
};
|
|
@@ -7114,7 +7225,16 @@ var SearchResultRow = ({
|
|
|
7114
7225
|
children: [
|
|
7115
7226
|
/* @__PURE__ */ jsx119(VenueLogo, { venue: item.venue, size: "small" }),
|
|
7116
7227
|
/* @__PURE__ */ jsxs114("div", { className: "flex min-w-0 flex-1 items-baseline gap-2", children: [
|
|
7117
|
-
/* @__PURE__ */ jsx119(
|
|
7228
|
+
item.isValueLoading ? /* @__PURE__ */ jsx119(
|
|
7229
|
+
"span",
|
|
7230
|
+
{
|
|
7231
|
+
"aria-hidden": "true",
|
|
7232
|
+
className: cn(
|
|
7233
|
+
"agg-search-result-value-loading",
|
|
7234
|
+
"h-5 w-12 shrink-0 rounded-agg-sm bg-agg-separator animate-pulse"
|
|
7235
|
+
)
|
|
7236
|
+
}
|
|
7237
|
+
) : /* @__PURE__ */ jsx119(
|
|
7118
7238
|
"p",
|
|
7119
7239
|
{
|
|
7120
7240
|
className: cn(
|
|
@@ -7227,6 +7347,24 @@ var Search = ({
|
|
|
7227
7347
|
() => filterOpenEvents(searchResults),
|
|
7228
7348
|
[searchResults]
|
|
7229
7349
|
);
|
|
7350
|
+
const visibleVenueMarkets = useMemo5(
|
|
7351
|
+
() => openEvents.flatMap((event) => {
|
|
7352
|
+
var _a;
|
|
7353
|
+
return (_a = event.venueMarkets) != null ? _a : [];
|
|
7354
|
+
}),
|
|
7355
|
+
[openEvents]
|
|
7356
|
+
);
|
|
7357
|
+
const livePrices = useLiveOutcomePrices(visibleVenueMarkets);
|
|
7358
|
+
const midpointResult = useMidpoints(visibleVenueMarkets);
|
|
7359
|
+
const searchDisplayPrices = useMemo5(() => {
|
|
7360
|
+
if (!midpointResult.bestMidpointsByOutcomeId.size) return livePrices;
|
|
7361
|
+
if (!livePrices.size) return midpointResult.bestMidpointsByOutcomeId;
|
|
7362
|
+
const merged = new Map(midpointResult.bestMidpointsByOutcomeId);
|
|
7363
|
+
for (const [outcomeId, price] of livePrices) {
|
|
7364
|
+
merged.set(outcomeId, price);
|
|
7365
|
+
}
|
|
7366
|
+
return merged;
|
|
7367
|
+
}, [livePrices, midpointResult.bestMidpointsByOutcomeId]);
|
|
7230
7368
|
const { validatedResults, eventsByResultId } = useMemo5(() => {
|
|
7231
7369
|
const nextEventsByResultId = /* @__PURE__ */ new Map();
|
|
7232
7370
|
const nextResults = openEvents.map((event) => {
|
|
@@ -7234,7 +7372,11 @@ var Search = ({
|
|
|
7234
7372
|
event,
|
|
7235
7373
|
labels,
|
|
7236
7374
|
formatPercent,
|
|
7237
|
-
formatCompactCurrency
|
|
7375
|
+
formatCompactCurrency,
|
|
7376
|
+
{
|
|
7377
|
+
priceByOutcomeId: searchDisplayPrices,
|
|
7378
|
+
isPriceLoading: midpointResult.isLoading
|
|
7379
|
+
}
|
|
7238
7380
|
);
|
|
7239
7381
|
if (!item) return null;
|
|
7240
7382
|
nextEventsByResultId.set(item.id, event);
|
|
@@ -7244,7 +7386,14 @@ var Search = ({
|
|
|
7244
7386
|
validatedResults: nextResults,
|
|
7245
7387
|
eventsByResultId: nextEventsByResultId
|
|
7246
7388
|
};
|
|
7247
|
-
}, [
|
|
7389
|
+
}, [
|
|
7390
|
+
formatCompactCurrency,
|
|
7391
|
+
formatPercent,
|
|
7392
|
+
labels,
|
|
7393
|
+
midpointResult.isLoading,
|
|
7394
|
+
openEvents,
|
|
7395
|
+
searchDisplayPrices
|
|
7396
|
+
]);
|
|
7248
7397
|
const hasSearchValue = trimmedValue.length > 0;
|
|
7249
7398
|
const shouldRenderDropdown = isFocused && shouldSearchValue && !searchConfig.result && !searchConfig.isShowingAllResults;
|
|
7250
7399
|
const resolvedIsActive = isFocused;
|
|
@@ -9585,6 +9734,7 @@ export {
|
|
|
9585
9734
|
formatCompactUsd,
|
|
9586
9735
|
formatTokenAmount,
|
|
9587
9736
|
formatAmountDisplay,
|
|
9737
|
+
resolveResolvedOutcomeLabel,
|
|
9588
9738
|
AggErrorBoundary,
|
|
9589
9739
|
AggLogo,
|
|
9590
9740
|
AppleIcon,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
dispatchAggDepositNotification
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4QGZ3FWI.mjs";
|
|
5
5
|
import {
|
|
6
6
|
BestPricesIcon,
|
|
7
7
|
BoltIcon,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
shortenAddress,
|
|
42
42
|
useOptionalToast,
|
|
43
43
|
venueLogoLabels
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-UTXQUOU3.mjs";
|
|
45
45
|
|
|
46
46
|
// src/deposit/index.tsx
|
|
47
47
|
import { useAggAuthState, useAggUiConfig, useDepositAddresses, useLabels as useLabels11 } from "@agg-build/hooks";
|