@agg-build/ui 2.7.2 → 2.8.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-7R2SMMAG.mjs → chunk-2QCNDFNC.mjs} +193 -103
- package/dist/{chunk-EDQ64EKO.mjs → chunk-AKLGQ6AB.mjs} +254 -53
- package/dist/{chunk-FMYYPNZZ.mjs → chunk-KO6VTRV6.mjs} +101 -27
- package/dist/{chunk-AHQA3B7D.mjs → chunk-KX3TQ7WC.mjs} +1 -1
- package/dist/{chunk-EKUH3265.mjs → chunk-MKU5Q6PN.mjs} +51 -13
- package/dist/{chunk-O27JUYCF.mjs → chunk-R5S2QOYL.mjs} +495 -289
- package/dist/{chunk-JQKJDSTW.mjs → chunk-VR5ZRDQT.mjs} +3 -2
- package/dist/events.js +198 -91
- package/dist/events.mjs +3 -3
- package/dist/index.js +1350 -751
- package/dist/index.mjs +7 -7
- package/dist/modals.js +941 -418
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +1008 -609
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +94 -26
- package/dist/primitives.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +1403 -902
- package/dist/trading.mjs +4 -4
- package/dist/types/events/orderbook/orderbook.utils.d.mts +1 -1
- package/dist/types/events/orderbook/orderbook.utils.d.ts +1 -1
- package/dist/types/pages/user-profile/components/open-order-row.d.mts +1 -0
- package/dist/types/pages/user-profile/components/open-order-row.d.ts +1 -0
- package/dist/types/pages/user-profile/position-view-model.d.mts +15 -4
- package/dist/types/pages/user-profile/position-view-model.d.ts +15 -4
- package/dist/types/primitives/select/index.d.mts +1 -1
- package/dist/types/primitives/select/index.d.ts +1 -1
- package/dist/types/primitives/select/select.types.d.mts +8 -0
- package/dist/types/primitives/select/select.types.d.ts +8 -0
- package/dist/types/profile/profile-modal.constants.d.mts +2 -1
- package/dist/types/profile/profile-modal.constants.d.ts +2 -1
- package/dist/types/profile/tabs/balance-management-tab.d.mts +3 -0
- package/dist/types/profile/tabs/balance-management-tab.d.ts +3 -0
- package/dist/types/trading/place-order/index.place-order.constants.d.mts +2 -1
- package/dist/types/trading/place-order/index.place-order.constants.d.ts +2 -1
- package/dist/types/trading/place-order/index.place-order.types.d.mts +6 -0
- package/dist/types/trading/place-order/index.place-order.types.d.ts +6 -0
- package/dist/types/trading/place-order/index.place-order.utils.d.mts +10 -2
- package/dist/types/trading/place-order/index.place-order.utils.d.ts +10 -2
- package/package.json +2 -2
package/dist/trading.js
CHANGED
|
@@ -105,7 +105,7 @@ __export(trading_exports, {
|
|
|
105
105
|
prepareSettlementDifferences: () => prepareSettlementDifferences,
|
|
106
106
|
resolveDifferenceIconClassName: () => resolveDifferenceIconClassName,
|
|
107
107
|
useClaimWinnings: () => useClaimWinnings,
|
|
108
|
-
useEventTradingContext: () =>
|
|
108
|
+
useEventTradingContext: () => import_hooks38.useEventTradingContext,
|
|
109
109
|
useResolvedMarketClaim: () => useResolvedMarketClaim
|
|
110
110
|
});
|
|
111
111
|
module.exports = __toCommonJS(trading_exports);
|
|
@@ -5331,15 +5331,14 @@ var SettlementDetails = ({ className }) => {
|
|
|
5331
5331
|
SettlementDetails.displayName = "SettlementDetails";
|
|
5332
5332
|
|
|
5333
5333
|
// src/trading/place-order/index.tsx
|
|
5334
|
-
var
|
|
5334
|
+
var import_hooks37 = require("@agg-build/hooks");
|
|
5335
5335
|
var import_sdk17 = require("@agg-build/sdk");
|
|
5336
|
-
var
|
|
5337
|
-
var DropdownMenu = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
5336
|
+
var import_react15 = __toESM(require("@number-flow/react"));
|
|
5338
5337
|
var Popover = __toESM(require("@radix-ui/react-popover"));
|
|
5339
5338
|
var import_dayjs5 = __toESM(require("dayjs"));
|
|
5340
5339
|
var import_timezone2 = __toESM(require("dayjs/plugin/timezone"));
|
|
5341
5340
|
var import_utc2 = __toESM(require("dayjs/plugin/utc"));
|
|
5342
|
-
var
|
|
5341
|
+
var import_react16 = require("react");
|
|
5343
5342
|
|
|
5344
5343
|
// src/events/market-details/market-details.utils.ts
|
|
5345
5344
|
var import_sdk12 = require("@agg-build/sdk");
|
|
@@ -5347,8 +5346,9 @@ var import_dayjs2 = __toESM(require("dayjs"));
|
|
|
5347
5346
|
|
|
5348
5347
|
// src/events/orderbook/orderbook.utils.ts
|
|
5349
5348
|
var import_sdk11 = require("@agg-build/sdk");
|
|
5350
|
-
var formatProbabilityCents = (value) => {
|
|
5349
|
+
var formatProbabilityCents = (value, formatPrice) => {
|
|
5351
5350
|
if (value == null) return "-";
|
|
5351
|
+
if (formatPrice) return formatPrice(value);
|
|
5352
5352
|
const cents = (value * 100).toFixed(1).replace(/\.0$/, "");
|
|
5353
5353
|
return `${cents}\xA2`;
|
|
5354
5354
|
};
|
|
@@ -5492,8 +5492,8 @@ var GeoBlockBanner = ({
|
|
|
5492
5492
|
GeoBlockBanner.displayName = "GeoBlockBanner";
|
|
5493
5493
|
|
|
5494
5494
|
// src/onboarding/index.tsx
|
|
5495
|
-
var
|
|
5496
|
-
var
|
|
5495
|
+
var import_react12 = require("react");
|
|
5496
|
+
var import_hooks34 = require("@agg-build/hooks");
|
|
5497
5497
|
var Dialog4 = __toESM(require("@radix-ui/react-dialog"));
|
|
5498
5498
|
|
|
5499
5499
|
// src/primitives/modal/index.tsx
|
|
@@ -6021,8 +6021,8 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
6021
6021
|
HowItWorksStep.displayName = "HowItWorksStep";
|
|
6022
6022
|
|
|
6023
6023
|
// src/onboarding/steps/profile-setup.tsx
|
|
6024
|
-
var
|
|
6025
|
-
var
|
|
6024
|
+
var import_react9 = require("react");
|
|
6025
|
+
var import_hooks30 = require("@agg-build/hooks");
|
|
6026
6026
|
|
|
6027
6027
|
// src/primitives/calendar/index.tsx
|
|
6028
6028
|
var import_react_day_picker = require("react-day-picker");
|
|
@@ -6571,6 +6571,302 @@ var LoadingIcon = ({
|
|
|
6571
6571
|
};
|
|
6572
6572
|
LoadingIcon.displayName = "LoadingIcon";
|
|
6573
6573
|
|
|
6574
|
+
// src/primitives/select/index.tsx
|
|
6575
|
+
var import_hooks28 = require("@agg-build/hooks");
|
|
6576
|
+
var import_react6 = require("react");
|
|
6577
|
+
var import_react_dom = require("react-dom");
|
|
6578
|
+
|
|
6579
|
+
// src/primitives/select/select.constants.ts
|
|
6580
|
+
var SELECT_DEFAULT_IS_DISABLED = false;
|
|
6581
|
+
|
|
6582
|
+
// src/primitives/select/select.utils.ts
|
|
6583
|
+
var resolveHasEnabledItems = (items) => {
|
|
6584
|
+
return items.some((item) => !item.disabled);
|
|
6585
|
+
};
|
|
6586
|
+
var resolveSelectedItem = (items, value) => {
|
|
6587
|
+
return items.find((item) => item.value === value);
|
|
6588
|
+
};
|
|
6589
|
+
var resolveIsSelectDisabled = ({
|
|
6590
|
+
disabled,
|
|
6591
|
+
items
|
|
6592
|
+
}) => {
|
|
6593
|
+
return disabled || !resolveHasEnabledItems(items);
|
|
6594
|
+
};
|
|
6595
|
+
|
|
6596
|
+
// src/primitives/select/index.tsx
|
|
6597
|
+
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
6598
|
+
var SELECT_DROPDOWN_Z = 1e4;
|
|
6599
|
+
function resolveSelectPortalContainer(triggerRoot) {
|
|
6600
|
+
var _a, _b;
|
|
6601
|
+
if (!triggerRoot) return document.body;
|
|
6602
|
+
return (_b = (_a = triggerRoot.closest(".agg-modal-center")) != null ? _a : triggerRoot.closest(".agg-modal-content")) != null ? _b : document.body;
|
|
6603
|
+
}
|
|
6604
|
+
var Select = ({
|
|
6605
|
+
items,
|
|
6606
|
+
value,
|
|
6607
|
+
onChange,
|
|
6608
|
+
ariaLabel,
|
|
6609
|
+
className,
|
|
6610
|
+
triggerClassName,
|
|
6611
|
+
contentClassName,
|
|
6612
|
+
itemClassName,
|
|
6613
|
+
disabled = SELECT_DEFAULT_IS_DISABLED,
|
|
6614
|
+
variant = "default",
|
|
6615
|
+
openOnHover = false,
|
|
6616
|
+
contentAlign = "start",
|
|
6617
|
+
contentSideOffset = 8
|
|
6618
|
+
}) => {
|
|
6619
|
+
var _a;
|
|
6620
|
+
const labels = (0, import_hooks28.useLabels)();
|
|
6621
|
+
const {
|
|
6622
|
+
general: { rootClassName },
|
|
6623
|
+
features: { enableAnimations }
|
|
6624
|
+
} = (0, import_hooks28.useSdkUiConfig)();
|
|
6625
|
+
const isDisabled = resolveIsSelectDisabled({ disabled, items });
|
|
6626
|
+
const selectedItem = resolveSelectedItem(items, value);
|
|
6627
|
+
const [isOpen, setIsOpen] = (0, import_react6.useState)(false);
|
|
6628
|
+
const [menuRect, setMenuRect] = (0, import_react6.useState)(null);
|
|
6629
|
+
const containerRef = (0, import_react6.useRef)(null);
|
|
6630
|
+
const portalRef = (0, import_react6.useRef)(null);
|
|
6631
|
+
const closeTimerRef = (0, import_react6.useRef)(null);
|
|
6632
|
+
const openedByHoverRef = (0, import_react6.useRef)(false);
|
|
6633
|
+
const handleClose = (0, import_react6.useCallback)(() => {
|
|
6634
|
+
setIsOpen(false);
|
|
6635
|
+
openedByHoverRef.current = false;
|
|
6636
|
+
}, []);
|
|
6637
|
+
const updateMenuRect = (0, import_react6.useCallback)(() => {
|
|
6638
|
+
const el = containerRef.current;
|
|
6639
|
+
if (!el) return;
|
|
6640
|
+
const r = el.getBoundingClientRect();
|
|
6641
|
+
setMenuRect({
|
|
6642
|
+
top: r.bottom + contentSideOffset,
|
|
6643
|
+
left: r.left,
|
|
6644
|
+
right: r.right,
|
|
6645
|
+
width: r.width
|
|
6646
|
+
});
|
|
6647
|
+
}, [contentSideOffset]);
|
|
6648
|
+
(0, import_react6.useEffect)(() => {
|
|
6649
|
+
return () => {
|
|
6650
|
+
if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
|
|
6651
|
+
};
|
|
6652
|
+
}, []);
|
|
6653
|
+
(0, import_react6.useLayoutEffect)(() => {
|
|
6654
|
+
if (!isOpen) {
|
|
6655
|
+
setMenuRect(null);
|
|
6656
|
+
return;
|
|
6657
|
+
}
|
|
6658
|
+
updateMenuRect();
|
|
6659
|
+
}, [isOpen, updateMenuRect, value]);
|
|
6660
|
+
(0, import_react6.useEffect)(() => {
|
|
6661
|
+
if (!isOpen) return;
|
|
6662
|
+
const handlePointerDown = (event) => {
|
|
6663
|
+
var _a2, _b;
|
|
6664
|
+
const target = event.target;
|
|
6665
|
+
if ((_a2 = containerRef.current) == null ? void 0 : _a2.contains(target)) return;
|
|
6666
|
+
if ((_b = portalRef.current) == null ? void 0 : _b.contains(target)) return;
|
|
6667
|
+
handleClose();
|
|
6668
|
+
};
|
|
6669
|
+
const handleReposition = () => {
|
|
6670
|
+
updateMenuRect();
|
|
6671
|
+
};
|
|
6672
|
+
document.addEventListener("mousedown", handlePointerDown);
|
|
6673
|
+
window.addEventListener("resize", handleReposition);
|
|
6674
|
+
document.addEventListener("scroll", handleReposition, true);
|
|
6675
|
+
return () => {
|
|
6676
|
+
document.removeEventListener("mousedown", handlePointerDown);
|
|
6677
|
+
window.removeEventListener("resize", handleReposition);
|
|
6678
|
+
document.removeEventListener("scroll", handleReposition, true);
|
|
6679
|
+
};
|
|
6680
|
+
}, [isOpen, handleClose, updateMenuRect]);
|
|
6681
|
+
(0, import_react6.useEffect)(() => {
|
|
6682
|
+
if (!isOpen) return;
|
|
6683
|
+
const handleKeyDown = (event) => {
|
|
6684
|
+
if ((event == null ? void 0 : event.key) === "Escape") handleClose();
|
|
6685
|
+
};
|
|
6686
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
6687
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
6688
|
+
}, [isOpen, handleClose]);
|
|
6689
|
+
const handlePointerEnter = (event) => {
|
|
6690
|
+
if (!openOnHover || isDisabled || event.pointerType === "touch") return;
|
|
6691
|
+
if (closeTimerRef.current) {
|
|
6692
|
+
clearTimeout(closeTimerRef.current);
|
|
6693
|
+
closeTimerRef.current = null;
|
|
6694
|
+
}
|
|
6695
|
+
if (isOpen) return;
|
|
6696
|
+
openedByHoverRef.current = true;
|
|
6697
|
+
setIsOpen(true);
|
|
6698
|
+
};
|
|
6699
|
+
const handlePointerLeave = (event) => {
|
|
6700
|
+
if (!openOnHover || event.pointerType === "touch") return;
|
|
6701
|
+
if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
|
|
6702
|
+
closeTimerRef.current = setTimeout(() => {
|
|
6703
|
+
handleClose();
|
|
6704
|
+
closeTimerRef.current = null;
|
|
6705
|
+
}, 120);
|
|
6706
|
+
};
|
|
6707
|
+
const handleTriggerClick = () => {
|
|
6708
|
+
if (openedByHoverRef.current && isOpen) {
|
|
6709
|
+
openedByHoverRef.current = false;
|
|
6710
|
+
return;
|
|
6711
|
+
}
|
|
6712
|
+
setIsOpen((previousValue) => !previousValue);
|
|
6713
|
+
};
|
|
6714
|
+
const isInline = variant === "inline";
|
|
6715
|
+
const triggerRadiusClass = triggerClassName != null ? triggerClassName : isInline ? "rounded-agg-sm" : "rounded-agg-md";
|
|
6716
|
+
const listbox = menuRect ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
6717
|
+
"div",
|
|
6718
|
+
{
|
|
6719
|
+
ref: portalRef,
|
|
6720
|
+
"data-agg-select-dropdown": true,
|
|
6721
|
+
role: "listbox",
|
|
6722
|
+
"aria-label": ariaLabel != null ? ariaLabel : labels.common.selectAria,
|
|
6723
|
+
style: {
|
|
6724
|
+
position: "fixed",
|
|
6725
|
+
top: menuRect.top,
|
|
6726
|
+
left: contentAlign === "start" ? menuRect.left : void 0,
|
|
6727
|
+
right: contentAlign === "end" ? window.innerWidth - menuRect.right : void 0,
|
|
6728
|
+
width: menuRect.width,
|
|
6729
|
+
zIndex: SELECT_DROPDOWN_Z
|
|
6730
|
+
},
|
|
6731
|
+
className: cn(
|
|
6732
|
+
AGG_ROOT_CLASS_NAME,
|
|
6733
|
+
rootClassName,
|
|
6734
|
+
"agg-select-content pointer-events-auto max-h-[min(20rem,calc(100vh-4rem))] overflow-y-auto border border-agg-separator bg-agg-secondary flex flex-col",
|
|
6735
|
+
isInline ? "min-w-[120px] gap-0 rounded-agg-lg py-1 shadow-[0_8px_16px_rgba(0,0,0,0.12)]" : "gap-1 rounded-[12px] p-2 shadow-[0_8px_16px_rgba(0,0,0,0.1)]",
|
|
6736
|
+
contentClassName
|
|
6737
|
+
),
|
|
6738
|
+
onPointerEnter: handlePointerEnter,
|
|
6739
|
+
onPointerLeave: handlePointerLeave,
|
|
6740
|
+
children: items.map((item) => {
|
|
6741
|
+
const isSelected = item.value === value;
|
|
6742
|
+
const isHidden = item.hidden === true;
|
|
6743
|
+
if (isHidden) return null;
|
|
6744
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
|
|
6745
|
+
"button",
|
|
6746
|
+
{
|
|
6747
|
+
type: "button",
|
|
6748
|
+
role: "option",
|
|
6749
|
+
"aria-selected": isSelected,
|
|
6750
|
+
disabled: item.disabled,
|
|
6751
|
+
className: cn(
|
|
6752
|
+
"agg-select-item",
|
|
6753
|
+
"relative flex w-full items-center text-left text-agg-sm leading-agg-5 outline-none",
|
|
6754
|
+
isInline ? "gap-2 px-4 py-2" : "gap-3 rounded-[6px] py-3 pl-3 pr-5",
|
|
6755
|
+
"hover:bg-agg-secondary-hover focus-visible:bg-agg-secondary-hover",
|
|
6756
|
+
isSelected ? isInline ? "font-agg-bold text-agg-foreground" : "bg-agg-primary/10 font-agg-normal text-agg-primary" : "font-agg-normal text-agg-foreground",
|
|
6757
|
+
item.disabled && "cursor-not-allowed opacity-60",
|
|
6758
|
+
itemClassName
|
|
6759
|
+
),
|
|
6760
|
+
onClick: () => {
|
|
6761
|
+
if (item.disabled) {
|
|
6762
|
+
return;
|
|
6763
|
+
}
|
|
6764
|
+
onChange(item.value);
|
|
6765
|
+
handleClose();
|
|
6766
|
+
},
|
|
6767
|
+
children: [
|
|
6768
|
+
isInline && isSelected ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
6769
|
+
"span",
|
|
6770
|
+
{
|
|
6771
|
+
className: "agg-select-item-indicator absolute bottom-2 left-0 top-2 w-1 bg-agg-primary",
|
|
6772
|
+
"aria-hidden": true
|
|
6773
|
+
}
|
|
6774
|
+
) : null,
|
|
6775
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
6776
|
+
"span",
|
|
6777
|
+
{
|
|
6778
|
+
className: cn(
|
|
6779
|
+
"h-4 w-4 shrink-0 [&_svg]:h-full [&_svg]:w-full",
|
|
6780
|
+
isSelected ? "text-agg-primary" : "text-agg-muted-foreground"
|
|
6781
|
+
),
|
|
6782
|
+
children: item.icon
|
|
6783
|
+
}
|
|
6784
|
+
) : item.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
6785
|
+
RemoteImage,
|
|
6786
|
+
{
|
|
6787
|
+
src: item.iconUrl,
|
|
6788
|
+
alt: "",
|
|
6789
|
+
className: "agg-select-item-icon h-4 w-4 shrink-0 rounded-sm object-contain"
|
|
6790
|
+
}
|
|
6791
|
+
) : null,
|
|
6792
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { className: "agg-select-item-label truncate", children: item.label })
|
|
6793
|
+
]
|
|
6794
|
+
},
|
|
6795
|
+
item.value
|
|
6796
|
+
);
|
|
6797
|
+
})
|
|
6798
|
+
}
|
|
6799
|
+
) : null;
|
|
6800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
|
|
6801
|
+
"div",
|
|
6802
|
+
{
|
|
6803
|
+
ref: containerRef,
|
|
6804
|
+
className: cn(
|
|
6805
|
+
"group/agg-select relative inline-flex",
|
|
6806
|
+
isInline ? "w-auto" : "w-full",
|
|
6807
|
+
className
|
|
6808
|
+
),
|
|
6809
|
+
children: [
|
|
6810
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
|
|
6811
|
+
"button",
|
|
6812
|
+
{
|
|
6813
|
+
type: "button",
|
|
6814
|
+
"aria-label": ariaLabel != null ? ariaLabel : labels.common.selectAria,
|
|
6815
|
+
"aria-expanded": isOpen,
|
|
6816
|
+
"aria-haspopup": "listbox",
|
|
6817
|
+
disabled: isDisabled,
|
|
6818
|
+
className: cn(
|
|
6819
|
+
"agg-select-trigger",
|
|
6820
|
+
"flex cursor-pointer items-center gap-2 font-agg-sans text-agg-foreground outline-none disabled:cursor-not-allowed disabled:opacity-60",
|
|
6821
|
+
isInline ? "h-auto w-auto bg-transparent px-2 py-1 pr-8 text-left text-agg-base leading-agg-6" : "h-10 w-full border border-agg-separator bg-agg-secondary px-3 py-[9px] pr-10 text-left text-agg-sm leading-agg-5",
|
|
6822
|
+
triggerRadiusClass,
|
|
6823
|
+
!isInline && getMotionClassName(
|
|
6824
|
+
enableAnimations,
|
|
6825
|
+
"transition-[border-color,box-shadow] duration-200 ease-in-out"
|
|
6826
|
+
),
|
|
6827
|
+
!isInline && isOpen && "border-2 border-agg-primary px-[11px] py-2 ring-0",
|
|
6828
|
+
!isInline && "hover:border-agg-primary focus:border-agg-primary focus:ring-0"
|
|
6829
|
+
),
|
|
6830
|
+
onClick: handleTriggerClick,
|
|
6831
|
+
onPointerEnter: handlePointerEnter,
|
|
6832
|
+
onPointerLeave: handlePointerLeave,
|
|
6833
|
+
children: [
|
|
6834
|
+
(selectedItem == null ? void 0 : selectedItem.icon) ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { className: "h-4 w-4 shrink-0 [&_svg]:h-full [&_svg]:w-full", children: selectedItem.icon }) : (selectedItem == null ? void 0 : selectedItem.iconUrl) ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
6835
|
+
RemoteImage,
|
|
6836
|
+
{
|
|
6837
|
+
src: selectedItem.iconUrl,
|
|
6838
|
+
alt: "",
|
|
6839
|
+
className: "agg-select-icon h-4 w-4 shrink-0 rounded-sm object-contain"
|
|
6840
|
+
}
|
|
6841
|
+
) : null,
|
|
6842
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { className: "agg-select-value flex-1 truncate", children: (_a = selectedItem == null ? void 0 : selectedItem.label) != null ? _a : "" })
|
|
6843
|
+
]
|
|
6844
|
+
}
|
|
6845
|
+
),
|
|
6846
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
6847
|
+
"span",
|
|
6848
|
+
{
|
|
6849
|
+
className: cn(
|
|
6850
|
+
"agg-select-chevron pointer-events-none absolute inset-y-0 inline-flex items-center justify-center",
|
|
6851
|
+
isInline ? "right-2 text-agg-foreground" : "right-3 text-agg-muted-foreground"
|
|
6852
|
+
),
|
|
6853
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
6854
|
+
Icon,
|
|
6855
|
+
{
|
|
6856
|
+
name: isOpen ? "chevron-up" : "chevron-down-thin",
|
|
6857
|
+
size: "small",
|
|
6858
|
+
color: "currentColor"
|
|
6859
|
+
}
|
|
6860
|
+
)
|
|
6861
|
+
}
|
|
6862
|
+
),
|
|
6863
|
+
isOpen && typeof document !== "undefined" && listbox ? (0, import_react_dom.createPortal)(listbox, resolveSelectPortalContainer(containerRef.current)) : null
|
|
6864
|
+
]
|
|
6865
|
+
}
|
|
6866
|
+
);
|
|
6867
|
+
};
|
|
6868
|
+
Select.displayName = "Select";
|
|
6869
|
+
|
|
6574
6870
|
// src/primitives/typography/typography.constants.ts
|
|
6575
6871
|
var display = cn("agg-type-display");
|
|
6576
6872
|
var heading = cn("agg-type-heading");
|
|
@@ -6634,7 +6930,7 @@ var getTypographyClassName = ({
|
|
|
6634
6930
|
};
|
|
6635
6931
|
|
|
6636
6932
|
// src/primitives/typography/index.tsx
|
|
6637
|
-
var
|
|
6933
|
+
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
6638
6934
|
var Typography = ({
|
|
6639
6935
|
as: Component = "p",
|
|
6640
6936
|
variant = "body",
|
|
@@ -6642,23 +6938,23 @@ var Typography = ({
|
|
|
6642
6938
|
children,
|
|
6643
6939
|
"aria-label": ariaLabel
|
|
6644
6940
|
}) => {
|
|
6645
|
-
return /* @__PURE__ */ (0,
|
|
6941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Component, { className: getTypographyClassName({ className, variant }), "aria-label": ariaLabel, children });
|
|
6646
6942
|
};
|
|
6647
6943
|
Typography.displayName = "Typography";
|
|
6648
6944
|
|
|
6649
6945
|
// src/primitives/toast/index.tsx
|
|
6650
6946
|
var RadixToast = __toESM(require("@radix-ui/react-toast"));
|
|
6651
|
-
var
|
|
6652
|
-
var
|
|
6653
|
-
var ToastContext = (0,
|
|
6947
|
+
var import_react7 = require("react");
|
|
6948
|
+
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
6949
|
+
var ToastContext = (0, import_react7.createContext)(null);
|
|
6654
6950
|
function useOptionalToast() {
|
|
6655
|
-
return (0,
|
|
6951
|
+
return (0, import_react7.useContext)(ToastContext);
|
|
6656
6952
|
}
|
|
6657
6953
|
|
|
6658
6954
|
// src/primitives/tooltip/index.tsx
|
|
6659
|
-
var
|
|
6955
|
+
var import_hooks29 = require("@agg-build/hooks");
|
|
6660
6956
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
6661
|
-
var
|
|
6957
|
+
var import_react8 = require("react");
|
|
6662
6958
|
|
|
6663
6959
|
// src/primitives/tooltip/tooltip.constants.ts
|
|
6664
6960
|
var tooltipSizeClasses = {
|
|
@@ -6690,7 +6986,7 @@ var resolveTooltipArrowDimensions = (size) => {
|
|
|
6690
6986
|
};
|
|
6691
6987
|
|
|
6692
6988
|
// src/primitives/tooltip/index.tsx
|
|
6693
|
-
var
|
|
6989
|
+
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
6694
6990
|
var Tooltip = ({
|
|
6695
6991
|
content,
|
|
6696
6992
|
children,
|
|
@@ -6705,25 +7001,25 @@ var Tooltip = ({
|
|
|
6705
7001
|
const {
|
|
6706
7002
|
general: { rootClassName },
|
|
6707
7003
|
features: { enableAnimations }
|
|
6708
|
-
} = (0,
|
|
6709
|
-
const trigger = (0,
|
|
7004
|
+
} = (0, import_hooks29.useSdkUiConfig)();
|
|
7005
|
+
const trigger = (0, import_react8.useMemo)(() => {
|
|
6710
7006
|
if (children) return children;
|
|
6711
|
-
return /* @__PURE__ */ (0,
|
|
7007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
6712
7008
|
"button",
|
|
6713
7009
|
{
|
|
6714
7010
|
type: "button",
|
|
6715
7011
|
className: resolveTooltipTriggerClassName(classNames == null ? void 0 : classNames.trigger),
|
|
6716
7012
|
"aria-label": ariaLabel != null ? ariaLabel : defaultTooltipTriggerAriaLabel,
|
|
6717
|
-
children: /* @__PURE__ */ (0,
|
|
7013
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Icon, { name: "info", size: "small", className: cn(classNames == null ? void 0 : classNames.icon), "aria-hidden": true })
|
|
6718
7014
|
}
|
|
6719
7015
|
);
|
|
6720
7016
|
}, [children, classNames == null ? void 0 : classNames.trigger, classNames == null ? void 0 : classNames.icon, ariaLabel]);
|
|
6721
7017
|
const { width: arrowWidth, height: arrowHeight } = resolveTooltipArrowDimensions(size);
|
|
6722
7018
|
const arrowPoints = `0,0 ${arrowWidth},0 ${arrowWidth / 2},${arrowHeight}`;
|
|
6723
7019
|
const arrowBorderPath = `M0 0 L${arrowWidth / 2} ${arrowHeight} L${arrowWidth} 0`;
|
|
6724
|
-
return /* @__PURE__ */ (0,
|
|
6725
|
-
/* @__PURE__ */ (0,
|
|
6726
|
-
/* @__PURE__ */ (0,
|
|
7020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TooltipPrimitive.Provider, { delayDuration, children: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(TooltipPrimitive.Root, { children: [
|
|
7021
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TooltipPrimitive.Trigger, { asChild: true, children: trigger }),
|
|
7022
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(
|
|
6727
7023
|
TooltipPrimitive.Content,
|
|
6728
7024
|
{
|
|
6729
7025
|
side,
|
|
@@ -6747,7 +7043,7 @@ var Tooltip = ({
|
|
|
6747
7043
|
classNames == null ? void 0 : classNames.content
|
|
6748
7044
|
),
|
|
6749
7045
|
children: [
|
|
6750
|
-
/* @__PURE__ */ (0,
|
|
7046
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(TooltipPrimitive.Arrow, { asChild: true, width: arrowWidth, height: arrowHeight, children: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(
|
|
6751
7047
|
"svg",
|
|
6752
7048
|
{
|
|
6753
7049
|
width: arrowWidth,
|
|
@@ -6756,8 +7052,8 @@ var Tooltip = ({
|
|
|
6756
7052
|
"aria-hidden": "true",
|
|
6757
7053
|
className: cn("overflow-visible", classNames == null ? void 0 : classNames.arrow),
|
|
6758
7054
|
children: [
|
|
6759
|
-
/* @__PURE__ */ (0,
|
|
6760
|
-
/* @__PURE__ */ (0,
|
|
7055
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)("polygon", { points: arrowPoints, className: "fill-agg-secondary" }),
|
|
7056
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
6761
7057
|
"path",
|
|
6762
7058
|
{
|
|
6763
7059
|
d: arrowBorderPath,
|
|
@@ -6779,18 +7075,18 @@ var Tooltip = ({
|
|
|
6779
7075
|
Tooltip.displayName = "Tooltip";
|
|
6780
7076
|
|
|
6781
7077
|
// src/onboarding/steps/profile-setup.tsx
|
|
6782
|
-
var
|
|
7078
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
6783
7079
|
var ProfileSetupStep = ({ onContinue }) => {
|
|
6784
|
-
const labels = (0,
|
|
6785
|
-
const [username, setUsername] = (0,
|
|
6786
|
-
const [avatarFile, setAvatarFile] = (0,
|
|
6787
|
-
const [avatarPreview, setAvatarPreview] = (0,
|
|
6788
|
-
const fileInputRef = (0,
|
|
6789
|
-
const handleAvatarClick = (0,
|
|
7080
|
+
const labels = (0, import_hooks30.useLabels)();
|
|
7081
|
+
const [username, setUsername] = (0, import_react9.useState)("");
|
|
7082
|
+
const [avatarFile, setAvatarFile] = (0, import_react9.useState)();
|
|
7083
|
+
const [avatarPreview, setAvatarPreview] = (0, import_react9.useState)();
|
|
7084
|
+
const fileInputRef = (0, import_react9.useRef)(null);
|
|
7085
|
+
const handleAvatarClick = (0, import_react9.useCallback)(() => {
|
|
6790
7086
|
var _a;
|
|
6791
7087
|
(_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
6792
7088
|
}, []);
|
|
6793
|
-
const handleFileChange = (0,
|
|
7089
|
+
const handleFileChange = (0, import_react9.useCallback)((e) => {
|
|
6794
7090
|
var _a;
|
|
6795
7091
|
const file = (_a = e.target.files) == null ? void 0 : _a[0];
|
|
6796
7092
|
if (!file) return;
|
|
@@ -6802,18 +7098,18 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
6802
7098
|
};
|
|
6803
7099
|
reader.readAsDataURL(file);
|
|
6804
7100
|
}, []);
|
|
6805
|
-
const handleContinue = (0,
|
|
7101
|
+
const handleContinue = (0, import_react9.useCallback)(() => {
|
|
6806
7102
|
onContinue({
|
|
6807
7103
|
username,
|
|
6808
7104
|
avatarFile,
|
|
6809
7105
|
avatarPreview
|
|
6810
7106
|
});
|
|
6811
7107
|
}, [username, avatarFile, avatarPreview, onContinue]);
|
|
6812
|
-
return /* @__PURE__ */ (0,
|
|
6813
|
-
/* @__PURE__ */ (0,
|
|
6814
|
-
/* @__PURE__ */ (0,
|
|
6815
|
-
/* @__PURE__ */ (0,
|
|
6816
|
-
/* @__PURE__ */ (0,
|
|
7108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-col gap-7", children: [
|
|
7109
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.profileSetup.title }),
|
|
7110
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-col gap-5 items-center w-full", children: [
|
|
7111
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex justify-center", children: [
|
|
7112
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
6817
7113
|
"button",
|
|
6818
7114
|
{
|
|
6819
7115
|
type: "button",
|
|
@@ -6829,13 +7125,13 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
6829
7125
|
),
|
|
6830
7126
|
"aria-label": labels.onboarding.profileSetup.uploadProfilePictureAria,
|
|
6831
7127
|
children: [
|
|
6832
|
-
!avatarPreview ? /* @__PURE__ */ (0,
|
|
7128
|
+
!avatarPreview ? /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
6833
7129
|
"svg",
|
|
6834
7130
|
{
|
|
6835
7131
|
"aria-hidden": true,
|
|
6836
7132
|
viewBox: "0 0 80 80",
|
|
6837
7133
|
className: "pointer-events-none absolute inset-0 h-full w-full text-agg-separator group-hover:text-agg-muted-foreground",
|
|
6838
|
-
children: /* @__PURE__ */ (0,
|
|
7134
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
6839
7135
|
"circle",
|
|
6840
7136
|
{
|
|
6841
7137
|
cx: "40",
|
|
@@ -6849,18 +7145,18 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
6849
7145
|
)
|
|
6850
7146
|
}
|
|
6851
7147
|
) : null,
|
|
6852
|
-
avatarPreview ? /* @__PURE__ */ (0,
|
|
7148
|
+
avatarPreview ? /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
6853
7149
|
RemoteImage,
|
|
6854
7150
|
{
|
|
6855
7151
|
src: avatarPreview,
|
|
6856
7152
|
alt: labels.onboarding.profileSetup.profilePreviewAlt,
|
|
6857
7153
|
className: "h-full w-full object-cover"
|
|
6858
7154
|
}
|
|
6859
|
-
) : /* @__PURE__ */ (0,
|
|
7155
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(ProfileIcon, { className: "h-7 w-7 text-agg-muted-foreground" })
|
|
6860
7156
|
]
|
|
6861
7157
|
}
|
|
6862
7158
|
),
|
|
6863
|
-
/* @__PURE__ */ (0,
|
|
7159
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
6864
7160
|
"input",
|
|
6865
7161
|
{
|
|
6866
7162
|
ref: fileInputRef,
|
|
@@ -6872,8 +7168,8 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
6872
7168
|
}
|
|
6873
7169
|
)
|
|
6874
7170
|
] }),
|
|
6875
|
-
/* @__PURE__ */ (0,
|
|
6876
|
-
/* @__PURE__ */ (0,
|
|
7171
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-col gap-2 w-full", children: [
|
|
7172
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
6877
7173
|
"label",
|
|
6878
7174
|
{
|
|
6879
7175
|
htmlFor: "onboarding-username",
|
|
@@ -6881,7 +7177,7 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
6881
7177
|
children: labels.onboarding.profileSetup.usernameLabel
|
|
6882
7178
|
}
|
|
6883
7179
|
),
|
|
6884
|
-
/* @__PURE__ */ (0,
|
|
7180
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
6885
7181
|
"input",
|
|
6886
7182
|
{
|
|
6887
7183
|
id: "onboarding-username",
|
|
@@ -6905,16 +7201,16 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
6905
7201
|
)
|
|
6906
7202
|
] })
|
|
6907
7203
|
] }),
|
|
6908
|
-
/* @__PURE__ */ (0,
|
|
7204
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Button, { variant: "primary", size: "large", className: "w-full", onClick: handleContinue, children: labels.onboarding.profileSetup.continue })
|
|
6909
7205
|
] });
|
|
6910
7206
|
};
|
|
6911
7207
|
ProfileSetupStep.displayName = "ProfileSetupStep";
|
|
6912
7208
|
|
|
6913
7209
|
// src/onboarding/steps/connect-accounts.tsx
|
|
6914
|
-
var
|
|
6915
|
-
var
|
|
7210
|
+
var import_hooks31 = require("@agg-build/hooks");
|
|
7211
|
+
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
6916
7212
|
var OnchainVenueLogos = () => {
|
|
6917
|
-
return /* @__PURE__ */ (0,
|
|
7213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("div", { className: "flex gap-1 sm:gap-0 sm:-space-x-5", children: ONCHAIN_VENUES.map((venue, index) => /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("div", { style: { zIndex: ONCHAIN_VENUES.length - index }, children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(VenueLogo, { venue, variant: "logo", size: "medium", className: "sm:h-8 sm:w-8" }) }, venue)) });
|
|
6918
7214
|
};
|
|
6919
7215
|
var VenueCard = ({
|
|
6920
7216
|
logos,
|
|
@@ -6925,8 +7221,8 @@ var VenueCard = ({
|
|
|
6925
7221
|
onConnect,
|
|
6926
7222
|
connected = false
|
|
6927
7223
|
}) => {
|
|
6928
|
-
const labels = (0,
|
|
6929
|
-
const action = connected ? /* @__PURE__ */ (0,
|
|
7224
|
+
const labels = (0, import_hooks31.useLabels)();
|
|
7225
|
+
const action = connected ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(CheckCircleIcon, { className: "h-6 w-6 text-agg-success" }) : /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
6930
7226
|
Button,
|
|
6931
7227
|
{
|
|
6932
7228
|
variant: "tertiary",
|
|
@@ -6936,18 +7232,18 @@ var VenueCard = ({
|
|
|
6936
7232
|
children: labels.onboarding.connectAccounts.connect
|
|
6937
7233
|
}
|
|
6938
7234
|
);
|
|
6939
|
-
const mobileAction = connected ? /* @__PURE__ */ (0,
|
|
7235
|
+
const mobileAction = connected ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(CheckCircleIcon, { className: "h-6 w-6 text-agg-success" }) : /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
6940
7236
|
Button,
|
|
6941
7237
|
{
|
|
6942
7238
|
variant: "tertiary",
|
|
6943
7239
|
size: "medium",
|
|
6944
7240
|
className: "!h-auto !px-0 !py-0 text-agg-primary hover:bg-transparent hover:text-agg-primary-hover",
|
|
6945
7241
|
onClick: onConnect,
|
|
6946
|
-
suffix: /* @__PURE__ */ (0,
|
|
7242
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(ChevronRightIcon, { className: "h-4 w-4" }),
|
|
6947
7243
|
children: labels.onboarding.connectAccounts.connectAccount
|
|
6948
7244
|
}
|
|
6949
7245
|
);
|
|
6950
|
-
return /* @__PURE__ */ (0,
|
|
7246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
6951
7247
|
"div",
|
|
6952
7248
|
{
|
|
6953
7249
|
className: cn(
|
|
@@ -6955,23 +7251,23 @@ var VenueCard = ({
|
|
|
6955
7251
|
connected ? "bg-agg-success/5" : "bg-agg-secondary-hover hover:bg-agg-tertiary"
|
|
6956
7252
|
),
|
|
6957
7253
|
children: [
|
|
6958
|
-
/* @__PURE__ */ (0,
|
|
6959
|
-
/* @__PURE__ */ (0,
|
|
6960
|
-
/* @__PURE__ */ (0,
|
|
6961
|
-
/* @__PURE__ */ (0,
|
|
6962
|
-
/* @__PURE__ */ (0,
|
|
6963
|
-
/* @__PURE__ */ (0,
|
|
7254
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "hidden sm:flex items-center justify-between", children: [
|
|
7255
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "flex items-center gap-5", children: [
|
|
7256
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("div", { className: "shrink-0", children: logos }),
|
|
7257
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "flex flex-col gap-[2px]", children: [
|
|
7258
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("p", { className: "text-agg-base font-agg-bold text-agg-foreground", children: title2 }),
|
|
7259
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("p", { className: "text-agg-sm text-agg-foreground", children: description })
|
|
6964
7260
|
] })
|
|
6965
7261
|
] }),
|
|
6966
|
-
/* @__PURE__ */ (0,
|
|
7262
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("div", { className: "shrink-0", children: action })
|
|
6967
7263
|
] }),
|
|
6968
|
-
/* @__PURE__ */ (0,
|
|
6969
|
-
/* @__PURE__ */ (0,
|
|
6970
|
-
/* @__PURE__ */ (0,
|
|
6971
|
-
/* @__PURE__ */ (0,
|
|
7264
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "flex flex-col gap-3 sm:hidden", children: [
|
|
7265
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
7266
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("div", { className: "shrink-0", children: logos }),
|
|
7267
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("p", { className: "text-agg-lg font-agg-bold text-agg-foreground", children: mobileTitle != null ? mobileTitle : title2 })
|
|
6972
7268
|
] }),
|
|
6973
|
-
/* @__PURE__ */ (0,
|
|
6974
|
-
/* @__PURE__ */ (0,
|
|
7269
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "flex flex-col items-start gap-2", children: [
|
|
7270
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("p", { className: "text-agg-base text-agg-foreground", children: mobileDescription != null ? mobileDescription : description }),
|
|
6975
7271
|
mobileAction
|
|
6976
7272
|
] })
|
|
6977
7273
|
] })
|
|
@@ -6984,14 +7280,14 @@ var ConnectAccountsStep = ({
|
|
|
6984
7280
|
onContinue,
|
|
6985
7281
|
connectedOnchain = false
|
|
6986
7282
|
}) => {
|
|
6987
|
-
const labels = (0,
|
|
7283
|
+
const labels = (0, import_hooks31.useLabels)();
|
|
6988
7284
|
const canContinue = connectedOnchain;
|
|
6989
|
-
return /* @__PURE__ */ (0,
|
|
6990
|
-
/* @__PURE__ */ (0,
|
|
6991
|
-
/* @__PURE__ */ (0,
|
|
7285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "flex flex-col gap-6", children: [
|
|
7286
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.connectAccounts.title }),
|
|
7287
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("div", { className: "flex flex-col gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
6992
7288
|
VenueCard,
|
|
6993
7289
|
{
|
|
6994
|
-
logos: /* @__PURE__ */ (0,
|
|
7290
|
+
logos: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(OnchainVenueLogos, {}),
|
|
6995
7291
|
title: labels.onboarding.connectAccounts.onchainTitle,
|
|
6996
7292
|
mobileTitle: labels.onboarding.connectAccounts.onchainMobileTitle(
|
|
6997
7293
|
ONCHAIN_VENUES.length - 1
|
|
@@ -7002,7 +7298,7 @@ var ConnectAccountsStep = ({
|
|
|
7002
7298
|
connected: connectedOnchain
|
|
7003
7299
|
}
|
|
7004
7300
|
) }),
|
|
7005
|
-
/* @__PURE__ */ (0,
|
|
7301
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
7006
7302
|
Button,
|
|
7007
7303
|
{
|
|
7008
7304
|
variant: "primary",
|
|
@@ -7018,22 +7314,22 @@ var ConnectAccountsStep = ({
|
|
|
7018
7314
|
ConnectAccountsStep.displayName = "ConnectAccountsStep";
|
|
7019
7315
|
|
|
7020
7316
|
// src/onboarding/steps/connect-onchain-modal.tsx
|
|
7021
|
-
var
|
|
7022
|
-
var
|
|
7317
|
+
var import_react10 = require("react");
|
|
7318
|
+
var import_hooks32 = require("@agg-build/hooks");
|
|
7023
7319
|
var Dialog2 = __toESM(require("@radix-ui/react-dialog"));
|
|
7024
|
-
var
|
|
7320
|
+
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
7025
7321
|
var ConnectOnchainModal = ({
|
|
7026
7322
|
open,
|
|
7027
7323
|
onOpenChange,
|
|
7028
7324
|
onConnect
|
|
7029
7325
|
}) => {
|
|
7030
|
-
const labels = (0,
|
|
7031
|
-
const [connecting, setConnecting] = (0,
|
|
7032
|
-
const [error, setError] = (0,
|
|
7033
|
-
const handleCancel = (0,
|
|
7326
|
+
const labels = (0, import_hooks32.useLabels)();
|
|
7327
|
+
const [connecting, setConnecting] = (0, import_react10.useState)(false);
|
|
7328
|
+
const [error, setError] = (0, import_react10.useState)();
|
|
7329
|
+
const handleCancel = (0, import_react10.useCallback)(() => {
|
|
7034
7330
|
onOpenChange(false);
|
|
7035
7331
|
}, [onOpenChange]);
|
|
7036
|
-
const handleConnect = (0,
|
|
7332
|
+
const handleConnect = (0, import_react10.useCallback)(() => __async(null, null, function* () {
|
|
7037
7333
|
if (connecting) return;
|
|
7038
7334
|
setConnecting(true);
|
|
7039
7335
|
setError(void 0);
|
|
@@ -7048,7 +7344,7 @@ var ConnectOnchainModal = ({
|
|
|
7048
7344
|
setConnecting(false);
|
|
7049
7345
|
}
|
|
7050
7346
|
}), [connecting, labels.onboarding.connectOnchainModal.fallbackError, onConnect, onOpenChange]);
|
|
7051
|
-
const handleOpenChange = (0,
|
|
7347
|
+
const handleOpenChange = (0, import_react10.useCallback)(
|
|
7052
7348
|
(value) => {
|
|
7053
7349
|
if (value) {
|
|
7054
7350
|
setError(void 0);
|
|
@@ -7058,15 +7354,15 @@ var ConnectOnchainModal = ({
|
|
|
7058
7354
|
},
|
|
7059
7355
|
[onOpenChange]
|
|
7060
7356
|
);
|
|
7061
|
-
return /* @__PURE__ */ (0,
|
|
7357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
7062
7358
|
Modal.Container,
|
|
7063
7359
|
{
|
|
7064
7360
|
maxWidth: "600px",
|
|
7065
7361
|
"aria-label": labels.onboarding.connectOnchainModal.ariaLabel,
|
|
7066
7362
|
classNames: { container: "!rounded-agg-lg" },
|
|
7067
7363
|
children: [
|
|
7068
|
-
/* @__PURE__ */ (0,
|
|
7069
|
-
/* @__PURE__ */ (0,
|
|
7364
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Dialog2.Title, { className: "sr-only", children: labels.onboarding.connectOnchainModal.title }),
|
|
7365
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
7070
7366
|
Modal.Header,
|
|
7071
7367
|
{
|
|
7072
7368
|
hideClose: false,
|
|
@@ -7077,26 +7373,26 @@ var ConnectOnchainModal = ({
|
|
|
7077
7373
|
}
|
|
7078
7374
|
}
|
|
7079
7375
|
),
|
|
7080
|
-
/* @__PURE__ */ (0,
|
|
7081
|
-
/* @__PURE__ */ (0,
|
|
7082
|
-
/* @__PURE__ */ (0,
|
|
7083
|
-
/* @__PURE__ */ (0,
|
|
7376
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Modal.Body, { classNames: { root: "!px-5 !pt-0 !pb-[60px] sm:!px-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex flex-col gap-8 items-center", children: [
|
|
7377
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex flex-col gap-4 items-center text-center", children: [
|
|
7378
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("h2", { className: "text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.connectOnchainModal.title }),
|
|
7379
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("p", { className: "text-agg-base text-center leading-agg-6 text-agg-foreground whitespace-pre-line", children: labels.onboarding.connectOnchainModal.description })
|
|
7084
7380
|
] }),
|
|
7085
|
-
/* @__PURE__ */ (0,
|
|
7086
|
-
/* @__PURE__ */ (0,
|
|
7087
|
-
/* @__PURE__ */ (0,
|
|
7088
|
-
index > 0 && /* @__PURE__ */ (0,
|
|
7089
|
-
/* @__PURE__ */ (0,
|
|
7090
|
-
/* @__PURE__ */ (0,
|
|
7381
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex w-full flex-col items-center gap-4 rounded-agg-xl bg-agg-secondary-hover p-6", children: [
|
|
7382
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("p", { className: "text-agg-sm font-agg-bold uppercase leading-agg-5 text-agg-muted-foreground", children: labels.onboarding.connectOnchainModal.supportedVenuesLabel }),
|
|
7383
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "flex flex-wrap items-center justify-center gap-x-4 gap-y-3", children: ONCHAIN_VENUES.map((venue, index) => /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex items-center gap-[6px]", children: [
|
|
7384
|
+
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { className: "mr-2.5 h-3 w-px bg-agg-separator" }),
|
|
7385
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(VenueLogo, { venue, size: "medium" }),
|
|
7386
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { className: "text-agg-base text-agg-foreground", children: labels.venues[venue] })
|
|
7091
7387
|
] }, venue)) })
|
|
7092
7388
|
] }),
|
|
7093
|
-
/* @__PURE__ */ (0,
|
|
7094
|
-
/* @__PURE__ */ (0,
|
|
7095
|
-
error ? /* @__PURE__ */ (0,
|
|
7096
|
-
/* @__PURE__ */ (0,
|
|
7097
|
-
/* @__PURE__ */ (0,
|
|
7389
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex flex-col gap-6 items-center", children: [
|
|
7390
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex flex-col gap-3 items-center", children: [
|
|
7391
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
7392
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(WarningIcon, { className: "h-3.5 w-3.5 shrink-0 text-agg-error" }),
|
|
7393
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-error", children: error })
|
|
7098
7394
|
] }) : null,
|
|
7099
|
-
/* @__PURE__ */ (0,
|
|
7395
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
7100
7396
|
Button,
|
|
7101
7397
|
{
|
|
7102
7398
|
variant: "primary",
|
|
@@ -7107,7 +7403,7 @@ var ConnectOnchainModal = ({
|
|
|
7107
7403
|
}
|
|
7108
7404
|
)
|
|
7109
7405
|
] }),
|
|
7110
|
-
/* @__PURE__ */ (0,
|
|
7406
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
7111
7407
|
Button,
|
|
7112
7408
|
{
|
|
7113
7409
|
variant: "tertiary",
|
|
@@ -7126,12 +7422,12 @@ var ConnectOnchainModal = ({
|
|
|
7126
7422
|
ConnectOnchainModal.displayName = "ConnectOnchainModal";
|
|
7127
7423
|
|
|
7128
7424
|
// src/onboarding/steps/connect-kalshi-modal.tsx
|
|
7129
|
-
var
|
|
7425
|
+
var import_hooks33 = require("@agg-build/hooks");
|
|
7130
7426
|
var import_sdk14 = require("@agg-build/sdk");
|
|
7131
7427
|
var Dialog3 = __toESM(require("@radix-ui/react-dialog"));
|
|
7132
|
-
var
|
|
7428
|
+
var import_react11 = require("react");
|
|
7133
7429
|
var import_zod = require("zod");
|
|
7134
|
-
var
|
|
7430
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
7135
7431
|
var kalshiCredentialsSchema = import_zod.z.object({
|
|
7136
7432
|
apiKeyId: import_zod.z.string().trim().min(1),
|
|
7137
7433
|
privateKey: import_zod.z.string().trim().min(1)
|
|
@@ -7153,25 +7449,25 @@ var ConnectKalshiModal = ({
|
|
|
7153
7449
|
onOpenChange,
|
|
7154
7450
|
onVerify
|
|
7155
7451
|
}) => {
|
|
7156
|
-
const labels = (0,
|
|
7157
|
-
const { disabledVenues, isLoading: isAppConfigLoading } = (0,
|
|
7158
|
-
const apiKeyInputRef = (0,
|
|
7159
|
-
const errorId = (0,
|
|
7160
|
-
const [apiKeyId, setApiKeyId] = (0,
|
|
7161
|
-
const [privateKey, setPrivateKey] = (0,
|
|
7162
|
-
const [isVerifying, setIsVerifying] = (0,
|
|
7163
|
-
const [isConnected, setIsConnected] = (0,
|
|
7164
|
-
const [error, setError] = (0,
|
|
7165
|
-
const availabilityState = (0,
|
|
7452
|
+
const labels = (0, import_hooks33.useLabels)();
|
|
7453
|
+
const { disabledVenues, isLoading: isAppConfigLoading } = (0, import_hooks33.useAppConfig)();
|
|
7454
|
+
const apiKeyInputRef = (0, import_react11.useRef)(null);
|
|
7455
|
+
const errorId = (0, import_react11.useId)();
|
|
7456
|
+
const [apiKeyId, setApiKeyId] = (0, import_react11.useState)("");
|
|
7457
|
+
const [privateKey, setPrivateKey] = (0, import_react11.useState)("");
|
|
7458
|
+
const [isVerifying, setIsVerifying] = (0, import_react11.useState)(false);
|
|
7459
|
+
const [isConnected, setIsConnected] = (0, import_react11.useState)(false);
|
|
7460
|
+
const [error, setError] = (0, import_react11.useState)();
|
|
7461
|
+
const availabilityState = (0, import_hooks33.getVenueAvailabilityState)({
|
|
7166
7462
|
venueId: import_sdk14.Venue.kalshi,
|
|
7167
7463
|
disabledVenues,
|
|
7168
7464
|
isConfigLoading: isAppConfigLoading
|
|
7169
7465
|
});
|
|
7170
|
-
const parsedCredentials = (0,
|
|
7466
|
+
const parsedCredentials = (0, import_react11.useMemo)(
|
|
7171
7467
|
() => kalshiCredentialsSchema.safeParse({ apiKeyId, privateKey }),
|
|
7172
7468
|
[apiKeyId, privateKey]
|
|
7173
7469
|
);
|
|
7174
|
-
(0,
|
|
7470
|
+
(0, import_react11.useEffect)(() => {
|
|
7175
7471
|
if (!open) return;
|
|
7176
7472
|
setApiKeyId("");
|
|
7177
7473
|
setPrivateKey("");
|
|
@@ -7184,14 +7480,14 @@ var ConnectKalshiModal = ({
|
|
|
7184
7480
|
});
|
|
7185
7481
|
return () => window.cancelAnimationFrame(animationFrame);
|
|
7186
7482
|
}, [open]);
|
|
7187
|
-
const handleOpenChange = (0,
|
|
7483
|
+
const handleOpenChange = (0, import_react11.useCallback)(
|
|
7188
7484
|
(nextOpen) => {
|
|
7189
7485
|
if (isVerifying && !nextOpen) return;
|
|
7190
7486
|
onOpenChange(nextOpen);
|
|
7191
7487
|
},
|
|
7192
7488
|
[isVerifying, onOpenChange]
|
|
7193
7489
|
);
|
|
7194
|
-
const handleVerify = (0,
|
|
7490
|
+
const handleVerify = (0, import_react11.useCallback)(() => __async(null, null, function* () {
|
|
7195
7491
|
if (!parsedCredentials.success || isVerifying || isConnected) return;
|
|
7196
7492
|
const credentials = parsedCredentials.data;
|
|
7197
7493
|
setIsVerifying(true);
|
|
@@ -7218,7 +7514,7 @@ var ConnectKalshiModal = ({
|
|
|
7218
7514
|
onVerify,
|
|
7219
7515
|
parsedCredentials
|
|
7220
7516
|
]);
|
|
7221
|
-
const handleSubmit = (0,
|
|
7517
|
+
const handleSubmit = (0, import_react11.useCallback)(
|
|
7222
7518
|
(event) => {
|
|
7223
7519
|
event.preventDefault();
|
|
7224
7520
|
void handleVerify();
|
|
@@ -7226,30 +7522,30 @@ var ConnectKalshiModal = ({
|
|
|
7226
7522
|
[handleVerify]
|
|
7227
7523
|
);
|
|
7228
7524
|
if (availabilityState === "hidden") return null;
|
|
7229
|
-
return /* @__PURE__ */ (0,
|
|
7525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
7230
7526
|
Modal.Container,
|
|
7231
7527
|
{
|
|
7232
7528
|
maxWidth: "600px",
|
|
7233
7529
|
"aria-label": labels.onboarding.connectKalshiModal.ariaLabel,
|
|
7234
7530
|
classNames: { container: "!rounded-agg-2xl" },
|
|
7235
7531
|
children: [
|
|
7236
|
-
/* @__PURE__ */ (0,
|
|
7532
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "flex h-[60px] shrink-0 items-center justify-end px-8", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
7237
7533
|
Dialog3.Close,
|
|
7238
7534
|
{
|
|
7239
7535
|
"aria-label": labels.common.close,
|
|
7240
7536
|
className: "flex size-10 cursor-pointer items-center justify-center rounded-agg-full text-agg-secondary transition-colors hover:bg-agg-quaternary hover:text-agg-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-accent disabled:cursor-default disabled:opacity-50",
|
|
7241
7537
|
disabled: isVerifying,
|
|
7242
|
-
children: /* @__PURE__ */ (0,
|
|
7538
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Icon, { name: "close", size: "medium" })
|
|
7243
7539
|
}
|
|
7244
7540
|
) }),
|
|
7245
|
-
/* @__PURE__ */ (0,
|
|
7541
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Modal.Body, { classNames: { root: "!px-5 !pb-12 !pt-0 sm:!px-10" }, children: isConnected ? /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
7246
7542
|
"div",
|
|
7247
7543
|
{
|
|
7248
7544
|
className: "flex flex-col items-center gap-8 pb-3 text-center",
|
|
7249
7545
|
role: "status",
|
|
7250
7546
|
"aria-live": "polite",
|
|
7251
7547
|
children: [
|
|
7252
|
-
/* @__PURE__ */ (0,
|
|
7548
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "flex size-[60px] items-center justify-center rounded-agg-full bg-agg-success", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
7253
7549
|
Icon,
|
|
7254
7550
|
{
|
|
7255
7551
|
name: "success-check",
|
|
@@ -7257,11 +7553,11 @@ var ConnectKalshiModal = ({
|
|
|
7257
7553
|
"aria-hidden": "true"
|
|
7258
7554
|
}
|
|
7259
7555
|
) }),
|
|
7260
|
-
/* @__PURE__ */ (0,
|
|
7261
|
-
/* @__PURE__ */ (0,
|
|
7262
|
-
/* @__PURE__ */ (0,
|
|
7556
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col items-center gap-4", children: [
|
|
7557
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Dialog3.Title, { className: "text-agg-2xl font-agg-bold leading-agg-8 text-agg-foreground", children: labels.onboarding.connectKalshiModal.success.title }),
|
|
7558
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Dialog3.Description, { className: "max-w-[480px] text-agg-base leading-agg-6 text-agg-foreground", children: labels.onboarding.connectKalshiModal.success.description })
|
|
7263
7559
|
] }),
|
|
7264
|
-
/* @__PURE__ */ (0,
|
|
7560
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
7265
7561
|
Button,
|
|
7266
7562
|
{
|
|
7267
7563
|
variant: "primary",
|
|
@@ -7273,27 +7569,27 @@ var ConnectKalshiModal = ({
|
|
|
7273
7569
|
)
|
|
7274
7570
|
]
|
|
7275
7571
|
}
|
|
7276
|
-
) : /* @__PURE__ */ (0,
|
|
7277
|
-
/* @__PURE__ */ (0,
|
|
7278
|
-
/* @__PURE__ */ (0,
|
|
7279
|
-
/* @__PURE__ */ (0,
|
|
7280
|
-
/* @__PURE__ */ (0,
|
|
7572
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("form", { className: "flex flex-col items-center gap-8", onSubmit: handleSubmit, children: [
|
|
7573
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(VenueLogo, { venue: import_sdk14.Venue.kalshi, variant: "logo", size: "large", className: "size-[60px]" }),
|
|
7574
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col items-center gap-4 text-center", children: [
|
|
7575
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Dialog3.Title, { className: "text-agg-2xl font-agg-bold leading-agg-8 text-agg-foreground", children: labels.onboarding.connectKalshiModal.title }),
|
|
7576
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Dialog3.Description, { className: "max-w-[520px] text-agg-base leading-agg-6 text-agg-foreground", children: labels.onboarding.connectKalshiModal.description })
|
|
7281
7577
|
] }),
|
|
7282
|
-
/* @__PURE__ */ (0,
|
|
7283
|
-
/* @__PURE__ */ (0,
|
|
7284
|
-
/* @__PURE__ */ (0,
|
|
7285
|
-
/* @__PURE__ */ (0,
|
|
7286
|
-
/* @__PURE__ */ (0,
|
|
7578
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex w-full flex-col gap-4", children: [
|
|
7579
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col gap-3 rounded-agg-xl bg-agg-secondary-hover p-4", children: [
|
|
7580
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
7581
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { className: "text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground", children: labels.onboarding.connectKalshiModal.stepOne.label }),
|
|
7582
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.onboarding.connectKalshiModal.stepOne.title })
|
|
7287
7583
|
] }),
|
|
7288
|
-
/* @__PURE__ */ (0,
|
|
7289
|
-
/* @__PURE__ */ (0,
|
|
7290
|
-
/* @__PURE__ */ (0,
|
|
7584
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: [
|
|
7585
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { children: labels.onboarding.connectKalshiModal.stepOne.instructions.signIn }),
|
|
7586
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("p", { children: [
|
|
7291
7587
|
labels.onboarding.connectKalshiModal.stepOne.instructions.goToProfilePrefix,
|
|
7292
7588
|
" ",
|
|
7293
|
-
/* @__PURE__ */ (0,
|
|
7589
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "font-agg-bold", children: labels.onboarding.connectKalshiModal.stepOne.instructions.profileText }),
|
|
7294
7590
|
labels.onboarding.connectKalshiModal.stepOne.instructions.goToProfileSeparator,
|
|
7295
7591
|
" ",
|
|
7296
|
-
/* @__PURE__ */ (0,
|
|
7592
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
7297
7593
|
"a",
|
|
7298
7594
|
{
|
|
7299
7595
|
href: labels.onboarding.connectKalshiModal.stepOne.instructions.profileUrl,
|
|
@@ -7304,34 +7600,34 @@ var ConnectKalshiModal = ({
|
|
|
7304
7600
|
}
|
|
7305
7601
|
)
|
|
7306
7602
|
] }),
|
|
7307
|
-
/* @__PURE__ */ (0,
|
|
7603
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("p", { children: [
|
|
7308
7604
|
labels.onboarding.connectKalshiModal.stepOne.instructions.clickCreateKeyPrefix,
|
|
7309
7605
|
" ",
|
|
7310
|
-
/* @__PURE__ */ (0,
|
|
7606
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "font-agg-bold", children: labels.onboarding.connectKalshiModal.stepOne.instructions.createKeyText }),
|
|
7311
7607
|
labels.onboarding.connectKalshiModal.stepOne.instructions.clickCreateKeySuffix
|
|
7312
7608
|
] }),
|
|
7313
|
-
/* @__PURE__ */ (0,
|
|
7609
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("p", { children: [
|
|
7314
7610
|
labels.onboarding.connectKalshiModal.stepOne.instructions.selectPermissionsPrefix,
|
|
7315
7611
|
" ",
|
|
7316
|
-
/* @__PURE__ */ (0,
|
|
7612
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "font-agg-bold", children: labels.onboarding.connectKalshiModal.stepOne.instructions.readWriteText }),
|
|
7317
7613
|
labels.onboarding.connectKalshiModal.stepOne.instructions.selectPermissionsSuffix
|
|
7318
7614
|
] }),
|
|
7319
|
-
/* @__PURE__ */ (0,
|
|
7615
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { children: labels.onboarding.connectKalshiModal.stepOne.instructions.createKey })
|
|
7320
7616
|
] }),
|
|
7321
|
-
/* @__PURE__ */ (0,
|
|
7617
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: [
|
|
7322
7618
|
labels.onboarding.connectKalshiModal.stepOne.footerLineOne,
|
|
7323
|
-
/* @__PURE__ */ (0,
|
|
7619
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("br", {}),
|
|
7324
7620
|
labels.onboarding.connectKalshiModal.stepOne.footerLineTwo
|
|
7325
7621
|
] })
|
|
7326
7622
|
] }),
|
|
7327
|
-
/* @__PURE__ */ (0,
|
|
7328
|
-
/* @__PURE__ */ (0,
|
|
7329
|
-
/* @__PURE__ */ (0,
|
|
7330
|
-
/* @__PURE__ */ (0,
|
|
7623
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col gap-3 rounded-agg-xl bg-agg-secondary-hover p-4", children: [
|
|
7624
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
7625
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { className: "text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground", children: labels.onboarding.connectKalshiModal.stepTwo.label }),
|
|
7626
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.onboarding.connectKalshiModal.stepTwo.title })
|
|
7331
7627
|
] }),
|
|
7332
|
-
/* @__PURE__ */ (0,
|
|
7333
|
-
/* @__PURE__ */ (0,
|
|
7334
|
-
/* @__PURE__ */ (0,
|
|
7628
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: labels.onboarding.connectKalshiModal.stepTwo.description }),
|
|
7629
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
7630
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
7335
7631
|
"label",
|
|
7336
7632
|
{
|
|
7337
7633
|
htmlFor: "kalshi-api-key-id",
|
|
@@ -7339,7 +7635,7 @@ var ConnectKalshiModal = ({
|
|
|
7339
7635
|
children: labels.onboarding.connectKalshiModal.stepTwo.apiKeyIdLabel
|
|
7340
7636
|
}
|
|
7341
7637
|
),
|
|
7342
|
-
/* @__PURE__ */ (0,
|
|
7638
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
7343
7639
|
"input",
|
|
7344
7640
|
{
|
|
7345
7641
|
ref: apiKeyInputRef,
|
|
@@ -7361,8 +7657,8 @@ var ConnectKalshiModal = ({
|
|
|
7361
7657
|
}
|
|
7362
7658
|
)
|
|
7363
7659
|
] }),
|
|
7364
|
-
/* @__PURE__ */ (0,
|
|
7365
|
-
/* @__PURE__ */ (0,
|
|
7660
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
7661
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
7366
7662
|
"label",
|
|
7367
7663
|
{
|
|
7368
7664
|
htmlFor: "kalshi-private-key",
|
|
@@ -7370,7 +7666,7 @@ var ConnectKalshiModal = ({
|
|
|
7370
7666
|
children: labels.onboarding.connectKalshiModal.stepTwo.privateKeyLabel
|
|
7371
7667
|
}
|
|
7372
7668
|
),
|
|
7373
|
-
/* @__PURE__ */ (0,
|
|
7669
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
7374
7670
|
"textarea",
|
|
7375
7671
|
{
|
|
7376
7672
|
id: "kalshi-private-key",
|
|
@@ -7393,22 +7689,22 @@ var ConnectKalshiModal = ({
|
|
|
7393
7689
|
] })
|
|
7394
7690
|
] })
|
|
7395
7691
|
] }),
|
|
7396
|
-
/* @__PURE__ */ (0,
|
|
7397
|
-
/* @__PURE__ */ (0,
|
|
7398
|
-
/* @__PURE__ */ (0,
|
|
7399
|
-
/* @__PURE__ */ (0,
|
|
7400
|
-
/* @__PURE__ */ (0,
|
|
7692
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex w-full items-center justify-between gap-4", children: [
|
|
7693
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { className: "text-agg-base text-agg-foreground", children: labels.onboarding.connectKalshiModal.help.label }),
|
|
7694
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
7695
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("span", { className: "flex items-center gap-2 text-agg-base font-agg-bold text-agg-primary", children: [
|
|
7696
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Icon, { name: "document", size: "small", className: "size-4 text-agg-primary" }),
|
|
7401
7697
|
labels.onboarding.connectKalshiModal.help.docsLinkLabel
|
|
7402
7698
|
] }),
|
|
7403
|
-
/* @__PURE__ */ (0,
|
|
7404
|
-
/* @__PURE__ */ (0,
|
|
7405
|
-
/* @__PURE__ */ (0,
|
|
7699
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "h-3 w-px bg-agg-separator" }),
|
|
7700
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("span", { className: "flex items-center gap-2 text-agg-base font-agg-bold text-agg-primary", children: [
|
|
7701
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Icon, { name: "play-square", size: "small", className: "size-4 text-agg-primary" }),
|
|
7406
7702
|
labels.onboarding.connectKalshiModal.help.tutorialLinkLabel
|
|
7407
7703
|
] })
|
|
7408
7704
|
] })
|
|
7409
7705
|
] }),
|
|
7410
|
-
/* @__PURE__ */ (0,
|
|
7411
|
-
error ? /* @__PURE__ */ (0,
|
|
7706
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col items-center gap-5", children: [
|
|
7707
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
7412
7708
|
"div",
|
|
7413
7709
|
{
|
|
7414
7710
|
id: errorId,
|
|
@@ -7416,13 +7712,13 @@ var ConnectKalshiModal = ({
|
|
|
7416
7712
|
role: "alert",
|
|
7417
7713
|
"aria-live": "assertive",
|
|
7418
7714
|
children: [
|
|
7419
|
-
/* @__PURE__ */ (0,
|
|
7420
|
-
/* @__PURE__ */ (0,
|
|
7715
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Icon, { name: "warning", size: "small", className: "size-3.5 text-agg-error" }),
|
|
7716
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-error", children: error })
|
|
7421
7717
|
]
|
|
7422
7718
|
}
|
|
7423
7719
|
) : null,
|
|
7424
|
-
/* @__PURE__ */ (0,
|
|
7425
|
-
/* @__PURE__ */ (0,
|
|
7720
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex items-center justify-center gap-3", children: [
|
|
7721
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
7426
7722
|
Button,
|
|
7427
7723
|
{
|
|
7428
7724
|
variant: "secondary",
|
|
@@ -7432,7 +7728,7 @@ var ConnectKalshiModal = ({
|
|
|
7432
7728
|
children: labels.onboarding.connectKalshiModal.actions.cancel
|
|
7433
7729
|
}
|
|
7434
7730
|
),
|
|
7435
|
-
/* @__PURE__ */ (0,
|
|
7731
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
7436
7732
|
Button,
|
|
7437
7733
|
{
|
|
7438
7734
|
type: "submit",
|
|
@@ -7453,7 +7749,7 @@ var ConnectKalshiModal = ({
|
|
|
7453
7749
|
ConnectKalshiModal.displayName = "ConnectKalshiModal";
|
|
7454
7750
|
|
|
7455
7751
|
// src/onboarding/index.tsx
|
|
7456
|
-
var
|
|
7752
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
7457
7753
|
var OnboardingModal = ({
|
|
7458
7754
|
open,
|
|
7459
7755
|
onOpenChange,
|
|
@@ -7464,55 +7760,55 @@ var OnboardingModal = ({
|
|
|
7464
7760
|
connectedOnchain = false
|
|
7465
7761
|
}) => {
|
|
7466
7762
|
var _a;
|
|
7467
|
-
const labels = (0,
|
|
7468
|
-
const [step, setStep] = (0,
|
|
7763
|
+
const labels = (0, import_hooks34.useLabels)();
|
|
7764
|
+
const [step, setStep] = (0, import_react12.useState)(ONBOARDING_STEPS.HOW_IT_WORKS);
|
|
7469
7765
|
const stepLabels = {
|
|
7470
7766
|
[ONBOARDING_STEPS.HOW_IT_WORKS]: labels.onboarding.modal.stepHowItWorks,
|
|
7471
7767
|
[ONBOARDING_STEPS.PROFILE_SETUP]: labels.onboarding.modal.stepProfileSetup,
|
|
7472
7768
|
[ONBOARDING_STEPS.CONNECT_ACCOUNTS]: labels.onboarding.modal.stepConnectAccounts
|
|
7473
7769
|
};
|
|
7474
7770
|
const resolvedTitle = (_a = stepLabels[step]) != null ? _a : labels.onboarding.modal.title;
|
|
7475
|
-
const [onchainModalOpen, setOnchainModalOpen] = (0,
|
|
7476
|
-
const [onchainConnected, setOnchainConnected] = (0,
|
|
7477
|
-
(0,
|
|
7771
|
+
const [onchainModalOpen, setOnchainModalOpen] = (0, import_react12.useState)(false);
|
|
7772
|
+
const [onchainConnected, setOnchainConnected] = (0, import_react12.useState)(false);
|
|
7773
|
+
(0, import_react12.useEffect)(() => {
|
|
7478
7774
|
if (open) {
|
|
7479
7775
|
setStep(ONBOARDING_STEPS.HOW_IT_WORKS);
|
|
7480
7776
|
setOnchainConnected(false);
|
|
7481
7777
|
}
|
|
7482
7778
|
}, [open]);
|
|
7483
|
-
const handleHowItWorksContinue = (0,
|
|
7779
|
+
const handleHowItWorksContinue = (0, import_react12.useCallback)(() => {
|
|
7484
7780
|
setStep(ONBOARDING_STEPS.PROFILE_SETUP);
|
|
7485
7781
|
}, []);
|
|
7486
|
-
const handleProfileContinue = (0,
|
|
7782
|
+
const handleProfileContinue = (0, import_react12.useCallback)(
|
|
7487
7783
|
(data) => {
|
|
7488
7784
|
onProfileSubmit == null ? void 0 : onProfileSubmit(data);
|
|
7489
7785
|
setStep(ONBOARDING_STEPS.CONNECT_ACCOUNTS);
|
|
7490
7786
|
},
|
|
7491
7787
|
[onProfileSubmit]
|
|
7492
7788
|
);
|
|
7493
|
-
const handleConnectContinue = (0,
|
|
7789
|
+
const handleConnectContinue = (0, import_react12.useCallback)(() => {
|
|
7494
7790
|
onComplete == null ? void 0 : onComplete();
|
|
7495
7791
|
}, [onComplete]);
|
|
7496
|
-
const handleOpenOnchainModal = (0,
|
|
7792
|
+
const handleOpenOnchainModal = (0, import_react12.useCallback)(() => {
|
|
7497
7793
|
setOnchainModalOpen(true);
|
|
7498
7794
|
}, []);
|
|
7499
|
-
const handleOnchainConnect = (0,
|
|
7795
|
+
const handleOnchainConnect = (0, import_react12.useCallback)(() => __async(null, null, function* () {
|
|
7500
7796
|
yield onConnectOnchain == null ? void 0 : onConnectOnchain();
|
|
7501
7797
|
setOnchainConnected(true);
|
|
7502
7798
|
}), [onConnectOnchain]);
|
|
7503
|
-
return /* @__PURE__ */ (0,
|
|
7504
|
-
/* @__PURE__ */ (0,
|
|
7799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [
|
|
7800
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Modal, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
7505
7801
|
Modal.Container,
|
|
7506
7802
|
{
|
|
7507
7803
|
maxWidth: "600px",
|
|
7508
7804
|
"aria-label": resolvedTitle,
|
|
7509
7805
|
classNames: { container: "!rounded-agg-lg" },
|
|
7510
7806
|
children: [
|
|
7511
|
-
/* @__PURE__ */ (0,
|
|
7512
|
-
/* @__PURE__ */ (0,
|
|
7513
|
-
step === ONBOARDING_STEPS.HOW_IT_WORKS && /* @__PURE__ */ (0,
|
|
7514
|
-
step === ONBOARDING_STEPS.PROFILE_SETUP && /* @__PURE__ */ (0,
|
|
7515
|
-
step === ONBOARDING_STEPS.CONNECT_ACCOUNTS && /* @__PURE__ */ (0,
|
|
7807
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Dialog4.Title, { className: "sr-only", children: resolvedTitle }),
|
|
7808
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(Modal.Body, { classNames: { root: "px-5 py-6 sm:px-10 sm:py-8" }, children: [
|
|
7809
|
+
step === ONBOARDING_STEPS.HOW_IT_WORKS && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(HowItWorksStep, { onContinue: handleHowItWorksContinue, icons: howItWorksIcons }),
|
|
7810
|
+
step === ONBOARDING_STEPS.PROFILE_SETUP && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(ProfileSetupStep, { onContinue: handleProfileContinue }),
|
|
7811
|
+
step === ONBOARDING_STEPS.CONNECT_ACCOUNTS && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
7516
7812
|
ConnectAccountsStep,
|
|
7517
7813
|
{
|
|
7518
7814
|
onConnectOnchain: handleOpenOnchainModal,
|
|
@@ -7524,7 +7820,7 @@ var OnboardingModal = ({
|
|
|
7524
7820
|
]
|
|
7525
7821
|
}
|
|
7526
7822
|
) }),
|
|
7527
|
-
/* @__PURE__ */ (0,
|
|
7823
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
7528
7824
|
ConnectOnchainModal,
|
|
7529
7825
|
{
|
|
7530
7826
|
open: onchainModalOpen,
|
|
@@ -7537,9 +7833,9 @@ var OnboardingModal = ({
|
|
|
7537
7833
|
OnboardingModal.displayName = "OnboardingModal";
|
|
7538
7834
|
|
|
7539
7835
|
// src/notifications/agg-notification-events-provider.tsx
|
|
7540
|
-
var
|
|
7541
|
-
var
|
|
7542
|
-
var
|
|
7836
|
+
var import_hooks35 = require("@agg-build/hooks");
|
|
7837
|
+
var import_react13 = require("react");
|
|
7838
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
7543
7839
|
var firedOrderNotificationKeys = /* @__PURE__ */ new Set();
|
|
7544
7840
|
var MICRO_UNITS_SCALE = 1e6;
|
|
7545
7841
|
var formatScaledMicroAmount = (value) => {
|
|
@@ -7636,41 +7932,41 @@ var requestAggDepositModalOpen = () => {
|
|
|
7636
7932
|
};
|
|
7637
7933
|
|
|
7638
7934
|
// src/trading/fund-kalshi-modal.tsx
|
|
7639
|
-
var
|
|
7935
|
+
var import_hooks36 = require("@agg-build/hooks");
|
|
7640
7936
|
var import_sdk15 = require("@agg-build/sdk");
|
|
7641
7937
|
var Dialog5 = __toESM(require("@radix-ui/react-dialog"));
|
|
7642
|
-
var
|
|
7938
|
+
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
7643
7939
|
var FundKalshiModal = ({ open, onOpenChange }) => {
|
|
7644
|
-
const labels = (0,
|
|
7940
|
+
const labels = (0, import_hooks36.useLabels)();
|
|
7645
7941
|
const modalLabels = labels.trading.fundKalshiModal;
|
|
7646
|
-
return /* @__PURE__ */ (0,
|
|
7942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Modal, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(
|
|
7647
7943
|
Modal.Container,
|
|
7648
7944
|
{
|
|
7649
7945
|
maxWidth: "600px",
|
|
7650
7946
|
"aria-label": modalLabels.ariaLabel,
|
|
7651
7947
|
classNames: { container: "relative !rounded-agg-2xl" },
|
|
7652
7948
|
children: [
|
|
7653
|
-
/* @__PURE__ */ (0,
|
|
7949
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
7654
7950
|
Dialog5.Close,
|
|
7655
7951
|
{
|
|
7656
7952
|
"aria-label": labels.common.close,
|
|
7657
7953
|
className: "absolute right-6 top-6 z-10 flex size-11 cursor-pointer items-center justify-center rounded-agg-full text-agg-secondary transition-colors hover:bg-agg-quaternary hover:text-agg-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-accent sm:right-7 sm:top-7",
|
|
7658
|
-
children: /* @__PURE__ */ (0,
|
|
7954
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Icon, { name: "close", size: "medium" })
|
|
7659
7955
|
}
|
|
7660
7956
|
),
|
|
7661
|
-
/* @__PURE__ */ (0,
|
|
7662
|
-
/* @__PURE__ */ (0,
|
|
7663
|
-
/* @__PURE__ */ (0,
|
|
7664
|
-
/* @__PURE__ */ (0,
|
|
7665
|
-
/* @__PURE__ */ (0,
|
|
7957
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Modal.Body, { classNames: { root: "!px-5 !py-12 sm:!px-10" }, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex flex-col items-center gap-8 text-center", children: [
|
|
7958
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(VenueLogo, { venue: import_sdk15.Venue.kalshi, variant: "logo", size: "large", className: "size-[60px]" }),
|
|
7959
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex flex-col items-center gap-4", children: [
|
|
7960
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Dialog5.Title, { className: "text-agg-2xl font-agg-bold leading-agg-8 text-agg-foreground", children: modalLabels.title }),
|
|
7961
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Dialog5.Description, { className: "max-w-[520px] text-agg-base leading-agg-6 text-agg-foreground", children: modalLabels.description })
|
|
7666
7962
|
] }),
|
|
7667
|
-
/* @__PURE__ */ (0,
|
|
7668
|
-
/* @__PURE__ */ (0,
|
|
7669
|
-
/* @__PURE__ */ (0,
|
|
7670
|
-
/* @__PURE__ */ (0,
|
|
7963
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex w-full flex-col gap-3 rounded-agg-xl bg-agg-secondary-hover p-4 text-left", children: [
|
|
7964
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { className: "text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground", children: modalLabels.howItWorks }),
|
|
7965
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("ol", { className: "list-decimal space-y-0 pl-5 text-agg-sm leading-agg-5 text-agg-foreground", children: [
|
|
7966
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("li", { children: [
|
|
7671
7967
|
modalLabels.firstStepPrefix,
|
|
7672
7968
|
" ",
|
|
7673
|
-
/* @__PURE__ */ (0,
|
|
7969
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
7674
7970
|
"a",
|
|
7675
7971
|
{
|
|
7676
7972
|
href: modalLabels.kalshiUrl,
|
|
@@ -7683,12 +7979,12 @@ var FundKalshiModal = ({ open, onOpenChange }) => {
|
|
|
7683
7979
|
" ",
|
|
7684
7980
|
modalLabels.firstStepSuffix
|
|
7685
7981
|
] }),
|
|
7686
|
-
modalLabels.remainingSteps.map((step) => /* @__PURE__ */ (0,
|
|
7982
|
+
modalLabels.remainingSteps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("li", { children: step }, step))
|
|
7687
7983
|
] })
|
|
7688
7984
|
] }),
|
|
7689
|
-
/* @__PURE__ */ (0,
|
|
7690
|
-
/* @__PURE__ */ (0,
|
|
7691
|
-
/* @__PURE__ */ (0,
|
|
7985
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex flex-wrap items-center justify-center gap-3", children: [
|
|
7986
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Button, { variant: "secondary", size: "large", onClick: () => onOpenChange(false), children: modalLabels.doItLater }),
|
|
7987
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
7692
7988
|
Button,
|
|
7693
7989
|
{
|
|
7694
7990
|
variant: "primary",
|
|
@@ -7713,11 +8009,12 @@ var MIN_SELL_ORDER_SHARES = 1;
|
|
|
7713
8009
|
var DEFAULT_SLIPPAGE_VALUE = "0.5";
|
|
7714
8010
|
var HIGH_SLIPPAGE_THRESHOLD = 10;
|
|
7715
8011
|
var PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT = 3;
|
|
8012
|
+
var PLACE_ORDER_NUMERIC_INPUT_CLASS_NAME = "bg-transparent text-right text-agg-3xl font-agg-bold leading-agg-9 tracking-agg-normal text-agg-foreground outline-none";
|
|
7716
8013
|
var PLACE_ORDER_CONTAINER_CLASS_NAME = "w-full overflow-hidden rounded-agg-xl border border-agg-separator bg-agg-secondary shadow-none hover:shadow-none";
|
|
7717
8014
|
var PLACE_ORDER_OUTCOME_BUTTON_CLASS_NAMES = {
|
|
7718
8015
|
activeNegative: "border-agg-error/50 bg-agg-error/15 font-agg-bold text-agg-error",
|
|
7719
8016
|
activePositive: "border-agg-success/50 bg-agg-success/15 font-agg-bold text-agg-success",
|
|
7720
|
-
base: "flex h-
|
|
8017
|
+
base: "flex h-11 flex-1 items-center justify-center rounded-agg-full border px-6 text-agg-base leading-agg-6",
|
|
7721
8018
|
inactive: "border-transparent bg-agg-secondary-hover font-agg-normal text-agg-foreground hover:bg-agg-tertiary"
|
|
7722
8019
|
};
|
|
7723
8020
|
|
|
@@ -8186,6 +8483,93 @@ var routePriceLabelFormatter = new Intl.NumberFormat("en-US", {
|
|
|
8186
8483
|
maximumFractionDigits: 1
|
|
8187
8484
|
});
|
|
8188
8485
|
var GEO_BLOCK_WARNING_PREFIX = "Venue not available in your region";
|
|
8486
|
+
var normalizeOutcomeName = (value) => {
|
|
8487
|
+
var _a;
|
|
8488
|
+
return (_a = value == null ? void 0 : value.trim().toLowerCase()) != null ? _a : "";
|
|
8489
|
+
};
|
|
8490
|
+
var findMatchingVenueOutcome = (market, selectedOutcome) => {
|
|
8491
|
+
var _a, _b;
|
|
8492
|
+
const selectedNames = new Set(
|
|
8493
|
+
[selectedOutcome.label, selectedOutcome.title].map(normalizeOutcomeName).filter(Boolean)
|
|
8494
|
+
);
|
|
8495
|
+
return (_b = (_a = market.venueMarketOutcomes) == null ? void 0 : _a.find((outcome) => {
|
|
8496
|
+
const normalizedLabel = normalizeOutcomeName(outcome.label);
|
|
8497
|
+
return normalizedLabel !== "" && selectedNames.has(normalizedLabel);
|
|
8498
|
+
})) != null ? _b : null;
|
|
8499
|
+
};
|
|
8500
|
+
var buildLimitOrderVenueOptions = ({
|
|
8501
|
+
currentPrices,
|
|
8502
|
+
livePrices,
|
|
8503
|
+
market,
|
|
8504
|
+
selectedOutcomeId
|
|
8505
|
+
}) => {
|
|
8506
|
+
var _a, _b, _c, _d;
|
|
8507
|
+
if (!market || !selectedOutcomeId) return [];
|
|
8508
|
+
const selectedOutcome = market.venueMarketOutcomes.find(
|
|
8509
|
+
(outcome) => outcome.id === selectedOutcomeId
|
|
8510
|
+
);
|
|
8511
|
+
if (!selectedOutcome) return [];
|
|
8512
|
+
const options = /* @__PURE__ */ new Map();
|
|
8513
|
+
const addOption = ({
|
|
8514
|
+
outcomeId,
|
|
8515
|
+
venue,
|
|
8516
|
+
venueMarketId
|
|
8517
|
+
}) => {
|
|
8518
|
+
var _a2;
|
|
8519
|
+
const parsedVenue = parseVenue(venue);
|
|
8520
|
+
if (!parsedVenue.success || options.has(parsedVenue.data)) return;
|
|
8521
|
+
options.set(parsedVenue.data, {
|
|
8522
|
+
currentPrice: (_a2 = livePrices == null ? void 0 : livePrices.get(outcomeId)) != null ? _a2 : currentPrices.get(outcomeId),
|
|
8523
|
+
venue: parsedVenue.data,
|
|
8524
|
+
venueMarketId,
|
|
8525
|
+
venueMarketOutcomeId: outcomeId
|
|
8526
|
+
});
|
|
8527
|
+
};
|
|
8528
|
+
addOption({
|
|
8529
|
+
outcomeId: selectedOutcome.id,
|
|
8530
|
+
venue: market.venue,
|
|
8531
|
+
venueMarketId: market.id
|
|
8532
|
+
});
|
|
8533
|
+
const matchedMarketsById = new Map(
|
|
8534
|
+
((_a = market.matchedVenueMarkets) != null ? _a : []).map((matchedMarket) => [matchedMarket.id, matchedMarket])
|
|
8535
|
+
);
|
|
8536
|
+
const matchedOutcomeRefs = (_b = selectedOutcome.matchedVenueMarketOutcomes) != null ? _b : [];
|
|
8537
|
+
for (const ref of matchedOutcomeRefs) {
|
|
8538
|
+
const matchedMarket = matchedMarketsById.get(ref.venueMarketId);
|
|
8539
|
+
const matchedOutcome = (_c = matchedMarket == null ? void 0 : matchedMarket.venueMarketOutcomes) == null ? void 0 : _c.find(
|
|
8540
|
+
(outcome) => outcome.id === ref.venueMarketOutcomeId
|
|
8541
|
+
);
|
|
8542
|
+
if (!matchedMarket || !matchedOutcome) continue;
|
|
8543
|
+
addOption({
|
|
8544
|
+
outcomeId: matchedOutcome.id,
|
|
8545
|
+
venue: matchedMarket.venue,
|
|
8546
|
+
venueMarketId: matchedMarket.id
|
|
8547
|
+
});
|
|
8548
|
+
}
|
|
8549
|
+
if (matchedOutcomeRefs.length === 0) {
|
|
8550
|
+
for (const matchedMarket of (_d = market.matchedVenueMarkets) != null ? _d : []) {
|
|
8551
|
+
const matchedOutcome = findMatchingVenueOutcome(matchedMarket, selectedOutcome);
|
|
8552
|
+
if (!matchedOutcome) continue;
|
|
8553
|
+
addOption({
|
|
8554
|
+
outcomeId: matchedOutcome.id,
|
|
8555
|
+
venue: matchedMarket.venue,
|
|
8556
|
+
venueMarketId: matchedMarket.id
|
|
8557
|
+
});
|
|
8558
|
+
}
|
|
8559
|
+
}
|
|
8560
|
+
return [...options.values()];
|
|
8561
|
+
};
|
|
8562
|
+
var resolveAutomaticLimitOrderVenueOption = (options, side) => {
|
|
8563
|
+
if (options.length === 0) return null;
|
|
8564
|
+
return [...options].sort((left, right) => {
|
|
8565
|
+
if (left.currentPrice == null && right.currentPrice == null) {
|
|
8566
|
+
return left.venue.localeCompare(right.venue);
|
|
8567
|
+
}
|
|
8568
|
+
if (left.currentPrice == null) return 1;
|
|
8569
|
+
if (right.currentPrice == null) return -1;
|
|
8570
|
+
return side === "buy" ? left.currentPrice - right.currentPrice : right.currentPrice - left.currentPrice;
|
|
8571
|
+
})[0];
|
|
8572
|
+
};
|
|
8189
8573
|
var isGeoBlockWarningReason = (reason) => reason.startsWith(GEO_BLOCK_WARNING_PREFIX);
|
|
8190
8574
|
var extractGeoBlockedVenues = (warnings) => {
|
|
8191
8575
|
if (!(warnings == null ? void 0 : warnings.length)) return /* @__PURE__ */ new Set();
|
|
@@ -8193,6 +8577,12 @@ var extractGeoBlockedVenues = (warnings) => {
|
|
|
8193
8577
|
warnings.filter((w) => w.venue && isGeoBlockWarningReason(w.reason)).map((w) => w.venue)
|
|
8194
8578
|
);
|
|
8195
8579
|
};
|
|
8580
|
+
var getSmartRouteTotalFees = (feeBreakdown) => {
|
|
8581
|
+
if (!feeBreakdown) return null;
|
|
8582
|
+
const feeParts = [feeBreakdown.venueFees, feeBreakdown.bridgeFees, feeBreakdown.executionGas];
|
|
8583
|
+
if (!feeParts.every(Number.isFinite)) return null;
|
|
8584
|
+
return feeParts.reduce((total, fee) => total + fee, 0);
|
|
8585
|
+
};
|
|
8196
8586
|
var hasLowLiquidityWarning = (warnings) => {
|
|
8197
8587
|
if (!(warnings == null ? void 0 : warnings.length)) return false;
|
|
8198
8588
|
return warnings.some((warning) => (warning == null ? void 0 : warning.reason) === "low_liquidity");
|
|
@@ -9406,7 +9796,7 @@ var isPercentageBelowMinimum = (value, minimumValue) => {
|
|
|
9406
9796
|
};
|
|
9407
9797
|
|
|
9408
9798
|
// src/trading/place-order/index.place-order.failure.tsx
|
|
9409
|
-
var
|
|
9799
|
+
var import_jsx_runtime133 = require("react/jsx-runtime");
|
|
9410
9800
|
var resolveFailureActionHandler = ({
|
|
9411
9801
|
action,
|
|
9412
9802
|
onDone,
|
|
@@ -9419,12 +9809,12 @@ var resolveFailureActionHandler = ({
|
|
|
9419
9809
|
};
|
|
9420
9810
|
var renderPartialFailureStep = (step) => {
|
|
9421
9811
|
const isWarningStep = step.tone === "warning" || step.tone === "error";
|
|
9422
|
-
return /* @__PURE__ */ (0,
|
|
9812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
|
|
9423
9813
|
"div",
|
|
9424
9814
|
{
|
|
9425
9815
|
className: "flex items-center gap-2 text-agg-sm leading-agg-5 text-agg-foreground",
|
|
9426
9816
|
children: [
|
|
9427
|
-
/* @__PURE__ */ (0,
|
|
9817
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
9428
9818
|
Icon,
|
|
9429
9819
|
{
|
|
9430
9820
|
name: isWarningStep ? "warning-filled" : "check-circle",
|
|
@@ -9433,8 +9823,8 @@ var renderPartialFailureStep = (step) => {
|
|
|
9433
9823
|
"aria-hidden": "true"
|
|
9434
9824
|
}
|
|
9435
9825
|
),
|
|
9436
|
-
/* @__PURE__ */ (0,
|
|
9437
|
-
step.venue ? /* @__PURE__ */ (0,
|
|
9826
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: "min-w-0 flex-1", children: step.label }),
|
|
9827
|
+
step.venue ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(VenueLogo, { venue: step.venue, size: "small", className: "h-4 w-4 shrink-0" }) : null
|
|
9438
9828
|
]
|
|
9439
9829
|
},
|
|
9440
9830
|
step.id
|
|
@@ -9453,10 +9843,10 @@ var PlaceOrderFailureView = ({
|
|
|
9453
9843
|
const shouldShowPartialFailureLayout = summary.kind === "partial_fill";
|
|
9454
9844
|
const failureStepGroups = shouldShowPartialFailureLayout ? groupPlaceOrderFailureSteps(summary.steps) : [];
|
|
9455
9845
|
if (shouldShowPartialFailureLayout) {
|
|
9456
|
-
return /* @__PURE__ */ (0,
|
|
9457
|
-
/* @__PURE__ */ (0,
|
|
9458
|
-
/* @__PURE__ */ (0,
|
|
9459
|
-
/* @__PURE__ */ (0,
|
|
9846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Card, { className: cn("group/agg-order-panel", getPlaceOrderContainerClassName(), className), children: /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "agg-order-failure-body flex flex-col gap-6 p-5", children: [
|
|
9847
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "agg-order-failure-header flex flex-col gap-2", children: [
|
|
9848
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "agg-order-failure-market flex items-center gap-3", children: [
|
|
9849
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
9460
9850
|
RemoteImage,
|
|
9461
9851
|
{
|
|
9462
9852
|
src: (_a = summary.eventImage) != null ? _a : null,
|
|
@@ -9464,12 +9854,12 @@ var PlaceOrderFailureView = ({
|
|
|
9464
9854
|
className: "h-12 w-12 shrink-0 overflow-hidden rounded-agg-lg object-cover"
|
|
9465
9855
|
}
|
|
9466
9856
|
),
|
|
9467
|
-
/* @__PURE__ */ (0,
|
|
9857
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)("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 })
|
|
9468
9858
|
] }),
|
|
9469
|
-
summary.eventSubtitle ? /* @__PURE__ */ (0,
|
|
9859
|
+
summary.eventSubtitle ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: summary.eventSubtitle }) : null
|
|
9470
9860
|
] }),
|
|
9471
|
-
/* @__PURE__ */ (0,
|
|
9472
|
-
/* @__PURE__ */ (0,
|
|
9861
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { className: "flex flex-col gap-4", children: failureStepGroups.map((group, groupIndex) => /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { className: "flex flex-col gap-2", children: group.map((step) => renderPartialFailureStep(step)) }, `failure-group-${groupIndex}`)) }),
|
|
9862
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { className: "flex items-center gap-4", children: summary.actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
9473
9863
|
Button,
|
|
9474
9864
|
{
|
|
9475
9865
|
variant: "tertiary",
|
|
@@ -9483,10 +9873,10 @@ var PlaceOrderFailureView = ({
|
|
|
9483
9873
|
)) })
|
|
9484
9874
|
] }) });
|
|
9485
9875
|
}
|
|
9486
|
-
return /* @__PURE__ */ (0,
|
|
9487
|
-
/* @__PURE__ */ (0,
|
|
9488
|
-
/* @__PURE__ */ (0,
|
|
9489
|
-
/* @__PURE__ */ (0,
|
|
9876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Card, { className: cn("group/agg-order-panel", getPlaceOrderContainerClassName(), className), children: /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "agg-order-failure-body flex flex-col gap-6 p-5", children: [
|
|
9877
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "agg-order-failure-header flex flex-col gap-2", children: [
|
|
9878
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "agg-order-failure-market flex items-center gap-3", children: [
|
|
9879
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
9490
9880
|
RemoteImage,
|
|
9491
9881
|
{
|
|
9492
9882
|
src: (_b = summary.eventImage) != null ? _b : null,
|
|
@@ -9494,11 +9884,11 @@ var PlaceOrderFailureView = ({
|
|
|
9494
9884
|
className: "h-12 w-12 shrink-0 overflow-hidden rounded-agg-lg object-cover"
|
|
9495
9885
|
}
|
|
9496
9886
|
),
|
|
9497
|
-
/* @__PURE__ */ (0,
|
|
9887
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)("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 })
|
|
9498
9888
|
] }),
|
|
9499
|
-
summary.eventSubtitle ? /* @__PURE__ */ (0,
|
|
9889
|
+
summary.eventSubtitle ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: summary.eventSubtitle }) : null
|
|
9500
9890
|
] }),
|
|
9501
|
-
/* @__PURE__ */ (0,
|
|
9891
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
9502
9892
|
InlineAlert,
|
|
9503
9893
|
{
|
|
9504
9894
|
tone: "error",
|
|
@@ -9507,7 +9897,7 @@ var PlaceOrderFailureView = ({
|
|
|
9507
9897
|
message: tradingLabels.orderFailureDescription((_c = summary.errorMessage) != null ? _c : "")
|
|
9508
9898
|
}
|
|
9509
9899
|
),
|
|
9510
|
-
/* @__PURE__ */ (0,
|
|
9900
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { className: "agg-order-failure-actions flex items-center gap-3", children: summary.actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
9511
9901
|
Button,
|
|
9512
9902
|
{
|
|
9513
9903
|
variant: action.variant === "retry" ? "primary" : "secondary",
|
|
@@ -9524,8 +9914,8 @@ var PlaceOrderFailureView = ({
|
|
|
9524
9914
|
PlaceOrderFailureView.displayName = "PlaceOrderFailureView";
|
|
9525
9915
|
|
|
9526
9916
|
// src/trading/place-order/index.place-order.success.tsx
|
|
9527
|
-
var
|
|
9528
|
-
var
|
|
9917
|
+
var import_react14 = require("react");
|
|
9918
|
+
var import_jsx_runtime134 = require("react/jsx-runtime");
|
|
9529
9919
|
var resolveBuyToWinLabel = (shares) => {
|
|
9530
9920
|
if (!shares) return "$0";
|
|
9531
9921
|
return shares.startsWith("$") ? shares : `$${shares}`;
|
|
@@ -9538,7 +9928,7 @@ var PlaceOrderSuccessView = ({
|
|
|
9538
9928
|
onShare: _onShare
|
|
9539
9929
|
}) => {
|
|
9540
9930
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
9541
|
-
const [isExecutionDetailsExpanded, setIsExecutionDetailsExpanded] = (0,
|
|
9931
|
+
const [isExecutionDetailsExpanded, setIsExecutionDetailsExpanded] = (0, import_react14.useState)(true);
|
|
9542
9932
|
const doneLabel = tradingLabels.orderDone;
|
|
9543
9933
|
const _shareLabel = (_a = tradingLabels.orderShare) != null ? _a : "Share";
|
|
9544
9934
|
const potentialReturnLabel = summary.potentialReturnLabel && tradingLabels.potentialReturnBonus ? tradingLabels.potentialReturnBonus(summary.potentialReturnLabel) : summary.potentialReturnLabel ? `+${summary.potentialReturnLabel} Better Payout` : null;
|
|
@@ -9556,10 +9946,10 @@ var PlaceOrderSuccessView = ({
|
|
|
9556
9946
|
const resolveStepIconClassName = (tone) => {
|
|
9557
9947
|
return tone === "warning" || tone === "error" ? "text-agg-warning" : "text-agg-primary";
|
|
9558
9948
|
};
|
|
9559
|
-
return /* @__PURE__ */ (0,
|
|
9560
|
-
summary.eventTitle ? /* @__PURE__ */ (0,
|
|
9561
|
-
/* @__PURE__ */ (0,
|
|
9562
|
-
/* @__PURE__ */ (0,
|
|
9949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Card, { className: cn("group/agg-order-panel", getPlaceOrderContainerClassName(), className), children: /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "agg-order-success-body flex flex-col gap-6 p-5", children: [
|
|
9950
|
+
summary.eventTitle ? /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "agg-order-success-header flex flex-col gap-2", children: [
|
|
9951
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "agg-order-success-market flex items-center gap-3", children: [
|
|
9952
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
9563
9953
|
RemoteImage,
|
|
9564
9954
|
{
|
|
9565
9955
|
src: (_h = summary.eventImage) != null ? _h : null,
|
|
@@ -9567,12 +9957,12 @@ var PlaceOrderSuccessView = ({
|
|
|
9567
9957
|
className: "h-12 w-12 shrink-0 overflow-hidden rounded-agg-lg object-cover"
|
|
9568
9958
|
}
|
|
9569
9959
|
),
|
|
9570
|
-
/* @__PURE__ */ (0,
|
|
9960
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("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 })
|
|
9571
9961
|
] }),
|
|
9572
|
-
summary.eventDateLabel ? /* @__PURE__ */ (0,
|
|
9962
|
+
summary.eventDateLabel ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("p", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: summary.eventDateLabel }) : null
|
|
9573
9963
|
] }) : null,
|
|
9574
|
-
executionStepGroups.length > 0 ? /* @__PURE__ */ (0,
|
|
9575
|
-
/* @__PURE__ */ (0,
|
|
9964
|
+
executionStepGroups.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "agg-order-success-timeline flex flex-col gap-2", children: [
|
|
9965
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
9576
9966
|
"div",
|
|
9577
9967
|
{
|
|
9578
9968
|
"aria-hidden": !isExecutionDetailsExpanded,
|
|
@@ -9585,12 +9975,12 @@ var PlaceOrderSuccessView = ({
|
|
|
9585
9975
|
"transition-[grid-template-rows,opacity] duration-200 ease-[cubic-bezier(0.22,1,0.36,1)]"
|
|
9586
9976
|
)
|
|
9587
9977
|
),
|
|
9588
|
-
children: /* @__PURE__ */ (0,
|
|
9978
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "min-h-0", children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "flex flex-col gap-4 pb-2", children: detailedStepGroups.map((group, groupIndex) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "flex flex-col gap-2", children: group.map((step) => /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
|
|
9589
9979
|
"div",
|
|
9590
9980
|
{
|
|
9591
9981
|
className: "flex items-center gap-2 text-agg-sm leading-agg-5 text-agg-foreground",
|
|
9592
9982
|
children: [
|
|
9593
|
-
/* @__PURE__ */ (0,
|
|
9983
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
9594
9984
|
Icon,
|
|
9595
9985
|
{
|
|
9596
9986
|
name: resolveStepIconName(step.tone),
|
|
@@ -9599,8 +9989,8 @@ var PlaceOrderSuccessView = ({
|
|
|
9599
9989
|
"aria-hidden": "true"
|
|
9600
9990
|
}
|
|
9601
9991
|
),
|
|
9602
|
-
/* @__PURE__ */ (0,
|
|
9603
|
-
step.venue ? /* @__PURE__ */ (0,
|
|
9992
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("p", { className: "min-w-0 flex-1", children: step.label }),
|
|
9993
|
+
step.venue ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
9604
9994
|
VenueLogo,
|
|
9605
9995
|
{
|
|
9606
9996
|
venue: step.venue,
|
|
@@ -9614,7 +10004,7 @@ var PlaceOrderSuccessView = ({
|
|
|
9614
10004
|
)) }, `execution-group-${groupIndex}`)) }) })
|
|
9615
10005
|
}
|
|
9616
10006
|
),
|
|
9617
|
-
finalStep ? hasExecutionDetails ? /* @__PURE__ */ (0,
|
|
10007
|
+
finalStep ? hasExecutionDetails ? /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
|
|
9618
10008
|
"button",
|
|
9619
10009
|
{
|
|
9620
10010
|
type: "button",
|
|
@@ -9626,7 +10016,7 @@ var PlaceOrderSuccessView = ({
|
|
|
9626
10016
|
),
|
|
9627
10017
|
onClick: () => setIsExecutionDetailsExpanded((currentValue) => !currentValue),
|
|
9628
10018
|
children: [
|
|
9629
|
-
/* @__PURE__ */ (0,
|
|
10019
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
9630
10020
|
Icon,
|
|
9631
10021
|
{
|
|
9632
10022
|
name: resolveStepIconName(finalStep.tone),
|
|
@@ -9635,8 +10025,8 @@ var PlaceOrderSuccessView = ({
|
|
|
9635
10025
|
"aria-hidden": "true"
|
|
9636
10026
|
}
|
|
9637
10027
|
),
|
|
9638
|
-
/* @__PURE__ */ (0,
|
|
9639
|
-
/* @__PURE__ */ (0,
|
|
10028
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("p", { className: "min-w-0 flex-1", children: finalStep.label }),
|
|
10029
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
9640
10030
|
Icon,
|
|
9641
10031
|
{
|
|
9642
10032
|
name: isExecutionDetailsExpanded ? "chevron-up" : "chevron-down",
|
|
@@ -9647,8 +10037,8 @@ var PlaceOrderSuccessView = ({
|
|
|
9647
10037
|
)
|
|
9648
10038
|
]
|
|
9649
10039
|
}
|
|
9650
|
-
) : /* @__PURE__ */ (0,
|
|
9651
|
-
/* @__PURE__ */ (0,
|
|
10040
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex items-center gap-2 text-agg-sm leading-agg-5 text-agg-foreground", children: [
|
|
10041
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
9652
10042
|
Icon,
|
|
9653
10043
|
{
|
|
9654
10044
|
name: resolveStepIconName(finalStep.tone),
|
|
@@ -9657,34 +10047,34 @@ var PlaceOrderSuccessView = ({
|
|
|
9657
10047
|
"aria-hidden": "true"
|
|
9658
10048
|
}
|
|
9659
10049
|
),
|
|
9660
|
-
/* @__PURE__ */ (0,
|
|
10050
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("p", { className: "min-w-0 flex-1", children: finalStep.label })
|
|
9661
10051
|
] }) : null
|
|
9662
10052
|
] }) : null,
|
|
9663
|
-
/* @__PURE__ */ (0,
|
|
10053
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
|
|
9664
10054
|
"div",
|
|
9665
10055
|
{
|
|
9666
10056
|
className: cn(
|
|
9667
10057
|
"agg-order-success-pill flex min-h-12 w-full items-center justify-center gap-2 rounded-agg-full px-6 py-2.5 text-center text-agg-base font-agg-bold leading-agg-6 text-agg-on-primary bg-agg-success"
|
|
9668
10058
|
),
|
|
9669
10059
|
children: [
|
|
9670
|
-
/* @__PURE__ */ (0,
|
|
9671
|
-
/* @__PURE__ */ (0,
|
|
10060
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Icon, { name: "success-check", size: "small", className: "h-4 w-4 shrink-0 text-current" }),
|
|
10061
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("span", { children: resolvedActionLabel })
|
|
9672
10062
|
]
|
|
9673
10063
|
}
|
|
9674
10064
|
),
|
|
9675
|
-
/* @__PURE__ */ (0,
|
|
9676
|
-
/* @__PURE__ */ (0,
|
|
9677
|
-
/* @__PURE__ */ (0,
|
|
10065
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "agg-order-success-summary flex items-center justify-between gap-4", children: [
|
|
10066
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.amount(resolvedTradeSide) }),
|
|
10067
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("p", { className: "text-right text-[30px] font-agg-bold leading-[36px] text-agg-foreground", children: resolvedAmountLabel })
|
|
9678
10068
|
] }),
|
|
9679
|
-
/* @__PURE__ */ (0,
|
|
9680
|
-
/* @__PURE__ */ (0,
|
|
9681
|
-
/* @__PURE__ */ (0,
|
|
10069
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "agg-order-success-summary flex items-center justify-between gap-4", children: [
|
|
10070
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.toWin(resolvedTradeSide) }),
|
|
10071
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("p", { className: "text-right text-[30px] font-agg-bold leading-[36px] text-agg-success", children: resolvedToWinLabel })
|
|
9682
10072
|
] }),
|
|
9683
|
-
summary.potentialReturnLabel ? /* @__PURE__ */ (0,
|
|
9684
|
-
/* @__PURE__ */ (0,
|
|
9685
|
-
/* @__PURE__ */ (0,
|
|
10073
|
+
summary.potentialReturnLabel ? /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex w-full flex-col items-center justify-center gap-1 overflow-hidden rounded-agg-lg border border-agg-primary/50 bg-gradient-to-b from-agg-primary/8 to-agg-primary/15 p-3 text-center", children: [
|
|
10074
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("p", { className: "bg-gradient-to-r from-agg-primary to-agg-primary-hover bg-clip-text text-agg-lg font-agg-bold leading-[28px] text-transparent", children: potentialReturnLabel }),
|
|
10075
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("p", { className: "text-agg-xs leading-agg-4 text-agg-foreground", children: (_i = tradingLabels.withSmartRouting) != null ? _i : "with Smart Routing" })
|
|
9686
10076
|
] }) : null,
|
|
9687
|
-
/* @__PURE__ */ (0,
|
|
10077
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "agg-order-success-actions flex gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
9688
10078
|
Button,
|
|
9689
10079
|
{
|
|
9690
10080
|
variant: "secondary",
|
|
@@ -9700,7 +10090,7 @@ var PlaceOrderSuccessView = ({
|
|
|
9700
10090
|
PlaceOrderSuccessView.displayName = "PlaceOrderSuccessView";
|
|
9701
10091
|
|
|
9702
10092
|
// src/trading/place-order/index.tsx
|
|
9703
|
-
var
|
|
10093
|
+
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
9704
10094
|
var SELL_SHARE_INPUT_DECIMALS = 6;
|
|
9705
10095
|
var SELL_SHARE_DISPLAY_DECIMALS = 2;
|
|
9706
10096
|
var floorToDecimals = (value, decimals) => {
|
|
@@ -9824,7 +10214,7 @@ var LoadingGlyph = ({
|
|
|
9824
10214
|
className,
|
|
9825
10215
|
enableAnimations
|
|
9826
10216
|
}) => {
|
|
9827
|
-
return /* @__PURE__ */ (0,
|
|
10217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
9828
10218
|
"span",
|
|
9829
10219
|
{
|
|
9830
10220
|
"aria-hidden": "true",
|
|
@@ -9844,25 +10234,25 @@ var PlaceOrderSlippageControl = ({
|
|
|
9844
10234
|
minimumValue: slippageMinimumValue
|
|
9845
10235
|
}) => {
|
|
9846
10236
|
var _a, _b;
|
|
9847
|
-
const labels = (0,
|
|
9848
|
-
const containerRef = (0,
|
|
9849
|
-
const triggerRef = (0,
|
|
9850
|
-
const inputRef = (0,
|
|
9851
|
-
const warningId = (0,
|
|
10237
|
+
const labels = (0, import_hooks37.useLabels)();
|
|
10238
|
+
const containerRef = (0, import_react16.useRef)(null);
|
|
10239
|
+
const triggerRef = (0, import_react16.useRef)(null);
|
|
10240
|
+
const inputRef = (0, import_react16.useRef)(null);
|
|
10241
|
+
const warningId = (0, import_react16.useId)();
|
|
9852
10242
|
const defaultValue = finalizePercentageValue(slippageDefaultValue);
|
|
9853
10243
|
const committedValue = finalizePercentageValue(slippageValue) || defaultValue;
|
|
9854
|
-
const [draftValue, setDraftValue] = (0,
|
|
9855
|
-
const [isEditing, setIsEditing] = (0,
|
|
10244
|
+
const [draftValue, setDraftValue] = (0, import_react16.useState)(committedValue);
|
|
10245
|
+
const [isEditing, setIsEditing] = (0, import_react16.useState)(
|
|
9856
10246
|
() => isPercentageBelowMinimum(committedValue, slippageMinimumValue)
|
|
9857
10247
|
);
|
|
9858
|
-
const [shouldFocusInput, setShouldFocusInput] = (0,
|
|
9859
|
-
(0,
|
|
10248
|
+
const [shouldFocusInput, setShouldFocusInput] = (0, import_react16.useState)(false);
|
|
10249
|
+
(0, import_react16.useEffect)(() => {
|
|
9860
10250
|
setDraftValue(committedValue);
|
|
9861
10251
|
if (isPercentageBelowMinimum(committedValue, slippageMinimumValue)) {
|
|
9862
10252
|
setIsEditing(true);
|
|
9863
10253
|
}
|
|
9864
10254
|
}, [committedValue, slippageMinimumValue]);
|
|
9865
|
-
(0,
|
|
10255
|
+
(0, import_react16.useEffect)(() => {
|
|
9866
10256
|
if (!shouldFocusInput) return;
|
|
9867
10257
|
requestAnimationFrame(() => {
|
|
9868
10258
|
var _a2, _b2;
|
|
@@ -9879,7 +10269,7 @@ var PlaceOrderSlippageControl = ({
|
|
|
9879
10269
|
Number(committedValue || slippageDefaultValue || DEFAULT_SLIPPAGE_VALUE)
|
|
9880
10270
|
);
|
|
9881
10271
|
const resolvedAutoLabel = labels.trading.resetSlippage;
|
|
9882
|
-
const resolvedWarningMessage = (0,
|
|
10272
|
+
const resolvedWarningMessage = (0, import_react16.useMemo)(() => {
|
|
9883
10273
|
if (isLowSlippage) {
|
|
9884
10274
|
return labels.trading.slippageLow(slippageMinimumValue);
|
|
9885
10275
|
}
|
|
@@ -9942,8 +10332,8 @@ var PlaceOrderSlippageControl = ({
|
|
|
9942
10332
|
if (!isEditing) return;
|
|
9943
10333
|
handleCommitDraft(false);
|
|
9944
10334
|
};
|
|
9945
|
-
return /* @__PURE__ */ (0,
|
|
9946
|
-
/* @__PURE__ */ (0,
|
|
10335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { ref: containerRef, className: "agg-slippage-control w-full", onBlur: handleContainerBlur, children: [
|
|
10336
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
9947
10337
|
"button",
|
|
9948
10338
|
{
|
|
9949
10339
|
ref: triggerRef,
|
|
@@ -9961,8 +10351,8 @@ var PlaceOrderSlippageControl = ({
|
|
|
9961
10351
|
),
|
|
9962
10352
|
onClick: handleToggleEditing,
|
|
9963
10353
|
children: [
|
|
9964
|
-
/* @__PURE__ */ (0,
|
|
9965
|
-
/* @__PURE__ */ (0,
|
|
10354
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "agg-slippage-label", children: collapsedLabel }),
|
|
10355
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
9966
10356
|
Icon,
|
|
9967
10357
|
{
|
|
9968
10358
|
name: isEditing ? "chevron-up" : "pencil",
|
|
@@ -9974,7 +10364,7 @@ var PlaceOrderSlippageControl = ({
|
|
|
9974
10364
|
]
|
|
9975
10365
|
}
|
|
9976
10366
|
),
|
|
9977
|
-
/* @__PURE__ */ (0,
|
|
10367
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
9978
10368
|
"div",
|
|
9979
10369
|
{
|
|
9980
10370
|
"aria-hidden": !isEditing,
|
|
@@ -9988,10 +10378,10 @@ var PlaceOrderSlippageControl = ({
|
|
|
9988
10378
|
"transition-[grid-template-rows,opacity,margin-top] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)]"
|
|
9989
10379
|
)
|
|
9990
10380
|
),
|
|
9991
|
-
children: /* @__PURE__ */ (0,
|
|
9992
|
-
/* @__PURE__ */ (0,
|
|
9993
|
-
/* @__PURE__ */ (0,
|
|
9994
|
-
/* @__PURE__ */ (0,
|
|
10381
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "min-h-0", children: /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-slippage-editor-body flex flex-col gap-2", children: [
|
|
10382
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-slippage-input-row flex h-9 overflow-hidden rounded-agg-sm border border-agg-separator", children: [
|
|
10383
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-slippage-input-group flex min-w-0 flex-1 items-center gap-2 bg-agg-secondary px-3", children: [
|
|
10384
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
9995
10385
|
"input",
|
|
9996
10386
|
{
|
|
9997
10387
|
ref: inputRef,
|
|
@@ -10006,7 +10396,7 @@ var PlaceOrderSlippageControl = ({
|
|
|
10006
10396
|
onKeyDown: handleInputKeyDown
|
|
10007
10397
|
}
|
|
10008
10398
|
),
|
|
10009
|
-
/* @__PURE__ */ (0,
|
|
10399
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10010
10400
|
"button",
|
|
10011
10401
|
{
|
|
10012
10402
|
type: "button",
|
|
@@ -10024,8 +10414,8 @@ var PlaceOrderSlippageControl = ({
|
|
|
10024
10414
|
}
|
|
10025
10415
|
)
|
|
10026
10416
|
] }),
|
|
10027
|
-
/* @__PURE__ */ (0,
|
|
10028
|
-
/* @__PURE__ */ (0,
|
|
10417
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "h-full w-px bg-agg-separator", "aria-hidden": "true" }),
|
|
10418
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10029
10419
|
"div",
|
|
10030
10420
|
{
|
|
10031
10421
|
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",
|
|
@@ -10034,7 +10424,7 @@ var PlaceOrderSlippageControl = ({
|
|
|
10034
10424
|
}
|
|
10035
10425
|
)
|
|
10036
10426
|
] }),
|
|
10037
|
-
/* @__PURE__ */ (0,
|
|
10427
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10038
10428
|
"div",
|
|
10039
10429
|
{
|
|
10040
10430
|
"aria-hidden": !resolvedWarningMessage,
|
|
@@ -10048,13 +10438,13 @@ var PlaceOrderSlippageControl = ({
|
|
|
10048
10438
|
"transition-[grid-template-rows,opacity] duration-200 ease-[cubic-bezier(0.22,1,0.36,1)]"
|
|
10049
10439
|
)
|
|
10050
10440
|
),
|
|
10051
|
-
children: /* @__PURE__ */ (0,
|
|
10441
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "min-h-0", children: /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
10052
10442
|
"div",
|
|
10053
10443
|
{
|
|
10054
10444
|
id: warningId,
|
|
10055
10445
|
className: "agg-slippage-warning-message flex items-start gap-2 text-agg-sm leading-agg-5 text-agg-foreground",
|
|
10056
10446
|
children: [
|
|
10057
|
-
/* @__PURE__ */ (0,
|
|
10447
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10058
10448
|
Icon,
|
|
10059
10449
|
{
|
|
10060
10450
|
name: "warning-filled",
|
|
@@ -10063,7 +10453,7 @@ var PlaceOrderSlippageControl = ({
|
|
|
10063
10453
|
color: "currentColor"
|
|
10064
10454
|
}
|
|
10065
10455
|
),
|
|
10066
|
-
/* @__PURE__ */ (0,
|
|
10456
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { children: resolvedWarningMessage != null ? resolvedWarningMessage : "" })
|
|
10067
10457
|
]
|
|
10068
10458
|
}
|
|
10069
10459
|
) })
|
|
@@ -10083,9 +10473,9 @@ var renderCardHeader = ({
|
|
|
10083
10473
|
onClose
|
|
10084
10474
|
}) => {
|
|
10085
10475
|
if (!headerTitle) return null;
|
|
10086
|
-
return /* @__PURE__ */ (0,
|
|
10087
|
-
/* @__PURE__ */ (0,
|
|
10088
|
-
/* @__PURE__ */ (0,
|
|
10476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: cn("agg-order-panel-header flex flex-col gap-2", className), children: [
|
|
10477
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-order-market-summary flex items-center gap-3", children: [
|
|
10478
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10089
10479
|
RemoteImage,
|
|
10090
10480
|
{
|
|
10091
10481
|
src: headerImage,
|
|
@@ -10093,19 +10483,19 @@ var renderCardHeader = ({
|
|
|
10093
10483
|
className: "agg-order-market-image h-12 w-12 shrink-0 overflow-hidden rounded-agg-lg object-cover"
|
|
10094
10484
|
}
|
|
10095
10485
|
),
|
|
10096
|
-
/* @__PURE__ */ (0,
|
|
10097
|
-
onClose ? /* @__PURE__ */ (0,
|
|
10486
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("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 }),
|
|
10487
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10098
10488
|
"button",
|
|
10099
10489
|
{
|
|
10100
10490
|
type: "button",
|
|
10101
10491
|
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",
|
|
10102
10492
|
"aria-label": "Close",
|
|
10103
10493
|
onClick: onClose,
|
|
10104
|
-
children: /* @__PURE__ */ (0,
|
|
10494
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(CloseIcon, { className: "h-5 w-5" })
|
|
10105
10495
|
}
|
|
10106
10496
|
) : null
|
|
10107
10497
|
] }),
|
|
10108
|
-
headerSubtitle ? /* @__PURE__ */ (0,
|
|
10498
|
+
headerSubtitle ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "agg-order-market-subtitle text-agg-base leading-agg-6 text-agg-foreground", children: headerSubtitle }) : null
|
|
10109
10499
|
] });
|
|
10110
10500
|
};
|
|
10111
10501
|
var PlaceOrderResolvedView = ({
|
|
@@ -10117,7 +10507,7 @@ var PlaceOrderResolvedView = ({
|
|
|
10117
10507
|
isSportsEvent = false
|
|
10118
10508
|
}) => {
|
|
10119
10509
|
var _a, _b;
|
|
10120
|
-
const labels = (0,
|
|
10510
|
+
const labels = (0, import_hooks37.useLabels)();
|
|
10121
10511
|
const tradingLabels = labels.trading;
|
|
10122
10512
|
const resolvingTimestamp = (_a = resolutionTimestamp != null ? resolutionTimestamp : tradingState.resolvesAt) != null ? _a : tradingState.endsAt;
|
|
10123
10513
|
const isResolvingMarket = false;
|
|
@@ -10126,7 +10516,7 @@ var PlaceOrderResolvedView = ({
|
|
|
10126
10516
|
return endDateLabel ? `${tradingState.market.question} \xB7 ${endDateLabel}` : tradingState.market.question;
|
|
10127
10517
|
})() : "";
|
|
10128
10518
|
if (isResolvingMarket) {
|
|
10129
|
-
return /* @__PURE__ */ (0,
|
|
10519
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10130
10520
|
Card,
|
|
10131
10521
|
{
|
|
10132
10522
|
className: cn(
|
|
@@ -10137,7 +10527,7 @@ var PlaceOrderResolvedView = ({
|
|
|
10137
10527
|
),
|
|
10138
10528
|
role: "status",
|
|
10139
10529
|
"aria-label": labels.marketDetails.resolvingTitle,
|
|
10140
|
-
children: /* @__PURE__ */ (0,
|
|
10530
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
10141
10531
|
"div",
|
|
10142
10532
|
{
|
|
10143
10533
|
className: cn(
|
|
@@ -10145,12 +10535,12 @@ var PlaceOrderResolvedView = ({
|
|
|
10145
10535
|
classNames == null ? void 0 : classNames.body
|
|
10146
10536
|
),
|
|
10147
10537
|
children: [
|
|
10148
|
-
/* @__PURE__ */ (0,
|
|
10149
|
-
/* @__PURE__ */ (0,
|
|
10150
|
-
/* @__PURE__ */ (0,
|
|
10151
|
-
resolvingSubtitle ? /* @__PURE__ */ (0,
|
|
10538
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "flex h-[60px] w-[60px] items-center justify-center rounded-full bg-agg-primary/10", children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(LoadingIcon, { variant: "prominent" }) }),
|
|
10539
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: cn("flex w-full flex-col items-center gap-1", classNames == null ? void 0 : classNames.content), children: [
|
|
10540
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(Typography, { variant: "body-large-strong", children: labels.marketDetails.resolvingTitle }),
|
|
10541
|
+
resolvingSubtitle ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(Typography, { variant: "body", className: "text-center", children: resolvingSubtitle }) : null
|
|
10152
10542
|
] }),
|
|
10153
|
-
/* @__PURE__ */ (0,
|
|
10543
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10154
10544
|
Typography,
|
|
10155
10545
|
{
|
|
10156
10546
|
variant: "label",
|
|
@@ -10164,7 +10554,7 @@ var PlaceOrderResolvedView = ({
|
|
|
10164
10554
|
}
|
|
10165
10555
|
);
|
|
10166
10556
|
}
|
|
10167
|
-
return /* @__PURE__ */ (0,
|
|
10557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10168
10558
|
Card,
|
|
10169
10559
|
{
|
|
10170
10560
|
className: cn(
|
|
@@ -10173,19 +10563,19 @@ var PlaceOrderResolvedView = ({
|
|
|
10173
10563
|
classNames == null ? void 0 : classNames.root,
|
|
10174
10564
|
className
|
|
10175
10565
|
),
|
|
10176
|
-
children: /* @__PURE__ */ (0,
|
|
10177
|
-
/* @__PURE__ */ (0,
|
|
10178
|
-
/* @__PURE__ */ (0,
|
|
10566
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: cn("agg-order-panel-body flex flex-col", classNames == null ? void 0 : classNames.body), children: [
|
|
10567
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex flex-col items-center gap-6 p-8", children: [
|
|
10568
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10179
10569
|
"div",
|
|
10180
10570
|
{
|
|
10181
10571
|
className: cn(
|
|
10182
10572
|
"flex h-15 w-15 items-center justify-center rounded-full",
|
|
10183
10573
|
"bg-agg-primary/15"
|
|
10184
10574
|
),
|
|
10185
|
-
children: /* @__PURE__ */ (0,
|
|
10575
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(Icon, { name: "success-check", className: cn("h-6 w-6", "text-agg-primary") })
|
|
10186
10576
|
}
|
|
10187
10577
|
),
|
|
10188
|
-
/* @__PURE__ */ (0,
|
|
10578
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
10189
10579
|
"div",
|
|
10190
10580
|
{
|
|
10191
10581
|
className: cn(
|
|
@@ -10193,8 +10583,8 @@ var PlaceOrderResolvedView = ({
|
|
|
10193
10583
|
classNames == null ? void 0 : classNames.content
|
|
10194
10584
|
),
|
|
10195
10585
|
children: [
|
|
10196
|
-
tradingState.market ? /* @__PURE__ */ (0,
|
|
10197
|
-
tradingState.winningOutcome ? /* @__PURE__ */ (0,
|
|
10586
|
+
tradingState.market ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(Typography, { variant: "body", className: "text-center", children: tradingState.market.question }) : null,
|
|
10587
|
+
tradingState.winningOutcome ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(Typography, { variant: "body-large-strong", children: tradingLabels.outcome(
|
|
10198
10588
|
shouldUseRawResolvedPlaceOrderOutcomeLabel(
|
|
10199
10589
|
tradingState.market,
|
|
10200
10590
|
tradingState.winningOutcome
|
|
@@ -10208,25 +10598,25 @@ var PlaceOrderResolvedView = ({
|
|
|
10208
10598
|
}
|
|
10209
10599
|
)
|
|
10210
10600
|
] }),
|
|
10211
|
-
resolvedClaim ? /* @__PURE__ */ (0,
|
|
10212
|
-
/* @__PURE__ */ (0,
|
|
10213
|
-
/* @__PURE__ */ (0,
|
|
10214
|
-
/* @__PURE__ */ (0,
|
|
10215
|
-
/* @__PURE__ */ (0,
|
|
10216
|
-
resolvedClaim.resolutionDateLabel ? /* @__PURE__ */ (0,
|
|
10217
|
-
/* @__PURE__ */ (0,
|
|
10218
|
-
/* @__PURE__ */ (0,
|
|
10601
|
+
resolvedClaim ? /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_jsx_runtime135.Fragment, { children: [
|
|
10602
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
|
|
10603
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex w-full flex-col gap-5 p-6", children: [
|
|
10604
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(Typography, { variant: "body-strong", className: "text-center", children: tradingLabels.resolvedEarningsTitle }),
|
|
10605
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex flex-col gap-3 text-agg-sm leading-agg-5 text-agg-foreground", children: [
|
|
10606
|
+
resolvedClaim.resolutionDateLabel ? /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
10607
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { children: tradingLabels.resolvedResolutionDateLabel }),
|
|
10608
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "font-agg-bold", children: resolvedClaim.resolutionDateLabel })
|
|
10219
10609
|
] }) : null,
|
|
10220
|
-
/* @__PURE__ */ (0,
|
|
10221
|
-
/* @__PURE__ */ (0,
|
|
10222
|
-
/* @__PURE__ */ (0,
|
|
10610
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
10611
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { children: tradingLabels.resolvedSharesLabel }),
|
|
10612
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "font-agg-bold", children: resolvedClaim.sharesLabel })
|
|
10223
10613
|
] }),
|
|
10224
|
-
/* @__PURE__ */ (0,
|
|
10225
|
-
/* @__PURE__ */ (0,
|
|
10226
|
-
/* @__PURE__ */ (0,
|
|
10614
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
10615
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { children: tradingLabels.resolvedTotalPayoutLabel }),
|
|
10616
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "font-agg-bold", children: resolvedClaim.totalPayoutLabel })
|
|
10227
10617
|
] })
|
|
10228
10618
|
] }),
|
|
10229
|
-
resolvedClaim.onClaim ? /* @__PURE__ */ (0,
|
|
10619
|
+
resolvedClaim.onClaim ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10230
10620
|
Button,
|
|
10231
10621
|
{
|
|
10232
10622
|
size: "large",
|
|
@@ -10247,18 +10637,18 @@ var renderRouteBreakdownRow = (row) => {
|
|
|
10247
10637
|
var _a, _b;
|
|
10248
10638
|
const venueLabel = getTradingVenueLabel(row.venue);
|
|
10249
10639
|
const rowKey = `${row.venue}-${row.label}-${row.priceLabel}-${(_a = row.resultLabel) != null ? _a : ""}`;
|
|
10250
|
-
return /* @__PURE__ */ (0,
|
|
10640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
10251
10641
|
"div",
|
|
10252
10642
|
{
|
|
10253
10643
|
className: "agg-route-breakdown-row flex items-center justify-between gap-4 text-left",
|
|
10254
10644
|
children: [
|
|
10255
|
-
/* @__PURE__ */ (0,
|
|
10256
|
-
/* @__PURE__ */ (0,
|
|
10257
|
-
/* @__PURE__ */ (0,
|
|
10645
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-route-breakdown-market flex min-w-0 items-center gap-2", children: [
|
|
10646
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(VenueLogo, { venue: row.venue, className: "size-3!", ariaLabel: venueLabel }),
|
|
10647
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "agg-route-breakdown-label truncate text-agg-sm leading-agg-5 text-agg-foreground", children: row.label })
|
|
10258
10648
|
] }),
|
|
10259
|
-
/* @__PURE__ */ (0,
|
|
10260
|
-
/* @__PURE__ */ (0,
|
|
10261
|
-
/* @__PURE__ */ (0,
|
|
10649
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-route-breakdown-value flex shrink-0 items-center gap-2 text-agg-sm leading-agg-5", children: [
|
|
10650
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "text-agg-muted-foreground", children: row.priceLabel }),
|
|
10651
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "text-agg-foreground", children: (_b = row.resultLabel) != null ? _b : "" })
|
|
10262
10652
|
] })
|
|
10263
10653
|
]
|
|
10264
10654
|
},
|
|
@@ -10286,7 +10676,7 @@ var renderRouteCard = ({
|
|
|
10286
10676
|
var _a, _b;
|
|
10287
10677
|
const showSplitDetails = isSelected && isExpanded && card.kind === "split" && !!((_a = card.rows) == null ? void 0 : _a.length);
|
|
10288
10678
|
const ariaLabel = [card.label, card.hint, card.value].filter(Boolean).join(" ");
|
|
10289
|
-
return /* @__PURE__ */ (0,
|
|
10679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10290
10680
|
"button",
|
|
10291
10681
|
{
|
|
10292
10682
|
type: "button",
|
|
@@ -10305,10 +10695,10 @@ var renderRouteCard = ({
|
|
|
10305
10695
|
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"
|
|
10306
10696
|
),
|
|
10307
10697
|
onClick: () => onSelect(card.id),
|
|
10308
|
-
children: /* @__PURE__ */ (0,
|
|
10309
|
-
/* @__PURE__ */ (0,
|
|
10310
|
-
/* @__PURE__ */ (0,
|
|
10311
|
-
card.kind === "split" ? /* @__PURE__ */ (0,
|
|
10698
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-route-card-content relative z-10 flex flex-col gap-3", children: [
|
|
10699
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-route-card-header flex items-center justify-between gap-4", children: [
|
|
10700
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-route-card-meta flex min-w-0 gap-3 items-center", children: [
|
|
10701
|
+
card.kind === "split" ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10312
10702
|
Icon,
|
|
10313
10703
|
{
|
|
10314
10704
|
name: "sparkles-filled",
|
|
@@ -10319,7 +10709,7 @@ var renderRouteCard = ({
|
|
|
10319
10709
|
),
|
|
10320
10710
|
"aria-hidden": "true"
|
|
10321
10711
|
}
|
|
10322
|
-
) : card.venue ? /* @__PURE__ */ (0,
|
|
10712
|
+
) : card.venue ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10323
10713
|
VenueLogo,
|
|
10324
10714
|
{
|
|
10325
10715
|
venue: card.venue,
|
|
@@ -10327,10 +10717,10 @@ var renderRouteCard = ({
|
|
|
10327
10717
|
ariaLabel: getTradingVenueLabel(card.venue)
|
|
10328
10718
|
}
|
|
10329
10719
|
) : null,
|
|
10330
|
-
/* @__PURE__ */ (0,
|
|
10331
|
-
/* @__PURE__ */ (0,
|
|
10332
|
-
/* @__PURE__ */ (0,
|
|
10333
|
-
card.isUnavailable ? /* @__PURE__ */ (0,
|
|
10720
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex flex-col gap-1 min-w-0", children: [
|
|
10721
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
10722
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "agg-route-card-title truncate text-agg-sm leading-agg-5 text-agg-foreground", children: card.label }),
|
|
10723
|
+
card.isUnavailable ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10334
10724
|
Icon,
|
|
10335
10725
|
{
|
|
10336
10726
|
name: "lock",
|
|
@@ -10338,7 +10728,7 @@ var renderRouteCard = ({
|
|
|
10338
10728
|
className: "shrink-0 text-agg-muted-foreground",
|
|
10339
10729
|
"aria-hidden": "true"
|
|
10340
10730
|
}
|
|
10341
|
-
) : card.kind === "split" && isSelected ? /* @__PURE__ */ (0,
|
|
10731
|
+
) : card.kind === "split" && isSelected ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10342
10732
|
Icon,
|
|
10343
10733
|
{
|
|
10344
10734
|
name: showSplitDetails ? "chevron-up" : "chevron-down",
|
|
@@ -10348,10 +10738,10 @@ var renderRouteCard = ({
|
|
|
10348
10738
|
}
|
|
10349
10739
|
) : null
|
|
10350
10740
|
] }),
|
|
10351
|
-
card.hint ? /* @__PURE__ */ (0,
|
|
10741
|
+
card.hint ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "agg-route-card-hint text-agg-xs leading-agg-4 text-agg-muted-foreground", children: card.hint }) : null
|
|
10352
10742
|
] })
|
|
10353
10743
|
] }),
|
|
10354
|
-
/* @__PURE__ */ (0,
|
|
10744
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10355
10745
|
"p",
|
|
10356
10746
|
{
|
|
10357
10747
|
className: cn(
|
|
@@ -10363,9 +10753,9 @@ var renderRouteCard = ({
|
|
|
10363
10753
|
}
|
|
10364
10754
|
)
|
|
10365
10755
|
] }),
|
|
10366
|
-
showSplitDetails ? /* @__PURE__ */ (0,
|
|
10367
|
-
/* @__PURE__ */ (0,
|
|
10368
|
-
/* @__PURE__ */ (0,
|
|
10756
|
+
showSplitDetails ? /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_jsx_runtime135.Fragment, { children: [
|
|
10757
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "agg-route-card-description text-agg-xs leading-agg-4 text-agg-foreground", children: tradingLabels.splitOrderDescription }),
|
|
10758
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "agg-route-breakdown flex flex-col gap-3", children: (_b = card.rows) == null ? void 0 : _b.map((row) => renderRouteBreakdownRow(row)) })
|
|
10369
10759
|
] }) : null
|
|
10370
10760
|
] })
|
|
10371
10761
|
}
|
|
@@ -10388,7 +10778,7 @@ var renderSubmissionSurface = ({
|
|
|
10388
10778
|
executionVenue: progressState.executionVenue,
|
|
10389
10779
|
labels: tradingLabels
|
|
10390
10780
|
});
|
|
10391
|
-
return /* @__PURE__ */ (0,
|
|
10781
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10392
10782
|
Card,
|
|
10393
10783
|
{
|
|
10394
10784
|
className: cn(
|
|
@@ -10397,31 +10787,31 @@ var renderSubmissionSurface = ({
|
|
|
10397
10787
|
classNames == null ? void 0 : classNames.root,
|
|
10398
10788
|
className
|
|
10399
10789
|
),
|
|
10400
|
-
children: /* @__PURE__ */ (0,
|
|
10790
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: cn("agg-order-submission-body flex flex-col gap-6 p-5", classNames == null ? void 0 : classNames.body), children: [
|
|
10401
10791
|
renderCardHeader({
|
|
10402
10792
|
className: classNames == null ? void 0 : classNames.header,
|
|
10403
10793
|
headerSubtitle,
|
|
10404
10794
|
headerImage,
|
|
10405
10795
|
headerTitle
|
|
10406
10796
|
}),
|
|
10407
|
-
/* @__PURE__ */ (0,
|
|
10408
|
-
/* @__PURE__ */ (0,
|
|
10409
|
-
/* @__PURE__ */ (0,
|
|
10410
|
-
/* @__PURE__ */ (0,
|
|
10797
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: cn("agg-order-panel-content flex flex-col gap-6", classNames == null ? void 0 : classNames.content), children: [
|
|
10798
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-order-submission-status flex h-12 w-full items-center justify-center gap-3 rounded-agg-full bg-agg-primary-hover px-8 text-agg-base font-agg-bold leading-agg-6 text-agg-on-primary", children: [
|
|
10799
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(LoadingGlyph, { enableAnimations, className: "h-4 w-4 text-current" }),
|
|
10800
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { children: actionLabel })
|
|
10411
10801
|
] }),
|
|
10412
|
-
/* @__PURE__ */ (0,
|
|
10802
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10413
10803
|
"div",
|
|
10414
10804
|
{
|
|
10415
10805
|
className: "agg-order-submission-steps agg-order-submission-group flex flex-col gap-2",
|
|
10416
10806
|
"data-testid": "agg-order-submission-steps",
|
|
10417
10807
|
children: displayRows.map((step) => {
|
|
10418
|
-
return /* @__PURE__ */ (0,
|
|
10808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
10419
10809
|
"div",
|
|
10420
10810
|
{
|
|
10421
10811
|
className: "agg-order-submission-step flex items-center gap-2 text-agg-sm leading-agg-5 text-agg-foreground",
|
|
10422
10812
|
"data-status": step.status,
|
|
10423
10813
|
children: [
|
|
10424
|
-
step.status === "complete" ? /* @__PURE__ */ (0,
|
|
10814
|
+
step.status === "complete" ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10425
10815
|
Icon,
|
|
10426
10816
|
{
|
|
10427
10817
|
name: "check-circle",
|
|
@@ -10429,15 +10819,15 @@ var renderSubmissionSurface = ({
|
|
|
10429
10819
|
className: "h-3 w-3 shrink-0 text-agg-primary",
|
|
10430
10820
|
"aria-hidden": "true"
|
|
10431
10821
|
}
|
|
10432
|
-
) : /* @__PURE__ */ (0,
|
|
10822
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10433
10823
|
LoadingGlyph,
|
|
10434
10824
|
{
|
|
10435
10825
|
enableAnimations,
|
|
10436
10826
|
className: "h-3 w-3 shrink-0 text-agg-primary"
|
|
10437
10827
|
}
|
|
10438
10828
|
),
|
|
10439
|
-
/* @__PURE__ */ (0,
|
|
10440
|
-
step.venue ? /* @__PURE__ */ (0,
|
|
10829
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "min-w-0 flex-1", children: step.label }),
|
|
10830
|
+
step.venue ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
10441
10831
|
VenueLogo,
|
|
10442
10832
|
{
|
|
10443
10833
|
venue: step.venue,
|
|
@@ -10481,25 +10871,26 @@ var PlaceOrder = ({
|
|
|
10481
10871
|
resolvedClaim,
|
|
10482
10872
|
midpointsResult
|
|
10483
10873
|
}) => {
|
|
10484
|
-
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
|
|
10874
|
+
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, __, _$;
|
|
10485
10875
|
const {
|
|
10486
10876
|
enableDebug: isExecutionDebugEnabled,
|
|
10487
10877
|
features: { enableAnimations, showFeesBreakdown, showLimitOrders },
|
|
10878
|
+
formatting: { formatPrice },
|
|
10488
10879
|
general: { locale },
|
|
10489
10880
|
trading: { executionMode: configuredExecutionMode = "live" } = { executionMode: "live" }
|
|
10490
|
-
} = (0,
|
|
10491
|
-
const labels = (0,
|
|
10881
|
+
} = (0, import_hooks37.useSdkUiConfig)();
|
|
10882
|
+
const labels = (0, import_hooks37.useLabels)();
|
|
10492
10883
|
const tradingLabels = labels.trading;
|
|
10493
10884
|
const toastCtx = useOptionalToast();
|
|
10494
|
-
const { isTradingBlocked } = (0,
|
|
10495
|
-
const tradingContext = (0,
|
|
10885
|
+
const { isTradingBlocked } = (0, import_hooks37.useGeoBlock)();
|
|
10886
|
+
const tradingContext = (0, import_hooks37.useEventTradingContext)();
|
|
10496
10887
|
const selectedEvent = (_a = tradingContext == null ? void 0 : tradingContext.selectedEvent) != null ? _a : null;
|
|
10497
10888
|
const selectedMarket = (_b = tradingContext == null ? void 0 : tradingContext.selectedMarket) != null ? _b : null;
|
|
10498
10889
|
const selectedOutcomeId = (_c = tradingContext == null ? void 0 : tradingContext.selectedOutcomeId) != null ? _c : null;
|
|
10499
|
-
const resolvedEventTradingState = (0,
|
|
10500
|
-
return eventTradingState != null ? eventTradingState : (0,
|
|
10890
|
+
const resolvedEventTradingState = (0, import_react16.useMemo)(() => {
|
|
10891
|
+
return eventTradingState != null ? eventTradingState : (0, import_hooks37.resolveEventTradingState)(selectedEvent);
|
|
10501
10892
|
}, [eventTradingState, selectedEvent]);
|
|
10502
|
-
const scopedSelectedEvent = (0,
|
|
10893
|
+
const scopedSelectedEvent = (0, import_react16.useMemo)(() => {
|
|
10503
10894
|
var _a2;
|
|
10504
10895
|
if (!selectedEvent) return null;
|
|
10505
10896
|
const primaryMarketId = (_a2 = resolvedEventTradingState.primaryMarket) == null ? void 0 : _a2.id;
|
|
@@ -10509,7 +10900,7 @@ var PlaceOrder = ({
|
|
|
10509
10900
|
);
|
|
10510
10901
|
return isSelectedEventInScope ? selectedEvent : null;
|
|
10511
10902
|
}, [(_d = resolvedEventTradingState.primaryMarket) == null ? void 0 : _d.id, selectedEvent]);
|
|
10512
|
-
const scopedSelectedMarket = (0,
|
|
10903
|
+
const scopedSelectedMarket = (0, import_react16.useMemo)(() => {
|
|
10513
10904
|
if (!selectedMarket) return resolvedEventTradingState.primaryMarket;
|
|
10514
10905
|
const isSelectedMarketInScope = resolvedEventTradingState.marketStates.some(
|
|
10515
10906
|
(item) => item.market.id === selectedMarket.id
|
|
@@ -10524,10 +10915,10 @@ var PlaceOrder = ({
|
|
|
10524
10915
|
(outcome) => outcome.label.trim().toLowerCase() === "yes"
|
|
10525
10916
|
)) != null ? _f : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venueMarketOutcomes[0]) != null ? _g : null;
|
|
10526
10917
|
const scopedSelectedOutcomeId = (_h = scopedSelectedOutcome == null ? void 0 : scopedSelectedOutcome.id) != null ? _h : null;
|
|
10527
|
-
const resolvedTradingState = (0,
|
|
10528
|
-
return (0,
|
|
10918
|
+
const resolvedTradingState = (0, import_react16.useMemo)(() => {
|
|
10919
|
+
return (0, import_hooks37.resolveMarketTradingState)(scopedSelectedMarket);
|
|
10529
10920
|
}, [scopedSelectedMarket]);
|
|
10530
|
-
const resolvedReadOnlyMarket = (0,
|
|
10921
|
+
const resolvedReadOnlyMarket = (0, import_react16.useMemo)(() => {
|
|
10531
10922
|
var _a2;
|
|
10532
10923
|
if (resolvedEventTradingState.kind !== "resolved") {
|
|
10533
10924
|
return scopedSelectedMarket;
|
|
@@ -10538,12 +10929,12 @@ var PlaceOrder = ({
|
|
|
10538
10929
|
resolvedEventTradingState.primaryMarket,
|
|
10539
10930
|
scopedSelectedMarket
|
|
10540
10931
|
]);
|
|
10541
|
-
const resolvedReadOnlyTradingState = (0,
|
|
10542
|
-
return (0,
|
|
10932
|
+
const resolvedReadOnlyTradingState = (0, import_react16.useMemo)(() => {
|
|
10933
|
+
return (0, import_hooks37.resolveMarketTradingState)(resolvedReadOnlyMarket);
|
|
10543
10934
|
}, [resolvedReadOnlyMarket]);
|
|
10544
10935
|
const isEndedWithoutKnownWinner = false;
|
|
10545
|
-
const orderEligibility = (0,
|
|
10546
|
-
() => (0,
|
|
10936
|
+
const orderEligibility = (0, import_react16.useMemo)(
|
|
10937
|
+
() => (0, import_hooks37.resolveOrderEligibility)({
|
|
10547
10938
|
event: scopedSelectedEvent,
|
|
10548
10939
|
market: scopedSelectedMarket,
|
|
10549
10940
|
outcome: scopedSelectedOutcome,
|
|
@@ -10552,15 +10943,15 @@ var PlaceOrder = ({
|
|
|
10552
10943
|
[scopedSelectedEvent, scopedSelectedMarket, scopedSelectedOutcome, resolvedEventTradingState]
|
|
10553
10944
|
);
|
|
10554
10945
|
const isResolvedOutcomeCtaLocked = resolvedEventTradingState.kind === "resolved" || resolvedTradingState.kind === "resolved";
|
|
10555
|
-
const { isAuthenticated, user } = (0,
|
|
10946
|
+
const { isAuthenticated, user } = (0, import_hooks37.useAggAuthContext)();
|
|
10556
10947
|
const resolvedExecutionMode = executionMode != null ? executionMode : configuredExecutionMode;
|
|
10557
10948
|
const isPaperMode = resolvedExecutionMode === "paper";
|
|
10558
|
-
const liveBalanceState = (0,
|
|
10559
|
-
const paperBalancesQuery = (0,
|
|
10949
|
+
const liveBalanceState = (0, import_hooks37.useAggBalanceState)();
|
|
10950
|
+
const paperBalancesQuery = (0, import_hooks37.useManagedBalances)({
|
|
10560
10951
|
enabled: Boolean(isAuthenticated && isPaperMode),
|
|
10561
10952
|
mode: "paper"
|
|
10562
10953
|
});
|
|
10563
|
-
const paperTotalBalance = (0,
|
|
10954
|
+
const paperTotalBalance = (0, import_react16.useMemo)(() => {
|
|
10564
10955
|
var _a2, _b2;
|
|
10565
10956
|
const cash = (_b2 = (_a2 = paperBalancesQuery.balances) == null ? void 0 : _a2.cash) != null ? _b2 : [];
|
|
10566
10957
|
return cash.reduce((sum, token) => {
|
|
@@ -10576,60 +10967,60 @@ var PlaceOrder = ({
|
|
|
10576
10967
|
const liveAvailableBalance = (_i = liveBalanceState.availableBalance) != null ? _i : liveBalanceState.totalBalance;
|
|
10577
10968
|
const totalBalance = isPaperMode ? paperTotalBalance : liveAvailableBalance;
|
|
10578
10969
|
const isBalanceLoading = isPaperMode ? paperBalancesQuery.isLoading : liveBalanceState.isLoading;
|
|
10579
|
-
const executeManaged = (0,
|
|
10580
|
-
const placeLimitOrder = (0,
|
|
10581
|
-
const aggClient = (0,
|
|
10582
|
-
const queryClient = (0,
|
|
10583
|
-
const { disabledVenues, isLoading: isAppConfigLoading } = (0,
|
|
10584
|
-
const { data: kalshiKeyStatus, refetch: refetchKalshiKeyStatus } = (0,
|
|
10970
|
+
const executeManaged = (0, import_hooks37.useExecuteManaged)();
|
|
10971
|
+
const placeLimitOrder = (0, import_hooks37.usePlaceLimitOrder)();
|
|
10972
|
+
const aggClient = (0, import_hooks37.useAggClient)();
|
|
10973
|
+
const queryClient = (0, import_hooks37.useQueryClient)();
|
|
10974
|
+
const { disabledVenues, isLoading: isAppConfigLoading } = (0, import_hooks37.useAppConfig)();
|
|
10975
|
+
const { data: kalshiKeyStatus, refetch: refetchKalshiKeyStatus } = (0, import_hooks37.useVenueKeyStatus)(
|
|
10585
10976
|
import_sdk17.Venue.kalshi,
|
|
10586
10977
|
isAuthenticated
|
|
10587
10978
|
);
|
|
10588
|
-
const [isConnectKalshiModalOpen, setIsConnectKalshiModalOpen] = (0,
|
|
10589
|
-
const [isFundKalshiModalOpen, setIsFundKalshiModalOpen] = (0,
|
|
10590
|
-
const livePrices = (0,
|
|
10979
|
+
const [isConnectKalshiModalOpen, setIsConnectKalshiModalOpen] = (0, import_react16.useState)(false);
|
|
10980
|
+
const [isFundKalshiModalOpen, setIsFundKalshiModalOpen] = (0, import_react16.useState)(false);
|
|
10981
|
+
const livePrices = (0, import_hooks37.useLiveOutcomePrices)(
|
|
10591
10982
|
scopedSelectedMarket ? [scopedSelectedMarket] : void 0
|
|
10592
10983
|
);
|
|
10593
|
-
const wsBestPrices = (0,
|
|
10594
|
-
const fetchedClusterMidpointResult = (0,
|
|
10984
|
+
const wsBestPrices = (0, import_hooks37.useLiveBestPrices)(scopedSelectedMarket ? [scopedSelectedMarket] : void 0);
|
|
10985
|
+
const fetchedClusterMidpointResult = (0, import_hooks37.useMidpoints)(
|
|
10595
10986
|
midpointsResult ? [] : scopedSelectedMarket ? [scopedSelectedMarket] : []
|
|
10596
10987
|
);
|
|
10597
10988
|
const clusterMidpointResult = midpointsResult != null ? midpointsResult : fetchedClusterMidpointResult;
|
|
10598
10989
|
const clusterBestMidpointsByOutcomeId = (_j = clusterMidpointResult.bestMidpointsByOutcomeId) != null ? _j : clusterMidpointResult.prices;
|
|
10599
10990
|
const clusterBestMidpoint = clusterMidpointResult.bestMidpoint;
|
|
10600
10991
|
const clusterBestPricesRest = clusterMidpointResult.bestPrices;
|
|
10601
|
-
const clusterBestPrices = (0,
|
|
10602
|
-
() => (0,
|
|
10992
|
+
const clusterBestPrices = (0, import_react16.useMemo)(
|
|
10993
|
+
() => (0, import_hooks37.mergeBestPricesPreferringLive)(clusterBestPricesRest, wsBestPrices),
|
|
10603
10994
|
[clusterBestPricesRest, wsBestPrices]
|
|
10604
10995
|
);
|
|
10605
|
-
const [internalTab, setInternalTab] = (0,
|
|
10606
|
-
const [executionType, setExecutionType] = (0,
|
|
10607
|
-
const [
|
|
10608
|
-
const [limitPrice, setLimitPrice] = (0,
|
|
10609
|
-
const [limitPriceInputValue, setLimitPriceInputValue] = (0,
|
|
10610
|
-
const [limitPriceInputError, setLimitPriceInputError] = (0,
|
|
10611
|
-
const [limitExpirationType, setLimitExpirationType] = (0,
|
|
10612
|
-
const [limitExpirationDate, setLimitExpirationDate] = (0,
|
|
10613
|
-
const [limitExpirationTime, setLimitExpirationTime] = (0,
|
|
10614
|
-
const [limitExpirationDraftDate, setLimitExpirationDraftDate] = (0,
|
|
10615
|
-
const [limitExpirationDraftTime, setLimitExpirationDraftTime] = (0,
|
|
10616
|
-
const [limitExpirationPickerView, setLimitExpirationPickerView] = (0,
|
|
10617
|
-
const [isLimitExpirationPickerOpen, setIsLimitExpirationPickerOpen] = (0,
|
|
10618
|
-
const [internalAmount, setInternalAmount] = (0,
|
|
10619
|
-
const [sellFilledForOutcomeId, setSellFilledForOutcomeId] = (0,
|
|
10620
|
-
const [internalSlippage] = (0,
|
|
10621
|
-
const [isRoutesExpanded, setIsRoutesExpanded] = (0,
|
|
10622
|
-
const [selectedRouteCardId, setSelectedRouteCardId] = (0,
|
|
10623
|
-
const [isSplitDetailOpen, setIsSplitDetailOpen] = (0,
|
|
10624
|
-
const [buyGeoBlockSnapshot, setBuyGeoBlockSnapshot] = (0,
|
|
10625
|
-
const [submissionFeedback, setSubmissionFeedback] = (0,
|
|
10626
|
-
const [submissionProgressState, setSubmissionProgressState] = (0,
|
|
10627
|
-
const [isBeforeActionPending, setIsBeforeActionPending] = (0,
|
|
10628
|
-
const outcomes = (0,
|
|
10996
|
+
const [internalTab, setInternalTab] = (0, import_react16.useState)("buy");
|
|
10997
|
+
const [executionType, setExecutionType] = (0, import_react16.useState)("market");
|
|
10998
|
+
const [selectedLimitVenue, setSelectedLimitVenue] = (0, import_react16.useState)(null);
|
|
10999
|
+
const [limitPrice, setLimitPrice] = (0, import_react16.useState)(0.5);
|
|
11000
|
+
const [limitPriceInputValue, setLimitPriceInputValue] = (0, import_react16.useState)(formatLimitPriceInputValue(0.5));
|
|
11001
|
+
const [limitPriceInputError, setLimitPriceInputError] = (0, import_react16.useState)(null);
|
|
11002
|
+
const [limitExpirationType, setLimitExpirationType] = (0, import_react16.useState)("GTC");
|
|
11003
|
+
const [limitExpirationDate, setLimitExpirationDate] = (0, import_react16.useState)(void 0);
|
|
11004
|
+
const [limitExpirationTime, setLimitExpirationTime] = (0, import_react16.useState)("17:00");
|
|
11005
|
+
const [limitExpirationDraftDate, setLimitExpirationDraftDate] = (0, import_react16.useState)();
|
|
11006
|
+
const [limitExpirationDraftTime, setLimitExpirationDraftTime] = (0, import_react16.useState)("17:00");
|
|
11007
|
+
const [limitExpirationPickerView, setLimitExpirationPickerView] = (0, import_react16.useState)("options");
|
|
11008
|
+
const [isLimitExpirationPickerOpen, setIsLimitExpirationPickerOpen] = (0, import_react16.useState)(false);
|
|
11009
|
+
const [internalAmount, setInternalAmount] = (0, import_react16.useState)(PLACE_ORDER_DEFAULT_AMOUNT);
|
|
11010
|
+
const [sellFilledForOutcomeId, setSellFilledForOutcomeId] = (0, import_react16.useState)(null);
|
|
11011
|
+
const [internalSlippage] = (0, import_react16.useState)(DEFAULT_SLIPPAGE_VALUE);
|
|
11012
|
+
const [isRoutesExpanded, setIsRoutesExpanded] = (0, import_react16.useState)(false);
|
|
11013
|
+
const [selectedRouteCardId, setSelectedRouteCardId] = (0, import_react16.useState)(null);
|
|
11014
|
+
const [isSplitDetailOpen, setIsSplitDetailOpen] = (0, import_react16.useState)(false);
|
|
11015
|
+
const [buyGeoBlockSnapshot, setBuyGeoBlockSnapshot] = (0, import_react16.useState)(null);
|
|
11016
|
+
const [submissionFeedback, setSubmissionFeedback] = (0, import_react16.useState)(null);
|
|
11017
|
+
const [submissionProgressState, setSubmissionProgressState] = (0, import_react16.useState)(null);
|
|
11018
|
+
const [isBeforeActionPending, setIsBeforeActionPending] = (0, import_react16.useState)(false);
|
|
11019
|
+
const outcomes = (0, import_react16.useMemo)(
|
|
10629
11020
|
() => mapVenueMarketOutcomesToPlaceOrderOutcomes(scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venueMarketOutcomes),
|
|
10630
11021
|
[scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venueMarketOutcomes]
|
|
10631
11022
|
);
|
|
10632
|
-
const selectedOutcomeDisplayPrice = (0,
|
|
11023
|
+
const selectedOutcomeDisplayPrice = (0, import_react16.useMemo)(() => {
|
|
10633
11024
|
var _a2;
|
|
10634
11025
|
if (!scopedSelectedOutcomeId || !scopedSelectedOutcome) return 0.5;
|
|
10635
11026
|
return getDisplayOutcomePrice({
|
|
@@ -10652,25 +11043,24 @@ var PlaceOrder = ({
|
|
|
10652
11043
|
scopedSelectedOutcomeId,
|
|
10653
11044
|
tradingContext == null ? void 0 : tradingContext.tradeSide
|
|
10654
11045
|
]);
|
|
10655
|
-
const buyTabRef = (0,
|
|
10656
|
-
const sellTabRef = (0,
|
|
10657
|
-
const
|
|
10658
|
-
const
|
|
10659
|
-
const
|
|
10660
|
-
const
|
|
10661
|
-
const
|
|
10662
|
-
const
|
|
10663
|
-
const
|
|
10664
|
-
const
|
|
10665
|
-
|
|
10666
|
-
(0, import_react15.useEffect)(() => {
|
|
11046
|
+
const buyTabRef = (0, import_react16.useRef)(null);
|
|
11047
|
+
const sellTabRef = (0, import_react16.useRef)(null);
|
|
11048
|
+
const expirationTriggerRef = (0, import_react16.useRef)(null);
|
|
11049
|
+
const limitPriceInitializedForOutcomeRef = (0, import_react16.useRef)(void 0);
|
|
11050
|
+
const expirationOptionRefs = (0, import_react16.useRef)([]);
|
|
11051
|
+
const shouldFocusExpirationOptionsRef = (0, import_react16.useRef)(false);
|
|
11052
|
+
const expirationTimeInputId = (0, import_react16.useId)();
|
|
11053
|
+
const executionDebugStoreRef = (0, import_react16.useRef)(null);
|
|
11054
|
+
const executionDebugAttemptIdRef = (0, import_react16.useRef)(null);
|
|
11055
|
+
const submittedSelectionRef = (0, import_react16.useRef)(null);
|
|
11056
|
+
(0, import_react16.useEffect)(() => {
|
|
10667
11057
|
if (!isExecutionDebugEnabled) {
|
|
10668
11058
|
executionDebugStoreRef.current = null;
|
|
10669
11059
|
return;
|
|
10670
11060
|
}
|
|
10671
11061
|
executionDebugStoreRef.current = enableExecutionDebugInBrowser();
|
|
10672
11062
|
}, [isExecutionDebugEnabled]);
|
|
10673
|
-
(0,
|
|
11063
|
+
(0, import_react16.useEffect)(() => {
|
|
10674
11064
|
var _a2;
|
|
10675
11065
|
if (!isLimitExpirationPickerOpen) return;
|
|
10676
11066
|
if (limitExpirationPickerView !== "options") return;
|
|
@@ -10678,7 +11068,7 @@ var PlaceOrder = ({
|
|
|
10678
11068
|
(_a2 = expirationOptionRefs.current[LIMIT_EXPIRATION_OPTION_COUNT - 1]) == null ? void 0 : _a2.focus();
|
|
10679
11069
|
shouldFocusExpirationOptionsRef.current = false;
|
|
10680
11070
|
}, [isLimitExpirationPickerOpen, limitExpirationPickerView]);
|
|
10681
|
-
(0,
|
|
11071
|
+
(0, import_react16.useEffect)(() => {
|
|
10682
11072
|
if (!isExecutionDebugEnabled) return;
|
|
10683
11073
|
const store = executionDebugStoreRef.current;
|
|
10684
11074
|
if (!store) return;
|
|
@@ -10690,16 +11080,37 @@ var PlaceOrder = ({
|
|
|
10690
11080
|
scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.id,
|
|
10691
11081
|
scopedSelectedOutcomeId
|
|
10692
11082
|
]);
|
|
10693
|
-
const debouncedAmount = (0,
|
|
11083
|
+
const debouncedAmount = (0, import_hooks37.useDebouncedValue)(internalAmount, 300);
|
|
10694
11084
|
const isQuoteInputEditing = internalAmount !== debouncedAmount;
|
|
10695
11085
|
const isLimitOrder = showLimitOrders && executionType === "limit";
|
|
10696
|
-
const isSell = (0,
|
|
11086
|
+
const isSell = (0, import_react16.useMemo)(() => internalTab === "sell", [internalTab]);
|
|
11087
|
+
const limitVenueOptions = (0, import_react16.useMemo)(
|
|
11088
|
+
() => {
|
|
11089
|
+
var _a2;
|
|
11090
|
+
return buildLimitOrderVenueOptions({
|
|
11091
|
+
currentPrices: (_a2 = clusterMidpointResult.currentMidpointsByOutcomeId) != null ? _a2 : clusterMidpointResult.prices,
|
|
11092
|
+
livePrices,
|
|
11093
|
+
market: scopedSelectedMarket,
|
|
11094
|
+
selectedOutcomeId: scopedSelectedOutcomeId
|
|
11095
|
+
});
|
|
11096
|
+
},
|
|
11097
|
+
[clusterMidpointResult, livePrices, scopedSelectedMarket, scopedSelectedOutcomeId]
|
|
11098
|
+
);
|
|
11099
|
+
const visibleLimitVenueOptions = (0, import_react16.useMemo)(() => {
|
|
11100
|
+
return limitVenueOptions.filter((option) => {
|
|
11101
|
+
return (0, import_hooks37.getVenueAvailabilityState)({
|
|
11102
|
+
venueId: option.venue,
|
|
11103
|
+
disabledVenues,
|
|
11104
|
+
isConfigLoading: isAppConfigLoading
|
|
11105
|
+
}) !== "hidden";
|
|
11106
|
+
});
|
|
11107
|
+
}, [disabledVenues, isAppConfigLoading, limitVenueOptions]);
|
|
10697
11108
|
const {
|
|
10698
11109
|
positions: executionPositions,
|
|
10699
11110
|
dataUpdatedAt: executionPositionsUpdatedAt,
|
|
10700
11111
|
isLoading: isExecutionPositionsLoading,
|
|
10701
11112
|
isFetching: isExecutionPositionsFetching
|
|
10702
|
-
} = (0,
|
|
11113
|
+
} = (0, import_hooks37.useExecutionPositions)({
|
|
10703
11114
|
enabled: Boolean(isAuthenticated && isSell),
|
|
10704
11115
|
mode: isPaperMode ? "paper" : void 0
|
|
10705
11116
|
});
|
|
@@ -10714,9 +11125,70 @@ var PlaceOrder = ({
|
|
|
10714
11125
|
isEditing: isQuoteInputEditing,
|
|
10715
11126
|
isMarketOpen: resolvedTradingState.kind === "open" && !isEndedWithoutKnownWinner,
|
|
10716
11127
|
isPanelActive: isQuotePanelActive,
|
|
10717
|
-
isSubmitting: submissionProgressState != null || isBeforeActionPending || executeManaged.isPending
|
|
11128
|
+
isSubmitting: submissionProgressState != null || isBeforeActionPending || executeManaged.isPending || placeLimitOrder.isPending
|
|
10718
11129
|
};
|
|
10719
|
-
const
|
|
11130
|
+
const limitVenueQuoteRequests = (0, import_react16.useMemo)(
|
|
11131
|
+
() => visibleLimitVenueOptions.map((option) => ({
|
|
11132
|
+
venue: option.venue,
|
|
11133
|
+
venueMarketOutcomeId: option.venueMarketOutcomeId
|
|
11134
|
+
})),
|
|
11135
|
+
[visibleLimitVenueOptions]
|
|
11136
|
+
);
|
|
11137
|
+
const hasValidLimitVenueQuoteAmount = debouncedAmount > 0;
|
|
11138
|
+
const isLimitVenueQuoteEnabled = isLimitOrder && isQuotePanelActive && !isEndedWithoutKnownWinner && !submissionProgressState && !isBeforeActionPending && !placeLimitOrder.isPending && hasValidLimitVenueQuoteAmount && orderEligibility.canPlaceOrder && (!isSell || sellFilledForOutcomeId === scopedSelectedOutcomeId && !isQuoteInputEditing);
|
|
11139
|
+
const limitVenueQuotes = (0, import_hooks37.useLimitOrderVenueQuotes)({
|
|
11140
|
+
requests: limitVenueQuoteRequests,
|
|
11141
|
+
tradeSide: internalTab,
|
|
11142
|
+
amount: debouncedAmount,
|
|
11143
|
+
marketId: scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.id,
|
|
11144
|
+
accountId: (_k = user == null ? void 0 : user.id) != null ? _k : null,
|
|
11145
|
+
chainBalances: chainBalancesOverride,
|
|
11146
|
+
mode: isPaperMode ? "paper" : void 0,
|
|
11147
|
+
slipCapBps: 1e6,
|
|
11148
|
+
enabled: isLimitVenueQuoteEnabled,
|
|
11149
|
+
refreshContext: smartRouteRefreshContext
|
|
11150
|
+
});
|
|
11151
|
+
const limitVenueQuoteByVenue = (0, import_react16.useMemo)(
|
|
11152
|
+
() => new Map(limitVenueQuotes.quotes.map((quote) => [quote.request.venue, quote])),
|
|
11153
|
+
[limitVenueQuotes.quotes]
|
|
11154
|
+
);
|
|
11155
|
+
const geoBlockedLimitVenues = (0, import_react16.useMemo)(() => {
|
|
11156
|
+
var _a2;
|
|
11157
|
+
const venues = /* @__PURE__ */ new Set();
|
|
11158
|
+
for (const quote of limitVenueQuotes.quotes) {
|
|
11159
|
+
if (extractGeoBlockedVenues((_a2 = quote.data) == null ? void 0 : _a2.warnings).has(quote.request.venue)) {
|
|
11160
|
+
venues.add(quote.request.venue);
|
|
11161
|
+
}
|
|
11162
|
+
}
|
|
11163
|
+
return venues;
|
|
11164
|
+
}, [limitVenueQuotes.quotes]);
|
|
11165
|
+
const availableLimitVenueOptions = (0, import_react16.useMemo)(() => {
|
|
11166
|
+
return visibleLimitVenueOptions.filter((option) => {
|
|
11167
|
+
return !geoBlockedLimitVenues.has(option.venue) && (0, import_hooks37.getVenueAvailabilityState)({
|
|
11168
|
+
venueId: option.venue,
|
|
11169
|
+
disabledVenues,
|
|
11170
|
+
isConfigLoading: isAppConfigLoading
|
|
11171
|
+
}) === "available";
|
|
11172
|
+
});
|
|
11173
|
+
}, [disabledVenues, geoBlockedLimitVenues, isAppConfigLoading, visibleLimitVenueOptions]);
|
|
11174
|
+
const automaticLimitVenueOption = (0, import_react16.useMemo)(
|
|
11175
|
+
() => resolveAutomaticLimitOrderVenueOption(availableLimitVenueOptions, internalTab),
|
|
11176
|
+
[availableLimitVenueOptions, internalTab]
|
|
11177
|
+
);
|
|
11178
|
+
const selectedLimitVenueOption = (0, import_react16.useMemo)(() => {
|
|
11179
|
+
if (selectedLimitVenue) {
|
|
11180
|
+
const selectedOption = availableLimitVenueOptions.find(
|
|
11181
|
+
(option) => option.venue === selectedLimitVenue
|
|
11182
|
+
);
|
|
11183
|
+
if (selectedOption) return selectedOption;
|
|
11184
|
+
}
|
|
11185
|
+
return automaticLimitVenueOption;
|
|
11186
|
+
}, [automaticLimitVenueOption, availableLimitVenueOptions, selectedLimitVenue]);
|
|
11187
|
+
(0, import_react16.useEffect)(() => {
|
|
11188
|
+
if (!selectedLimitVenue || !geoBlockedLimitVenues.has(selectedLimitVenue)) return;
|
|
11189
|
+
setSelectedLimitVenue(null);
|
|
11190
|
+
}, [geoBlockedLimitVenues, selectedLimitVenue]);
|
|
11191
|
+
const smartRoute = (0, import_hooks37.useSmartRoute)(__spreadProps(__spreadValues({
|
|
10720
11192
|
venueMarketOutcomeId: scopedSelectedOutcomeId,
|
|
10721
11193
|
maxSpend: isSell ? void 0 : debouncedAmount,
|
|
10722
11194
|
sellShares: isSell ? debouncedAmount : void 0,
|
|
@@ -10731,13 +11203,13 @@ var PlaceOrder = ({
|
|
|
10731
11203
|
enabled: isSmartRouteEnabled
|
|
10732
11204
|
}, isSell ? {
|
|
10733
11205
|
sellCacheScope: {
|
|
10734
|
-
accountId: (
|
|
11206
|
+
accountId: (_l = user == null ? void 0 : user.id) != null ? _l : null,
|
|
10735
11207
|
positionVersion: executionPositionsUpdatedAt
|
|
10736
11208
|
}
|
|
10737
11209
|
} : {}), {
|
|
10738
11210
|
refreshContext: smartRouteRefreshContext
|
|
10739
11211
|
}));
|
|
10740
|
-
(0,
|
|
11212
|
+
(0, import_react16.useEffect)(() => {
|
|
10741
11213
|
var _a2, _b2, _c2;
|
|
10742
11214
|
if (isSell || smartRoute.isFetching || ((_a2 = smartRoute.data) == null ? void 0 : _a2.venueMarketOutcomeId) !== scopedSelectedOutcomeId) {
|
|
10743
11215
|
return;
|
|
@@ -10759,7 +11231,7 @@ var PlaceOrder = ({
|
|
|
10759
11231
|
smartRoute.isFetching,
|
|
10760
11232
|
user == null ? void 0 : user.id
|
|
10761
11233
|
]);
|
|
10762
|
-
const inheritedBuyGeoBlockedVenues = (0,
|
|
11234
|
+
const inheritedBuyGeoBlockedVenues = (0, import_react16.useMemo)(() => {
|
|
10763
11235
|
var _a2, _b2;
|
|
10764
11236
|
if (!isSell || !buyGeoBlockSnapshot || !scopedSelectedOutcomeId) return void 0;
|
|
10765
11237
|
if (buyGeoBlockSnapshot.eventId !== ((_a2 = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.id) != null ? _a2 : null)) return void 0;
|
|
@@ -10775,7 +11247,7 @@ var PlaceOrder = ({
|
|
|
10775
11247
|
scopedSelectedOutcomeId,
|
|
10776
11248
|
user == null ? void 0 : user.id
|
|
10777
11249
|
]);
|
|
10778
|
-
const venueSellQuoteRequests = (0,
|
|
11250
|
+
const venueSellQuoteRequests = (0, import_react16.useMemo)(
|
|
10779
11251
|
() => {
|
|
10780
11252
|
var _a2;
|
|
10781
11253
|
return isSell && !smartRoute.isLoading && ((_a2 = smartRoute.data) == null ? void 0 : _a2.venueMarketOutcomeId) === scopedSelectedOutcomeId ? buildVenueSellQuoteRequests({
|
|
@@ -10785,17 +11257,17 @@ var PlaceOrder = ({
|
|
|
10785
11257
|
},
|
|
10786
11258
|
[debouncedAmount, isSell, scopedSelectedOutcomeId, smartRoute.data, smartRoute.isLoading]
|
|
10787
11259
|
);
|
|
10788
|
-
const venueSellQuotes = (0,
|
|
11260
|
+
const venueSellQuotes = (0, import_hooks37.useVenueSellQuotes)({
|
|
10789
11261
|
venueMarketOutcomeId: scopedSelectedOutcomeId,
|
|
10790
|
-
accountId: (
|
|
11262
|
+
accountId: (_m = user == null ? void 0 : user.id) != null ? _m : null,
|
|
10791
11263
|
positionVersion: executionPositionsUpdatedAt,
|
|
10792
11264
|
requests: venueSellQuoteRequests,
|
|
10793
11265
|
mode: isPaperMode ? "paper" : void 0,
|
|
10794
11266
|
slipCapBps: 1e6,
|
|
10795
|
-
enabled: isSell && isSmartRouteEnabled && !smartRoute.isLoading && ((
|
|
11267
|
+
enabled: isSell && isSmartRouteEnabled && !smartRoute.isLoading && ((_n = smartRoute.data) == null ? void 0 : _n.venueMarketOutcomeId) === scopedSelectedOutcomeId,
|
|
10796
11268
|
refreshContext: smartRouteRefreshContext
|
|
10797
11269
|
});
|
|
10798
|
-
const currentSellableShares = (0,
|
|
11270
|
+
const currentSellableShares = (0, import_react16.useMemo)(() => {
|
|
10799
11271
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
10800
11272
|
const sharesFromQuote = (_b2 = (_a2 = smartRoute.data) == null ? void 0 : _a2.positionAvailability) == null ? void 0 : _b2.totalSellableShares;
|
|
10801
11273
|
if (typeof sharesFromQuote === "number" && Number.isFinite(sharesFromQuote)) {
|
|
@@ -10827,24 +11299,24 @@ var PlaceOrder = ({
|
|
|
10827
11299
|
isSell,
|
|
10828
11300
|
scopedSelectedMarket,
|
|
10829
11301
|
scopedSelectedOutcome,
|
|
10830
|
-
(
|
|
11302
|
+
(_p = (_o = smartRoute.data) == null ? void 0 : _o.positionAvailability) == null ? void 0 : _p.totalSellableShares
|
|
10831
11303
|
]);
|
|
10832
|
-
const maxSellableShares = (0,
|
|
11304
|
+
const maxSellableShares = (0, import_react16.useMemo)(
|
|
10833
11305
|
() => floorToDecimals(currentSellableShares, SELL_SHARE_INPUT_DECIMALS),
|
|
10834
11306
|
[currentSellableShares]
|
|
10835
11307
|
);
|
|
10836
|
-
const isCurrentSellableSharesLoading = isSell && isAuthenticated && !(typeof ((
|
|
10837
|
-
const displayedCurrentSellableShares = (0,
|
|
11308
|
+
const isCurrentSellableSharesLoading = isSell && isAuthenticated && !(typeof ((_r = (_q = smartRoute.data) == null ? void 0 : _q.positionAvailability) == null ? void 0 : _r.totalSellableShares) === "number") && (isExecutionPositionsLoading || isExecutionPositionsFetching);
|
|
11309
|
+
const displayedCurrentSellableShares = (0, import_react16.useMemo)(() => {
|
|
10838
11310
|
if (!Number.isFinite(currentSellableShares) || currentSellableShares <= 0) return 0;
|
|
10839
11311
|
return floorToDecimals(currentSellableShares, SELL_SHARE_DISPLAY_DECIMALS);
|
|
10840
11312
|
}, [currentSellableShares]);
|
|
10841
|
-
const displayedCurrentSellableSharesLabel = (0,
|
|
11313
|
+
const displayedCurrentSellableSharesLabel = (0, import_react16.useMemo)(
|
|
10842
11314
|
() => `${formatFlooredShareAmount(maxSellableShares, SELL_SHARE_DISPLAY_DECIMALS)} shares`,
|
|
10843
11315
|
[maxSellableShares]
|
|
10844
11316
|
);
|
|
10845
11317
|
const isAtMaxSellableShares = isSell && maxSellableShares > 0 && Math.abs(internalAmount - maxSellableShares) < 1e-9;
|
|
10846
|
-
const isSellAmountAboveAvailability = isSell && ((
|
|
10847
|
-
(0,
|
|
11318
|
+
const isSellAmountAboveAvailability = isSell && ((_s = smartRoute.data) == null ? void 0 : _s.venueMarketOutcomeId) === scopedSelectedOutcomeId && typeof ((_t = smartRoute.data.positionAvailability) == null ? void 0 : _t.totalSellableShares) === "number" && internalAmount > maxSellableShares;
|
|
11319
|
+
(0, import_react16.useEffect)(() => {
|
|
10848
11320
|
if (submissionProgressState != null) return;
|
|
10849
11321
|
if (!isSell || isCurrentSellableSharesLoading) return;
|
|
10850
11322
|
if (scopedSelectedOutcomeId === sellFilledForOutcomeId) return;
|
|
@@ -10860,7 +11332,7 @@ var PlaceOrder = ({
|
|
|
10860
11332
|
onAmountChange,
|
|
10861
11333
|
submissionProgressState
|
|
10862
11334
|
]);
|
|
10863
|
-
(0,
|
|
11335
|
+
(0, import_react16.useEffect)(() => {
|
|
10864
11336
|
var _a2, _b2;
|
|
10865
11337
|
if (submissionProgressState != null || !isSell) return;
|
|
10866
11338
|
if (((_a2 = smartRoute.data) == null ? void 0 : _a2.venueMarketOutcomeId) !== scopedSelectedOutcomeId) return;
|
|
@@ -10879,11 +11351,11 @@ var PlaceOrder = ({
|
|
|
10879
11351
|
isSell,
|
|
10880
11352
|
onAmountChange,
|
|
10881
11353
|
scopedSelectedOutcomeId,
|
|
10882
|
-
(
|
|
10883
|
-
(
|
|
11354
|
+
(_v = (_u = smartRoute.data) == null ? void 0 : _u.positionAvailability) == null ? void 0 : _v.totalSellableShares,
|
|
11355
|
+
(_w = smartRoute.data) == null ? void 0 : _w.venueMarketOutcomeId,
|
|
10884
11356
|
submissionProgressState
|
|
10885
11357
|
]);
|
|
10886
|
-
const routeCards = (0,
|
|
11358
|
+
const routeCards = (0, import_react16.useMemo)(() => {
|
|
10887
11359
|
const eventVenues = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.venueMarkets.map((market) => market.venue);
|
|
10888
11360
|
if (isSell) {
|
|
10889
11361
|
return buildLiveSellRouteCards({
|
|
@@ -10911,15 +11383,15 @@ var PlaceOrder = ({
|
|
|
10911
11383
|
scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.venueMarkets,
|
|
10912
11384
|
venueSellQuotes.quotes
|
|
10913
11385
|
]);
|
|
10914
|
-
const resolvedSelectedRouteCardId = (0,
|
|
11386
|
+
const resolvedSelectedRouteCardId = (0, import_react16.useMemo)(() => {
|
|
10915
11387
|
var _a2;
|
|
10916
11388
|
if (routeCards.length === 0) return null;
|
|
10917
11389
|
if (selectedRouteCardId && routeCards.some((card) => card.id === selectedRouteCardId && !card.isUnavailable)) {
|
|
10918
11390
|
return selectedRouteCardId;
|
|
10919
11391
|
}
|
|
10920
11392
|
return resolveDefaultRouteCardId(routeCards, isSell ? void 0 : (_a2 = smartRoute.data) == null ? void 0 : _a2.status);
|
|
10921
|
-
}, [routeCards, selectedRouteCardId, isSell, (
|
|
10922
|
-
(0,
|
|
11393
|
+
}, [routeCards, selectedRouteCardId, isSell, (_x = smartRoute.data) == null ? void 0 : _x.status]);
|
|
11394
|
+
(0, import_react16.useEffect)(() => {
|
|
10923
11395
|
if (routeCards.length === 0) {
|
|
10924
11396
|
setSelectedRouteCardId(null);
|
|
10925
11397
|
setIsRoutesExpanded(false);
|
|
@@ -10931,20 +11403,19 @@ var PlaceOrder = ({
|
|
|
10931
11403
|
}
|
|
10932
11404
|
}, [resolvedSelectedRouteCardId, routeCards.length, selectedRouteCardId]);
|
|
10933
11405
|
const isSubmissionLocked = submissionProgressState != null;
|
|
10934
|
-
const isSubmissionLockedRef = (0,
|
|
11406
|
+
const isSubmissionLockedRef = (0, import_react16.useRef)(isSubmissionLocked);
|
|
10935
11407
|
isSubmissionLockedRef.current = isSubmissionLocked;
|
|
10936
|
-
(0,
|
|
11408
|
+
(0, import_react16.useEffect)(() => {
|
|
10937
11409
|
if (isSubmissionLockedRef.current) return;
|
|
10938
11410
|
setSubmissionFeedback(null);
|
|
10939
11411
|
setSubmissionProgressState(null);
|
|
10940
11412
|
}, [executionType, internalAmount, internalSlippage, internalTab, scopedSelectedOutcomeId]);
|
|
10941
|
-
(0,
|
|
11413
|
+
(0, import_react16.useEffect)(() => {
|
|
10942
11414
|
if (showLimitOrders || executionType !== "limit") return;
|
|
10943
11415
|
setExecutionType("market");
|
|
10944
|
-
setIsExecutionTypeMenuOpen(false);
|
|
10945
11416
|
setIsLimitExpirationPickerOpen(false);
|
|
10946
11417
|
}, [executionType, showLimitOrders]);
|
|
10947
|
-
(0,
|
|
11418
|
+
(0, import_react16.useEffect)(() => {
|
|
10948
11419
|
if (executionType !== "limit") {
|
|
10949
11420
|
limitPriceInitializedForOutcomeRef.current = void 0;
|
|
10950
11421
|
return;
|
|
@@ -10957,32 +11428,36 @@ var PlaceOrder = ({
|
|
|
10957
11428
|
setLimitPriceInputValue(formatLimitPriceInputValue(nextLimitPrice));
|
|
10958
11429
|
setLimitPriceInputError(null);
|
|
10959
11430
|
}, [executionType, scopedSelectedOutcomeId, selectedOutcomeDisplayPrice]);
|
|
11431
|
+
(0, import_react16.useEffect)(() => {
|
|
11432
|
+
setSelectedLimitVenue(null);
|
|
11433
|
+
}, [scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.id, scopedSelectedOutcomeId]);
|
|
10960
11434
|
const orderedRouteCards = routeCards;
|
|
10961
|
-
const selectedRouteCard = (
|
|
10962
|
-
const isKalshiRoute = (0,
|
|
11435
|
+
const selectedRouteCard = (_z = (_y = orderedRouteCards.find((card) => card.id === resolvedSelectedRouteCardId)) != null ? _y : orderedRouteCards[0]) != null ? _z : null;
|
|
11436
|
+
const isKalshiRoute = (0, import_react16.useMemo)(() => {
|
|
11437
|
+
if (isLimitOrder) return (selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue) === import_sdk17.Venue.kalshi;
|
|
10963
11438
|
if (selectedRouteCard) {
|
|
10964
11439
|
return selectedRouteCard.venue === "kalshi" || selectedRouteCard.quoteData.fills.some((f) => f.venue === "kalshi");
|
|
10965
11440
|
}
|
|
10966
11441
|
return (scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) === "kalshi";
|
|
10967
|
-
}, [selectedRouteCard, scopedSelectedMarket]);
|
|
10968
|
-
const displayedBalance = isPaperMode ? paperTotalBalance : isKalshiRoute ? (
|
|
10969
|
-
const legacyKalshiAccount = (0,
|
|
11442
|
+
}, [isLimitOrder, selectedLimitVenueOption == null ? void 0 : selectedLimitVenueOption.venue, selectedRouteCard, scopedSelectedMarket]);
|
|
11443
|
+
const displayedBalance = isPaperMode ? paperTotalBalance : isKalshiRoute ? (_A = liveBalanceState.kalshiBalance) != null ? _A : 0 : liveAvailableBalance;
|
|
11444
|
+
const legacyKalshiAccount = (0, import_react16.useMemo)(
|
|
10970
11445
|
() => {
|
|
10971
11446
|
var _a2;
|
|
10972
11447
|
return (_a2 = user == null ? void 0 : user.venueAccounts) == null ? void 0 : _a2.find((venueAccount) => venueAccount.venue === "kalshi");
|
|
10973
11448
|
},
|
|
10974
11449
|
[user == null ? void 0 : user.venueAccounts]
|
|
10975
11450
|
);
|
|
10976
|
-
const isKalshiAccountActive = (
|
|
10977
|
-
const isKalshiVerified = ((
|
|
11451
|
+
const isKalshiAccountActive = (_B = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.connected) != null ? _B : (legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.status) === "active";
|
|
11452
|
+
const isKalshiVerified = ((_C = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.kycStatus) != null ? _C : legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.kycStatus) === "verified";
|
|
10978
11453
|
const hasKalshiConnectionState = kalshiKeyStatus !== void 0 || (user == null ? void 0 : user.venueAccounts) != null;
|
|
10979
|
-
const isKalshiAvailable = (0,
|
|
11454
|
+
const isKalshiAvailable = (0, import_hooks37.getVenueAvailabilityState)({
|
|
10980
11455
|
venueId: "kalshi",
|
|
10981
11456
|
disabledVenues,
|
|
10982
11457
|
isConfigLoading: isAppConfigLoading
|
|
10983
11458
|
}) === "available";
|
|
10984
11459
|
const needsKalshiConnection = isAuthenticated && hasKalshiConnectionState && isKalshiAvailable && isKalshiRoute && !isKalshiAccountActive;
|
|
10985
|
-
const handleVerifyKalshi = (0,
|
|
11460
|
+
const handleVerifyKalshi = (0, import_react16.useCallback)(
|
|
10986
11461
|
(credentials) => __async(null, null, function* () {
|
|
10987
11462
|
if (onConnectKalshi) {
|
|
10988
11463
|
yield onConnectKalshi(credentials);
|
|
@@ -11001,8 +11476,8 @@ var PlaceOrder = ({
|
|
|
11001
11476
|
[aggClient, onConnectKalshi, refetchKalshiKeyStatus]
|
|
11002
11477
|
);
|
|
11003
11478
|
const needsKycVerification = isAuthenticated && hasKalshiConnectionState && isKalshiRoute && isKalshiAccountActive && !isKalshiVerified;
|
|
11004
|
-
const verifyKalshiConnectionLabel = (
|
|
11005
|
-
const handleRouteCardSelect = (0,
|
|
11479
|
+
const verifyKalshiConnectionLabel = (_G = (_F = (_E = (_D = labels.onboarding) == null ? void 0 : _D.connectKalshiModal) == null ? void 0 : _E.actions) == null ? void 0 : _F.verifyConnection) != null ? _G : tradingLabels.kycRequired;
|
|
11480
|
+
const handleRouteCardSelect = (0, import_react16.useCallback)(
|
|
11006
11481
|
(cardId) => {
|
|
11007
11482
|
if (cardId === resolvedSelectedRouteCardId) {
|
|
11008
11483
|
const card = routeCards.find((c) => c.id === cardId);
|
|
@@ -11015,17 +11490,17 @@ var PlaceOrder = ({
|
|
|
11015
11490
|
},
|
|
11016
11491
|
[resolvedSelectedRouteCardId, routeCards]
|
|
11017
11492
|
);
|
|
11018
|
-
const executionProgress = (0,
|
|
11019
|
-
orderIds: (
|
|
11020
|
-
quoteId: (
|
|
11493
|
+
const executionProgress = (0, import_hooks37.useExecutionProgress)({
|
|
11494
|
+
orderIds: (_H = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) != null ? _H : null,
|
|
11495
|
+
quoteId: (_I = submissionProgressState == null ? void 0 : submissionProgressState.quoteId) != null ? _I : null,
|
|
11021
11496
|
mode: isPaperMode ? "paper" : void 0,
|
|
11022
|
-
enabled: ((submissionProgressState == null ? void 0 : submissionProgressState.phase) === "submitting" || (submissionProgressState == null ? void 0 : submissionProgressState.phase) === "executing") && !!((
|
|
11497
|
+
enabled: ((submissionProgressState == null ? void 0 : submissionProgressState.phase) === "submitting" || (submissionProgressState == null ? void 0 : submissionProgressState.phase) === "executing") && !!((_J = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) == null ? void 0 : _J.length)
|
|
11023
11498
|
});
|
|
11024
|
-
const selectedOutcomeLabel = (
|
|
11025
|
-
const headerImage = (
|
|
11026
|
-
const headerTitle = (
|
|
11027
|
-
const headerSubtitle = (
|
|
11028
|
-
const buildExecutionSummary = (0,
|
|
11499
|
+
const selectedOutcomeLabel = (_M = (_L = (_K = outcomes.find((outcome) => outcome.id === scopedSelectedOutcomeId)) == null ? void 0 : _K.label) != null ? _L : scopedSelectedOutcome == null ? void 0 : scopedSelectedOutcome.label) != null ? _M : "";
|
|
11500
|
+
const headerImage = (_O = (_N = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.image) != null ? _N : scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.image) != null ? _O : null;
|
|
11501
|
+
const headerTitle = (_Q = (_P = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.title) != null ? _P : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _Q : "";
|
|
11502
|
+
const headerSubtitle = (_R = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _R : "";
|
|
11503
|
+
const buildExecutionSummary = (0, import_react16.useCallback)(
|
|
11029
11504
|
(quoteData, executionVenue, orderId, partialFillSummary) => {
|
|
11030
11505
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
11031
11506
|
if (!quoteData) return void 0;
|
|
@@ -11101,7 +11576,7 @@ var PlaceOrder = ({
|
|
|
11101
11576
|
tradingLabels
|
|
11102
11577
|
]
|
|
11103
11578
|
);
|
|
11104
|
-
(0,
|
|
11579
|
+
(0, import_react16.useEffect)(() => {
|
|
11105
11580
|
if (executionProgress.phase === "order_submitted") {
|
|
11106
11581
|
const submittedOrder = executionProgress.submittedOrders[0];
|
|
11107
11582
|
setSubmissionProgressState((prev) => {
|
|
@@ -11114,7 +11589,7 @@ var PlaceOrder = ({
|
|
|
11114
11589
|
});
|
|
11115
11590
|
}
|
|
11116
11591
|
}, [executionProgress.phase, executionProgress.submittedOrders]);
|
|
11117
|
-
(0,
|
|
11592
|
+
(0, import_react16.useEffect)(() => {
|
|
11118
11593
|
var _a2, _b2;
|
|
11119
11594
|
const dp = executionProgress.dagProgress;
|
|
11120
11595
|
if (!dp) return;
|
|
@@ -11165,7 +11640,7 @@ var PlaceOrder = ({
|
|
|
11165
11640
|
return __spreadProps(__spreadValues({}, prev), { dagProgress: dp });
|
|
11166
11641
|
});
|
|
11167
11642
|
}, [executionProgress.dagProgress, tradingLabels]);
|
|
11168
|
-
(0,
|
|
11643
|
+
(0, import_react16.useEffect)(() => {
|
|
11169
11644
|
const orderIds = submissionProgressState == null ? void 0 : submissionProgressState.orderIds;
|
|
11170
11645
|
if (!(orderIds == null ? void 0 : orderIds.length)) return;
|
|
11171
11646
|
const aggregateStatus = deriveAggregateOrderStatus(
|
|
@@ -11226,7 +11701,7 @@ var PlaceOrder = ({
|
|
|
11226
11701
|
tradingLabels
|
|
11227
11702
|
]);
|
|
11228
11703
|
const estDurationMs = (selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData) && typeof selectedRouteCard.quoteData.estDurationMs === "number" ? selectedRouteCard.quoteData.estDurationMs : 6e4;
|
|
11229
|
-
(0,
|
|
11704
|
+
(0, import_react16.useEffect)(() => {
|
|
11230
11705
|
const phase = submissionProgressState == null ? void 0 : submissionProgressState.phase;
|
|
11231
11706
|
if (phase !== "submitting" && phase !== "executing") return;
|
|
11232
11707
|
const timeoutMs = Math.max(6e4, 2 * estDurationMs);
|
|
@@ -11241,7 +11716,7 @@ var PlaceOrder = ({
|
|
|
11241
11716
|
}, timeoutMs);
|
|
11242
11717
|
return () => clearTimeout(id);
|
|
11243
11718
|
}, [submissionProgressState == null ? void 0 : submissionProgressState.phase, estDurationMs]);
|
|
11244
|
-
const emitTerminalOrderNotifications = (0,
|
|
11719
|
+
const emitTerminalOrderNotifications = (0, import_react16.useCallback)(() => {
|
|
11245
11720
|
const toast = toastCtx == null ? void 0 : toastCtx.toast;
|
|
11246
11721
|
if (!toast) return;
|
|
11247
11722
|
for (const event of executionProgress.terminalOrderEvents) {
|
|
@@ -11270,7 +11745,7 @@ var PlaceOrder = ({
|
|
|
11270
11745
|
});
|
|
11271
11746
|
}
|
|
11272
11747
|
}, [executionProgress.terminalOrderEvents, labels, toastCtx]);
|
|
11273
|
-
(0,
|
|
11748
|
+
(0, import_react16.useEffect)(() => {
|
|
11274
11749
|
var _a2, _b2;
|
|
11275
11750
|
if (!submissionProgressState) return;
|
|
11276
11751
|
onExecutionStateChange == null ? void 0 : onExecutionStateChange(submissionProgressState);
|
|
@@ -11290,8 +11765,8 @@ var PlaceOrder = ({
|
|
|
11290
11765
|
}
|
|
11291
11766
|
if (submissionProgressState.phase === "success" && submissionProgressState.summary) {
|
|
11292
11767
|
emitTerminalOrderNotifications();
|
|
11293
|
-
(0,
|
|
11294
|
-
(0,
|
|
11768
|
+
(0, import_hooks37.invalidateBalanceQueries)(queryClient);
|
|
11769
|
+
(0, import_hooks37.invalidatePositionQueries)(queryClient);
|
|
11295
11770
|
if (debugStore && debugAttemptId) {
|
|
11296
11771
|
debugStore.updateAttempt(debugAttemptId, {
|
|
11297
11772
|
status: "succeeded",
|
|
@@ -11322,19 +11797,19 @@ var PlaceOrder = ({
|
|
|
11322
11797
|
queryClient,
|
|
11323
11798
|
submissionProgressState
|
|
11324
11799
|
]);
|
|
11325
|
-
const activeQuoteData = (
|
|
11326
|
-
const
|
|
11800
|
+
const activeQuoteData = isLimitOrder ? null : (_T = (_S = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData) != null ? _S : smartRoute.data) != null ? _T : null;
|
|
11801
|
+
const visibleMarketRouteCards = orderedRouteCards.length > PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT && !isRoutesExpanded ? orderedRouteCards.slice(0, PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT) : orderedRouteCards;
|
|
11327
11802
|
const hasEnteredAmount = internalAmount > 0;
|
|
11328
11803
|
const isQuoteLoading = !isLimitOrder && hasEnteredAmount && (smartRoute.isFetching || smartRoute.isLoading || isSell && (venueSellQuotes.isFetching || venueSellQuotes.isLoading));
|
|
11329
11804
|
const routeLoadingMessage = isQuoteLoading ? smartRoute.loadingReason === "updating-route" ? tradingLabels.updatingRoute : smartRoute.loadingReason === "refreshing-quotes" ? tradingLabels.refreshingQuotes : tradingLabels.findingBestOdds : null;
|
|
11330
|
-
const selectedRouteFills = (
|
|
11805
|
+
const selectedRouteFills = (_U = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData.fills) != null ? _U : [];
|
|
11331
11806
|
const isKalshiOnlyRoute = isKalshiRoute && ((selectedRouteCard == null ? void 0 : selectedRouteCard.venue) === import_sdk17.Venue.kalshi || selectedRouteFills.length > 0 && selectedRouteFills.every((fill) => fill.venue === import_sdk17.Venue.kalshi));
|
|
11332
11807
|
const isOnchainOnlyRoute = !isKalshiRoute || selectedRouteFills.length > 0 && selectedRouteFills.every((fill) => fill.venue !== import_sdk17.Venue.kalshi);
|
|
11333
11808
|
const kalshiRequiredAmount = isSell ? 0 : selectedRouteFills.filter((fill) => fill.venue === import_sdk17.Venue.kalshi).reduce((total, fill) => total + fill.venueQty * fill.avgPrice, 0);
|
|
11334
11809
|
const onchainRequiredAmount = isSell ? 0 : selectedRouteFills.filter((fill) => fill.venue !== import_sdk17.Venue.kalshi).reduce((total, fill) => total + fill.venueQty * fill.avgPrice, 0);
|
|
11335
11810
|
const resolvedKalshiRequiredAmount = isKalshiOnlyRoute || isKalshiRoute && selectedRouteFills.length === 0 ? internalAmount : kalshiRequiredAmount;
|
|
11336
11811
|
const resolvedOnchainRequiredAmount = isOnchainOnlyRoute || !isKalshiRoute && selectedRouteFills.length === 0 ? internalAmount : onchainRequiredAmount;
|
|
11337
|
-
const isKalshiBalanceInsufficient = !isPaperMode && isKalshiRoute && resolvedKalshiRequiredAmount > ((
|
|
11812
|
+
const isKalshiBalanceInsufficient = !isPaperMode && isKalshiRoute && resolvedKalshiRequiredAmount > ((_V = liveBalanceState.kalshiBalance) != null ? _V : 0);
|
|
11338
11813
|
const isOnchainBalanceInsufficient = resolvedOnchainRequiredAmount > liveAvailableBalance;
|
|
11339
11814
|
const isInsufficientBalance = !isSell && isAuthenticated && hasEnteredAmount && !isBalanceLoading && (isLimitOrder ? internalAmount > totalBalance : isPaperMode ? internalAmount > paperTotalBalance : isKalshiBalanceInsufficient || isOnchainBalanceInsufficient);
|
|
11340
11815
|
const isQuoteInsufficientBalance = !isLimitOrder && (activeQuoteData == null ? void 0 : activeQuoteData.status) === "insufficient_balance";
|
|
@@ -11343,7 +11818,7 @@ var PlaceOrder = ({
|
|
|
11343
11818
|
const isBelowVenueMinimumFromQuote = isQuoteBelowVenueMinimum(activeQuoteData);
|
|
11344
11819
|
const isBelowMinimum = isBelowClientMinimum || isBelowVenueMinimumFromQuote;
|
|
11345
11820
|
const belowMinimumMessage = isBelowClientMinimum ? tradingLabels.minimumOrderAmount(MIN_BUY_ORDER_AMOUNT) : tradingLabels.minOrderSizeViolated;
|
|
11346
|
-
const quoteStatus = (0,
|
|
11821
|
+
const quoteStatus = (0, import_react16.useMemo)(() => {
|
|
11347
11822
|
if (!orderEligibility.canPlaceOrder) return void 0;
|
|
11348
11823
|
return resolvePlaceOrderQuoteStatus({
|
|
11349
11824
|
amount: internalAmount,
|
|
@@ -11358,7 +11833,7 @@ var PlaceOrder = ({
|
|
|
11358
11833
|
scopedSelectedMarket,
|
|
11359
11834
|
tradingLabels
|
|
11360
11835
|
]);
|
|
11361
|
-
const smartRouteErrorMessage = (0,
|
|
11836
|
+
const smartRouteErrorMessage = (0, import_react16.useMemo)(() => {
|
|
11362
11837
|
var _a2;
|
|
11363
11838
|
const quoteError = (_a2 = smartRoute.error) != null ? _a2 : isSell ? venueSellQuotes.error : null;
|
|
11364
11839
|
if (!quoteError || orderedRouteCards.length > 0) return null;
|
|
@@ -11369,7 +11844,7 @@ var PlaceOrder = ({
|
|
|
11369
11844
|
});
|
|
11370
11845
|
}, [isSell, orderedRouteCards.length, smartRoute.error, tradingLabels, venueSellQuotes.error]);
|
|
11371
11846
|
const progressActionLabel = (internalTab === "buy" ? tradingLabels.buyingOutcome(selectedOutcomeLabel) : tradingLabels.sellingOutcome(selectedOutcomeLabel)).trim();
|
|
11372
|
-
const canRetryRemaining = (0,
|
|
11847
|
+
const canRetryRemaining = (0, import_react16.useMemo)(() => {
|
|
11373
11848
|
const remaining = getPlaceOrderUnfilledRemaining({
|
|
11374
11849
|
originalAmount: internalAmount,
|
|
11375
11850
|
tradeSide: internalTab,
|
|
@@ -11379,7 +11854,7 @@ var PlaceOrder = ({
|
|
|
11379
11854
|
return remaining >= minRemainder;
|
|
11380
11855
|
}, [executionProgress.terminalOrderEvents, internalAmount, internalTab, isSell]);
|
|
11381
11856
|
const PARTIAL_FILL_AUTO_SUCCESS_THRESHOLD = 0.95;
|
|
11382
|
-
const shouldAutoSkipPartialFill = (0,
|
|
11857
|
+
const shouldAutoSkipPartialFill = (0, import_react16.useMemo)(() => {
|
|
11383
11858
|
if (internalAmount <= 0) return false;
|
|
11384
11859
|
const remaining = getPlaceOrderUnfilledRemaining({
|
|
11385
11860
|
originalAmount: internalAmount,
|
|
@@ -11390,7 +11865,7 @@ var PlaceOrder = ({
|
|
|
11390
11865
|
const fillRatio = filled / internalAmount;
|
|
11391
11866
|
return fillRatio >= PARTIAL_FILL_AUTO_SUCCESS_THRESHOLD || !canRetryRemaining;
|
|
11392
11867
|
}, [canRetryRemaining, executionProgress.terminalOrderEvents, internalAmount, internalTab]);
|
|
11393
|
-
const failureSummary = (0,
|
|
11868
|
+
const failureSummary = (0, import_react16.useMemo)(() => {
|
|
11394
11869
|
var _a2;
|
|
11395
11870
|
if ((submissionProgressState == null ? void 0 : submissionProgressState.phase) !== "failed") return void 0;
|
|
11396
11871
|
return buildPlaceOrderFailureSummary({
|
|
@@ -11419,7 +11894,7 @@ var PlaceOrder = ({
|
|
|
11419
11894
|
submissionProgressState,
|
|
11420
11895
|
tradingLabels
|
|
11421
11896
|
]);
|
|
11422
|
-
const displayedToWinHint = (0,
|
|
11897
|
+
const displayedToWinHint = (0, import_react16.useMemo)(() => {
|
|
11423
11898
|
var _a2, _b2, _c2, _d2;
|
|
11424
11899
|
if (!selectedRouteCard) return "";
|
|
11425
11900
|
if (selectedRouteCard.isUnavailable) {
|
|
@@ -11428,9 +11903,9 @@ var PlaceOrder = ({
|
|
|
11428
11903
|
}
|
|
11429
11904
|
return (_d2 = selectedRouteCard.hint) != null ? _d2 : "";
|
|
11430
11905
|
}, [selectedRouteCard, tradingLabels]);
|
|
11431
|
-
const displayedToWinValue = (
|
|
11432
|
-
const limitOrderPayload = (0,
|
|
11433
|
-
if (!
|
|
11906
|
+
const displayedToWinValue = (_W = selectedRouteCard == null ? void 0 : selectedRouteCard.numericValue) != null ? _W : 0;
|
|
11907
|
+
const limitOrderPayload = (0, import_react16.useMemo)(() => {
|
|
11908
|
+
if (!selectedLimitVenueOption || internalAmount <= 0) return null;
|
|
11434
11909
|
if (limitPriceInputError) return null;
|
|
11435
11910
|
const expirationDate = resolveLimitExpirationDate({
|
|
11436
11911
|
expirationType: limitExpirationType,
|
|
@@ -11446,8 +11921,8 @@ var PlaceOrder = ({
|
|
|
11446
11921
|
});
|
|
11447
11922
|
const expiresAt = expirationDate ? serializeLimitOrderExpiration(expirationDate) : void 0;
|
|
11448
11923
|
return __spreadValues({
|
|
11449
|
-
venue:
|
|
11450
|
-
venueMarketOutcomeId:
|
|
11924
|
+
venue: selectedLimitVenueOption.venue,
|
|
11925
|
+
venueMarketOutcomeId: selectedLimitVenueOption.venueMarketOutcomeId,
|
|
11451
11926
|
side: internalTab,
|
|
11452
11927
|
limitPriceRaw,
|
|
11453
11928
|
sizeRaw,
|
|
@@ -11461,10 +11936,9 @@ var PlaceOrder = ({
|
|
|
11461
11936
|
limitExpirationType,
|
|
11462
11937
|
limitPrice,
|
|
11463
11938
|
limitPriceInputError,
|
|
11464
|
-
|
|
11465
|
-
scopedSelectedOutcomeId
|
|
11939
|
+
selectedLimitVenueOption
|
|
11466
11940
|
]);
|
|
11467
|
-
const resolvedLimitExpirationDraftDate = (0,
|
|
11941
|
+
const resolvedLimitExpirationDraftDate = (0, import_react16.useMemo)(() => {
|
|
11468
11942
|
return resolveLimitExpirationDate({
|
|
11469
11943
|
expirationType: "CUSTOM",
|
|
11470
11944
|
customDate: limitExpirationDraftDate,
|
|
@@ -11472,7 +11946,7 @@ var PlaceOrder = ({
|
|
|
11472
11946
|
});
|
|
11473
11947
|
}, [limitExpirationDraftDate, limitExpirationDraftTime]);
|
|
11474
11948
|
const isLimitExpirationDraftValid = isFutureLimitExpiration(resolvedLimitExpirationDraftDate);
|
|
11475
|
-
const resolvedCustomExpirationDate = (0,
|
|
11949
|
+
const resolvedCustomExpirationDate = (0, import_react16.useMemo)(() => {
|
|
11476
11950
|
return resolveLimitExpirationDate({
|
|
11477
11951
|
expirationType: "CUSTOM",
|
|
11478
11952
|
customDate: limitExpirationDate,
|
|
@@ -11494,7 +11968,7 @@ var PlaceOrder = ({
|
|
|
11494
11968
|
expiresAt: serializeLimitOrderExpiration(expirationDate)
|
|
11495
11969
|
});
|
|
11496
11970
|
};
|
|
11497
|
-
const displayedLimitToWinValue = (0,
|
|
11971
|
+
const displayedLimitToWinValue = (0, import_react16.useMemo)(() => {
|
|
11498
11972
|
if (!limitOrderPayload) return 0;
|
|
11499
11973
|
const size = Number(BigInt(limitOrderPayload.sizeRaw)) / Number(LIMIT_ORDER_RAW_SCALE);
|
|
11500
11974
|
if (internalTab === "buy") return size;
|
|
@@ -11505,14 +11979,73 @@ var PlaceOrder = ({
|
|
|
11505
11979
|
)
|
|
11506
11980
|
) / Number(LIMIT_ORDER_RAW_SCALE);
|
|
11507
11981
|
}, [internalTab, limitOrderPayload]);
|
|
11982
|
+
const limitRouteCards = (0, import_react16.useMemo)(() => {
|
|
11983
|
+
return visibleLimitVenueOptions.map((option) => {
|
|
11984
|
+
var _a2, _b2;
|
|
11985
|
+
const availabilityState = (0, import_hooks37.getVenueAvailabilityState)({
|
|
11986
|
+
venueId: option.venue,
|
|
11987
|
+
disabledVenues,
|
|
11988
|
+
isConfigLoading: isAppConfigLoading
|
|
11989
|
+
});
|
|
11990
|
+
const isGeoBlocked = geoBlockedLimitVenues.has(option.venue);
|
|
11991
|
+
const isUnavailable = isTradingBlocked || isGeoBlocked || availabilityState !== "available";
|
|
11992
|
+
const currentPriceLabel = option.currentPrice == null ? "\u2014" : formatProbabilityCents(option.currentPrice, formatPrice);
|
|
11993
|
+
const totalFees = getSmartRouteTotalFees(
|
|
11994
|
+
(_b2 = (_a2 = limitVenueQuoteByVenue.get(option.venue)) == null ? void 0 : _a2.data) == null ? void 0 : _b2.feeBreakdown
|
|
11995
|
+
);
|
|
11996
|
+
const feeLabel = totalFees == null ? void 0 : formatUsd(totalFees, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
11997
|
+
return {
|
|
11998
|
+
id: `limit-venue-${option.venue}-${option.venueMarketOutcomeId}`,
|
|
11999
|
+
hint: isGeoBlocked ? tradingLabels.venueUnavailableInRegion : tradingLabels.limitRoutingCurrentPrice(currentPriceLabel, feeLabel),
|
|
12000
|
+
isUnavailable,
|
|
12001
|
+
kind: "venue",
|
|
12002
|
+
label: getTradingVenueLabel(option.venue),
|
|
12003
|
+
numericValue: displayedLimitToWinValue,
|
|
12004
|
+
value: formatUsd(displayedLimitToWinValue, {
|
|
12005
|
+
maximumFractionDigits: 2,
|
|
12006
|
+
minimumFractionDigits: 2
|
|
12007
|
+
}),
|
|
12008
|
+
venue: option.venue
|
|
12009
|
+
};
|
|
12010
|
+
});
|
|
12011
|
+
}, [
|
|
12012
|
+
disabledVenues,
|
|
12013
|
+
displayedLimitToWinValue,
|
|
12014
|
+
formatPrice,
|
|
12015
|
+
geoBlockedLimitVenues,
|
|
12016
|
+
isAppConfigLoading,
|
|
12017
|
+
isTradingBlocked,
|
|
12018
|
+
limitVenueQuoteByVenue,
|
|
12019
|
+
tradingLabels,
|
|
12020
|
+
visibleLimitVenueOptions
|
|
12021
|
+
]);
|
|
12022
|
+
const limitVenueOptionByCardId = (0, import_react16.useMemo)(() => {
|
|
12023
|
+
return new Map(
|
|
12024
|
+
visibleLimitVenueOptions.map((option) => [
|
|
12025
|
+
`limit-venue-${option.venue}-${option.venueMarketOutcomeId}`,
|
|
12026
|
+
option
|
|
12027
|
+
])
|
|
12028
|
+
);
|
|
12029
|
+
}, [visibleLimitVenueOptions]);
|
|
12030
|
+
const activeRouteCards = isLimitOrder ? limitRouteCards : visibleMarketRouteCards;
|
|
12031
|
+
const activeRouteCardCount = isLimitOrder ? limitRouteCards.length : orderedRouteCards.length;
|
|
12032
|
+
const handleActiveRouteCardSelect = (cardId) => {
|
|
12033
|
+
if (!isLimitOrder) {
|
|
12034
|
+
handleRouteCardSelect(cardId);
|
|
12035
|
+
return;
|
|
12036
|
+
}
|
|
12037
|
+
const option = limitVenueOptionByCardId.get(cardId);
|
|
12038
|
+
if (!option) return;
|
|
12039
|
+
setSelectedLimitVenue(option.venue);
|
|
12040
|
+
};
|
|
11508
12041
|
const displayedLimitToWinHint = formatLimitPriceLabel(limitPrice);
|
|
11509
12042
|
const activeFeeBreakdown = activeQuoteData == null ? void 0 : activeQuoteData.feeBreakdown;
|
|
11510
|
-
const estimatedFeesValue = (0,
|
|
11511
|
-
|
|
11512
|
-
|
|
12043
|
+
const estimatedFeesValue = (0, import_react16.useMemo)(() => {
|
|
12044
|
+
const totalFees = getSmartRouteTotalFees(activeFeeBreakdown);
|
|
12045
|
+
if (totalFees == null) return null;
|
|
11513
12046
|
return formatUsd(totalFees, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
11514
12047
|
}, [activeFeeBreakdown]);
|
|
11515
|
-
const feeBreakdownRows = (0,
|
|
12048
|
+
const feeBreakdownRows = (0, import_react16.useMemo)(() => {
|
|
11516
12049
|
if (!activeFeeBreakdown) return [];
|
|
11517
12050
|
return [
|
|
11518
12051
|
{
|
|
@@ -11547,27 +12080,29 @@ var PlaceOrder = ({
|
|
|
11547
12080
|
];
|
|
11548
12081
|
}, [activeFeeBreakdown, tradingLabels]);
|
|
11549
12082
|
const isActionLoading = isPrimaryActionLoading || executeManaged.isPending || placeLimitOrder.isPending || isBeforeActionPending;
|
|
11550
|
-
const
|
|
11551
|
-
const
|
|
12083
|
+
const selectedLimitRouteCardId = selectedLimitVenueOption ? `limit-venue-${selectedLimitVenueOption.venue}-${selectedLimitVenueOption.venueMarketOutcomeId}` : null;
|
|
12084
|
+
const selectedLimitRouteCard = selectedLimitRouteCardId ? (_X = limitRouteCards.find((card) => card.id === selectedLimitRouteCardId)) != null ? _X : null : null;
|
|
12085
|
+
const selectedRouteGeoBlocked = isLimitOrder ? (_Y = selectedLimitRouteCard == null ? void 0 : selectedLimitRouteCard.isUnavailable) != null ? _Y : false : (_Z = selectedRouteCard == null ? void 0 : selectedRouteCard.isUnavailable) != null ? _Z : false;
|
|
12086
|
+
const geoBlockedVenuesFromWarnings = (0, import_react16.useMemo)(
|
|
11552
12087
|
() => {
|
|
11553
12088
|
var _a2;
|
|
11554
12089
|
return extractGeoBlockedVenues((_a2 = smartRoute.data) == null ? void 0 : _a2.warnings);
|
|
11555
12090
|
},
|
|
11556
|
-
[(
|
|
12091
|
+
[(__ = smartRoute.data) == null ? void 0 : __.warnings]
|
|
11557
12092
|
);
|
|
11558
|
-
const isPrimaryVenueGeoBlocked = (0,
|
|
12093
|
+
const isPrimaryVenueGeoBlocked = (0, import_react16.useMemo)(() => {
|
|
11559
12094
|
var _a2, _b2;
|
|
11560
12095
|
if (!selectedRouteCard || selectedRouteCard.isUnavailable) return false;
|
|
11561
12096
|
const fills = (_b2 = (_a2 = selectedRouteCard.quoteData) == null ? void 0 : _a2.fills) != null ? _b2 : [];
|
|
11562
12097
|
return fills.length > 0 && fills.every((f) => geoBlockedVenuesFromWarnings.has(f.venue));
|
|
11563
12098
|
}, [selectedRouteCard, geoBlockedVenuesFromWarnings]);
|
|
11564
|
-
const shouldShowGeoBlockBanner = isTradingBlocked || selectedRouteGeoBlocked || isPrimaryVenueGeoBlocked;
|
|
12099
|
+
const shouldShowGeoBlockBanner = isTradingBlocked || selectedRouteGeoBlocked || isPrimaryVenueGeoBlocked || isLimitOrder && limitRouteCards.length > 0 && limitRouteCards.every((card) => card.isUnavailable);
|
|
11565
12100
|
const shouldShowLowLiquidityWarning = !isQuoteInputEditing && !isQuoteLoading && (activeQuoteData == null ? void 0 : activeQuoteData.venueMarketOutcomeId) === scopedSelectedOutcomeId && hasLowLiquidityWarning(activeQuoteData.warnings);
|
|
11566
12101
|
const actionLabel = `${internalTab === "buy" ? tradingLabels.buy : tradingLabels.sell} ${selectedOutcomeLabel}`.trim();
|
|
11567
12102
|
const isActionDisabled = isPrimaryActionDisabled || !orderEligibility.canPlaceOrder || isActionLoading || !hasEnteredAmount || !scopedSelectedMarket || isInsufficientBalance || isQuoteInsufficientBalance || isSell && isQuoteInputEditing || isSellAmountAboveAvailability || isBelowMinimum || !isLimitOrder && isQuoteLoading || (isLimitOrder ? !limitOrderPayload : !selectedRouteCard || !selectedRouteCard.quoteData.quoteId) || selectedRouteGeoBlocked || !isAuthenticated || !isLimitOrder && quoteStatus !== void 0;
|
|
11568
|
-
const shouldShowSmartRouting =
|
|
11569
|
-
const shouldShowRouteToggle = !isQuoteLoading && orderedRouteCards.length > PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT;
|
|
11570
|
-
const handleReturnToOrderForm = (0,
|
|
12103
|
+
const shouldShowSmartRouting = orderEligibility.canPlaceOrder && hasEnteredAmount && !isBelowMinimum && (isLimitOrder ? limitRouteCards.length > 0 : orderedRouteCards.length > 0 || smartRoute.isFetching || smartRoute.isLoading || isSell && (venueSellQuotes.isFetching || venueSellQuotes.isLoading));
|
|
12104
|
+
const shouldShowRouteToggle = !isLimitOrder && !isQuoteLoading && orderedRouteCards.length > PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT;
|
|
12105
|
+
const handleReturnToOrderForm = (0, import_react16.useCallback)(() => {
|
|
11571
12106
|
const submittedSelection = submittedSelectionRef.current;
|
|
11572
12107
|
submittedSelectionRef.current = null;
|
|
11573
12108
|
setSubmissionProgressState(null);
|
|
@@ -11588,7 +12123,7 @@ var PlaceOrder = ({
|
|
|
11588
12123
|
const shareUrl = `https://twitter.com/intent/tweet?text=${encodeURIComponent(shareText)}`;
|
|
11589
12124
|
window.open(shareUrl, "_blank", "noopener,noreferrer");
|
|
11590
12125
|
};
|
|
11591
|
-
const handleExecuteQuote = (0,
|
|
12126
|
+
const handleExecuteQuote = (0, import_react16.useCallback)(
|
|
11592
12127
|
(quoteData) => __async(null, null, function* () {
|
|
11593
12128
|
var _a2, _b2, _c2;
|
|
11594
12129
|
const quoteId = quoteData == null ? void 0 : quoteData.quoteId;
|
|
@@ -11698,7 +12233,7 @@ var PlaceOrder = ({
|
|
|
11698
12233
|
venueSellQuotes.quotes
|
|
11699
12234
|
]
|
|
11700
12235
|
);
|
|
11701
|
-
const handlePlaceLimitOrder = (0,
|
|
12236
|
+
const handlePlaceLimitOrder = (0, import_react16.useCallback)(
|
|
11702
12237
|
(submissionLimitOrderPayload) => __async(null, null, function* () {
|
|
11703
12238
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
11704
12239
|
if (!showLimitOrders) return;
|
|
@@ -11782,7 +12317,7 @@ var PlaceOrder = ({
|
|
|
11782
12317
|
tradingLabels
|
|
11783
12318
|
]
|
|
11784
12319
|
);
|
|
11785
|
-
const handleSkipToSuccess = (0,
|
|
12320
|
+
const handleSkipToSuccess = (0, import_react16.useCallback)(() => {
|
|
11786
12321
|
const primaryFilledEvent = executionProgress.terminalOrderEvents.find(
|
|
11787
12322
|
(e) => e.event === "filled" || e.event === "partial_fill"
|
|
11788
12323
|
);
|
|
@@ -11807,7 +12342,7 @@ var PlaceOrder = ({
|
|
|
11807
12342
|
failureSummary,
|
|
11808
12343
|
selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData
|
|
11809
12344
|
]);
|
|
11810
|
-
(0,
|
|
12345
|
+
(0, import_react16.useEffect)(() => {
|
|
11811
12346
|
if ((submissionProgressState == null ? void 0 : submissionProgressState.phase) !== "failed") return;
|
|
11812
12347
|
if ((failureSummary == null ? void 0 : failureSummary.kind) !== "partial_fill") return;
|
|
11813
12348
|
if (!shouldAutoSkipPartialFill) return;
|
|
@@ -11818,7 +12353,7 @@ var PlaceOrder = ({
|
|
|
11818
12353
|
shouldAutoSkipPartialFill,
|
|
11819
12354
|
submissionProgressState == null ? void 0 : submissionProgressState.phase
|
|
11820
12355
|
]);
|
|
11821
|
-
const handleRetrySubmission = (0,
|
|
12356
|
+
const handleRetrySubmission = (0, import_react16.useCallback)(() => __async(null, null, function* () {
|
|
11822
12357
|
var _a2, _b2, _c2, _d2, _e2;
|
|
11823
12358
|
if (!orderEligibility.canPlaceOrder || (failureSummary == null ? void 0 : failureSummary.kind) === "generic") {
|
|
11824
12359
|
handleReturnToOrderForm();
|
|
@@ -11967,7 +12502,7 @@ var PlaceOrder = ({
|
|
|
11967
12502
|
]);
|
|
11968
12503
|
const resolvedStatusClassName = cn(classNames == null ? void 0 : classNames.root, className);
|
|
11969
12504
|
if (isLoading) {
|
|
11970
|
-
return /* @__PURE__ */ (0,
|
|
12505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
11971
12506
|
Skeleton,
|
|
11972
12507
|
{
|
|
11973
12508
|
ariaLabel: labels.common.loading,
|
|
@@ -11978,7 +12513,7 @@ var PlaceOrder = ({
|
|
|
11978
12513
|
}
|
|
11979
12514
|
if (submissionProgressState) {
|
|
11980
12515
|
if (submissionProgressState.phase === "success" && submissionProgressState.summary) {
|
|
11981
|
-
return /* @__PURE__ */ (0,
|
|
12516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
11982
12517
|
PlaceOrderSuccessView,
|
|
11983
12518
|
{
|
|
11984
12519
|
className: resolvedStatusClassName,
|
|
@@ -11990,7 +12525,7 @@ var PlaceOrder = ({
|
|
|
11990
12525
|
);
|
|
11991
12526
|
}
|
|
11992
12527
|
if (submissionProgressState.phase === "failed") {
|
|
11993
|
-
return /* @__PURE__ */ (0,
|
|
12528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
11994
12529
|
PlaceOrderFailureView,
|
|
11995
12530
|
{
|
|
11996
12531
|
className: resolvedStatusClassName,
|
|
@@ -12207,11 +12742,11 @@ var PlaceOrder = ({
|
|
|
12207
12742
|
}
|
|
12208
12743
|
});
|
|
12209
12744
|
if (isEndedWithoutKnownWinner || !orderEligibility.canPlaceOrder && resolvedReadOnlyTradingState.kind !== "open") {
|
|
12210
|
-
return /* @__PURE__ */ (0,
|
|
12745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12211
12746
|
PlaceOrderResolvedView,
|
|
12212
12747
|
{
|
|
12213
12748
|
tradingState: resolvedReadOnlyTradingState,
|
|
12214
|
-
resolutionTimestamp: (
|
|
12749
|
+
resolutionTimestamp: (_$ = resolvedEventTradingState.resolvesAt) != null ? _$ : resolvedReadOnlyTradingState.resolvesAt,
|
|
12215
12750
|
resolvedClaim,
|
|
12216
12751
|
classNames,
|
|
12217
12752
|
className,
|
|
@@ -12219,8 +12754,8 @@ var PlaceOrder = ({
|
|
|
12219
12754
|
}
|
|
12220
12755
|
);
|
|
12221
12756
|
}
|
|
12222
|
-
return /* @__PURE__ */ (0,
|
|
12223
|
-
/* @__PURE__ */ (0,
|
|
12757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_react16.Fragment, { children: [
|
|
12758
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
12224
12759
|
Card,
|
|
12225
12760
|
{
|
|
12226
12761
|
className: cn(
|
|
@@ -12237,20 +12772,20 @@ var PlaceOrder = ({
|
|
|
12237
12772
|
headerTitle,
|
|
12238
12773
|
onClose
|
|
12239
12774
|
}),
|
|
12240
|
-
/* @__PURE__ */ (0,
|
|
12241
|
-
/* @__PURE__ */ (0,
|
|
12775
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: cn("agg-order-panel-content flex flex-col gap-6", classNames == null ? void 0 : classNames.content), children: [
|
|
12776
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
12242
12777
|
"div",
|
|
12243
12778
|
{
|
|
12244
12779
|
className: "agg-order-tabs flex items-end border-b border-agg-separator",
|
|
12245
12780
|
role: "tablist",
|
|
12246
12781
|
"aria-label": labels.common.tabsAria,
|
|
12247
12782
|
children: [
|
|
12248
|
-
/* @__PURE__ */ (0,
|
|
12783
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "flex min-w-0 flex-1 items-end", children: [
|
|
12249
12784
|
{ value: "buy", label: tradingLabels.buy, ref: buyTabRef },
|
|
12250
12785
|
{ value: "sell", label: tradingLabels.sell, ref: sellTabRef }
|
|
12251
12786
|
].map((tabItem) => {
|
|
12252
12787
|
const isActive = internalTab === tabItem.value;
|
|
12253
|
-
return /* @__PURE__ */ (0,
|
|
12788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
12254
12789
|
"button",
|
|
12255
12790
|
{
|
|
12256
12791
|
ref: tabItem.ref,
|
|
@@ -12274,7 +12809,7 @@ var PlaceOrder = ({
|
|
|
12274
12809
|
onKeyDown: (event) => handleTabKeyDown(event, tabItem.value),
|
|
12275
12810
|
children: [
|
|
12276
12811
|
tabItem.label,
|
|
12277
|
-
/* @__PURE__ */ (0,
|
|
12812
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12278
12813
|
"span",
|
|
12279
12814
|
{
|
|
12280
12815
|
"aria-hidden": "true",
|
|
@@ -12294,274 +12829,241 @@ var PlaceOrder = ({
|
|
|
12294
12829
|
tabItem.value
|
|
12295
12830
|
);
|
|
12296
12831
|
}) }),
|
|
12297
|
-
showLimitOrders ? /* @__PURE__ */ (0,
|
|
12298
|
-
|
|
12832
|
+
showLimitOrders ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12833
|
+
Select,
|
|
12299
12834
|
{
|
|
12300
|
-
|
|
12301
|
-
|
|
12302
|
-
|
|
12303
|
-
|
|
12304
|
-
|
|
12305
|
-
|
|
12306
|
-
|
|
12307
|
-
|
|
12308
|
-
|
|
12309
|
-
|
|
12310
|
-
|
|
12311
|
-
|
|
12312
|
-
|
|
12313
|
-
children: [
|
|
12314
|
-
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("span", { children: isLimitOrder ? tradingLabels.orderTypeLimit : tradingLabels.orderTypeMarket }),
|
|
12315
|
-
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Icon, { name: "chevron-down", size: "small", className: "h-4 w-4", "aria-hidden": true })
|
|
12316
|
-
]
|
|
12317
|
-
}
|
|
12318
|
-
) }),
|
|
12319
|
-
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12320
|
-
DropdownMenu.Portal,
|
|
12321
|
-
{
|
|
12322
|
-
container: resolvePlaceOrderPortalContainer(executionTypeTriggerRef.current),
|
|
12323
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12324
|
-
DropdownMenu.Content,
|
|
12325
|
-
{
|
|
12326
|
-
align: "end",
|
|
12327
|
-
sideOffset: 8,
|
|
12328
|
-
className: "z-50 min-w-[140px] rounded-agg-lg border border-agg-separator bg-agg-secondary p-1 shadow-[0_8px_16px_rgba(0,0,0,0.12)]",
|
|
12329
|
-
children: [
|
|
12330
|
-
{ value: "market", label: tradingLabels.orderTypeMarket },
|
|
12331
|
-
{ value: "limit", label: tradingLabels.orderTypeLimit }
|
|
12332
|
-
].map((item) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12333
|
-
DropdownMenu.Item,
|
|
12334
|
-
{
|
|
12335
|
-
className: cn(
|
|
12336
|
-
"cursor-pointer rounded-agg-sm px-3 py-2 text-agg-sm leading-agg-5 text-agg-foreground outline-none hover:bg-agg-secondary-hover focus:bg-agg-secondary-hover",
|
|
12337
|
-
executionType === item.value && "font-agg-bold text-agg-primary"
|
|
12338
|
-
),
|
|
12339
|
-
onSelect: () => handleExecutionTypeChange(item.value),
|
|
12340
|
-
children: item.label
|
|
12341
|
-
},
|
|
12342
|
-
item.value
|
|
12343
|
-
))
|
|
12344
|
-
}
|
|
12345
|
-
)
|
|
12346
|
-
}
|
|
12347
|
-
)
|
|
12348
|
-
]
|
|
12835
|
+
ariaLabel: tradingLabels.orderTypeAria,
|
|
12836
|
+
className: "mb-2",
|
|
12837
|
+
triggerClassName: "agg-order-type-trigger",
|
|
12838
|
+
items: [
|
|
12839
|
+
{ value: "market", label: tradingLabels.orderTypeMarket },
|
|
12840
|
+
{ value: "limit", label: tradingLabels.orderTypeLimit }
|
|
12841
|
+
],
|
|
12842
|
+
value: executionType,
|
|
12843
|
+
onChange: handleExecutionTypeChange,
|
|
12844
|
+
variant: "inline",
|
|
12845
|
+
openOnHover: true,
|
|
12846
|
+
contentAlign: "end",
|
|
12847
|
+
contentSideOffset: 4
|
|
12349
12848
|
}
|
|
12350
12849
|
) : null
|
|
12351
12850
|
]
|
|
12352
12851
|
}
|
|
12353
12852
|
),
|
|
12354
|
-
|
|
12355
|
-
|
|
12356
|
-
|
|
12357
|
-
|
|
12358
|
-
|
|
12359
|
-
|
|
12360
|
-
|
|
12361
|
-
|
|
12362
|
-
|
|
12363
|
-
|
|
12364
|
-
|
|
12365
|
-
|
|
12366
|
-
|
|
12367
|
-
|
|
12368
|
-
|
|
12369
|
-
|
|
12370
|
-
|
|
12371
|
-
|
|
12372
|
-
|
|
12373
|
-
|
|
12374
|
-
|
|
12375
|
-
|
|
12376
|
-
|
|
12377
|
-
|
|
12378
|
-
|
|
12379
|
-
|
|
12380
|
-
|
|
12381
|
-
|
|
12382
|
-
|
|
12383
|
-
|
|
12384
|
-
|
|
12385
|
-
|
|
12386
|
-
|
|
12387
|
-
|
|
12388
|
-
|
|
12389
|
-
|
|
12853
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-order-entry-section flex flex-col gap-4", children: [
|
|
12854
|
+
outcomes.length >= 2 ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "agg-outcomes flex w-full max-w-full gap-2", children: outcomes.map((outcome, index) => {
|
|
12855
|
+
var _a2, _b2, _c2;
|
|
12856
|
+
const price = getDisplayOutcomePrice({
|
|
12857
|
+
outcomeId: outcome.id,
|
|
12858
|
+
outcomeLabel: outcome.label,
|
|
12859
|
+
selection: (_a2 = tradingContext == null ? void 0 : tradingContext.tradeSide) != null ? _a2 : isSell ? "sell" : "buy",
|
|
12860
|
+
bestPrices: clusterBestPrices,
|
|
12861
|
+
bestMidpoint: clusterBestMidpoint,
|
|
12862
|
+
bestMidpointsByOutcomeId: clusterBestMidpointsByOutcomeId,
|
|
12863
|
+
livePrices
|
|
12864
|
+
});
|
|
12865
|
+
const isActive = outcome.id === scopedSelectedOutcomeId;
|
|
12866
|
+
const isPositive = resolveIsPositiveOutcome(outcome, index);
|
|
12867
|
+
const isPriceLoading = clusterMidpointResult.isLoading && price == null;
|
|
12868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
12869
|
+
"button",
|
|
12870
|
+
{
|
|
12871
|
+
"data-id": outcome.id,
|
|
12872
|
+
type: "button",
|
|
12873
|
+
className: cn(
|
|
12874
|
+
"agg-outcome-button",
|
|
12875
|
+
getOutcomeButtonClassName({
|
|
12876
|
+
enableAnimations,
|
|
12877
|
+
isActive,
|
|
12878
|
+
isPositive
|
|
12879
|
+
}),
|
|
12880
|
+
"disabled:cursor-not-allowed disabled:opacity-60",
|
|
12881
|
+
"leading-agg-5! flex-1 min-w-0 gap-1 md:gap-2"
|
|
12882
|
+
),
|
|
12883
|
+
"aria-pressed": isActive,
|
|
12884
|
+
"aria-label": `${(_b2 = outcome.title) != null ? _b2 : outcome.label} ${formatProbabilityCents(price, formatPrice)}`,
|
|
12885
|
+
disabled: !orderEligibility.canPlaceOrder || isResolvedOutcomeCtaLocked,
|
|
12886
|
+
onClick: () => handleOutcomeChange(outcome.id),
|
|
12887
|
+
children: [
|
|
12888
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12889
|
+
Typography,
|
|
12890
|
+
{
|
|
12891
|
+
as: "span",
|
|
12892
|
+
variant: isActive ? "body-strong" : "body",
|
|
12893
|
+
className: cn("whitespace-nowrap truncate"),
|
|
12894
|
+
children: (_c2 = outcome.title) != null ? _c2 : outcome.label
|
|
12895
|
+
}
|
|
12896
|
+
),
|
|
12897
|
+
isPriceLoading ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12898
|
+
"span",
|
|
12899
|
+
{
|
|
12900
|
+
"aria-hidden": "true",
|
|
12901
|
+
className: cn(
|
|
12902
|
+
"agg-place-order-outcome-price-loading",
|
|
12903
|
+
"h-4 w-10 shrink-0 rounded-agg-sm bg-agg-separator animate-pulse"
|
|
12904
|
+
)
|
|
12905
|
+
}
|
|
12906
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(Typography, { as: "span", variant: isActive ? "body-strong" : "body", children: formatProbabilityCents(price, formatPrice) })
|
|
12907
|
+
]
|
|
12908
|
+
},
|
|
12909
|
+
outcome.id
|
|
12910
|
+
);
|
|
12911
|
+
}) }) : null,
|
|
12912
|
+
isLimitOrder ? /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-limit-price-section flex items-center justify-between gap-4", children: [
|
|
12913
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.limitPrice }),
|
|
12914
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex min-w-0 flex-col items-end gap-1", children: [
|
|
12915
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
12916
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("label", { className: "relative flex items-center", children: [
|
|
12917
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12918
|
+
"input",
|
|
12919
|
+
{
|
|
12920
|
+
type: "text",
|
|
12921
|
+
inputMode: "decimal",
|
|
12922
|
+
"aria-label": tradingLabels.limitPriceInputAria,
|
|
12923
|
+
"aria-invalid": Boolean(limitPriceInputError),
|
|
12924
|
+
value: limitPriceInputValue,
|
|
12925
|
+
onChange: handleLimitPriceInputChange,
|
|
12926
|
+
onBlur: handleLimitPriceInputBlur,
|
|
12927
|
+
className: cn(
|
|
12928
|
+
PLACE_ORDER_NUMERIC_INPUT_CLASS_NAME,
|
|
12929
|
+
"h-9 w-[108px] pr-5",
|
|
12930
|
+
limitPriceInputError && "text-agg-error focus-visible:text-agg-error"
|
|
12931
|
+
)
|
|
12932
|
+
}
|
|
12933
|
+
),
|
|
12934
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "pointer-events-none absolute right-1 text-agg-3xl font-agg-bold leading-agg-9 text-agg-foreground", children: "\xA2" })
|
|
12935
|
+
] }),
|
|
12936
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12937
|
+
"button",
|
|
12390
12938
|
{
|
|
12391
|
-
|
|
12392
|
-
|
|
12393
|
-
|
|
12394
|
-
|
|
12939
|
+
type: "button",
|
|
12940
|
+
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",
|
|
12941
|
+
"aria-label": tradingLabels.limitPriceDecreaseAria,
|
|
12942
|
+
onClick: () => handleLimitPriceStep("decrease"),
|
|
12943
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(Icon, { name: "minus", size: "small", className: "h-4 w-4", "aria-hidden": true })
|
|
12395
12944
|
}
|
|
12396
12945
|
),
|
|
12397
|
-
|
|
12398
|
-
"
|
|
12946
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12947
|
+
"button",
|
|
12399
12948
|
{
|
|
12400
|
-
|
|
12401
|
-
className:
|
|
12402
|
-
|
|
12403
|
-
|
|
12404
|
-
)
|
|
12949
|
+
type: "button",
|
|
12950
|
+
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",
|
|
12951
|
+
"aria-label": tradingLabels.limitPriceIncreaseAria,
|
|
12952
|
+
onClick: () => handleLimitPriceStep("increase"),
|
|
12953
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(Icon, { name: "plus", size: "small", className: "h-4 w-4", "aria-hidden": true })
|
|
12405
12954
|
}
|
|
12406
|
-
)
|
|
12407
|
-
]
|
|
12408
|
-
|
|
12409
|
-
|
|
12410
|
-
)
|
|
12411
|
-
|
|
12412
|
-
|
|
12413
|
-
|
|
12414
|
-
|
|
12415
|
-
|
|
12416
|
-
|
|
12417
|
-
|
|
12418
|
-
"input",
|
|
12955
|
+
)
|
|
12956
|
+
] }),
|
|
12957
|
+
limitPriceInputError ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "max-w-[220px] text-right text-agg-xs leading-agg-4 text-agg-error", children: limitPriceInputError }) : null
|
|
12958
|
+
] })
|
|
12959
|
+
] }) : null,
|
|
12960
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-order-amount-section flex items-start justify-between gap-4", children: [
|
|
12961
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-order-amount-meta flex flex-col", children: [
|
|
12962
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "agg-order-amount-label text-agg-base font-agg-bold leading-agg-6 text-agg-foreground whitespace-nowrap", children: tradingLabels.amount(internalTab) }),
|
|
12963
|
+
isAuthenticated ? isSell ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "agg-balance-value flex items-baseline gap-1.5 text-agg-sm leading-agg-5 text-agg-muted-foreground", children: isCurrentSellableSharesLoading ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(LoadingIcon, { size: "small" }) : /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_jsx_runtime135.Fragment, { children: [
|
|
12964
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "whitespace-pre", children: displayedCurrentSellableSharesLabel }),
|
|
12965
|
+
displayedCurrentSellableShares > 0 ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12966
|
+
"button",
|
|
12419
12967
|
{
|
|
12420
|
-
type: "
|
|
12421
|
-
inputMode: "decimal",
|
|
12422
|
-
"aria-label": tradingLabels.limitPriceInputAria,
|
|
12423
|
-
"aria-invalid": Boolean(limitPriceInputError),
|
|
12424
|
-
value: limitPriceInputValue,
|
|
12425
|
-
onChange: handleLimitPriceInputChange,
|
|
12426
|
-
onBlur: handleLimitPriceInputBlur,
|
|
12968
|
+
type: "button",
|
|
12427
12969
|
className: cn(
|
|
12428
|
-
"
|
|
12429
|
-
"
|
|
12430
|
-
|
|
12431
|
-
|
|
12970
|
+
"agg-max-shares-button",
|
|
12971
|
+
"cursor-pointer disabled:cursor-not-allowed",
|
|
12972
|
+
"bg-transparent p-0 text-agg-sm font-agg-bold leading-agg-5 text-agg-primary disabled:text-agg-muted-foreground",
|
|
12973
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-0 focus-visible:ring-offset-agg-secondary"
|
|
12974
|
+
),
|
|
12975
|
+
"aria-label": tradingLabels.maxShares,
|
|
12976
|
+
disabled: !orderEligibility.canPlaceOrder || isAtMaxSellableShares,
|
|
12977
|
+
onClick: handleFillSellableShares,
|
|
12978
|
+
children: tradingLabels.maxShares
|
|
12432
12979
|
}
|
|
12433
|
-
)
|
|
12434
|
-
|
|
12435
|
-
|
|
12436
|
-
|
|
12437
|
-
|
|
12438
|
-
|
|
12439
|
-
|
|
12440
|
-
|
|
12441
|
-
|
|
12442
|
-
|
|
12443
|
-
|
|
12980
|
+
) : null
|
|
12981
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "agg-balance-value flex items-center gap-2 text-agg-sm leading-agg-5 text-agg-muted-foreground", children: isBalanceLoading ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(LoadingIcon, { size: "small" }) : tradingLabels.balance(formatUsd(displayedBalance)) }) : null
|
|
12982
|
+
] }),
|
|
12983
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12984
|
+
CurrencyInput,
|
|
12985
|
+
{
|
|
12986
|
+
value: internalAmount,
|
|
12987
|
+
onChange: handleAmountChange,
|
|
12988
|
+
ariaLabel: tradingLabels.amount(internalTab),
|
|
12989
|
+
max: isLimitOrder && !isSell && isAuthenticated && !isBalanceLoading ? totalBalance : void 0,
|
|
12990
|
+
isInvalid: isInsufficientBalance || isBelowMinimum,
|
|
12991
|
+
disabled: !orderEligibility.canPlaceOrder,
|
|
12992
|
+
prefix: internalTab === "buy" ? "$" : "",
|
|
12993
|
+
decimalPlaces: isSell ? SELL_SHARE_INPUT_DECIMALS : 2,
|
|
12994
|
+
classNames: {
|
|
12995
|
+
input: cn(
|
|
12996
|
+
"agg-order-amount-input",
|
|
12997
|
+
PLACE_ORDER_NUMERIC_INPUT_CLASS_NAME,
|
|
12998
|
+
"w-full max-w-[168px]",
|
|
12999
|
+
hasEnteredAmount ? "text-agg-foreground" : "text-agg-separator caret-agg-foreground"
|
|
13000
|
+
)
|
|
12444
13001
|
}
|
|
12445
|
-
|
|
12446
|
-
|
|
12447
|
-
|
|
13002
|
+
}
|
|
13003
|
+
)
|
|
13004
|
+
] }),
|
|
13005
|
+
showFeesBreakdown && hasEnteredAmount && !isBelowMinimum && estimatedFeesValue ? /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-order-fees-section flex items-center justify-between gap-4", children: [
|
|
13006
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
13007
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
13008
|
+
Typography,
|
|
12448
13009
|
{
|
|
12449
|
-
|
|
12450
|
-
className: "
|
|
12451
|
-
|
|
12452
|
-
onClick: () => handleLimitPriceStep("increase"),
|
|
12453
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Icon, { name: "plus", size: "small", className: "h-4 w-4", "aria-hidden": true })
|
|
13010
|
+
variant: "text-sm",
|
|
13011
|
+
className: "text-agg-sm leading-agg-5 text-agg-muted-foreground",
|
|
13012
|
+
children: tradingLabels.estimatedFees
|
|
12454
13013
|
}
|
|
12455
|
-
)
|
|
12456
|
-
|
|
12457
|
-
|
|
12458
|
-
] })
|
|
12459
|
-
] }) : null,
|
|
12460
|
-
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "agg-order-amount-section flex items-start justify-between gap-4", children: [
|
|
12461
|
-
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "agg-order-amount-meta flex flex-col", children: [
|
|
12462
|
-
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("p", { className: "agg-order-amount-label text-agg-base font-agg-bold leading-agg-6 text-agg-foreground whitespace-nowrap", children: tradingLabels.amount(internalTab) }),
|
|
12463
|
-
isAuthenticated ? isSell ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "agg-balance-value flex items-baseline gap-1.5 text-agg-sm leading-agg-5 text-agg-muted-foreground", children: isCurrentSellableSharesLoading ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(LoadingIcon, { size: "small" }) : /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(import_jsx_runtime134.Fragment, { children: [
|
|
12464
|
-
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("span", { className: "whitespace-pre", children: displayedCurrentSellableSharesLabel }),
|
|
12465
|
-
displayedCurrentSellableShares > 0 ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12466
|
-
"button",
|
|
13014
|
+
),
|
|
13015
|
+
feeBreakdownRows.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
13016
|
+
Tooltip,
|
|
12467
13017
|
{
|
|
12468
|
-
|
|
12469
|
-
|
|
12470
|
-
|
|
12471
|
-
|
|
12472
|
-
|
|
12473
|
-
|
|
12474
|
-
|
|
12475
|
-
|
|
12476
|
-
|
|
12477
|
-
|
|
12478
|
-
|
|
13018
|
+
"aria-label": tradingLabels.estimatedFeesTooltipAria,
|
|
13019
|
+
classNames: {
|
|
13020
|
+
content: cn(
|
|
13021
|
+
"min-w-[220px] max-w-[320px] rounded-[10px] px-5 py-4",
|
|
13022
|
+
"shadow-[0_12px_12px_rgba(0,0,0,0.10)]"
|
|
13023
|
+
),
|
|
13024
|
+
icon: "h-3 w-3 text-agg-muted-foreground",
|
|
13025
|
+
trigger: "h-3 w-3 text-agg-muted-foreground"
|
|
13026
|
+
},
|
|
13027
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "flex w-full flex-col gap-2", children: feeBreakdownRows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
13028
|
+
"div",
|
|
13029
|
+
{
|
|
13030
|
+
className: "flex items-center justify-between gap-3 text-agg-sm font-agg-normal leading-agg-5 text-agg-foreground",
|
|
13031
|
+
children: [
|
|
13032
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { children: row.label }),
|
|
13033
|
+
row.kind === "badge" ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
13034
|
+
"span",
|
|
13035
|
+
{
|
|
13036
|
+
className: cn(
|
|
13037
|
+
"agg-fee-badge inline-flex items-center justify-center rounded-agg-sm border border-agg-primary/50",
|
|
13038
|
+
"bg-linear-to-b from-agg-primary/8 to-agg-primary/15 px-1.5 py-1",
|
|
13039
|
+
"text-agg-xs font-agg-bold leading-agg-4 text-agg-primary uppercase whitespace-nowrap"
|
|
13040
|
+
),
|
|
13041
|
+
children: row.badgeLabel
|
|
13042
|
+
}
|
|
13043
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "text-right", children: row.value })
|
|
13044
|
+
]
|
|
13045
|
+
},
|
|
13046
|
+
row.label
|
|
13047
|
+
)) })
|
|
12479
13048
|
}
|
|
12480
13049
|
) : null
|
|
12481
|
-
] })
|
|
12482
|
-
|
|
12483
|
-
|
|
12484
|
-
CurrencyInput,
|
|
12485
|
-
{
|
|
12486
|
-
value: internalAmount,
|
|
12487
|
-
onChange: handleAmountChange,
|
|
12488
|
-
ariaLabel: tradingLabels.amount(internalTab),
|
|
12489
|
-
max: isLimitOrder && !isSell && isAuthenticated && !isBalanceLoading ? totalBalance : void 0,
|
|
12490
|
-
isInvalid: isInsufficientBalance || isBelowMinimum,
|
|
12491
|
-
disabled: !orderEligibility.canPlaceOrder,
|
|
12492
|
-
prefix: internalTab === "buy" ? "$" : "",
|
|
12493
|
-
decimalPlaces: isSell ? SELL_SHARE_INPUT_DECIMALS : 2,
|
|
12494
|
-
classNames: {
|
|
12495
|
-
input: cn(
|
|
12496
|
-
"agg-order-amount-input",
|
|
12497
|
-
"w-full max-w-[168px] text-right text-agg-3xl font-agg-bold leading-agg-9 tracking-agg-normal",
|
|
12498
|
-
hasEnteredAmount ? "text-agg-foreground" : "text-agg-separator caret-agg-foreground"
|
|
12499
|
-
)
|
|
12500
|
-
}
|
|
12501
|
-
}
|
|
12502
|
-
)
|
|
13050
|
+
] }),
|
|
13051
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: estimatedFeesValue })
|
|
13052
|
+
] }) : null
|
|
12503
13053
|
] }),
|
|
12504
|
-
|
|
12505
|
-
/* @__PURE__ */ (0,
|
|
12506
|
-
/* @__PURE__ */ (0,
|
|
12507
|
-
|
|
12508
|
-
{
|
|
12509
|
-
variant: "text-sm",
|
|
12510
|
-
className: "text-agg-sm leading-agg-5 text-agg-muted-foreground",
|
|
12511
|
-
children: tradingLabels.estimatedFees
|
|
12512
|
-
}
|
|
12513
|
-
),
|
|
12514
|
-
feeBreakdownRows.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12515
|
-
Tooltip,
|
|
12516
|
-
{
|
|
12517
|
-
"aria-label": tradingLabels.estimatedFeesTooltipAria,
|
|
12518
|
-
classNames: {
|
|
12519
|
-
content: cn(
|
|
12520
|
-
"min-w-[220px] max-w-[320px] rounded-[10px] px-5 py-4",
|
|
12521
|
-
"shadow-[0_12px_12px_rgba(0,0,0,0.10)]"
|
|
12522
|
-
),
|
|
12523
|
-
icon: "h-3 w-3 text-agg-muted-foreground",
|
|
12524
|
-
trigger: "h-3 w-3 text-agg-muted-foreground"
|
|
12525
|
-
},
|
|
12526
|
-
content: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "flex w-full flex-col gap-2", children: feeBreakdownRows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
|
|
12527
|
-
"div",
|
|
12528
|
-
{
|
|
12529
|
-
className: "flex items-center justify-between gap-3 text-agg-sm font-agg-normal leading-agg-5 text-agg-foreground",
|
|
12530
|
-
children: [
|
|
12531
|
-
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("span", { children: row.label }),
|
|
12532
|
-
row.kind === "badge" ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
12533
|
-
"span",
|
|
12534
|
-
{
|
|
12535
|
-
className: cn(
|
|
12536
|
-
"agg-fee-badge inline-flex items-center justify-center rounded-agg-sm border border-agg-primary/50",
|
|
12537
|
-
"bg-linear-to-b from-agg-primary/8 to-agg-primary/15 px-1.5 py-1",
|
|
12538
|
-
"text-agg-xs font-agg-bold leading-agg-4 text-agg-primary uppercase whitespace-nowrap"
|
|
12539
|
-
),
|
|
12540
|
-
children: row.badgeLabel
|
|
12541
|
-
}
|
|
12542
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("span", { className: "text-right", children: row.value })
|
|
12543
|
-
]
|
|
12544
|
-
},
|
|
12545
|
-
row.label
|
|
12546
|
-
)) })
|
|
12547
|
-
}
|
|
12548
|
-
) : null
|
|
12549
|
-
] }),
|
|
12550
|
-
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: estimatedFeesValue })
|
|
12551
|
-
] }) : null,
|
|
12552
|
-
shouldShowSmartRouting ? /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "agg-route-panel flex flex-col gap-3", children: [
|
|
12553
|
-
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "agg-route-panel-header flex items-center justify-between gap-4", children: [
|
|
12554
|
-
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("p", { className: "agg-route-panel-title text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.smartRouting }),
|
|
12555
|
-
shouldShowRouteToggle && !isRoutesExpanded ? /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
|
|
13054
|
+
shouldShowSmartRouting ? /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-route-panel flex flex-col gap-3", children: [
|
|
13055
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-route-panel-header flex items-center justify-between gap-4", children: [
|
|
13056
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "agg-route-panel-title text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.smartRouting }),
|
|
13057
|
+
shouldShowRouteToggle && !isRoutesExpanded ? /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
12556
13058
|
"button",
|
|
12557
13059
|
{
|
|
12558
13060
|
type: "button",
|
|
12559
13061
|
className: "agg-route-toggle flex cursor-pointer items-center gap-1.5 text-agg-sm leading-agg-5 text-agg-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-0 focus-visible:ring-offset-agg-secondary",
|
|
12560
|
-
"aria-label": tradingLabels.viewAllRoutes(
|
|
13062
|
+
"aria-label": tradingLabels.viewAllRoutes(activeRouteCardCount),
|
|
12561
13063
|
onClick: () => setIsRoutesExpanded((currentValue) => !currentValue),
|
|
12562
13064
|
children: [
|
|
12563
|
-
/* @__PURE__ */ (0,
|
|
12564
|
-
/* @__PURE__ */ (0,
|
|
13065
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { children: tradingLabels.viewAllRoutes(activeRouteCardCount) }),
|
|
13066
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12565
13067
|
Icon,
|
|
12566
13068
|
{
|
|
12567
13069
|
name: "chevron-down",
|
|
@@ -12574,29 +13076,29 @@ var PlaceOrder = ({
|
|
|
12574
13076
|
}
|
|
12575
13077
|
) : null
|
|
12576
13078
|
] }),
|
|
12577
|
-
/* @__PURE__ */ (0,
|
|
12578
|
-
/* @__PURE__ */ (0,
|
|
12579
|
-
/* @__PURE__ */ (0,
|
|
12580
|
-
] }) :
|
|
12581
|
-
return /* @__PURE__ */ (0,
|
|
13079
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "agg-route-list flex flex-col gap-2", children: !isLimitOrder && isQuoteLoading ? /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-route-loading flex flex-col gap-2", "aria-hidden": "true", children: [
|
|
13080
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(PlaceOrderRouteCardSkeleton, {}),
|
|
13081
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(PlaceOrderRouteCardSkeleton, {})
|
|
13082
|
+
] }) : activeRouteCards.length > 0 ? activeRouteCards.map((card) => {
|
|
13083
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_react16.Fragment, { children: renderRouteCard({
|
|
12582
13084
|
card,
|
|
12583
13085
|
enableAnimations,
|
|
12584
13086
|
isExpanded: card.kind === "split" ? isSplitDetailOpen : isRoutesExpanded,
|
|
12585
|
-
isSelected: !card.isUnavailable && card.id === resolvedSelectedRouteCardId,
|
|
12586
|
-
onSelect:
|
|
13087
|
+
isSelected: !card.isUnavailable && card.id === (isLimitOrder ? selectedLimitRouteCardId : resolvedSelectedRouteCardId),
|
|
13088
|
+
onSelect: handleActiveRouteCardSelect,
|
|
12587
13089
|
tradingLabels
|
|
12588
13090
|
}) }, card.id);
|
|
12589
13091
|
}) : null })
|
|
12590
13092
|
] }) : null,
|
|
12591
|
-
isLimitOrder ? /* @__PURE__ */ (0,
|
|
12592
|
-
/* @__PURE__ */ (0,
|
|
12593
|
-
/* @__PURE__ */ (0,
|
|
13093
|
+
isLimitOrder ? /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-limit-expiration-section flex items-center justify-between gap-4", children: [
|
|
13094
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.expiration }),
|
|
13095
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
12594
13096
|
Popover.Root,
|
|
12595
13097
|
{
|
|
12596
13098
|
open: isLimitExpirationPickerOpen,
|
|
12597
13099
|
onOpenChange: handleLimitExpirationPickerOpenChange,
|
|
12598
13100
|
children: [
|
|
12599
|
-
/* @__PURE__ */ (0,
|
|
13101
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
12600
13102
|
"button",
|
|
12601
13103
|
{
|
|
12602
13104
|
ref: expirationTriggerRef,
|
|
@@ -12604,11 +13106,10 @@ var PlaceOrder = ({
|
|
|
12604
13106
|
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",
|
|
12605
13107
|
"aria-label": tradingLabels.expirationMenuAria,
|
|
12606
13108
|
children: [
|
|
12607
|
-
/* @__PURE__ */ (0,
|
|
12608
|
-
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("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 ? (0, import_dayjs5.default)(resolvedCustomExpirationDate).format(
|
|
13109
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("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 ? (0, import_dayjs5.default)(resolvedCustomExpirationDate).format(
|
|
12609
13110
|
"MMM D, YYYY [at] HH:mm"
|
|
12610
13111
|
) : tradingLabels.expirationCustom }),
|
|
12611
|
-
/* @__PURE__ */ (0,
|
|
13112
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12612
13113
|
Icon,
|
|
12613
13114
|
{
|
|
12614
13115
|
name: isLimitExpirationPickerOpen ? "chevron-up" : "chevron-down",
|
|
@@ -12620,11 +13121,11 @@ var PlaceOrder = ({
|
|
|
12620
13121
|
]
|
|
12621
13122
|
}
|
|
12622
13123
|
) }),
|
|
12623
|
-
/* @__PURE__ */ (0,
|
|
13124
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12624
13125
|
Popover.Portal,
|
|
12625
13126
|
{
|
|
12626
13127
|
container: resolvePlaceOrderPortalContainer(expirationTriggerRef.current),
|
|
12627
|
-
children: /* @__PURE__ */ (0,
|
|
13128
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12628
13129
|
Popover.Content,
|
|
12629
13130
|
{
|
|
12630
13131
|
align: "end",
|
|
@@ -12633,14 +13134,14 @@ var PlaceOrder = ({
|
|
|
12633
13134
|
role: "dialog",
|
|
12634
13135
|
"aria-label": tradingLabels.expirationMenuAria,
|
|
12635
13136
|
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)]",
|
|
12636
|
-
children: limitExpirationPickerView === "calendar" ? /* @__PURE__ */ (0,
|
|
12637
|
-
/* @__PURE__ */ (0,
|
|
13137
|
+
children: limitExpirationPickerView === "calendar" ? /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex flex-col gap-3 p-4", children: [
|
|
13138
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12638
13139
|
Button,
|
|
12639
13140
|
{
|
|
12640
13141
|
variant: "tertiary",
|
|
12641
13142
|
size: "small",
|
|
12642
13143
|
className: "w-fit px-0",
|
|
12643
|
-
prefix: /* @__PURE__ */ (0,
|
|
13144
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12644
13145
|
Icon,
|
|
12645
13146
|
{
|
|
12646
13147
|
name: "chevron-left",
|
|
@@ -12653,7 +13154,7 @@ var PlaceOrder = ({
|
|
|
12653
13154
|
children: tradingLabels.expirationOptions
|
|
12654
13155
|
}
|
|
12655
13156
|
),
|
|
12656
|
-
/* @__PURE__ */ (0,
|
|
13157
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12657
13158
|
Calendar,
|
|
12658
13159
|
{
|
|
12659
13160
|
mode: "single",
|
|
@@ -12668,9 +13169,9 @@ var PlaceOrder = ({
|
|
|
12668
13169
|
}
|
|
12669
13170
|
}
|
|
12670
13171
|
),
|
|
12671
|
-
/* @__PURE__ */ (0,
|
|
12672
|
-
/* @__PURE__ */ (0,
|
|
12673
|
-
/* @__PURE__ */ (0,
|
|
13172
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
13173
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex shrink-0 flex-col gap-0.5", children: [
|
|
13174
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12674
13175
|
"label",
|
|
12675
13176
|
{
|
|
12676
13177
|
htmlFor: expirationTimeInputId,
|
|
@@ -12678,9 +13179,9 @@ var PlaceOrder = ({
|
|
|
12678
13179
|
children: tradingLabels.expirationStartTime
|
|
12679
13180
|
}
|
|
12680
13181
|
),
|
|
12681
|
-
/* @__PURE__ */ (0,
|
|
13182
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "text-agg-xs leading-agg-4 text-agg-foreground", children: tradingLabels.expirationStartTimeHint })
|
|
12682
13183
|
] }),
|
|
12683
|
-
/* @__PURE__ */ (0,
|
|
13184
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12684
13185
|
"input",
|
|
12685
13186
|
{
|
|
12686
13187
|
id: expirationTimeInputId,
|
|
@@ -12691,8 +13192,8 @@ var PlaceOrder = ({
|
|
|
12691
13192
|
}
|
|
12692
13193
|
)
|
|
12693
13194
|
] }),
|
|
12694
|
-
/* @__PURE__ */ (0,
|
|
12695
|
-
/* @__PURE__ */ (0,
|
|
13195
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex gap-2", children: [
|
|
13196
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12696
13197
|
Button,
|
|
12697
13198
|
{
|
|
12698
13199
|
variant: "secondary",
|
|
@@ -12702,13 +13203,13 @@ var PlaceOrder = ({
|
|
|
12702
13203
|
children: tradingLabels.expirationCancel
|
|
12703
13204
|
}
|
|
12704
13205
|
),
|
|
12705
|
-
/* @__PURE__ */ (0,
|
|
13206
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12706
13207
|
Button,
|
|
12707
13208
|
{
|
|
12708
13209
|
size: "small",
|
|
12709
13210
|
className: "min-w-0 flex-1",
|
|
12710
13211
|
disabled: !isLimitExpirationDraftValid,
|
|
12711
|
-
prefix: /* @__PURE__ */ (0,
|
|
13212
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12712
13213
|
Icon,
|
|
12713
13214
|
{
|
|
12714
13215
|
name: "success-check",
|
|
@@ -12722,7 +13223,7 @@ var PlaceOrder = ({
|
|
|
12722
13223
|
}
|
|
12723
13224
|
)
|
|
12724
13225
|
] })
|
|
12725
|
-
] }) : /* @__PURE__ */ (0,
|
|
13226
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12726
13227
|
"div",
|
|
12727
13228
|
{
|
|
12728
13229
|
role: "radiogroup",
|
|
@@ -12740,7 +13241,7 @@ var PlaceOrder = ({
|
|
|
12740
13241
|
{ value: "ONE_HOUR", label: tradingLabels.expirationOneHour },
|
|
12741
13242
|
{ value: "END_OF_DAY", label: tradingLabels.expirationEndOfDay },
|
|
12742
13243
|
{ value: "CUSTOM", label: tradingLabels.expirationCustom }
|
|
12743
|
-
].map((item, optionIndex) => /* @__PURE__ */ (0,
|
|
13244
|
+
].map((item, optionIndex) => /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
12744
13245
|
"button",
|
|
12745
13246
|
{
|
|
12746
13247
|
ref: (element) => {
|
|
@@ -12757,14 +13258,14 @@ var PlaceOrder = ({
|
|
|
12757
13258
|
onClick: () => handleLimitExpirationTypeChange(item.value),
|
|
12758
13259
|
onKeyDown: (event) => handleLimitExpirationOptionKeyDown(event, optionIndex),
|
|
12759
13260
|
children: [
|
|
12760
|
-
limitExpirationType === item.value ? /* @__PURE__ */ (0,
|
|
13261
|
+
limitExpirationType === item.value ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12761
13262
|
"span",
|
|
12762
13263
|
{
|
|
12763
13264
|
className: "absolute bottom-2 left-0 top-2 w-1 bg-agg-primary",
|
|
12764
13265
|
"aria-hidden": true
|
|
12765
13266
|
}
|
|
12766
13267
|
) : null,
|
|
12767
|
-
/* @__PURE__ */ (0,
|
|
13268
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "truncate", children: item.label })
|
|
12768
13269
|
]
|
|
12769
13270
|
},
|
|
12770
13271
|
item.value
|
|
@@ -12779,13 +13280,13 @@ var PlaceOrder = ({
|
|
|
12779
13280
|
}
|
|
12780
13281
|
)
|
|
12781
13282
|
] }) : null,
|
|
12782
|
-
hasEnteredAmount && (isLimitOrder ? limitOrderPayload : selectedRouteCard) && !isQuoteLoading && !isBelowMinimum && orderEligibility.canPlaceOrder ? /* @__PURE__ */ (0,
|
|
12783
|
-
/* @__PURE__ */ (0,
|
|
12784
|
-
/* @__PURE__ */ (0,
|
|
12785
|
-
/* @__PURE__ */ (0,
|
|
13283
|
+
hasEnteredAmount && (isLimitOrder ? limitOrderPayload : selectedRouteCard) && !isQuoteLoading && !isBelowMinimum && orderEligibility.canPlaceOrder ? /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-order-summary flex items-start justify-between gap-4", children: [
|
|
13284
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-order-summary-meta flex flex-col", children: [
|
|
13285
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "agg-order-summary-label text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: tradingLabels.toWin(internalTab) }),
|
|
13286
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "agg-order-summary-hint text-agg-sm leading-agg-5 text-agg-muted-foreground", children: isLimitOrder ? displayedLimitToWinHint : displayedToWinHint })
|
|
12786
13287
|
] }),
|
|
12787
|
-
/* @__PURE__ */ (0,
|
|
12788
|
-
|
|
13288
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
13289
|
+
import_react15.default,
|
|
12789
13290
|
{
|
|
12790
13291
|
value: isLimitOrder ? displayedLimitToWinValue : displayedToWinValue,
|
|
12791
13292
|
locales: locale,
|
|
@@ -12799,7 +13300,7 @@ var PlaceOrder = ({
|
|
|
12799
13300
|
}
|
|
12800
13301
|
)
|
|
12801
13302
|
] }) : null,
|
|
12802
|
-
/* @__PURE__ */ (0,
|
|
13303
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
12803
13304
|
"div",
|
|
12804
13305
|
{
|
|
12805
13306
|
className: cn(
|
|
@@ -12807,17 +13308,17 @@ var PlaceOrder = ({
|
|
|
12807
13308
|
classNames == null ? void 0 : classNames.footer
|
|
12808
13309
|
),
|
|
12809
13310
|
children: [
|
|
12810
|
-
!shouldShowGeoBlockBanner ? /* @__PURE__ */ (0,
|
|
12811
|
-
submissionFeedback ? /* @__PURE__ */ (0,
|
|
13311
|
+
!shouldShowGeoBlockBanner ? /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-order-alerts flex flex-col gap-3 empty:hidden mb-3", children: [
|
|
13312
|
+
submissionFeedback ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12812
13313
|
InlineAlert,
|
|
12813
13314
|
{
|
|
12814
13315
|
tone: submissionFeedback.tone,
|
|
12815
13316
|
message: submissionFeedback.message
|
|
12816
13317
|
}
|
|
12817
13318
|
) : null,
|
|
12818
|
-
!submissionFeedback && orderEligibility.canPlaceOrder && !isInsufficientBalance && isBelowMinimum ? /* @__PURE__ */ (0,
|
|
12819
|
-
!submissionFeedback && orderEligibility.canPlaceOrder && !isInsufficientBalance && !isBelowMinimum && quoteStatus ? /* @__PURE__ */ (0,
|
|
12820
|
-
!submissionFeedback && orderEligibility.canPlaceOrder && !isInsufficientBalance && !isBelowMinimum && !quoteStatus && hasEnteredAmount && smartRouteErrorMessage ? /* @__PURE__ */ (0,
|
|
13319
|
+
!submissionFeedback && orderEligibility.canPlaceOrder && !isInsufficientBalance && isBelowMinimum ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(InlineAlert, { tone: "error", message: belowMinimumMessage }) : null,
|
|
13320
|
+
!submissionFeedback && orderEligibility.canPlaceOrder && !isInsufficientBalance && !isBelowMinimum && quoteStatus ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(InlineAlert, { tone: quoteStatus.tone, message: quoteStatus.message }) : null,
|
|
13321
|
+
!submissionFeedback && orderEligibility.canPlaceOrder && !isInsufficientBalance && !isBelowMinimum && !quoteStatus && hasEnteredAmount && smartRouteErrorMessage ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12821
13322
|
InlineAlert,
|
|
12822
13323
|
{
|
|
12823
13324
|
tone: "error",
|
|
@@ -12829,14 +13330,14 @@ var PlaceOrder = ({
|
|
|
12829
13330
|
}
|
|
12830
13331
|
) : null
|
|
12831
13332
|
] }) : null,
|
|
12832
|
-
!submissionFeedback && !shouldShowGeoBlockBanner && orderEligibility.canPlaceOrder && !needsKalshiConnection && shouldShowInsufficientBalanceAlert ? /* @__PURE__ */ (0,
|
|
13333
|
+
!submissionFeedback && !shouldShowGeoBlockBanner && orderEligibility.canPlaceOrder && !needsKalshiConnection && shouldShowInsufficientBalanceAlert ? /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
12833
13334
|
"div",
|
|
12834
13335
|
{
|
|
12835
13336
|
className: "agg-order-insufficient-balance-alert flex items-center justify-center gap-2",
|
|
12836
13337
|
role: "status",
|
|
12837
13338
|
"aria-live": "polite",
|
|
12838
13339
|
children: [
|
|
12839
|
-
/* @__PURE__ */ (0,
|
|
13340
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12840
13341
|
Icon,
|
|
12841
13342
|
{
|
|
12842
13343
|
name: "warning-filled",
|
|
@@ -12845,11 +13346,11 @@ var PlaceOrder = ({
|
|
|
12845
13346
|
"aria-hidden": "true"
|
|
12846
13347
|
}
|
|
12847
13348
|
),
|
|
12848
|
-
/* @__PURE__ */ (0,
|
|
13349
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "text-agg-sm text-agg-foreground", children: tradingLabels.insufficientBalance })
|
|
12849
13350
|
]
|
|
12850
13351
|
}
|
|
12851
13352
|
) : null,
|
|
12852
|
-
!submissionFeedback && !shouldShowGeoBlockBanner && needsKalshiConnection ? /* @__PURE__ */ (0,
|
|
13353
|
+
!submissionFeedback && !shouldShowGeoBlockBanner && needsKalshiConnection ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12853
13354
|
Button,
|
|
12854
13355
|
{
|
|
12855
13356
|
size: "large",
|
|
@@ -12859,7 +13360,7 @@ var PlaceOrder = ({
|
|
|
12859
13360
|
onClick: () => setIsConnectKalshiModalOpen(true),
|
|
12860
13361
|
children: tradingLabels.connectKalshi
|
|
12861
13362
|
}
|
|
12862
|
-
) : needsKycVerification && !submissionFeedback && !shouldShowGeoBlockBanner ? /* @__PURE__ */ (0,
|
|
13363
|
+
) : needsKycVerification && !submissionFeedback && !shouldShowGeoBlockBanner ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12863
13364
|
Button,
|
|
12864
13365
|
{
|
|
12865
13366
|
size: "large",
|
|
@@ -12869,7 +13370,7 @@ var PlaceOrder = ({
|
|
|
12869
13370
|
onClick: () => setIsConnectKalshiModalOpen(true),
|
|
12870
13371
|
children: verifyKalshiConnectionLabel
|
|
12871
13372
|
}
|
|
12872
|
-
) : !submissionFeedback && !shouldShowGeoBlockBanner && isInsufficientBalance ? /* @__PURE__ */ (0,
|
|
13373
|
+
) : !submissionFeedback && !shouldShowGeoBlockBanner && isInsufficientBalance ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12873
13374
|
Button,
|
|
12874
13375
|
{
|
|
12875
13376
|
size: "large",
|
|
@@ -12879,7 +13380,7 @@ var PlaceOrder = ({
|
|
|
12879
13380
|
onClick: handleDepositRequiredClick,
|
|
12880
13381
|
children: isKalshiBalanceInsufficient ? tradingLabels.addFundsToKalshi : tradingLabels.deposit
|
|
12881
13382
|
}
|
|
12882
|
-
) : isQuoteLoading && !isActionLoading ? /* @__PURE__ */ (0,
|
|
13383
|
+
) : isQuoteLoading && !isActionLoading ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12883
13384
|
Button,
|
|
12884
13385
|
{
|
|
12885
13386
|
size: "large",
|
|
@@ -12888,7 +13389,7 @@ var PlaceOrder = ({
|
|
|
12888
13389
|
disabled: true,
|
|
12889
13390
|
"aria-live": "polite",
|
|
12890
13391
|
"aria-label": routeLoadingMessage != null ? routeLoadingMessage : labels.common.loading,
|
|
12891
|
-
prefix: /* @__PURE__ */ (0,
|
|
13392
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12892
13393
|
"span",
|
|
12893
13394
|
{
|
|
12894
13395
|
className: cn(
|
|
@@ -12900,7 +13401,7 @@ var PlaceOrder = ({
|
|
|
12900
13401
|
),
|
|
12901
13402
|
children: routeLoadingMessage
|
|
12902
13403
|
}
|
|
12903
|
-
) : !isAuthenticated ? /* @__PURE__ */ (0,
|
|
13404
|
+
) : !isAuthenticated ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12904
13405
|
Button,
|
|
12905
13406
|
{
|
|
12906
13407
|
size: "large",
|
|
@@ -12908,10 +13409,10 @@ var PlaceOrder = ({
|
|
|
12908
13409
|
className: "agg-order-submit h-12 w-full px-8 text-agg-base leading-agg-6 shadow-none",
|
|
12909
13410
|
disabled: !orderEligibility.canPlaceOrder || shouldShowGeoBlockBanner,
|
|
12910
13411
|
"aria-label": tradingLabels.signInToTrade,
|
|
12911
|
-
onClick:
|
|
13412
|
+
onClick: import_hooks37.requestAggAuthChooserOpen,
|
|
12912
13413
|
children: tradingLabels.signInToTrade
|
|
12913
13414
|
}
|
|
12914
|
-
) : /* @__PURE__ */ (0,
|
|
13415
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12915
13416
|
Button,
|
|
12916
13417
|
{
|
|
12917
13418
|
size: "large",
|
|
@@ -12926,13 +13427,13 @@ var PlaceOrder = ({
|
|
|
12926
13427
|
children: actionLabel
|
|
12927
13428
|
}
|
|
12928
13429
|
),
|
|
12929
|
-
shouldShowLowLiquidityWarning ? /* @__PURE__ */ (0,
|
|
13430
|
+
shouldShowLowLiquidityWarning ? /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
12930
13431
|
"div",
|
|
12931
13432
|
{
|
|
12932
13433
|
className: "agg-order-low-liquidity-warning flex w-full items-center gap-2 rounded-agg-lg bg-agg-warning/10 px-3 py-2",
|
|
12933
13434
|
role: "status",
|
|
12934
13435
|
children: [
|
|
12935
|
-
/* @__PURE__ */ (0,
|
|
13436
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12936
13437
|
Icon,
|
|
12937
13438
|
{
|
|
12938
13439
|
name: "warning-filled",
|
|
@@ -12941,12 +13442,12 @@ var PlaceOrder = ({
|
|
|
12941
13442
|
"aria-hidden": "true"
|
|
12942
13443
|
}
|
|
12943
13444
|
),
|
|
12944
|
-
/* @__PURE__ */ (0,
|
|
13445
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "min-w-0 flex-1 wrap-break-word text-agg-sm leading-agg-5 text-agg-foreground", children: tradingLabels.lowLiquidityWarning })
|
|
12945
13446
|
]
|
|
12946
13447
|
}
|
|
12947
13448
|
) : null,
|
|
12948
|
-
!shouldShowGeoBlockBanner && internalTab === "buy" && showFeesBreakdown ? /* @__PURE__ */ (0,
|
|
12949
|
-
/* @__PURE__ */ (0,
|
|
13449
|
+
!shouldShowGeoBlockBanner && internalTab === "buy" && showFeesBreakdown ? /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "agg-order-platform-fee mt-1 flex items-center justify-center gap-1.5 text-agg-sm leading-agg-5 text-agg-muted-foreground", children: [
|
|
13450
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12950
13451
|
Icon,
|
|
12951
13452
|
{
|
|
12952
13453
|
name: "shield-trust",
|
|
@@ -12955,10 +13456,10 @@ var PlaceOrder = ({
|
|
|
12955
13456
|
"aria-hidden": "true"
|
|
12956
13457
|
}
|
|
12957
13458
|
),
|
|
12958
|
-
/* @__PURE__ */ (0,
|
|
13459
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(Typography, { variant: "text-xs-caps", className: "text-agg-primary", children: tradingLabels.platformFee })
|
|
12959
13460
|
] }) : null,
|
|
12960
|
-
shouldShowGeoBlockBanner ? /* @__PURE__ */ (0,
|
|
12961
|
-
!shouldShowGeoBlockBanner ? /* @__PURE__ */ (0,
|
|
13461
|
+
shouldShowGeoBlockBanner ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(GeoBlockBanner, { termsUrl: AGG_TERMS_OF_SERVICE_URL }) : null,
|
|
13462
|
+
!shouldShowGeoBlockBanner ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "agg-order-disclaimer text-center text-agg-xs leading-agg-4 text-agg-muted-foreground", children: tradingLabels.disclaimer }) : null
|
|
12962
13463
|
]
|
|
12963
13464
|
}
|
|
12964
13465
|
)
|
|
@@ -12966,7 +13467,7 @@ var PlaceOrder = ({
|
|
|
12966
13467
|
]
|
|
12967
13468
|
}
|
|
12968
13469
|
),
|
|
12969
|
-
/* @__PURE__ */ (0,
|
|
13470
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
12970
13471
|
ConnectKalshiModal,
|
|
12971
13472
|
{
|
|
12972
13473
|
open: isConnectKalshiModalOpen,
|
|
@@ -12974,39 +13475,39 @@ var PlaceOrder = ({
|
|
|
12974
13475
|
onVerify: handleVerifyKalshi
|
|
12975
13476
|
}
|
|
12976
13477
|
),
|
|
12977
|
-
/* @__PURE__ */ (0,
|
|
13478
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(FundKalshiModal, { open: isFundKalshiModalOpen, onOpenChange: setIsFundKalshiModalOpen })
|
|
12978
13479
|
] });
|
|
12979
13480
|
};
|
|
12980
13481
|
PlaceOrder.displayName = "PlaceOrder";
|
|
12981
13482
|
|
|
12982
13483
|
// src/trading/trading-context/index.tsx
|
|
12983
|
-
var
|
|
13484
|
+
var import_hooks38 = require("@agg-build/hooks");
|
|
12984
13485
|
|
|
12985
13486
|
// src/trading/use-claim-winnings.ts
|
|
12986
|
-
var
|
|
12987
|
-
var
|
|
13487
|
+
var import_hooks39 = require("@agg-build/hooks");
|
|
13488
|
+
var import_react17 = require("react");
|
|
12988
13489
|
var toClaimError = (err) => {
|
|
12989
13490
|
if (err instanceof Error) return err;
|
|
12990
13491
|
return new Error(String(err));
|
|
12991
13492
|
};
|
|
12992
13493
|
function useClaimWinnings(options = {}) {
|
|
12993
13494
|
const { onClaim, onClaimResult, onClaimSubmitError, externalClaimingKeys } = options;
|
|
12994
|
-
const labels = (0,
|
|
13495
|
+
const labels = (0, import_hooks39.useLabels)();
|
|
12995
13496
|
const claimNotificationLabels = labels.notifications.claim;
|
|
12996
13497
|
const toastCtx = useOptionalToast();
|
|
12997
|
-
const queryClient = (0,
|
|
12998
|
-
const redeemMutation = (0,
|
|
12999
|
-
const [activeRedeems, setActiveRedeems] = (0,
|
|
13000
|
-
const activeClaimKeysRef = (0,
|
|
13001
|
-
const pendingClaimToastIdsRef = (0,
|
|
13002
|
-
const submittedClaimToastKeysRef = (0,
|
|
13003
|
-
const [submittingClaimKeys, setSubmittingClaimKeys] = (0,
|
|
13004
|
-
const lifecycleInputs = (0,
|
|
13498
|
+
const queryClient = (0, import_hooks39.useQueryClient)();
|
|
13499
|
+
const redeemMutation = (0, import_hooks39.useRedeem)();
|
|
13500
|
+
const [activeRedeems, setActiveRedeems] = (0, import_react17.useState)({});
|
|
13501
|
+
const activeClaimKeysRef = (0, import_react17.useRef)(/* @__PURE__ */ new Set());
|
|
13502
|
+
const pendingClaimToastIdsRef = (0, import_react17.useRef)({});
|
|
13503
|
+
const submittedClaimToastKeysRef = (0, import_react17.useRef)(/* @__PURE__ */ new Set());
|
|
13504
|
+
const [submittingClaimKeys, setSubmittingClaimKeys] = (0, import_react17.useState)({});
|
|
13505
|
+
const lifecycleInputs = (0, import_react17.useMemo)(
|
|
13005
13506
|
() => Object.values(activeRedeems),
|
|
13006
13507
|
[activeRedeems]
|
|
13007
13508
|
);
|
|
13008
|
-
const lifecycleStates = (0,
|
|
13009
|
-
const internalClaimingIds = (0,
|
|
13509
|
+
const lifecycleStates = (0, import_hooks39.useRedeemLifecycles)(lifecycleInputs);
|
|
13510
|
+
const internalClaimingIds = (0, import_react17.useMemo)(() => {
|
|
13010
13511
|
const out = __spreadValues({}, submittingClaimKeys);
|
|
13011
13512
|
for (const [claimKey, active] of Object.entries(activeRedeems)) {
|
|
13012
13513
|
const state = lifecycleStates[active.redeemId];
|
|
@@ -13015,20 +13516,20 @@ function useClaimWinnings(options = {}) {
|
|
|
13015
13516
|
return out;
|
|
13016
13517
|
}, [activeRedeems, lifecycleStates, submittingClaimKeys]);
|
|
13017
13518
|
const claimingKeys = externalClaimingKeys != null ? externalClaimingKeys : internalClaimingIds;
|
|
13018
|
-
const isClaiming = (0,
|
|
13519
|
+
const isClaiming = (0, import_react17.useCallback)(
|
|
13019
13520
|
(claimKey) => Boolean(externalClaimingKeys == null ? void 0 : externalClaimingKeys[claimKey]) || Boolean(internalClaimingIds[claimKey]),
|
|
13020
13521
|
[externalClaimingKeys, internalClaimingIds]
|
|
13021
13522
|
);
|
|
13022
|
-
const invalidateClaimUiState = (0,
|
|
13023
|
-
(0,
|
|
13024
|
-
(0,
|
|
13523
|
+
const invalidateClaimUiState = (0, import_react17.useCallback)(() => {
|
|
13524
|
+
(0, import_hooks39.invalidateBalanceQueries)(queryClient);
|
|
13525
|
+
(0, import_hooks39.invalidatePositionQueries)(queryClient);
|
|
13025
13526
|
queryClient.invalidateQueries({
|
|
13026
|
-
queryKey:
|
|
13527
|
+
queryKey: import_hooks39.executionKeys.claimablePositionsCount(),
|
|
13027
13528
|
refetchType: "active"
|
|
13028
13529
|
});
|
|
13029
|
-
(0,
|
|
13530
|
+
(0, import_hooks39.invalidateUserActivityQueries)(queryClient);
|
|
13030
13531
|
}, [queryClient]);
|
|
13031
|
-
const claim = (0,
|
|
13532
|
+
const claim = (0, import_react17.useCallback)(
|
|
13032
13533
|
(_0) => __async(null, [_0], function* ({ claimKey, winningOutcomeIds, payload }) {
|
|
13033
13534
|
if (activeClaimKeysRef.current.has(claimKey) || Boolean(externalClaimingKeys == null ? void 0 : externalClaimingKeys[claimKey]) || internalClaimingIds[claimKey]) {
|
|
13034
13535
|
return;
|
|
@@ -13166,8 +13667,8 @@ function useClaimWinnings(options = {}) {
|
|
|
13166
13667
|
toastCtx
|
|
13167
13668
|
]
|
|
13168
13669
|
);
|
|
13169
|
-
const firedTerminalRef = (0,
|
|
13170
|
-
(0,
|
|
13670
|
+
const firedTerminalRef = (0, import_react17.useRef)({});
|
|
13671
|
+
(0, import_react17.useEffect)(() => {
|
|
13171
13672
|
var _a, _b;
|
|
13172
13673
|
for (const [claimKey, active] of Object.entries(activeRedeems)) {
|
|
13173
13674
|
const state = lifecycleStates[active.redeemId];
|
|
@@ -13223,8 +13724,8 @@ function useClaimWinnings(options = {}) {
|
|
|
13223
13724
|
}
|
|
13224
13725
|
|
|
13225
13726
|
// src/trading/use-resolved-market-claim.ts
|
|
13226
|
-
var
|
|
13227
|
-
var
|
|
13727
|
+
var import_hooks40 = require("@agg-build/hooks");
|
|
13728
|
+
var import_react18 = require("react");
|
|
13228
13729
|
var sharesFormatter = new Intl.NumberFormat("en-US", { maximumFractionDigits: 2 });
|
|
13229
13730
|
var dateFormatter = new Intl.DateTimeFormat("en-US", {
|
|
13230
13731
|
month: "short",
|
|
@@ -13240,18 +13741,18 @@ var formatResolutionDate = (value) => {
|
|
|
13240
13741
|
function useResolvedMarketClaim(options = {}) {
|
|
13241
13742
|
var _a;
|
|
13242
13743
|
const { market, enabled = true, executionMode } = options;
|
|
13243
|
-
const { isAuthenticated } = (0,
|
|
13244
|
-
const tradingState = (0,
|
|
13744
|
+
const { isAuthenticated } = (0, import_hooks40.useAggAuthState)();
|
|
13745
|
+
const tradingState = (0, import_react18.useMemo)(() => (0, import_hooks40.resolveMarketTradingState)(market), [market]);
|
|
13245
13746
|
const isResolved = tradingState.kind === "resolved";
|
|
13246
13747
|
const marketId = (_a = market == null ? void 0 : market.id) != null ? _a : null;
|
|
13247
13748
|
const shouldFetch = Boolean(enabled && isAuthenticated && isResolved && marketId);
|
|
13248
|
-
const { positions } = (0,
|
|
13749
|
+
const { positions } = (0, import_hooks40.useExecutionPositions)(__spreadValues({
|
|
13249
13750
|
enabled: shouldFetch,
|
|
13250
13751
|
status: "active",
|
|
13251
13752
|
limit: 50
|
|
13252
13753
|
}, executionMode === "paper" ? { mode: "paper" } : {}));
|
|
13253
13754
|
const claimWinnings = useClaimWinnings();
|
|
13254
|
-
return (0,
|
|
13755
|
+
return (0, import_react18.useMemo)(() => {
|
|
13255
13756
|
var _a2;
|
|
13256
13757
|
if (!shouldFetch || !marketId) return void 0;
|
|
13257
13758
|
const group = positions.find(
|
|
@@ -13262,7 +13763,7 @@ function useResolvedMarketClaim(options = {}) {
|
|
|
13262
13763
|
(outcome) => outcome.winner === true && outcome.totalSize > 0
|
|
13263
13764
|
);
|
|
13264
13765
|
if (winningOutcomes.length === 0) return void 0;
|
|
13265
|
-
const totals = (0,
|
|
13766
|
+
const totals = (0, import_hooks40.computeClosedPositionTotals)(group);
|
|
13266
13767
|
const winningShares = winningOutcomes.reduce((sum, outcome) => sum + outcome.totalSize, 0);
|
|
13267
13768
|
const winningOutcomeLabel = (_a2 = resolveResolvedOutcomeLabel({
|
|
13268
13769
|
market: market != null ? market : group.venueMarket,
|