@agg-build/ui 4.19.0 → 4.21.0
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-GT3DCFIT.mjs → chunk-5PA5KLXN.mjs} +17 -9
- package/dist/chunk-CKHECAKV.mjs +2724 -0
- package/dist/{chunk-NSQQ62QK.mjs → chunk-DONMO42Q.mjs} +1 -1
- package/dist/{chunk-DXASFSVL.mjs → chunk-JLO2BGSF.mjs} +546 -225
- package/dist/{chunk-5YHKIJ23.mjs → chunk-NV6WT3TN.mjs} +481 -826
- package/dist/{chunk-47CCGQH6.mjs → chunk-UXLC3FFY.mjs} +451 -1349
- package/dist/{event-market-2BAMDM5I.mjs → event-market-UREM3ZE7.mjs} +3 -3
- package/dist/events.js +419 -99
- package/dist/events.mjs +4 -2
- package/dist/index.js +22571 -21972
- package/dist/index.mjs +12 -10
- package/dist/modals.js +898 -335
- package/dist/modals.mjs +5 -5
- package/dist/pages.js +4328 -2833
- package/dist/pages.mjs +5 -5
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +1746 -643
- package/dist/trading.mjs +2 -2
- package/dist/types/events/list/event-list-venue-strip.d.mts +29 -0
- package/dist/types/events/list/event-list-venue-strip.d.ts +29 -0
- package/dist/types/events/list/index.d.mts +2 -0
- package/dist/types/events/list/index.d.ts +2 -0
- package/dist/types/pages/user-profile/components/available-balance-card.d.mts +2 -1
- package/dist/types/pages/user-profile/components/available-balance-card.d.ts +2 -1
- package/dist/types/pages/user-profile/components/betdex-account-card.d.mts +3 -1
- package/dist/types/pages/user-profile/components/betdex-account-card.d.ts +3 -1
- package/dist/types/pages/user-profile/components/betdex-account-transfers.d.mts +2 -1
- package/dist/types/pages/user-profile/components/betdex-account-transfers.d.ts +2 -1
- package/dist/types/pages/user-profile/components/betdex-wallet-deposit.d.mts +6 -0
- package/dist/types/pages/user-profile/components/betdex-wallet-deposit.d.ts +6 -0
- package/dist/types/profile/tabs/trading-access-tab.d.mts +2 -1
- package/dist/types/profile/tabs/trading-access-tab.d.ts +2 -1
- package/dist/types/trading/manage-betdex-account-modal.d.mts +2 -1
- package/dist/types/trading/manage-betdex-account-modal.d.ts +2 -1
- package/dist/types/trading/place-order/index.place-order.types.d.mts +1 -0
- package/dist/types/trading/place-order/index.place-order.types.d.ts +1 -0
- package/dist/types/trading/place-order/index.place-order.utils.d.mts +2 -2
- package/dist/types/trading/place-order/index.place-order.utils.d.ts +2 -2
- package/dist/types/withdraw/steps/withdraw-amount.d.mts +3 -1
- package/dist/types/withdraw/steps/withdraw-amount.d.ts +3 -1
- package/dist/types/withdraw/withdraw-modal.types.d.mts +8 -0
- package/dist/types/withdraw/withdraw-modal.types.d.ts +8 -0
- package/package.json +3 -3
- package/dist/chunk-ROA5K67W.mjs +0 -1237
|
@@ -14,9 +14,10 @@ import {
|
|
|
14
14
|
ConnectKalshiModal,
|
|
15
15
|
ConnectProphetxModal,
|
|
16
16
|
GeoBlockBanner,
|
|
17
|
+
ManageBetdexAccountModal,
|
|
17
18
|
SharedKycModal,
|
|
18
19
|
subscribeAggDepositNotification
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-CKHECAKV.mjs";
|
|
20
21
|
import {
|
|
21
22
|
AGG_TERMS_OF_SERVICE_URL,
|
|
22
23
|
Button,
|
|
@@ -42,7 +43,6 @@ import {
|
|
|
42
43
|
RemoteImage,
|
|
43
44
|
Select,
|
|
44
45
|
Skeleton,
|
|
45
|
-
SkeletonBlock,
|
|
46
46
|
Tooltip,
|
|
47
47
|
Typography,
|
|
48
48
|
VenueLogo,
|
|
@@ -233,8 +233,8 @@ import {
|
|
|
233
233
|
useExecutionPositions,
|
|
234
234
|
useExecutionProgress,
|
|
235
235
|
useGeoBlock,
|
|
236
|
-
useHostedVenueAccount
|
|
237
|
-
useLabels as
|
|
236
|
+
useHostedVenueAccount,
|
|
237
|
+
useLabels as useLabels3,
|
|
238
238
|
useLimitOrderVenueQuotes,
|
|
239
239
|
useLiveBestPrices,
|
|
240
240
|
useLiveOutcomePrices,
|
|
@@ -258,7 +258,7 @@ import * as Popover from "@radix-ui/react-popover";
|
|
|
258
258
|
import dayjs from "dayjs";
|
|
259
259
|
import timezone from "dayjs/plugin/timezone";
|
|
260
260
|
import utc from "dayjs/plugin/utc";
|
|
261
|
-
import { Fragment as
|
|
261
|
+
import { Fragment as Fragment2, useCallback as useCallback3, useEffect as useEffect4, useId, useMemo, useRef as useRef4, useState as useState3 } from "react";
|
|
262
262
|
|
|
263
263
|
// src/kyc/shared-kyc.ts
|
|
264
264
|
import { Venue as Venue2 } from "@agg-build/sdk";
|
|
@@ -899,400 +899,6 @@ var FundKalshiModal = ({ open, onOpenChange }) => {
|
|
|
899
899
|
};
|
|
900
900
|
FundKalshiModal.displayName = "FundKalshiModal";
|
|
901
901
|
|
|
902
|
-
// src/trading/manage-betdex-account-modal.tsx
|
|
903
|
-
import { useLabels as useLabels6 } from "@agg-build/hooks";
|
|
904
|
-
import * as Dialog2 from "@radix-ui/react-dialog";
|
|
905
|
-
|
|
906
|
-
// src/pages/user-profile/components/betdex-account-card.tsx
|
|
907
|
-
import { useState as useState4 } from "react";
|
|
908
|
-
import { useHostedVenueAccount, useLabels as useLabels5 } from "@agg-build/hooks";
|
|
909
|
-
import { Venue as Venue4 } from "@agg-build/sdk";
|
|
910
|
-
|
|
911
|
-
// src/pages/user-profile/components/betdex-account-transfers.tsx
|
|
912
|
-
import { useState as useState2 } from "react";
|
|
913
|
-
import { useHostedVenueTransfers, useLabels as useLabels3 } from "@agg-build/hooks";
|
|
914
|
-
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
915
|
-
function hostedWithdrawalRaw(value) {
|
|
916
|
-
var _a;
|
|
917
|
-
const match = /^([0-9]{1,26})(?:\.([0-9]{1,6}))?$/.exec(value.trim());
|
|
918
|
-
if (!match) return null;
|
|
919
|
-
const raw = BigInt(match[1]) * BigInt(1e6) + BigInt(((_a = match[2]) != null ? _a : "").padEnd(6, "0"));
|
|
920
|
-
return raw > BigInt(0) ? raw.toString() : null;
|
|
921
|
-
}
|
|
922
|
-
var amountText = (raw) => {
|
|
923
|
-
const value = BigInt(raw);
|
|
924
|
-
const fraction = (value % BigInt(1e6)).toString().padStart(6, "0").replace(/0+$/, "");
|
|
925
|
-
return (value / BigInt(1e6)).toString() + (fraction ? "." + fraction : "");
|
|
926
|
-
};
|
|
927
|
-
function BetdexAccountTransfers({
|
|
928
|
-
accountId,
|
|
929
|
-
environment,
|
|
930
|
-
availableRaw,
|
|
931
|
-
canDeposit
|
|
932
|
-
}) {
|
|
933
|
-
const labels = useLabels3().userProfile.hostedBetdex;
|
|
934
|
-
const transfer = useHostedVenueTransfers(accountId, environment);
|
|
935
|
-
const [showWithdraw, setShowWithdraw] = useState2(false);
|
|
936
|
-
const [amount2, setAmount] = useState2("");
|
|
937
|
-
const [destination, setDestination] = useState2("");
|
|
938
|
-
const [actionError, setActionError] = useState2(false);
|
|
939
|
-
const raw = hostedWithdrawalRaw(amount2);
|
|
940
|
-
const withinBalance = raw !== null && (availableRaw === void 0 || BigInt(raw) <= BigInt(availableRaw));
|
|
941
|
-
const validDestination = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(destination.trim());
|
|
942
|
-
const result = transfer.withdrawal.data;
|
|
943
|
-
const terminal = (result == null ? void 0 : result.status) === "confirmed" || (result == null ? void 0 : result.status) === "failed";
|
|
944
|
-
const run = (work) => {
|
|
945
|
-
setActionError(false);
|
|
946
|
-
void work().catch(() => setActionError(true));
|
|
947
|
-
};
|
|
948
|
-
if (!transfer.isAvailable) return null;
|
|
949
|
-
return /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-3 border-t border-agg-separator pt-3", children: [
|
|
950
|
-
/* @__PURE__ */ jsxs4("div", { className: "flex flex-wrap gap-2", children: [
|
|
951
|
-
canDeposit ? /* @__PURE__ */ jsx4(
|
|
952
|
-
Button,
|
|
953
|
-
{
|
|
954
|
-
type: "button",
|
|
955
|
-
variant: "secondary",
|
|
956
|
-
size: "small",
|
|
957
|
-
"aria-label": labels.deposit,
|
|
958
|
-
isLoading: transfer.deposit.isPending,
|
|
959
|
-
disabled: transfer.deposit.isPending,
|
|
960
|
-
onClick: () => run(() => transfer.deposit.mutateAsync()),
|
|
961
|
-
children: labels.deposit
|
|
962
|
-
}
|
|
963
|
-
) : null,
|
|
964
|
-
/* @__PURE__ */ jsx4(
|
|
965
|
-
Button,
|
|
966
|
-
{
|
|
967
|
-
type: "button",
|
|
968
|
-
variant: "secondary",
|
|
969
|
-
size: "small",
|
|
970
|
-
"aria-expanded": showWithdraw || !!transfer.request,
|
|
971
|
-
onClick: () => setShowWithdraw((value) => !value),
|
|
972
|
-
children: labels.withdraw
|
|
973
|
-
}
|
|
974
|
-
)
|
|
975
|
-
] }),
|
|
976
|
-
transfer.deposit.data ? /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-2 agg-type-caption", children: [
|
|
977
|
-
/* @__PURE__ */ jsx4("p", { className: "text-agg-muted-foreground", children: labels.depositInstructions[environment] }),
|
|
978
|
-
/* @__PURE__ */ jsxs4("label", { className: "flex flex-col gap-1 text-agg-muted-foreground", children: [
|
|
979
|
-
labels.depositAddress,
|
|
980
|
-
/* @__PURE__ */ jsx4(
|
|
981
|
-
"input",
|
|
982
|
-
{
|
|
983
|
-
readOnly: true,
|
|
984
|
-
value: transfer.deposit.data.address,
|
|
985
|
-
onFocus: (event) => event.currentTarget.select(),
|
|
986
|
-
className: "w-full rounded-agg-md border border-agg-separator bg-agg-primary p-2 text-agg-foreground"
|
|
987
|
-
}
|
|
988
|
-
)
|
|
989
|
-
] })
|
|
990
|
-
] }) : null,
|
|
991
|
-
transfer.deposit.isError || transfer.withdrawal.isError || transfer.storageError || actionError ? /* @__PURE__ */ jsx4("p", { role: "alert", className: "agg-type-caption text-agg-error", children: labels.transferUnavailable }) : null,
|
|
992
|
-
transfer.request ? /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-2 agg-type-caption", children: [
|
|
993
|
-
/* @__PURE__ */ jsxs4("p", { children: [
|
|
994
|
-
labels.withdrawalAmount,
|
|
995
|
-
": ",
|
|
996
|
-
amountText(transfer.request.amountRaw)
|
|
997
|
-
] }),
|
|
998
|
-
/* @__PURE__ */ jsxs4("p", { className: "break-all", children: [
|
|
999
|
-
labels.withdrawalDestination,
|
|
1000
|
-
": ",
|
|
1001
|
-
transfer.request.destinationAddress
|
|
1002
|
-
] }),
|
|
1003
|
-
/* @__PURE__ */ jsx4("p", { role: "status", children: result ? labels.withdrawalStatuses[result.status] : labels.withdrawalUnknown }),
|
|
1004
|
-
terminal ? /* @__PURE__ */ jsx4(
|
|
1005
|
-
Button,
|
|
1006
|
-
{
|
|
1007
|
-
type: "button",
|
|
1008
|
-
variant: "tertiary",
|
|
1009
|
-
size: "small",
|
|
1010
|
-
onClick: () => {
|
|
1011
|
-
transfer.clear();
|
|
1012
|
-
setAmount("");
|
|
1013
|
-
setDestination("");
|
|
1014
|
-
setActionError(false);
|
|
1015
|
-
setShowWithdraw(false);
|
|
1016
|
-
},
|
|
1017
|
-
children: labels.withdrawalNew
|
|
1018
|
-
}
|
|
1019
|
-
) : /* @__PURE__ */ jsx4(
|
|
1020
|
-
Button,
|
|
1021
|
-
{
|
|
1022
|
-
type: "button",
|
|
1023
|
-
variant: "tertiary",
|
|
1024
|
-
size: "small",
|
|
1025
|
-
"aria-label": result ? labels.withdrawalCheck : labels.withdrawalRetry,
|
|
1026
|
-
isLoading: transfer.withdrawal.isPending,
|
|
1027
|
-
disabled: transfer.withdrawal.isPending,
|
|
1028
|
-
onClick: () => run(transfer.check),
|
|
1029
|
-
children: result ? labels.withdrawalCheck : labels.withdrawalRetry
|
|
1030
|
-
}
|
|
1031
|
-
)
|
|
1032
|
-
] }) : showWithdraw ? /* @__PURE__ */ jsxs4(
|
|
1033
|
-
"form",
|
|
1034
|
-
{
|
|
1035
|
-
className: "flex flex-col gap-3",
|
|
1036
|
-
onSubmit: (event) => {
|
|
1037
|
-
event.preventDefault();
|
|
1038
|
-
if (!raw || !withinBalance || !validDestination || !transfer.ready) return;
|
|
1039
|
-
run(() => transfer.submit(raw, destination.trim()));
|
|
1040
|
-
},
|
|
1041
|
-
children: [
|
|
1042
|
-
/* @__PURE__ */ jsxs4("label", { className: "flex flex-col gap-1 agg-type-caption text-agg-muted-foreground", children: [
|
|
1043
|
-
labels.withdrawalAmount,
|
|
1044
|
-
/* @__PURE__ */ jsx4(
|
|
1045
|
-
"input",
|
|
1046
|
-
{
|
|
1047
|
-
inputMode: "decimal",
|
|
1048
|
-
autoComplete: "off",
|
|
1049
|
-
value: amount2,
|
|
1050
|
-
onChange: (event) => setAmount(event.target.value),
|
|
1051
|
-
className: "rounded-agg-md border border-agg-separator bg-agg-primary p-2 text-agg-foreground"
|
|
1052
|
-
}
|
|
1053
|
-
)
|
|
1054
|
-
] }),
|
|
1055
|
-
/* @__PURE__ */ jsxs4("label", { className: "flex flex-col gap-1 agg-type-caption text-agg-muted-foreground", children: [
|
|
1056
|
-
labels.withdrawalDestination,
|
|
1057
|
-
/* @__PURE__ */ jsx4(
|
|
1058
|
-
"input",
|
|
1059
|
-
{
|
|
1060
|
-
autoComplete: "off",
|
|
1061
|
-
spellCheck: false,
|
|
1062
|
-
value: destination,
|
|
1063
|
-
onChange: (event) => setDestination(event.target.value),
|
|
1064
|
-
className: "rounded-agg-md border border-agg-separator bg-agg-primary p-2 text-agg-foreground"
|
|
1065
|
-
}
|
|
1066
|
-
)
|
|
1067
|
-
] }),
|
|
1068
|
-
/* @__PURE__ */ jsx4(
|
|
1069
|
-
Button,
|
|
1070
|
-
{
|
|
1071
|
-
type: "submit",
|
|
1072
|
-
variant: "primary",
|
|
1073
|
-
size: "small",
|
|
1074
|
-
"aria-label": labels.withdrawalSubmit,
|
|
1075
|
-
disabled: !withinBalance || !validDestination || !transfer.ready || transfer.withdrawal.isPending,
|
|
1076
|
-
isLoading: transfer.withdrawal.isPending,
|
|
1077
|
-
children: labels.withdrawalSubmit
|
|
1078
|
-
}
|
|
1079
|
-
)
|
|
1080
|
-
]
|
|
1081
|
-
}
|
|
1082
|
-
) : null
|
|
1083
|
-
] });
|
|
1084
|
-
}
|
|
1085
|
-
|
|
1086
|
-
// src/pages/user-profile/components/betdex-account-activity.tsx
|
|
1087
|
-
import { useState as useState3 } from "react";
|
|
1088
|
-
import { useHostedVenueActivity, useLabels as useLabels4 } from "@agg-build/hooks";
|
|
1089
|
-
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1090
|
-
function amount(raw) {
|
|
1091
|
-
const negative = raw.startsWith("-");
|
|
1092
|
-
const digits = (negative ? raw.slice(1) : raw).padStart(19, "0");
|
|
1093
|
-
const fraction = digits.slice(-18).replace(/0+$/, "");
|
|
1094
|
-
return `${negative ? "-" : "+"}${digits.slice(0, -18)}${fraction ? `.${fraction}` : ""}`;
|
|
1095
|
-
}
|
|
1096
|
-
function BetdexAccountActivity({
|
|
1097
|
-
accountId,
|
|
1098
|
-
environment
|
|
1099
|
-
}) {
|
|
1100
|
-
const labels = useLabels4().userProfile.hostedBetdex;
|
|
1101
|
-
const [page, setPage] = useState3(0);
|
|
1102
|
-
const { activity, isAvailable } = useHostedVenueActivity("betdex", page);
|
|
1103
|
-
if (!isAvailable) return null;
|
|
1104
|
-
const data = activity.data;
|
|
1105
|
-
const valid = (data == null ? void 0 : data.accountId) === accountId && data.environment === environment && data.page === page;
|
|
1106
|
-
const unavailable = activity.isError || !!data && !valid;
|
|
1107
|
-
return /* @__PURE__ */ jsxs5(
|
|
1108
|
-
"section",
|
|
1109
|
-
{
|
|
1110
|
-
"aria-label": labels.activityTitle,
|
|
1111
|
-
className: "flex flex-col gap-3 border-t border-agg-separator pt-3",
|
|
1112
|
-
children: [
|
|
1113
|
-
/* @__PURE__ */ jsx5("h4", { className: "agg-type-label text-agg-foreground", children: labels.activityTitle }),
|
|
1114
|
-
/* @__PURE__ */ jsx5("p", { className: "agg-type-caption text-agg-muted-foreground", children: labels.activityDescription }),
|
|
1115
|
-
activity.isPending ? /* @__PURE__ */ jsx5(SkeletonBlock, { className: "h-16 w-full" }) : null,
|
|
1116
|
-
unavailable ? /* @__PURE__ */ jsx5("p", { role: "status", className: "agg-type-caption text-agg-muted-foreground", children: labels.activityUnavailable }) : null,
|
|
1117
|
-
valid && !unavailable ? data.items.length ? /* @__PURE__ */ jsx5("ul", { className: "flex flex-col gap-3 agg-type-caption", children: data.items.map((item) => /* @__PURE__ */ jsxs5("li", { className: "flex flex-col gap-1", children: [
|
|
1118
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex justify-between gap-3 text-agg-foreground", children: [
|
|
1119
|
-
/* @__PURE__ */ jsx5("span", { children: labels.activityCodes[item.code] }),
|
|
1120
|
-
/* @__PURE__ */ jsxs5("span", { className: "break-all tabular-nums", children: [
|
|
1121
|
-
amount(item.amountRaw),
|
|
1122
|
-
" ",
|
|
1123
|
-
data.asset
|
|
1124
|
-
] })
|
|
1125
|
-
] }),
|
|
1126
|
-
/* @__PURE__ */ jsx5("time", { dateTime: item.createdAt, className: "text-agg-muted-foreground", children: new Date(item.createdAt).toLocaleString() })
|
|
1127
|
-
] }, item.id)) }) : /* @__PURE__ */ jsx5("p", { className: "agg-type-caption text-agg-muted-foreground", children: labels.activityEmpty }) : null,
|
|
1128
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex flex-wrap gap-2", children: [
|
|
1129
|
-
/* @__PURE__ */ jsx5(
|
|
1130
|
-
Button,
|
|
1131
|
-
{
|
|
1132
|
-
type: "button",
|
|
1133
|
-
variant: "tertiary",
|
|
1134
|
-
size: "small",
|
|
1135
|
-
disabled: activity.isFetching || page === 0,
|
|
1136
|
-
onClick: () => setPage((value) => Math.max(0, value - 1)),
|
|
1137
|
-
children: labels.activityPrevious
|
|
1138
|
-
}
|
|
1139
|
-
),
|
|
1140
|
-
/* @__PURE__ */ jsx5(
|
|
1141
|
-
Button,
|
|
1142
|
-
{
|
|
1143
|
-
type: "button",
|
|
1144
|
-
variant: "tertiary",
|
|
1145
|
-
size: "small",
|
|
1146
|
-
disabled: activity.isFetching || unavailable || !valid || data.nextPage === null,
|
|
1147
|
-
onClick: () => {
|
|
1148
|
-
if (valid && data.nextPage !== null) setPage(data.nextPage);
|
|
1149
|
-
},
|
|
1150
|
-
children: labels.activityNext
|
|
1151
|
-
}
|
|
1152
|
-
),
|
|
1153
|
-
/* @__PURE__ */ jsx5(
|
|
1154
|
-
Button,
|
|
1155
|
-
{
|
|
1156
|
-
type: "button",
|
|
1157
|
-
variant: "tertiary",
|
|
1158
|
-
size: "small",
|
|
1159
|
-
disabled: activity.isFetching,
|
|
1160
|
-
onClick: () => {
|
|
1161
|
-
void activity.refetch();
|
|
1162
|
-
},
|
|
1163
|
-
children: labels.activityRefresh
|
|
1164
|
-
}
|
|
1165
|
-
)
|
|
1166
|
-
] })
|
|
1167
|
-
]
|
|
1168
|
-
}
|
|
1169
|
-
);
|
|
1170
|
-
}
|
|
1171
|
-
|
|
1172
|
-
// src/pages/user-profile/components/betdex-account-card.tsx
|
|
1173
|
-
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1174
|
-
function BetdexAccountCard() {
|
|
1175
|
-
var _a;
|
|
1176
|
-
const [showActivity, setShowActivity] = useState4(false);
|
|
1177
|
-
const labels = useLabels5().userProfile.hostedBetdex;
|
|
1178
|
-
const { account, provision, isAvailable } = useHostedVenueAccount("betdex");
|
|
1179
|
-
const data = account.data;
|
|
1180
|
-
if (!isAvailable || (data == null ? void 0 : data.status) === "disabled") return null;
|
|
1181
|
-
const pending = provision.isPending || (data == null ? void 0 : data.status) === "provisioning";
|
|
1182
|
-
const canCreate = (data == null ? void 0 : data.status) === "not_created" && data.provisioningEnabled;
|
|
1183
|
-
const rawLabel = (raw) => formatUsd(Number(raw) / 1e6);
|
|
1184
|
-
return /* @__PURE__ */ jsxs6(
|
|
1185
|
-
"section",
|
|
1186
|
-
{
|
|
1187
|
-
"aria-label": labels.title,
|
|
1188
|
-
className: "flex flex-col gap-3 rounded-agg-xl border border-agg-separator bg-agg-secondary p-5",
|
|
1189
|
-
children: [
|
|
1190
|
-
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2", children: [
|
|
1191
|
-
/* @__PURE__ */ jsx6(VenueLogo, { venue: Venue4.betdex, size: "small", className: "size-4" }),
|
|
1192
|
-
/* @__PURE__ */ jsx6("h3", { className: "agg-type-label text-agg-foreground", children: labels.title })
|
|
1193
|
-
] }),
|
|
1194
|
-
/* @__PURE__ */ jsx6("p", { className: "agg-type-caption text-agg-muted-foreground", children: labels.description }),
|
|
1195
|
-
(data == null ? void 0 : data.environment) === "sandbox" ? /* @__PURE__ */ jsx6("p", { className: "agg-type-caption text-agg-warning", children: labels.sandbox }) : null,
|
|
1196
|
-
account.isPending ? /* @__PURE__ */ jsx6(SkeletonBlock, { className: "h-10 w-full" }) : null,
|
|
1197
|
-
(data == null ? void 0 : data.status) === "active" && data.balanceStatus === "available" && data.balance && !account.isError ? /* @__PURE__ */ jsx6("dl", { className: "flex flex-col gap-2 agg-type-caption", children: [
|
|
1198
|
-
[labels.total, data.balance.totalRaw],
|
|
1199
|
-
[labels.available, data.balance.availableRaw],
|
|
1200
|
-
[labels.reserved, data.balance.unmatchedExposureRaw]
|
|
1201
|
-
].map(([label, raw]) => /* @__PURE__ */ jsxs6("div", { className: "flex justify-between gap-3", children: [
|
|
1202
|
-
/* @__PURE__ */ jsx6("dt", { className: "text-agg-muted-foreground", children: label }),
|
|
1203
|
-
/* @__PURE__ */ jsx6("dd", { className: "text-agg-foreground", children: rawLabel(raw) })
|
|
1204
|
-
] }, label)) }) : null,
|
|
1205
|
-
pending ? /* @__PURE__ */ jsx6("p", { role: "status", className: "agg-type-caption text-agg-muted-foreground", children: labels.provisioning }) : null,
|
|
1206
|
-
(data == null ? void 0 : data.status) === "suspended" ? /* @__PURE__ */ jsx6("p", { role: "status", className: "agg-type-caption text-agg-muted-foreground", children: labels.suspended }) : null,
|
|
1207
|
-
account.isError || (data == null ? void 0 : data.status) === "unavailable" || (data == null ? void 0 : data.balanceStatus) === "unavailable" ? /* @__PURE__ */ jsx6("p", { role: "status", className: "agg-type-caption text-agg-muted-foreground", children: labels.unavailable }) : null,
|
|
1208
|
-
(data == null ? void 0 : data.status) === "not_created" && !data.provisioningEnabled ? /* @__PURE__ */ jsx6("p", { className: "agg-type-caption text-agg-muted-foreground", children: labels.provisioningUnavailable }) : null,
|
|
1209
|
-
provision.isError ? /* @__PURE__ */ jsx6("p", { role: "alert", className: "agg-type-caption text-agg-error", children: labels.creationFailed }) : null,
|
|
1210
|
-
canCreate || (data == null ? void 0 : data.status) === "provisioning" ? /* @__PURE__ */ jsx6(
|
|
1211
|
-
Button,
|
|
1212
|
-
{
|
|
1213
|
-
type: "button",
|
|
1214
|
-
"aria-label": (data == null ? void 0 : data.status) === "provisioning" ? labels.checkSetup : labels.createAccount,
|
|
1215
|
-
variant: "secondary",
|
|
1216
|
-
size: "small",
|
|
1217
|
-
isLoading: provision.isPending,
|
|
1218
|
-
disabled: provision.isPending || account.isError,
|
|
1219
|
-
onClick: () => provision.mutate(),
|
|
1220
|
-
children: (data == null ? void 0 : data.status) === "provisioning" ? labels.checkSetup : labels.createAccount
|
|
1221
|
-
}
|
|
1222
|
-
) : null,
|
|
1223
|
-
/* @__PURE__ */ jsx6(
|
|
1224
|
-
Button,
|
|
1225
|
-
{
|
|
1226
|
-
type: "button",
|
|
1227
|
-
variant: "tertiary",
|
|
1228
|
-
size: "small",
|
|
1229
|
-
disabled: account.isFetching || provision.isPending,
|
|
1230
|
-
onClick: () => {
|
|
1231
|
-
void account.refetch();
|
|
1232
|
-
},
|
|
1233
|
-
children: labels.refresh
|
|
1234
|
-
}
|
|
1235
|
-
),
|
|
1236
|
-
(data == null ? void 0 : data.accountId) && data.environment && ["active", "suspended"].includes(data.status) ? /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
1237
|
-
/* @__PURE__ */ jsx6(
|
|
1238
|
-
BetdexAccountTransfers,
|
|
1239
|
-
{
|
|
1240
|
-
accountId: data.accountId,
|
|
1241
|
-
environment: data.environment,
|
|
1242
|
-
availableRaw: data.balanceStatus === "available" ? (_a = data.balance) == null ? void 0 : _a.availableRaw : void 0,
|
|
1243
|
-
canDeposit: data.status === "active"
|
|
1244
|
-
},
|
|
1245
|
-
`transfers:${data.accountId}:${data.environment}`
|
|
1246
|
-
),
|
|
1247
|
-
/* @__PURE__ */ jsx6(
|
|
1248
|
-
Button,
|
|
1249
|
-
{
|
|
1250
|
-
type: "button",
|
|
1251
|
-
variant: "tertiary",
|
|
1252
|
-
size: "small",
|
|
1253
|
-
"aria-expanded": showActivity,
|
|
1254
|
-
onClick: () => setShowActivity((shown) => !shown),
|
|
1255
|
-
children: showActivity ? labels.hideActivity : labels.showActivity
|
|
1256
|
-
}
|
|
1257
|
-
),
|
|
1258
|
-
showActivity ? /* @__PURE__ */ jsx6(
|
|
1259
|
-
BetdexAccountActivity,
|
|
1260
|
-
{
|
|
1261
|
-
accountId: data.accountId,
|
|
1262
|
-
environment: data.environment
|
|
1263
|
-
},
|
|
1264
|
-
`${data.accountId}:${data.environment}`
|
|
1265
|
-
) : null
|
|
1266
|
-
] }) : null
|
|
1267
|
-
]
|
|
1268
|
-
}
|
|
1269
|
-
);
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
// src/trading/manage-betdex-account-modal.tsx
|
|
1273
|
-
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1274
|
-
function ManageBetdexAccountModal({
|
|
1275
|
-
open,
|
|
1276
|
-
onOpenChange
|
|
1277
|
-
}) {
|
|
1278
|
-
const labels = useLabels6();
|
|
1279
|
-
return /* @__PURE__ */ jsx7(Modal, { open, onOpenChange, children: /* @__PURE__ */ jsxs7(Modal.Container, { maxWidth: "600px", "aria-label": labels.trading.manageBetdexAccount, children: [
|
|
1280
|
-
/* @__PURE__ */ jsx7(
|
|
1281
|
-
Dialog2.Close,
|
|
1282
|
-
{
|
|
1283
|
-
"aria-label": labels.common.close,
|
|
1284
|
-
className: "absolute right-4 top-4 z-10 flex size-11 cursor-pointer items-center justify-center rounded-agg-full text-agg-muted-foreground hover:bg-agg-quaternary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-accent",
|
|
1285
|
-
children: /* @__PURE__ */ jsx7(Icon, { name: "close", size: "medium" })
|
|
1286
|
-
}
|
|
1287
|
-
),
|
|
1288
|
-
/* @__PURE__ */ jsxs7(Modal.Body, { classNames: { root: "!px-5 !py-16" }, children: [
|
|
1289
|
-
/* @__PURE__ */ jsx7(Dialog2.Title, { className: "sr-only", children: labels.trading.manageBetdexAccount }),
|
|
1290
|
-
/* @__PURE__ */ jsx7(Dialog2.Description, { className: "sr-only", children: labels.userProfile.hostedBetdex.description }),
|
|
1291
|
-
open ? /* @__PURE__ */ jsx7(BetdexAccountCard, {}) : null
|
|
1292
|
-
] })
|
|
1293
|
-
] }) });
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
902
|
// src/trading/place-order/index.place-order.execution-debug.ts
|
|
1297
903
|
var REDACTED = "[redacted]";
|
|
1298
904
|
var SENSITIVE_FIELD_PATTERNS = [
|
|
@@ -1585,6 +1191,9 @@ var formatChainIdLabel = (chainId) => {
|
|
|
1585
1191
|
};
|
|
1586
1192
|
|
|
1587
1193
|
// src/trading/place-order/index.place-order.utils.ts
|
|
1194
|
+
import {
|
|
1195
|
+
Venue as Venue4
|
|
1196
|
+
} from "@agg-build/sdk";
|
|
1588
1197
|
var ATOMIC_UNITS = 1e6;
|
|
1589
1198
|
var ATOMIC_UNITS_BIGINT = BigInt(ATOMIC_UNITS);
|
|
1590
1199
|
var getPlaceOrderBalanceCacheKey = (balances) => {
|
|
@@ -1977,7 +1586,7 @@ var isQuoteBelowVenueMinimum = (quoteData) => {
|
|
|
1977
1586
|
return typeof quoteData.error === "string" && quoteData.error.startsWith("Trade below ");
|
|
1978
1587
|
};
|
|
1979
1588
|
var resolvePlaceOrderQuoteStatus = ({
|
|
1980
|
-
amount
|
|
1589
|
+
amount,
|
|
1981
1590
|
labels,
|
|
1982
1591
|
quoteData,
|
|
1983
1592
|
selectedMarket,
|
|
@@ -2066,7 +1675,7 @@ var resolvePlaceOrderQuoteStatus = ({
|
|
|
2066
1675
|
placement: "above-action"
|
|
2067
1676
|
};
|
|
2068
1677
|
}
|
|
2069
|
-
if (quoteData.totalFilled === 0 &&
|
|
1678
|
+
if (quoteData.totalFilled === 0 && amount > 0) {
|
|
2070
1679
|
return {
|
|
2071
1680
|
tone: "error",
|
|
2072
1681
|
message: labels.insufficientLiquidity,
|
|
@@ -2080,9 +1689,10 @@ var buildLiveRouteCards = ({
|
|
|
2080
1689
|
quoteData,
|
|
2081
1690
|
tradeSide,
|
|
2082
1691
|
eventVenues = [],
|
|
2083
|
-
geoBlockedVenues: inheritedGeoBlockedVenues
|
|
1692
|
+
geoBlockedVenues: inheritedGeoBlockedVenues,
|
|
1693
|
+
betdexFundingRequired = false
|
|
2084
1694
|
}) => {
|
|
2085
|
-
var _a, _b, _c, _d, _e;
|
|
1695
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
2086
1696
|
const geoBlockedVenues = extractGeoBlockedVenues(quoteData.warnings);
|
|
2087
1697
|
for (const venue of inheritedGeoBlockedVenues != null ? inheritedGeoBlockedVenues : []) {
|
|
2088
1698
|
geoBlockedVenues.add(venue);
|
|
@@ -2143,7 +1753,7 @@ var buildLiveRouteCards = ({
|
|
|
2143
1753
|
// balance condition, and `handleExecuteQuote` rejects an empty quoteId.
|
|
2144
1754
|
(primaryWinnerOutcomeId && sq.venueMarketOutcomeId ? sq.venueMarketOutcomeId !== primaryWinnerOutcomeId : sq.venue !== primaryWinnerVenue)
|
|
2145
1755
|
).map((sq) => {
|
|
2146
|
-
var _a2, _b2, _c2, _d2, _e2,
|
|
1756
|
+
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
2147
1757
|
const parsedVenue = parseVenue(sq.venue);
|
|
2148
1758
|
const venue = parsedVenue.success ? parsedVenue.data : void 0;
|
|
2149
1759
|
if (geoBlockedVenues.has(sq.venue)) {
|
|
@@ -2198,7 +1808,7 @@ var buildLiveRouteCards = ({
|
|
|
2198
1808
|
numericValue: (_e2 = sq.estimatedPayout) != null ? _e2 : sq.filledQty,
|
|
2199
1809
|
quoteData: soloQuoteData,
|
|
2200
1810
|
value: getTradingValueLabel({
|
|
2201
|
-
amount: (
|
|
1811
|
+
amount: (_f2 = sq.estimatedPayout) != null ? _f2 : sq.filledQty,
|
|
2202
1812
|
minimumFractionDigits: 2,
|
|
2203
1813
|
maximumFractionDigits: 2
|
|
2204
1814
|
}),
|
|
@@ -2260,7 +1870,44 @@ var buildLiveRouteCards = ({
|
|
|
2260
1870
|
}
|
|
2261
1871
|
];
|
|
2262
1872
|
})() : [];
|
|
2263
|
-
|
|
1873
|
+
const betdexFundingWarnings = tradeSide === "buy" ? ((_f = quoteData.warnings) != null ? _f : []).filter(
|
|
1874
|
+
(warning) => warning.venue === Venue4.betdex && warning.reason === "hosted_cash_unavailable"
|
|
1875
|
+
) : [];
|
|
1876
|
+
if (tradeSide === "buy" && betdexFundingRequired && betdexFundingWarnings.length === 0 && quoteData.matchedMarkets.some((market) => market.venue === Venue4.betdex) && !((_g = quoteData.warnings) != null ? _g : []).some((warning) => warning.venue === Venue4.betdex)) {
|
|
1877
|
+
betdexFundingWarnings.push({
|
|
1878
|
+
venue: Venue4.betdex,
|
|
1879
|
+
venueMarketOutcomeId: (_j = (_i = (_h = quoteData.venueSoloQuotes) == null ? void 0 : _h.find((solo) => solo.venue === Venue4.betdex)) == null ? void 0 : _i.venueMarketOutcomeId) != null ? _j : "",
|
|
1880
|
+
reason: "hosted_cash_unavailable"
|
|
1881
|
+
});
|
|
1882
|
+
}
|
|
1883
|
+
const fundingCards = eventVenueSet.has(Venue4.betdex) && !coveredVenueStrings.has(Venue4.betdex) && !geoBlockedVenues.has(Venue4.betdex) ? [
|
|
1884
|
+
...new Map(
|
|
1885
|
+
betdexFundingWarnings.map((warning) => [warning.venueMarketOutcomeId, warning])
|
|
1886
|
+
).values()
|
|
1887
|
+
].map((warning) => ({
|
|
1888
|
+
id: `live-account-betdex-${warning.venueMarketOutcomeId}`,
|
|
1889
|
+
venueMarketOutcomeId: warning.venueMarketOutcomeId,
|
|
1890
|
+
hint: labels.manageBetdexAccount,
|
|
1891
|
+
kind: "venue",
|
|
1892
|
+
label: getTradingVenueLabel(Venue4.betdex),
|
|
1893
|
+
numericValue: 0,
|
|
1894
|
+
quoteData: __spreadProps(__spreadValues({}, quoteData), {
|
|
1895
|
+
quoteId: "",
|
|
1896
|
+
fills: [],
|
|
1897
|
+
totalFilled: 0,
|
|
1898
|
+
rawExecCost: 0,
|
|
1899
|
+
estimatedPayout: void 0,
|
|
1900
|
+
estimatedProfit: void 0,
|
|
1901
|
+
returnPct: void 0,
|
|
1902
|
+
feeBreakdown: void 0,
|
|
1903
|
+
venueSoloQuotes: void 0,
|
|
1904
|
+
status: "insufficient_balance",
|
|
1905
|
+
error: void 0
|
|
1906
|
+
}),
|
|
1907
|
+
value: "",
|
|
1908
|
+
venue: Venue4.betdex
|
|
1909
|
+
})) : [];
|
|
1910
|
+
return [...baseCards, ...unavailableCards, ...warningOnlyUnavailableCards, ...fundingCards];
|
|
2264
1911
|
};
|
|
2265
1912
|
var routeCardRequiresKalshi = (card) => card.venue === "kalshi" || card.quoteData.fills.some((fill) => fill.venue === "kalshi");
|
|
2266
1913
|
var resolveDefaultRouteCardId = (routeCards, primaryStatus, options) => {
|
|
@@ -3220,7 +2867,7 @@ var normalizeIdentity = (value) => {
|
|
|
3220
2867
|
var _a;
|
|
3221
2868
|
return (_a = value == null ? void 0 : value.trim().toLowerCase()) != null ? _a : "";
|
|
3222
2869
|
};
|
|
3223
|
-
var formatTokenAmount = (
|
|
2870
|
+
var formatTokenAmount = (amount) => amount.toLocaleString("en-US", {
|
|
3224
2871
|
maximumFractionDigits: 2,
|
|
3225
2872
|
minimumFractionDigits: 0
|
|
3226
2873
|
});
|
|
@@ -3336,10 +2983,10 @@ var resolveActualFillPresentation = ({
|
|
|
3336
2983
|
);
|
|
3337
2984
|
if (filledEvents.length === 0) return { amount: fallbackAmount, price: fallbackPrice };
|
|
3338
2985
|
const actualAmounts = filledEvents.map((event) => parseRawUsd(event.filledAmountRaw));
|
|
3339
|
-
if (actualAmounts.some((
|
|
2986
|
+
if (actualAmounts.some((amount2) => amount2 === null)) {
|
|
3340
2987
|
return { amount: fallbackAmount, price: fallbackPrice };
|
|
3341
2988
|
}
|
|
3342
|
-
const
|
|
2989
|
+
const amount = actualAmounts.reduce((total, value) => total + value, 0);
|
|
3343
2990
|
const weightedPriceTotal = filledEvents.reduce((total, event, index) => {
|
|
3344
2991
|
var _a;
|
|
3345
2992
|
const executionPrice = Number(event.executionPriceRaw);
|
|
@@ -3347,8 +2994,8 @@ var resolveActualFillPresentation = ({
|
|
|
3347
2994
|
return total + price * ((_a = actualAmounts[index]) != null ? _a : 0);
|
|
3348
2995
|
}, 0);
|
|
3349
2996
|
return {
|
|
3350
|
-
amount
|
|
3351
|
-
price:
|
|
2997
|
+
amount,
|
|
2998
|
+
price: amount > 0 ? weightedPriceTotal / amount : fallbackPrice
|
|
3352
2999
|
};
|
|
3353
3000
|
};
|
|
3354
3001
|
var resolveBackendStepStatus = (status) => {
|
|
@@ -3380,12 +3027,12 @@ var resolveOrderPresentation = ({
|
|
|
3380
3027
|
const actualShares = parseRawUsd(order.actualSharesRaw);
|
|
3381
3028
|
const filledAmount = parseRawUsd(order.filledAmountRaw);
|
|
3382
3029
|
const fallbackAmount = fallbackFill ? tradeSide === "buy" ? fallbackFill.inAmount != null ? Number(fallbackFill.inAmount) / 1e6 : fallbackFill.venueQty * fallbackFill.avgPrice : fallbackFill.venueQty : 0;
|
|
3383
|
-
const
|
|
3030
|
+
const amount = tradeSide === "buy" ? filledAmount != null ? filledAmount : (fallbackFill == null ? void 0 : fallbackFill.inAmount) != null ? fallbackAmount : quotedShares != null && quotedPrice > 0 ? quotedShares * quotedPrice : fallbackAmount : (_b = actualShares != null ? actualShares : quotedShares) != null ? _b : fallbackAmount;
|
|
3384
3031
|
return {
|
|
3385
3032
|
venue,
|
|
3386
3033
|
venueLabel,
|
|
3387
3034
|
priceLabel: price > 0 ? getTradingRoutePriceLabel(price) : "\u2014",
|
|
3388
|
-
amountLabel: tradeSide === "buy" ? formatUsd(
|
|
3035
|
+
amountLabel: tradeSide === "buy" ? formatUsd(amount) : labels.executionShares(formatTokenAmount(amount))
|
|
3389
3036
|
};
|
|
3390
3037
|
};
|
|
3391
3038
|
var resolveBackendStepFallbackLabels = ({
|
|
@@ -3414,16 +3061,16 @@ var resolveBackendStepFallbackLabels = ({
|
|
|
3414
3061
|
completedLabel: labels.bridgeComplete
|
|
3415
3062
|
};
|
|
3416
3063
|
}
|
|
3417
|
-
const { amount
|
|
3064
|
+
const { amount, tokenSymbol, fromChain, toChain } = step.bridge;
|
|
3418
3065
|
if (fromChain === toChain) {
|
|
3419
3066
|
return {
|
|
3420
|
-
pendingLabel: labels.depositingFunds(
|
|
3421
|
-
completedLabel: labels.fundsDeposited(
|
|
3067
|
+
pendingLabel: labels.depositingFunds(amount, tokenSymbol, toChain),
|
|
3068
|
+
completedLabel: labels.fundsDeposited(amount, tokenSymbol, toChain)
|
|
3422
3069
|
};
|
|
3423
3070
|
}
|
|
3424
3071
|
return {
|
|
3425
|
-
pendingLabel: labels.bridgingFunds(
|
|
3426
|
-
completedLabel: labels.fundsBridged(
|
|
3072
|
+
pendingLabel: labels.bridgingFunds(amount, fromChain, toChain, tokenSymbol),
|
|
3073
|
+
completedLabel: labels.fundsBridged(amount, fromChain, toChain, tokenSymbol)
|
|
3427
3074
|
};
|
|
3428
3075
|
}
|
|
3429
3076
|
return {
|
|
@@ -3612,12 +3259,12 @@ var deriveExecutionOrderGroups = ({
|
|
|
3612
3259
|
...bridgeDefinitions.map((bridge, bridgeIndex) => {
|
|
3613
3260
|
const sourceChain = formatExecutionChainLabel(bridge.sourceChainId);
|
|
3614
3261
|
const destinationChain = formatExecutionChainLabel(bridge.destinationChainId);
|
|
3615
|
-
const
|
|
3262
|
+
const amount = formatTokenAmount(bridge.amount);
|
|
3616
3263
|
return {
|
|
3617
3264
|
id: `${groupId}-bridge-${bridgeIndex}`,
|
|
3618
3265
|
kind: "bridge",
|
|
3619
|
-
pendingLabel: labels.bridgingFunds(
|
|
3620
|
-
completedLabel: labels.fundsBridged(
|
|
3266
|
+
pendingLabel: labels.bridgingFunds(amount, sourceChain, destinationChain),
|
|
3267
|
+
completedLabel: labels.fundsBridged(amount, sourceChain, destinationChain),
|
|
3621
3268
|
realStatus: bridgeStatus
|
|
3622
3269
|
};
|
|
3623
3270
|
}),
|
|
@@ -3731,17 +3378,17 @@ var calculateExecutionProgress = ({
|
|
|
3731
3378
|
};
|
|
3732
3379
|
|
|
3733
3380
|
// src/trading/place-order/index.place-order.execution-view.tsx
|
|
3734
|
-
import { useEffect as useEffect3, useRef as useRef3, useState as
|
|
3735
|
-
import { jsx as
|
|
3381
|
+
import { useEffect as useEffect3, useRef as useRef3, useState as useState2 } from "react";
|
|
3382
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
3736
3383
|
var PlaceOrderExecutionHeader = ({
|
|
3737
3384
|
className,
|
|
3738
3385
|
eventDateLabel,
|
|
3739
3386
|
eventImage,
|
|
3740
3387
|
eventTitle
|
|
3741
3388
|
}) => {
|
|
3742
|
-
return /* @__PURE__ */
|
|
3743
|
-
/* @__PURE__ */
|
|
3744
|
-
/* @__PURE__ */
|
|
3389
|
+
return /* @__PURE__ */ jsxs4("div", { className: cn("agg-order-execution-header flex flex-col gap-2", className), children: [
|
|
3390
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-3", children: [
|
|
3391
|
+
/* @__PURE__ */ jsx4(
|
|
3745
3392
|
RemoteImage,
|
|
3746
3393
|
{
|
|
3747
3394
|
src: eventImage != null ? eventImage : null,
|
|
@@ -3749,15 +3396,15 @@ var PlaceOrderExecutionHeader = ({
|
|
|
3749
3396
|
className: "h-12 w-12 shrink-0 overflow-hidden rounded-agg-lg object-cover"
|
|
3750
3397
|
}
|
|
3751
3398
|
),
|
|
3752
|
-
/* @__PURE__ */
|
|
3399
|
+
/* @__PURE__ */ jsx4("p", { className: "min-w-0 flex-1 text-agg-base font-agg-bold leading-agg-6 text-agg-foreground line-clamp-2", children: eventTitle })
|
|
3753
3400
|
] }),
|
|
3754
|
-
eventDateLabel ? /* @__PURE__ */
|
|
3401
|
+
eventDateLabel ? /* @__PURE__ */ jsx4("p", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: eventDateLabel }) : null
|
|
3755
3402
|
] });
|
|
3756
3403
|
};
|
|
3757
3404
|
var PROGRESS_TWEEN_MS = 700;
|
|
3758
3405
|
var prefersReducedMotion = () => typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
3759
3406
|
var useTweenedProgress = (target, enabled) => {
|
|
3760
|
-
const [value, setValue] =
|
|
3407
|
+
const [value, setValue] = useState2(target);
|
|
3761
3408
|
const valueRef = useRef3(target);
|
|
3762
3409
|
useEffect3(() => {
|
|
3763
3410
|
const from = valueRef.current;
|
|
@@ -3789,12 +3436,12 @@ var ExecutionProgressBar = ({
|
|
|
3789
3436
|
const clamped = Math.max(0, Math.min(100, progress));
|
|
3790
3437
|
const displayed = useTweenedProgress(clamped, enableAnimations);
|
|
3791
3438
|
const isRunning = clamped < 100;
|
|
3792
|
-
return /* @__PURE__ */
|
|
3793
|
-
/* @__PURE__ */
|
|
3439
|
+
return /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-3", children: [
|
|
3440
|
+
/* @__PURE__ */ jsxs4("p", { className: "shrink-0 tabular-nums text-agg-sm leading-agg-5 text-agg-muted-foreground", children: [
|
|
3794
3441
|
displayed,
|
|
3795
3442
|
"%"
|
|
3796
3443
|
] }),
|
|
3797
|
-
/* @__PURE__ */
|
|
3444
|
+
/* @__PURE__ */ jsx4(
|
|
3798
3445
|
"div",
|
|
3799
3446
|
{
|
|
3800
3447
|
role: "progressbar",
|
|
@@ -3803,7 +3450,7 @@ var ExecutionProgressBar = ({
|
|
|
3803
3450
|
"aria-valuemax": 100,
|
|
3804
3451
|
"aria-valuenow": clamped,
|
|
3805
3452
|
className: "relative h-1 min-w-0 flex-1 overflow-hidden rounded-agg-full bg-agg-separator",
|
|
3806
|
-
children: /* @__PURE__ */
|
|
3453
|
+
children: /* @__PURE__ */ jsx4(
|
|
3807
3454
|
"div",
|
|
3808
3455
|
{
|
|
3809
3456
|
className: cn(
|
|
@@ -3814,7 +3461,7 @@ var ExecutionProgressBar = ({
|
|
|
3814
3461
|
)
|
|
3815
3462
|
),
|
|
3816
3463
|
style: { width: `${clamped}%` },
|
|
3817
|
-
children: isRunning ? /* @__PURE__ */
|
|
3464
|
+
children: isRunning ? /* @__PURE__ */ jsx4(
|
|
3818
3465
|
"span",
|
|
3819
3466
|
{
|
|
3820
3467
|
"aria-hidden": "true",
|
|
@@ -3838,7 +3485,7 @@ var ExecutionStepIndicator = ({
|
|
|
3838
3485
|
step
|
|
3839
3486
|
}) => {
|
|
3840
3487
|
if (step.status === "done") {
|
|
3841
|
-
return /* @__PURE__ */
|
|
3488
|
+
return /* @__PURE__ */ jsx4(
|
|
3842
3489
|
Icon,
|
|
3843
3490
|
{
|
|
3844
3491
|
name: "check-circle",
|
|
@@ -3849,7 +3496,7 @@ var ExecutionStepIndicator = ({
|
|
|
3849
3496
|
);
|
|
3850
3497
|
}
|
|
3851
3498
|
if (step.status === "loading") {
|
|
3852
|
-
return /* @__PURE__ */
|
|
3499
|
+
return /* @__PURE__ */ jsx4("span", { className: "inline-flex h-3 w-3 shrink-0 items-center justify-center", "aria-hidden": "true", children: /* @__PURE__ */ jsx4(
|
|
3853
3500
|
"span",
|
|
3854
3501
|
{
|
|
3855
3502
|
className: cn(
|
|
@@ -3860,7 +3507,7 @@ var ExecutionStepIndicator = ({
|
|
|
3860
3507
|
) });
|
|
3861
3508
|
}
|
|
3862
3509
|
if (step.status === "failed") {
|
|
3863
|
-
return /* @__PURE__ */
|
|
3510
|
+
return /* @__PURE__ */ jsx4(
|
|
3864
3511
|
Icon,
|
|
3865
3512
|
{
|
|
3866
3513
|
name: "error-filled",
|
|
@@ -3871,7 +3518,7 @@ var ExecutionStepIndicator = ({
|
|
|
3871
3518
|
);
|
|
3872
3519
|
}
|
|
3873
3520
|
if (step.status === "warning") {
|
|
3874
|
-
return /* @__PURE__ */
|
|
3521
|
+
return /* @__PURE__ */ jsx4(
|
|
3875
3522
|
Icon,
|
|
3876
3523
|
{
|
|
3877
3524
|
name: "warning-filled",
|
|
@@ -3881,7 +3528,7 @@ var ExecutionStepIndicator = ({
|
|
|
3881
3528
|
}
|
|
3882
3529
|
);
|
|
3883
3530
|
}
|
|
3884
|
-
return /* @__PURE__ */
|
|
3531
|
+
return /* @__PURE__ */ jsx4(
|
|
3885
3532
|
"span",
|
|
3886
3533
|
{
|
|
3887
3534
|
className: "h-3 w-3 shrink-0 rounded-full border border-dashed border-agg-separator",
|
|
@@ -3894,17 +3541,17 @@ var PlaceOrderExecutionGroups = ({
|
|
|
3894
3541
|
groups,
|
|
3895
3542
|
labels
|
|
3896
3543
|
}) => {
|
|
3897
|
-
return /* @__PURE__ */
|
|
3544
|
+
return /* @__PURE__ */ jsx4("div", { className: "agg-order-execution-groups flex flex-col gap-5", children: groups.map((group) => {
|
|
3898
3545
|
var _a, _b;
|
|
3899
|
-
return /* @__PURE__ */
|
|
3546
|
+
return /* @__PURE__ */ jsxs4(
|
|
3900
3547
|
"section",
|
|
3901
3548
|
{
|
|
3902
3549
|
className: "agg-order-execution-group flex flex-col gap-3",
|
|
3903
3550
|
"aria-label": (_a = group.title) != null ? _a : labels.venueOrder(group.venueLabel),
|
|
3904
3551
|
children: [
|
|
3905
|
-
/* @__PURE__ */
|
|
3906
|
-
/* @__PURE__ */
|
|
3907
|
-
group.venue ? /* @__PURE__ */
|
|
3552
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex min-h-5 items-center justify-between gap-3 text-agg-sm leading-agg-5", children: [
|
|
3553
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 items-center gap-2 text-agg-foreground", children: [
|
|
3554
|
+
group.venue ? /* @__PURE__ */ jsx4(
|
|
3908
3555
|
VenueLogo,
|
|
3909
3556
|
{
|
|
3910
3557
|
venue: group.venue,
|
|
@@ -3913,22 +3560,22 @@ var PlaceOrderExecutionGroups = ({
|
|
|
3913
3560
|
className: "h-3.5 w-3.5 shrink-0"
|
|
3914
3561
|
}
|
|
3915
3562
|
) : null,
|
|
3916
|
-
/* @__PURE__ */
|
|
3563
|
+
/* @__PURE__ */ jsx4("h3", { className: "truncate font-agg-normal", children: (_b = group.title) != null ? _b : labels.venueOrder(group.venueLabel) })
|
|
3917
3564
|
] }),
|
|
3918
|
-
/* @__PURE__ */
|
|
3919
|
-
/* @__PURE__ */
|
|
3920
|
-
/* @__PURE__ */
|
|
3565
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
3566
|
+
/* @__PURE__ */ jsx4("span", { className: "text-agg-muted-foreground", children: group.priceLabel }),
|
|
3567
|
+
/* @__PURE__ */ jsx4("span", { className: "text-agg-foreground", children: group.amountLabel })
|
|
3921
3568
|
] })
|
|
3922
3569
|
] }),
|
|
3923
|
-
/* @__PURE__ */
|
|
3570
|
+
/* @__PURE__ */ jsx4("div", { className: "flex flex-col gap-3 pl-[22px]", children: group.steps.map((step) => /* @__PURE__ */ jsxs4(
|
|
3924
3571
|
"div",
|
|
3925
3572
|
{
|
|
3926
3573
|
className: "flex items-start gap-2 text-agg-xs leading-agg-4 text-agg-foreground",
|
|
3927
3574
|
"data-kind": step.kind,
|
|
3928
3575
|
"data-status": step.status,
|
|
3929
3576
|
children: [
|
|
3930
|
-
/* @__PURE__ */
|
|
3931
|
-
/* @__PURE__ */
|
|
3577
|
+
/* @__PURE__ */ jsx4(ExecutionStepIndicator, { enableAnimations, step }),
|
|
3578
|
+
/* @__PURE__ */ jsx4("p", { className: "min-w-0 flex-1", children: step.status === "done" ? step.completedLabel : step.pendingLabel })
|
|
3932
3579
|
]
|
|
3933
3580
|
},
|
|
3934
3581
|
step.id
|
|
@@ -3951,7 +3598,7 @@ var PlaceOrderExecutionView = ({
|
|
|
3951
3598
|
progress,
|
|
3952
3599
|
settlementHint
|
|
3953
3600
|
}) => {
|
|
3954
|
-
return /* @__PURE__ */
|
|
3601
|
+
return /* @__PURE__ */ jsx4(
|
|
3955
3602
|
Card,
|
|
3956
3603
|
{
|
|
3957
3604
|
className: cn(
|
|
@@ -3960,8 +3607,8 @@ var PlaceOrderExecutionView = ({
|
|
|
3960
3607
|
classNames == null ? void 0 : classNames.root,
|
|
3961
3608
|
className
|
|
3962
3609
|
),
|
|
3963
|
-
children: /* @__PURE__ */
|
|
3964
|
-
/* @__PURE__ */
|
|
3610
|
+
children: /* @__PURE__ */ jsxs4("div", { className: cn("flex flex-col gap-6 p-5", classNames == null ? void 0 : classNames.body), children: [
|
|
3611
|
+
/* @__PURE__ */ jsx4(
|
|
3965
3612
|
PlaceOrderExecutionHeader,
|
|
3966
3613
|
{
|
|
3967
3614
|
className: classNames == null ? void 0 : classNames.header,
|
|
@@ -3970,8 +3617,8 @@ var PlaceOrderExecutionView = ({
|
|
|
3970
3617
|
eventTitle
|
|
3971
3618
|
}
|
|
3972
3619
|
),
|
|
3973
|
-
/* @__PURE__ */
|
|
3974
|
-
/* @__PURE__ */
|
|
3620
|
+
/* @__PURE__ */ jsxs4("div", { className: cn("flex flex-col gap-5", classNames == null ? void 0 : classNames.content), children: [
|
|
3621
|
+
/* @__PURE__ */ jsx4(
|
|
3975
3622
|
ExecutionProgressBar,
|
|
3976
3623
|
{
|
|
3977
3624
|
enableAnimations,
|
|
@@ -3979,7 +3626,7 @@ var PlaceOrderExecutionView = ({
|
|
|
3979
3626
|
progress
|
|
3980
3627
|
}
|
|
3981
3628
|
),
|
|
3982
|
-
/* @__PURE__ */
|
|
3629
|
+
/* @__PURE__ */ jsx4(
|
|
3983
3630
|
PlaceOrderExecutionGroups,
|
|
3984
3631
|
{
|
|
3985
3632
|
enableAnimations,
|
|
@@ -3987,7 +3634,7 @@ var PlaceOrderExecutionView = ({
|
|
|
3987
3634
|
labels
|
|
3988
3635
|
}
|
|
3989
3636
|
),
|
|
3990
|
-
settlementHint ? /* @__PURE__ */
|
|
3637
|
+
settlementHint ? /* @__PURE__ */ jsx4("p", { className: "text-agg-sm leading-agg-5 text-agg-muted-foreground", children: settlementHint }) : null
|
|
3991
3638
|
] })
|
|
3992
3639
|
] })
|
|
3993
3640
|
}
|
|
@@ -3996,7 +3643,7 @@ var PlaceOrderExecutionView = ({
|
|
|
3996
3643
|
PlaceOrderExecutionView.displayName = "PlaceOrderExecutionView";
|
|
3997
3644
|
|
|
3998
3645
|
// src/trading/place-order/index.place-order.failure.tsx
|
|
3999
|
-
import { jsx as
|
|
3646
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
4000
3647
|
var resolveFailureActionHandler = ({
|
|
4001
3648
|
action,
|
|
4002
3649
|
onDone,
|
|
@@ -4009,12 +3656,12 @@ var resolveFailureActionHandler = ({
|
|
|
4009
3656
|
};
|
|
4010
3657
|
var renderPartialFailureStep = (step) => {
|
|
4011
3658
|
const isWarningStep = step.tone === "warning" || step.tone === "error";
|
|
4012
|
-
return /* @__PURE__ */
|
|
3659
|
+
return /* @__PURE__ */ jsxs5(
|
|
4013
3660
|
"div",
|
|
4014
3661
|
{
|
|
4015
3662
|
className: "flex items-center gap-2 text-agg-sm leading-agg-5 text-agg-foreground",
|
|
4016
3663
|
children: [
|
|
4017
|
-
/* @__PURE__ */
|
|
3664
|
+
/* @__PURE__ */ jsx5(
|
|
4018
3665
|
Icon,
|
|
4019
3666
|
{
|
|
4020
3667
|
name: isWarningStep ? "warning-filled" : "check-circle",
|
|
@@ -4023,8 +3670,8 @@ var renderPartialFailureStep = (step) => {
|
|
|
4023
3670
|
"aria-hidden": "true"
|
|
4024
3671
|
}
|
|
4025
3672
|
),
|
|
4026
|
-
/* @__PURE__ */
|
|
4027
|
-
step.venue ? /* @__PURE__ */
|
|
3673
|
+
/* @__PURE__ */ jsx5("p", { className: "min-w-0 flex-1", children: step.label }),
|
|
3674
|
+
step.venue ? /* @__PURE__ */ jsx5(VenueLogo, { venue: step.venue, size: "small", className: "h-4 w-4 shrink-0" }) : null
|
|
4028
3675
|
]
|
|
4029
3676
|
},
|
|
4030
3677
|
step.id
|
|
@@ -4043,10 +3690,10 @@ var PlaceOrderFailureView = ({
|
|
|
4043
3690
|
const shouldShowPartialFailureLayout = summary.kind === "partial_fill";
|
|
4044
3691
|
const failureStepGroups = shouldShowPartialFailureLayout ? groupPlaceOrderFailureSteps(summary.steps) : [];
|
|
4045
3692
|
if (shouldShowPartialFailureLayout) {
|
|
4046
|
-
return /* @__PURE__ */
|
|
4047
|
-
/* @__PURE__ */
|
|
4048
|
-
/* @__PURE__ */
|
|
4049
|
-
/* @__PURE__ */
|
|
3693
|
+
return /* @__PURE__ */ jsx5(Card, { className: cn("group/agg-order-panel", getPlaceOrderContainerClassName(), className), children: /* @__PURE__ */ jsxs5("div", { className: "agg-order-failure-body flex flex-col gap-6 p-5", children: [
|
|
3694
|
+
/* @__PURE__ */ jsxs5("div", { className: "agg-order-failure-header flex flex-col gap-2", children: [
|
|
3695
|
+
/* @__PURE__ */ jsxs5("div", { className: "agg-order-failure-market flex items-center gap-3", children: [
|
|
3696
|
+
/* @__PURE__ */ jsx5(
|
|
4050
3697
|
RemoteImage,
|
|
4051
3698
|
{
|
|
4052
3699
|
src: (_a = summary.eventImage) != null ? _a : null,
|
|
@@ -4054,19 +3701,19 @@ var PlaceOrderFailureView = ({
|
|
|
4054
3701
|
className: "h-12 w-12 shrink-0 overflow-hidden rounded-agg-lg object-cover"
|
|
4055
3702
|
}
|
|
4056
3703
|
),
|
|
4057
|
-
/* @__PURE__ */
|
|
3704
|
+
/* @__PURE__ */ jsx5("p", { className: "min-w-0 flex-1 text-agg-base font-agg-bold leading-agg-6 text-agg-foreground line-clamp-2", children: summary.eventTitle })
|
|
4058
3705
|
] }),
|
|
4059
|
-
summary.eventSubtitle ? /* @__PURE__ */
|
|
3706
|
+
summary.eventSubtitle ? /* @__PURE__ */ jsx5("p", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: summary.eventSubtitle }) : null
|
|
4060
3707
|
] }),
|
|
4061
|
-
/* @__PURE__ */
|
|
3708
|
+
/* @__PURE__ */ jsx5("div", { className: "flex flex-col gap-4", children: ((_b = summary.executionGroups) == null ? void 0 : _b.length) ? /* @__PURE__ */ jsx5(
|
|
4062
3709
|
PlaceOrderExecutionGroups,
|
|
4063
3710
|
{
|
|
4064
3711
|
enableAnimations: false,
|
|
4065
3712
|
groups: summary.executionGroups,
|
|
4066
3713
|
labels: tradingLabels
|
|
4067
3714
|
}
|
|
4068
|
-
) : failureStepGroups.map((group, groupIndex) => /* @__PURE__ */
|
|
4069
|
-
summary.errorMessage ? /* @__PURE__ */
|
|
3715
|
+
) : failureStepGroups.map((group, groupIndex) => /* @__PURE__ */ jsx5("div", { className: "flex flex-col gap-2", children: group.map((step) => renderPartialFailureStep(step)) }, `failure-group-${groupIndex}`)) }),
|
|
3716
|
+
summary.errorMessage ? /* @__PURE__ */ jsx5(
|
|
4070
3717
|
InlineAlert,
|
|
4071
3718
|
{
|
|
4072
3719
|
tone: "error",
|
|
@@ -4074,20 +3721,20 @@ var PlaceOrderFailureView = ({
|
|
|
4074
3721
|
message: tradingLabels.orderFailureDescription(summary.errorMessage)
|
|
4075
3722
|
}
|
|
4076
3723
|
) : null,
|
|
4077
|
-
summary.result ? /* @__PURE__ */
|
|
4078
|
-
/* @__PURE__ */
|
|
4079
|
-
/* @__PURE__ */
|
|
4080
|
-
/* @__PURE__ */
|
|
4081
|
-
/* @__PURE__ */
|
|
3724
|
+
summary.result ? /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-4", children: [
|
|
3725
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between gap-4", children: [
|
|
3726
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex min-w-0 flex-col", children: [
|
|
3727
|
+
/* @__PURE__ */ jsx5("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.orderPartiallyFilled }),
|
|
3728
|
+
/* @__PURE__ */ jsx5("p", { className: "text-agg-sm leading-agg-5 text-agg-muted-foreground", children: tradingLabels.orderAveragePrice(summary.result.averagePriceLabel) })
|
|
4082
3729
|
] }),
|
|
4083
|
-
/* @__PURE__ */
|
|
3730
|
+
/* @__PURE__ */ jsx5("p", { className: "shrink-0 text-right text-[30px] font-agg-bold leading-[36px] text-agg-foreground", children: summary.result.filledAmountLabel })
|
|
4084
3731
|
] }),
|
|
4085
|
-
/* @__PURE__ */
|
|
4086
|
-
/* @__PURE__ */
|
|
4087
|
-
/* @__PURE__ */
|
|
3732
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between gap-4", children: [
|
|
3733
|
+
/* @__PURE__ */ jsx5("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.orderPayout }),
|
|
3734
|
+
/* @__PURE__ */ jsx5("p", { className: "shrink-0 text-right text-[30px] font-agg-bold leading-[36px] text-agg-success", children: summary.result.payoutLabel })
|
|
4088
3735
|
] })
|
|
4089
3736
|
] }) : null,
|
|
4090
|
-
/* @__PURE__ */
|
|
3737
|
+
/* @__PURE__ */ jsx5("div", { className: "flex flex-col gap-4", children: summary.actions.map((action) => /* @__PURE__ */ jsx5(
|
|
4091
3738
|
Button,
|
|
4092
3739
|
{
|
|
4093
3740
|
variant: action.variant === "retry" ? "primary" : "secondary",
|
|
@@ -4101,10 +3748,10 @@ var PlaceOrderFailureView = ({
|
|
|
4101
3748
|
)) })
|
|
4102
3749
|
] }) });
|
|
4103
3750
|
}
|
|
4104
|
-
return /* @__PURE__ */
|
|
4105
|
-
/* @__PURE__ */
|
|
4106
|
-
/* @__PURE__ */
|
|
4107
|
-
/* @__PURE__ */
|
|
3751
|
+
return /* @__PURE__ */ jsx5(Card, { className: cn("group/agg-order-panel", getPlaceOrderContainerClassName(), className), children: /* @__PURE__ */ jsxs5("div", { className: "agg-order-failure-body flex flex-col gap-6 p-5", children: [
|
|
3752
|
+
/* @__PURE__ */ jsxs5("div", { className: "agg-order-failure-header flex flex-col gap-2", children: [
|
|
3753
|
+
/* @__PURE__ */ jsxs5("div", { className: "agg-order-failure-market flex items-center gap-3", children: [
|
|
3754
|
+
/* @__PURE__ */ jsx5(
|
|
4108
3755
|
RemoteImage,
|
|
4109
3756
|
{
|
|
4110
3757
|
src: (_c = summary.eventImage) != null ? _c : null,
|
|
@@ -4112,11 +3759,11 @@ var PlaceOrderFailureView = ({
|
|
|
4112
3759
|
className: "h-12 w-12 shrink-0 overflow-hidden rounded-agg-lg object-cover"
|
|
4113
3760
|
}
|
|
4114
3761
|
),
|
|
4115
|
-
/* @__PURE__ */
|
|
3762
|
+
/* @__PURE__ */ jsx5("p", { className: "min-w-0 flex-1 text-agg-base font-agg-bold leading-agg-6 text-agg-foreground line-clamp-2", children: summary.eventTitle })
|
|
4116
3763
|
] }),
|
|
4117
|
-
summary.eventSubtitle ? /* @__PURE__ */
|
|
3764
|
+
summary.eventSubtitle ? /* @__PURE__ */ jsx5("p", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: summary.eventSubtitle }) : null
|
|
4118
3765
|
] }),
|
|
4119
|
-
((_d = summary.executionGroups) == null ? void 0 : _d.length) ? /* @__PURE__ */
|
|
3766
|
+
((_d = summary.executionGroups) == null ? void 0 : _d.length) ? /* @__PURE__ */ jsx5(
|
|
4120
3767
|
PlaceOrderExecutionGroups,
|
|
4121
3768
|
{
|
|
4122
3769
|
enableAnimations: false,
|
|
@@ -4124,7 +3771,7 @@ var PlaceOrderFailureView = ({
|
|
|
4124
3771
|
labels: tradingLabels
|
|
4125
3772
|
}
|
|
4126
3773
|
) : null,
|
|
4127
|
-
/* @__PURE__ */
|
|
3774
|
+
/* @__PURE__ */ jsx5(
|
|
4128
3775
|
InlineAlert,
|
|
4129
3776
|
{
|
|
4130
3777
|
tone: "error",
|
|
@@ -4133,7 +3780,7 @@ var PlaceOrderFailureView = ({
|
|
|
4133
3780
|
message: tradingLabels.orderFailureDescription((_e = summary.errorMessage) != null ? _e : "")
|
|
4134
3781
|
}
|
|
4135
3782
|
),
|
|
4136
|
-
/* @__PURE__ */
|
|
3783
|
+
/* @__PURE__ */ jsx5("div", { className: "agg-order-failure-actions flex flex-col gap-4", children: summary.actions.map((action) => /* @__PURE__ */ jsx5(
|
|
4137
3784
|
Button,
|
|
4138
3785
|
{
|
|
4139
3786
|
variant: action.variant === "retry" ? "primary" : "secondary",
|
|
@@ -4150,7 +3797,7 @@ var PlaceOrderFailureView = ({
|
|
|
4150
3797
|
PlaceOrderFailureView.displayName = "PlaceOrderFailureView";
|
|
4151
3798
|
|
|
4152
3799
|
// src/trading/place-order/index.place-order.success.tsx
|
|
4153
|
-
import { jsx as
|
|
3800
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
4154
3801
|
var resolveBuyPayoutLabel = (shares) => {
|
|
4155
3802
|
if (!shares) return "$0";
|
|
4156
3803
|
return shares.startsWith("$") ? shares : `$${shares}`;
|
|
@@ -4171,7 +3818,7 @@ var PlaceOrderSuccessView = ({
|
|
|
4171
3818
|
const amountTitle = isLimitOrder ? tradingLabels.orderAmount : summary.resultState === "partial" ? tradingLabels.orderPartiallyFilled : tradingLabels.orderFullyFilled;
|
|
4172
3819
|
const amountSubtitle = isLimitOrder ? tradingLabels.orderLimitPrice((_d = summary.limitPriceLabel) != null ? _d : summary.avgPrice) : tradingLabels.orderAveragePrice(summary.avgPrice);
|
|
4173
3820
|
const legacyExecutionSteps = ((_e = summary.executionStepGroups) != null ? _e : []).flat();
|
|
4174
|
-
return /* @__PURE__ */
|
|
3821
|
+
return /* @__PURE__ */ jsx6(
|
|
4175
3822
|
Card,
|
|
4176
3823
|
{
|
|
4177
3824
|
className: cn(
|
|
@@ -4180,8 +3827,8 @@ var PlaceOrderSuccessView = ({
|
|
|
4180
3827
|
"border-0 ring-1 ring-inset ring-agg-separator",
|
|
4181
3828
|
className
|
|
4182
3829
|
),
|
|
4183
|
-
children: /* @__PURE__ */
|
|
4184
|
-
summary.eventTitle ? /* @__PURE__ */
|
|
3830
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "agg-order-success-body flex flex-col gap-6 p-5", children: [
|
|
3831
|
+
summary.eventTitle ? /* @__PURE__ */ jsx6(
|
|
4185
3832
|
PlaceOrderExecutionHeader,
|
|
4186
3833
|
{
|
|
4187
3834
|
eventDateLabel: summary.eventDateLabel,
|
|
@@ -4189,19 +3836,19 @@ var PlaceOrderSuccessView = ({
|
|
|
4189
3836
|
eventTitle: summary.eventTitle
|
|
4190
3837
|
}
|
|
4191
3838
|
) : null,
|
|
4192
|
-
((_f = summary.executionGroups) == null ? void 0 : _f.length) ? /* @__PURE__ */
|
|
3839
|
+
((_f = summary.executionGroups) == null ? void 0 : _f.length) ? /* @__PURE__ */ jsx6(
|
|
4193
3840
|
PlaceOrderExecutionGroups,
|
|
4194
3841
|
{
|
|
4195
3842
|
enableAnimations: false,
|
|
4196
3843
|
groups: summary.executionGroups,
|
|
4197
3844
|
labels: tradingLabels
|
|
4198
3845
|
}
|
|
4199
|
-
) : legacyExecutionSteps.length > 0 ? /* @__PURE__ */
|
|
3846
|
+
) : legacyExecutionSteps.length > 0 ? /* @__PURE__ */ jsx6("div", { className: "flex flex-col gap-3 pl-[22px]", children: legacyExecutionSteps.map((step) => /* @__PURE__ */ jsxs6(
|
|
4200
3847
|
"div",
|
|
4201
3848
|
{
|
|
4202
3849
|
className: "flex items-start gap-2 text-agg-xs leading-agg-4 text-agg-foreground",
|
|
4203
3850
|
children: [
|
|
4204
|
-
/* @__PURE__ */
|
|
3851
|
+
/* @__PURE__ */ jsx6(
|
|
4205
3852
|
Icon,
|
|
4206
3853
|
{
|
|
4207
3854
|
name: step.tone === "warning" || step.tone === "error" ? "warning-filled" : "check-circle",
|
|
@@ -4213,28 +3860,28 @@ var PlaceOrderSuccessView = ({
|
|
|
4213
3860
|
"aria-hidden": "true"
|
|
4214
3861
|
}
|
|
4215
3862
|
),
|
|
4216
|
-
/* @__PURE__ */
|
|
3863
|
+
/* @__PURE__ */ jsx6("p", { className: "min-w-0 flex-1", children: step.label })
|
|
4217
3864
|
]
|
|
4218
3865
|
},
|
|
4219
3866
|
step.id
|
|
4220
3867
|
)) }) : null,
|
|
4221
|
-
/* @__PURE__ */
|
|
4222
|
-
/* @__PURE__ */
|
|
4223
|
-
/* @__PURE__ */
|
|
4224
|
-
/* @__PURE__ */
|
|
4225
|
-
/* @__PURE__ */
|
|
3868
|
+
/* @__PURE__ */ jsxs6("div", { className: "agg-order-success-summary flex flex-col gap-4", children: [
|
|
3869
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between gap-4", children: [
|
|
3870
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex min-w-0 flex-col", children: [
|
|
3871
|
+
/* @__PURE__ */ jsx6("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: amountTitle }),
|
|
3872
|
+
/* @__PURE__ */ jsx6("p", { className: "text-agg-sm leading-agg-5 text-agg-muted-foreground", children: amountSubtitle })
|
|
4226
3873
|
] }),
|
|
4227
|
-
/* @__PURE__ */
|
|
3874
|
+
/* @__PURE__ */ jsx6("p", { className: "shrink-0 text-right text-[30px] font-agg-bold leading-[36px] text-agg-foreground", children: resolvedAmountLabel })
|
|
4228
3875
|
] }),
|
|
4229
|
-
/* @__PURE__ */
|
|
4230
|
-
/* @__PURE__ */
|
|
4231
|
-
/* @__PURE__ */
|
|
4232
|
-
potentialReturnLabel ? /* @__PURE__ */
|
|
3876
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between gap-4", children: [
|
|
3877
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex min-w-0 flex-col gap-0.5", children: [
|
|
3878
|
+
/* @__PURE__ */ jsx6("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.orderPayout }),
|
|
3879
|
+
potentialReturnLabel ? /* @__PURE__ */ jsx6("span", { className: "agg-type-overline agg-text-brand", children: potentialReturnLabel }) : null
|
|
4233
3880
|
] }),
|
|
4234
|
-
/* @__PURE__ */
|
|
3881
|
+
/* @__PURE__ */ jsx6("p", { className: "shrink-0 text-right text-[30px] font-agg-bold leading-[36px] text-agg-success", children: resolvedPayoutLabel })
|
|
4235
3882
|
] })
|
|
4236
3883
|
] }),
|
|
4237
|
-
/* @__PURE__ */
|
|
3884
|
+
/* @__PURE__ */ jsx6(
|
|
4238
3885
|
Button,
|
|
4239
3886
|
{
|
|
4240
3887
|
variant: "secondary",
|
|
@@ -4252,7 +3899,7 @@ var PlaceOrderSuccessView = ({
|
|
|
4252
3899
|
PlaceOrderSuccessView.displayName = "PlaceOrderSuccessView";
|
|
4253
3900
|
|
|
4254
3901
|
// src/trading/place-order/index.tsx
|
|
4255
|
-
import { Fragment as
|
|
3902
|
+
import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
4256
3903
|
var SELL_SHARE_INPUT_DECIMALS = 6;
|
|
4257
3904
|
var SELL_SHARE_DISPLAY_DECIMALS = 2;
|
|
4258
3905
|
var resolvePlaceOrderPortalContainer = (triggerElement) => {
|
|
@@ -4277,12 +3924,12 @@ var toLimitPriceRaw = (value) => {
|
|
|
4277
3924
|
return Math.round(clampedValue * Number(LIMIT_ORDER_RAW_SCALE)).toString();
|
|
4278
3925
|
};
|
|
4279
3926
|
var toLimitSizeRaw = ({
|
|
4280
|
-
amount
|
|
3927
|
+
amount,
|
|
4281
3928
|
limitPriceRaw,
|
|
4282
3929
|
side
|
|
4283
3930
|
}) => {
|
|
4284
|
-
if (side === "sell") return toRaw6(
|
|
4285
|
-
const spendRaw = BigInt(toRaw6(
|
|
3931
|
+
if (side === "sell") return toRaw6(amount);
|
|
3932
|
+
const spendRaw = BigInt(toRaw6(amount));
|
|
4286
3933
|
const priceRaw = BigInt(limitPriceRaw);
|
|
4287
3934
|
return ceilDiv(spendRaw * LIMIT_ORDER_RAW_SCALE, priceRaw).toString();
|
|
4288
3935
|
};
|
|
@@ -4323,13 +3970,13 @@ var buildLimitOrderExecutionGroup = ({
|
|
|
4323
3970
|
};
|
|
4324
3971
|
};
|
|
4325
3972
|
var getLimitOrderToWinValue = ({
|
|
4326
|
-
amount
|
|
3973
|
+
amount,
|
|
4327
3974
|
limitPriceRaw,
|
|
4328
3975
|
side
|
|
4329
3976
|
}) => {
|
|
4330
3977
|
const priceRaw = BigInt(limitPriceRaw);
|
|
4331
3978
|
if (priceRaw <= BigInt(0) || priceRaw >= LIMIT_ORDER_RAW_SCALE) return 0;
|
|
4332
|
-
const sizeRaw = BigInt(toLimitSizeRaw({ amount
|
|
3979
|
+
const sizeRaw = BigInt(toLimitSizeRaw({ amount, limitPriceRaw, side }));
|
|
4333
3980
|
if (side === "buy") return Number(sizeRaw) / Number(LIMIT_ORDER_RAW_SCALE);
|
|
4334
3981
|
return Number(ceilDiv(priceRaw * sizeRaw, LIMIT_ORDER_RAW_SCALE)) / Number(LIMIT_ORDER_RAW_SCALE);
|
|
4335
3982
|
};
|
|
@@ -4397,18 +4044,18 @@ var PlaceOrderSlippageControl = ({
|
|
|
4397
4044
|
minimumValue: slippageMinimumValue
|
|
4398
4045
|
}) => {
|
|
4399
4046
|
var _a, _b;
|
|
4400
|
-
const labels =
|
|
4047
|
+
const labels = useLabels3();
|
|
4401
4048
|
const containerRef = useRef4(null);
|
|
4402
4049
|
const triggerRef = useRef4(null);
|
|
4403
4050
|
const inputRef = useRef4(null);
|
|
4404
4051
|
const warningId = useId();
|
|
4405
4052
|
const defaultValue = finalizePercentageValue(slippageDefaultValue);
|
|
4406
4053
|
const committedValue = finalizePercentageValue(slippageValue) || defaultValue;
|
|
4407
|
-
const [draftValue, setDraftValue] =
|
|
4408
|
-
const [isEditing, setIsEditing] =
|
|
4054
|
+
const [draftValue, setDraftValue] = useState3(committedValue);
|
|
4055
|
+
const [isEditing, setIsEditing] = useState3(
|
|
4409
4056
|
() => isPercentageBelowMinimum(committedValue, slippageMinimumValue)
|
|
4410
4057
|
);
|
|
4411
|
-
const [shouldFocusInput, setShouldFocusInput] =
|
|
4058
|
+
const [shouldFocusInput, setShouldFocusInput] = useState3(false);
|
|
4412
4059
|
useEffect4(() => {
|
|
4413
4060
|
setDraftValue(committedValue);
|
|
4414
4061
|
if (isPercentageBelowMinimum(committedValue, slippageMinimumValue)) {
|
|
@@ -4495,8 +4142,8 @@ var PlaceOrderSlippageControl = ({
|
|
|
4495
4142
|
if (!isEditing) return;
|
|
4496
4143
|
handleCommitDraft(false);
|
|
4497
4144
|
};
|
|
4498
|
-
return /* @__PURE__ */
|
|
4499
|
-
/* @__PURE__ */
|
|
4145
|
+
return /* @__PURE__ */ jsxs7("div", { ref: containerRef, className: "agg-slippage-control w-full", onBlur: handleContainerBlur, children: [
|
|
4146
|
+
/* @__PURE__ */ jsxs7(
|
|
4500
4147
|
"button",
|
|
4501
4148
|
{
|
|
4502
4149
|
ref: triggerRef,
|
|
@@ -4514,8 +4161,8 @@ var PlaceOrderSlippageControl = ({
|
|
|
4514
4161
|
),
|
|
4515
4162
|
onClick: handleToggleEditing,
|
|
4516
4163
|
children: [
|
|
4517
|
-
/* @__PURE__ */
|
|
4518
|
-
/* @__PURE__ */
|
|
4164
|
+
/* @__PURE__ */ jsx7("span", { className: "agg-slippage-label", children: collapsedLabel }),
|
|
4165
|
+
/* @__PURE__ */ jsx7(
|
|
4519
4166
|
Icon,
|
|
4520
4167
|
{
|
|
4521
4168
|
name: isEditing ? "chevron-up" : "pencil",
|
|
@@ -4527,7 +4174,7 @@ var PlaceOrderSlippageControl = ({
|
|
|
4527
4174
|
]
|
|
4528
4175
|
}
|
|
4529
4176
|
),
|
|
4530
|
-
/* @__PURE__ */
|
|
4177
|
+
/* @__PURE__ */ jsx7(
|
|
4531
4178
|
"div",
|
|
4532
4179
|
{
|
|
4533
4180
|
"aria-hidden": !isEditing,
|
|
@@ -4541,10 +4188,10 @@ var PlaceOrderSlippageControl = ({
|
|
|
4541
4188
|
"transition-[grid-template-rows,opacity,margin-top] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)]"
|
|
4542
4189
|
)
|
|
4543
4190
|
),
|
|
4544
|
-
children: /* @__PURE__ */
|
|
4545
|
-
/* @__PURE__ */
|
|
4546
|
-
/* @__PURE__ */
|
|
4547
|
-
/* @__PURE__ */
|
|
4191
|
+
children: /* @__PURE__ */ jsx7("div", { className: "min-h-0", children: /* @__PURE__ */ jsxs7("div", { className: "agg-slippage-editor-body flex flex-col gap-2", children: [
|
|
4192
|
+
/* @__PURE__ */ jsxs7("div", { className: "agg-slippage-input-row flex h-9 overflow-hidden rounded-agg-sm border border-agg-separator", children: [
|
|
4193
|
+
/* @__PURE__ */ jsxs7("div", { className: "agg-slippage-input-group flex min-w-0 flex-1 items-center gap-2 bg-agg-secondary px-3", children: [
|
|
4194
|
+
/* @__PURE__ */ jsx7(
|
|
4548
4195
|
"input",
|
|
4549
4196
|
{
|
|
4550
4197
|
ref: inputRef,
|
|
@@ -4559,7 +4206,7 @@ var PlaceOrderSlippageControl = ({
|
|
|
4559
4206
|
onKeyDown: handleInputKeyDown
|
|
4560
4207
|
}
|
|
4561
4208
|
),
|
|
4562
|
-
/* @__PURE__ */
|
|
4209
|
+
/* @__PURE__ */ jsx7(
|
|
4563
4210
|
"button",
|
|
4564
4211
|
{
|
|
4565
4212
|
type: "button",
|
|
@@ -4577,8 +4224,8 @@ var PlaceOrderSlippageControl = ({
|
|
|
4577
4224
|
}
|
|
4578
4225
|
)
|
|
4579
4226
|
] }),
|
|
4580
|
-
/* @__PURE__ */
|
|
4581
|
-
/* @__PURE__ */
|
|
4227
|
+
/* @__PURE__ */ jsx7("div", { className: "h-full w-px bg-agg-separator", "aria-hidden": "true" }),
|
|
4228
|
+
/* @__PURE__ */ jsx7(
|
|
4582
4229
|
"div",
|
|
4583
4230
|
{
|
|
4584
4231
|
className: "agg-slippage-suffix flex w-9 items-center justify-center bg-agg-secondary-hover text-agg-sm leading-agg-5 text-agg-muted-foreground",
|
|
@@ -4587,7 +4234,7 @@ var PlaceOrderSlippageControl = ({
|
|
|
4587
4234
|
}
|
|
4588
4235
|
)
|
|
4589
4236
|
] }),
|
|
4590
|
-
/* @__PURE__ */
|
|
4237
|
+
/* @__PURE__ */ jsx7(
|
|
4591
4238
|
"div",
|
|
4592
4239
|
{
|
|
4593
4240
|
"aria-hidden": !resolvedWarningMessage,
|
|
@@ -4601,13 +4248,13 @@ var PlaceOrderSlippageControl = ({
|
|
|
4601
4248
|
"transition-[grid-template-rows,opacity] duration-200 ease-[cubic-bezier(0.22,1,0.36,1)]"
|
|
4602
4249
|
)
|
|
4603
4250
|
),
|
|
4604
|
-
children: /* @__PURE__ */
|
|
4251
|
+
children: /* @__PURE__ */ jsx7("div", { className: "min-h-0", children: /* @__PURE__ */ jsxs7(
|
|
4605
4252
|
"div",
|
|
4606
4253
|
{
|
|
4607
4254
|
id: warningId,
|
|
4608
4255
|
className: "agg-slippage-warning-message flex items-start gap-2 text-agg-sm leading-agg-5 text-agg-foreground",
|
|
4609
4256
|
children: [
|
|
4610
|
-
/* @__PURE__ */
|
|
4257
|
+
/* @__PURE__ */ jsx7(
|
|
4611
4258
|
Icon,
|
|
4612
4259
|
{
|
|
4613
4260
|
name: "warning-filled",
|
|
@@ -4616,7 +4263,7 @@ var PlaceOrderSlippageControl = ({
|
|
|
4616
4263
|
color: "currentColor"
|
|
4617
4264
|
}
|
|
4618
4265
|
),
|
|
4619
|
-
/* @__PURE__ */
|
|
4266
|
+
/* @__PURE__ */ jsx7("p", { children: resolvedWarningMessage != null ? resolvedWarningMessage : "" })
|
|
4620
4267
|
]
|
|
4621
4268
|
}
|
|
4622
4269
|
) })
|
|
@@ -4637,30 +4284,30 @@ var renderCardHeader = ({
|
|
|
4637
4284
|
onClose
|
|
4638
4285
|
}) => {
|
|
4639
4286
|
if (!headerTitle) return null;
|
|
4640
|
-
return /* @__PURE__ */
|
|
4641
|
-
/* @__PURE__ */
|
|
4642
|
-
/* @__PURE__ */
|
|
4287
|
+
return /* @__PURE__ */ jsxs7("div", { className: cn("agg-order-panel-header flex flex-col gap-2", className), children: [
|
|
4288
|
+
/* @__PURE__ */ jsxs7("div", { className: "agg-order-market-summary flex items-center gap-3", children: [
|
|
4289
|
+
/* @__PURE__ */ jsx7(
|
|
4643
4290
|
RemoteImage,
|
|
4644
4291
|
{
|
|
4645
4292
|
src: headerImage,
|
|
4646
4293
|
alt: "",
|
|
4647
|
-
fallback: headerVenue ? /* @__PURE__ */
|
|
4294
|
+
fallback: headerVenue ? /* @__PURE__ */ jsx7(VenueLogo, { venue: headerVenue, size: "large" }) : void 0,
|
|
4648
4295
|
className: "agg-order-market-image h-12 w-12 shrink-0 overflow-hidden rounded-agg-lg object-cover"
|
|
4649
4296
|
}
|
|
4650
4297
|
),
|
|
4651
|
-
/* @__PURE__ */
|
|
4652
|
-
onClose ? /* @__PURE__ */
|
|
4298
|
+
/* @__PURE__ */ jsx7("p", { className: "agg-order-market-title min-w-0 flex-1 text-agg-base font-agg-bold leading-agg-6 text-agg-foreground line-clamp-2", children: headerTitle }),
|
|
4299
|
+
onClose ? /* @__PURE__ */ jsx7(
|
|
4653
4300
|
"button",
|
|
4654
4301
|
{
|
|
4655
4302
|
type: "button",
|
|
4656
4303
|
className: "agg-order-close -mr-1 -mt-1 hidden shrink-0 cursor-pointer items-center justify-center p-1 text-agg-muted-foreground hover:text-agg-foreground sm:flex",
|
|
4657
4304
|
"aria-label": "Close",
|
|
4658
4305
|
onClick: onClose,
|
|
4659
|
-
children: /* @__PURE__ */
|
|
4306
|
+
children: /* @__PURE__ */ jsx7(CloseIcon, { className: "h-5 w-5" })
|
|
4660
4307
|
}
|
|
4661
4308
|
) : null
|
|
4662
4309
|
] }),
|
|
4663
|
-
headerSubtitle ? /* @__PURE__ */
|
|
4310
|
+
headerSubtitle ? /* @__PURE__ */ jsx7("p", { className: "agg-order-market-subtitle text-agg-base leading-agg-6 text-agg-foreground", children: headerSubtitle }) : null
|
|
4664
4311
|
] });
|
|
4665
4312
|
};
|
|
4666
4313
|
var PlaceOrderResolvedView = ({
|
|
@@ -4673,7 +4320,7 @@ var PlaceOrderResolvedView = ({
|
|
|
4673
4320
|
showResolvingState = false
|
|
4674
4321
|
}) => {
|
|
4675
4322
|
var _a, _b;
|
|
4676
|
-
const labels =
|
|
4323
|
+
const labels = useLabels3();
|
|
4677
4324
|
const tradingLabels = labels.trading;
|
|
4678
4325
|
const resolvingTimestamp = (_a = resolutionTimestamp != null ? resolutionTimestamp : tradingState.resolvesAt) != null ? _a : tradingState.endsAt;
|
|
4679
4326
|
const isResolvingMarket = showResolvingState && !tradingState.winningOutcome;
|
|
@@ -4682,7 +4329,7 @@ var PlaceOrderResolvedView = ({
|
|
|
4682
4329
|
return endDateLabel ? `${tradingState.market.question} \xB7 ${endDateLabel}` : tradingState.market.question;
|
|
4683
4330
|
})() : "";
|
|
4684
4331
|
if (isResolvingMarket) {
|
|
4685
|
-
return /* @__PURE__ */
|
|
4332
|
+
return /* @__PURE__ */ jsx7(
|
|
4686
4333
|
Card,
|
|
4687
4334
|
{
|
|
4688
4335
|
className: cn(
|
|
@@ -4693,7 +4340,7 @@ var PlaceOrderResolvedView = ({
|
|
|
4693
4340
|
),
|
|
4694
4341
|
role: "status",
|
|
4695
4342
|
"aria-label": labels.marketDetails.resolvingTitle,
|
|
4696
|
-
children: /* @__PURE__ */
|
|
4343
|
+
children: /* @__PURE__ */ jsxs7(
|
|
4697
4344
|
"div",
|
|
4698
4345
|
{
|
|
4699
4346
|
className: cn(
|
|
@@ -4701,12 +4348,12 @@ var PlaceOrderResolvedView = ({
|
|
|
4701
4348
|
classNames == null ? void 0 : classNames.body
|
|
4702
4349
|
),
|
|
4703
4350
|
children: [
|
|
4704
|
-
/* @__PURE__ */
|
|
4705
|
-
/* @__PURE__ */
|
|
4706
|
-
/* @__PURE__ */
|
|
4707
|
-
resolvingSubtitle ? /* @__PURE__ */
|
|
4351
|
+
/* @__PURE__ */ jsx7("div", { className: "flex h-[60px] w-[60px] items-center justify-center rounded-full bg-agg-primary/10", children: /* @__PURE__ */ jsx7(LoadingIcon, { variant: "prominent" }) }),
|
|
4352
|
+
/* @__PURE__ */ jsxs7("div", { className: cn("flex w-full flex-col items-center gap-1", classNames == null ? void 0 : classNames.content), children: [
|
|
4353
|
+
/* @__PURE__ */ jsx7(Typography, { variant: "body-large-strong", children: labels.marketDetails.resolvingTitle }),
|
|
4354
|
+
resolvingSubtitle ? /* @__PURE__ */ jsx7(Typography, { variant: "body", className: "text-center", children: resolvingSubtitle }) : null
|
|
4708
4355
|
] }),
|
|
4709
|
-
/* @__PURE__ */
|
|
4356
|
+
/* @__PURE__ */ jsx7(
|
|
4710
4357
|
Typography,
|
|
4711
4358
|
{
|
|
4712
4359
|
variant: "label",
|
|
@@ -4720,7 +4367,7 @@ var PlaceOrderResolvedView = ({
|
|
|
4720
4367
|
}
|
|
4721
4368
|
);
|
|
4722
4369
|
}
|
|
4723
|
-
return /* @__PURE__ */
|
|
4370
|
+
return /* @__PURE__ */ jsx7(
|
|
4724
4371
|
Card,
|
|
4725
4372
|
{
|
|
4726
4373
|
className: cn(
|
|
@@ -4729,19 +4376,19 @@ var PlaceOrderResolvedView = ({
|
|
|
4729
4376
|
classNames == null ? void 0 : classNames.root,
|
|
4730
4377
|
className
|
|
4731
4378
|
),
|
|
4732
|
-
children: /* @__PURE__ */
|
|
4733
|
-
/* @__PURE__ */
|
|
4734
|
-
/* @__PURE__ */
|
|
4379
|
+
children: /* @__PURE__ */ jsxs7("div", { className: cn("agg-order-panel-body flex flex-col", classNames == null ? void 0 : classNames.body), children: [
|
|
4380
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col items-center gap-6 p-8", children: [
|
|
4381
|
+
/* @__PURE__ */ jsx7(
|
|
4735
4382
|
"div",
|
|
4736
4383
|
{
|
|
4737
4384
|
className: cn(
|
|
4738
4385
|
"flex h-15 w-15 items-center justify-center rounded-full",
|
|
4739
4386
|
"bg-agg-primary/15"
|
|
4740
4387
|
),
|
|
4741
|
-
children: /* @__PURE__ */
|
|
4388
|
+
children: /* @__PURE__ */ jsx7(Icon, { name: "success-check", className: cn("h-6 w-6", "text-agg-primary") })
|
|
4742
4389
|
}
|
|
4743
4390
|
),
|
|
4744
|
-
/* @__PURE__ */
|
|
4391
|
+
/* @__PURE__ */ jsxs7(
|
|
4745
4392
|
"div",
|
|
4746
4393
|
{
|
|
4747
4394
|
className: cn(
|
|
@@ -4749,8 +4396,8 @@ var PlaceOrderResolvedView = ({
|
|
|
4749
4396
|
classNames == null ? void 0 : classNames.content
|
|
4750
4397
|
),
|
|
4751
4398
|
children: [
|
|
4752
|
-
tradingState.market ? /* @__PURE__ */
|
|
4753
|
-
tradingState.winningOutcome ? /* @__PURE__ */
|
|
4399
|
+
tradingState.market ? /* @__PURE__ */ jsx7(Typography, { variant: "body", className: "text-center", children: tradingState.market.question }) : null,
|
|
4400
|
+
tradingState.winningOutcome ? /* @__PURE__ */ jsx7(Typography, { variant: "body-large-strong", children: tradingLabels.outcome(
|
|
4754
4401
|
shouldUseRawResolvedPlaceOrderOutcomeLabel(
|
|
4755
4402
|
tradingState.market,
|
|
4756
4403
|
tradingState.winningOutcome
|
|
@@ -4764,25 +4411,25 @@ var PlaceOrderResolvedView = ({
|
|
|
4764
4411
|
}
|
|
4765
4412
|
)
|
|
4766
4413
|
] }),
|
|
4767
|
-
resolvedClaim ? /* @__PURE__ */
|
|
4768
|
-
/* @__PURE__ */
|
|
4769
|
-
/* @__PURE__ */
|
|
4770
|
-
/* @__PURE__ */
|
|
4771
|
-
/* @__PURE__ */
|
|
4772
|
-
resolvedClaim.resolutionDateLabel ? /* @__PURE__ */
|
|
4773
|
-
/* @__PURE__ */
|
|
4774
|
-
/* @__PURE__ */
|
|
4414
|
+
resolvedClaim ? /* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
4415
|
+
/* @__PURE__ */ jsx7("div", { className: "h-px w-full bg-agg-separator" }),
|
|
4416
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex w-full flex-col gap-5 p-6", children: [
|
|
4417
|
+
/* @__PURE__ */ jsx7(Typography, { variant: "body-strong", className: "text-center", children: tradingLabels.resolvedEarningsTitle }),
|
|
4418
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-3 text-agg-sm leading-agg-5 text-agg-foreground", children: [
|
|
4419
|
+
resolvedClaim.resolutionDateLabel ? /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between gap-4", children: [
|
|
4420
|
+
/* @__PURE__ */ jsx7("span", { children: tradingLabels.resolvedResolutionDateLabel }),
|
|
4421
|
+
/* @__PURE__ */ jsx7("span", { className: "font-agg-bold", children: resolvedClaim.resolutionDateLabel })
|
|
4775
4422
|
] }) : null,
|
|
4776
|
-
/* @__PURE__ */
|
|
4777
|
-
/* @__PURE__ */
|
|
4778
|
-
/* @__PURE__ */
|
|
4423
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between gap-4", children: [
|
|
4424
|
+
/* @__PURE__ */ jsx7("span", { children: tradingLabels.resolvedSharesLabel }),
|
|
4425
|
+
/* @__PURE__ */ jsx7("span", { className: "font-agg-bold", children: resolvedClaim.sharesLabel })
|
|
4779
4426
|
] }),
|
|
4780
|
-
/* @__PURE__ */
|
|
4781
|
-
/* @__PURE__ */
|
|
4782
|
-
/* @__PURE__ */
|
|
4427
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between gap-4", children: [
|
|
4428
|
+
/* @__PURE__ */ jsx7("span", { children: tradingLabels.resolvedTotalPayoutLabel }),
|
|
4429
|
+
/* @__PURE__ */ jsx7("span", { className: "font-agg-bold", children: resolvedClaim.totalPayoutLabel })
|
|
4783
4430
|
] })
|
|
4784
4431
|
] }),
|
|
4785
|
-
resolvedClaim.onClaim ? /* @__PURE__ */
|
|
4432
|
+
resolvedClaim.onClaim ? /* @__PURE__ */ jsx7(
|
|
4786
4433
|
Button,
|
|
4787
4434
|
{
|
|
4788
4435
|
size: "large",
|
|
@@ -4804,21 +4451,21 @@ var renderRouteBreakdownRow = (row, sharedKycStatus, tradingLabels) => {
|
|
|
4804
4451
|
const venueLabel = getTradingVenueLabel(row.venue);
|
|
4805
4452
|
const rowKey = `${row.venue}-${row.label}-${row.priceLabel}-${(_a = row.resultLabel) != null ? _a : ""}`;
|
|
4806
4453
|
const showSharedKycRequirement = row.requiresSharedKyc === true && sharedKycStatus !== void 0 && sharedKycStatus !== "verified";
|
|
4807
|
-
return /* @__PURE__ */
|
|
4454
|
+
return /* @__PURE__ */ jsxs7(
|
|
4808
4455
|
"div",
|
|
4809
4456
|
{
|
|
4810
4457
|
className: "agg-route-breakdown-row flex items-center justify-between gap-4 text-left",
|
|
4811
4458
|
children: [
|
|
4812
|
-
/* @__PURE__ */
|
|
4813
|
-
/* @__PURE__ */
|
|
4814
|
-
/* @__PURE__ */
|
|
4815
|
-
/* @__PURE__ */
|
|
4816
|
-
showSharedKycRequirement ? /* @__PURE__ */
|
|
4459
|
+
/* @__PURE__ */ jsxs7("div", { className: "agg-route-breakdown-market flex min-w-0 items-center gap-2", children: [
|
|
4460
|
+
/* @__PURE__ */ jsx7(VenueLogo, { venue: row.venue, className: "size-3!", ariaLabel: venueLabel }),
|
|
4461
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex min-w-0 flex-col", children: [
|
|
4462
|
+
/* @__PURE__ */ jsx7("p", { className: "agg-route-breakdown-label truncate text-agg-sm leading-agg-5 text-agg-foreground", children: row.label }),
|
|
4463
|
+
showSharedKycRequirement ? /* @__PURE__ */ jsx7("p", { className: "text-agg-xs leading-agg-4 text-agg-muted-foreground", children: tradingLabels.sharedKyc.required }) : null
|
|
4817
4464
|
] })
|
|
4818
4465
|
] }),
|
|
4819
|
-
/* @__PURE__ */
|
|
4820
|
-
/* @__PURE__ */
|
|
4821
|
-
/* @__PURE__ */
|
|
4466
|
+
/* @__PURE__ */ jsxs7("div", { className: "agg-route-breakdown-value flex shrink-0 items-center gap-2 text-agg-sm leading-agg-5", children: [
|
|
4467
|
+
/* @__PURE__ */ jsx7("p", { className: "text-agg-muted-foreground", children: row.priceLabel }),
|
|
4468
|
+
/* @__PURE__ */ jsx7("p", { className: "text-agg-foreground", children: (_b = row.resultLabel) != null ? _b : "" })
|
|
4822
4469
|
] })
|
|
4823
4470
|
]
|
|
4824
4471
|
},
|
|
@@ -4851,7 +4498,7 @@ var renderRouteCard = ({
|
|
|
4851
4498
|
const showSplitDetails = isSelected && isExpanded && card.kind === "split" && !!((_a = card.rows) == null ? void 0 : _a.length);
|
|
4852
4499
|
const displayedHint = showKalshiRequirement ? tradingLabels.requiresKalshiAccount : showSharedKycRequirement ? tradingLabels.sharedKyc.required : card.hint;
|
|
4853
4500
|
const ariaLabel = [card.label, displayedHint, card.value].filter(Boolean).join(" ");
|
|
4854
|
-
return /* @__PURE__ */
|
|
4501
|
+
return /* @__PURE__ */ jsx7(
|
|
4855
4502
|
"button",
|
|
4856
4503
|
{
|
|
4857
4504
|
type: "button",
|
|
@@ -4870,10 +4517,10 @@ var renderRouteCard = ({
|
|
|
4870
4517
|
isSelected && !card.isUnavailable ? "border border-agg-trade-highlight-border bg-linear-to-b from-agg-trade-highlight-surface-from to-agg-trade-highlight-surface-to" : "border-transparent bg-agg-secondary-hover"
|
|
4871
4518
|
),
|
|
4872
4519
|
onClick: () => onSelect(card.id),
|
|
4873
|
-
children: /* @__PURE__ */
|
|
4874
|
-
/* @__PURE__ */
|
|
4875
|
-
/* @__PURE__ */
|
|
4876
|
-
card.kind === "split" ? /* @__PURE__ */
|
|
4520
|
+
children: /* @__PURE__ */ jsxs7("div", { className: "agg-route-card-content relative z-10 flex flex-col gap-3", children: [
|
|
4521
|
+
/* @__PURE__ */ jsxs7("div", { className: "agg-route-card-header flex items-center justify-between gap-4", children: [
|
|
4522
|
+
/* @__PURE__ */ jsxs7("div", { className: "agg-route-card-meta flex min-w-0 gap-3 items-center", children: [
|
|
4523
|
+
card.kind === "split" ? /* @__PURE__ */ jsx7(
|
|
4877
4524
|
Icon,
|
|
4878
4525
|
{
|
|
4879
4526
|
name: "sparkles-filled",
|
|
@@ -4884,7 +4531,7 @@ var renderRouteCard = ({
|
|
|
4884
4531
|
),
|
|
4885
4532
|
"aria-hidden": "true"
|
|
4886
4533
|
}
|
|
4887
|
-
) : card.venue ? /* @__PURE__ */
|
|
4534
|
+
) : card.venue ? /* @__PURE__ */ jsx7(
|
|
4888
4535
|
VenueLogo,
|
|
4889
4536
|
{
|
|
4890
4537
|
venue: card.venue,
|
|
@@ -4892,10 +4539,10 @@ var renderRouteCard = ({
|
|
|
4892
4539
|
ariaLabel: getTradingVenueLabel(card.venue)
|
|
4893
4540
|
}
|
|
4894
4541
|
) : null,
|
|
4895
|
-
/* @__PURE__ */
|
|
4896
|
-
/* @__PURE__ */
|
|
4897
|
-
/* @__PURE__ */
|
|
4898
|
-
card.isUnavailable ? /* @__PURE__ */
|
|
4542
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-1 min-w-0", children: [
|
|
4543
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-1.5", children: [
|
|
4544
|
+
/* @__PURE__ */ jsx7("p", { className: "agg-route-card-title truncate text-agg-sm leading-agg-5 text-agg-foreground", children: card.label }),
|
|
4545
|
+
card.isUnavailable ? /* @__PURE__ */ jsx7(
|
|
4899
4546
|
Icon,
|
|
4900
4547
|
{
|
|
4901
4548
|
name: "lock",
|
|
@@ -4903,7 +4550,7 @@ var renderRouteCard = ({
|
|
|
4903
4550
|
className: "shrink-0 text-agg-muted-foreground",
|
|
4904
4551
|
"aria-hidden": "true"
|
|
4905
4552
|
}
|
|
4906
|
-
) : showKalshiRequirement || showSharedKycRequirement || card.insufficientInventory ? /* @__PURE__ */
|
|
4553
|
+
) : showKalshiRequirement || showSharedKycRequirement || card.insufficientInventory ? /* @__PURE__ */ jsx7(
|
|
4907
4554
|
Icon,
|
|
4908
4555
|
{
|
|
4909
4556
|
name: "warning",
|
|
@@ -4911,7 +4558,7 @@ var renderRouteCard = ({
|
|
|
4911
4558
|
className: "shrink-0 text-agg-muted-foreground",
|
|
4912
4559
|
"aria-hidden": "true"
|
|
4913
4560
|
}
|
|
4914
|
-
) : card.kind === "split" && isSelected ? /* @__PURE__ */
|
|
4561
|
+
) : card.kind === "split" && isSelected ? /* @__PURE__ */ jsx7(
|
|
4915
4562
|
Icon,
|
|
4916
4563
|
{
|
|
4917
4564
|
name: showSplitDetails ? "chevron-up" : "chevron-down",
|
|
@@ -4921,10 +4568,10 @@ var renderRouteCard = ({
|
|
|
4921
4568
|
}
|
|
4922
4569
|
) : null
|
|
4923
4570
|
] }),
|
|
4924
|
-
card.hint ? /* @__PURE__ */
|
|
4571
|
+
card.hint ? /* @__PURE__ */ jsx7("p", { className: "agg-route-card-hint text-agg-xs leading-agg-4 text-agg-muted-foreground", children: displayedHint }) : null
|
|
4925
4572
|
] })
|
|
4926
4573
|
] }),
|
|
4927
|
-
/* @__PURE__ */
|
|
4574
|
+
/* @__PURE__ */ jsx7(
|
|
4928
4575
|
"p",
|
|
4929
4576
|
{
|
|
4930
4577
|
className: cn(
|
|
@@ -4936,9 +4583,9 @@ var renderRouteCard = ({
|
|
|
4936
4583
|
}
|
|
4937
4584
|
)
|
|
4938
4585
|
] }),
|
|
4939
|
-
showSplitDetails ? /* @__PURE__ */
|
|
4940
|
-
/* @__PURE__ */
|
|
4941
|
-
/* @__PURE__ */
|
|
4586
|
+
showSplitDetails ? /* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
4587
|
+
/* @__PURE__ */ jsx7("p", { className: "agg-route-card-description text-agg-xs leading-agg-4 text-agg-foreground", children: (_b = card.description) != null ? _b : tradingLabels.splitOrderDescription }),
|
|
4588
|
+
/* @__PURE__ */ jsx7("div", { className: "agg-route-breakdown flex flex-col gap-3", children: (_c = card.rows) == null ? void 0 : _c.map(
|
|
4942
4589
|
(row) => renderRouteBreakdownRow(row, sharedKycStatus, tradingLabels)
|
|
4943
4590
|
) })
|
|
4944
4591
|
] }) : null
|
|
@@ -4971,14 +4618,14 @@ var PlaceOrder = ({
|
|
|
4971
4618
|
showResolvingState = false,
|
|
4972
4619
|
midpointsResult
|
|
4973
4620
|
}) => {
|
|
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;
|
|
4621
|
+
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, _ja;
|
|
4975
4622
|
const {
|
|
4976
4623
|
enableDebug: isExecutionDebugEnabled,
|
|
4977
4624
|
features: { enableAnimations, showFeesBreakdown, showLimitOrders: limitOrdersFeature },
|
|
4978
4625
|
formatting: { formatPrice },
|
|
4979
4626
|
general: { locale }
|
|
4980
4627
|
} = useSdkUiConfig();
|
|
4981
|
-
const labels =
|
|
4628
|
+
const labels = useLabels3();
|
|
4982
4629
|
const tradingLabels = labels.trading;
|
|
4983
4630
|
const toastCtx = useOptionalToast();
|
|
4984
4631
|
const { isTradingBlocked } = useGeoBlock();
|
|
@@ -5084,14 +4731,14 @@ var PlaceOrder = ({
|
|
|
5084
4731
|
Venue5.prophetx,
|
|
5085
4732
|
isAuthenticated && !isPaperMode
|
|
5086
4733
|
);
|
|
5087
|
-
const [isConnectProphetxModalOpen, setIsConnectProphetxModalOpen] =
|
|
4734
|
+
const [isConnectProphetxModalOpen, setIsConnectProphetxModalOpen] = useState3(false);
|
|
5088
4735
|
const { data: kalshiKeyStatus, refetch: refetchKalshiKeyStatus } = useVenueKeyStatus(
|
|
5089
4736
|
Venue5.kalshi,
|
|
5090
4737
|
isAuthenticated
|
|
5091
4738
|
);
|
|
5092
|
-
const [isConnectKalshiModalOpen, setIsConnectKalshiModalOpen] =
|
|
5093
|
-
const [isFundKalshiModalOpen, setIsFundKalshiModalOpen] =
|
|
5094
|
-
const [isBetdexAccountModalOpen, setIsBetdexAccountModalOpen] =
|
|
4739
|
+
const [isConnectKalshiModalOpen, setIsConnectKalshiModalOpen] = useState3(false);
|
|
4740
|
+
const [isFundKalshiModalOpen, setIsFundKalshiModalOpen] = useState3(false);
|
|
4741
|
+
const [isBetdexAccountModalOpen, setIsBetdexAccountModalOpen] = useState3(false);
|
|
5095
4742
|
const livePrices = useLiveOutcomePrices(
|
|
5096
4743
|
scopedSelectedMarket ? [scopedSelectedMarket] : void 0
|
|
5097
4744
|
);
|
|
@@ -5107,32 +4754,32 @@ var PlaceOrder = ({
|
|
|
5107
4754
|
() => mergeBestPricesPreferringLive(clusterBestPricesRest, wsBestPrices),
|
|
5108
4755
|
[clusterBestPricesRest, wsBestPrices]
|
|
5109
4756
|
);
|
|
5110
|
-
const [internalTab, setInternalTab] =
|
|
5111
|
-
const [executionType, setExecutionType] =
|
|
5112
|
-
const [selectedLimitVenue, setSelectedLimitVenue] =
|
|
5113
|
-
const [limitPrice, setLimitPrice] =
|
|
5114
|
-
const [limitPriceInputValue, setLimitPriceInputValue] =
|
|
5115
|
-
const [limitPriceInputError, setLimitPriceInputError] =
|
|
5116
|
-
const [limitExpirationType, setLimitExpirationType] =
|
|
5117
|
-
const [limitExpirationDate, setLimitExpirationDate] =
|
|
5118
|
-
const [limitExpirationTime, setLimitExpirationTime] =
|
|
5119
|
-
const [limitExpirationDraftDate, setLimitExpirationDraftDate] =
|
|
5120
|
-
const [limitExpirationDraftTime, setLimitExpirationDraftTime] =
|
|
5121
|
-
const [limitExpirationPickerView, setLimitExpirationPickerView] =
|
|
5122
|
-
const [isLimitExpirationPickerOpen, setIsLimitExpirationPickerOpen] =
|
|
5123
|
-
const [internalAmount, setInternalAmount] =
|
|
5124
|
-
const [sellFilledForOutcomeId, setSellFilledForOutcomeId] =
|
|
5125
|
-
const [internalSlippage] =
|
|
5126
|
-
const [isRoutesExpanded, setIsRoutesExpanded] =
|
|
5127
|
-
const [selectedRouteCardId, setSelectedRouteCardId] =
|
|
5128
|
-
const [manualRouteSelectionIdentity, setManualRouteSelectionIdentity] =
|
|
4757
|
+
const [internalTab, setInternalTab] = useState3("buy");
|
|
4758
|
+
const [executionType, setExecutionType] = useState3("market");
|
|
4759
|
+
const [selectedLimitVenue, setSelectedLimitVenue] = useState3(null);
|
|
4760
|
+
const [limitPrice, setLimitPrice] = useState3(0.5);
|
|
4761
|
+
const [limitPriceInputValue, setLimitPriceInputValue] = useState3(formatLimitPriceInputValue(0.5));
|
|
4762
|
+
const [limitPriceInputError, setLimitPriceInputError] = useState3(null);
|
|
4763
|
+
const [limitExpirationType, setLimitExpirationType] = useState3("GTC");
|
|
4764
|
+
const [limitExpirationDate, setLimitExpirationDate] = useState3(void 0);
|
|
4765
|
+
const [limitExpirationTime, setLimitExpirationTime] = useState3("17:00");
|
|
4766
|
+
const [limitExpirationDraftDate, setLimitExpirationDraftDate] = useState3();
|
|
4767
|
+
const [limitExpirationDraftTime, setLimitExpirationDraftTime] = useState3("17:00");
|
|
4768
|
+
const [limitExpirationPickerView, setLimitExpirationPickerView] = useState3("options");
|
|
4769
|
+
const [isLimitExpirationPickerOpen, setIsLimitExpirationPickerOpen] = useState3(false);
|
|
4770
|
+
const [internalAmount, setInternalAmount] = useState3(PLACE_ORDER_DEFAULT_AMOUNT);
|
|
4771
|
+
const [sellFilledForOutcomeId, setSellFilledForOutcomeId] = useState3(null);
|
|
4772
|
+
const [internalSlippage] = useState3(DEFAULT_SLIPPAGE_VALUE);
|
|
4773
|
+
const [isRoutesExpanded, setIsRoutesExpanded] = useState3(false);
|
|
4774
|
+
const [selectedRouteCardId, setSelectedRouteCardId] = useState3(null);
|
|
4775
|
+
const [manualRouteSelectionIdentity, setManualRouteSelectionIdentity] = useState3(
|
|
5129
4776
|
null
|
|
5130
4777
|
);
|
|
5131
|
-
const [isSplitDetailOpen, setIsSplitDetailOpen] =
|
|
5132
|
-
const [buyGeoBlockSnapshot, setBuyGeoBlockSnapshot] =
|
|
5133
|
-
const [submissionFeedback, setSubmissionFeedback] =
|
|
5134
|
-
const [submissionProgressState, setSubmissionProgressState] =
|
|
5135
|
-
const [isBeforeActionPending, setIsBeforeActionPending] =
|
|
4778
|
+
const [isSplitDetailOpen, setIsSplitDetailOpen] = useState3(false);
|
|
4779
|
+
const [buyGeoBlockSnapshot, setBuyGeoBlockSnapshot] = useState3(null);
|
|
4780
|
+
const [submissionFeedback, setSubmissionFeedback] = useState3(null);
|
|
4781
|
+
const [submissionProgressState, setSubmissionProgressState] = useState3(null);
|
|
4782
|
+
const [isBeforeActionPending, setIsBeforeActionPending] = useState3(false);
|
|
5136
4783
|
const outcomes = useMemo(
|
|
5137
4784
|
() => mapVenueMarketOutcomesToPlaceOrderOutcomes(scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venueMarketOutcomes),
|
|
5138
4785
|
[scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venueMarketOutcomes]
|
|
@@ -5474,7 +5121,15 @@ var PlaceOrder = ({
|
|
|
5474
5121
|
(_x = smartRoute.data) == null ? void 0 : _x.venueMarketOutcomeId,
|
|
5475
5122
|
submissionProgressState
|
|
5476
5123
|
]);
|
|
5477
|
-
const
|
|
5124
|
+
const { account: betdexAccount, isAvailable: isBetdexAccountAvailable } = useHostedVenueAccount(
|
|
5125
|
+
"betdex",
|
|
5126
|
+
!isPaperMode && isQuotePanelActive && ((scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) === Venue5.betdex || (scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.venueMarkets.some((market) => market.venue === Venue5.betdex)) === true || ((_y = smartRoute.data) == null ? void 0 : _y.fills.some((fill) => fill.venue === Venue5.betdex)) === true)
|
|
5127
|
+
);
|
|
5128
|
+
const betdexAccountData = betdexAccount.data;
|
|
5129
|
+
const betdexBalance = isBetdexAccountAvailable && !betdexAccount.isError && (betdexAccountData == null ? void 0 : betdexAccountData.status) === "active" && betdexAccountData.balanceStatus === "available" ? betdexAccountData.balance : null;
|
|
5130
|
+
const betdexAvailableAmount = betdexBalance ? Number(betdexBalance.availableRaw) / __pow(10, betdexBalance.decimals) : NaN;
|
|
5131
|
+
const betdexAvailableBalance = Number.isFinite(betdexAvailableAmount) && betdexAvailableAmount >= 0 ? betdexAvailableAmount : null;
|
|
5132
|
+
const scopedSmartRouteData = ((_z = smartRoute.data) == null ? void 0 : _z.venueMarketOutcomeId) === scopedSelectedOutcomeId ? smartRoute.data : null;
|
|
5478
5133
|
const routeCards = useMemo(() => {
|
|
5479
5134
|
const eventVenues = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.venueMarkets.map((market) => market.venue);
|
|
5480
5135
|
if (isSell) {
|
|
@@ -5494,10 +5149,13 @@ var PlaceOrder = ({
|
|
|
5494
5149
|
eventVenues,
|
|
5495
5150
|
labels: tradingLabels,
|
|
5496
5151
|
quoteData: scopedSmartRouteData,
|
|
5497
|
-
tradeSide: "buy"
|
|
5152
|
+
tradeSide: "buy",
|
|
5153
|
+
betdexFundingRequired: !isPaperMode && betdexAvailableBalance !== null && betdexAvailableBalance < debouncedAmount
|
|
5498
5154
|
}) : [];
|
|
5499
5155
|
}, [
|
|
5500
5156
|
debouncedAmount,
|
|
5157
|
+
isPaperMode,
|
|
5158
|
+
betdexAvailableBalance,
|
|
5501
5159
|
scopedSmartRouteData,
|
|
5502
5160
|
tradingLabels,
|
|
5503
5161
|
inheritedBuyGeoBlockedVenues,
|
|
@@ -5507,7 +5165,7 @@ var PlaceOrder = ({
|
|
|
5507
5165
|
]);
|
|
5508
5166
|
const routeCardsScopeKey = [
|
|
5509
5167
|
resolvedExecutionMode,
|
|
5510
|
-
(
|
|
5168
|
+
(_A = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.id) != null ? _A : "",
|
|
5511
5169
|
scopedSelectedOutcomeId != null ? scopedSelectedOutcomeId : "",
|
|
5512
5170
|
internalTab
|
|
5513
5171
|
].join(":");
|
|
@@ -5515,7 +5173,7 @@ var PlaceOrder = ({
|
|
|
5515
5173
|
if (routeCards.length > 0) {
|
|
5516
5174
|
lastValidRouteCardsRef.current = { cards: routeCards, scopeKey: routeCardsScopeKey };
|
|
5517
5175
|
}
|
|
5518
|
-
const displayedRouteCards = routeCards.length > 0 ? routeCards : isRouteCardsTransient && ((
|
|
5176
|
+
const displayedRouteCards = routeCards.length > 0 ? routeCards : isRouteCardsTransient && ((_B = lastValidRouteCardsRef.current) == null ? void 0 : _B.scopeKey) === routeCardsScopeKey ? lastValidRouteCardsRef.current.cards : [];
|
|
5519
5177
|
const selectedManualRouteCard = manualRouteSelectionIdentity ? routeCards.find(
|
|
5520
5178
|
(card) => getPlaceOrderRouteCardIdentity(card) === manualRouteSelectionIdentity
|
|
5521
5179
|
) : void 0;
|
|
@@ -5526,7 +5184,7 @@ var PlaceOrder = ({
|
|
|
5526
5184
|
},
|
|
5527
5185
|
[user == null ? void 0 : user.venueAccounts]
|
|
5528
5186
|
);
|
|
5529
|
-
const isKalshiAccountActive = (
|
|
5187
|
+
const isKalshiAccountActive = (_C = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.connected) != null ? _C : (legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.status) === "active";
|
|
5530
5188
|
const hasKalshiConnectionState = kalshiKeyStatus !== void 0 || (user == null ? void 0 : user.venueAccounts) != null;
|
|
5531
5189
|
const isKalshiAvailable = getVenueAvailabilityState({
|
|
5532
5190
|
venueId: "kalshi",
|
|
@@ -5554,7 +5212,7 @@ var PlaceOrder = ({
|
|
|
5554
5212
|
routeCards,
|
|
5555
5213
|
selectedManualRouteCard,
|
|
5556
5214
|
selectedRouteCardId,
|
|
5557
|
-
(
|
|
5215
|
+
(_D = smartRoute.data) == null ? void 0 : _D.status
|
|
5558
5216
|
]);
|
|
5559
5217
|
useEffect4(() => {
|
|
5560
5218
|
if (routeCards.length === 0) {
|
|
@@ -5615,10 +5273,10 @@ var PlaceOrder = ({
|
|
|
5615
5273
|
setIsSplitDetailOpen(false);
|
|
5616
5274
|
}, [executionType, internalTab, scopedSelectedOutcomeId]);
|
|
5617
5275
|
const orderedRouteCards = routeCards;
|
|
5618
|
-
const selectedRouteCard = (
|
|
5619
|
-
const hasDirectProphetxQuote = (
|
|
5276
|
+
const selectedRouteCard = (_F = (_E = orderedRouteCards.find((card) => card.id === resolvedSelectedRouteCardId)) != null ? _E : orderedRouteCards[0]) != null ? _F : null;
|
|
5277
|
+
const hasDirectProphetxQuote = (_G = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData.fills.some(
|
|
5620
5278
|
(fill) => fill.venue === Venue5.prophetx && fill.executionBackend === "direct"
|
|
5621
|
-
)) != null ?
|
|
5279
|
+
)) != null ? _G : false;
|
|
5622
5280
|
const selectedSharedKycVenue = useMemo(() => {
|
|
5623
5281
|
var _a2, _b2;
|
|
5624
5282
|
const candidateVenue = isLimitOrder ? selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue : (_b2 = (_a2 = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData.fills.find(
|
|
@@ -5650,7 +5308,7 @@ var PlaceOrder = ({
|
|
|
5650
5308
|
return (scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) === "kalshi";
|
|
5651
5309
|
}, [isLimitOrder, selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue, selectedRouteCard, scopedSelectedMarket]);
|
|
5652
5310
|
const isProphetxDirectRoute = !isPaperMode && (isProphetxDirect || hasDirectProphetxQuote) && (!isSell || !sellableSharesByVenue.get(Venue5.prophetx)) && (isLimitOrder ? (selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue) === Venue5.prophetx : selectedRouteCard ? selectedRouteCard.venue === Venue5.prophetx || selectedRouteCard.quoteData.fills.some((fill) => fill.venue === Venue5.prophetx) : (scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) === Venue5.prophetx);
|
|
5653
|
-
const prophetxBalance = (
|
|
5311
|
+
const prophetxBalance = (_I = (_H = liveBalanceState.venueCashBalances) == null ? void 0 : _H[Venue5.prophetx]) != null ? _I : 0;
|
|
5654
5312
|
const needsProphetxConnection = !isPaperMode && isAuthenticated && canConnectProphetx && isProphetxDirectRoute && !(prophetxKeyStatus == null ? void 0 : prophetxKeyStatus.connected);
|
|
5655
5313
|
useEffect4(() => {
|
|
5656
5314
|
if ((selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue) === Venue5.prophetx) {
|
|
@@ -5658,21 +5316,13 @@ var PlaceOrder = ({
|
|
|
5658
5316
|
setIsLimitExpirationPickerOpen(false);
|
|
5659
5317
|
}
|
|
5660
5318
|
}, [selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue]);
|
|
5661
|
-
const selectedRouteFills = (
|
|
5662
|
-
const fallbackRouteVenue = isLimitOrder ? selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue : (
|
|
5319
|
+
const selectedRouteFills = (_J = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData.fills) != null ? _J : [];
|
|
5320
|
+
const fallbackRouteVenue = isLimitOrder ? selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue : (_K = selectedRouteCard == null ? void 0 : selectedRouteCard.venue) != null ? _K : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue;
|
|
5663
5321
|
const isBetdexRoute = isLimitOrder || selectedRouteFills.length === 0 ? fallbackRouteVenue === Venue5.betdex : selectedRouteFills.some((fill) => fill.venue === Venue5.betdex);
|
|
5664
5322
|
const isBetdexOnlyRoute = isBetdexRoute && (isLimitOrder || selectedRouteFills.every((fill) => fill.venue === Venue5.betdex));
|
|
5665
|
-
const
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
);
|
|
5669
|
-
const betdexAccountData = betdexAccount.data;
|
|
5670
|
-
const betdexBalance = isBetdexAccountAvailable && !betdexAccount.isError && (betdexAccountData == null ? void 0 : betdexAccountData.status) === "active" && betdexAccountData.balanceStatus === "available" ? betdexAccountData.balance : null;
|
|
5671
|
-
const betdexAvailableAmount = betdexBalance ? Number(betdexBalance.availableRaw) / __pow(10, betdexBalance.decimals) : NaN;
|
|
5672
|
-
const betdexAvailableBalance = Number.isFinite(betdexAvailableAmount) && betdexAvailableAmount >= 0 ? betdexAvailableAmount : null;
|
|
5673
|
-
const totalBalance = isPaperMode ? paperTotalBalance : isProphetxDirectRoute ? prophetxBalance : isBetdexOnlyRoute ? betdexAvailableBalance != null ? betdexAvailableBalance : 0 : liveAvailableBalance;
|
|
5674
|
-
const isBalanceLoading = isPaperMode ? paperBalancesQuery.isLoading : isBetdexOnlyRoute ? betdexAccount.isLoading : liveBalanceState.isLoading || isBetdexRoute && betdexAccount.isLoading;
|
|
5675
|
-
const displayedBalance = isPaperMode ? paperTotalBalance : isProphetxDirectRoute ? prophetxBalance : isBetdexOnlyRoute ? betdexAvailableBalance != null ? betdexAvailableBalance : 0 : isKalshiRoute ? (_K = liveBalanceState.kalshiBalance) != null ? _K : 0 : liveAvailableBalance;
|
|
5323
|
+
const totalBalance = isPaperMode ? paperTotalBalance : isProphetxDirectRoute ? prophetxBalance : isBetdexOnlyRoute ? (betdexAvailableBalance != null ? betdexAvailableBalance : 0) + (isLimitOrder ? 0 : liveAvailableBalance) : liveAvailableBalance;
|
|
5324
|
+
const isBalanceLoading = isPaperMode ? paperBalancesQuery.isLoading : isBetdexOnlyRoute ? betdexAccount.isLoading || !isLimitOrder && liveBalanceState.isLoading : liveBalanceState.isLoading || isBetdexRoute && betdexAccount.isLoading;
|
|
5325
|
+
const displayedBalance = isPaperMode ? paperTotalBalance : isProphetxDirectRoute ? prophetxBalance : isBetdexOnlyRoute ? (betdexAvailableBalance != null ? betdexAvailableBalance : 0) + (isLimitOrder ? 0 : liveAvailableBalance) : isKalshiRoute ? (_L = liveBalanceState.kalshiBalance) != null ? _L : 0 : liveAvailableBalance;
|
|
5676
5326
|
const betdexBalanceLabel = betdexAvailableBalance === null ? tradingLabels.betdexBalanceUnavailable : tradingLabels.betdexBalance(formatUsd(betdexAvailableBalance));
|
|
5677
5327
|
const needsKalshiConnection = isKalshiDisconnected && isKalshiRoute;
|
|
5678
5328
|
const handleVerifyKalshi = useCallback3(
|
|
@@ -5725,22 +5375,23 @@ var PlaceOrder = ({
|
|
|
5725
5375
|
]
|
|
5726
5376
|
);
|
|
5727
5377
|
const executionProgress = useExecutionProgress({
|
|
5728
|
-
orderIds: (
|
|
5729
|
-
quoteId: (
|
|
5378
|
+
orderIds: (_M = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) != null ? _M : null,
|
|
5379
|
+
quoteId: (_N = submissionProgressState == null ? void 0 : submissionProgressState.quoteId) != null ? _N : null,
|
|
5730
5380
|
mode: isPaperMode ? "paper" : void 0,
|
|
5731
|
-
enabled: ((submissionProgressState == null ? void 0 : submissionProgressState.phase) === "submitting" || (submissionProgressState == null ? void 0 : submissionProgressState.phase) === "executing") && !!((
|
|
5381
|
+
enabled: ((submissionProgressState == null ? void 0 : submissionProgressState.phase) === "submitting" || (submissionProgressState == null ? void 0 : submissionProgressState.phase) === "executing") && !!((_O = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) == null ? void 0 : _O.length)
|
|
5732
5382
|
});
|
|
5733
5383
|
const executionProgressFloorRef = useRef4({
|
|
5734
5384
|
quoteId: null,
|
|
5735
5385
|
value: 0
|
|
5736
5386
|
});
|
|
5737
|
-
const
|
|
5738
|
-
const
|
|
5739
|
-
const
|
|
5740
|
-
const
|
|
5741
|
-
const
|
|
5387
|
+
const selectedOutcome = (_P = outcomes.find((outcome) => outcome.id === scopedSelectedOutcomeId)) != null ? _P : scopedSelectedOutcome;
|
|
5388
|
+
const selectedOutcomeLabel = (scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) === Venue5.betdex ? ((_Q = selectedOutcome == null ? void 0 : selectedOutcome.title) == null ? void 0 : _Q.trim()) || (selectedOutcome == null ? void 0 : selectedOutcome.label) || "" : (_R = selectedOutcome == null ? void 0 : selectedOutcome.label) != null ? _R : "";
|
|
5389
|
+
const headerImage = (_T = (_S = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.image) != null ? _S : scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.image) != null ? _T : null;
|
|
5390
|
+
const headerTitle = (_V = (_U = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.title) != null ? _U : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _V : "";
|
|
5391
|
+
const headerSubtitle = (_W = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _W : "";
|
|
5392
|
+
const executionDateSource = (_X = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.endDate) != null ? _X : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.endDate;
|
|
5742
5393
|
const executionDateLabel = executionDateSource ? getTradingDateLabel(executionDateSource) : "";
|
|
5743
|
-
const executionQuoteData = (
|
|
5394
|
+
const executionQuoteData = (_Z = (_Y = submissionProgressState == null ? void 0 : submissionProgressState.quoteData) != null ? _Y : selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData) != null ? _Z : null;
|
|
5744
5395
|
const executionOrderGroups = useMemo(() => {
|
|
5745
5396
|
var _a2, _b2, _c2;
|
|
5746
5397
|
if (submissionProgressState == null ? void 0 : submissionProgressState.limitOrderGroup) return [submissionProgressState.limitOrderGroup];
|
|
@@ -5763,7 +5414,7 @@ var PlaceOrder = ({
|
|
|
5763
5414
|
executionQuoteData,
|
|
5764
5415
|
internalTab,
|
|
5765
5416
|
submissionProgressState == null ? void 0 : submissionProgressState.limitOrderGroup,
|
|
5766
|
-
(
|
|
5417
|
+
(__ = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) == null ? void 0 : __.length,
|
|
5767
5418
|
tradingLabels
|
|
5768
5419
|
]);
|
|
5769
5420
|
const executionProgressPercent = useMemo(() => {
|
|
@@ -6115,7 +5766,7 @@ var PlaceOrder = ({
|
|
|
6115
5766
|
queryClient,
|
|
6116
5767
|
submissionProgressState
|
|
6117
5768
|
]);
|
|
6118
|
-
const activeQuoteData = isLimitOrder ? null : (
|
|
5769
|
+
const activeQuoteData = isLimitOrder ? null : (_$ = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData) != null ? _$ : scopedSmartRouteData;
|
|
6119
5770
|
const visibleMarketRouteCards = displayedRouteCards.length > PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT && !isRoutesExpanded ? displayedRouteCards.slice(0, PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT) : displayedRouteCards;
|
|
6120
5771
|
const hasEnteredAmount = internalAmount > 0;
|
|
6121
5772
|
const isQuoteLoading = !isLimitOrder && hasEnteredAmount && (isSell && isQuoteInputEditing || smartRoute.isLoading || !isSell && smartRoute.isFetching || isSell && venueSellQuotes.isLoading);
|
|
@@ -6130,16 +5781,17 @@ var PlaceOrder = ({
|
|
|
6130
5781
|
const resolvedKalshiRequiredAmount = isKalshiOnlyRoute || isKalshiRoute && selectedRouteFills.length === 0 ? internalAmount : kalshiRequiredAmount;
|
|
6131
5782
|
const resolvedBetdexRequiredAmount = isBetdexOnlyRoute ? internalAmount : betdexRequiredAmount;
|
|
6132
5783
|
const resolvedOnchainRequiredAmount = isOnchainOnlyRoute ? internalAmount : onchainRequiredAmount;
|
|
6133
|
-
const isKalshiBalanceInsufficient = !isPaperMode && isKalshiRoute && resolvedKalshiRequiredAmount > ((
|
|
5784
|
+
const isKalshiBalanceInsufficient = !isPaperMode && isKalshiRoute && resolvedKalshiRequiredAmount > ((_aa = liveBalanceState.kalshiBalance) != null ? _aa : 0);
|
|
6134
5785
|
const isBetdexBalanceInsufficient = !isPaperMode && isBetdexRoute && betdexAvailableBalance !== null && resolvedBetdexRequiredAmount > betdexAvailableBalance;
|
|
6135
5786
|
const isBetdexBalanceUnavailable = !isPaperMode && !isSell && isAuthenticated && isBetdexRoute && betdexAvailableBalance === null;
|
|
6136
|
-
const
|
|
5787
|
+
const canExecuteBetdexQuote = !isPaperMode && !isSell && !isLimitOrder && isAuthenticated && isBetdexRoute && !(selectedRouteCard == null ? void 0 : selectedRouteCard.isUnavailable) && selectedRouteFills.length > 0 && (selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData.status) === "ok" && !!selectedRouteCard.quoteData.quoteId;
|
|
5788
|
+
const needsBetdexAccount = !canExecuteBetdexQuote && !isSell && isAuthenticated && !betdexAccount.isLoading && (isBetdexBalanceUnavailable || hasEnteredAmount && isBetdexBalanceInsufficient);
|
|
6137
5789
|
const isOnchainBalanceInsufficient = resolvedOnchainRequiredAmount > liveAvailableBalance;
|
|
6138
5790
|
const prophetxRequiredAmount = !isProphetxDirectRoute || isSell ? 0 : selectedRouteFills.length ? selectedRouteFills.filter((fill) => fill.venue === Venue5.prophetx).reduce((sum, fill) => sum + fill.venueQty * fill.avgPrice, 0) : internalAmount;
|
|
6139
5791
|
const isProphetxBalanceInsufficient = !isPaperMode && !isBalanceLoading && prophetxRequiredAmount > prophetxBalance;
|
|
6140
|
-
const isInsufficientBalance = !isSell && isAuthenticated && hasEnteredAmount && !isBalanceLoading && (isLimitOrder ? internalAmount > (isProphetxDirectRoute ? prophetxBalance : totalBalance) : isPaperMode ? internalAmount > paperTotalBalance : isKalshiBalanceInsufficient || isProphetxBalanceInsufficient || isBetdexBalanceInsufficient || isOnchainBalanceInsufficient);
|
|
5792
|
+
const isInsufficientBalance = !isSell && isAuthenticated && hasEnteredAmount && !isBalanceLoading && (isLimitOrder ? internalAmount > (isProphetxDirectRoute ? prophetxBalance : totalBalance) : isPaperMode ? internalAmount > paperTotalBalance : isKalshiBalanceInsufficient || isProphetxBalanceInsufficient || isBetdexBalanceInsufficient && !canExecuteBetdexQuote || isOnchainBalanceInsufficient);
|
|
6141
5793
|
const isQuoteInsufficientBalance = !isLimitOrder && (activeQuoteData == null ? void 0 : activeQuoteData.status) === "insufficient_balance";
|
|
6142
|
-
const shouldShowInsufficientBalanceAlert = isInsufficientBalance || isQuoteInsufficientBalance;
|
|
5794
|
+
const shouldShowInsufficientBalanceAlert = isInsufficientBalance || isQuoteInsufficientBalance && !canExecuteBetdexQuote;
|
|
6143
5795
|
const insufficientBalanceDetails = isQuoteInsufficientBalance && (activeQuoteData == null ? void 0 : activeQuoteData.error) && activeQuoteData.error !== tradingLabels.insufficientBalance ? activeQuoteData.error : null;
|
|
6144
5796
|
const isSelectedVenueInventoryInsufficient = isSell && (selectedRouteCard == null ? void 0 : selectedRouteCard.kind) === "venue" && selectedRouteCard.insufficientInventory === true;
|
|
6145
5797
|
const isBelowClientMinimum = !isSell && hasEnteredAmount && internalAmount < MIN_BUY_ORDER_AMOUNT;
|
|
@@ -6271,7 +5923,7 @@ var PlaceOrder = ({
|
|
|
6271
5923
|
const averagePrice = selectedRouteCard.executionPrice;
|
|
6272
5924
|
return averagePrice == null ? "" : tradingLabels.averagePrice(averagePrice);
|
|
6273
5925
|
}, [selectedRouteCard, tradingLabels]);
|
|
6274
|
-
const displayedToWinValue = (
|
|
5926
|
+
const displayedToWinValue = (_ba = selectedRouteCard == null ? void 0 : selectedRouteCard.numericValue) != null ? _ba : 0;
|
|
6275
5927
|
const originalLimitPriceRaw = useMemo(() => toLimitPriceRaw(limitPrice), [limitPrice]);
|
|
6276
5928
|
const limitPriceAdjustmentByVenue = useMemo(() => {
|
|
6277
5929
|
var _a2;
|
|
@@ -6300,7 +5952,7 @@ var PlaceOrder = ({
|
|
|
6300
5952
|
return adjustments;
|
|
6301
5953
|
}, [internalTab, limitVenueQuoteByVenue, originalLimitPriceRaw, visibleLimitVenueOptions]);
|
|
6302
5954
|
const selectedLimitPriceAdjustment = selectedLimitVenueOption ? limitPriceAdjustmentByVenue.get(selectedLimitVenueOption.venue) : void 0;
|
|
6303
|
-
const selectedLimitPriceRaw = (
|
|
5955
|
+
const selectedLimitPriceRaw = (_ca = selectedLimitPriceAdjustment == null ? void 0 : selectedLimitPriceAdjustment.adjustedPriceRaw) != null ? _ca : originalLimitPriceRaw;
|
|
6304
5956
|
const limitPriceAdjustmentMessage = useMemo(() => {
|
|
6305
5957
|
if (!selectedLimitVenueOption || !(selectedLimitPriceAdjustment == null ? void 0 : selectedLimitPriceAdjustment.adjusted) || !selectedLimitPriceAdjustment.tickSizeRaw) {
|
|
6306
5958
|
return "";
|
|
@@ -6474,7 +6126,7 @@ var PlaceOrder = ({
|
|
|
6474
6126
|
if (totalFees == null) return null;
|
|
6475
6127
|
return formatUsd(totalFees, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
6476
6128
|
}, [activeFeeBreakdown]);
|
|
6477
|
-
const appFeeValue = (
|
|
6129
|
+
const appFeeValue = (_da = activeFeeBreakdown == null ? void 0 : activeFeeBreakdown.appFee) != null ? _da : 0;
|
|
6478
6130
|
const feeBreakdownRows = useMemo(() => {
|
|
6479
6131
|
var _a2;
|
|
6480
6132
|
if (!activeFeeBreakdown) return [];
|
|
@@ -6524,14 +6176,14 @@ var PlaceOrder = ({
|
|
|
6524
6176
|
}, [activeFeeBreakdown, appFeeValue, tradingLabels]);
|
|
6525
6177
|
const isActionLoading = isPrimaryActionLoading || executeManaged.isPending || placeLimitOrder.isPending || isBeforeActionPending;
|
|
6526
6178
|
const selectedLimitRouteCardId = selectedLimitVenueOption ? `limit-venue-${selectedLimitVenueOption.venue}-${selectedLimitVenueOption.venueMarketOutcomeId}` : null;
|
|
6527
|
-
const selectedLimitRouteCard = selectedLimitRouteCardId ? (
|
|
6528
|
-
const selectedRouteGeoBlocked = isLimitOrder ? (
|
|
6179
|
+
const selectedLimitRouteCard = selectedLimitRouteCardId ? (_ea = limitRouteCards.find((card) => card.id === selectedLimitRouteCardId)) != null ? _ea : null : null;
|
|
6180
|
+
const selectedRouteGeoBlocked = isLimitOrder ? (_fa = selectedLimitRouteCard == null ? void 0 : selectedLimitRouteCard.isUnavailable) != null ? _fa : false : (_ga = selectedRouteCard == null ? void 0 : selectedRouteCard.isUnavailable) != null ? _ga : false;
|
|
6529
6181
|
const geoBlockedVenuesFromWarnings = useMemo(
|
|
6530
6182
|
() => {
|
|
6531
6183
|
var _a2;
|
|
6532
6184
|
return extractGeoBlockedVenues((_a2 = smartRoute.data) == null ? void 0 : _a2.warnings);
|
|
6533
6185
|
},
|
|
6534
|
-
[(
|
|
6186
|
+
[(_ha = smartRoute.data) == null ? void 0 : _ha.warnings]
|
|
6535
6187
|
);
|
|
6536
6188
|
const isPrimaryVenueGeoBlocked = useMemo(() => {
|
|
6537
6189
|
var _a2, _b2;
|
|
@@ -6541,7 +6193,7 @@ var PlaceOrder = ({
|
|
|
6541
6193
|
}, [selectedRouteCard, geoBlockedVenuesFromWarnings]);
|
|
6542
6194
|
const shouldShowGeoBlockBanner = isTradingBlocked || selectedRouteGeoBlocked || isPrimaryVenueGeoBlocked || isLimitOrder && limitRouteCards.length > 0 && limitRouteCards.every((card) => card.isUnavailable);
|
|
6543
6195
|
const actionLabel = `${internalTab === "buy" ? tradingLabels.buy : tradingLabels.sell} ${selectedOutcomeLabel}`.trim();
|
|
6544
|
-
const isActionDisabled = isPrimaryActionDisabled || !orderEligibility.canPlaceOrder || isActionLoading || !hasEnteredAmount || !scopedSelectedMarket || isInsufficientBalance || isBetdexBalanceUnavailable || isQuoteInsufficientBalance || isSell && isQuoteInputEditing || isSellAmountAboveAvailability || isBelowMinimum || !isLimitOrder && isQuoteLoading || isSelectedVenueInventoryInsufficient || (isLimitOrder ? !limitOrderPayload : !selectedRouteCard || !selectedRouteCard.quoteData.quoteId) || selectedRouteGeoBlocked || !isAuthenticated || !isLimitOrder && quoteStatus !== void 0;
|
|
6196
|
+
const isActionDisabled = isPrimaryActionDisabled || !orderEligibility.canPlaceOrder || isActionLoading || !hasEnteredAmount || !scopedSelectedMarket || isInsufficientBalance || isBetdexBalanceUnavailable && !canExecuteBetdexQuote || isQuoteInsufficientBalance && !canExecuteBetdexQuote || isSell && isQuoteInputEditing || isSellAmountAboveAvailability || isBelowMinimum || !isLimitOrder && isQuoteLoading || isSelectedVenueInventoryInsufficient || (isLimitOrder ? !limitOrderPayload : !selectedRouteCard || !selectedRouteCard.quoteData.quoteId && !canExecuteBetdexQuote) || selectedRouteGeoBlocked || !isAuthenticated || !isLimitOrder && quoteStatus !== void 0 && !canExecuteBetdexQuote;
|
|
6545
6197
|
const shouldShowSmartRouting = orderEligibility.canPlaceOrder && hasEnteredAmount && !isBelowMinimum && (isLimitOrder ? limitRouteCards.length > 0 : displayedRouteCards.length > 0 || smartRoute.isFetching || smartRoute.isLoading || isSell && (venueSellQuotes.isFetching || venueSellQuotes.isLoading));
|
|
6546
6198
|
const shouldShowRouteToggle = !isLimitOrder && !isQuoteLoading && displayedRouteCards.length > PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT;
|
|
6547
6199
|
const handleReturnToOrderForm = useCallback3(() => {
|
|
@@ -6964,7 +6616,7 @@ var PlaceOrder = ({
|
|
|
6964
6616
|
]);
|
|
6965
6617
|
const resolvedStatusClassName = cn(classNames == null ? void 0 : classNames.root, className);
|
|
6966
6618
|
if (isLoading) {
|
|
6967
|
-
return /* @__PURE__ */
|
|
6619
|
+
return /* @__PURE__ */ jsx7(
|
|
6968
6620
|
Skeleton,
|
|
6969
6621
|
{
|
|
6970
6622
|
ariaLabel: labels.common.loading,
|
|
@@ -6975,7 +6627,7 @@ var PlaceOrder = ({
|
|
|
6975
6627
|
}
|
|
6976
6628
|
if (submissionProgressState) {
|
|
6977
6629
|
if (submissionProgressState.phase === "success" && submissionProgressState.summary) {
|
|
6978
|
-
return /* @__PURE__ */
|
|
6630
|
+
return /* @__PURE__ */ jsx7(
|
|
6979
6631
|
PlaceOrderSuccessView,
|
|
6980
6632
|
{
|
|
6981
6633
|
className: resolvedStatusClassName,
|
|
@@ -6987,7 +6639,7 @@ var PlaceOrder = ({
|
|
|
6987
6639
|
);
|
|
6988
6640
|
}
|
|
6989
6641
|
if (submissionProgressState.phase === "failed") {
|
|
6990
|
-
return /* @__PURE__ */
|
|
6642
|
+
return /* @__PURE__ */ jsx7(
|
|
6991
6643
|
PlaceOrderFailureView,
|
|
6992
6644
|
{
|
|
6993
6645
|
className: resolvedStatusClassName,
|
|
@@ -7000,7 +6652,7 @@ var PlaceOrder = ({
|
|
|
7000
6652
|
}
|
|
7001
6653
|
);
|
|
7002
6654
|
}
|
|
7003
|
-
return /* @__PURE__ */
|
|
6655
|
+
return /* @__PURE__ */ jsx7(
|
|
7004
6656
|
PlaceOrderExecutionView,
|
|
7005
6657
|
{
|
|
7006
6658
|
className,
|
|
@@ -7228,11 +6880,11 @@ var PlaceOrder = ({
|
|
|
7228
6880
|
}
|
|
7229
6881
|
});
|
|
7230
6882
|
if (isEndedWithoutKnownWinner || !orderEligibility.canPlaceOrder && resolvedReadOnlyTradingState.kind !== "open") {
|
|
7231
|
-
return /* @__PURE__ */
|
|
6883
|
+
return /* @__PURE__ */ jsx7(
|
|
7232
6884
|
PlaceOrderResolvedView,
|
|
7233
6885
|
{
|
|
7234
6886
|
tradingState: resolvedReadOnlyTradingState,
|
|
7235
|
-
resolutionTimestamp: (
|
|
6887
|
+
resolutionTimestamp: (_ia = resolvedEventTradingState.resolvesAt) != null ? _ia : resolvedReadOnlyTradingState.resolvesAt,
|
|
7236
6888
|
resolvedClaim,
|
|
7237
6889
|
classNames,
|
|
7238
6890
|
className,
|
|
@@ -7241,8 +6893,8 @@ var PlaceOrder = ({
|
|
|
7241
6893
|
}
|
|
7242
6894
|
);
|
|
7243
6895
|
}
|
|
7244
|
-
return /* @__PURE__ */
|
|
7245
|
-
/* @__PURE__ */
|
|
6896
|
+
return /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
6897
|
+
/* @__PURE__ */ jsxs7(
|
|
7246
6898
|
Card,
|
|
7247
6899
|
{
|
|
7248
6900
|
className: cn(
|
|
@@ -7257,23 +6909,23 @@ var PlaceOrder = ({
|
|
|
7257
6909
|
headerSubtitle,
|
|
7258
6910
|
headerImage,
|
|
7259
6911
|
headerTitle,
|
|
7260
|
-
headerVenue: (
|
|
6912
|
+
headerVenue: (_ja = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) != null ? _ja : scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.venue,
|
|
7261
6913
|
onClose
|
|
7262
6914
|
}),
|
|
7263
|
-
/* @__PURE__ */
|
|
7264
|
-
/* @__PURE__ */
|
|
6915
|
+
/* @__PURE__ */ jsxs7("div", { className: cn("agg-order-panel-content flex flex-col gap-6", classNames == null ? void 0 : classNames.content), children: [
|
|
6916
|
+
/* @__PURE__ */ jsxs7(
|
|
7265
6917
|
"div",
|
|
7266
6918
|
{
|
|
7267
6919
|
className: "agg-order-tabs flex items-end border-b border-agg-separator",
|
|
7268
6920
|
role: "tablist",
|
|
7269
6921
|
"aria-label": labels.common.tabsAria,
|
|
7270
6922
|
children: [
|
|
7271
|
-
/* @__PURE__ */
|
|
6923
|
+
/* @__PURE__ */ jsx7("div", { className: "flex min-w-0 flex-1 items-end", children: [
|
|
7272
6924
|
{ value: "buy", label: tradingLabels.buy, ref: buyTabRef },
|
|
7273
6925
|
{ value: "sell", label: tradingLabels.sell, ref: sellTabRef }
|
|
7274
6926
|
].map((tabItem) => {
|
|
7275
6927
|
const isActive = internalTab === tabItem.value;
|
|
7276
|
-
return /* @__PURE__ */
|
|
6928
|
+
return /* @__PURE__ */ jsxs7(
|
|
7277
6929
|
"button",
|
|
7278
6930
|
{
|
|
7279
6931
|
ref: tabItem.ref,
|
|
@@ -7297,7 +6949,7 @@ var PlaceOrder = ({
|
|
|
7297
6949
|
onKeyDown: (event) => handleTabKeyDown(event, tabItem.value),
|
|
7298
6950
|
children: [
|
|
7299
6951
|
tabItem.label,
|
|
7300
|
-
/* @__PURE__ */
|
|
6952
|
+
/* @__PURE__ */ jsx7(
|
|
7301
6953
|
"span",
|
|
7302
6954
|
{
|
|
7303
6955
|
"aria-hidden": "true",
|
|
@@ -7317,7 +6969,7 @@ var PlaceOrder = ({
|
|
|
7317
6969
|
tabItem.value
|
|
7318
6970
|
);
|
|
7319
6971
|
}) }),
|
|
7320
|
-
showLimitOrders ? /* @__PURE__ */
|
|
6972
|
+
showLimitOrders ? /* @__PURE__ */ jsx7(
|
|
7321
6973
|
Select,
|
|
7322
6974
|
{
|
|
7323
6975
|
ariaLabel: tradingLabels.orderTypeAria,
|
|
@@ -7338,8 +6990,8 @@ var PlaceOrder = ({
|
|
|
7338
6990
|
]
|
|
7339
6991
|
}
|
|
7340
6992
|
),
|
|
7341
|
-
/* @__PURE__ */
|
|
7342
|
-
outcomes.length >= 2 ? /* @__PURE__ */
|
|
6993
|
+
/* @__PURE__ */ jsxs7("div", { className: "agg-order-entry-section flex flex-col gap-4", children: [
|
|
6994
|
+
outcomes.length >= 2 ? /* @__PURE__ */ jsx7("div", { className: "agg-outcomes flex w-full max-w-full gap-2", children: outcomes.map((outcome, index) => {
|
|
7343
6995
|
var _a2, _b2, _c2;
|
|
7344
6996
|
const price = getDisplayOutcomePrice({
|
|
7345
6997
|
outcomeId: outcome.id,
|
|
@@ -7353,7 +7005,7 @@ var PlaceOrder = ({
|
|
|
7353
7005
|
const isActive = outcome.id === scopedSelectedOutcomeId;
|
|
7354
7006
|
const isPositive = resolveIsPositiveOutcome(outcome, index);
|
|
7355
7007
|
const isPriceLoading = clusterMidpointResult.isLoading && price == null;
|
|
7356
|
-
return /* @__PURE__ */
|
|
7008
|
+
return /* @__PURE__ */ jsxs7(
|
|
7357
7009
|
"button",
|
|
7358
7010
|
{
|
|
7359
7011
|
"data-id": outcome.id,
|
|
@@ -7373,7 +7025,7 @@ var PlaceOrder = ({
|
|
|
7373
7025
|
disabled: !orderEligibility.canPlaceOrder || isResolvedOutcomeCtaLocked,
|
|
7374
7026
|
onClick: () => handleOutcomeChange(outcome.id),
|
|
7375
7027
|
children: [
|
|
7376
|
-
/* @__PURE__ */
|
|
7028
|
+
/* @__PURE__ */ jsx7(
|
|
7377
7029
|
Typography,
|
|
7378
7030
|
{
|
|
7379
7031
|
as: "span",
|
|
@@ -7382,7 +7034,7 @@ var PlaceOrder = ({
|
|
|
7382
7034
|
children: (_c2 = outcome.title) != null ? _c2 : outcome.label
|
|
7383
7035
|
}
|
|
7384
7036
|
),
|
|
7385
|
-
isPriceLoading ? /* @__PURE__ */
|
|
7037
|
+
isPriceLoading ? /* @__PURE__ */ jsx7(
|
|
7386
7038
|
"span",
|
|
7387
7039
|
{
|
|
7388
7040
|
"aria-hidden": "true",
|
|
@@ -7391,18 +7043,18 @@ var PlaceOrder = ({
|
|
|
7391
7043
|
"h-4 w-10 shrink-0 rounded-agg-sm bg-agg-separator animate-pulse"
|
|
7392
7044
|
)
|
|
7393
7045
|
}
|
|
7394
|
-
) : /* @__PURE__ */
|
|
7046
|
+
) : /* @__PURE__ */ jsx7(Typography, { as: "span", variant: isActive ? "body-strong" : "body", children: formatProbabilityCents(price, formatPrice) })
|
|
7395
7047
|
]
|
|
7396
7048
|
},
|
|
7397
7049
|
outcome.id
|
|
7398
7050
|
);
|
|
7399
7051
|
}) }) : null,
|
|
7400
|
-
isLimitOrder ? /* @__PURE__ */
|
|
7401
|
-
/* @__PURE__ */
|
|
7402
|
-
/* @__PURE__ */
|
|
7403
|
-
/* @__PURE__ */
|
|
7404
|
-
/* @__PURE__ */
|
|
7405
|
-
/* @__PURE__ */
|
|
7052
|
+
isLimitOrder ? /* @__PURE__ */ jsxs7("div", { className: "agg-limit-price-section flex items-center justify-between gap-4", children: [
|
|
7053
|
+
/* @__PURE__ */ jsx7("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.limitPrice }),
|
|
7054
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex min-w-0 flex-col items-end gap-1", children: [
|
|
7055
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-2", children: [
|
|
7056
|
+
/* @__PURE__ */ jsxs7("label", { className: "relative flex items-center", children: [
|
|
7057
|
+
/* @__PURE__ */ jsx7(
|
|
7406
7058
|
"input",
|
|
7407
7059
|
{
|
|
7408
7060
|
type: "text",
|
|
@@ -7419,40 +7071,40 @@ var PlaceOrder = ({
|
|
|
7419
7071
|
)
|
|
7420
7072
|
}
|
|
7421
7073
|
),
|
|
7422
|
-
/* @__PURE__ */
|
|
7074
|
+
/* @__PURE__ */ jsx7("span", { className: "pointer-events-none absolute right-1 text-agg-3xl font-agg-bold leading-agg-9 text-agg-foreground", children: "\xA2" })
|
|
7423
7075
|
] }),
|
|
7424
|
-
/* @__PURE__ */
|
|
7076
|
+
/* @__PURE__ */ jsx7(
|
|
7425
7077
|
"button",
|
|
7426
7078
|
{
|
|
7427
7079
|
type: "button",
|
|
7428
7080
|
className: "flex size-8 cursor-pointer items-center justify-center rounded-agg-lg bg-agg-secondary-hover text-agg-foreground hover:bg-agg-tertiary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary",
|
|
7429
7081
|
"aria-label": tradingLabels.limitPriceDecreaseAria,
|
|
7430
7082
|
onClick: () => handleLimitPriceStep("decrease"),
|
|
7431
|
-
children: /* @__PURE__ */
|
|
7083
|
+
children: /* @__PURE__ */ jsx7(Icon, { name: "minus", size: "small", className: "h-4 w-4", "aria-hidden": true })
|
|
7432
7084
|
}
|
|
7433
7085
|
),
|
|
7434
|
-
/* @__PURE__ */
|
|
7086
|
+
/* @__PURE__ */ jsx7(
|
|
7435
7087
|
"button",
|
|
7436
7088
|
{
|
|
7437
7089
|
type: "button",
|
|
7438
7090
|
className: "flex size-8 cursor-pointer items-center justify-center rounded-agg-lg bg-agg-secondary-hover text-agg-foreground hover:bg-agg-tertiary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary",
|
|
7439
7091
|
"aria-label": tradingLabels.limitPriceIncreaseAria,
|
|
7440
7092
|
onClick: () => handleLimitPriceStep("increase"),
|
|
7441
|
-
children: /* @__PURE__ */
|
|
7093
|
+
children: /* @__PURE__ */ jsx7(Icon, { name: "plus", size: "small", className: "h-4 w-4", "aria-hidden": true })
|
|
7442
7094
|
}
|
|
7443
7095
|
)
|
|
7444
7096
|
] }),
|
|
7445
|
-
limitPriceInputError ? /* @__PURE__ */
|
|
7097
|
+
limitPriceInputError ? /* @__PURE__ */ jsx7("p", { className: "max-w-[220px] text-right text-agg-xs leading-agg-4 text-agg-error", children: limitPriceInputError }) : null
|
|
7446
7098
|
] })
|
|
7447
7099
|
] }) : null,
|
|
7448
|
-
isLimitOrder && limitPriceAdjustmentMessage ? /* @__PURE__ */
|
|
7100
|
+
isLimitOrder && limitPriceAdjustmentMessage ? /* @__PURE__ */ jsxs7(
|
|
7449
7101
|
"div",
|
|
7450
7102
|
{
|
|
7451
7103
|
className: "agg-limit-price-adjustment flex w-full items-center gap-2 rounded-agg-lg bg-agg-warning/10 px-3 py-2",
|
|
7452
7104
|
role: "status",
|
|
7453
7105
|
"aria-live": "polite",
|
|
7454
7106
|
children: [
|
|
7455
|
-
/* @__PURE__ */
|
|
7107
|
+
/* @__PURE__ */ jsx7(
|
|
7456
7108
|
Icon,
|
|
7457
7109
|
{
|
|
7458
7110
|
name: "warning-filled",
|
|
@@ -7461,16 +7113,16 @@ var PlaceOrder = ({
|
|
|
7461
7113
|
"aria-hidden": "true"
|
|
7462
7114
|
}
|
|
7463
7115
|
),
|
|
7464
|
-
/* @__PURE__ */
|
|
7116
|
+
/* @__PURE__ */ jsx7("p", { className: "min-w-0 flex-1 wrap-break-word text-agg-sm leading-agg-5 text-agg-foreground", children: limitPriceAdjustmentMessage })
|
|
7465
7117
|
]
|
|
7466
7118
|
}
|
|
7467
7119
|
) : null,
|
|
7468
|
-
/* @__PURE__ */
|
|
7469
|
-
/* @__PURE__ */
|
|
7470
|
-
/* @__PURE__ */
|
|
7471
|
-
isAuthenticated ? isSell ? /* @__PURE__ */
|
|
7472
|
-
/* @__PURE__ */
|
|
7473
|
-
displayedCurrentSellableShares > 0 ? /* @__PURE__ */
|
|
7120
|
+
/* @__PURE__ */ jsxs7("div", { className: "agg-order-amount-section flex items-start justify-between gap-4", children: [
|
|
7121
|
+
/* @__PURE__ */ jsxs7("div", { className: "agg-order-amount-meta flex flex-col", children: [
|
|
7122
|
+
/* @__PURE__ */ jsx7("p", { className: "agg-order-amount-label text-agg-base font-agg-bold leading-agg-6 text-agg-foreground whitespace-nowrap", children: tradingLabels.amount(internalTab) }),
|
|
7123
|
+
isAuthenticated ? isSell ? /* @__PURE__ */ jsx7("div", { className: "agg-balance-value flex items-baseline gap-1.5 text-agg-sm leading-agg-5 text-agg-muted-foreground", children: isCurrentSellableSharesLoading ? /* @__PURE__ */ jsx7(LoadingIcon, { size: "small" }) : /* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
7124
|
+
/* @__PURE__ */ jsx7("span", { className: "whitespace-pre", children: displayedCurrentSellableSharesLabel }),
|
|
7125
|
+
displayedCurrentSellableShares > 0 ? /* @__PURE__ */ jsx7(
|
|
7474
7126
|
"button",
|
|
7475
7127
|
{
|
|
7476
7128
|
type: "button",
|
|
@@ -7486,12 +7138,12 @@ var PlaceOrder = ({
|
|
|
7486
7138
|
children: tradingLabels.maxShares
|
|
7487
7139
|
}
|
|
7488
7140
|
) : null
|
|
7489
|
-
] }) }) : /* @__PURE__ */
|
|
7490
|
-
/* @__PURE__ */
|
|
7491
|
-
!isPaperMode && isBetdexRoute && !isBetdexOnlyRoute ? /* @__PURE__ */
|
|
7141
|
+
] }) }) : /* @__PURE__ */ jsx7("div", { className: "agg-balance-value flex flex-col items-end gap-1 text-agg-sm leading-agg-5 text-agg-muted-foreground", children: isBalanceLoading ? /* @__PURE__ */ jsx7(LoadingIcon, { size: "small" }) : /* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
7142
|
+
/* @__PURE__ */ jsx7("span", { children: !isPaperMode && isBetdexOnlyRoute && betdexAvailableBalance === null ? betdexBalanceLabel : tradingLabels.balance(formatUsd(displayedBalance)) }),
|
|
7143
|
+
!isPaperMode && isBetdexRoute && !isBetdexOnlyRoute ? /* @__PURE__ */ jsx7("span", { children: betdexBalanceLabel }) : null
|
|
7492
7144
|
] }) }) : null
|
|
7493
7145
|
] }),
|
|
7494
|
-
/* @__PURE__ */
|
|
7146
|
+
/* @__PURE__ */ jsx7(
|
|
7495
7147
|
CurrencyInput,
|
|
7496
7148
|
{
|
|
7497
7149
|
value: internalAmount,
|
|
@@ -7513,10 +7165,10 @@ var PlaceOrder = ({
|
|
|
7513
7165
|
}
|
|
7514
7166
|
)
|
|
7515
7167
|
] }),
|
|
7516
|
-
showFeesBreakdown && hasEnteredAmount && !isBelowMinimum && estimatedFeesValue ? /* @__PURE__ */
|
|
7517
|
-
/* @__PURE__ */
|
|
7518
|
-
/* @__PURE__ */
|
|
7519
|
-
/* @__PURE__ */
|
|
7168
|
+
showFeesBreakdown && hasEnteredAmount && !isBelowMinimum && estimatedFeesValue ? /* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
7169
|
+
/* @__PURE__ */ jsxs7("div", { className: "agg-order-fees-section flex items-center justify-between gap-4", children: [
|
|
7170
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-1.5", children: [
|
|
7171
|
+
/* @__PURE__ */ jsx7(
|
|
7520
7172
|
Typography,
|
|
7521
7173
|
{
|
|
7522
7174
|
variant: "text-sm",
|
|
@@ -7524,7 +7176,7 @@ var PlaceOrder = ({
|
|
|
7524
7176
|
children: tradingLabels.estimatedFees
|
|
7525
7177
|
}
|
|
7526
7178
|
),
|
|
7527
|
-
feeBreakdownRows.length > 0 ? /* @__PURE__ */
|
|
7179
|
+
feeBreakdownRows.length > 0 ? /* @__PURE__ */ jsx7(
|
|
7528
7180
|
Tooltip,
|
|
7529
7181
|
{
|
|
7530
7182
|
"aria-label": tradingLabels.estimatedFeesTooltipAria,
|
|
@@ -7536,13 +7188,13 @@ var PlaceOrder = ({
|
|
|
7536
7188
|
icon: "h-3 w-3 text-agg-muted-foreground",
|
|
7537
7189
|
trigger: "h-3 w-3 text-agg-muted-foreground"
|
|
7538
7190
|
},
|
|
7539
|
-
content: /* @__PURE__ */
|
|
7191
|
+
content: /* @__PURE__ */ jsx7("div", { className: "flex w-full flex-col gap-2", children: feeBreakdownRows.map((row) => /* @__PURE__ */ jsxs7(
|
|
7540
7192
|
"div",
|
|
7541
7193
|
{
|
|
7542
7194
|
className: "flex items-center justify-between gap-3 text-agg-sm font-agg-normal leading-agg-5 text-agg-foreground",
|
|
7543
7195
|
children: [
|
|
7544
|
-
/* @__PURE__ */
|
|
7545
|
-
row.kind === "badge" ? /* @__PURE__ */
|
|
7196
|
+
/* @__PURE__ */ jsx7("span", { children: row.label }),
|
|
7197
|
+
row.kind === "badge" ? /* @__PURE__ */ jsx7(
|
|
7546
7198
|
"span",
|
|
7547
7199
|
{
|
|
7548
7200
|
className: cn(
|
|
@@ -7552,7 +7204,7 @@ var PlaceOrder = ({
|
|
|
7552
7204
|
),
|
|
7553
7205
|
children: row.badgeLabel
|
|
7554
7206
|
}
|
|
7555
|
-
) : /* @__PURE__ */
|
|
7207
|
+
) : /* @__PURE__ */ jsx7("span", { className: "text-right", children: row.value })
|
|
7556
7208
|
]
|
|
7557
7209
|
},
|
|
7558
7210
|
row.label
|
|
@@ -7560,9 +7212,9 @@ var PlaceOrder = ({
|
|
|
7560
7212
|
}
|
|
7561
7213
|
) : null
|
|
7562
7214
|
] }),
|
|
7563
|
-
/* @__PURE__ */
|
|
7215
|
+
/* @__PURE__ */ jsx7("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: estimatedFeesValue })
|
|
7564
7216
|
] }),
|
|
7565
|
-
(activeQuoteData == null ? void 0 : activeQuoteData.fills.some((fill) => fill.venue === Venue5.betdex)) ? /* @__PURE__ */
|
|
7217
|
+
(activeQuoteData == null ? void 0 : activeQuoteData.fills.some((fill) => fill.venue === Venue5.betdex)) ? /* @__PURE__ */ jsx7(
|
|
7566
7218
|
Typography,
|
|
7567
7219
|
{
|
|
7568
7220
|
variant: "text-sm",
|
|
@@ -7571,9 +7223,9 @@ var PlaceOrder = ({
|
|
|
7571
7223
|
}
|
|
7572
7224
|
) : null
|
|
7573
7225
|
] }) : null,
|
|
7574
|
-
showFeesBreakdown && hasEnteredAmount && !isBelowMinimum && executionReserveValue ? /* @__PURE__ */
|
|
7575
|
-
/* @__PURE__ */
|
|
7576
|
-
/* @__PURE__ */
|
|
7226
|
+
showFeesBreakdown && hasEnteredAmount && !isBelowMinimum && executionReserveValue ? /* @__PURE__ */ jsxs7("div", { className: "agg-order-reserve-section flex items-center justify-between gap-4", children: [
|
|
7227
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-1.5", children: [
|
|
7228
|
+
/* @__PURE__ */ jsx7(
|
|
7577
7229
|
Typography,
|
|
7578
7230
|
{
|
|
7579
7231
|
variant: "text-sm",
|
|
@@ -7581,7 +7233,7 @@ var PlaceOrder = ({
|
|
|
7581
7233
|
children: tradingLabels.executionReserve
|
|
7582
7234
|
}
|
|
7583
7235
|
),
|
|
7584
|
-
/* @__PURE__ */
|
|
7236
|
+
/* @__PURE__ */ jsx7(
|
|
7585
7237
|
Tooltip,
|
|
7586
7238
|
{
|
|
7587
7239
|
"aria-label": tradingLabels.executionReserveTooltipAria,
|
|
@@ -7594,18 +7246,18 @@ var PlaceOrder = ({
|
|
|
7594
7246
|
}
|
|
7595
7247
|
)
|
|
7596
7248
|
] }),
|
|
7597
|
-
/* @__PURE__ */
|
|
7249
|
+
/* @__PURE__ */ jsx7("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: executionReserveValue })
|
|
7598
7250
|
] }) : null
|
|
7599
7251
|
] }),
|
|
7600
|
-
shouldShowSmartRouting ? /* @__PURE__ */
|
|
7252
|
+
shouldShowSmartRouting ? /* @__PURE__ */ jsxs7(
|
|
7601
7253
|
"div",
|
|
7602
7254
|
{
|
|
7603
7255
|
className: "agg-route-panel flex flex-col gap-3",
|
|
7604
7256
|
"aria-busy": !isLimitOrder && isQuoteLoading,
|
|
7605
7257
|
children: [
|
|
7606
|
-
/* @__PURE__ */
|
|
7607
|
-
/* @__PURE__ */
|
|
7608
|
-
shouldShowRouteToggle && !isRoutesExpanded ? /* @__PURE__ */
|
|
7258
|
+
/* @__PURE__ */ jsxs7("div", { className: "agg-route-panel-header flex items-center justify-between gap-4", children: [
|
|
7259
|
+
/* @__PURE__ */ jsx7("p", { className: "agg-route-panel-title text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.smartRouting }),
|
|
7260
|
+
shouldShowRouteToggle && !isRoutesExpanded ? /* @__PURE__ */ jsxs7(
|
|
7609
7261
|
"button",
|
|
7610
7262
|
{
|
|
7611
7263
|
type: "button",
|
|
@@ -7613,8 +7265,8 @@ var PlaceOrder = ({
|
|
|
7613
7265
|
"aria-label": tradingLabels.viewAllRoutes(activeRouteCardCount),
|
|
7614
7266
|
onClick: () => setIsRoutesExpanded((currentValue) => !currentValue),
|
|
7615
7267
|
children: [
|
|
7616
|
-
/* @__PURE__ */
|
|
7617
|
-
/* @__PURE__ */
|
|
7268
|
+
/* @__PURE__ */ jsx7("span", { children: tradingLabels.viewAllRoutes(activeRouteCardCount) }),
|
|
7269
|
+
/* @__PURE__ */ jsx7(
|
|
7618
7270
|
Icon,
|
|
7619
7271
|
{
|
|
7620
7272
|
name: "chevron-down",
|
|
@@ -7627,11 +7279,11 @@ var PlaceOrder = ({
|
|
|
7627
7279
|
}
|
|
7628
7280
|
) : null
|
|
7629
7281
|
] }),
|
|
7630
|
-
/* @__PURE__ */
|
|
7631
|
-
/* @__PURE__ */
|
|
7632
|
-
/* @__PURE__ */
|
|
7282
|
+
/* @__PURE__ */ jsx7("div", { className: "agg-route-list flex flex-col gap-2", children: !isLimitOrder && isQuoteLoading && activeRouteCards.length === 0 ? /* @__PURE__ */ jsxs7("div", { className: "agg-route-loading flex flex-col gap-2", "aria-hidden": "true", children: [
|
|
7283
|
+
/* @__PURE__ */ jsx7(PlaceOrderRouteCardSkeleton, {}),
|
|
7284
|
+
/* @__PURE__ */ jsx7(PlaceOrderRouteCardSkeleton, {})
|
|
7633
7285
|
] }) : activeRouteCards.length > 0 ? activeRouteCards.map((card) => {
|
|
7634
|
-
return /* @__PURE__ */
|
|
7286
|
+
return /* @__PURE__ */ jsx7(Fragment2, { children: renderRouteCard({
|
|
7635
7287
|
card,
|
|
7636
7288
|
enableAnimations,
|
|
7637
7289
|
isExpanded: card.kind === "split" ? isSplitDetailOpen : isRoutesExpanded,
|
|
@@ -7645,15 +7297,15 @@ var PlaceOrder = ({
|
|
|
7645
7297
|
]
|
|
7646
7298
|
}
|
|
7647
7299
|
) : null,
|
|
7648
|
-
isLimitOrder && (selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue) !== Venue5.prophetx ? /* @__PURE__ */
|
|
7649
|
-
/* @__PURE__ */
|
|
7650
|
-
/* @__PURE__ */
|
|
7300
|
+
isLimitOrder && (selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue) !== Venue5.prophetx ? /* @__PURE__ */ jsxs7("div", { className: "agg-limit-expiration-section flex items-center justify-between gap-4", children: [
|
|
7301
|
+
/* @__PURE__ */ jsx7("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.expiration }),
|
|
7302
|
+
/* @__PURE__ */ jsxs7(
|
|
7651
7303
|
Popover.Root,
|
|
7652
7304
|
{
|
|
7653
7305
|
open: isLimitExpirationPickerOpen,
|
|
7654
7306
|
onOpenChange: handleLimitExpirationPickerOpenChange,
|
|
7655
7307
|
children: [
|
|
7656
|
-
/* @__PURE__ */
|
|
7308
|
+
/* @__PURE__ */ jsx7(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs7(
|
|
7657
7309
|
"button",
|
|
7658
7310
|
{
|
|
7659
7311
|
ref: expirationTriggerRef,
|
|
@@ -7661,10 +7313,10 @@ var PlaceOrder = ({
|
|
|
7661
7313
|
className: "flex min-w-0 cursor-pointer items-center justify-end gap-2 text-right text-agg-base leading-agg-6 text-agg-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary",
|
|
7662
7314
|
"aria-label": tradingLabels.expirationMenuAria,
|
|
7663
7315
|
children: [
|
|
7664
|
-
/* @__PURE__ */
|
|
7316
|
+
/* @__PURE__ */ jsx7("span", { className: "min-w-0 truncate", children: limitExpirationType === "GTC" ? tradingLabels.expirationGoodTilCanceled : limitExpirationType === "FIVE_MINUTES" ? tradingLabels.expirationFiveMinutes : limitExpirationType === "ONE_HOUR" ? tradingLabels.expirationOneHour : limitExpirationType === "END_OF_DAY" ? tradingLabels.expirationEndOfDay : resolvedCustomExpirationDate ? dayjs(resolvedCustomExpirationDate).format(
|
|
7665
7317
|
"MMM D, YYYY [at] HH:mm"
|
|
7666
7318
|
) : tradingLabels.expirationCustom }),
|
|
7667
|
-
/* @__PURE__ */
|
|
7319
|
+
/* @__PURE__ */ jsx7(
|
|
7668
7320
|
Icon,
|
|
7669
7321
|
{
|
|
7670
7322
|
name: isLimitExpirationPickerOpen ? "chevron-up" : "chevron-down",
|
|
@@ -7676,11 +7328,11 @@ var PlaceOrder = ({
|
|
|
7676
7328
|
]
|
|
7677
7329
|
}
|
|
7678
7330
|
) }),
|
|
7679
|
-
/* @__PURE__ */
|
|
7331
|
+
/* @__PURE__ */ jsx7(
|
|
7680
7332
|
Popover.Portal,
|
|
7681
7333
|
{
|
|
7682
7334
|
container: resolvePlaceOrderPortalContainer(expirationTriggerRef.current),
|
|
7683
|
-
children: /* @__PURE__ */
|
|
7335
|
+
children: /* @__PURE__ */ jsx7(
|
|
7684
7336
|
Popover.Content,
|
|
7685
7337
|
{
|
|
7686
7338
|
align: "end",
|
|
@@ -7689,14 +7341,14 @@ var PlaceOrder = ({
|
|
|
7689
7341
|
role: "dialog",
|
|
7690
7342
|
"aria-label": tradingLabels.expirationMenuAria,
|
|
7691
7343
|
className: "z-50 max-h-[calc(100dvh-2rem)] w-[min(312px,calc(100vw-2rem))] overflow-y-auto rounded-agg-xl border border-agg-separator bg-agg-secondary p-0 shadow-[0_8px_16px_rgba(0,0,0,0.20)]",
|
|
7692
|
-
children: limitExpirationPickerView === "calendar" ? /* @__PURE__ */
|
|
7693
|
-
/* @__PURE__ */
|
|
7344
|
+
children: limitExpirationPickerView === "calendar" ? /* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-3 p-4", children: [
|
|
7345
|
+
/* @__PURE__ */ jsx7(
|
|
7694
7346
|
Button,
|
|
7695
7347
|
{
|
|
7696
7348
|
variant: "tertiary",
|
|
7697
7349
|
size: "small",
|
|
7698
7350
|
className: "w-fit px-0",
|
|
7699
|
-
prefix: /* @__PURE__ */
|
|
7351
|
+
prefix: /* @__PURE__ */ jsx7(
|
|
7700
7352
|
Icon,
|
|
7701
7353
|
{
|
|
7702
7354
|
name: "chevron-left",
|
|
@@ -7709,7 +7361,7 @@ var PlaceOrder = ({
|
|
|
7709
7361
|
children: tradingLabels.expirationOptions
|
|
7710
7362
|
}
|
|
7711
7363
|
),
|
|
7712
|
-
/* @__PURE__ */
|
|
7364
|
+
/* @__PURE__ */ jsx7(
|
|
7713
7365
|
Calendar,
|
|
7714
7366
|
{
|
|
7715
7367
|
mode: "single",
|
|
@@ -7724,9 +7376,9 @@ var PlaceOrder = ({
|
|
|
7724
7376
|
}
|
|
7725
7377
|
}
|
|
7726
7378
|
),
|
|
7727
|
-
/* @__PURE__ */
|
|
7728
|
-
/* @__PURE__ */
|
|
7729
|
-
/* @__PURE__ */
|
|
7379
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-4", children: [
|
|
7380
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex shrink-0 flex-col gap-0.5", children: [
|
|
7381
|
+
/* @__PURE__ */ jsx7(
|
|
7730
7382
|
"label",
|
|
7731
7383
|
{
|
|
7732
7384
|
htmlFor: expirationTimeInputId,
|
|
@@ -7734,9 +7386,9 @@ var PlaceOrder = ({
|
|
|
7734
7386
|
children: tradingLabels.expirationStartTime
|
|
7735
7387
|
}
|
|
7736
7388
|
),
|
|
7737
|
-
/* @__PURE__ */
|
|
7389
|
+
/* @__PURE__ */ jsx7("span", { className: "text-agg-xs leading-agg-4 text-agg-foreground", children: tradingLabels.expirationStartTimeHint })
|
|
7738
7390
|
] }),
|
|
7739
|
-
/* @__PURE__ */
|
|
7391
|
+
/* @__PURE__ */ jsx7(
|
|
7740
7392
|
"input",
|
|
7741
7393
|
{
|
|
7742
7394
|
id: expirationTimeInputId,
|
|
@@ -7747,8 +7399,8 @@ var PlaceOrder = ({
|
|
|
7747
7399
|
}
|
|
7748
7400
|
)
|
|
7749
7401
|
] }),
|
|
7750
|
-
/* @__PURE__ */
|
|
7751
|
-
/* @__PURE__ */
|
|
7402
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex gap-2", children: [
|
|
7403
|
+
/* @__PURE__ */ jsx7(
|
|
7752
7404
|
Button,
|
|
7753
7405
|
{
|
|
7754
7406
|
variant: "secondary",
|
|
@@ -7758,13 +7410,13 @@ var PlaceOrder = ({
|
|
|
7758
7410
|
children: tradingLabels.expirationCancel
|
|
7759
7411
|
}
|
|
7760
7412
|
),
|
|
7761
|
-
/* @__PURE__ */
|
|
7413
|
+
/* @__PURE__ */ jsx7(
|
|
7762
7414
|
Button,
|
|
7763
7415
|
{
|
|
7764
7416
|
size: "small",
|
|
7765
7417
|
className: "min-w-0 flex-1",
|
|
7766
7418
|
disabled: !isLimitExpirationDraftValid,
|
|
7767
|
-
prefix: /* @__PURE__ */
|
|
7419
|
+
prefix: /* @__PURE__ */ jsx7(
|
|
7768
7420
|
Icon,
|
|
7769
7421
|
{
|
|
7770
7422
|
name: "success-check",
|
|
@@ -7778,7 +7430,7 @@ var PlaceOrder = ({
|
|
|
7778
7430
|
}
|
|
7779
7431
|
)
|
|
7780
7432
|
] })
|
|
7781
|
-
] }) : /* @__PURE__ */
|
|
7433
|
+
] }) : /* @__PURE__ */ jsx7(
|
|
7782
7434
|
"div",
|
|
7783
7435
|
{
|
|
7784
7436
|
role: "radiogroup",
|
|
@@ -7796,7 +7448,7 @@ var PlaceOrder = ({
|
|
|
7796
7448
|
{ value: "ONE_HOUR", label: tradingLabels.expirationOneHour },
|
|
7797
7449
|
{ value: "END_OF_DAY", label: tradingLabels.expirationEndOfDay },
|
|
7798
7450
|
{ value: "CUSTOM", label: tradingLabels.expirationCustom }
|
|
7799
|
-
].map((item, optionIndex) => /* @__PURE__ */
|
|
7451
|
+
].map((item, optionIndex) => /* @__PURE__ */ jsxs7(
|
|
7800
7452
|
"button",
|
|
7801
7453
|
{
|
|
7802
7454
|
ref: (element) => {
|
|
@@ -7813,14 +7465,14 @@ var PlaceOrder = ({
|
|
|
7813
7465
|
onClick: () => handleLimitExpirationTypeChange(item.value),
|
|
7814
7466
|
onKeyDown: (event) => handleLimitExpirationOptionKeyDown(event, optionIndex),
|
|
7815
7467
|
children: [
|
|
7816
|
-
limitExpirationType === item.value ? /* @__PURE__ */
|
|
7468
|
+
limitExpirationType === item.value ? /* @__PURE__ */ jsx7(
|
|
7817
7469
|
"span",
|
|
7818
7470
|
{
|
|
7819
7471
|
className: "absolute bottom-2 left-0 top-2 w-1 bg-agg-primary",
|
|
7820
7472
|
"aria-hidden": true
|
|
7821
7473
|
}
|
|
7822
7474
|
) : null,
|
|
7823
|
-
/* @__PURE__ */
|
|
7475
|
+
/* @__PURE__ */ jsx7("span", { className: "truncate", children: item.label })
|
|
7824
7476
|
]
|
|
7825
7477
|
},
|
|
7826
7478
|
item.value
|
|
@@ -7835,12 +7487,12 @@ var PlaceOrder = ({
|
|
|
7835
7487
|
}
|
|
7836
7488
|
)
|
|
7837
7489
|
] }) : null,
|
|
7838
|
-
hasEnteredAmount && (isLimitOrder ? limitOrderPayload : selectedRouteCard) && !isQuoteLoading && !isBelowMinimum && orderEligibility.canPlaceOrder ? /* @__PURE__ */
|
|
7839
|
-
/* @__PURE__ */
|
|
7840
|
-
/* @__PURE__ */
|
|
7841
|
-
/* @__PURE__ */
|
|
7490
|
+
hasEnteredAmount && (isLimitOrder ? limitOrderPayload : selectedRouteCard) && !isQuoteLoading && !isBelowMinimum && orderEligibility.canPlaceOrder ? /* @__PURE__ */ jsxs7("div", { className: "agg-order-summary flex items-start justify-between gap-4", children: [
|
|
7491
|
+
/* @__PURE__ */ jsxs7("div", { className: "agg-order-summary-meta flex flex-col", children: [
|
|
7492
|
+
/* @__PURE__ */ jsx7("p", { className: "agg-order-summary-label text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.toWin(internalTab) }),
|
|
7493
|
+
/* @__PURE__ */ jsx7("p", { className: "agg-order-summary-hint text-agg-sm leading-agg-5 text-agg-muted-foreground", children: isLimitOrder ? displayedLimitToWinHint : displayedToWinHint })
|
|
7842
7494
|
] }),
|
|
7843
|
-
/* @__PURE__ */
|
|
7495
|
+
/* @__PURE__ */ jsx7(
|
|
7844
7496
|
NumberFlow,
|
|
7845
7497
|
{
|
|
7846
7498
|
value: isLimitOrder ? displayedLimitToWinValue : displayedToWinValue,
|
|
@@ -7855,7 +7507,7 @@ var PlaceOrder = ({
|
|
|
7855
7507
|
}
|
|
7856
7508
|
)
|
|
7857
7509
|
] }) : null,
|
|
7858
|
-
/* @__PURE__ */
|
|
7510
|
+
/* @__PURE__ */ jsxs7(
|
|
7859
7511
|
"div",
|
|
7860
7512
|
{
|
|
7861
7513
|
className: cn(
|
|
@@ -7863,17 +7515,17 @@ var PlaceOrder = ({
|
|
|
7863
7515
|
classNames == null ? void 0 : classNames.footer
|
|
7864
7516
|
),
|
|
7865
7517
|
children: [
|
|
7866
|
-
!shouldShowGeoBlockBanner ? /* @__PURE__ */
|
|
7867
|
-
submissionFeedback ? /* @__PURE__ */
|
|
7518
|
+
!shouldShowGeoBlockBanner ? /* @__PURE__ */ jsxs7("div", { className: "agg-order-alerts flex flex-col gap-3 empty:hidden mb-3", children: [
|
|
7519
|
+
submissionFeedback ? /* @__PURE__ */ jsx7(
|
|
7868
7520
|
InlineAlert,
|
|
7869
7521
|
{
|
|
7870
7522
|
tone: submissionFeedback.tone,
|
|
7871
7523
|
message: submissionFeedback.message
|
|
7872
7524
|
}
|
|
7873
7525
|
) : null,
|
|
7874
|
-
!submissionFeedback && orderEligibility.canPlaceOrder && !isInsufficientBalance && isBelowMinimum ? /* @__PURE__ */
|
|
7875
|
-
!submissionFeedback && orderEligibility.canPlaceOrder && !isInsufficientBalance && !isBelowMinimum && quoteStatus ? /* @__PURE__ */
|
|
7876
|
-
!submissionFeedback && orderEligibility.canPlaceOrder && !isInsufficientBalance && !isBelowMinimum && !quoteStatus && hasEnteredAmount && smartRouteErrorMessage ? /* @__PURE__ */
|
|
7526
|
+
!submissionFeedback && orderEligibility.canPlaceOrder && !isInsufficientBalance && isBelowMinimum ? /* @__PURE__ */ jsx7(InlineAlert, { tone: "error", message: belowMinimumMessage }) : null,
|
|
7527
|
+
!submissionFeedback && orderEligibility.canPlaceOrder && !isInsufficientBalance && !isBelowMinimum && quoteStatus ? /* @__PURE__ */ jsx7(InlineAlert, { tone: quoteStatus.tone, message: quoteStatus.message }) : null,
|
|
7528
|
+
!submissionFeedback && orderEligibility.canPlaceOrder && !isInsufficientBalance && !isBelowMinimum && !quoteStatus && hasEnteredAmount && smartRouteErrorMessage ? /* @__PURE__ */ jsx7(
|
|
7877
7529
|
InlineAlert,
|
|
7878
7530
|
{
|
|
7879
7531
|
tone: "error",
|
|
@@ -7885,14 +7537,14 @@ var PlaceOrder = ({
|
|
|
7885
7537
|
}
|
|
7886
7538
|
) : null
|
|
7887
7539
|
] }) : null,
|
|
7888
|
-
!submissionFeedback && !shouldShowGeoBlockBanner && orderEligibility.canPlaceOrder && !needsSharedKycVerification && !needsKalshiConnection && shouldShowInsufficientBalanceAlert ? /* @__PURE__ */
|
|
7540
|
+
!submissionFeedback && !shouldShowGeoBlockBanner && orderEligibility.canPlaceOrder && !needsSharedKycVerification && !needsKalshiConnection && shouldShowInsufficientBalanceAlert ? /* @__PURE__ */ jsxs7(
|
|
7889
7541
|
"div",
|
|
7890
7542
|
{
|
|
7891
7543
|
className: "agg-order-insufficient-balance-alert flex items-center justify-center gap-2",
|
|
7892
7544
|
role: "status",
|
|
7893
7545
|
"aria-live": "polite",
|
|
7894
7546
|
children: [
|
|
7895
|
-
/* @__PURE__ */
|
|
7547
|
+
/* @__PURE__ */ jsx7(
|
|
7896
7548
|
Icon,
|
|
7897
7549
|
{
|
|
7898
7550
|
name: "warning-filled",
|
|
@@ -7901,8 +7553,8 @@ var PlaceOrder = ({
|
|
|
7901
7553
|
"aria-hidden": "true"
|
|
7902
7554
|
}
|
|
7903
7555
|
),
|
|
7904
|
-
/* @__PURE__ */
|
|
7905
|
-
insufficientBalanceDetails ? /* @__PURE__ */
|
|
7556
|
+
/* @__PURE__ */ jsx7("span", { className: "text-agg-sm text-agg-foreground", children: tradingLabels.insufficientBalance }),
|
|
7557
|
+
insufficientBalanceDetails ? /* @__PURE__ */ jsx7(
|
|
7906
7558
|
Tooltip,
|
|
7907
7559
|
{
|
|
7908
7560
|
"aria-label": tradingLabels.insufficientBalanceDetails,
|
|
@@ -7918,7 +7570,7 @@ var PlaceOrder = ({
|
|
|
7918
7570
|
]
|
|
7919
7571
|
}
|
|
7920
7572
|
) : null,
|
|
7921
|
-
!submissionFeedback && !shouldShowGeoBlockBanner && needsSharedKycVerification ? /* @__PURE__ */
|
|
7573
|
+
!submissionFeedback && !shouldShowGeoBlockBanner && needsSharedKycVerification ? /* @__PURE__ */ jsx7(
|
|
7922
7574
|
Button,
|
|
7923
7575
|
{
|
|
7924
7576
|
size: "large",
|
|
@@ -7932,7 +7584,7 @@ var PlaceOrder = ({
|
|
|
7932
7584
|
},
|
|
7933
7585
|
children: sharedKyc.status === "loading" ? tradingLabels.sharedKyc.checkingStatus : tradingLabels.sharedKyc.completeToTrade
|
|
7934
7586
|
}
|
|
7935
|
-
) : !submissionFeedback && !shouldShowGeoBlockBanner && needsProphetxConnection ? /* @__PURE__ */
|
|
7587
|
+
) : !submissionFeedback && !shouldShowGeoBlockBanner && needsProphetxConnection ? /* @__PURE__ */ jsx7(
|
|
7936
7588
|
Button,
|
|
7937
7589
|
{
|
|
7938
7590
|
size: "large",
|
|
@@ -7940,7 +7592,7 @@ var PlaceOrder = ({
|
|
|
7940
7592
|
onClick: () => setIsConnectProphetxModalOpen(true),
|
|
7941
7593
|
children: tradingLabels.connectProphetx
|
|
7942
7594
|
}
|
|
7943
|
-
) : !submissionFeedback && isProphetxDirectRoute && isSell ? /* @__PURE__ */
|
|
7595
|
+
) : !submissionFeedback && isProphetxDirectRoute && isSell ? /* @__PURE__ */ jsx7(Button, { size: "large", className: "h-12 w-full", disabled: true, children: tradingLabels.prophetxSettlementNotice }) : !submissionFeedback && !shouldShowGeoBlockBanner && isProphetxBalanceInsufficient ? /* @__PURE__ */ jsx7(
|
|
7944
7596
|
"a",
|
|
7945
7597
|
{
|
|
7946
7598
|
className: "flex h-12 w-full items-center justify-center rounded-agg-md bg-agg-primary text-agg-on-primary",
|
|
@@ -7949,7 +7601,7 @@ var PlaceOrder = ({
|
|
|
7949
7601
|
rel: "noopener noreferrer",
|
|
7950
7602
|
children: tradingLabels.prophetxFundingNotice
|
|
7951
7603
|
}
|
|
7952
|
-
) : !submissionFeedback && !shouldShowGeoBlockBanner && needsKalshiConnection ? /* @__PURE__ */
|
|
7604
|
+
) : !submissionFeedback && !shouldShowGeoBlockBanner && needsKalshiConnection ? /* @__PURE__ */ jsx7(
|
|
7953
7605
|
Button,
|
|
7954
7606
|
{
|
|
7955
7607
|
size: "large",
|
|
@@ -7959,17 +7611,7 @@ var PlaceOrder = ({
|
|
|
7959
7611
|
onClick: () => setIsConnectKalshiModalOpen(true),
|
|
7960
7612
|
children: tradingLabels.connectKalshi
|
|
7961
7613
|
}
|
|
7962
|
-
) :
|
|
7963
|
-
Button,
|
|
7964
|
-
{
|
|
7965
|
-
size: "large",
|
|
7966
|
-
variant: "primary",
|
|
7967
|
-
className: "agg-order-submit h-12 w-full px-8 text-agg-base leading-agg-6 shadow-none",
|
|
7968
|
-
"aria-label": isKalshiBalanceInsufficient ? tradingLabels.addFundsToKalshi : needsBetdexAccount ? tradingLabels.manageBetdexAccount : tradingLabels.deposit,
|
|
7969
|
-
onClick: handleDepositRequiredClick,
|
|
7970
|
-
children: isKalshiBalanceInsufficient ? tradingLabels.addFundsToKalshi : needsBetdexAccount ? tradingLabels.manageBetdexAccount : tradingLabels.deposit
|
|
7971
|
-
}
|
|
7972
|
-
) : isQuoteLoading && !isActionLoading ? /* @__PURE__ */ jsx11(
|
|
7614
|
+
) : isQuoteLoading && !isActionLoading ? /* @__PURE__ */ jsx7(
|
|
7973
7615
|
Button,
|
|
7974
7616
|
{
|
|
7975
7617
|
size: "large",
|
|
@@ -7978,7 +7620,7 @@ var PlaceOrder = ({
|
|
|
7978
7620
|
disabled: true,
|
|
7979
7621
|
"aria-live": "polite",
|
|
7980
7622
|
"aria-label": routeLoadingMessage != null ? routeLoadingMessage : labels.common.loading,
|
|
7981
|
-
prefix: /* @__PURE__ */
|
|
7623
|
+
prefix: /* @__PURE__ */ jsx7(
|
|
7982
7624
|
"span",
|
|
7983
7625
|
{
|
|
7984
7626
|
className: cn(
|
|
@@ -7990,7 +7632,17 @@ var PlaceOrder = ({
|
|
|
7990
7632
|
),
|
|
7991
7633
|
children: routeLoadingMessage
|
|
7992
7634
|
}
|
|
7993
|
-
) : !
|
|
7635
|
+
) : !submissionFeedback && !shouldShowGeoBlockBanner && (isInsufficientBalance || needsBetdexAccount) ? /* @__PURE__ */ jsx7(
|
|
7636
|
+
Button,
|
|
7637
|
+
{
|
|
7638
|
+
size: "large",
|
|
7639
|
+
variant: "primary",
|
|
7640
|
+
className: "agg-order-submit h-12 w-full px-8 text-agg-base leading-agg-6 shadow-none",
|
|
7641
|
+
"aria-label": isKalshiBalanceInsufficient ? tradingLabels.addFundsToKalshi : needsBetdexAccount ? tradingLabels.manageBetdexAccount : tradingLabels.deposit,
|
|
7642
|
+
onClick: handleDepositRequiredClick,
|
|
7643
|
+
children: isKalshiBalanceInsufficient ? tradingLabels.addFundsToKalshi : needsBetdexAccount ? tradingLabels.manageBetdexAccount : tradingLabels.deposit
|
|
7644
|
+
}
|
|
7645
|
+
) : !isAuthenticated ? /* @__PURE__ */ jsx7(
|
|
7994
7646
|
Button,
|
|
7995
7647
|
{
|
|
7996
7648
|
size: "large",
|
|
@@ -8001,7 +7653,7 @@ var PlaceOrder = ({
|
|
|
8001
7653
|
onClick: requestAggAuthChooserOpen,
|
|
8002
7654
|
children: tradingLabels.signInToTrade
|
|
8003
7655
|
}
|
|
8004
|
-
) : /* @__PURE__ */
|
|
7656
|
+
) : /* @__PURE__ */ jsx7(
|
|
8005
7657
|
Button,
|
|
8006
7658
|
{
|
|
8007
7659
|
size: "large",
|
|
@@ -8016,8 +7668,8 @@ var PlaceOrder = ({
|
|
|
8016
7668
|
children: actionLabel
|
|
8017
7669
|
}
|
|
8018
7670
|
),
|
|
8019
|
-
!shouldShowGeoBlockBanner && internalTab === "buy" && showFeesBreakdown && appFeeValue === 0 ? /* @__PURE__ */
|
|
8020
|
-
/* @__PURE__ */
|
|
7671
|
+
!shouldShowGeoBlockBanner && internalTab === "buy" && showFeesBreakdown && appFeeValue === 0 ? /* @__PURE__ */ jsxs7("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: [
|
|
7672
|
+
/* @__PURE__ */ jsx7(
|
|
8021
7673
|
Icon,
|
|
8022
7674
|
{
|
|
8023
7675
|
name: "shield-trust",
|
|
@@ -8026,10 +7678,10 @@ var PlaceOrder = ({
|
|
|
8026
7678
|
"aria-hidden": "true"
|
|
8027
7679
|
}
|
|
8028
7680
|
),
|
|
8029
|
-
/* @__PURE__ */
|
|
7681
|
+
/* @__PURE__ */ jsx7(Typography, { variant: "text-xs-caps", className: "text-agg-primary", children: tradingLabels.platformFee })
|
|
8030
7682
|
] }) : null,
|
|
8031
|
-
shouldShowGeoBlockBanner ? /* @__PURE__ */
|
|
8032
|
-
!shouldShowGeoBlockBanner ? /* @__PURE__ */
|
|
7683
|
+
shouldShowGeoBlockBanner ? /* @__PURE__ */ jsx7(GeoBlockBanner, { termsUrl: AGG_TERMS_OF_SERVICE_URL }) : null,
|
|
7684
|
+
!shouldShowGeoBlockBanner ? /* @__PURE__ */ jsx7("p", { className: "agg-order-disclaimer text-center text-agg-xs leading-agg-4 text-agg-muted-foreground", children: tradingLabels.disclaimer }) : null
|
|
8033
7685
|
]
|
|
8034
7686
|
}
|
|
8035
7687
|
)
|
|
@@ -8037,7 +7689,7 @@ var PlaceOrder = ({
|
|
|
8037
7689
|
]
|
|
8038
7690
|
}
|
|
8039
7691
|
),
|
|
8040
|
-
/* @__PURE__ */
|
|
7692
|
+
/* @__PURE__ */ jsx7(
|
|
8041
7693
|
SharedKycModal,
|
|
8042
7694
|
{
|
|
8043
7695
|
open: sharedKycFlow.isModalOpen,
|
|
@@ -8051,7 +7703,7 @@ var PlaceOrder = ({
|
|
|
8051
7703
|
}
|
|
8052
7704
|
}
|
|
8053
7705
|
),
|
|
8054
|
-
isAuthenticated && !isPaperMode && ((prophetxKeyStatus == null ? void 0 : prophetxKeyStatus.validatedAt) || (prophetxKeyStatus == null ? void 0 : prophetxKeyStatus.hasAccountHistory)) ? /* @__PURE__ */
|
|
7706
|
+
isAuthenticated && !isPaperMode && ((prophetxKeyStatus == null ? void 0 : prophetxKeyStatus.validatedAt) || (prophetxKeyStatus == null ? void 0 : prophetxKeyStatus.hasAccountHistory)) ? /* @__PURE__ */ jsx7(
|
|
8055
7707
|
"button",
|
|
8056
7708
|
{
|
|
8057
7709
|
type: "button",
|
|
@@ -8060,7 +7712,7 @@ var PlaceOrder = ({
|
|
|
8060
7712
|
children: tradingLabels.manageProphetx
|
|
8061
7713
|
}
|
|
8062
7714
|
) : null,
|
|
8063
|
-
isAuthenticated && isProphetxDirect && canConnectProphetx && !needsProphetxConnection && !(prophetxKeyStatus == null ? void 0 : prophetxKeyStatus.connected) && !(prophetxKeyStatus == null ? void 0 : prophetxKeyStatus.hasAccountHistory) ? /* @__PURE__ */
|
|
7715
|
+
isAuthenticated && isProphetxDirect && canConnectProphetx && !needsProphetxConnection && !(prophetxKeyStatus == null ? void 0 : prophetxKeyStatus.connected) && !(prophetxKeyStatus == null ? void 0 : prophetxKeyStatus.hasAccountHistory) ? /* @__PURE__ */ jsx7(
|
|
8064
7716
|
"button",
|
|
8065
7717
|
{
|
|
8066
7718
|
type: "button",
|
|
@@ -8069,7 +7721,7 @@ var PlaceOrder = ({
|
|
|
8069
7721
|
children: tradingLabels.connectProphetx
|
|
8070
7722
|
}
|
|
8071
7723
|
) : null,
|
|
8072
|
-
/* @__PURE__ */
|
|
7724
|
+
/* @__PURE__ */ jsx7(
|
|
8073
7725
|
ConnectProphetxModal,
|
|
8074
7726
|
{
|
|
8075
7727
|
allowExistingConnection: Boolean(
|
|
@@ -8089,7 +7741,7 @@ var PlaceOrder = ({
|
|
|
8089
7741
|
})
|
|
8090
7742
|
}
|
|
8091
7743
|
),
|
|
8092
|
-
/* @__PURE__ */
|
|
7744
|
+
/* @__PURE__ */ jsx7(
|
|
8093
7745
|
ConnectKalshiModal,
|
|
8094
7746
|
{
|
|
8095
7747
|
open: isConnectKalshiModalOpen,
|
|
@@ -8097,12 +7749,16 @@ var PlaceOrder = ({
|
|
|
8097
7749
|
onVerify: handleVerifyKalshi
|
|
8098
7750
|
}
|
|
8099
7751
|
),
|
|
8100
|
-
/* @__PURE__ */
|
|
8101
|
-
/* @__PURE__ */
|
|
7752
|
+
/* @__PURE__ */ jsx7(FundKalshiModal, { open: isFundKalshiModalOpen, onOpenChange: setIsFundKalshiModalOpen }),
|
|
7753
|
+
/* @__PURE__ */ jsx7(
|
|
8102
7754
|
ManageBetdexAccountModal,
|
|
8103
7755
|
{
|
|
7756
|
+
userId: user == null ? void 0 : user.id,
|
|
8104
7757
|
open: isBetdexAccountModalOpen,
|
|
8105
|
-
onOpenChange:
|
|
7758
|
+
onOpenChange: (open) => {
|
|
7759
|
+
setIsBetdexAccountModalOpen(open);
|
|
7760
|
+
if (!open) void smartRoute.refetch();
|
|
7761
|
+
}
|
|
8106
7762
|
}
|
|
8107
7763
|
)
|
|
8108
7764
|
] });
|
|
@@ -8115,28 +7771,28 @@ import {
|
|
|
8115
7771
|
invalidateBalanceQueries as invalidateBalanceQueries2,
|
|
8116
7772
|
invalidatePositionQueries as invalidatePositionQueries2,
|
|
8117
7773
|
invalidateUserActivityQueries,
|
|
8118
|
-
useLabels as
|
|
7774
|
+
useLabels as useLabels4,
|
|
8119
7775
|
useQueryClient as useQueryClient2,
|
|
8120
7776
|
useRedeem,
|
|
8121
7777
|
useRedeemLifecycles
|
|
8122
7778
|
} from "@agg-build/hooks";
|
|
8123
|
-
import { useCallback as useCallback4, useEffect as useEffect5, useMemo as useMemo2, useRef as useRef5, useState as
|
|
7779
|
+
import { useCallback as useCallback4, useEffect as useEffect5, useMemo as useMemo2, useRef as useRef5, useState as useState4 } from "react";
|
|
8124
7780
|
var toClaimError = (err) => {
|
|
8125
7781
|
if (err instanceof Error) return err;
|
|
8126
7782
|
return new Error(String(err));
|
|
8127
7783
|
};
|
|
8128
7784
|
function useClaimWinnings(options = {}) {
|
|
8129
7785
|
const { onClaim, onClaimResult, onClaimSubmitError, externalClaimingKeys } = options;
|
|
8130
|
-
const labels =
|
|
7786
|
+
const labels = useLabels4();
|
|
8131
7787
|
const claimNotificationLabels = labels.notifications.claim;
|
|
8132
7788
|
const toastCtx = useOptionalToast();
|
|
8133
7789
|
const queryClient = useQueryClient2();
|
|
8134
7790
|
const redeemMutation = useRedeem();
|
|
8135
|
-
const [activeRedeems, setActiveRedeems] =
|
|
7791
|
+
const [activeRedeems, setActiveRedeems] = useState4({});
|
|
8136
7792
|
const activeClaimKeysRef = useRef5(/* @__PURE__ */ new Set());
|
|
8137
7793
|
const pendingClaimToastIdsRef = useRef5({});
|
|
8138
7794
|
const submittedClaimToastKeysRef = useRef5(/* @__PURE__ */ new Set());
|
|
8139
|
-
const [submittingClaimKeys, setSubmittingClaimKeys] =
|
|
7795
|
+
const [submittingClaimKeys, setSubmittingClaimKeys] = useState4({});
|
|
8140
7796
|
const lifecycleInputs = useMemo2(
|
|
8141
7797
|
() => Object.values(activeRedeems),
|
|
8142
7798
|
[activeRedeems]
|
|
@@ -8445,7 +8101,6 @@ export {
|
|
|
8445
8101
|
createAggClientSharedKycInitiator,
|
|
8446
8102
|
useSharedKycFlow,
|
|
8447
8103
|
FundKalshiModal,
|
|
8448
|
-
BetdexAccountCard,
|
|
8449
8104
|
formatChainIdLabel,
|
|
8450
8105
|
PlaceOrderExecutionHeader,
|
|
8451
8106
|
PlaceOrderExecutionGroups,
|