@agg-build/ui 2.2.0 → 2.2.3
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-5MRFY5ZQ.mjs → chunk-4QGZ3FWI.mjs} +1 -1
- package/dist/{chunk-73MO7MYG.mjs → chunk-JOZPXDNZ.mjs} +30 -7
- package/dist/{chunk-TR7HUVY7.mjs → chunk-LPIAEKSZ.mjs} +82 -2
- package/dist/{chunk-BTRFSEPC.mjs → chunk-QM3WWPCV.mjs} +107 -29
- package/dist/{chunk-DTOI4V6P.mjs → chunk-TDLI6F55.mjs} +1155 -954
- package/dist/{chunk-MIAAL7BL.mjs → chunk-UTXQUOU3.mjs} +98 -4
- package/dist/{chunk-HNLA44SY.mjs → chunk-ZRYHWHTD.mjs} +2 -2
- package/dist/events.js +277 -31
- package/dist/events.mjs +3 -3
- package/dist/index.js +2003 -1534
- package/dist/index.mjs +9 -7
- package/dist/modals.js +2 -2
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +1375 -908
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +4 -3
- package/dist/primitives.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +114 -6
- package/dist/trading.mjs +4 -4
- package/dist/types/events/item/event-list-item.types.d.mts +4 -0
- package/dist/types/events/item/event-list-item.types.d.ts +4 -0
- package/dist/types/events/item/event-list-item.utils.d.mts +1 -1
- package/dist/types/events/item/event-list-item.utils.d.ts +1 -1
- package/dist/types/events/item-details/event-list-item-details.types.d.mts +0 -5
- package/dist/types/events/item-details/event-list-item-details.types.d.ts +0 -5
- 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/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/shared/utils.d.mts +16 -0
- package/dist/types/shared/utils.d.ts +16 -0
- 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) => {
|
|
@@ -6486,7 +6573,7 @@ var sizeClasses2 = {
|
|
|
6486
6573
|
var lineColorByVenue = {
|
|
6487
6574
|
light: {
|
|
6488
6575
|
[Venue9.kalshi]: "#00D295",
|
|
6489
|
-
[Venue9.limitless]: "#
|
|
6576
|
+
[Venue9.limitless]: "#C4FF00",
|
|
6490
6577
|
[Venue9.opinion]: "#000000",
|
|
6491
6578
|
[Venue9.polymarket]: "#2E5CFF",
|
|
6492
6579
|
[Venue9.predict]: "#6D57F8",
|
|
@@ -6496,7 +6583,7 @@ var lineColorByVenue = {
|
|
|
6496
6583
|
},
|
|
6497
6584
|
dark: {
|
|
6498
6585
|
[Venue9.kalshi]: "#00D295",
|
|
6499
|
-
[Venue9.limitless]: "#
|
|
6586
|
+
[Venue9.limitless]: "#C4FF00",
|
|
6500
6587
|
[Venue9.opinion]: "#FFFFFF",
|
|
6501
6588
|
[Venue9.polymarket]: "#2E5CFF",
|
|
6502
6589
|
[Venue9.predict]: "#6D57F8",
|
|
@@ -6824,8 +6911,14 @@ var formatMarketProbabilityPercent = (value, formatPercent = formatWholePercent)
|
|
|
6824
6911
|
}
|
|
6825
6912
|
return formattedValue;
|
|
6826
6913
|
};
|
|
6827
|
-
var formatPriceGapPercent = (value) => {
|
|
6914
|
+
var formatPriceGapPercent = (value, mode = "percent") => {
|
|
6828
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
|
+
}
|
|
6829
6922
|
if (value < MIN_PRICE_GAP_PCT) return void 0;
|
|
6830
6923
|
if (value > MAX_PRICE_GAP_PCT) return void 0;
|
|
6831
6924
|
return `${Math.round(value)}%`;
|
|
@@ -9641,6 +9734,7 @@ export {
|
|
|
9641
9734
|
formatCompactUsd,
|
|
9642
9735
|
formatTokenAmount,
|
|
9643
9736
|
formatAmountDisplay,
|
|
9737
|
+
resolveResolvedOutcomeLabel,
|
|
9644
9738
|
AggErrorBoundary,
|
|
9645
9739
|
AggLogo,
|
|
9646
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";
|