@kite-copilot/chat-panel 0.2.52 → 0.2.54
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/auto.cjs +1524 -1110
- package/dist/auto.d.cts +1 -1
- package/dist/auto.d.ts +1 -1
- package/dist/auto.js +1 -1
- package/dist/{chunk-KIOKMXFF.js → chunk-TK7U64UR.js} +1525 -1111
- package/dist/{createKiteChat-DeQKgFyx.d.cts → createKiteChat-Cl1sNjam.d.cts} +6 -2
- package/dist/{createKiteChat-DeQKgFyx.d.ts → createKiteChat-Cl1sNjam.d.ts} +6 -2
- package/dist/embed.global.js +63 -24
- package/dist/index.cjs +1524 -1110
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -71,6 +71,7 @@ var import_client = require("react-dom/client");
|
|
|
71
71
|
|
|
72
72
|
// src/ChatPanel.tsx
|
|
73
73
|
var React6 = __toESM(require("react"), 1);
|
|
74
|
+
var import_react_dom = require("react-dom");
|
|
74
75
|
var import_supabase_js = require("@supabase/supabase-js");
|
|
75
76
|
|
|
76
77
|
// src/lib/utils.ts
|
|
@@ -1120,29 +1121,29 @@ function DataRenderer({ type, data }) {
|
|
|
1120
1121
|
// src/components/TypingIndicator.tsx
|
|
1121
1122
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1122
1123
|
function TypingIndicator({ className = "" }) {
|
|
1123
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.
|
|
1124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: `flex items-center gap-1.5 ${className}`, children: [
|
|
1124
1125
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1125
1126
|
"span",
|
|
1126
1127
|
{
|
|
1127
|
-
className: "w-2 h-2 bg-gray-
|
|
1128
|
+
className: "w-2 h-2 bg-gray-500 rounded-full animate-bounce",
|
|
1128
1129
|
style: { animationDelay: "0ms", animationDuration: "600ms" }
|
|
1129
1130
|
}
|
|
1130
1131
|
),
|
|
1131
1132
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1132
1133
|
"span",
|
|
1133
1134
|
{
|
|
1134
|
-
className: "w-2 h-2 bg-gray-
|
|
1135
|
+
className: "w-2 h-2 bg-gray-500 rounded-full animate-bounce",
|
|
1135
1136
|
style: { animationDelay: "150ms", animationDuration: "600ms" }
|
|
1136
1137
|
}
|
|
1137
1138
|
),
|
|
1138
1139
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1139
1140
|
"span",
|
|
1140
1141
|
{
|
|
1141
|
-
className: "w-2 h-2 bg-gray-
|
|
1142
|
+
className: "w-2 h-2 bg-gray-500 rounded-full animate-bounce",
|
|
1142
1143
|
style: { animationDelay: "300ms", animationDuration: "600ms" }
|
|
1143
1144
|
}
|
|
1144
1145
|
)
|
|
1145
|
-
] })
|
|
1146
|
+
] });
|
|
1146
1147
|
}
|
|
1147
1148
|
|
|
1148
1149
|
// src/ChatPanel.tsx
|
|
@@ -1591,6 +1592,132 @@ function AuthErrorState({
|
|
|
1591
1592
|
)
|
|
1592
1593
|
] });
|
|
1593
1594
|
}
|
|
1595
|
+
function ImageLightbox({
|
|
1596
|
+
imageUrl,
|
|
1597
|
+
onClose
|
|
1598
|
+
}) {
|
|
1599
|
+
const handleDownload = async () => {
|
|
1600
|
+
try {
|
|
1601
|
+
const response = await fetch(imageUrl);
|
|
1602
|
+
const blob = await response.blob();
|
|
1603
|
+
const url = window.URL.createObjectURL(blob);
|
|
1604
|
+
const a = document.createElement("a");
|
|
1605
|
+
a.href = url;
|
|
1606
|
+
const urlParts = imageUrl.split("/");
|
|
1607
|
+
const filename = urlParts[urlParts.length - 1] || "image.jpg";
|
|
1608
|
+
a.download = filename;
|
|
1609
|
+
document.body.appendChild(a);
|
|
1610
|
+
a.click();
|
|
1611
|
+
document.body.removeChild(a);
|
|
1612
|
+
window.URL.revokeObjectURL(url);
|
|
1613
|
+
} catch (error) {
|
|
1614
|
+
console.error("Failed to download image:", error);
|
|
1615
|
+
window.open(imageUrl, "_blank");
|
|
1616
|
+
}
|
|
1617
|
+
};
|
|
1618
|
+
return (0, import_react_dom.createPortal)(
|
|
1619
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1620
|
+
"div",
|
|
1621
|
+
{
|
|
1622
|
+
style: {
|
|
1623
|
+
position: "fixed",
|
|
1624
|
+
top: 0,
|
|
1625
|
+
left: 0,
|
|
1626
|
+
right: 0,
|
|
1627
|
+
bottom: 0,
|
|
1628
|
+
display: "flex",
|
|
1629
|
+
alignItems: "center",
|
|
1630
|
+
justifyContent: "center",
|
|
1631
|
+
backgroundColor: "rgba(0, 0, 0, 0.8)",
|
|
1632
|
+
zIndex: 99999
|
|
1633
|
+
},
|
|
1634
|
+
onClick: onClose,
|
|
1635
|
+
children: [
|
|
1636
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1637
|
+
"button",
|
|
1638
|
+
{
|
|
1639
|
+
onClick: (e) => {
|
|
1640
|
+
e.stopPropagation();
|
|
1641
|
+
onClose();
|
|
1642
|
+
},
|
|
1643
|
+
style: {
|
|
1644
|
+
position: "absolute",
|
|
1645
|
+
top: "16px",
|
|
1646
|
+
right: "16px",
|
|
1647
|
+
padding: "8px",
|
|
1648
|
+
borderRadius: "9999px",
|
|
1649
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
1650
|
+
color: "white",
|
|
1651
|
+
border: "none",
|
|
1652
|
+
cursor: "pointer",
|
|
1653
|
+
display: "flex",
|
|
1654
|
+
alignItems: "center",
|
|
1655
|
+
justifyContent: "center"
|
|
1656
|
+
},
|
|
1657
|
+
"aria-label": "Close",
|
|
1658
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.X, { style: { height: "24px", width: "24px" } })
|
|
1659
|
+
}
|
|
1660
|
+
),
|
|
1661
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1662
|
+
"div",
|
|
1663
|
+
{
|
|
1664
|
+
style: {
|
|
1665
|
+
position: "relative",
|
|
1666
|
+
maxWidth: "90vw",
|
|
1667
|
+
maxHeight: "90vh",
|
|
1668
|
+
display: "flex",
|
|
1669
|
+
flexDirection: "column",
|
|
1670
|
+
alignItems: "center"
|
|
1671
|
+
},
|
|
1672
|
+
onClick: (e) => e.stopPropagation(),
|
|
1673
|
+
children: [
|
|
1674
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1675
|
+
"img",
|
|
1676
|
+
{
|
|
1677
|
+
src: imageUrl,
|
|
1678
|
+
alt: "Full size preview",
|
|
1679
|
+
style: {
|
|
1680
|
+
maxWidth: "100%",
|
|
1681
|
+
maxHeight: "85vh",
|
|
1682
|
+
objectFit: "contain",
|
|
1683
|
+
borderRadius: "8px",
|
|
1684
|
+
boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)"
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
),
|
|
1688
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { display: "flex", gap: "12px", marginTop: "16px" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1689
|
+
"button",
|
|
1690
|
+
{
|
|
1691
|
+
onClick: handleDownload,
|
|
1692
|
+
style: {
|
|
1693
|
+
display: "flex",
|
|
1694
|
+
alignItems: "center",
|
|
1695
|
+
gap: "8px",
|
|
1696
|
+
padding: "8px 16px",
|
|
1697
|
+
backgroundColor: "white",
|
|
1698
|
+
color: "#1f2937",
|
|
1699
|
+
borderRadius: "8px",
|
|
1700
|
+
border: "none",
|
|
1701
|
+
cursor: "pointer",
|
|
1702
|
+
fontSize: "14px",
|
|
1703
|
+
fontWeight: 500,
|
|
1704
|
+
boxShadow: "0 10px 15px -3px rgba(0, 0, 0, 0.1)"
|
|
1705
|
+
},
|
|
1706
|
+
children: [
|
|
1707
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Download, { style: { height: "16px", width: "16px" } }),
|
|
1708
|
+
"Download"
|
|
1709
|
+
]
|
|
1710
|
+
}
|
|
1711
|
+
) })
|
|
1712
|
+
]
|
|
1713
|
+
}
|
|
1714
|
+
)
|
|
1715
|
+
]
|
|
1716
|
+
}
|
|
1717
|
+
),
|
|
1718
|
+
document.body
|
|
1719
|
+
);
|
|
1720
|
+
}
|
|
1594
1721
|
function ChatPanel({
|
|
1595
1722
|
isOpen = true,
|
|
1596
1723
|
onClose,
|
|
@@ -1611,7 +1738,8 @@ function ChatPanel({
|
|
|
1611
1738
|
initialCorner = "bottom-left",
|
|
1612
1739
|
onCornerChange,
|
|
1613
1740
|
productBackendUrl,
|
|
1614
|
-
getAuthHeaders
|
|
1741
|
+
getAuthHeaders,
|
|
1742
|
+
isEval = false
|
|
1615
1743
|
} = {}) {
|
|
1616
1744
|
const [messages, setMessages] = React6.useState(initialMessages);
|
|
1617
1745
|
const [input, setInput] = React6.useState("");
|
|
@@ -1721,13 +1849,20 @@ function ChatPanel({
|
|
|
1721
1849
|
}, [effectiveSupabaseUrl, effectiveSupabaseAnonKey]);
|
|
1722
1850
|
React6.useEffect(() => {
|
|
1723
1851
|
if (!isEscalated || !sessionId || !supabaseRef.current) {
|
|
1852
|
+
console.log("[KiteChat] Typing channel skip - isEscalated:", isEscalated, "sessionId:", sessionId, "supabase:", !!supabaseRef.current);
|
|
1724
1853
|
return;
|
|
1725
1854
|
}
|
|
1726
1855
|
const channelName = `typing:${sessionId}`;
|
|
1727
|
-
|
|
1856
|
+
console.log("[KiteChat] Subscribing to typing channel:", channelName, "sessionId:", sessionId);
|
|
1857
|
+
const channel = supabaseRef.current.channel(channelName, {
|
|
1858
|
+
config: { broadcast: { self: true } }
|
|
1859
|
+
});
|
|
1728
1860
|
channel.on("broadcast", { event: "typing" }, (payload) => {
|
|
1861
|
+
console.log("[KiteChat] Received typing event:", payload);
|
|
1729
1862
|
const { sender, isTyping } = payload.payload;
|
|
1863
|
+
console.log("[KiteChat] Typing event - sender:", sender, "isTyping:", isTyping);
|
|
1730
1864
|
if (sender === "agent") {
|
|
1865
|
+
console.log("[KiteChat] Setting agentIsTyping to:", isTyping);
|
|
1731
1866
|
setAgentIsTyping(isTyping);
|
|
1732
1867
|
if (isTyping) {
|
|
1733
1868
|
if (typingTimeoutRef.current) {
|
|
@@ -1739,6 +1874,7 @@ function ChatPanel({
|
|
|
1739
1874
|
}
|
|
1740
1875
|
}
|
|
1741
1876
|
}).subscribe((status) => {
|
|
1877
|
+
console.log("[KiteChat] Typing channel subscription status:", status);
|
|
1742
1878
|
if (status === "SUBSCRIBED") {
|
|
1743
1879
|
typingChannelRef.current = channel;
|
|
1744
1880
|
console.log("[KiteChat] Typing channel subscribed successfully");
|
|
@@ -1753,7 +1889,7 @@ function ChatPanel({
|
|
|
1753
1889
|
window.clearTimeout(typingTimeoutRef.current);
|
|
1754
1890
|
}
|
|
1755
1891
|
};
|
|
1756
|
-
}, [isEscalated, sessionId]);
|
|
1892
|
+
}, [isEscalated, sessionId, effectiveSupabaseUrl, effectiveSupabaseAnonKey]);
|
|
1757
1893
|
React6.useEffect(() => {
|
|
1758
1894
|
if (!isOpen && isEscalated && supabaseRef.current && sessionId) {
|
|
1759
1895
|
console.log("[KiteChat] Panel closed during live chat, marking disconnected");
|
|
@@ -1964,6 +2100,97 @@ function ChatPanel({
|
|
|
1964
2100
|
const [pendingBulkSession, setPendingBulkSession] = React6.useState(null);
|
|
1965
2101
|
const pendingBulkSessionRef = React6.useRef(null);
|
|
1966
2102
|
const fileInputRef = React6.useRef(null);
|
|
2103
|
+
const [pendingImages, setPendingImages] = React6.useState([]);
|
|
2104
|
+
const [isUploadingImage, setIsUploadingImage] = React6.useState(false);
|
|
2105
|
+
const [isDragOver, setIsDragOver] = React6.useState(false);
|
|
2106
|
+
const imageInputRef = React6.useRef(null);
|
|
2107
|
+
const [lightboxImageUrl, setLightboxImageUrl] = React6.useState(null);
|
|
2108
|
+
const uploadImageToStorage = React6.useCallback(async (file) => {
|
|
2109
|
+
if (!supabaseRef.current) {
|
|
2110
|
+
console.error("[KiteChat] Supabase client not available for file upload");
|
|
2111
|
+
return null;
|
|
2112
|
+
}
|
|
2113
|
+
const fileExt = file.name.split(".").pop();
|
|
2114
|
+
const fileName = `${sessionId}/${Date.now()}-${Math.random().toString(36).substring(7)}.${fileExt}`;
|
|
2115
|
+
const bucketName = "chat-attachments";
|
|
2116
|
+
try {
|
|
2117
|
+
const { data, error } = await supabaseRef.current.storage.from(bucketName).upload(fileName, file, {
|
|
2118
|
+
cacheControl: "3600",
|
|
2119
|
+
upsert: false
|
|
2120
|
+
});
|
|
2121
|
+
if (error) {
|
|
2122
|
+
console.error("[KiteChat] Upload error:", error);
|
|
2123
|
+
return null;
|
|
2124
|
+
}
|
|
2125
|
+
const { data: urlData } = supabaseRef.current.storage.from(bucketName).getPublicUrl(fileName);
|
|
2126
|
+
return urlData?.publicUrl || null;
|
|
2127
|
+
} catch (err) {
|
|
2128
|
+
console.error("[KiteChat] Upload failed:", err);
|
|
2129
|
+
return null;
|
|
2130
|
+
}
|
|
2131
|
+
}, [sessionId]);
|
|
2132
|
+
const handleImageSelect = React6.useCallback((files) => {
|
|
2133
|
+
if (!files) return;
|
|
2134
|
+
const imageFiles = Array.from(files).filter(
|
|
2135
|
+
(file) => file.type.startsWith("image/") || file.type === "application/pdf"
|
|
2136
|
+
);
|
|
2137
|
+
const newImages = imageFiles.map((file) => ({
|
|
2138
|
+
file,
|
|
2139
|
+
preview: file.type.startsWith("image/") ? URL.createObjectURL(file) : ""
|
|
2140
|
+
}));
|
|
2141
|
+
console.log("[KiteChat] Adding images to pending:", newImages.length, "files");
|
|
2142
|
+
setPendingImages((prev) => {
|
|
2143
|
+
const updated = [...prev, ...newImages];
|
|
2144
|
+
console.log("[KiteChat] pendingImages now:", updated.length);
|
|
2145
|
+
return updated;
|
|
2146
|
+
});
|
|
2147
|
+
}, []);
|
|
2148
|
+
React6.useEffect(() => {
|
|
2149
|
+
const hasText = input.trim().length > 0;
|
|
2150
|
+
const hasFile = !!pendingFile;
|
|
2151
|
+
const hasImages = pendingImages.length > 0;
|
|
2152
|
+
const disabled = !hasText && !hasFile && !hasImages || isWaitingForAuth;
|
|
2153
|
+
console.log("[KiteChat] Send button state:", {
|
|
2154
|
+
hasText,
|
|
2155
|
+
hasFile,
|
|
2156
|
+
hasImages,
|
|
2157
|
+
pendingImagesCount: pendingImages.length,
|
|
2158
|
+
isWaitingForAuth,
|
|
2159
|
+
authStatus: authState.status,
|
|
2160
|
+
disabled
|
|
2161
|
+
});
|
|
2162
|
+
}, [input, pendingFile, pendingImages, isWaitingForAuth, authState.status]);
|
|
2163
|
+
const handleDragOver = React6.useCallback((e) => {
|
|
2164
|
+
e.preventDefault();
|
|
2165
|
+
e.stopPropagation();
|
|
2166
|
+
setIsDragOver(true);
|
|
2167
|
+
}, []);
|
|
2168
|
+
const handleDragLeave = React6.useCallback((e) => {
|
|
2169
|
+
e.preventDefault();
|
|
2170
|
+
e.stopPropagation();
|
|
2171
|
+
setIsDragOver(false);
|
|
2172
|
+
}, []);
|
|
2173
|
+
const handleDrop = React6.useCallback((e) => {
|
|
2174
|
+
e.preventDefault();
|
|
2175
|
+
e.stopPropagation();
|
|
2176
|
+
setIsDragOver(false);
|
|
2177
|
+
const files = e.dataTransfer.files;
|
|
2178
|
+
if (files.length > 0) {
|
|
2179
|
+
const csvFile = Array.from(files).find((f) => f.name.endsWith(".csv"));
|
|
2180
|
+
if (csvFile && !isEscalated) {
|
|
2181
|
+
setPendingFile(csvFile);
|
|
2182
|
+
} else {
|
|
2183
|
+
handleImageSelect(files);
|
|
2184
|
+
}
|
|
2185
|
+
}
|
|
2186
|
+
}, [isEscalated, handleImageSelect]);
|
|
2187
|
+
React6.useEffect(() => {
|
|
2188
|
+
return () => {
|
|
2189
|
+
pendingImages.forEach((img) => {
|
|
2190
|
+
if (img.preview) URL.revokeObjectURL(img.preview);
|
|
2191
|
+
});
|
|
2192
|
+
};
|
|
2193
|
+
}, [pendingImages]);
|
|
1967
2194
|
const [searchExpanded, setSearchExpanded] = React6.useState(false);
|
|
1968
2195
|
const [searchInput, setSearchInput] = React6.useState("");
|
|
1969
2196
|
const searchInputRef = React6.useRef(null);
|
|
@@ -2020,6 +2247,11 @@ function ChatPanel({
|
|
|
2020
2247
|
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
2021
2248
|
}
|
|
2022
2249
|
}, [messages, phase, activeGuide]);
|
|
2250
|
+
React6.useEffect(() => {
|
|
2251
|
+
if (isEscalated && agentIsTyping && !activeGuide) {
|
|
2252
|
+
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
2253
|
+
}
|
|
2254
|
+
}, [isEscalated, agentIsTyping, activeGuide]);
|
|
2023
2255
|
const latestBulkSummaryNavigation = React6.useMemo(() => {
|
|
2024
2256
|
for (let i = messages.length - 1; i >= 0; i--) {
|
|
2025
2257
|
const msg = messages[i];
|
|
@@ -2089,12 +2321,20 @@ function ChatPanel({
|
|
|
2089
2321
|
onNavigate
|
|
2090
2322
|
]);
|
|
2091
2323
|
const connectToEscalationWs = React6.useCallback((currentSessionId) => {
|
|
2092
|
-
if (!agentUrl)
|
|
2324
|
+
if (!agentUrl) {
|
|
2325
|
+
console.log("[KiteChat] No agentUrl, skipping WebSocket connection");
|
|
2326
|
+
return;
|
|
2327
|
+
}
|
|
2093
2328
|
if (escalationWsRef.current) {
|
|
2329
|
+
console.log("[KiteChat] Closing existing WebSocket connection");
|
|
2094
2330
|
escalationWsRef.current.close();
|
|
2095
2331
|
}
|
|
2096
2332
|
const wsUrl = agentUrl.replace(/^http/, "ws") + `/ws/escalation/${currentSessionId}`;
|
|
2333
|
+
console.log("[KiteChat] Connecting to escalation WebSocket:", wsUrl);
|
|
2097
2334
|
const ws = new WebSocket(wsUrl);
|
|
2335
|
+
ws.onopen = () => {
|
|
2336
|
+
console.log("[KiteChat] Escalation WebSocket connected successfully");
|
|
2337
|
+
};
|
|
2098
2338
|
ws.onmessage = (event) => {
|
|
2099
2339
|
try {
|
|
2100
2340
|
const data = JSON.parse(event.data);
|
|
@@ -2125,13 +2365,18 @@ function ChatPanel({
|
|
|
2125
2365
|
ws.onerror = (err) => {
|
|
2126
2366
|
console.error("[KiteChat] Escalation WebSocket error:", err);
|
|
2127
2367
|
};
|
|
2128
|
-
ws.onclose = () => {
|
|
2368
|
+
ws.onclose = (event) => {
|
|
2369
|
+
console.log("[KiteChat] Escalation WebSocket closed - code:", event.code, "reason:", event.reason);
|
|
2129
2370
|
};
|
|
2130
2371
|
escalationWsRef.current = ws;
|
|
2131
2372
|
}, [agentUrl]);
|
|
2132
2373
|
const sendEscalatedMessage = React6.useCallback(async (content) => {
|
|
2133
|
-
if (!escalationWsRef.current
|
|
2134
|
-
console.error("[KiteChat] Escalation WebSocket not connected");
|
|
2374
|
+
if (!escalationWsRef.current) {
|
|
2375
|
+
console.error("[KiteChat] Escalation WebSocket not connected - no ref");
|
|
2376
|
+
return false;
|
|
2377
|
+
}
|
|
2378
|
+
if (escalationWsRef.current.readyState !== WebSocket.OPEN) {
|
|
2379
|
+
console.error("[KiteChat] Escalation WebSocket not connected - state:", escalationWsRef.current.readyState, "(0=CONNECTING, 1=OPEN, 2=CLOSING, 3=CLOSED)");
|
|
2135
2380
|
return false;
|
|
2136
2381
|
}
|
|
2137
2382
|
try {
|
|
@@ -2163,7 +2408,9 @@ function ChatPanel({
|
|
|
2163
2408
|
};
|
|
2164
2409
|
}, []);
|
|
2165
2410
|
React6.useEffect(() => {
|
|
2411
|
+
console.log("[KiteChat] Escalation useEffect - isEscalated:", isEscalated, "sessionId:", sessionId);
|
|
2166
2412
|
if (isEscalated && sessionId) {
|
|
2413
|
+
console.log("[KiteChat] Triggering WebSocket connection for escalation");
|
|
2167
2414
|
connectToEscalationWs(sessionId);
|
|
2168
2415
|
}
|
|
2169
2416
|
}, [isEscalated, sessionId, connectToEscalationWs]);
|
|
@@ -2256,7 +2503,7 @@ function ChatPanel({
|
|
|
2256
2503
|
setPanelView("landing");
|
|
2257
2504
|
setCurrentFolderId(void 0);
|
|
2258
2505
|
}
|
|
2259
|
-
function handleSubmit(e) {
|
|
2506
|
+
async function handleSubmit(e) {
|
|
2260
2507
|
e.preventDefault();
|
|
2261
2508
|
const trimmed = input.trim();
|
|
2262
2509
|
if (pendingFile) {
|
|
@@ -2276,6 +2523,49 @@ function ChatPanel({
|
|
|
2276
2523
|
if (fileInputRef.current) fileInputRef.current.value = "";
|
|
2277
2524
|
return;
|
|
2278
2525
|
}
|
|
2526
|
+
if (pendingImages.length > 0) {
|
|
2527
|
+
setIsUploadingImage(true);
|
|
2528
|
+
try {
|
|
2529
|
+
const uploadedUrls = [];
|
|
2530
|
+
for (const img of pendingImages) {
|
|
2531
|
+
const url = await uploadImageToStorage(img.file);
|
|
2532
|
+
if (url) {
|
|
2533
|
+
uploadedUrls.push(url);
|
|
2534
|
+
}
|
|
2535
|
+
if (img.preview) URL.revokeObjectURL(img.preview);
|
|
2536
|
+
}
|
|
2537
|
+
if (uploadedUrls.length > 0) {
|
|
2538
|
+
const imageMarkdown = uploadedUrls.map((url) => ``).join("\n");
|
|
2539
|
+
const messageContent = trimmed ? `${trimmed}
|
|
2540
|
+
|
|
2541
|
+
${imageMarkdown}` : imageMarkdown;
|
|
2542
|
+
const userMessage = {
|
|
2543
|
+
id: Date.now(),
|
|
2544
|
+
role: "user",
|
|
2545
|
+
content: messageContent,
|
|
2546
|
+
imageUrls: uploadedUrls
|
|
2547
|
+
};
|
|
2548
|
+
setMessages((prev) => [...prev, userMessage]);
|
|
2549
|
+
if (isEscalated) {
|
|
2550
|
+
sendEscalatedMessage(messageContent);
|
|
2551
|
+
sendTypingIndicator(false);
|
|
2552
|
+
if (userTypingTimeoutRef.current) {
|
|
2553
|
+
window.clearTimeout(userTypingTimeoutRef.current);
|
|
2554
|
+
userTypingTimeoutRef.current = null;
|
|
2555
|
+
}
|
|
2556
|
+
} else {
|
|
2557
|
+
startChatFlow(messageContent);
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
} catch (err) {
|
|
2561
|
+
console.error("[KiteChat] Failed to upload images:", err);
|
|
2562
|
+
} finally {
|
|
2563
|
+
setIsUploadingImage(false);
|
|
2564
|
+
setPendingImages([]);
|
|
2565
|
+
setInput("");
|
|
2566
|
+
}
|
|
2567
|
+
return;
|
|
2568
|
+
}
|
|
2279
2569
|
if (!trimmed) return;
|
|
2280
2570
|
if (isEscalated) {
|
|
2281
2571
|
const userMessage = {
|
|
@@ -2440,7 +2730,8 @@ function ChatPanel({
|
|
|
2440
2730
|
user_id: userId,
|
|
2441
2731
|
org_id: orgId,
|
|
2442
2732
|
user_name: userName,
|
|
2443
|
-
user_email: userEmail
|
|
2733
|
+
user_email: userEmail,
|
|
2734
|
+
is_eval: isEval
|
|
2444
2735
|
}),
|
|
2445
2736
|
signal: controller.signal
|
|
2446
2737
|
});
|
|
@@ -3333,19 +3624,23 @@ ${userText}`
|
|
|
3333
3624
|
)
|
|
3334
3625
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
3335
3626
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3336
|
-
"
|
|
3627
|
+
"textarea",
|
|
3337
3628
|
{
|
|
3338
3629
|
ref: searchInputRef,
|
|
3339
|
-
type: "text",
|
|
3340
3630
|
value: searchInput,
|
|
3341
|
-
onChange: (e) =>
|
|
3631
|
+
onChange: (e) => {
|
|
3632
|
+
setSearchInput(e.target.value);
|
|
3633
|
+
e.target.style.height = "auto";
|
|
3634
|
+
e.target.style.height = Math.min(e.target.scrollHeight, 120) + "px";
|
|
3635
|
+
},
|
|
3342
3636
|
onKeyDown: (e) => {
|
|
3343
|
-
if (e.key === "Enter" && searchInput.trim()) {
|
|
3637
|
+
if (e.key === "Enter" && !e.shiftKey && searchInput.trim()) {
|
|
3344
3638
|
e.preventDefault();
|
|
3345
3639
|
onOpen?.();
|
|
3346
3640
|
startChatFlow(searchInput.trim());
|
|
3347
3641
|
setSearchInput("");
|
|
3348
3642
|
setSearchExpanded(false);
|
|
3643
|
+
e.currentTarget.style.height = "auto";
|
|
3349
3644
|
} else if (e.key === "Escape") {
|
|
3350
3645
|
setSearchExpanded(false);
|
|
3351
3646
|
setSearchInput("");
|
|
@@ -3357,7 +3652,8 @@ ${userText}`
|
|
|
3357
3652
|
}
|
|
3358
3653
|
},
|
|
3359
3654
|
placeholder: "Ask a question...",
|
|
3360
|
-
|
|
3655
|
+
rows: 1,
|
|
3656
|
+
className: "flex-1 text-sm text-gray-700 outline-none bg-transparent resize-none min-h-[20px] max-h-[120px]"
|
|
3361
3657
|
}
|
|
3362
3658
|
),
|
|
3363
3659
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
@@ -3384,8 +3680,8 @@ ${userText}`
|
|
|
3384
3680
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3385
3681
|
"section",
|
|
3386
3682
|
{
|
|
3387
|
-
className: `fixed
|
|
3388
|
-
style: { width: `${PANEL_WIDTH}px` },
|
|
3683
|
+
className: `fixed bottom-4 z-40 flex flex-col bg-white border border-gray-200 rounded-2xl overflow-hidden shadow-2xl ${corner === "bottom-left" ? "left-4" : "right-4"} ${isOpen ? "opacity-100 scale-100" : "opacity-0 scale-95 pointer-events-none"}`,
|
|
3684
|
+
style: { width: `${PANEL_WIDTH}px`, height: `${PANEL_HEIGHT}px` },
|
|
3389
3685
|
children: [
|
|
3390
3686
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0", children: [
|
|
3391
3687
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2.5", children: [
|
|
@@ -3416,8 +3712,8 @@ ${userText}`
|
|
|
3416
3712
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3417
3713
|
"section",
|
|
3418
3714
|
{
|
|
3419
|
-
className: `fixed
|
|
3420
|
-
style: { width: `${PANEL_WIDTH}px` },
|
|
3715
|
+
className: `fixed bottom-4 z-40 flex flex-col bg-white border border-gray-200 rounded-2xl overflow-hidden shadow-2xl ${corner === "bottom-left" ? "left-4" : "right-4"} ${isOpen ? "opacity-100 scale-100" : "opacity-0 scale-95 pointer-events-none"}`,
|
|
3716
|
+
style: { width: `${PANEL_WIDTH}px`, height: `${PANEL_HEIGHT}px` },
|
|
3421
3717
|
children: [
|
|
3422
3718
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0", children: [
|
|
3423
3719
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2.5", children: [
|
|
@@ -3444,8 +3740,8 @@ ${userText}`
|
|
|
3444
3740
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3445
3741
|
"section",
|
|
3446
3742
|
{
|
|
3447
|
-
className: `fixed
|
|
3448
|
-
style: { width: `${PANEL_WIDTH}px` },
|
|
3743
|
+
className: `fixed bottom-4 z-40 flex flex-col bg-white border border-gray-200 rounded-2xl overflow-hidden shadow-2xl ${corner === "bottom-left" ? "left-4" : "right-4"} ${isOpen ? "opacity-100 scale-100" : "opacity-0 scale-95 pointer-events-none"}`,
|
|
3744
|
+
style: { width: `${PANEL_WIDTH}px`, height: `${PANEL_HEIGHT}px` },
|
|
3449
3745
|
children: [
|
|
3450
3746
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0", children: [
|
|
3451
3747
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2.5", children: [
|
|
@@ -3497,9 +3793,8 @@ ${userText}`
|
|
|
3497
3793
|
size: "sm",
|
|
3498
3794
|
className: "h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",
|
|
3499
3795
|
onClick: () => {
|
|
3500
|
-
resetSession();
|
|
3501
3796
|
setMessages([]);
|
|
3502
|
-
|
|
3797
|
+
resetSession();
|
|
3503
3798
|
setCurrentFolderId(void 0);
|
|
3504
3799
|
setActiveGuide(void 0);
|
|
3505
3800
|
activeGuideRef.current = void 0;
|
|
@@ -3531,1258 +3826,1368 @@ ${userText}`
|
|
|
3531
3826
|
)
|
|
3532
3827
|
] })
|
|
3533
3828
|
] }),
|
|
3534
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
{
|
|
3552
|
-
type: "button",
|
|
3553
|
-
size: "sm",
|
|
3554
|
-
variant: "ghost",
|
|
3555
|
-
className: "w-full justify-start rounded-lg px-3 py-1.5 text-xs text-gray-700 hover:bg-gray-100 h-auto",
|
|
3556
|
-
onClick: () => sendTopic(question.prompt),
|
|
3557
|
-
children: [
|
|
3558
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3559
|
-
"span",
|
|
3560
|
-
{
|
|
3561
|
-
className: `mr-2 inline-block h-1.5 w-1.5 rounded-full ${iconColors[index % iconColors.length]}`
|
|
3562
|
-
}
|
|
3563
|
-
),
|
|
3564
|
-
question.label
|
|
3565
|
-
]
|
|
3566
|
-
},
|
|
3567
|
-
question.id
|
|
3568
|
-
);
|
|
3569
|
-
}) }) }),
|
|
3570
|
-
panelView === "folder" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
3571
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mb-3 flex items-center gap-2", children: [
|
|
3572
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3829
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex-1 flex flex-col min-h-0 overflow-hidden relative", children: [
|
|
3830
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3831
|
+
"div",
|
|
3832
|
+
{
|
|
3833
|
+
className: `absolute inset-0 grid place-items-center overflow-y-auto ${isEmpty ? "visible" : "invisible pointer-events-none"}`,
|
|
3834
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w-full px-4", children: [
|
|
3835
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "py-3", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h2", { className: "text-center text-2xl font-semibold text-gray-900", children: panelView === "folder" ? folders.find((f) => f.id === currentFolderId)?.title || "" : "How can I help?" }) }),
|
|
3836
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "pb-4 px-4", children: [
|
|
3837
|
+
panelView === "landing" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-col gap-1", children: loadingQuestions ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Loader2, { className: "h-4 w-4 animate-spin text-gray-400" }) }) : startingQuestions.map((question, index) => {
|
|
3838
|
+
const iconColors = [
|
|
3839
|
+
"bg-blue-400",
|
|
3840
|
+
"bg-green-400",
|
|
3841
|
+
"bg-purple-400",
|
|
3842
|
+
"bg-orange-400",
|
|
3843
|
+
"bg-pink-400"
|
|
3844
|
+
];
|
|
3845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3573
3846
|
Button,
|
|
3574
3847
|
{
|
|
3575
3848
|
type: "button",
|
|
3576
|
-
size: "
|
|
3849
|
+
size: "sm",
|
|
3577
3850
|
variant: "ghost",
|
|
3578
|
-
className: "
|
|
3579
|
-
onClick:
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3851
|
+
className: "w-full justify-start rounded-lg px-3 py-1.5 text-xs text-gray-700 hover:bg-gray-100 h-auto",
|
|
3852
|
+
onClick: () => sendTopic(question.prompt),
|
|
3853
|
+
children: [
|
|
3854
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3855
|
+
"span",
|
|
3856
|
+
{
|
|
3857
|
+
className: `mr-2 inline-block h-1.5 w-1.5 rounded-full ${iconColors[index % iconColors.length]}`
|
|
3858
|
+
}
|
|
3859
|
+
),
|
|
3860
|
+
question.label
|
|
3861
|
+
]
|
|
3862
|
+
},
|
|
3863
|
+
question.id
|
|
3864
|
+
);
|
|
3865
|
+
}) }) }),
|
|
3866
|
+
panelView === "folder" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
3867
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mb-3 flex items-center gap-2", children: [
|
|
3868
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3869
|
+
Button,
|
|
3870
|
+
{
|
|
3871
|
+
type: "button",
|
|
3872
|
+
size: "icon",
|
|
3873
|
+
variant: "ghost",
|
|
3874
|
+
className: "h-7 w-7 rounded-full hover:bg-gray-100",
|
|
3875
|
+
onClick: closeFolder,
|
|
3876
|
+
"aria-label": "Back to suggestions",
|
|
3877
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ArrowLeft, { className: "h-4 w-4 text-gray-500" })
|
|
3878
|
+
}
|
|
3879
|
+
),
|
|
3880
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs font-medium uppercase tracking-wide text-gray-400", children: "Topics" })
|
|
3881
|
+
] }),
|
|
3882
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-col gap-1.5", children: folders.find((f) => f.id === currentFolderId)?.topics.map((topic) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3883
|
+
Button,
|
|
3884
|
+
{
|
|
3885
|
+
type: "button",
|
|
3886
|
+
size: "sm",
|
|
3887
|
+
variant: "secondary",
|
|
3888
|
+
className: "justify-start rounded-xl border border-gray-200 bg-gray-50 px-3 py-2.5 text-xs text-gray-700 shadow-none transition-all hover:bg-gray-100 hover:border-gray-300 h-auto",
|
|
3889
|
+
onClick: () => sendTopic(topic.prompt),
|
|
3890
|
+
children: topic.label
|
|
3891
|
+
},
|
|
3892
|
+
topic.id
|
|
3893
|
+
)) })
|
|
3894
|
+
] })
|
|
3598
3895
|
] })
|
|
3599
3896
|
] })
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
} else if (message.kind === "guideComplete") {
|
|
3897
|
+
}
|
|
3898
|
+
),
|
|
3899
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `flex-1 flex flex-col min-h-0 overflow-hidden ${isEmpty ? "invisible pointer-events-none" : "visible"}`, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex-1 min-h-0 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ScrollArea, { ref: messagesContainerRef, className: "h-full", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-2 px-4 py-3", children: [
|
|
3900
|
+
messages.map((message, index) => {
|
|
3901
|
+
const isUser = message.role === "user";
|
|
3902
|
+
const previousRole = index > 0 ? messages[index - 1].role : void 0;
|
|
3903
|
+
const isRoleChange = previousRole !== void 0 && previousRole !== message.role;
|
|
3904
|
+
const currentGuide = activeGuideRef.current || activeGuide;
|
|
3905
|
+
let isCurrentGuideStep = false;
|
|
3906
|
+
if (currentGuide && message.kind === "guideStep") {
|
|
3907
|
+
if (message.guideStepIndex !== void 0) {
|
|
3908
|
+
isCurrentGuideStep = message.guideStepIndex === currentGuide.stepIndex;
|
|
3909
|
+
} else {
|
|
3614
3910
|
isCurrentGuideStep = index === messages.length - 1;
|
|
3615
3911
|
}
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
] }, message.id);
|
|
3627
|
-
}
|
|
3628
|
-
if (message.kind === "searchSummary") {
|
|
3629
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3630
|
-
"div",
|
|
3912
|
+
} else if (message.kind === "guideComplete") {
|
|
3913
|
+
isCurrentGuideStep = index === messages.length - 1;
|
|
3914
|
+
}
|
|
3915
|
+
if (message.kind === "guideStep" && !isCurrentGuideStep) {
|
|
3916
|
+
return null;
|
|
3917
|
+
}
|
|
3918
|
+
if (isUser) {
|
|
3919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `flex flex-col items-end gap-2 ${isRoleChange ? "mt-3" : ""}`, children: [
|
|
3920
|
+
message.imageUrls && message.imageUrls.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-wrap gap-1 justify-end max-w-[260px]", children: message.imageUrls.map((url, imgIndex) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3921
|
+
"button",
|
|
3631
3922
|
{
|
|
3632
|
-
|
|
3923
|
+
onClick: () => setLightboxImageUrl(url),
|
|
3924
|
+
className: "block cursor-pointer",
|
|
3633
3925
|
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3634
|
-
|
|
3926
|
+
"img",
|
|
3635
3927
|
{
|
|
3636
|
-
|
|
3637
|
-
|
|
3928
|
+
src: url,
|
|
3929
|
+
alt: `Attachment ${imgIndex + 1}`,
|
|
3930
|
+
className: "max-h-32 max-w-[200px] rounded-lg object-cover border border-gray-700 hover:opacity-90 transition-opacity"
|
|
3638
3931
|
}
|
|
3639
3932
|
)
|
|
3640
3933
|
},
|
|
3641
|
-
|
|
3642
|
-
)
|
|
3934
|
+
imgIndex
|
|
3935
|
+
)) }),
|
|
3936
|
+
message.content && !message.content.match(/^!\[image\]\([^)]+\)(\n!\[image\]\([^)]+\))*$/) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "max-w-[260px] rounded-2xl rounded-br-md bg-gray-900 px-3 py-2 text-sm text-white shadow-sm", children: message.content.replace(/!\[image\]\([^)]+\)\n*/g, "").trim() })
|
|
3937
|
+
] }, message.id);
|
|
3938
|
+
}
|
|
3939
|
+
if (message.role === "agent") {
|
|
3940
|
+
const imageRegex = /!\[image\]\(([^)]+)\)/g;
|
|
3941
|
+
const extractedImageUrls = [];
|
|
3942
|
+
let match;
|
|
3943
|
+
const contentStr = message.content || "";
|
|
3944
|
+
while ((match = imageRegex.exec(contentStr)) !== null) {
|
|
3945
|
+
extractedImageUrls.push(match[1]);
|
|
3643
3946
|
}
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3947
|
+
const agentImageUrls = message.imageUrls || extractedImageUrls;
|
|
3948
|
+
const agentTextContent = contentStr.replace(/!\[image\]\([^)]+\)\n*/g, "").trim();
|
|
3949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `flex flex-col items-start gap-2 ${isRoleChange ? "mt-3" : ""}`, children: [
|
|
3950
|
+
isRoleChange && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-[10px] text-gray-500 mb-1 ml-1", children: "Agent" }),
|
|
3951
|
+
agentImageUrls.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-wrap gap-1 justify-start max-w-[300px]", children: agentImageUrls.map((url, imgIndex) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3952
|
+
"button",
|
|
3647
3953
|
{
|
|
3648
|
-
|
|
3649
|
-
className:
|
|
3650
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime10.
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3954
|
+
onClick: () => setLightboxImageUrl(url),
|
|
3955
|
+
className: "block cursor-pointer",
|
|
3956
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3957
|
+
"img",
|
|
3958
|
+
{
|
|
3959
|
+
src: url,
|
|
3960
|
+
alt: `Attachment ${imgIndex + 1}`,
|
|
3961
|
+
className: "max-h-32 max-w-[200px] rounded-lg object-cover border border-gray-300 hover:opacity-90 transition-opacity"
|
|
3962
|
+
}
|
|
3963
|
+
)
|
|
3654
3964
|
},
|
|
3655
|
-
|
|
3656
|
-
)
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3965
|
+
imgIndex
|
|
3966
|
+
)) }),
|
|
3967
|
+
agentTextContent && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "max-w-[300px] rounded-2xl rounded-bl-md bg-gray-100 px-4 py-3 text-sm text-gray-700", children: agentTextContent })
|
|
3968
|
+
] }, message.id);
|
|
3969
|
+
}
|
|
3970
|
+
if (message.kind === "searchSummary") {
|
|
3971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3972
|
+
"div",
|
|
3973
|
+
{
|
|
3974
|
+
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
3975
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3976
|
+
AssistantSearchSummary,
|
|
3977
|
+
{
|
|
3978
|
+
title: message.title ?? "Search results",
|
|
3979
|
+
links: message.links ?? []
|
|
3980
|
+
}
|
|
3981
|
+
)
|
|
3982
|
+
},
|
|
3983
|
+
message.id
|
|
3984
|
+
);
|
|
3985
|
+
}
|
|
3986
|
+
if (message.kind === "guideComplete") {
|
|
3987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3988
|
+
"div",
|
|
3989
|
+
{
|
|
3990
|
+
ref: isCurrentGuideStep ? currentStepRef : null,
|
|
3991
|
+
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
3992
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2 rounded-xl bg-green-50 border border-green-200 px-3 py-2.5 text-sm leading-6", children: [
|
|
3993
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CheckCircle2, { className: "h-5 w-5 text-green-600 flex-shrink-0" }),
|
|
3994
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "font-medium text-green-800", children: message.content })
|
|
3995
|
+
] })
|
|
3996
|
+
},
|
|
3997
|
+
message.id
|
|
3998
|
+
);
|
|
3999
|
+
}
|
|
4000
|
+
if (message.kind === "navigationAction") {
|
|
4001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4002
|
+
"div",
|
|
4003
|
+
{
|
|
4004
|
+
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
4005
|
+
children: [
|
|
4006
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-2 text-gray-700", children: message.content || "" }),
|
|
4007
|
+
message.navigationTarget && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4008
|
+
Button,
|
|
4009
|
+
{
|
|
4010
|
+
type: "button",
|
|
4011
|
+
size: "sm",
|
|
4012
|
+
variant: "secondary",
|
|
4013
|
+
className: "h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",
|
|
4014
|
+
onClick: () => message.navigationTarget && handleConfirmNavigation(
|
|
4015
|
+
message.navigationTarget
|
|
4016
|
+
),
|
|
4017
|
+
children: [
|
|
4018
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "Confirm" }),
|
|
4019
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
|
|
4020
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
|
|
4021
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
|
|
4022
|
+
] })
|
|
4023
|
+
]
|
|
4024
|
+
}
|
|
4025
|
+
) })
|
|
4026
|
+
]
|
|
4027
|
+
},
|
|
4028
|
+
message.id
|
|
4029
|
+
);
|
|
4030
|
+
}
|
|
4031
|
+
if (message.kind === "actionForm") {
|
|
4032
|
+
const actionType = message.actionType;
|
|
4033
|
+
const formData = Object.keys(actionFormData).length > 0 ? actionFormData : message.actionData || {};
|
|
4034
|
+
if (message.isSubmitted) {
|
|
4035
|
+
let successContent = "";
|
|
4036
|
+
if (actionType === "updateCompanyInfo") {
|
|
4037
|
+
successContent = "Company information has been updated successfully.";
|
|
4038
|
+
} else if (actionType === "addApiKey") {
|
|
4039
|
+
successContent = "API key has been added successfully.";
|
|
4040
|
+
} else if (actionType === "addCustomer") {
|
|
4041
|
+
successContent = "Customer has been added successfully.";
|
|
4042
|
+
} else if (actionType === "enable2FA") {
|
|
4043
|
+
successContent = "Two-factor authentication has been enabled successfully.";
|
|
4044
|
+
} else if (actionType === "disable2FA") {
|
|
4045
|
+
successContent = "Two-factor authentication has been disabled successfully.";
|
|
4046
|
+
} else if (actionType === "changePassword") {
|
|
4047
|
+
successContent = "Your password has been changed successfully.";
|
|
4048
|
+
} else if (actionType === "revokeSession") {
|
|
4049
|
+
successContent = "Session has been revoked successfully.";
|
|
4050
|
+
} else if (actionType === "toggleNotification") {
|
|
4051
|
+
successContent = "Notification preferences have been updated successfully.";
|
|
4052
|
+
} else if (actionType === "connectIntegration") {
|
|
4053
|
+
successContent = "Integration has been connected successfully.";
|
|
4054
|
+
} else if (actionType === "disconnectIntegration") {
|
|
4055
|
+
successContent = "Integration has been disconnected successfully.";
|
|
4056
|
+
} else if (actionType === "addPaymentMethod") {
|
|
4057
|
+
successContent = "Payment method has been added successfully.";
|
|
4058
|
+
} else if (actionType === "removePaymentMethod") {
|
|
4059
|
+
successContent = "Payment method has been removed successfully.";
|
|
4060
|
+
} else if (actionType === "deleteApiKey") {
|
|
4061
|
+
successContent = "API key has been deleted successfully.";
|
|
4062
|
+
} else if (actionType === "addWebhook") {
|
|
4063
|
+
successContent = "Webhook endpoint has been added successfully.";
|
|
4064
|
+
} else if (actionType === "updateCurrency") {
|
|
4065
|
+
successContent = "Currency preference has been updated successfully.";
|
|
4066
|
+
} else if (actionType === "updateTimezone") {
|
|
4067
|
+
successContent = "Timezone has been updated successfully.";
|
|
4068
|
+
} else if (actionType === "refundPayment") {
|
|
4069
|
+
successContent = "Refund has been processed successfully.";
|
|
4070
|
+
} else if (actionType === "exportCertificate") {
|
|
4071
|
+
successContent = "Certificate of Incorporation has been downloaded successfully.";
|
|
4072
|
+
} else if (actionType === "createSubscription") {
|
|
4073
|
+
successContent = "Subscription has been created successfully.";
|
|
4074
|
+
} else if (actionType === "toggleBlockRule" || actionType === "enableBlockRule" || actionType === "disableBlockRule") {
|
|
4075
|
+
successContent = "Block rule has been updated successfully.";
|
|
4076
|
+
} else {
|
|
4077
|
+
successContent = "Action completed successfully.";
|
|
4078
|
+
}
|
|
4079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3660
4080
|
"div",
|
|
3661
4081
|
{
|
|
3662
4082
|
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
3663
|
-
children:
|
|
3664
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-2 text-gray-700", children: message.content || "" }),
|
|
3665
|
-
message.navigationTarget && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3666
|
-
Button,
|
|
3667
|
-
{
|
|
3668
|
-
type: "button",
|
|
3669
|
-
size: "sm",
|
|
3670
|
-
variant: "secondary",
|
|
3671
|
-
className: "h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",
|
|
3672
|
-
onClick: () => message.navigationTarget && handleConfirmNavigation(
|
|
3673
|
-
message.navigationTarget
|
|
3674
|
-
),
|
|
3675
|
-
children: [
|
|
3676
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "Confirm" }),
|
|
3677
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
|
|
3678
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
|
|
3679
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
|
|
3680
|
-
] })
|
|
3681
|
-
]
|
|
3682
|
-
}
|
|
3683
|
-
) })
|
|
3684
|
-
]
|
|
4083
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 text-gray-700", children: successContent })
|
|
3685
4084
|
},
|
|
3686
4085
|
message.id
|
|
3687
4086
|
);
|
|
3688
4087
|
}
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
successContent = "API key has been added successfully.";
|
|
3698
|
-
} else if (actionType === "addCustomer") {
|
|
3699
|
-
successContent = "Customer has been added successfully.";
|
|
3700
|
-
} else if (actionType === "enable2FA") {
|
|
3701
|
-
successContent = "Two-factor authentication has been enabled successfully.";
|
|
3702
|
-
} else if (actionType === "disable2FA") {
|
|
3703
|
-
successContent = "Two-factor authentication has been disabled successfully.";
|
|
3704
|
-
} else if (actionType === "changePassword") {
|
|
3705
|
-
successContent = "Your password has been changed successfully.";
|
|
3706
|
-
} else if (actionType === "revokeSession") {
|
|
3707
|
-
successContent = "Session has been revoked successfully.";
|
|
3708
|
-
} else if (actionType === "toggleNotification") {
|
|
3709
|
-
successContent = "Notification preferences have been updated successfully.";
|
|
3710
|
-
} else if (actionType === "connectIntegration") {
|
|
3711
|
-
successContent = "Integration has been connected successfully.";
|
|
3712
|
-
} else if (actionType === "disconnectIntegration") {
|
|
3713
|
-
successContent = "Integration has been disconnected successfully.";
|
|
3714
|
-
} else if (actionType === "addPaymentMethod") {
|
|
3715
|
-
successContent = "Payment method has been added successfully.";
|
|
3716
|
-
} else if (actionType === "removePaymentMethod") {
|
|
3717
|
-
successContent = "Payment method has been removed successfully.";
|
|
3718
|
-
} else if (actionType === "deleteApiKey") {
|
|
3719
|
-
successContent = "API key has been deleted successfully.";
|
|
3720
|
-
} else if (actionType === "addWebhook") {
|
|
3721
|
-
successContent = "Webhook endpoint has been added successfully.";
|
|
3722
|
-
} else if (actionType === "updateCurrency") {
|
|
3723
|
-
successContent = "Currency preference has been updated successfully.";
|
|
3724
|
-
} else if (actionType === "updateTimezone") {
|
|
3725
|
-
successContent = "Timezone has been updated successfully.";
|
|
3726
|
-
} else if (actionType === "refundPayment") {
|
|
3727
|
-
successContent = "Refund has been processed successfully.";
|
|
3728
|
-
} else if (actionType === "exportCertificate") {
|
|
3729
|
-
successContent = "Certificate of Incorporation has been downloaded successfully.";
|
|
3730
|
-
} else if (actionType === "createSubscription") {
|
|
3731
|
-
successContent = "Subscription has been created successfully.";
|
|
3732
|
-
} else if (actionType === "toggleBlockRule" || actionType === "enableBlockRule" || actionType === "disableBlockRule") {
|
|
3733
|
-
successContent = "Block rule has been updated successfully.";
|
|
3734
|
-
} else {
|
|
3735
|
-
successContent = "Action completed successfully.";
|
|
3736
|
-
}
|
|
3737
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3738
|
-
"div",
|
|
3739
|
-
{
|
|
3740
|
-
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
3741
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 text-gray-700", children: successContent })
|
|
3742
|
-
},
|
|
3743
|
-
message.id
|
|
3744
|
-
);
|
|
3745
|
-
}
|
|
3746
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3747
|
-
"div",
|
|
3748
|
-
{
|
|
3749
|
-
className: `min-w-0 ${isRoleChange ? "mt-3" : ""}`,
|
|
3750
|
-
children: [
|
|
3751
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700", children: message.content || "" }),
|
|
3752
|
-
actionType === "updateCompanyInfo" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden", children: [
|
|
3753
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
3754
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3755
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Company Name" }),
|
|
3756
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3757
|
-
Input,
|
|
3758
|
-
{
|
|
3759
|
-
placeholder: "Acme Corporation",
|
|
3760
|
-
value: formData.companyName || "",
|
|
3761
|
-
onChange: (e) => setActionFormData({
|
|
3762
|
-
...actionFormData,
|
|
3763
|
-
companyName: e.target.value
|
|
3764
|
-
}),
|
|
3765
|
-
className: "h-8 text-xs border-gray-200"
|
|
3766
|
-
}
|
|
3767
|
-
)
|
|
3768
|
-
] }),
|
|
3769
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3770
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Email" }),
|
|
3771
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3772
|
-
Input,
|
|
3773
|
-
{
|
|
3774
|
-
type: "email",
|
|
3775
|
-
placeholder: "contact@acme.com",
|
|
3776
|
-
value: formData.email || "",
|
|
3777
|
-
onChange: (e) => setActionFormData({
|
|
3778
|
-
...actionFormData,
|
|
3779
|
-
email: e.target.value
|
|
3780
|
-
}),
|
|
3781
|
-
className: "h-8 text-xs border-gray-200"
|
|
3782
|
-
}
|
|
3783
|
-
)
|
|
3784
|
-
] })
|
|
3785
|
-
] }),
|
|
4088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4089
|
+
"div",
|
|
4090
|
+
{
|
|
4091
|
+
className: `min-w-0 ${isRoleChange ? "mt-3" : ""}`,
|
|
4092
|
+
children: [
|
|
4093
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700", children: message.content || "" }),
|
|
4094
|
+
actionType === "updateCompanyInfo" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden", children: [
|
|
4095
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
3786
4096
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3787
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "
|
|
4097
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Company Name" }),
|
|
3788
4098
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3789
4099
|
Input,
|
|
3790
4100
|
{
|
|
3791
|
-
placeholder: "
|
|
3792
|
-
value: formData.
|
|
4101
|
+
placeholder: "Acme Corporation",
|
|
4102
|
+
value: formData.companyName || "",
|
|
3793
4103
|
onChange: (e) => setActionFormData({
|
|
3794
4104
|
...actionFormData,
|
|
3795
|
-
|
|
4105
|
+
companyName: e.target.value
|
|
3796
4106
|
}),
|
|
3797
4107
|
className: "h-8 text-xs border-gray-200"
|
|
3798
4108
|
}
|
|
3799
4109
|
)
|
|
3800
4110
|
] }),
|
|
3801
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", {
|
|
3802
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
)
|
|
3817
|
-
] }),
|
|
3818
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3819
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Website" }),
|
|
3820
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3821
|
-
Input,
|
|
3822
|
-
{
|
|
3823
|
-
type: "url",
|
|
3824
|
-
placeholder: "https://acme.com",
|
|
3825
|
-
value: formData.website || "",
|
|
3826
|
-
onChange: (e) => setActionFormData({
|
|
3827
|
-
...actionFormData,
|
|
3828
|
-
website: e.target.value
|
|
3829
|
-
}),
|
|
3830
|
-
className: "h-8 text-xs border-gray-200"
|
|
3831
|
-
}
|
|
3832
|
-
)
|
|
3833
|
-
] })
|
|
4111
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4112
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Email" }),
|
|
4113
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4114
|
+
Input,
|
|
4115
|
+
{
|
|
4116
|
+
type: "email",
|
|
4117
|
+
placeholder: "contact@acme.com",
|
|
4118
|
+
value: formData.email || "",
|
|
4119
|
+
onChange: (e) => setActionFormData({
|
|
4120
|
+
...actionFormData,
|
|
4121
|
+
email: e.target.value
|
|
4122
|
+
}),
|
|
4123
|
+
className: "h-8 text-xs border-gray-200"
|
|
4124
|
+
}
|
|
4125
|
+
)
|
|
3834
4126
|
] })
|
|
3835
4127
|
] }),
|
|
3836
|
-
|
|
3837
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "
|
|
4128
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4129
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Address" }),
|
|
3838
4130
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3839
4131
|
Input,
|
|
3840
4132
|
{
|
|
3841
|
-
placeholder: "
|
|
3842
|
-
value: formData.
|
|
4133
|
+
placeholder: "123 Main St, San Francisco, CA",
|
|
4134
|
+
value: formData.address || "",
|
|
3843
4135
|
onChange: (e) => setActionFormData({
|
|
3844
4136
|
...actionFormData,
|
|
3845
|
-
|
|
4137
|
+
address: e.target.value
|
|
3846
4138
|
}),
|
|
3847
4139
|
className: "h-8 text-xs border-gray-200"
|
|
3848
4140
|
}
|
|
3849
4141
|
)
|
|
3850
|
-
] })
|
|
3851
|
-
|
|
3852
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
3853
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3854
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Company Name" }),
|
|
3855
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3856
|
-
Input,
|
|
3857
|
-
{
|
|
3858
|
-
placeholder: "Acme Corporation",
|
|
3859
|
-
value: formData.name || "",
|
|
3860
|
-
onChange: (e) => setActionFormData({
|
|
3861
|
-
...actionFormData,
|
|
3862
|
-
name: e.target.value
|
|
3863
|
-
}),
|
|
3864
|
-
className: "h-8 text-xs border-gray-200"
|
|
3865
|
-
}
|
|
3866
|
-
)
|
|
3867
|
-
] }),
|
|
3868
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3869
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Email" }),
|
|
3870
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3871
|
-
Input,
|
|
3872
|
-
{
|
|
3873
|
-
type: "email",
|
|
3874
|
-
placeholder: "contact@acme.com",
|
|
3875
|
-
value: formData.email || "",
|
|
3876
|
-
onChange: (e) => setActionFormData({
|
|
3877
|
-
...actionFormData,
|
|
3878
|
-
email: e.target.value
|
|
3879
|
-
}),
|
|
3880
|
-
className: "h-8 text-xs border-gray-200"
|
|
3881
|
-
}
|
|
3882
|
-
)
|
|
3883
|
-
] })
|
|
3884
|
-
] }),
|
|
4142
|
+
] }),
|
|
4143
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
3885
4144
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3886
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "
|
|
4145
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Phone" }),
|
|
3887
4146
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3888
4147
|
Input,
|
|
3889
4148
|
{
|
|
3890
|
-
|
|
3891
|
-
|
|
4149
|
+
type: "tel",
|
|
4150
|
+
placeholder: "+1 (555) 123-4567",
|
|
4151
|
+
value: formData.phone || "",
|
|
3892
4152
|
onChange: (e) => setActionFormData({
|
|
3893
4153
|
...actionFormData,
|
|
3894
|
-
|
|
4154
|
+
phone: e.target.value
|
|
3895
4155
|
}),
|
|
3896
4156
|
className: "h-8 text-xs border-gray-200"
|
|
3897
4157
|
}
|
|
3898
4158
|
)
|
|
3899
4159
|
] }),
|
|
3900
4160
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3901
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "
|
|
3902
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.
|
|
3903
|
-
|
|
4161
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Website" }),
|
|
4162
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4163
|
+
Input,
|
|
3904
4164
|
{
|
|
3905
|
-
|
|
4165
|
+
type: "url",
|
|
4166
|
+
placeholder: "https://acme.com",
|
|
4167
|
+
value: formData.website || "",
|
|
3906
4168
|
onChange: (e) => setActionFormData({
|
|
3907
4169
|
...actionFormData,
|
|
3908
|
-
|
|
4170
|
+
website: e.target.value
|
|
3909
4171
|
}),
|
|
3910
|
-
className: "h-8
|
|
3911
|
-
children: [
|
|
3912
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Starter", children: "Starter" }),
|
|
3913
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Professional", children: "Professional" }),
|
|
3914
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Enterprise", children: "Enterprise" })
|
|
3915
|
-
]
|
|
4172
|
+
className: "h-8 text-xs border-gray-200"
|
|
3916
4173
|
}
|
|
3917
4174
|
)
|
|
3918
4175
|
] })
|
|
3919
|
-
] })
|
|
3920
|
-
|
|
3921
|
-
|
|
4176
|
+
] })
|
|
4177
|
+
] }),
|
|
4178
|
+
actionType === "addApiKey" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4179
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "API Key Name" }),
|
|
4180
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4181
|
+
Input,
|
|
4182
|
+
{
|
|
4183
|
+
placeholder: "Production Key",
|
|
4184
|
+
value: formData.name || "",
|
|
4185
|
+
onChange: (e) => setActionFormData({
|
|
4186
|
+
...actionFormData,
|
|
4187
|
+
name: e.target.value
|
|
4188
|
+
}),
|
|
4189
|
+
className: "h-8 text-xs border-gray-200"
|
|
4190
|
+
}
|
|
4191
|
+
)
|
|
4192
|
+
] }) }),
|
|
4193
|
+
actionType === "addCustomer" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden", children: [
|
|
4194
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
3922
4195
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3923
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "
|
|
4196
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Company Name" }),
|
|
3924
4197
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3925
4198
|
Input,
|
|
3926
4199
|
{
|
|
3927
|
-
|
|
3928
|
-
value: formData.
|
|
4200
|
+
placeholder: "Acme Corporation",
|
|
4201
|
+
value: formData.name || "",
|
|
3929
4202
|
onChange: (e) => setActionFormData({
|
|
3930
4203
|
...actionFormData,
|
|
3931
|
-
|
|
4204
|
+
name: e.target.value
|
|
3932
4205
|
}),
|
|
3933
4206
|
className: "h-8 text-xs border-gray-200"
|
|
3934
4207
|
}
|
|
3935
4208
|
)
|
|
3936
4209
|
] }),
|
|
3937
4210
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3938
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "
|
|
4211
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Email" }),
|
|
3939
4212
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3940
4213
|
Input,
|
|
3941
4214
|
{
|
|
3942
|
-
type: "
|
|
3943
|
-
|
|
4215
|
+
type: "email",
|
|
4216
|
+
placeholder: "contact@acme.com",
|
|
4217
|
+
value: formData.email || "",
|
|
3944
4218
|
onChange: (e) => setActionFormData({
|
|
3945
4219
|
...actionFormData,
|
|
3946
|
-
|
|
3947
|
-
}),
|
|
3948
|
-
className: "h-8 text-xs border-gray-200"
|
|
3949
|
-
}
|
|
3950
|
-
)
|
|
3951
|
-
] }),
|
|
3952
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3953
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Confirm New Password" }),
|
|
3954
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3955
|
-
Input,
|
|
3956
|
-
{
|
|
3957
|
-
type: "password",
|
|
3958
|
-
value: formData.confirmPassword || "",
|
|
3959
|
-
onChange: (e) => setActionFormData({
|
|
3960
|
-
...actionFormData,
|
|
3961
|
-
confirmPassword: e.target.value
|
|
4220
|
+
email: e.target.value
|
|
3962
4221
|
}),
|
|
3963
4222
|
className: "h-8 text-xs border-gray-200"
|
|
3964
4223
|
}
|
|
3965
4224
|
)
|
|
3966
4225
|
] })
|
|
3967
4226
|
] }),
|
|
3968
|
-
|
|
3969
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "paymentFailed", children: "Payment Failed" }),
|
|
3983
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "invoicePaid", children: "Invoice Paid" }),
|
|
3984
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "monthlySummary", children: "Monthly Summary" }),
|
|
3985
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "productUpdates", children: "Product Updates" })
|
|
3986
|
-
]
|
|
3987
|
-
}
|
|
3988
|
-
)
|
|
3989
|
-
] }),
|
|
3990
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3991
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3992
|
-
"input",
|
|
3993
|
-
{
|
|
3994
|
-
type: "checkbox",
|
|
3995
|
-
checked: formData.enabled !== false,
|
|
3996
|
-
onChange: (e) => setActionFormData({
|
|
3997
|
-
...actionFormData,
|
|
3998
|
-
enabled: e.target.checked
|
|
3999
|
-
}),
|
|
4000
|
-
className: "h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"
|
|
4001
|
-
}
|
|
4002
|
-
),
|
|
4003
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs text-black", children: "Enable this notification" })
|
|
4004
|
-
] })
|
|
4227
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4228
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Location" }),
|
|
4229
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4230
|
+
Input,
|
|
4231
|
+
{
|
|
4232
|
+
placeholder: "San Francisco, CA",
|
|
4233
|
+
value: formData.location || "",
|
|
4234
|
+
onChange: (e) => setActionFormData({
|
|
4235
|
+
...actionFormData,
|
|
4236
|
+
location: e.target.value
|
|
4237
|
+
}),
|
|
4238
|
+
className: "h-8 text-xs border-gray-200"
|
|
4239
|
+
}
|
|
4240
|
+
)
|
|
4005
4241
|
] }),
|
|
4006
|
-
|
|
4007
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "
|
|
4242
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4243
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Subscription Tier" }),
|
|
4008
4244
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4009
4245
|
"select",
|
|
4010
4246
|
{
|
|
4011
|
-
value: formData.
|
|
4247
|
+
value: formData.subscription || "Starter",
|
|
4012
4248
|
onChange: (e) => setActionFormData({
|
|
4013
4249
|
...actionFormData,
|
|
4014
|
-
|
|
4250
|
+
subscription: e.target.value
|
|
4015
4251
|
}),
|
|
4016
4252
|
className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
|
|
4017
4253
|
children: [
|
|
4018
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "
|
|
4019
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "
|
|
4020
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "
|
|
4254
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Starter", children: "Starter" }),
|
|
4255
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Professional", children: "Professional" }),
|
|
4256
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Enterprise", children: "Enterprise" })
|
|
4021
4257
|
]
|
|
4022
4258
|
}
|
|
4023
4259
|
)
|
|
4024
|
-
] })
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
}
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Expiry Date" }),
|
|
4043
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4044
|
-
Input,
|
|
4045
|
-
{
|
|
4046
|
-
placeholder: "MM/YY",
|
|
4047
|
-
value: formData.expiryDate || "",
|
|
4048
|
-
onChange: (e) => setActionFormData({
|
|
4049
|
-
...actionFormData,
|
|
4050
|
-
expiryDate: e.target.value
|
|
4051
|
-
}),
|
|
4052
|
-
className: "h-8 text-xs border-gray-200"
|
|
4053
|
-
}
|
|
4054
|
-
)
|
|
4055
|
-
] })
|
|
4260
|
+
] })
|
|
4261
|
+
] }),
|
|
4262
|
+
(actionType === "enable2FA" || actionType === "disable2FA") && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-black", children: actionType === "enable2FA" ? "This will enable two-factor authentication for your account. You'll need to set up an authenticator app." : "This will disable two-factor authentication for your account. Your account will be less secure." }) }),
|
|
4263
|
+
actionType === "changePassword" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
|
|
4264
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4265
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Current Password" }),
|
|
4266
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4267
|
+
Input,
|
|
4268
|
+
{
|
|
4269
|
+
type: "password",
|
|
4270
|
+
value: formData.currentPassword || "",
|
|
4271
|
+
onChange: (e) => setActionFormData({
|
|
4272
|
+
...actionFormData,
|
|
4273
|
+
currentPassword: e.target.value
|
|
4274
|
+
}),
|
|
4275
|
+
className: "h-8 text-xs border-gray-200"
|
|
4276
|
+
}
|
|
4277
|
+
)
|
|
4056
4278
|
] }),
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
transactionId: value,
|
|
4072
|
-
customer: void 0
|
|
4073
|
-
});
|
|
4074
|
-
} else {
|
|
4075
|
-
setActionFormData({
|
|
4076
|
-
...actionFormData,
|
|
4077
|
-
customer: value,
|
|
4078
|
-
transactionId: void 0
|
|
4079
|
-
});
|
|
4080
|
-
}
|
|
4081
|
-
},
|
|
4082
|
-
className: "h-8 text-xs border-gray-200"
|
|
4083
|
-
}
|
|
4084
|
-
)
|
|
4085
|
-
] }),
|
|
4086
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4087
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Amount (optional)" }),
|
|
4088
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4089
|
-
Input,
|
|
4090
|
-
{
|
|
4091
|
-
placeholder: "$0.00",
|
|
4092
|
-
value: formData.amount || "",
|
|
4093
|
-
onChange: (e) => setActionFormData({
|
|
4094
|
-
...actionFormData,
|
|
4095
|
-
amount: e.target.value
|
|
4096
|
-
}),
|
|
4097
|
-
className: "h-8 text-xs border-gray-200"
|
|
4098
|
-
}
|
|
4099
|
-
)
|
|
4100
|
-
] }),
|
|
4101
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4102
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Reason (optional)" }),
|
|
4103
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4104
|
-
Input,
|
|
4105
|
-
{
|
|
4106
|
-
placeholder: "e.g., Customer request",
|
|
4107
|
-
value: formData.reason || "",
|
|
4108
|
-
onChange: (e) => setActionFormData({
|
|
4109
|
-
...actionFormData,
|
|
4110
|
-
reason: e.target.value
|
|
4111
|
-
}),
|
|
4112
|
-
className: "h-8 text-xs border-gray-200"
|
|
4113
|
-
}
|
|
4114
|
-
)
|
|
4115
|
-
] })
|
|
4279
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4280
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "New Password" }),
|
|
4281
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4282
|
+
Input,
|
|
4283
|
+
{
|
|
4284
|
+
type: "password",
|
|
4285
|
+
value: formData.newPassword || "",
|
|
4286
|
+
onChange: (e) => setActionFormData({
|
|
4287
|
+
...actionFormData,
|
|
4288
|
+
newPassword: e.target.value
|
|
4289
|
+
}),
|
|
4290
|
+
className: "h-8 text-xs border-gray-200"
|
|
4291
|
+
}
|
|
4292
|
+
)
|
|
4116
4293
|
] }),
|
|
4117
|
-
|
|
4118
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4294
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4295
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Confirm New Password" }),
|
|
4296
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4297
|
+
Input,
|
|
4298
|
+
{
|
|
4299
|
+
type: "password",
|
|
4300
|
+
value: formData.confirmPassword || "",
|
|
4301
|
+
onChange: (e) => setActionFormData({
|
|
4302
|
+
...actionFormData,
|
|
4303
|
+
confirmPassword: e.target.value
|
|
4304
|
+
}),
|
|
4305
|
+
className: "h-8 text-xs border-gray-200"
|
|
4306
|
+
}
|
|
4307
|
+
)
|
|
4308
|
+
] })
|
|
4309
|
+
] }),
|
|
4310
|
+
actionType === "toggleNotification" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
|
|
4311
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4312
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Notification Type" }),
|
|
4313
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4314
|
+
"select",
|
|
4315
|
+
{
|
|
4316
|
+
value: formData.notificationType || "paymentReceived",
|
|
4317
|
+
onChange: (e) => setActionFormData({
|
|
4318
|
+
...actionFormData,
|
|
4319
|
+
notificationType: e.target.value
|
|
4320
|
+
}),
|
|
4321
|
+
className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
|
|
4322
|
+
children: [
|
|
4323
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "paymentReceived", children: "Payment Received" }),
|
|
4324
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "paymentFailed", children: "Payment Failed" }),
|
|
4325
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "invoicePaid", children: "Invoice Paid" }),
|
|
4326
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "monthlySummary", children: "Monthly Summary" }),
|
|
4327
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "productUpdates", children: "Product Updates" })
|
|
4328
|
+
]
|
|
4329
|
+
}
|
|
4330
|
+
)
|
|
4135
4331
|
] }),
|
|
4136
|
-
|
|
4137
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
}
|
|
4166
|
-
|
|
4167
|
-
|
|
4332
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4333
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4334
|
+
"input",
|
|
4335
|
+
{
|
|
4336
|
+
type: "checkbox",
|
|
4337
|
+
checked: formData.enabled !== false,
|
|
4338
|
+
onChange: (e) => setActionFormData({
|
|
4339
|
+
...actionFormData,
|
|
4340
|
+
enabled: e.target.checked
|
|
4341
|
+
}),
|
|
4342
|
+
className: "h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"
|
|
4343
|
+
}
|
|
4344
|
+
),
|
|
4345
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs text-black", children: "Enable this notification" })
|
|
4346
|
+
] })
|
|
4347
|
+
] }),
|
|
4348
|
+
(actionType === "connectIntegration" || actionType === "disconnectIntegration") && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4349
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Integration" }),
|
|
4350
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4351
|
+
"select",
|
|
4352
|
+
{
|
|
4353
|
+
value: formData.integrationName || "Slack",
|
|
4354
|
+
onChange: (e) => setActionFormData({
|
|
4355
|
+
...actionFormData,
|
|
4356
|
+
integrationName: e.target.value
|
|
4357
|
+
}),
|
|
4358
|
+
className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
|
|
4359
|
+
children: [
|
|
4360
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Slack", children: "Slack" }),
|
|
4361
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Zapier", children: "Zapier" }),
|
|
4362
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Webhook", children: "Webhook" })
|
|
4363
|
+
]
|
|
4364
|
+
}
|
|
4365
|
+
)
|
|
4366
|
+
] }) }),
|
|
4367
|
+
actionType === "addPaymentMethod" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
|
|
4368
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4369
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Card Number" }),
|
|
4370
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4371
|
+
Input,
|
|
4372
|
+
{
|
|
4373
|
+
placeholder: "1234 5678 9012 3456",
|
|
4374
|
+
value: formData.cardNumber || "",
|
|
4375
|
+
onChange: (e) => setActionFormData({
|
|
4376
|
+
...actionFormData,
|
|
4377
|
+
cardNumber: e.target.value
|
|
4378
|
+
}),
|
|
4379
|
+
className: "h-8 text-xs border-gray-200"
|
|
4380
|
+
}
|
|
4381
|
+
)
|
|
4382
|
+
] }),
|
|
4383
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4384
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Expiry Date" }),
|
|
4385
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4386
|
+
Input,
|
|
4387
|
+
{
|
|
4388
|
+
placeholder: "MM/YY",
|
|
4389
|
+
value: formData.expiryDate || "",
|
|
4390
|
+
onChange: (e) => setActionFormData({
|
|
4391
|
+
...actionFormData,
|
|
4392
|
+
expiryDate: e.target.value
|
|
4393
|
+
}),
|
|
4394
|
+
className: "h-8 text-xs border-gray-200"
|
|
4395
|
+
}
|
|
4396
|
+
)
|
|
4397
|
+
] })
|
|
4398
|
+
] }),
|
|
4399
|
+
actionType === "removePaymentMethod" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-black", children: "This will remove the default payment method from your account." }) }),
|
|
4400
|
+
actionType === "refundPayment" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
|
|
4401
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4402
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Transaction ID or Customer Name" }),
|
|
4403
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4404
|
+
Input,
|
|
4405
|
+
{
|
|
4406
|
+
placeholder: "e.g., txn_1234 or Acme Corp",
|
|
4407
|
+
value: formData.transactionId || formData.customer || "",
|
|
4408
|
+
onChange: (e) => {
|
|
4409
|
+
const value = e.target.value;
|
|
4410
|
+
if (value.startsWith("txn_") || /^\d+$/.test(value)) {
|
|
4411
|
+
setActionFormData({
|
|
4412
|
+
...actionFormData,
|
|
4413
|
+
transactionId: value,
|
|
4414
|
+
customer: void 0
|
|
4415
|
+
});
|
|
4416
|
+
} else {
|
|
4417
|
+
setActionFormData({
|
|
4418
|
+
...actionFormData,
|
|
4419
|
+
customer: value,
|
|
4420
|
+
transactionId: void 0
|
|
4421
|
+
});
|
|
4422
|
+
}
|
|
4423
|
+
},
|
|
4424
|
+
className: "h-8 text-xs border-gray-200"
|
|
4425
|
+
}
|
|
4426
|
+
)
|
|
4168
4427
|
] }),
|
|
4169
|
-
|
|
4170
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "
|
|
4428
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4429
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Amount (optional)" }),
|
|
4430
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4431
|
+
Input,
|
|
4432
|
+
{
|
|
4433
|
+
placeholder: "$0.00",
|
|
4434
|
+
value: formData.amount || "",
|
|
4435
|
+
onChange: (e) => setActionFormData({
|
|
4436
|
+
...actionFormData,
|
|
4437
|
+
amount: e.target.value
|
|
4438
|
+
}),
|
|
4439
|
+
className: "h-8 text-xs border-gray-200"
|
|
4440
|
+
}
|
|
4441
|
+
)
|
|
4442
|
+
] }),
|
|
4443
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4444
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Reason (optional)" }),
|
|
4445
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4446
|
+
Input,
|
|
4447
|
+
{
|
|
4448
|
+
placeholder: "e.g., Customer request",
|
|
4449
|
+
value: formData.reason || "",
|
|
4450
|
+
onChange: (e) => setActionFormData({
|
|
4451
|
+
...actionFormData,
|
|
4452
|
+
reason: e.target.value
|
|
4453
|
+
}),
|
|
4454
|
+
className: "h-8 text-xs border-gray-200"
|
|
4455
|
+
}
|
|
4456
|
+
)
|
|
4457
|
+
] })
|
|
4458
|
+
] }),
|
|
4459
|
+
actionType === "deleteApiKey" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
|
|
4460
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4461
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "API Key Name or ID" }),
|
|
4462
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4463
|
+
Input,
|
|
4464
|
+
{
|
|
4465
|
+
placeholder: "Production Key",
|
|
4466
|
+
value: formData.keyId || formData.name || "",
|
|
4467
|
+
onChange: (e) => setActionFormData({
|
|
4468
|
+
...actionFormData,
|
|
4469
|
+
keyId: e.target.value,
|
|
4470
|
+
name: e.target.value
|
|
4471
|
+
}),
|
|
4472
|
+
className: "h-8 text-xs border-gray-200"
|
|
4473
|
+
}
|
|
4474
|
+
)
|
|
4475
|
+
] }),
|
|
4476
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-red-600", children: "Warning: This action cannot be undone. The API key will be permanently deleted." })
|
|
4477
|
+
] }),
|
|
4478
|
+
actionType === "addWebhook" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
|
|
4479
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4480
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Webhook URL" }),
|
|
4481
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4482
|
+
Input,
|
|
4483
|
+
{
|
|
4484
|
+
type: "url",
|
|
4485
|
+
placeholder: "https://example.com/webhook",
|
|
4486
|
+
value: formData.url || "",
|
|
4487
|
+
onChange: (e) => setActionFormData({
|
|
4488
|
+
...actionFormData,
|
|
4489
|
+
url: e.target.value
|
|
4490
|
+
}),
|
|
4491
|
+
className: "h-8 text-xs border-gray-200"
|
|
4492
|
+
}
|
|
4493
|
+
)
|
|
4494
|
+
] }),
|
|
4495
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4496
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Name (optional)" }),
|
|
4497
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4498
|
+
Input,
|
|
4499
|
+
{
|
|
4500
|
+
placeholder: "Production Webhook",
|
|
4501
|
+
value: formData.name || "",
|
|
4502
|
+
onChange: (e) => setActionFormData({
|
|
4503
|
+
...actionFormData,
|
|
4504
|
+
name: e.target.value
|
|
4505
|
+
}),
|
|
4506
|
+
className: "h-8 text-xs border-gray-200"
|
|
4507
|
+
}
|
|
4508
|
+
)
|
|
4509
|
+
] })
|
|
4510
|
+
] }),
|
|
4511
|
+
actionType === "updateCurrency" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4512
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Currency" }),
|
|
4513
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4514
|
+
"select",
|
|
4515
|
+
{
|
|
4516
|
+
value: formData.currency || "USD",
|
|
4517
|
+
onChange: (e) => setActionFormData({
|
|
4518
|
+
...actionFormData,
|
|
4519
|
+
currency: e.target.value
|
|
4520
|
+
}),
|
|
4521
|
+
className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
|
|
4522
|
+
children: [
|
|
4523
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "USD", children: "USD ($)" }),
|
|
4524
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "EUR", children: "EUR (\u20AC)" }),
|
|
4525
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "GBP", children: "GBP (\xA3)" }),
|
|
4526
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "JPY", children: "JPY (\xA5)" })
|
|
4527
|
+
]
|
|
4528
|
+
}
|
|
4529
|
+
)
|
|
4530
|
+
] }) }),
|
|
4531
|
+
actionType === "updateTimezone" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4532
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Timezone" }),
|
|
4533
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4534
|
+
"select",
|
|
4535
|
+
{
|
|
4536
|
+
value: formData.timezone || "America/Los_Angeles",
|
|
4537
|
+
onChange: (e) => setActionFormData({
|
|
4538
|
+
...actionFormData,
|
|
4539
|
+
timezone: e.target.value
|
|
4540
|
+
}),
|
|
4541
|
+
className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
|
|
4542
|
+
children: [
|
|
4543
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "America/Los_Angeles", children: "Pacific Time (PT)" }),
|
|
4544
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "America/New_York", children: "Eastern Time (ET)" }),
|
|
4545
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Europe/London", children: "GMT" }),
|
|
4546
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Asia/Tokyo", children: "JST" })
|
|
4547
|
+
]
|
|
4548
|
+
}
|
|
4549
|
+
)
|
|
4550
|
+
] }) }),
|
|
4551
|
+
actionType === "revokeSession" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
|
|
4552
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4553
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Device/Session" }),
|
|
4554
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4555
|
+
Input,
|
|
4556
|
+
{
|
|
4557
|
+
placeholder: "MacBook Pro",
|
|
4558
|
+
value: formData.device || "",
|
|
4559
|
+
onChange: (e) => setActionFormData({
|
|
4560
|
+
...actionFormData,
|
|
4561
|
+
device: e.target.value
|
|
4562
|
+
}),
|
|
4563
|
+
className: "h-8 text-xs border-gray-200"
|
|
4564
|
+
}
|
|
4565
|
+
)
|
|
4566
|
+
] }),
|
|
4567
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-black", children: "This will sign out the device and invalidate its session." })
|
|
4568
|
+
] }),
|
|
4569
|
+
actionType === "createSubscription" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
|
|
4570
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4571
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Customer Email" }),
|
|
4572
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4573
|
+
Input,
|
|
4574
|
+
{
|
|
4575
|
+
type: "email",
|
|
4576
|
+
placeholder: "customer@example.com",
|
|
4577
|
+
value: formData.customerEmail || "",
|
|
4578
|
+
onChange: (e) => setActionFormData({
|
|
4579
|
+
...actionFormData,
|
|
4580
|
+
customerEmail: e.target.value
|
|
4581
|
+
}),
|
|
4582
|
+
className: "h-8 text-xs border-gray-200"
|
|
4583
|
+
}
|
|
4584
|
+
)
|
|
4585
|
+
] }),
|
|
4586
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4587
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Plan" }),
|
|
4171
4588
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4172
4589
|
"select",
|
|
4173
4590
|
{
|
|
4174
|
-
value: formData.
|
|
4591
|
+
value: formData.plan || "Starter",
|
|
4175
4592
|
onChange: (e) => setActionFormData({
|
|
4176
4593
|
...actionFormData,
|
|
4177
|
-
|
|
4594
|
+
plan: e.target.value
|
|
4178
4595
|
}),
|
|
4179
4596
|
className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
|
|
4180
4597
|
children: [
|
|
4181
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "
|
|
4182
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "
|
|
4183
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "
|
|
4184
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "JPY", children: "JPY (\xA5)" })
|
|
4598
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Starter", children: "Starter ($29/mo)" }),
|
|
4599
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Professional", children: "Professional ($99/mo)" }),
|
|
4600
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Enterprise", children: "Enterprise ($299/mo)" })
|
|
4185
4601
|
]
|
|
4186
4602
|
}
|
|
4187
4603
|
)
|
|
4188
|
-
] })
|
|
4189
|
-
|
|
4190
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "
|
|
4604
|
+
] }),
|
|
4605
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4606
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Billing Cycle" }),
|
|
4191
4607
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4192
4608
|
"select",
|
|
4193
4609
|
{
|
|
4194
|
-
value: formData.
|
|
4610
|
+
value: formData.billingCycle || "monthly",
|
|
4195
4611
|
onChange: (e) => setActionFormData({
|
|
4196
4612
|
...actionFormData,
|
|
4197
|
-
|
|
4613
|
+
billingCycle: e.target.value
|
|
4198
4614
|
}),
|
|
4199
4615
|
className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
|
|
4200
4616
|
children: [
|
|
4201
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "
|
|
4202
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "
|
|
4203
|
-
|
|
4204
|
-
|
|
4617
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "monthly", children: "Monthly" }),
|
|
4618
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "yearly", children: "Yearly (Save 15%)" })
|
|
4619
|
+
]
|
|
4620
|
+
}
|
|
4621
|
+
)
|
|
4622
|
+
] })
|
|
4623
|
+
] }),
|
|
4624
|
+
actionType === "exportCertificate" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
|
|
4625
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-black", children: "This will export your certificate of incorporation document." }),
|
|
4626
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4627
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Format" }),
|
|
4628
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4629
|
+
"select",
|
|
4630
|
+
{
|
|
4631
|
+
value: formData.format || "pdf",
|
|
4632
|
+
onChange: (e) => setActionFormData({
|
|
4633
|
+
...actionFormData,
|
|
4634
|
+
format: e.target.value
|
|
4635
|
+
}),
|
|
4636
|
+
className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
|
|
4637
|
+
children: [
|
|
4638
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "pdf", children: "PDF" }),
|
|
4639
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "json", children: "JSON" })
|
|
4640
|
+
]
|
|
4641
|
+
}
|
|
4642
|
+
)
|
|
4643
|
+
] })
|
|
4644
|
+
] }),
|
|
4645
|
+
(actionType === "toggleBlockRule" || actionType === "enableBlockRule" || actionType === "disableBlockRule") && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
|
|
4646
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4647
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Block Rule" }),
|
|
4648
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4649
|
+
"select",
|
|
4650
|
+
{
|
|
4651
|
+
value: formData.ruleId || "rule_1",
|
|
4652
|
+
onChange: (e) => setActionFormData({
|
|
4653
|
+
...actionFormData,
|
|
4654
|
+
ruleId: e.target.value
|
|
4655
|
+
}),
|
|
4656
|
+
className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
|
|
4657
|
+
children: [
|
|
4658
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "rule_1", children: "Block if risk level = 'highest'" }),
|
|
4659
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "rule_2", children: "Block if matches Stripe block lists" }),
|
|
4660
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "rule_3", children: "Block if CVC verification fails" }),
|
|
4661
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "rule_4", children: "Block if Postal code verification fails" })
|
|
4205
4662
|
]
|
|
4206
4663
|
}
|
|
4207
4664
|
)
|
|
4208
|
-
] }) }),
|
|
4209
|
-
actionType === "revokeSession" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
|
|
4210
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
4211
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Device/Session" }),
|
|
4212
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4213
|
-
Input,
|
|
4214
|
-
{
|
|
4215
|
-
placeholder: "MacBook Pro",
|
|
4216
|
-
value: formData.device || "",
|
|
4217
|
-
onChange: (e) => setActionFormData({
|
|
4218
|
-
...actionFormData,
|
|
4219
|
-
device: e.target.value
|
|
4220
|
-
}),
|
|
4221
|
-
className: "h-8 text-xs border-gray-200"
|
|
4222
|
-
}
|
|
4223
|
-
)
|
|
4224
|
-
] }),
|
|
4225
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-black", children: "This will sign out the device and invalidate its session." })
|
|
4226
4665
|
] }),
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
}
|
|
4242
|
-
)
|
|
4243
|
-
]
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
"select",
|
|
4267
|
-
{
|
|
4268
|
-
value: formData.billingCycle || "monthly",
|
|
4269
|
-
onChange: (e) => setActionFormData({
|
|
4270
|
-
...actionFormData,
|
|
4271
|
-
billingCycle: e.target.value
|
|
4272
|
-
}),
|
|
4273
|
-
className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
|
|
4274
|
-
children: [
|
|
4275
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "monthly", children: "Monthly" }),
|
|
4276
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "yearly", children: "Yearly (Save 15%)" })
|
|
4277
|
-
]
|
|
4278
|
-
}
|
|
4279
|
-
)
|
|
4666
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-black", children: actionType === "enableBlockRule" ? "This will enable the selected block rule to actively block matching payments." : actionType === "disableBlockRule" ? "This will disable the selected block rule. Matching payments will no longer be blocked." : "This will toggle the selected block rule's state." })
|
|
4667
|
+
] }),
|
|
4668
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-3", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4669
|
+
Button,
|
|
4670
|
+
{
|
|
4671
|
+
type: "button",
|
|
4672
|
+
size: "sm",
|
|
4673
|
+
variant: "secondary",
|
|
4674
|
+
className: "h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",
|
|
4675
|
+
onClick: handleActionSubmit,
|
|
4676
|
+
children: [
|
|
4677
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "Confirm" }),
|
|
4678
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
|
|
4679
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
|
|
4680
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
|
|
4681
|
+
] })
|
|
4682
|
+
]
|
|
4683
|
+
}
|
|
4684
|
+
) })
|
|
4685
|
+
]
|
|
4686
|
+
},
|
|
4687
|
+
message.id
|
|
4688
|
+
);
|
|
4689
|
+
}
|
|
4690
|
+
if (message.kind === "bulkPreview" && message.csvData) {
|
|
4691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4692
|
+
"div",
|
|
4693
|
+
{
|
|
4694
|
+
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
4695
|
+
children: [
|
|
4696
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700", children: message.content || "" }),
|
|
4697
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "bg-gray-50 rounded-lg border border-gray-200 overflow-hidden", children: [
|
|
4698
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "bg-gray-100 px-3 py-2 border-b border-gray-200 flex items-center gap-2", children: [
|
|
4699
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.FileSpreadsheet, { className: "h-4 w-4 text-gray-600" }),
|
|
4700
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs font-medium text-gray-700", children: message.csvData.fileName }),
|
|
4701
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-xs text-gray-500", children: [
|
|
4702
|
+
"\u2022 ",
|
|
4703
|
+
message.csvData.rowCount,
|
|
4704
|
+
" rows"
|
|
4280
4705
|
] })
|
|
4281
4706
|
] }),
|
|
4282
|
-
|
|
4283
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("
|
|
4284
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
"
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
format: e.target.value
|
|
4293
|
-
}),
|
|
4294
|
-
className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
|
|
4295
|
-
children: [
|
|
4296
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "pdf", children: "PDF" }),
|
|
4297
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "json", children: "JSON" })
|
|
4298
|
-
]
|
|
4299
|
-
}
|
|
4300
|
-
)
|
|
4301
|
-
] })
|
|
4707
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "px-3 py-2 border-b border-gray-100", children: [
|
|
4708
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-gray-500 mb-1", children: "Columns" }),
|
|
4709
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-wrap gap-1", children: message.csvData.columns.map((col, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4710
|
+
"span",
|
|
4711
|
+
{
|
|
4712
|
+
className: "text-xs bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded",
|
|
4713
|
+
children: col
|
|
4714
|
+
},
|
|
4715
|
+
i
|
|
4716
|
+
)) })
|
|
4302
4717
|
] }),
|
|
4303
|
-
|
|
4304
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4718
|
+
message.csvData.sampleRows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "px-3 py-2", children: [
|
|
4719
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-gray-500 mb-1", children: "Sample Data" }),
|
|
4720
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-1", children: message.csvData.sampleRows.slice(0, 3).map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4721
|
+
"div",
|
|
4722
|
+
{
|
|
4723
|
+
className: "text-xs text-gray-600 bg-white rounded px-2 py-1 border border-gray-100",
|
|
4724
|
+
children: [
|
|
4725
|
+
Object.entries(row).slice(0, 3).map(([key, val], j) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
4726
|
+
j > 0 && " \u2022 ",
|
|
4727
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-gray-400", children: [
|
|
4728
|
+
key,
|
|
4729
|
+
":"
|
|
4730
|
+
] }),
|
|
4731
|
+
" ",
|
|
4732
|
+
val
|
|
4733
|
+
] }, key)),
|
|
4734
|
+
Object.keys(row).length > 3 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-gray-400", children: [
|
|
4735
|
+
" ",
|
|
4736
|
+
"..."
|
|
4737
|
+
] })
|
|
4738
|
+
]
|
|
4739
|
+
},
|
|
4740
|
+
i
|
|
4741
|
+
)) })
|
|
4325
4742
|
] }),
|
|
4326
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "
|
|
4743
|
+
message.suggestedAction && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "px-3 py-2 bg-blue-50 border-t border-blue-100", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-xs text-blue-700", children: [
|
|
4744
|
+
"Suggested action:",
|
|
4745
|
+
" ",
|
|
4746
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: message.suggestedAction.replace(/_/g, " ") })
|
|
4747
|
+
] }) })
|
|
4748
|
+
] }),
|
|
4749
|
+
message.bulkSessionId && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mt-3 flex items-center gap-2", children: [
|
|
4750
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4327
4751
|
Button,
|
|
4328
4752
|
{
|
|
4329
4753
|
type: "button",
|
|
4330
4754
|
size: "sm",
|
|
4331
4755
|
variant: "secondary",
|
|
4332
4756
|
className: "h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",
|
|
4333
|
-
onClick:
|
|
4757
|
+
onClick: () => message.bulkSessionId && confirmBulkOperation(message.bulkSessionId),
|
|
4334
4758
|
children: [
|
|
4335
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.
|
|
4759
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
4760
|
+
"Process ",
|
|
4761
|
+
message.csvData.rowCount,
|
|
4762
|
+
" rows"
|
|
4763
|
+
] }),
|
|
4336
4764
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
|
|
4337
4765
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
|
|
4338
4766
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
|
|
4339
4767
|
] })
|
|
4340
4768
|
]
|
|
4341
4769
|
}
|
|
4342
|
-
)
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4770
|
+
),
|
|
4771
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4772
|
+
Button,
|
|
4773
|
+
{
|
|
4774
|
+
type: "button",
|
|
4775
|
+
size: "sm",
|
|
4776
|
+
variant: "ghost",
|
|
4777
|
+
className: "h-8 rounded-xl px-3 text-xs text-gray-500 hover:text-gray-700 hover:bg-gray-100",
|
|
4778
|
+
onClick: cancelBulkOperation,
|
|
4779
|
+
children: "Cancel"
|
|
4780
|
+
}
|
|
4781
|
+
)
|
|
4782
|
+
] })
|
|
4783
|
+
]
|
|
4784
|
+
},
|
|
4785
|
+
message.id
|
|
4786
|
+
);
|
|
4787
|
+
}
|
|
4788
|
+
if (message.kind === "bulkProgress" && message.bulkProgress) {
|
|
4789
|
+
const { processed, total, successes, failures } = message.bulkProgress;
|
|
4790
|
+
const percentage = Math.round(processed / total * 100);
|
|
4791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4792
|
+
"div",
|
|
4793
|
+
{
|
|
4794
|
+
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
4795
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "bg-gray-50 rounded-lg border border-gray-200 p-3", children: [
|
|
4796
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
4797
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Loader2, { className: "h-4 w-4 animate-spin text-blue-600" }),
|
|
4798
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-sm font-medium text-gray-700", children: [
|
|
4799
|
+
"Processing... ",
|
|
4800
|
+
processed,
|
|
4801
|
+
" of ",
|
|
4802
|
+
total
|
|
4803
|
+
] })
|
|
4804
|
+
] }),
|
|
4805
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-2 bg-gray-200 rounded-full overflow-hidden mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4806
|
+
"div",
|
|
4807
|
+
{
|
|
4808
|
+
className: "h-full bg-blue-600 transition-all duration-300",
|
|
4809
|
+
style: { width: `${percentage}%` }
|
|
4810
|
+
}
|
|
4811
|
+
) }),
|
|
4812
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-3 text-xs text-gray-600", children: [
|
|
4813
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1", children: [
|
|
4814
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CheckCircle2, { className: "h-3 w-3 text-green-600" }),
|
|
4815
|
+
successes,
|
|
4816
|
+
" successful"
|
|
4817
|
+
] }),
|
|
4818
|
+
failures > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 text-red-600", children: [
|
|
4819
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.X, { className: "h-3 w-3" }),
|
|
4820
|
+
failures,
|
|
4821
|
+
" failed"
|
|
4822
|
+
] })
|
|
4823
|
+
] })
|
|
4824
|
+
] })
|
|
4825
|
+
},
|
|
4826
|
+
message.id
|
|
4827
|
+
);
|
|
4828
|
+
}
|
|
4829
|
+
if (message.kind === "bulkSummary" && message.bulkSummary) {
|
|
4830
|
+
const { total, successes, failures, navigationPage } = message.bulkSummary;
|
|
4831
|
+
const hasFailures = failures.length > 0;
|
|
4832
|
+
const pageLabel = navigationPage?.page === "customers" ? "Customers" : navigationPage?.page === "dashboard" ? "Dashboard" : navigationPage?.page === "settings" ? "Settings" : "Results";
|
|
4833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4834
|
+
"div",
|
|
4835
|
+
{
|
|
4836
|
+
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
4837
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4838
|
+
"div",
|
|
4839
|
+
{
|
|
4840
|
+
className: `rounded-lg border p-3 ${hasFailures ? "bg-amber-50 border-amber-200" : "bg-green-50 border-green-200"}`,
|
|
4841
|
+
children: [
|
|
4842
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
4843
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4844
|
+
import_lucide_react4.CheckCircle2,
|
|
4369
4845
|
{
|
|
4370
|
-
className:
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
)) })
|
|
4846
|
+
className: `h-5 w-5 ${hasFailures ? "text-amber-600" : "text-green-600"}`
|
|
4847
|
+
}
|
|
4848
|
+
),
|
|
4849
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-sm font-medium text-gray-800", children: "Bulk operation complete" })
|
|
4375
4850
|
] }),
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.
|
|
4379
|
-
"
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4851
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-sm text-gray-600 mb-2", children: message.content || `Processed ${total} rows: ${successes} successful${hasFailures ? `, ${failures.length} failed` : ""}.` }),
|
|
4852
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-4 text-xs", children: [
|
|
4853
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 text-green-700", children: [
|
|
4854
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CheckCircle2, { className: "h-3 w-3" }),
|
|
4855
|
+
successes,
|
|
4856
|
+
" successful"
|
|
4857
|
+
] }),
|
|
4858
|
+
hasFailures && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 text-red-600", children: [
|
|
4859
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.X, { className: "h-3 w-3" }),
|
|
4860
|
+
failures.length,
|
|
4861
|
+
" failed"
|
|
4862
|
+
] })
|
|
4863
|
+
] }),
|
|
4864
|
+
hasFailures && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mt-3 pt-2 border-t border-amber-200", children: [
|
|
4865
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-amber-700 mb-1", children: "Failed Rows" }),
|
|
4866
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-1 max-h-32 overflow-y-auto", children: [
|
|
4867
|
+
failures.slice(0, 5).map((failure, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4868
|
+
"div",
|
|
4869
|
+
{
|
|
4870
|
+
className: "text-xs text-red-700 bg-red-50 rounded px-2 py-1",
|
|
4871
|
+
children: [
|
|
4872
|
+
"Row ",
|
|
4873
|
+
failure.row,
|
|
4874
|
+
":",
|
|
4393
4875
|
" ",
|
|
4394
|
-
"
|
|
4395
|
-
]
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4876
|
+
failure.error || "Unknown error"
|
|
4877
|
+
]
|
|
4878
|
+
},
|
|
4879
|
+
i
|
|
4880
|
+
)),
|
|
4881
|
+
failures.length > 5 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "text-xs text-amber-600", children: [
|
|
4882
|
+
"...and ",
|
|
4883
|
+
failures.length - 5,
|
|
4884
|
+
" more"
|
|
4885
|
+
] })
|
|
4886
|
+
] })
|
|
4400
4887
|
] }),
|
|
4401
|
-
|
|
4402
|
-
"
|
|
4403
|
-
" ",
|
|
4404
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: message.suggestedAction.replace(/_/g, " ") })
|
|
4405
|
-
] }) })
|
|
4406
|
-
] }),
|
|
4407
|
-
message.bulkSessionId && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mt-3 flex items-center gap-2", children: [
|
|
4408
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4409
|
-
Button,
|
|
4888
|
+
navigationPage && successes > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-3 pt-2 border-t border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4889
|
+
"button",
|
|
4410
4890
|
{
|
|
4411
4891
|
type: "button",
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4892
|
+
onClick: (e) => {
|
|
4893
|
+
e.preventDefault();
|
|
4894
|
+
e.stopPropagation();
|
|
4895
|
+
if (onNavigate && navigationPage.page) {
|
|
4896
|
+
onNavigate(
|
|
4897
|
+
navigationPage.page,
|
|
4898
|
+
navigationPage.subtab
|
|
4899
|
+
);
|
|
4900
|
+
}
|
|
4901
|
+
},
|
|
4902
|
+
className: "flex items-center gap-2 text-xs text-gray-500 hover:text-gray-700 transition-colors group cursor-pointer",
|
|
4416
4903
|
children: [
|
|
4417
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
4418
|
-
"
|
|
4419
|
-
|
|
4420
|
-
"
|
|
4904
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 px-1.5 py-0.5 bg-gray-100 rounded text-[10px] font-medium text-gray-600 group-hover:bg-gray-200", children: [
|
|
4905
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-2.5 w-2.5" }),
|
|
4906
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "+" }),
|
|
4907
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-2.5 w-2.5" })
|
|
4421
4908
|
] }),
|
|
4422
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", {
|
|
4423
|
-
|
|
4424
|
-
|
|
4909
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
4910
|
+
"View ",
|
|
4911
|
+
pageLabel
|
|
4425
4912
|
] })
|
|
4426
4913
|
]
|
|
4427
4914
|
}
|
|
4428
|
-
)
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4915
|
+
) })
|
|
4916
|
+
]
|
|
4917
|
+
}
|
|
4918
|
+
)
|
|
4919
|
+
},
|
|
4920
|
+
message.id
|
|
4921
|
+
);
|
|
4922
|
+
}
|
|
4923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(React6.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4924
|
+
"div",
|
|
4925
|
+
{
|
|
4926
|
+
ref: isCurrentGuideStep ? currentStepRef : null,
|
|
4927
|
+
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
4928
|
+
children: [
|
|
4929
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-sm leading-6 text-gray-700", children: (() => {
|
|
4930
|
+
const text = message.content || "";
|
|
4931
|
+
if (message.kind === "guideStep") {
|
|
4932
|
+
const m = text.match(/^(Step\s+\d+:)([\s\S]*)/);
|
|
4933
|
+
if (m) {
|
|
4934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
4935
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: m[1] }),
|
|
4936
|
+
m[2]
|
|
4937
|
+
] });
|
|
4938
|
+
}
|
|
4939
|
+
}
|
|
4940
|
+
if (message.role === "assistant" && text) {
|
|
4941
|
+
return renderMarkdown(text);
|
|
4942
|
+
}
|
|
4943
|
+
return text || /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "opacity-70", children: "Thinking\u2026" });
|
|
4944
|
+
})() }),
|
|
4945
|
+
message.role === "assistant" && message.structuredData && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-3", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4946
|
+
DataRenderer,
|
|
4947
|
+
{
|
|
4948
|
+
type: message.structuredData.type,
|
|
4949
|
+
data: message.structuredData.data
|
|
4950
|
+
}
|
|
4951
|
+
) }),
|
|
4952
|
+
message.role === "assistant" && message.followups && message.followups.length > 0 && !message.followupSelected && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-3 flex flex-wrap gap-1.5", children: message.followups.map((followup) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4953
|
+
"button",
|
|
4954
|
+
{
|
|
4955
|
+
type: "button",
|
|
4956
|
+
onClick: () => handleFollowupClick(message.id, followup),
|
|
4957
|
+
className: "inline-flex items-center px-3 py-1.5 text-xs font-medium rounded-xl\n bg-white hover:bg-gray-50 text-gray-600 hover:text-gray-800\n border border-gray-200 hover:border-gray-300 shadow-sm\n transition-all duration-150 ease-in-out",
|
|
4958
|
+
children: followup.label
|
|
4959
|
+
},
|
|
4960
|
+
followup.id
|
|
4961
|
+
)) })
|
|
4962
|
+
]
|
|
4445
4963
|
}
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
processed,
|
|
4459
|
-
" of ",
|
|
4460
|
-
total
|
|
4461
|
-
] })
|
|
4462
|
-
] }),
|
|
4463
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-2 bg-gray-200 rounded-full overflow-hidden mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4464
|
-
"div",
|
|
4465
|
-
{
|
|
4466
|
-
className: "h-full bg-blue-600 transition-all duration-300",
|
|
4467
|
-
style: { width: `${percentage}%` }
|
|
4468
|
-
}
|
|
4469
|
-
) }),
|
|
4470
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-3 text-xs text-gray-600", children: [
|
|
4471
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1", children: [
|
|
4472
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CheckCircle2, { className: "h-3 w-3 text-green-600" }),
|
|
4473
|
-
successes,
|
|
4474
|
-
" successful"
|
|
4475
|
-
] }),
|
|
4476
|
-
failures > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 text-red-600", children: [
|
|
4477
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.X, { className: "h-3 w-3" }),
|
|
4478
|
-
failures,
|
|
4479
|
-
" failed"
|
|
4480
|
-
] })
|
|
4481
|
-
] })
|
|
4482
|
-
] })
|
|
4483
|
-
},
|
|
4484
|
-
message.id
|
|
4485
|
-
);
|
|
4964
|
+
) }, message.id);
|
|
4965
|
+
}),
|
|
4966
|
+
(activeGuide || guideComplete) && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mt-3 flex items-center gap-2", children: [
|
|
4967
|
+
activeGuide && activeGuide.stepIndex > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4968
|
+
Button,
|
|
4969
|
+
{
|
|
4970
|
+
type: "button",
|
|
4971
|
+
size: "sm",
|
|
4972
|
+
variant: "secondary",
|
|
4973
|
+
className: "h-7 w-7 rounded-full p-0 bg-gray-100 hover:bg-gray-200 border border-gray-200",
|
|
4974
|
+
onClick: goBackGuide,
|
|
4975
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ArrowLeft, { className: "h-3.5 w-3.5 text-gray-600" })
|
|
4486
4976
|
}
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
{
|
|
4504
|
-
className: `h-5 w-5 ${hasFailures ? "text-amber-600" : "text-green-600"}`
|
|
4505
|
-
}
|
|
4506
|
-
),
|
|
4507
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-sm font-medium text-gray-800", children: "Bulk operation complete" })
|
|
4508
|
-
] }),
|
|
4509
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-sm text-gray-600 mb-2", children: message.content || `Processed ${total} rows: ${successes} successful${hasFailures ? `, ${failures.length} failed` : ""}.` }),
|
|
4510
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-4 text-xs", children: [
|
|
4511
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 text-green-700", children: [
|
|
4512
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CheckCircle2, { className: "h-3 w-3" }),
|
|
4513
|
-
successes,
|
|
4514
|
-
" successful"
|
|
4515
|
-
] }),
|
|
4516
|
-
hasFailures && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 text-red-600", children: [
|
|
4517
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.X, { className: "h-3 w-3" }),
|
|
4518
|
-
failures.length,
|
|
4519
|
-
" failed"
|
|
4520
|
-
] })
|
|
4521
|
-
] }),
|
|
4522
|
-
hasFailures && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mt-3 pt-2 border-t border-amber-200", children: [
|
|
4523
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-amber-700 mb-1", children: "Failed Rows" }),
|
|
4524
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-1 max-h-32 overflow-y-auto", children: [
|
|
4525
|
-
failures.slice(0, 5).map((failure, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4526
|
-
"div",
|
|
4527
|
-
{
|
|
4528
|
-
className: "text-xs text-red-700 bg-red-50 rounded px-2 py-1",
|
|
4529
|
-
children: [
|
|
4530
|
-
"Row ",
|
|
4531
|
-
failure.row,
|
|
4532
|
-
":",
|
|
4533
|
-
" ",
|
|
4534
|
-
failure.error || "Unknown error"
|
|
4535
|
-
]
|
|
4536
|
-
},
|
|
4537
|
-
i
|
|
4538
|
-
)),
|
|
4539
|
-
failures.length > 5 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "text-xs text-amber-600", children: [
|
|
4540
|
-
"...and ",
|
|
4541
|
-
failures.length - 5,
|
|
4542
|
-
" more"
|
|
4543
|
-
] })
|
|
4544
|
-
] })
|
|
4545
|
-
] }),
|
|
4546
|
-
navigationPage && successes > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-3 pt-2 border-t border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4547
|
-
"button",
|
|
4548
|
-
{
|
|
4549
|
-
type: "button",
|
|
4550
|
-
onClick: (e) => {
|
|
4551
|
-
e.preventDefault();
|
|
4552
|
-
e.stopPropagation();
|
|
4553
|
-
if (onNavigate && navigationPage.page) {
|
|
4554
|
-
onNavigate(
|
|
4555
|
-
navigationPage.page,
|
|
4556
|
-
navigationPage.subtab
|
|
4557
|
-
);
|
|
4558
|
-
}
|
|
4559
|
-
},
|
|
4560
|
-
className: "flex items-center gap-2 text-xs text-gray-500 hover:text-gray-700 transition-colors group cursor-pointer",
|
|
4561
|
-
children: [
|
|
4562
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 px-1.5 py-0.5 bg-gray-100 rounded text-[10px] font-medium text-gray-600 group-hover:bg-gray-200", children: [
|
|
4563
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-2.5 w-2.5" }),
|
|
4564
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "+" }),
|
|
4565
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-2.5 w-2.5" })
|
|
4566
|
-
] }),
|
|
4567
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
4568
|
-
"View ",
|
|
4569
|
-
pageLabel
|
|
4570
|
-
] })
|
|
4571
|
-
]
|
|
4572
|
-
}
|
|
4573
|
-
) })
|
|
4574
|
-
]
|
|
4575
|
-
}
|
|
4576
|
-
)
|
|
4577
|
-
},
|
|
4578
|
-
message.id
|
|
4579
|
-
);
|
|
4977
|
+
),
|
|
4978
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4979
|
+
Button,
|
|
4980
|
+
{
|
|
4981
|
+
type: "button",
|
|
4982
|
+
size: "sm",
|
|
4983
|
+
variant: "secondary",
|
|
4984
|
+
className: "h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",
|
|
4985
|
+
onClick: guideComplete ? handleBack : advanceGuide,
|
|
4986
|
+
children: [
|
|
4987
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: guideComplete ? "Done" : "Next" }),
|
|
4988
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
|
|
4989
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
|
|
4990
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
|
|
4991
|
+
] })
|
|
4992
|
+
]
|
|
4580
4993
|
}
|
|
4581
|
-
|
|
4582
|
-
|
|
4994
|
+
)
|
|
4995
|
+
] }),
|
|
4996
|
+
(phase === "thinking" || phase === "searching" || phase === "executing" || phase === "responding") && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `${lastRole === "user" ? "mt-3" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4997
|
+
AssistantActivity,
|
|
4998
|
+
{
|
|
4999
|
+
phase,
|
|
5000
|
+
progressSteps
|
|
5001
|
+
}
|
|
5002
|
+
) }),
|
|
5003
|
+
isEscalated && agentIsTyping && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex items-start mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "bg-gray-200 rounded-2xl rounded-bl-md px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TypingIndicator, {}) }) }),
|
|
5004
|
+
!activeGuide && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref: messagesEndRef })
|
|
5005
|
+
] }) }) }) })
|
|
5006
|
+
] }),
|
|
5007
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
5008
|
+
"div",
|
|
5009
|
+
{
|
|
5010
|
+
className: `px-4 py-3 bg-white shrink-0 ${isDragOver ? "ring-2 ring-blue-400 ring-inset bg-blue-50" : ""}`,
|
|
5011
|
+
onDragOver: handleDragOver,
|
|
5012
|
+
onDragLeave: handleDragLeave,
|
|
5013
|
+
onDrop: handleDrop,
|
|
5014
|
+
children: [
|
|
5015
|
+
pendingFile && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mb-2 flex items-center gap-2 rounded-xl bg-blue-50 border border-blue-200 px-3 py-2", children: [
|
|
5016
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.FileSpreadsheet, { className: "h-4 w-4 text-blue-600" }),
|
|
5017
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs text-blue-700 flex-1 truncate", children: pendingFile.name }),
|
|
5018
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5019
|
+
"button",
|
|
4583
5020
|
{
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
if (m) {
|
|
4592
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
4593
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: m[1] }),
|
|
4594
|
-
m[2]
|
|
4595
|
-
] });
|
|
4596
|
-
}
|
|
4597
|
-
}
|
|
4598
|
-
if (message.role === "assistant" && text) {
|
|
4599
|
-
return renderMarkdown(text);
|
|
4600
|
-
}
|
|
4601
|
-
return text || /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "opacity-70", children: "Thinking\u2026" });
|
|
4602
|
-
})() }),
|
|
4603
|
-
message.role === "assistant" && message.structuredData && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-3", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4604
|
-
DataRenderer,
|
|
4605
|
-
{
|
|
4606
|
-
type: message.structuredData.type,
|
|
4607
|
-
data: message.structuredData.data
|
|
4608
|
-
}
|
|
4609
|
-
) }),
|
|
4610
|
-
message.role === "assistant" && message.followups && message.followups.length > 0 && !message.followupSelected && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-3 flex flex-wrap gap-1.5", children: message.followups.map((followup) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4611
|
-
"button",
|
|
4612
|
-
{
|
|
4613
|
-
type: "button",
|
|
4614
|
-
onClick: () => handleFollowupClick(message.id, followup),
|
|
4615
|
-
className: "inline-flex items-center px-3 py-1.5 text-xs font-medium rounded-xl\n bg-white hover:bg-gray-50 text-gray-600 hover:text-gray-800\n border border-gray-200 hover:border-gray-300 shadow-sm\n transition-all duration-150 ease-in-out",
|
|
4616
|
-
children: followup.label
|
|
4617
|
-
},
|
|
4618
|
-
followup.id
|
|
4619
|
-
)) })
|
|
4620
|
-
]
|
|
5021
|
+
type: "button",
|
|
5022
|
+
onClick: () => {
|
|
5023
|
+
setPendingFile(null);
|
|
5024
|
+
if (fileInputRef.current) fileInputRef.current.value = "";
|
|
5025
|
+
},
|
|
5026
|
+
className: "text-blue-600 hover:text-blue-800",
|
|
5027
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.X, { className: "h-4 w-4" })
|
|
4621
5028
|
}
|
|
4622
|
-
)
|
|
4623
|
-
}),
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
5029
|
+
)
|
|
5030
|
+
] }),
|
|
5031
|
+
pendingImages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mb-2 flex flex-wrap gap-2", children: [
|
|
5032
|
+
pendingImages.map((img, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "relative group", children: [
|
|
5033
|
+
img.preview ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5034
|
+
"img",
|
|
5035
|
+
{
|
|
5036
|
+
src: img.preview,
|
|
5037
|
+
alt: `Preview ${index + 1}`,
|
|
5038
|
+
className: "h-16 w-16 object-cover rounded-lg border border-gray-200"
|
|
5039
|
+
}
|
|
5040
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-16 w-16 rounded-lg border border-gray-200 bg-gray-100 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.FileSpreadsheet, { className: "h-6 w-6 text-gray-400" }) }),
|
|
5041
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5042
|
+
"button",
|
|
5043
|
+
{
|
|
5044
|
+
type: "button",
|
|
5045
|
+
onClick: () => {
|
|
5046
|
+
if (img.preview) URL.revokeObjectURL(img.preview);
|
|
5047
|
+
setPendingImages((prev) => prev.filter((_, i) => i !== index));
|
|
5048
|
+
},
|
|
5049
|
+
className: "absolute -top-1 -right-1 h-4 w-4 rounded-full bg-gray-800 text-white flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",
|
|
5050
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.X, { className: "h-2.5 w-2.5" })
|
|
5051
|
+
}
|
|
5052
|
+
)
|
|
5053
|
+
] }, index)),
|
|
5054
|
+
isUploadingImage && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-16 w-16 rounded-lg border border-gray-200 bg-gray-50 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Loader2, { className: "h-5 w-5 animate-spin text-gray-400" }) })
|
|
5055
|
+
] }),
|
|
5056
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("form", { onSubmit: handleSubmit, className: "w-full", children: [
|
|
5057
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5058
|
+
"input",
|
|
4627
5059
|
{
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
className: "
|
|
4632
|
-
|
|
4633
|
-
|
|
5060
|
+
ref: fileInputRef,
|
|
5061
|
+
type: "file",
|
|
5062
|
+
accept: ".csv",
|
|
5063
|
+
className: "hidden",
|
|
5064
|
+
onChange: (e) => {
|
|
5065
|
+
const file = e.target.files?.[0];
|
|
5066
|
+
if (file) {
|
|
5067
|
+
setPendingFile(file);
|
|
5068
|
+
}
|
|
5069
|
+
}
|
|
4634
5070
|
}
|
|
4635
5071
|
),
|
|
4636
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.
|
|
4637
|
-
|
|
5072
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5073
|
+
"input",
|
|
4638
5074
|
{
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
(phase === "thinking" || phase === "searching" || phase === "executing" || phase === "responding") && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `${lastRole === "user" ? "mt-3" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4655
|
-
AssistantActivity,
|
|
4656
|
-
{
|
|
4657
|
-
phase,
|
|
4658
|
-
progressSteps
|
|
4659
|
-
}
|
|
4660
|
-
) }),
|
|
4661
|
-
isEscalated && agentIsTyping && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TypingIndicator, {}) }),
|
|
4662
|
-
!activeGuide && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref: messagesEndRef })
|
|
4663
|
-
] }) }) }) })
|
|
4664
|
-
}
|
|
4665
|
-
),
|
|
4666
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "px-4 py-3 bg-white shrink-0", children: [
|
|
4667
|
-
pendingFile && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mb-2 flex items-center gap-2 rounded-xl bg-blue-50 border border-blue-200 px-3 py-2", children: [
|
|
4668
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.FileSpreadsheet, { className: "h-4 w-4 text-blue-600" }),
|
|
4669
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs text-blue-700 flex-1 truncate", children: pendingFile.name }),
|
|
4670
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4671
|
-
"button",
|
|
4672
|
-
{
|
|
4673
|
-
type: "button",
|
|
4674
|
-
onClick: () => {
|
|
4675
|
-
setPendingFile(null);
|
|
4676
|
-
if (fileInputRef.current) fileInputRef.current.value = "";
|
|
4677
|
-
},
|
|
4678
|
-
className: "text-blue-600 hover:text-blue-800",
|
|
4679
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.X, { className: "h-4 w-4" })
|
|
4680
|
-
}
|
|
4681
|
-
)
|
|
4682
|
-
] }),
|
|
4683
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("form", { onSubmit: handleSubmit, className: "w-full", children: [
|
|
4684
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4685
|
-
"input",
|
|
4686
|
-
{
|
|
4687
|
-
ref: fileInputRef,
|
|
4688
|
-
type: "file",
|
|
4689
|
-
accept: ".csv",
|
|
4690
|
-
className: "hidden",
|
|
4691
|
-
onChange: (e) => {
|
|
4692
|
-
const file = e.target.files?.[0];
|
|
4693
|
-
if (file) {
|
|
4694
|
-
setPendingFile(file);
|
|
5075
|
+
ref: imageInputRef,
|
|
5076
|
+
type: "file",
|
|
5077
|
+
accept: "image/*,.pdf,.csv",
|
|
5078
|
+
multiple: true,
|
|
5079
|
+
className: "hidden",
|
|
5080
|
+
onChange: (e) => {
|
|
5081
|
+
const files = e.target.files;
|
|
5082
|
+
if (!files || files.length === 0) return;
|
|
5083
|
+
const csvFile = Array.from(files).find((f) => f.name.endsWith(".csv"));
|
|
5084
|
+
if (csvFile && !isEscalated) {
|
|
5085
|
+
setPendingFile(csvFile);
|
|
5086
|
+
} else {
|
|
5087
|
+
handleImageSelect(files);
|
|
5088
|
+
}
|
|
5089
|
+
}
|
|
4695
5090
|
}
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
),
|
|
4712
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4713
|
-
"textarea",
|
|
4714
|
-
{
|
|
4715
|
-
placeholder: pendingFile ? "Describe what to do with this CSV..." : "Ask anything...",
|
|
4716
|
-
value: input,
|
|
4717
|
-
onChange: (e) => {
|
|
4718
|
-
setInput(e.target.value);
|
|
4719
|
-
if (e.target.value.length > 0) {
|
|
4720
|
-
handleTypingStart();
|
|
5091
|
+
),
|
|
5092
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `flex w-full items-start gap-2 rounded-xl border bg-white px-3 py-2 shadow-sm ${isDragOver ? "border-blue-400" : "border-gray-200"}`, children: [
|
|
5093
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5094
|
+
Button,
|
|
5095
|
+
{
|
|
5096
|
+
type: "button",
|
|
5097
|
+
size: "icon",
|
|
5098
|
+
variant: "ghost",
|
|
5099
|
+
onClick: () => {
|
|
5100
|
+
imageInputRef.current?.click();
|
|
5101
|
+
},
|
|
5102
|
+
className: "h-5 w-5 rounded-full text-gray-400 hover:text-gray-600 hover:bg-gray-100",
|
|
5103
|
+
title: "Attach file (image, PDF, or CSV)",
|
|
5104
|
+
disabled: isUploadingImage,
|
|
5105
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Paperclip, { className: "h-2.5 w-2.5" })
|
|
4721
5106
|
}
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
5107
|
+
),
|
|
5108
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5109
|
+
"textarea",
|
|
5110
|
+
{
|
|
5111
|
+
placeholder: pendingFile ? "Describe what to do with this CSV..." : pendingImages.length > 0 ? "Add a message (optional)..." : isDragOver ? "Drop files here..." : "Ask anything...",
|
|
5112
|
+
value: input,
|
|
5113
|
+
onChange: (e) => {
|
|
5114
|
+
setInput(e.target.value);
|
|
5115
|
+
if (e.target.value.length > 0) {
|
|
5116
|
+
handleTypingStart();
|
|
5117
|
+
}
|
|
5118
|
+
},
|
|
5119
|
+
rows: 1,
|
|
5120
|
+
className: "flex-1 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 text-sm placeholder:text-gray-400 resize-none overflow-hidden outline-none",
|
|
5121
|
+
style: { minHeight: "20px", maxHeight: "120px" },
|
|
5122
|
+
onInput: (e) => {
|
|
5123
|
+
const target = e.target;
|
|
5124
|
+
target.style.height = "auto";
|
|
5125
|
+
target.style.height = Math.min(target.scrollHeight, 120) + "px";
|
|
5126
|
+
},
|
|
5127
|
+
onKeyDown: (e) => {
|
|
5128
|
+
if (e.key === "Enter" && !e.shiftKey && !e.metaKey && !e.ctrlKey) {
|
|
5129
|
+
e.preventDefault();
|
|
5130
|
+
if (input.trim() || pendingFile || pendingImages.length > 0) {
|
|
5131
|
+
const form = e.currentTarget.closest("form");
|
|
5132
|
+
if (form) {
|
|
5133
|
+
form.requestSubmit();
|
|
5134
|
+
}
|
|
5135
|
+
}
|
|
5136
|
+
return;
|
|
5137
|
+
}
|
|
5138
|
+
if ((e.metaKey || e.ctrlKey) && e.key === "Enter") {
|
|
5139
|
+
const currentBulkSession = pendingBulkSessionRef.current;
|
|
5140
|
+
if (currentBulkSession) {
|
|
5141
|
+
e.preventDefault();
|
|
5142
|
+
e.stopPropagation();
|
|
5143
|
+
confirmBulkOperation(currentBulkSession);
|
|
5144
|
+
return;
|
|
5145
|
+
}
|
|
5146
|
+
if (pendingAction) {
|
|
5147
|
+
e.preventDefault();
|
|
5148
|
+
e.stopPropagation();
|
|
5149
|
+
handleActionSubmit();
|
|
5150
|
+
return;
|
|
5151
|
+
}
|
|
5152
|
+
if (pendingNavigation) {
|
|
5153
|
+
e.preventDefault();
|
|
5154
|
+
e.stopPropagation();
|
|
5155
|
+
handleConfirmNavigation(pendingNavigation);
|
|
5156
|
+
return;
|
|
5157
|
+
}
|
|
5158
|
+
const currentGuide = activeGuideRef.current;
|
|
5159
|
+
if (currentGuide) {
|
|
5160
|
+
e.preventDefault();
|
|
5161
|
+
e.stopPropagation();
|
|
5162
|
+
advanceGuide();
|
|
5163
|
+
return;
|
|
5164
|
+
}
|
|
4738
5165
|
}
|
|
4739
5166
|
}
|
|
4740
|
-
return;
|
|
4741
5167
|
}
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
e.preventDefault();
|
|
4752
|
-
e.stopPropagation();
|
|
4753
|
-
handleActionSubmit();
|
|
4754
|
-
return;
|
|
4755
|
-
}
|
|
4756
|
-
if (pendingNavigation) {
|
|
4757
|
-
e.preventDefault();
|
|
4758
|
-
e.stopPropagation();
|
|
4759
|
-
handleConfirmNavigation(pendingNavigation);
|
|
4760
|
-
return;
|
|
4761
|
-
}
|
|
4762
|
-
const currentGuide = activeGuideRef.current;
|
|
4763
|
-
if (currentGuide) {
|
|
5168
|
+
),
|
|
5169
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5170
|
+
Button,
|
|
5171
|
+
{
|
|
5172
|
+
type: "submit",
|
|
5173
|
+
size: "icon",
|
|
5174
|
+
disabled: !input.trim() && !pendingFile && pendingImages.length === 0 || isWaitingForAuth,
|
|
5175
|
+
className: "h-6 w-6 rounded-full bg-gray-700 hover:bg-gray-600 disabled:bg-gray-300",
|
|
5176
|
+
onClick: (e) => {
|
|
4764
5177
|
e.preventDefault();
|
|
4765
|
-
e.
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
5178
|
+
const form = e.currentTarget.closest("form");
|
|
5179
|
+
if (form) {
|
|
5180
|
+
form.requestSubmit();
|
|
5181
|
+
}
|
|
5182
|
+
},
|
|
5183
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ArrowUp, { className: "h-2.5 w-2.5 text-white" })
|
|
4769
5184
|
}
|
|
4770
|
-
|
|
4771
|
-
}
|
|
4772
|
-
)
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
type: "submit",
|
|
4777
|
-
size: "icon",
|
|
4778
|
-
disabled: !input.trim() && !pendingFile || isWaitingForAuth,
|
|
4779
|
-
className: "h-6 w-6 rounded-full bg-gray-900 hover:bg-gray-800 disabled:bg-gray-300",
|
|
4780
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ArrowUp, { className: "h-2.5 w-2.5" })
|
|
4781
|
-
}
|
|
4782
|
-
)
|
|
4783
|
-
] })
|
|
4784
|
-
] })
|
|
4785
|
-
] }),
|
|
5185
|
+
)
|
|
5186
|
+
] })
|
|
5187
|
+
] })
|
|
5188
|
+
]
|
|
5189
|
+
}
|
|
5190
|
+
),
|
|
4786
5191
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4787
5192
|
GuideCursor,
|
|
4788
5193
|
{
|
|
@@ -4791,6 +5196,13 @@ ${userText}`
|
|
|
4791
5196
|
visible: cursorState.visible,
|
|
4792
5197
|
onClick: cursorState.onClick
|
|
4793
5198
|
}
|
|
5199
|
+
),
|
|
5200
|
+
lightboxImageUrl && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5201
|
+
ImageLightbox,
|
|
5202
|
+
{
|
|
5203
|
+
imageUrl: lightboxImageUrl,
|
|
5204
|
+
onClose: () => setLightboxImageUrl(null)
|
|
5205
|
+
}
|
|
4794
5206
|
)
|
|
4795
5207
|
]
|
|
4796
5208
|
}
|
|
@@ -4835,7 +5247,8 @@ function ChatPanelWithToggle({
|
|
|
4835
5247
|
initialCorner,
|
|
4836
5248
|
onCornerChange,
|
|
4837
5249
|
productBackendUrl,
|
|
4838
|
-
getAuthHeaders
|
|
5250
|
+
getAuthHeaders,
|
|
5251
|
+
isEval
|
|
4839
5252
|
}) {
|
|
4840
5253
|
const [internalIsOpen, setInternalIsOpen] = React6.useState(defaultOpen);
|
|
4841
5254
|
const isOpen = controlledIsOpen !== void 0 ? controlledIsOpen : internalIsOpen;
|
|
@@ -4866,7 +5279,8 @@ function ChatPanelWithToggle({
|
|
|
4866
5279
|
initialCorner,
|
|
4867
5280
|
onCornerChange,
|
|
4868
5281
|
productBackendUrl,
|
|
4869
|
-
getAuthHeaders
|
|
5282
|
+
getAuthHeaders,
|
|
5283
|
+
isEval
|
|
4870
5284
|
}
|
|
4871
5285
|
);
|
|
4872
5286
|
}
|