@kite-copilot/chat-panel 0.2.34 → 0.2.36
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 +521 -326
- package/dist/auto.d.cts +1 -1
- package/dist/auto.d.ts +1 -1
- package/dist/auto.js +1 -1
- package/dist/{chunk-URD5MNZI.js → chunk-GUAWNSRO.js} +527 -330
- package/dist/{createKiteChat-DPFkdPqV.d.cts → createKiteChat-jmAPjuv_.d.cts} +14 -2
- package/dist/{createKiteChat-DPFkdPqV.d.ts → createKiteChat-jmAPjuv_.d.ts} +14 -2
- package/dist/embed.global.js +64 -22
- package/dist/index.cjs +525 -330
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +2 -2
- package/package.json +1 -1
package/dist/auto.cjs
CHANGED
|
@@ -40,6 +40,7 @@ var import_client = require("react-dom/client");
|
|
|
40
40
|
|
|
41
41
|
// src/ChatPanel.tsx
|
|
42
42
|
var React4 = __toESM(require("react"), 1);
|
|
43
|
+
var import_supabase_js = require("@supabase/supabase-js");
|
|
43
44
|
|
|
44
45
|
// src/lib/utils.ts
|
|
45
46
|
var import_clsx = require("clsx");
|
|
@@ -884,8 +885,36 @@ function DataRenderer({ type, data }) {
|
|
|
884
885
|
}
|
|
885
886
|
}
|
|
886
887
|
|
|
887
|
-
// src/
|
|
888
|
+
// src/components/TypingIndicator.tsx
|
|
888
889
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
890
|
+
function TypingIndicator({ className = "" }) {
|
|
891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `flex items-center gap-1 px-4 py-3 ${className}`, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
892
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
893
|
+
"span",
|
|
894
|
+
{
|
|
895
|
+
className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce",
|
|
896
|
+
style: { animationDelay: "0ms", animationDuration: "600ms" }
|
|
897
|
+
}
|
|
898
|
+
),
|
|
899
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
900
|
+
"span",
|
|
901
|
+
{
|
|
902
|
+
className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce",
|
|
903
|
+
style: { animationDelay: "150ms", animationDuration: "600ms" }
|
|
904
|
+
}
|
|
905
|
+
),
|
|
906
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
907
|
+
"span",
|
|
908
|
+
{
|
|
909
|
+
className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce",
|
|
910
|
+
style: { animationDelay: "300ms", animationDuration: "600ms" }
|
|
911
|
+
}
|
|
912
|
+
)
|
|
913
|
+
] }) });
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
// src/ChatPanel.tsx
|
|
917
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
889
918
|
var DEFAULT_AGENT_URL = "http://localhost:5002";
|
|
890
919
|
var PANEL_WIDTH = 340;
|
|
891
920
|
function unescapeJsonString(str) {
|
|
@@ -907,7 +936,7 @@ function renderMarkdown(text) {
|
|
|
907
936
|
const codeMatch = remaining.match(/^`([^`]+)`/);
|
|
908
937
|
if (codeMatch) {
|
|
909
938
|
parts.push(
|
|
910
|
-
/* @__PURE__ */ (0,
|
|
939
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
911
940
|
"code",
|
|
912
941
|
{
|
|
913
942
|
className: "bg-gray-100 px-1 py-0.5 rounded text-xs font-mono",
|
|
@@ -921,20 +950,20 @@ function renderMarkdown(text) {
|
|
|
921
950
|
}
|
|
922
951
|
const boldMatch = remaining.match(/^\*\*([^*]+)\*\*/);
|
|
923
952
|
if (boldMatch) {
|
|
924
|
-
parts.push(/* @__PURE__ */ (0,
|
|
953
|
+
parts.push(/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: boldMatch[1] }, keyIndex++));
|
|
925
954
|
remaining = remaining.slice(boldMatch[0].length);
|
|
926
955
|
continue;
|
|
927
956
|
}
|
|
928
957
|
const italicMatch = remaining.match(/^\*([^*]+)\*/);
|
|
929
958
|
if (italicMatch) {
|
|
930
|
-
parts.push(/* @__PURE__ */ (0,
|
|
959
|
+
parts.push(/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("em", { children: italicMatch[1] }, keyIndex++));
|
|
931
960
|
remaining = remaining.slice(italicMatch[0].length);
|
|
932
961
|
continue;
|
|
933
962
|
}
|
|
934
963
|
const linkMatch = remaining.match(/^\[([^\]]+)\]\(([^)]+)\)/);
|
|
935
964
|
if (linkMatch) {
|
|
936
965
|
parts.push(
|
|
937
|
-
/* @__PURE__ */ (0,
|
|
966
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
938
967
|
"a",
|
|
939
968
|
{
|
|
940
969
|
href: linkMatch[2],
|
|
@@ -954,7 +983,7 @@ function renderMarkdown(text) {
|
|
|
954
983
|
const url = urlMatch[1];
|
|
955
984
|
const href = url.startsWith("www.") ? `https://${url}` : url;
|
|
956
985
|
parts.push(
|
|
957
|
-
/* @__PURE__ */ (0,
|
|
986
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
958
987
|
"a",
|
|
959
988
|
{
|
|
960
989
|
href,
|
|
@@ -973,7 +1002,7 @@ function renderMarkdown(text) {
|
|
|
973
1002
|
if (emailMatch) {
|
|
974
1003
|
const email = emailMatch[1];
|
|
975
1004
|
parts.push(
|
|
976
|
-
/* @__PURE__ */ (0,
|
|
1005
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
977
1006
|
"a",
|
|
978
1007
|
{
|
|
979
1008
|
href: `mailto:${email}`,
|
|
@@ -998,17 +1027,17 @@ function renderMarkdown(text) {
|
|
|
998
1027
|
remaining = remaining.slice(nextSpecial);
|
|
999
1028
|
}
|
|
1000
1029
|
}
|
|
1001
|
-
return parts.length === 1 ? parts[0] : /* @__PURE__ */ (0,
|
|
1030
|
+
return parts.length === 1 ? parts[0] : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: parts });
|
|
1002
1031
|
};
|
|
1003
1032
|
const flushList = () => {
|
|
1004
1033
|
if (currentList) {
|
|
1005
1034
|
const ListTag = currentList.type === "ul" ? "ul" : "ol";
|
|
1006
1035
|
elements.push(
|
|
1007
|
-
/* @__PURE__ */ (0,
|
|
1036
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1008
1037
|
ListTag,
|
|
1009
1038
|
{
|
|
1010
1039
|
className: `${currentList.type === "ul" ? "list-disc" : "list-decimal"} ml-4 my-1`,
|
|
1011
|
-
children: currentList.items.map((item, i) => /* @__PURE__ */ (0,
|
|
1040
|
+
children: currentList.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { className: "ml-2", children: item }, i))
|
|
1012
1041
|
},
|
|
1013
1042
|
elements.length
|
|
1014
1043
|
)
|
|
@@ -1021,11 +1050,11 @@ function renderMarkdown(text) {
|
|
|
1021
1050
|
if (line.startsWith("```")) {
|
|
1022
1051
|
if (inCodeBlock) {
|
|
1023
1052
|
elements.push(
|
|
1024
|
-
/* @__PURE__ */ (0,
|
|
1053
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1025
1054
|
"pre",
|
|
1026
1055
|
{
|
|
1027
1056
|
className: "bg-gray-100 rounded p-2 my-1 overflow-x-auto",
|
|
1028
|
-
children: /* @__PURE__ */ (0,
|
|
1057
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("code", { className: "text-xs font-mono", children: codeContent.join("\n") })
|
|
1029
1058
|
},
|
|
1030
1059
|
elements.length
|
|
1031
1060
|
)
|
|
@@ -1051,7 +1080,7 @@ function renderMarkdown(text) {
|
|
|
1051
1080
|
const content = processInlineFormatting(headerMatch[2]);
|
|
1052
1081
|
const className = level === 1 ? "text-lg font-bold my-1" : level === 2 ? "text-base font-bold my-1" : "text-sm font-semibold my-1";
|
|
1053
1082
|
elements.push(
|
|
1054
|
-
/* @__PURE__ */ (0,
|
|
1083
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className, children: content }, elements.length)
|
|
1055
1084
|
);
|
|
1056
1085
|
continue;
|
|
1057
1086
|
}
|
|
@@ -1075,23 +1104,23 @@ function renderMarkdown(text) {
|
|
|
1075
1104
|
}
|
|
1076
1105
|
if (line.trim() === "") {
|
|
1077
1106
|
flushList();
|
|
1078
|
-
elements.push(/* @__PURE__ */ (0,
|
|
1107
|
+
elements.push(/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-2" }, elements.length));
|
|
1079
1108
|
continue;
|
|
1080
1109
|
}
|
|
1081
1110
|
if (line.match(/^[-*_]{3,}$/)) {
|
|
1082
1111
|
flushList();
|
|
1083
1112
|
elements.push(
|
|
1084
|
-
/* @__PURE__ */ (0,
|
|
1113
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("hr", { className: "my-2 border-gray-200" }, elements.length)
|
|
1085
1114
|
);
|
|
1086
1115
|
continue;
|
|
1087
1116
|
}
|
|
1088
1117
|
flushList();
|
|
1089
1118
|
elements.push(
|
|
1090
|
-
/* @__PURE__ */ (0,
|
|
1119
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: processInlineFormatting(line) }, elements.length)
|
|
1091
1120
|
);
|
|
1092
1121
|
}
|
|
1093
1122
|
flushList();
|
|
1094
|
-
return /* @__PURE__ */ (0,
|
|
1123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: elements });
|
|
1095
1124
|
}
|
|
1096
1125
|
var defaultStartingQuestions = [
|
|
1097
1126
|
{
|
|
@@ -1318,21 +1347,155 @@ function ChatPanel({
|
|
|
1318
1347
|
orgId,
|
|
1319
1348
|
userName,
|
|
1320
1349
|
userEmail,
|
|
1321
|
-
userOrganization
|
|
1350
|
+
userOrganization,
|
|
1351
|
+
supabaseUrl,
|
|
1352
|
+
supabaseAnonKey
|
|
1322
1353
|
} = {}) {
|
|
1323
1354
|
const [messages, setMessages] = React4.useState(initialMessages);
|
|
1324
1355
|
const [input, setInput] = React4.useState("");
|
|
1325
1356
|
const [sessionId, setSessionId] = React4.useState(() => crypto.randomUUID());
|
|
1326
1357
|
const [isEscalated, setIsEscalated] = React4.useState(false);
|
|
1327
1358
|
const escalationWsRef = React4.useRef(null);
|
|
1359
|
+
const [agentIsTyping, setAgentIsTyping] = React4.useState(false);
|
|
1360
|
+
const supabaseRef = React4.useRef(null);
|
|
1361
|
+
const typingChannelRef = React4.useRef(null);
|
|
1362
|
+
const typingTimeoutRef = React4.useRef(null);
|
|
1328
1363
|
const resetSession = React4.useCallback(() => {
|
|
1364
|
+
if (isEscalated && supabaseRef.current && sessionId) {
|
|
1365
|
+
supabaseRef.current.from("escalations").update({
|
|
1366
|
+
customer_status: "disconnected",
|
|
1367
|
+
customer_last_seen: (/* @__PURE__ */ new Date()).toISOString()
|
|
1368
|
+
}).eq("session_id", sessionId);
|
|
1369
|
+
}
|
|
1329
1370
|
setSessionId(crypto.randomUUID());
|
|
1330
1371
|
setIsEscalated(false);
|
|
1331
1372
|
if (escalationWsRef.current) {
|
|
1332
1373
|
escalationWsRef.current.close();
|
|
1333
1374
|
escalationWsRef.current = null;
|
|
1334
1375
|
}
|
|
1335
|
-
|
|
1376
|
+
setAgentIsTyping(false);
|
|
1377
|
+
if (typingChannelRef.current) {
|
|
1378
|
+
typingChannelRef.current.unsubscribe();
|
|
1379
|
+
typingChannelRef.current = null;
|
|
1380
|
+
}
|
|
1381
|
+
}, [isEscalated, sessionId]);
|
|
1382
|
+
React4.useEffect(() => {
|
|
1383
|
+
if (supabaseUrl && supabaseAnonKey && !supabaseRef.current) {
|
|
1384
|
+
supabaseRef.current = (0, import_supabase_js.createClient)(supabaseUrl, supabaseAnonKey);
|
|
1385
|
+
}
|
|
1386
|
+
}, [supabaseUrl, supabaseAnonKey]);
|
|
1387
|
+
React4.useEffect(() => {
|
|
1388
|
+
if (!isEscalated || !sessionId || !supabaseRef.current) {
|
|
1389
|
+
return;
|
|
1390
|
+
}
|
|
1391
|
+
const channelName = `typing:${sessionId}`;
|
|
1392
|
+
const channel = supabaseRef.current.channel(channelName);
|
|
1393
|
+
channel.on("broadcast", { event: "typing" }, (payload) => {
|
|
1394
|
+
const { sender, isTyping } = payload.payload;
|
|
1395
|
+
if (sender === "agent") {
|
|
1396
|
+
setAgentIsTyping(isTyping);
|
|
1397
|
+
if (isTyping) {
|
|
1398
|
+
if (typingTimeoutRef.current) {
|
|
1399
|
+
window.clearTimeout(typingTimeoutRef.current);
|
|
1400
|
+
}
|
|
1401
|
+
typingTimeoutRef.current = window.setTimeout(() => {
|
|
1402
|
+
setAgentIsTyping(false);
|
|
1403
|
+
}, 5e3);
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
}).subscribe((status) => {
|
|
1407
|
+
if (status === "SUBSCRIBED") {
|
|
1408
|
+
typingChannelRef.current = channel;
|
|
1409
|
+
}
|
|
1410
|
+
});
|
|
1411
|
+
return () => {
|
|
1412
|
+
channel.unsubscribe();
|
|
1413
|
+
typingChannelRef.current = null;
|
|
1414
|
+
if (typingTimeoutRef.current) {
|
|
1415
|
+
window.clearTimeout(typingTimeoutRef.current);
|
|
1416
|
+
}
|
|
1417
|
+
};
|
|
1418
|
+
}, [isEscalated, sessionId]);
|
|
1419
|
+
const heartbeatIntervalRef = React4.useRef(null);
|
|
1420
|
+
const updateCustomerStatus = React4.useCallback(async (status) => {
|
|
1421
|
+
if (!supabaseRef.current || !sessionId) return;
|
|
1422
|
+
try {
|
|
1423
|
+
await supabaseRef.current.from("escalations").update({
|
|
1424
|
+
customer_status: status,
|
|
1425
|
+
customer_last_seen: (/* @__PURE__ */ new Date()).toISOString()
|
|
1426
|
+
}).eq("session_id", sessionId);
|
|
1427
|
+
} catch (err) {
|
|
1428
|
+
console.error("[KiteChat] Failed to update customer status:", err);
|
|
1429
|
+
}
|
|
1430
|
+
}, [sessionId]);
|
|
1431
|
+
React4.useEffect(() => {
|
|
1432
|
+
if (!isEscalated || !sessionId || !supabaseRef.current) {
|
|
1433
|
+
return;
|
|
1434
|
+
}
|
|
1435
|
+
const currentSessionId = sessionId;
|
|
1436
|
+
const supabase = supabaseRef.current;
|
|
1437
|
+
updateCustomerStatus("active");
|
|
1438
|
+
heartbeatIntervalRef.current = window.setInterval(() => {
|
|
1439
|
+
updateCustomerStatus("active");
|
|
1440
|
+
}, 6e4);
|
|
1441
|
+
const handleBeforeUnload = () => {
|
|
1442
|
+
supabase.from("escalations").update({
|
|
1443
|
+
customer_status: "disconnected",
|
|
1444
|
+
customer_last_seen: (/* @__PURE__ */ new Date()).toISOString()
|
|
1445
|
+
}).eq("session_id", currentSessionId);
|
|
1446
|
+
};
|
|
1447
|
+
const handleVisibilityChange = () => {
|
|
1448
|
+
if (document.visibilityState === "hidden") {
|
|
1449
|
+
supabase.from("escalations").update({
|
|
1450
|
+
customer_status: "disconnected",
|
|
1451
|
+
customer_last_seen: (/* @__PURE__ */ new Date()).toISOString()
|
|
1452
|
+
}).eq("session_id", currentSessionId);
|
|
1453
|
+
} else if (document.visibilityState === "visible") {
|
|
1454
|
+
updateCustomerStatus("active");
|
|
1455
|
+
}
|
|
1456
|
+
};
|
|
1457
|
+
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
1458
|
+
document.addEventListener("visibilitychange", handleVisibilityChange);
|
|
1459
|
+
return () => {
|
|
1460
|
+
window.removeEventListener("beforeunload", handleBeforeUnload);
|
|
1461
|
+
document.removeEventListener("visibilitychange", handleVisibilityChange);
|
|
1462
|
+
supabase.from("escalations").update({
|
|
1463
|
+
customer_status: "disconnected",
|
|
1464
|
+
customer_last_seen: (/* @__PURE__ */ new Date()).toISOString()
|
|
1465
|
+
}).eq("session_id", currentSessionId).then(
|
|
1466
|
+
() => {
|
|
1467
|
+
console.log("[KiteChat] Marked customer as disconnected");
|
|
1468
|
+
},
|
|
1469
|
+
(err) => {
|
|
1470
|
+
console.error("[KiteChat] Failed to mark disconnected:", err);
|
|
1471
|
+
}
|
|
1472
|
+
);
|
|
1473
|
+
if (heartbeatIntervalRef.current) {
|
|
1474
|
+
window.clearInterval(heartbeatIntervalRef.current);
|
|
1475
|
+
heartbeatIntervalRef.current = null;
|
|
1476
|
+
}
|
|
1477
|
+
};
|
|
1478
|
+
}, [isEscalated, sessionId, updateCustomerStatus]);
|
|
1479
|
+
const sendTypingIndicator = React4.useCallback((isTyping) => {
|
|
1480
|
+
if (!typingChannelRef.current || !isEscalated) return;
|
|
1481
|
+
typingChannelRef.current.send({
|
|
1482
|
+
type: "broadcast",
|
|
1483
|
+
event: "typing",
|
|
1484
|
+
payload: { sender: "user", isTyping }
|
|
1485
|
+
});
|
|
1486
|
+
}, [isEscalated]);
|
|
1487
|
+
const userTypingTimeoutRef = React4.useRef(null);
|
|
1488
|
+
const handleTypingStart = React4.useCallback(() => {
|
|
1489
|
+
if (!isEscalated || !supabaseRef.current) return;
|
|
1490
|
+
sendTypingIndicator(true);
|
|
1491
|
+
updateCustomerStatus("active");
|
|
1492
|
+
if (userTypingTimeoutRef.current) {
|
|
1493
|
+
window.clearTimeout(userTypingTimeoutRef.current);
|
|
1494
|
+
}
|
|
1495
|
+
userTypingTimeoutRef.current = window.setTimeout(() => {
|
|
1496
|
+
sendTypingIndicator(false);
|
|
1497
|
+
}, 1500);
|
|
1498
|
+
}, [isEscalated, sendTypingIndicator, updateCustomerStatus]);
|
|
1336
1499
|
const streamIntervals = React4.useRef({});
|
|
1337
1500
|
const isEmpty = messages.length === 0;
|
|
1338
1501
|
const [phase, setPhase] = React4.useState("idle");
|
|
@@ -1607,12 +1770,13 @@ function ChatPanel({
|
|
|
1607
1770
|
type: "user_message",
|
|
1608
1771
|
content
|
|
1609
1772
|
}));
|
|
1773
|
+
updateCustomerStatus("active");
|
|
1610
1774
|
return true;
|
|
1611
1775
|
} catch (err) {
|
|
1612
1776
|
console.error("[KiteChat] Failed to send escalated message:", err);
|
|
1613
1777
|
return false;
|
|
1614
1778
|
}
|
|
1615
|
-
}, []);
|
|
1779
|
+
}, [updateCustomerStatus]);
|
|
1616
1780
|
React4.useEffect(() => {
|
|
1617
1781
|
return () => {
|
|
1618
1782
|
if (escalationWsRef.current) {
|
|
@@ -1743,6 +1907,11 @@ function ChatPanel({
|
|
|
1743
1907
|
};
|
|
1744
1908
|
setMessages((prev) => [...prev, userMessage]);
|
|
1745
1909
|
sendEscalatedMessage(trimmed);
|
|
1910
|
+
sendTypingIndicator(false);
|
|
1911
|
+
if (userTypingTimeoutRef.current) {
|
|
1912
|
+
window.clearTimeout(userTypingTimeoutRef.current);
|
|
1913
|
+
userTypingTimeoutRef.current = null;
|
|
1914
|
+
}
|
|
1746
1915
|
setInput("");
|
|
1747
1916
|
return;
|
|
1748
1917
|
}
|
|
@@ -2761,8 +2930,8 @@ ${userText}`
|
|
|
2761
2930
|
}
|
|
2762
2931
|
}
|
|
2763
2932
|
if (!isOpen) {
|
|
2764
|
-
return /* @__PURE__ */ (0,
|
|
2765
|
-
/* @__PURE__ */ (0,
|
|
2933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "fixed bottom-6 left-1/2 -translate-x-1/2 z-50", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `flex items-center gap-3 rounded-2xl bg-white border border-gray-200 shadow-lg px-4 py-2 hover:shadow-xl transition-all duration-300 ease-out focus-within:border-gray-700 ${searchExpanded ? "w-[480px]" : "w-[320px]"}`, children: !searchExpanded ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-3 w-full", children: [
|
|
2934
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2766
2935
|
"button",
|
|
2767
2936
|
{
|
|
2768
2937
|
onClick: () => {
|
|
@@ -2771,23 +2940,23 @@ ${userText}`
|
|
|
2771
2940
|
},
|
|
2772
2941
|
className: "flex items-center gap-3 flex-1 group",
|
|
2773
2942
|
children: [
|
|
2774
|
-
/* @__PURE__ */ (0,
|
|
2775
|
-
/* @__PURE__ */ (0,
|
|
2943
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-sm text-gray-500 flex-1 text-left", children: "Ask a question..." }),
|
|
2944
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs text-gray-400 font-medium", children: "\u2318I" })
|
|
2776
2945
|
]
|
|
2777
2946
|
}
|
|
2778
2947
|
),
|
|
2779
|
-
/* @__PURE__ */ (0,
|
|
2948
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2780
2949
|
"button",
|
|
2781
2950
|
{
|
|
2782
2951
|
onClick: () => {
|
|
2783
2952
|
onOpen?.();
|
|
2784
2953
|
},
|
|
2785
2954
|
className: "h-7 w-7 rounded-lg bg-gray-100 hover:bg-gray-200 flex items-center justify-center transition-colors",
|
|
2786
|
-
children: /* @__PURE__ */ (0,
|
|
2955
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Sparkles, { className: "h-3.5 w-3.5 text-black", fill: "currentColor" })
|
|
2787
2956
|
}
|
|
2788
2957
|
)
|
|
2789
|
-
] }) : /* @__PURE__ */ (0,
|
|
2790
|
-
/* @__PURE__ */ (0,
|
|
2958
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
2959
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2791
2960
|
"input",
|
|
2792
2961
|
{
|
|
2793
2962
|
ref: searchInputRef,
|
|
@@ -2815,9 +2984,9 @@ ${userText}`
|
|
|
2815
2984
|
className: "flex-1 text-sm text-gray-700 outline-none bg-transparent"
|
|
2816
2985
|
}
|
|
2817
2986
|
),
|
|
2818
|
-
/* @__PURE__ */ (0,
|
|
2819
|
-
/* @__PURE__ */ (0,
|
|
2820
|
-
/* @__PURE__ */ (0,
|
|
2987
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2988
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs text-gray-400 font-medium", children: "\u21B5 Enter" }),
|
|
2989
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2821
2990
|
"button",
|
|
2822
2991
|
{
|
|
2823
2992
|
onClick: () => {
|
|
@@ -2829,25 +2998,25 @@ ${userText}`
|
|
|
2829
2998
|
setSearchExpanded(false);
|
|
2830
2999
|
},
|
|
2831
3000
|
className: "h-7 w-7 rounded-lg bg-gray-100 hover:bg-gray-200 flex items-center justify-center transition-colors cursor-pointer",
|
|
2832
|
-
children: /* @__PURE__ */ (0,
|
|
3001
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Sparkles, { className: "h-3.5 w-3.5 text-black", fill: "currentColor" })
|
|
2833
3002
|
}
|
|
2834
3003
|
)
|
|
2835
3004
|
] })
|
|
2836
3005
|
] }) }) });
|
|
2837
3006
|
}
|
|
2838
|
-
return /* @__PURE__ */ (0,
|
|
3007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2839
3008
|
"section",
|
|
2840
3009
|
{
|
|
2841
3010
|
className: `fixed top-0 right-0 z-40 flex flex-col bg-white border-l border-gray-200 h-full overflow-hidden transition-transform duration-300 ${isOpen ? "translate-x-0" : "translate-x-full"}`,
|
|
2842
3011
|
style: { width: `${PANEL_WIDTH}px` },
|
|
2843
3012
|
children: [
|
|
2844
|
-
/* @__PURE__ */ (0,
|
|
2845
|
-
/* @__PURE__ */ (0,
|
|
2846
|
-
/* @__PURE__ */ (0,
|
|
2847
|
-
/* @__PURE__ */ (0,
|
|
3013
|
+
/* @__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: [
|
|
3014
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2.5", children: [
|
|
3015
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Sparkles, { className: "h-3.5 w-3.5 text-black", fill: "currentColor" }),
|
|
3016
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { className: "text-sm font-semibold text-gray-800", children: "Copilot" })
|
|
2848
3017
|
] }),
|
|
2849
|
-
/* @__PURE__ */ (0,
|
|
2850
|
-
/* @__PURE__ */ (0,
|
|
3018
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
3019
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2851
3020
|
Button,
|
|
2852
3021
|
{
|
|
2853
3022
|
variant: "ghost",
|
|
@@ -2862,29 +3031,40 @@ ${userText}`
|
|
|
2862
3031
|
activeGuideRef.current = void 0;
|
|
2863
3032
|
setGuideComplete(false);
|
|
2864
3033
|
},
|
|
2865
|
-
children: /* @__PURE__ */ (0,
|
|
3034
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.SquarePen, { className: "h-3 w-3" })
|
|
2866
3035
|
}
|
|
2867
3036
|
),
|
|
2868
|
-
/* @__PURE__ */ (0,
|
|
3037
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2869
3038
|
Button,
|
|
2870
3039
|
{
|
|
2871
3040
|
variant: "ghost",
|
|
2872
3041
|
size: "sm",
|
|
2873
3042
|
className: "h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",
|
|
2874
|
-
onClick: () =>
|
|
2875
|
-
|
|
3043
|
+
onClick: () => {
|
|
3044
|
+
if (isEscalated) {
|
|
3045
|
+
resetSession();
|
|
3046
|
+
setMessages([]);
|
|
3047
|
+
setPanelView("landing");
|
|
3048
|
+
setCurrentFolderId(void 0);
|
|
3049
|
+
setActiveGuide(void 0);
|
|
3050
|
+
activeGuideRef.current = void 0;
|
|
3051
|
+
setGuideComplete(false);
|
|
3052
|
+
}
|
|
3053
|
+
onClose?.();
|
|
3054
|
+
},
|
|
3055
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Minus, { className: "h-3.5 w-3.5" })
|
|
2876
3056
|
}
|
|
2877
3057
|
)
|
|
2878
3058
|
] })
|
|
2879
3059
|
] }),
|
|
2880
|
-
/* @__PURE__ */ (0,
|
|
3060
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2881
3061
|
"div",
|
|
2882
3062
|
{
|
|
2883
3063
|
className: isEmpty ? "grid flex-1 place-items-center transition-all duration-300" : "flex flex-1 flex-col transition-all duration-300 min-h-0 overflow-hidden",
|
|
2884
|
-
children: isEmpty ? /* @__PURE__ */ (0,
|
|
2885
|
-
/* @__PURE__ */ (0,
|
|
2886
|
-
/* @__PURE__ */ (0,
|
|
2887
|
-
panelView === "landing" && /* @__PURE__ */ (0,
|
|
3064
|
+
children: isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w-full overflow-y-auto px-4", children: [
|
|
3065
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "py-3 transition-all duration-300", 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?" }) }),
|
|
3066
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "pb-4 px-4", children: [
|
|
3067
|
+
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) => {
|
|
2888
3068
|
const iconColors = [
|
|
2889
3069
|
"bg-blue-400",
|
|
2890
3070
|
"bg-green-400",
|
|
@@ -2892,7 +3072,7 @@ ${userText}`
|
|
|
2892
3072
|
"bg-orange-400",
|
|
2893
3073
|
"bg-pink-400"
|
|
2894
3074
|
];
|
|
2895
|
-
return /* @__PURE__ */ (0,
|
|
3075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2896
3076
|
Button,
|
|
2897
3077
|
{
|
|
2898
3078
|
type: "button",
|
|
@@ -2901,7 +3081,7 @@ ${userText}`
|
|
|
2901
3081
|
className: "w-full justify-start rounded-lg px-3 py-1.5 text-xs text-gray-700 hover:bg-gray-100 h-auto",
|
|
2902
3082
|
onClick: () => sendTopic(question.prompt),
|
|
2903
3083
|
children: [
|
|
2904
|
-
/* @__PURE__ */ (0,
|
|
3084
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2905
3085
|
"span",
|
|
2906
3086
|
{
|
|
2907
3087
|
className: `mr-2 inline-block h-1.5 w-1.5 rounded-full ${iconColors[index % iconColors.length]}`
|
|
@@ -2913,9 +3093,9 @@ ${userText}`
|
|
|
2913
3093
|
question.id
|
|
2914
3094
|
);
|
|
2915
3095
|
}) }) }),
|
|
2916
|
-
panelView === "folder" && /* @__PURE__ */ (0,
|
|
2917
|
-
/* @__PURE__ */ (0,
|
|
2918
|
-
/* @__PURE__ */ (0,
|
|
3096
|
+
panelView === "folder" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
3097
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mb-3 flex items-center gap-2", children: [
|
|
3098
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2919
3099
|
Button,
|
|
2920
3100
|
{
|
|
2921
3101
|
type: "button",
|
|
@@ -2924,12 +3104,12 @@ ${userText}`
|
|
|
2924
3104
|
className: "h-7 w-7 rounded-full hover:bg-gray-100",
|
|
2925
3105
|
onClick: closeFolder,
|
|
2926
3106
|
"aria-label": "Back to suggestions",
|
|
2927
|
-
children: /* @__PURE__ */ (0,
|
|
3107
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ArrowLeft, { className: "h-4 w-4 text-gray-500" })
|
|
2928
3108
|
}
|
|
2929
3109
|
),
|
|
2930
|
-
/* @__PURE__ */ (0,
|
|
3110
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs font-medium uppercase tracking-wide text-gray-400", children: "Topics" })
|
|
2931
3111
|
] }),
|
|
2932
|
-
/* @__PURE__ */ (0,
|
|
3112
|
+
/* @__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)(
|
|
2933
3113
|
Button,
|
|
2934
3114
|
{
|
|
2935
3115
|
type: "button",
|
|
@@ -2943,7 +3123,7 @@ ${userText}`
|
|
|
2943
3123
|
)) })
|
|
2944
3124
|
] })
|
|
2945
3125
|
] })
|
|
2946
|
-
] }) : /* @__PURE__ */ (0,
|
|
3126
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { 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: [
|
|
2947
3127
|
messages.map((message, index) => {
|
|
2948
3128
|
const isUser = message.role === "user";
|
|
2949
3129
|
const previousRole = index > 0 ? messages[index - 1].role : void 0;
|
|
@@ -2963,17 +3143,20 @@ ${userText}`
|
|
|
2963
3143
|
return null;
|
|
2964
3144
|
}
|
|
2965
3145
|
if (isUser) {
|
|
2966
|
-
return /* @__PURE__ */ (0,
|
|
3146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `flex justify-end ${isRoleChange ? "mt-3" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "max-w-[260px] rounded-2xl rounded-br-md bg-gray-900 px-3 py-2 text-xs text-white shadow-sm", children: message.content }) }, message.id);
|
|
2967
3147
|
}
|
|
2968
3148
|
if (message.role === "agent") {
|
|
2969
|
-
return /* @__PURE__ */ (0,
|
|
3149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `flex flex-col items-start ${isRoleChange ? "mt-3" : ""}`, children: [
|
|
3150
|
+
isRoleChange && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-[10px] text-gray-500 mb-1 ml-1", children: "Agent" }),
|
|
3151
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "max-w-[260px] rounded-2xl rounded-bl-md bg-white border border-gray-200 px-3 py-2 text-xs text-gray-800 shadow-sm", children: message.content })
|
|
3152
|
+
] }, message.id);
|
|
2970
3153
|
}
|
|
2971
3154
|
if (message.kind === "searchSummary") {
|
|
2972
|
-
return /* @__PURE__ */ (0,
|
|
3155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2973
3156
|
"div",
|
|
2974
3157
|
{
|
|
2975
3158
|
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
2976
|
-
children: /* @__PURE__ */ (0,
|
|
3159
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2977
3160
|
AssistantSearchSummary,
|
|
2978
3161
|
{
|
|
2979
3162
|
title: message.title ?? "Search results",
|
|
@@ -2985,27 +3168,27 @@ ${userText}`
|
|
|
2985
3168
|
);
|
|
2986
3169
|
}
|
|
2987
3170
|
if (message.kind === "guideComplete") {
|
|
2988
|
-
return /* @__PURE__ */ (0,
|
|
3171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2989
3172
|
"div",
|
|
2990
3173
|
{
|
|
2991
3174
|
ref: isCurrentGuideStep ? currentStepRef : null,
|
|
2992
3175
|
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
2993
|
-
children: /* @__PURE__ */ (0,
|
|
2994
|
-
/* @__PURE__ */ (0,
|
|
2995
|
-
/* @__PURE__ */ (0,
|
|
3176
|
+
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: [
|
|
3177
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CheckCircle2, { className: "h-5 w-5 text-green-600 flex-shrink-0" }),
|
|
3178
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "font-medium text-green-800", children: message.content })
|
|
2996
3179
|
] })
|
|
2997
3180
|
},
|
|
2998
3181
|
message.id
|
|
2999
3182
|
);
|
|
3000
3183
|
}
|
|
3001
3184
|
if (message.kind === "navigationAction") {
|
|
3002
|
-
return /* @__PURE__ */ (0,
|
|
3185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3003
3186
|
"div",
|
|
3004
3187
|
{
|
|
3005
3188
|
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
3006
3189
|
children: [
|
|
3007
|
-
/* @__PURE__ */ (0,
|
|
3008
|
-
message.navigationTarget && /* @__PURE__ */ (0,
|
|
3190
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-2 text-gray-700", children: message.content || "" }),
|
|
3191
|
+
message.navigationTarget && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3009
3192
|
Button,
|
|
3010
3193
|
{
|
|
3011
3194
|
type: "button",
|
|
@@ -3016,10 +3199,10 @@ ${userText}`
|
|
|
3016
3199
|
message.navigationTarget
|
|
3017
3200
|
),
|
|
3018
3201
|
children: [
|
|
3019
|
-
/* @__PURE__ */ (0,
|
|
3020
|
-
/* @__PURE__ */ (0,
|
|
3021
|
-
/* @__PURE__ */ (0,
|
|
3022
|
-
/* @__PURE__ */ (0,
|
|
3202
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "Confirm" }),
|
|
3203
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
|
|
3204
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
|
|
3205
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
|
|
3023
3206
|
] })
|
|
3024
3207
|
]
|
|
3025
3208
|
}
|
|
@@ -3077,26 +3260,26 @@ ${userText}`
|
|
|
3077
3260
|
} else {
|
|
3078
3261
|
successContent = "Action completed successfully.";
|
|
3079
3262
|
}
|
|
3080
|
-
return /* @__PURE__ */ (0,
|
|
3263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3081
3264
|
"div",
|
|
3082
3265
|
{
|
|
3083
3266
|
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
3084
|
-
children: /* @__PURE__ */ (0,
|
|
3267
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 text-gray-700", children: successContent })
|
|
3085
3268
|
},
|
|
3086
3269
|
message.id
|
|
3087
3270
|
);
|
|
3088
3271
|
}
|
|
3089
|
-
return /* @__PURE__ */ (0,
|
|
3272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3090
3273
|
"div",
|
|
3091
3274
|
{
|
|
3092
3275
|
className: `min-w-0 ${isRoleChange ? "mt-3" : ""}`,
|
|
3093
3276
|
children: [
|
|
3094
|
-
/* @__PURE__ */ (0,
|
|
3095
|
-
actionType === "updateCompanyInfo" && /* @__PURE__ */ (0,
|
|
3096
|
-
/* @__PURE__ */ (0,
|
|
3097
|
-
/* @__PURE__ */ (0,
|
|
3098
|
-
/* @__PURE__ */ (0,
|
|
3099
|
-
/* @__PURE__ */ (0,
|
|
3277
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700", children: message.content || "" }),
|
|
3278
|
+
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: [
|
|
3279
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
3280
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3281
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Company Name" }),
|
|
3282
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3100
3283
|
Input,
|
|
3101
3284
|
{
|
|
3102
3285
|
placeholder: "Acme Corporation",
|
|
@@ -3109,9 +3292,9 @@ ${userText}`
|
|
|
3109
3292
|
}
|
|
3110
3293
|
)
|
|
3111
3294
|
] }),
|
|
3112
|
-
/* @__PURE__ */ (0,
|
|
3113
|
-
/* @__PURE__ */ (0,
|
|
3114
|
-
/* @__PURE__ */ (0,
|
|
3295
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3296
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Email" }),
|
|
3297
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3115
3298
|
Input,
|
|
3116
3299
|
{
|
|
3117
3300
|
type: "email",
|
|
@@ -3126,9 +3309,9 @@ ${userText}`
|
|
|
3126
3309
|
)
|
|
3127
3310
|
] })
|
|
3128
3311
|
] }),
|
|
3129
|
-
/* @__PURE__ */ (0,
|
|
3130
|
-
/* @__PURE__ */ (0,
|
|
3131
|
-
/* @__PURE__ */ (0,
|
|
3312
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3313
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Address" }),
|
|
3314
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3132
3315
|
Input,
|
|
3133
3316
|
{
|
|
3134
3317
|
placeholder: "123 Main St, San Francisco, CA",
|
|
@@ -3141,10 +3324,10 @@ ${userText}`
|
|
|
3141
3324
|
}
|
|
3142
3325
|
)
|
|
3143
3326
|
] }),
|
|
3144
|
-
/* @__PURE__ */ (0,
|
|
3145
|
-
/* @__PURE__ */ (0,
|
|
3146
|
-
/* @__PURE__ */ (0,
|
|
3147
|
-
/* @__PURE__ */ (0,
|
|
3327
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
3328
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3329
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Phone" }),
|
|
3330
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3148
3331
|
Input,
|
|
3149
3332
|
{
|
|
3150
3333
|
type: "tel",
|
|
@@ -3158,9 +3341,9 @@ ${userText}`
|
|
|
3158
3341
|
}
|
|
3159
3342
|
)
|
|
3160
3343
|
] }),
|
|
3161
|
-
/* @__PURE__ */ (0,
|
|
3162
|
-
/* @__PURE__ */ (0,
|
|
3163
|
-
/* @__PURE__ */ (0,
|
|
3344
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3345
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Website" }),
|
|
3346
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3164
3347
|
Input,
|
|
3165
3348
|
{
|
|
3166
3349
|
type: "url",
|
|
@@ -3176,9 +3359,9 @@ ${userText}`
|
|
|
3176
3359
|
] })
|
|
3177
3360
|
] })
|
|
3178
3361
|
] }),
|
|
3179
|
-
actionType === "addApiKey" && /* @__PURE__ */ (0,
|
|
3180
|
-
/* @__PURE__ */ (0,
|
|
3181
|
-
/* @__PURE__ */ (0,
|
|
3362
|
+
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: [
|
|
3363
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "API Key Name" }),
|
|
3364
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3182
3365
|
Input,
|
|
3183
3366
|
{
|
|
3184
3367
|
placeholder: "Production Key",
|
|
@@ -3191,11 +3374,11 @@ ${userText}`
|
|
|
3191
3374
|
}
|
|
3192
3375
|
)
|
|
3193
3376
|
] }) }),
|
|
3194
|
-
actionType === "addCustomer" && /* @__PURE__ */ (0,
|
|
3195
|
-
/* @__PURE__ */ (0,
|
|
3196
|
-
/* @__PURE__ */ (0,
|
|
3197
|
-
/* @__PURE__ */ (0,
|
|
3198
|
-
/* @__PURE__ */ (0,
|
|
3377
|
+
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: [
|
|
3378
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
3379
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3380
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Company Name" }),
|
|
3381
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3199
3382
|
Input,
|
|
3200
3383
|
{
|
|
3201
3384
|
placeholder: "Acme Corporation",
|
|
@@ -3208,9 +3391,9 @@ ${userText}`
|
|
|
3208
3391
|
}
|
|
3209
3392
|
)
|
|
3210
3393
|
] }),
|
|
3211
|
-
/* @__PURE__ */ (0,
|
|
3212
|
-
/* @__PURE__ */ (0,
|
|
3213
|
-
/* @__PURE__ */ (0,
|
|
3394
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3395
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Email" }),
|
|
3396
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3214
3397
|
Input,
|
|
3215
3398
|
{
|
|
3216
3399
|
type: "email",
|
|
@@ -3225,9 +3408,9 @@ ${userText}`
|
|
|
3225
3408
|
)
|
|
3226
3409
|
] })
|
|
3227
3410
|
] }),
|
|
3228
|
-
/* @__PURE__ */ (0,
|
|
3229
|
-
/* @__PURE__ */ (0,
|
|
3230
|
-
/* @__PURE__ */ (0,
|
|
3411
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3412
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Location" }),
|
|
3413
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3231
3414
|
Input,
|
|
3232
3415
|
{
|
|
3233
3416
|
placeholder: "San Francisco, CA",
|
|
@@ -3240,9 +3423,9 @@ ${userText}`
|
|
|
3240
3423
|
}
|
|
3241
3424
|
)
|
|
3242
3425
|
] }),
|
|
3243
|
-
/* @__PURE__ */ (0,
|
|
3244
|
-
/* @__PURE__ */ (0,
|
|
3245
|
-
/* @__PURE__ */ (0,
|
|
3426
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3427
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Subscription Tier" }),
|
|
3428
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3246
3429
|
"select",
|
|
3247
3430
|
{
|
|
3248
3431
|
value: formData.subscription || "Starter",
|
|
@@ -3252,19 +3435,19 @@ ${userText}`
|
|
|
3252
3435
|
}),
|
|
3253
3436
|
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",
|
|
3254
3437
|
children: [
|
|
3255
|
-
/* @__PURE__ */ (0,
|
|
3256
|
-
/* @__PURE__ */ (0,
|
|
3257
|
-
/* @__PURE__ */ (0,
|
|
3438
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Starter", children: "Starter" }),
|
|
3439
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Professional", children: "Professional" }),
|
|
3440
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Enterprise", children: "Enterprise" })
|
|
3258
3441
|
]
|
|
3259
3442
|
}
|
|
3260
3443
|
)
|
|
3261
3444
|
] })
|
|
3262
3445
|
] }),
|
|
3263
|
-
(actionType === "enable2FA" || actionType === "disable2FA") && /* @__PURE__ */ (0,
|
|
3264
|
-
actionType === "changePassword" && /* @__PURE__ */ (0,
|
|
3265
|
-
/* @__PURE__ */ (0,
|
|
3266
|
-
/* @__PURE__ */ (0,
|
|
3267
|
-
/* @__PURE__ */ (0,
|
|
3446
|
+
(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." }) }),
|
|
3447
|
+
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: [
|
|
3448
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3449
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Current Password" }),
|
|
3450
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3268
3451
|
Input,
|
|
3269
3452
|
{
|
|
3270
3453
|
type: "password",
|
|
@@ -3277,9 +3460,9 @@ ${userText}`
|
|
|
3277
3460
|
}
|
|
3278
3461
|
)
|
|
3279
3462
|
] }),
|
|
3280
|
-
/* @__PURE__ */ (0,
|
|
3281
|
-
/* @__PURE__ */ (0,
|
|
3282
|
-
/* @__PURE__ */ (0,
|
|
3463
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3464
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "New Password" }),
|
|
3465
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3283
3466
|
Input,
|
|
3284
3467
|
{
|
|
3285
3468
|
type: "password",
|
|
@@ -3292,9 +3475,9 @@ ${userText}`
|
|
|
3292
3475
|
}
|
|
3293
3476
|
)
|
|
3294
3477
|
] }),
|
|
3295
|
-
/* @__PURE__ */ (0,
|
|
3296
|
-
/* @__PURE__ */ (0,
|
|
3297
|
-
/* @__PURE__ */ (0,
|
|
3478
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3479
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Confirm New Password" }),
|
|
3480
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3298
3481
|
Input,
|
|
3299
3482
|
{
|
|
3300
3483
|
type: "password",
|
|
@@ -3308,10 +3491,10 @@ ${userText}`
|
|
|
3308
3491
|
)
|
|
3309
3492
|
] })
|
|
3310
3493
|
] }),
|
|
3311
|
-
actionType === "toggleNotification" && /* @__PURE__ */ (0,
|
|
3312
|
-
/* @__PURE__ */ (0,
|
|
3313
|
-
/* @__PURE__ */ (0,
|
|
3314
|
-
/* @__PURE__ */ (0,
|
|
3494
|
+
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: [
|
|
3495
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3496
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Notification Type" }),
|
|
3497
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3315
3498
|
"select",
|
|
3316
3499
|
{
|
|
3317
3500
|
value: formData.notificationType || "paymentReceived",
|
|
@@ -3321,17 +3504,17 @@ ${userText}`
|
|
|
3321
3504
|
}),
|
|
3322
3505
|
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",
|
|
3323
3506
|
children: [
|
|
3324
|
-
/* @__PURE__ */ (0,
|
|
3325
|
-
/* @__PURE__ */ (0,
|
|
3326
|
-
/* @__PURE__ */ (0,
|
|
3327
|
-
/* @__PURE__ */ (0,
|
|
3328
|
-
/* @__PURE__ */ (0,
|
|
3507
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "paymentReceived", children: "Payment Received" }),
|
|
3508
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "paymentFailed", children: "Payment Failed" }),
|
|
3509
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "invoicePaid", children: "Invoice Paid" }),
|
|
3510
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "monthlySummary", children: "Monthly Summary" }),
|
|
3511
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "productUpdates", children: "Product Updates" })
|
|
3329
3512
|
]
|
|
3330
3513
|
}
|
|
3331
3514
|
)
|
|
3332
3515
|
] }),
|
|
3333
|
-
/* @__PURE__ */ (0,
|
|
3334
|
-
/* @__PURE__ */ (0,
|
|
3516
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3517
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3335
3518
|
"input",
|
|
3336
3519
|
{
|
|
3337
3520
|
type: "checkbox",
|
|
@@ -3343,12 +3526,12 @@ ${userText}`
|
|
|
3343
3526
|
className: "h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"
|
|
3344
3527
|
}
|
|
3345
3528
|
),
|
|
3346
|
-
/* @__PURE__ */ (0,
|
|
3529
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs text-black", children: "Enable this notification" })
|
|
3347
3530
|
] })
|
|
3348
3531
|
] }),
|
|
3349
|
-
(actionType === "connectIntegration" || actionType === "disconnectIntegration") && /* @__PURE__ */ (0,
|
|
3350
|
-
/* @__PURE__ */ (0,
|
|
3351
|
-
/* @__PURE__ */ (0,
|
|
3532
|
+
(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: [
|
|
3533
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Integration" }),
|
|
3534
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3352
3535
|
"select",
|
|
3353
3536
|
{
|
|
3354
3537
|
value: formData.integrationName || "Slack",
|
|
@@ -3358,17 +3541,17 @@ ${userText}`
|
|
|
3358
3541
|
}),
|
|
3359
3542
|
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",
|
|
3360
3543
|
children: [
|
|
3361
|
-
/* @__PURE__ */ (0,
|
|
3362
|
-
/* @__PURE__ */ (0,
|
|
3363
|
-
/* @__PURE__ */ (0,
|
|
3544
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Slack", children: "Slack" }),
|
|
3545
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Zapier", children: "Zapier" }),
|
|
3546
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Webhook", children: "Webhook" })
|
|
3364
3547
|
]
|
|
3365
3548
|
}
|
|
3366
3549
|
)
|
|
3367
3550
|
] }) }),
|
|
3368
|
-
actionType === "addPaymentMethod" && /* @__PURE__ */ (0,
|
|
3369
|
-
/* @__PURE__ */ (0,
|
|
3370
|
-
/* @__PURE__ */ (0,
|
|
3371
|
-
/* @__PURE__ */ (0,
|
|
3551
|
+
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: [
|
|
3552
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3553
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Card Number" }),
|
|
3554
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3372
3555
|
Input,
|
|
3373
3556
|
{
|
|
3374
3557
|
placeholder: "1234 5678 9012 3456",
|
|
@@ -3381,9 +3564,9 @@ ${userText}`
|
|
|
3381
3564
|
}
|
|
3382
3565
|
)
|
|
3383
3566
|
] }),
|
|
3384
|
-
/* @__PURE__ */ (0,
|
|
3385
|
-
/* @__PURE__ */ (0,
|
|
3386
|
-
/* @__PURE__ */ (0,
|
|
3567
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3568
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Expiry Date" }),
|
|
3569
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3387
3570
|
Input,
|
|
3388
3571
|
{
|
|
3389
3572
|
placeholder: "MM/YY",
|
|
@@ -3397,11 +3580,11 @@ ${userText}`
|
|
|
3397
3580
|
)
|
|
3398
3581
|
] })
|
|
3399
3582
|
] }),
|
|
3400
|
-
actionType === "removePaymentMethod" && /* @__PURE__ */ (0,
|
|
3401
|
-
actionType === "refundPayment" && /* @__PURE__ */ (0,
|
|
3402
|
-
/* @__PURE__ */ (0,
|
|
3403
|
-
/* @__PURE__ */ (0,
|
|
3404
|
-
/* @__PURE__ */ (0,
|
|
3583
|
+
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." }) }),
|
|
3584
|
+
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: [
|
|
3585
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3586
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Transaction ID or Customer Name" }),
|
|
3587
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3405
3588
|
Input,
|
|
3406
3589
|
{
|
|
3407
3590
|
placeholder: "e.g., txn_1234 or Acme Corp",
|
|
@@ -3426,9 +3609,9 @@ ${userText}`
|
|
|
3426
3609
|
}
|
|
3427
3610
|
)
|
|
3428
3611
|
] }),
|
|
3429
|
-
/* @__PURE__ */ (0,
|
|
3430
|
-
/* @__PURE__ */ (0,
|
|
3431
|
-
/* @__PURE__ */ (0,
|
|
3612
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3613
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Amount (optional)" }),
|
|
3614
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3432
3615
|
Input,
|
|
3433
3616
|
{
|
|
3434
3617
|
placeholder: "$0.00",
|
|
@@ -3441,9 +3624,9 @@ ${userText}`
|
|
|
3441
3624
|
}
|
|
3442
3625
|
)
|
|
3443
3626
|
] }),
|
|
3444
|
-
/* @__PURE__ */ (0,
|
|
3445
|
-
/* @__PURE__ */ (0,
|
|
3446
|
-
/* @__PURE__ */ (0,
|
|
3627
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3628
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Reason (optional)" }),
|
|
3629
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3447
3630
|
Input,
|
|
3448
3631
|
{
|
|
3449
3632
|
placeholder: "e.g., Customer request",
|
|
@@ -3457,10 +3640,10 @@ ${userText}`
|
|
|
3457
3640
|
)
|
|
3458
3641
|
] })
|
|
3459
3642
|
] }),
|
|
3460
|
-
actionType === "deleteApiKey" && /* @__PURE__ */ (0,
|
|
3461
|
-
/* @__PURE__ */ (0,
|
|
3462
|
-
/* @__PURE__ */ (0,
|
|
3463
|
-
/* @__PURE__ */ (0,
|
|
3643
|
+
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: [
|
|
3644
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3645
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "API Key Name or ID" }),
|
|
3646
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3464
3647
|
Input,
|
|
3465
3648
|
{
|
|
3466
3649
|
placeholder: "Production Key",
|
|
@@ -3474,12 +3657,12 @@ ${userText}`
|
|
|
3474
3657
|
}
|
|
3475
3658
|
)
|
|
3476
3659
|
] }),
|
|
3477
|
-
/* @__PURE__ */ (0,
|
|
3660
|
+
/* @__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." })
|
|
3478
3661
|
] }),
|
|
3479
|
-
actionType === "addWebhook" && /* @__PURE__ */ (0,
|
|
3480
|
-
/* @__PURE__ */ (0,
|
|
3481
|
-
/* @__PURE__ */ (0,
|
|
3482
|
-
/* @__PURE__ */ (0,
|
|
3662
|
+
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: [
|
|
3663
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3664
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Webhook URL" }),
|
|
3665
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3483
3666
|
Input,
|
|
3484
3667
|
{
|
|
3485
3668
|
type: "url",
|
|
@@ -3493,9 +3676,9 @@ ${userText}`
|
|
|
3493
3676
|
}
|
|
3494
3677
|
)
|
|
3495
3678
|
] }),
|
|
3496
|
-
/* @__PURE__ */ (0,
|
|
3497
|
-
/* @__PURE__ */ (0,
|
|
3498
|
-
/* @__PURE__ */ (0,
|
|
3679
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3680
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Name (optional)" }),
|
|
3681
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3499
3682
|
Input,
|
|
3500
3683
|
{
|
|
3501
3684
|
placeholder: "Production Webhook",
|
|
@@ -3509,9 +3692,9 @@ ${userText}`
|
|
|
3509
3692
|
)
|
|
3510
3693
|
] })
|
|
3511
3694
|
] }),
|
|
3512
|
-
actionType === "updateCurrency" && /* @__PURE__ */ (0,
|
|
3513
|
-
/* @__PURE__ */ (0,
|
|
3514
|
-
/* @__PURE__ */ (0,
|
|
3695
|
+
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: [
|
|
3696
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Currency" }),
|
|
3697
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3515
3698
|
"select",
|
|
3516
3699
|
{
|
|
3517
3700
|
value: formData.currency || "USD",
|
|
@@ -3521,17 +3704,17 @@ ${userText}`
|
|
|
3521
3704
|
}),
|
|
3522
3705
|
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",
|
|
3523
3706
|
children: [
|
|
3524
|
-
/* @__PURE__ */ (0,
|
|
3525
|
-
/* @__PURE__ */ (0,
|
|
3526
|
-
/* @__PURE__ */ (0,
|
|
3527
|
-
/* @__PURE__ */ (0,
|
|
3707
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "USD", children: "USD ($)" }),
|
|
3708
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "EUR", children: "EUR (\u20AC)" }),
|
|
3709
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "GBP", children: "GBP (\xA3)" }),
|
|
3710
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "JPY", children: "JPY (\xA5)" })
|
|
3528
3711
|
]
|
|
3529
3712
|
}
|
|
3530
3713
|
)
|
|
3531
3714
|
] }) }),
|
|
3532
|
-
actionType === "updateTimezone" && /* @__PURE__ */ (0,
|
|
3533
|
-
/* @__PURE__ */ (0,
|
|
3534
|
-
/* @__PURE__ */ (0,
|
|
3715
|
+
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: [
|
|
3716
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Timezone" }),
|
|
3717
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3535
3718
|
"select",
|
|
3536
3719
|
{
|
|
3537
3720
|
value: formData.timezone || "America/Los_Angeles",
|
|
@@ -3541,18 +3724,18 @@ ${userText}`
|
|
|
3541
3724
|
}),
|
|
3542
3725
|
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",
|
|
3543
3726
|
children: [
|
|
3544
|
-
/* @__PURE__ */ (0,
|
|
3545
|
-
/* @__PURE__ */ (0,
|
|
3546
|
-
/* @__PURE__ */ (0,
|
|
3547
|
-
/* @__PURE__ */ (0,
|
|
3727
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "America/Los_Angeles", children: "Pacific Time (PT)" }),
|
|
3728
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "America/New_York", children: "Eastern Time (ET)" }),
|
|
3729
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Europe/London", children: "GMT" }),
|
|
3730
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Asia/Tokyo", children: "JST" })
|
|
3548
3731
|
]
|
|
3549
3732
|
}
|
|
3550
3733
|
)
|
|
3551
3734
|
] }) }),
|
|
3552
|
-
actionType === "revokeSession" && /* @__PURE__ */ (0,
|
|
3553
|
-
/* @__PURE__ */ (0,
|
|
3554
|
-
/* @__PURE__ */ (0,
|
|
3555
|
-
/* @__PURE__ */ (0,
|
|
3735
|
+
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: [
|
|
3736
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3737
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Device/Session" }),
|
|
3738
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3556
3739
|
Input,
|
|
3557
3740
|
{
|
|
3558
3741
|
placeholder: "MacBook Pro",
|
|
@@ -3565,12 +3748,12 @@ ${userText}`
|
|
|
3565
3748
|
}
|
|
3566
3749
|
)
|
|
3567
3750
|
] }),
|
|
3568
|
-
/* @__PURE__ */ (0,
|
|
3751
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-black", children: "This will sign out the device and invalidate its session." })
|
|
3569
3752
|
] }),
|
|
3570
|
-
actionType === "createSubscription" && /* @__PURE__ */ (0,
|
|
3571
|
-
/* @__PURE__ */ (0,
|
|
3572
|
-
/* @__PURE__ */ (0,
|
|
3573
|
-
/* @__PURE__ */ (0,
|
|
3753
|
+
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: [
|
|
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: "Customer Email" }),
|
|
3756
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3574
3757
|
Input,
|
|
3575
3758
|
{
|
|
3576
3759
|
type: "email",
|
|
@@ -3584,9 +3767,9 @@ ${userText}`
|
|
|
3584
3767
|
}
|
|
3585
3768
|
)
|
|
3586
3769
|
] }),
|
|
3587
|
-
/* @__PURE__ */ (0,
|
|
3588
|
-
/* @__PURE__ */ (0,
|
|
3589
|
-
/* @__PURE__ */ (0,
|
|
3770
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3771
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Plan" }),
|
|
3772
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3590
3773
|
"select",
|
|
3591
3774
|
{
|
|
3592
3775
|
value: formData.plan || "Starter",
|
|
@@ -3596,16 +3779,16 @@ ${userText}`
|
|
|
3596
3779
|
}),
|
|
3597
3780
|
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",
|
|
3598
3781
|
children: [
|
|
3599
|
-
/* @__PURE__ */ (0,
|
|
3600
|
-
/* @__PURE__ */ (0,
|
|
3601
|
-
/* @__PURE__ */ (0,
|
|
3782
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Starter", children: "Starter ($29/mo)" }),
|
|
3783
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Professional", children: "Professional ($99/mo)" }),
|
|
3784
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Enterprise", children: "Enterprise ($299/mo)" })
|
|
3602
3785
|
]
|
|
3603
3786
|
}
|
|
3604
3787
|
)
|
|
3605
3788
|
] }),
|
|
3606
|
-
/* @__PURE__ */ (0,
|
|
3607
|
-
/* @__PURE__ */ (0,
|
|
3608
|
-
/* @__PURE__ */ (0,
|
|
3789
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3790
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Billing Cycle" }),
|
|
3791
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3609
3792
|
"select",
|
|
3610
3793
|
{
|
|
3611
3794
|
value: formData.billingCycle || "monthly",
|
|
@@ -3615,18 +3798,18 @@ ${userText}`
|
|
|
3615
3798
|
}),
|
|
3616
3799
|
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",
|
|
3617
3800
|
children: [
|
|
3618
|
-
/* @__PURE__ */ (0,
|
|
3619
|
-
/* @__PURE__ */ (0,
|
|
3801
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "monthly", children: "Monthly" }),
|
|
3802
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "yearly", children: "Yearly (Save 15%)" })
|
|
3620
3803
|
]
|
|
3621
3804
|
}
|
|
3622
3805
|
)
|
|
3623
3806
|
] })
|
|
3624
3807
|
] }),
|
|
3625
|
-
actionType === "exportCertificate" && /* @__PURE__ */ (0,
|
|
3626
|
-
/* @__PURE__ */ (0,
|
|
3627
|
-
/* @__PURE__ */ (0,
|
|
3628
|
-
/* @__PURE__ */ (0,
|
|
3629
|
-
/* @__PURE__ */ (0,
|
|
3808
|
+
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: [
|
|
3809
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-black", children: "This will export your certificate of incorporation document." }),
|
|
3810
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3811
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Format" }),
|
|
3812
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3630
3813
|
"select",
|
|
3631
3814
|
{
|
|
3632
3815
|
value: formData.format || "pdf",
|
|
@@ -3636,17 +3819,17 @@ ${userText}`
|
|
|
3636
3819
|
}),
|
|
3637
3820
|
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",
|
|
3638
3821
|
children: [
|
|
3639
|
-
/* @__PURE__ */ (0,
|
|
3640
|
-
/* @__PURE__ */ (0,
|
|
3822
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "pdf", children: "PDF" }),
|
|
3823
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "json", children: "JSON" })
|
|
3641
3824
|
]
|
|
3642
3825
|
}
|
|
3643
3826
|
)
|
|
3644
3827
|
] })
|
|
3645
3828
|
] }),
|
|
3646
|
-
(actionType === "toggleBlockRule" || actionType === "enableBlockRule" || actionType === "disableBlockRule") && /* @__PURE__ */ (0,
|
|
3647
|
-
/* @__PURE__ */ (0,
|
|
3648
|
-
/* @__PURE__ */ (0,
|
|
3649
|
-
/* @__PURE__ */ (0,
|
|
3829
|
+
(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: [
|
|
3830
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3831
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Block Rule" }),
|
|
3832
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3650
3833
|
"select",
|
|
3651
3834
|
{
|
|
3652
3835
|
value: formData.ruleId || "rule_1",
|
|
@@ -3656,17 +3839,17 @@ ${userText}`
|
|
|
3656
3839
|
}),
|
|
3657
3840
|
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",
|
|
3658
3841
|
children: [
|
|
3659
|
-
/* @__PURE__ */ (0,
|
|
3660
|
-
/* @__PURE__ */ (0,
|
|
3661
|
-
/* @__PURE__ */ (0,
|
|
3662
|
-
/* @__PURE__ */ (0,
|
|
3842
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "rule_1", children: "Block if risk level = 'highest'" }),
|
|
3843
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "rule_2", children: "Block if matches Stripe block lists" }),
|
|
3844
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "rule_3", children: "Block if CVC verification fails" }),
|
|
3845
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "rule_4", children: "Block if Postal code verification fails" })
|
|
3663
3846
|
]
|
|
3664
3847
|
}
|
|
3665
3848
|
)
|
|
3666
3849
|
] }),
|
|
3667
|
-
/* @__PURE__ */ (0,
|
|
3850
|
+
/* @__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." })
|
|
3668
3851
|
] }),
|
|
3669
|
-
/* @__PURE__ */ (0,
|
|
3852
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-3", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3670
3853
|
Button,
|
|
3671
3854
|
{
|
|
3672
3855
|
type: "button",
|
|
@@ -3675,10 +3858,10 @@ ${userText}`
|
|
|
3675
3858
|
className: "h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",
|
|
3676
3859
|
onClick: handleActionSubmit,
|
|
3677
3860
|
children: [
|
|
3678
|
-
/* @__PURE__ */ (0,
|
|
3679
|
-
/* @__PURE__ */ (0,
|
|
3680
|
-
/* @__PURE__ */ (0,
|
|
3681
|
-
/* @__PURE__ */ (0,
|
|
3861
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "Confirm" }),
|
|
3862
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
|
|
3863
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
|
|
3864
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
|
|
3682
3865
|
] })
|
|
3683
3866
|
]
|
|
3684
3867
|
}
|
|
@@ -3689,25 +3872,25 @@ ${userText}`
|
|
|
3689
3872
|
);
|
|
3690
3873
|
}
|
|
3691
3874
|
if (message.kind === "bulkPreview" && message.csvData) {
|
|
3692
|
-
return /* @__PURE__ */ (0,
|
|
3875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3693
3876
|
"div",
|
|
3694
3877
|
{
|
|
3695
3878
|
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
3696
3879
|
children: [
|
|
3697
|
-
/* @__PURE__ */ (0,
|
|
3698
|
-
/* @__PURE__ */ (0,
|
|
3699
|
-
/* @__PURE__ */ (0,
|
|
3700
|
-
/* @__PURE__ */ (0,
|
|
3701
|
-
/* @__PURE__ */ (0,
|
|
3702
|
-
/* @__PURE__ */ (0,
|
|
3880
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700", children: message.content || "" }),
|
|
3881
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "bg-gray-50 rounded-lg border border-gray-200 overflow-hidden", children: [
|
|
3882
|
+
/* @__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: [
|
|
3883
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.FileSpreadsheet, { className: "h-4 w-4 text-gray-600" }),
|
|
3884
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs font-medium text-gray-700", children: message.csvData.fileName }),
|
|
3885
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-xs text-gray-500", children: [
|
|
3703
3886
|
"\u2022 ",
|
|
3704
3887
|
message.csvData.rowCount,
|
|
3705
3888
|
" rows"
|
|
3706
3889
|
] })
|
|
3707
3890
|
] }),
|
|
3708
|
-
/* @__PURE__ */ (0,
|
|
3709
|
-
/* @__PURE__ */ (0,
|
|
3710
|
-
/* @__PURE__ */ (0,
|
|
3891
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "px-3 py-2 border-b border-gray-100", children: [
|
|
3892
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-gray-500 mb-1", children: "Columns" }),
|
|
3893
|
+
/* @__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)(
|
|
3711
3894
|
"span",
|
|
3712
3895
|
{
|
|
3713
3896
|
className: "text-xs bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded",
|
|
@@ -3716,23 +3899,23 @@ ${userText}`
|
|
|
3716
3899
|
i
|
|
3717
3900
|
)) })
|
|
3718
3901
|
] }),
|
|
3719
|
-
message.csvData.sampleRows.length > 0 && /* @__PURE__ */ (0,
|
|
3720
|
-
/* @__PURE__ */ (0,
|
|
3721
|
-
/* @__PURE__ */ (0,
|
|
3902
|
+
message.csvData.sampleRows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "px-3 py-2", children: [
|
|
3903
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-gray-500 mb-1", children: "Sample Data" }),
|
|
3904
|
+
/* @__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)(
|
|
3722
3905
|
"div",
|
|
3723
3906
|
{
|
|
3724
3907
|
className: "text-xs text-gray-600 bg-white rounded px-2 py-1 border border-gray-100",
|
|
3725
3908
|
children: [
|
|
3726
|
-
Object.entries(row).slice(0, 3).map(([key, val], j) => /* @__PURE__ */ (0,
|
|
3909
|
+
Object.entries(row).slice(0, 3).map(([key, val], j) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
3727
3910
|
j > 0 && " \u2022 ",
|
|
3728
|
-
/* @__PURE__ */ (0,
|
|
3911
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-gray-400", children: [
|
|
3729
3912
|
key,
|
|
3730
3913
|
":"
|
|
3731
3914
|
] }),
|
|
3732
3915
|
" ",
|
|
3733
3916
|
val
|
|
3734
3917
|
] }, key)),
|
|
3735
|
-
Object.keys(row).length > 3 && /* @__PURE__ */ (0,
|
|
3918
|
+
Object.keys(row).length > 3 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-gray-400", children: [
|
|
3736
3919
|
" ",
|
|
3737
3920
|
"..."
|
|
3738
3921
|
] })
|
|
@@ -3741,14 +3924,14 @@ ${userText}`
|
|
|
3741
3924
|
i
|
|
3742
3925
|
)) })
|
|
3743
3926
|
] }),
|
|
3744
|
-
message.suggestedAction && /* @__PURE__ */ (0,
|
|
3927
|
+
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: [
|
|
3745
3928
|
"Suggested action:",
|
|
3746
3929
|
" ",
|
|
3747
|
-
/* @__PURE__ */ (0,
|
|
3930
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: message.suggestedAction.replace(/_/g, " ") })
|
|
3748
3931
|
] }) })
|
|
3749
3932
|
] }),
|
|
3750
|
-
message.bulkSessionId && /* @__PURE__ */ (0,
|
|
3751
|
-
/* @__PURE__ */ (0,
|
|
3933
|
+
message.bulkSessionId && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mt-3 flex items-center gap-2", children: [
|
|
3934
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3752
3935
|
Button,
|
|
3753
3936
|
{
|
|
3754
3937
|
type: "button",
|
|
@@ -3757,19 +3940,19 @@ ${userText}`
|
|
|
3757
3940
|
className: "h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",
|
|
3758
3941
|
onClick: () => message.bulkSessionId && confirmBulkOperation(message.bulkSessionId),
|
|
3759
3942
|
children: [
|
|
3760
|
-
/* @__PURE__ */ (0,
|
|
3943
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
3761
3944
|
"Process ",
|
|
3762
3945
|
message.csvData.rowCount,
|
|
3763
3946
|
" rows"
|
|
3764
3947
|
] }),
|
|
3765
|
-
/* @__PURE__ */ (0,
|
|
3766
|
-
/* @__PURE__ */ (0,
|
|
3767
|
-
/* @__PURE__ */ (0,
|
|
3948
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
|
|
3949
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
|
|
3950
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
|
|
3768
3951
|
] })
|
|
3769
3952
|
]
|
|
3770
3953
|
}
|
|
3771
3954
|
),
|
|
3772
|
-
/* @__PURE__ */ (0,
|
|
3955
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3773
3956
|
Button,
|
|
3774
3957
|
{
|
|
3775
3958
|
type: "button",
|
|
@@ -3789,35 +3972,35 @@ ${userText}`
|
|
|
3789
3972
|
if (message.kind === "bulkProgress" && message.bulkProgress) {
|
|
3790
3973
|
const { processed, total, successes, failures } = message.bulkProgress;
|
|
3791
3974
|
const percentage = Math.round(processed / total * 100);
|
|
3792
|
-
return /* @__PURE__ */ (0,
|
|
3975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3793
3976
|
"div",
|
|
3794
3977
|
{
|
|
3795
3978
|
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
3796
|
-
children: /* @__PURE__ */ (0,
|
|
3797
|
-
/* @__PURE__ */ (0,
|
|
3798
|
-
/* @__PURE__ */ (0,
|
|
3799
|
-
/* @__PURE__ */ (0,
|
|
3979
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "bg-gray-50 rounded-lg border border-gray-200 p-3", children: [
|
|
3980
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
3981
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Loader2, { className: "h-4 w-4 animate-spin text-blue-600" }),
|
|
3982
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-sm font-medium text-gray-700", children: [
|
|
3800
3983
|
"Processing... ",
|
|
3801
3984
|
processed,
|
|
3802
3985
|
" of ",
|
|
3803
3986
|
total
|
|
3804
3987
|
] })
|
|
3805
3988
|
] }),
|
|
3806
|
-
/* @__PURE__ */ (0,
|
|
3989
|
+
/* @__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)(
|
|
3807
3990
|
"div",
|
|
3808
3991
|
{
|
|
3809
3992
|
className: "h-full bg-blue-600 transition-all duration-300",
|
|
3810
3993
|
style: { width: `${percentage}%` }
|
|
3811
3994
|
}
|
|
3812
3995
|
) }),
|
|
3813
|
-
/* @__PURE__ */ (0,
|
|
3814
|
-
/* @__PURE__ */ (0,
|
|
3815
|
-
/* @__PURE__ */ (0,
|
|
3996
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-3 text-xs text-gray-600", children: [
|
|
3997
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1", children: [
|
|
3998
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CheckCircle2, { className: "h-3 w-3 text-green-600" }),
|
|
3816
3999
|
successes,
|
|
3817
4000
|
" successful"
|
|
3818
4001
|
] }),
|
|
3819
|
-
failures > 0 && /* @__PURE__ */ (0,
|
|
3820
|
-
/* @__PURE__ */ (0,
|
|
4002
|
+
failures > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 text-red-600", children: [
|
|
4003
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.X, { className: "h-3 w-3" }),
|
|
3821
4004
|
failures,
|
|
3822
4005
|
" failed"
|
|
3823
4006
|
] })
|
|
@@ -3831,41 +4014,41 @@ ${userText}`
|
|
|
3831
4014
|
const { total, successes, failures, navigationPage } = message.bulkSummary;
|
|
3832
4015
|
const hasFailures = failures.length > 0;
|
|
3833
4016
|
const pageLabel = navigationPage?.page === "customers" ? "Customers" : navigationPage?.page === "dashboard" ? "Dashboard" : navigationPage?.page === "settings" ? "Settings" : "Results";
|
|
3834
|
-
return /* @__PURE__ */ (0,
|
|
4017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3835
4018
|
"div",
|
|
3836
4019
|
{
|
|
3837
4020
|
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
3838
|
-
children: /* @__PURE__ */ (0,
|
|
4021
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3839
4022
|
"div",
|
|
3840
4023
|
{
|
|
3841
4024
|
className: `rounded-lg border p-3 ${hasFailures ? "bg-amber-50 border-amber-200" : "bg-green-50 border-green-200"}`,
|
|
3842
4025
|
children: [
|
|
3843
|
-
/* @__PURE__ */ (0,
|
|
3844
|
-
/* @__PURE__ */ (0,
|
|
4026
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
4027
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3845
4028
|
import_lucide_react4.CheckCircle2,
|
|
3846
4029
|
{
|
|
3847
4030
|
className: `h-5 w-5 ${hasFailures ? "text-amber-600" : "text-green-600"}`
|
|
3848
4031
|
}
|
|
3849
4032
|
),
|
|
3850
|
-
/* @__PURE__ */ (0,
|
|
4033
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-sm font-medium text-gray-800", children: "Bulk operation complete" })
|
|
3851
4034
|
] }),
|
|
3852
|
-
/* @__PURE__ */ (0,
|
|
3853
|
-
/* @__PURE__ */ (0,
|
|
3854
|
-
/* @__PURE__ */ (0,
|
|
3855
|
-
/* @__PURE__ */ (0,
|
|
4035
|
+
/* @__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` : ""}.` }),
|
|
4036
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-4 text-xs", children: [
|
|
4037
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 text-green-700", children: [
|
|
4038
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CheckCircle2, { className: "h-3 w-3" }),
|
|
3856
4039
|
successes,
|
|
3857
4040
|
" successful"
|
|
3858
4041
|
] }),
|
|
3859
|
-
hasFailures && /* @__PURE__ */ (0,
|
|
3860
|
-
/* @__PURE__ */ (0,
|
|
4042
|
+
hasFailures && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 text-red-600", children: [
|
|
4043
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.X, { className: "h-3 w-3" }),
|
|
3861
4044
|
failures.length,
|
|
3862
4045
|
" failed"
|
|
3863
4046
|
] })
|
|
3864
4047
|
] }),
|
|
3865
|
-
hasFailures && /* @__PURE__ */ (0,
|
|
3866
|
-
/* @__PURE__ */ (0,
|
|
3867
|
-
/* @__PURE__ */ (0,
|
|
3868
|
-
failures.slice(0, 5).map((failure, i) => /* @__PURE__ */ (0,
|
|
4048
|
+
hasFailures && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mt-3 pt-2 border-t border-amber-200", children: [
|
|
4049
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-amber-700 mb-1", children: "Failed Rows" }),
|
|
4050
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-1 max-h-32 overflow-y-auto", children: [
|
|
4051
|
+
failures.slice(0, 5).map((failure, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3869
4052
|
"div",
|
|
3870
4053
|
{
|
|
3871
4054
|
className: "text-xs text-red-700 bg-red-50 rounded px-2 py-1",
|
|
@@ -3879,14 +4062,14 @@ ${userText}`
|
|
|
3879
4062
|
},
|
|
3880
4063
|
i
|
|
3881
4064
|
)),
|
|
3882
|
-
failures.length > 5 && /* @__PURE__ */ (0,
|
|
4065
|
+
failures.length > 5 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "text-xs text-amber-600", children: [
|
|
3883
4066
|
"...and ",
|
|
3884
4067
|
failures.length - 5,
|
|
3885
4068
|
" more"
|
|
3886
4069
|
] })
|
|
3887
4070
|
] })
|
|
3888
4071
|
] }),
|
|
3889
|
-
navigationPage && successes > 0 && /* @__PURE__ */ (0,
|
|
4072
|
+
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)(
|
|
3890
4073
|
"button",
|
|
3891
4074
|
{
|
|
3892
4075
|
type: "button",
|
|
@@ -3919,12 +4102,12 @@ ${userText}`
|
|
|
3919
4102
|
},
|
|
3920
4103
|
className: "flex items-center gap-2 text-xs text-gray-500 hover:text-gray-700 transition-colors group cursor-pointer",
|
|
3921
4104
|
children: [
|
|
3922
|
-
/* @__PURE__ */ (0,
|
|
3923
|
-
/* @__PURE__ */ (0,
|
|
3924
|
-
/* @__PURE__ */ (0,
|
|
3925
|
-
/* @__PURE__ */ (0,
|
|
4105
|
+
/* @__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: [
|
|
4106
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-2.5 w-2.5" }),
|
|
4107
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "+" }),
|
|
4108
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-2.5 w-2.5" })
|
|
3926
4109
|
] }),
|
|
3927
|
-
/* @__PURE__ */ (0,
|
|
4110
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
3928
4111
|
"View ",
|
|
3929
4112
|
pageLabel
|
|
3930
4113
|
] })
|
|
@@ -3938,19 +4121,19 @@ ${userText}`
|
|
|
3938
4121
|
message.id
|
|
3939
4122
|
);
|
|
3940
4123
|
}
|
|
3941
|
-
return /* @__PURE__ */ (0,
|
|
4124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(React4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3942
4125
|
"div",
|
|
3943
4126
|
{
|
|
3944
4127
|
ref: isCurrentGuideStep ? currentStepRef : null,
|
|
3945
4128
|
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
3946
4129
|
children: [
|
|
3947
|
-
/* @__PURE__ */ (0,
|
|
4130
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-sm leading-6 text-gray-700", children: (() => {
|
|
3948
4131
|
const text = message.content || "";
|
|
3949
4132
|
if (message.kind === "guideStep") {
|
|
3950
4133
|
const m = text.match(/^(Step\s+\d+:)([\s\S]*)/);
|
|
3951
4134
|
if (m) {
|
|
3952
|
-
return /* @__PURE__ */ (0,
|
|
3953
|
-
/* @__PURE__ */ (0,
|
|
4135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
4136
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: m[1] }),
|
|
3954
4137
|
m[2]
|
|
3955
4138
|
] });
|
|
3956
4139
|
}
|
|
@@ -3958,16 +4141,16 @@ ${userText}`
|
|
|
3958
4141
|
if (message.role === "assistant" && text) {
|
|
3959
4142
|
return renderMarkdown(text);
|
|
3960
4143
|
}
|
|
3961
|
-
return text || /* @__PURE__ */ (0,
|
|
4144
|
+
return text || /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "opacity-70", children: "Thinking\u2026" });
|
|
3962
4145
|
})() }),
|
|
3963
|
-
message.role === "assistant" && message.structuredData && /* @__PURE__ */ (0,
|
|
4146
|
+
message.role === "assistant" && message.structuredData && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-3", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3964
4147
|
DataRenderer,
|
|
3965
4148
|
{
|
|
3966
4149
|
type: message.structuredData.type,
|
|
3967
4150
|
data: message.structuredData.data
|
|
3968
4151
|
}
|
|
3969
4152
|
) }),
|
|
3970
|
-
message.role === "assistant" && message.followups && message.followups.length > 0 && !message.followupSelected && /* @__PURE__ */ (0,
|
|
4153
|
+
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)(
|
|
3971
4154
|
"button",
|
|
3972
4155
|
{
|
|
3973
4156
|
type: "button",
|
|
@@ -3981,8 +4164,8 @@ ${userText}`
|
|
|
3981
4164
|
}
|
|
3982
4165
|
) }, message.id);
|
|
3983
4166
|
}),
|
|
3984
|
-
(activeGuide || guideComplete) && /* @__PURE__ */ (0,
|
|
3985
|
-
activeGuide && activeGuide.stepIndex > 0 && /* @__PURE__ */ (0,
|
|
4167
|
+
(activeGuide || guideComplete) && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mt-3 flex items-center gap-2", children: [
|
|
4168
|
+
activeGuide && activeGuide.stepIndex > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3986
4169
|
Button,
|
|
3987
4170
|
{
|
|
3988
4171
|
type: "button",
|
|
@@ -3990,10 +4173,10 @@ ${userText}`
|
|
|
3990
4173
|
variant: "secondary",
|
|
3991
4174
|
className: "h-7 w-7 rounded-full p-0 bg-gray-100 hover:bg-gray-200 border border-gray-200",
|
|
3992
4175
|
onClick: goBackGuide,
|
|
3993
|
-
children: /* @__PURE__ */ (0,
|
|
4176
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ArrowLeft, { className: "h-3.5 w-3.5 text-gray-600" })
|
|
3994
4177
|
}
|
|
3995
4178
|
),
|
|
3996
|
-
/* @__PURE__ */ (0,
|
|
4179
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3997
4180
|
Button,
|
|
3998
4181
|
{
|
|
3999
4182
|
type: "button",
|
|
@@ -4002,31 +4185,32 @@ ${userText}`
|
|
|
4002
4185
|
className: "h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",
|
|
4003
4186
|
onClick: guideComplete ? handleBack : advanceGuide,
|
|
4004
4187
|
children: [
|
|
4005
|
-
/* @__PURE__ */ (0,
|
|
4006
|
-
/* @__PURE__ */ (0,
|
|
4007
|
-
/* @__PURE__ */ (0,
|
|
4008
|
-
/* @__PURE__ */ (0,
|
|
4188
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: guideComplete ? "Done" : "Next" }),
|
|
4189
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
|
|
4190
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
|
|
4191
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
|
|
4009
4192
|
] })
|
|
4010
4193
|
]
|
|
4011
4194
|
}
|
|
4012
4195
|
)
|
|
4013
4196
|
] }),
|
|
4014
|
-
(phase === "thinking" || phase === "searching" || phase === "executing" || phase === "responding") && /* @__PURE__ */ (0,
|
|
4197
|
+
(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)(
|
|
4015
4198
|
AssistantActivity,
|
|
4016
4199
|
{
|
|
4017
4200
|
phase,
|
|
4018
4201
|
progressSteps
|
|
4019
4202
|
}
|
|
4020
4203
|
) }),
|
|
4021
|
-
|
|
4204
|
+
isEscalated && agentIsTyping && phase === "idle" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TypingIndicator, {}) }),
|
|
4205
|
+
!activeGuide && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref: messagesEndRef })
|
|
4022
4206
|
] }) }) }) })
|
|
4023
4207
|
}
|
|
4024
4208
|
),
|
|
4025
|
-
/* @__PURE__ */ (0,
|
|
4026
|
-
pendingFile && /* @__PURE__ */ (0,
|
|
4027
|
-
/* @__PURE__ */ (0,
|
|
4028
|
-
/* @__PURE__ */ (0,
|
|
4029
|
-
/* @__PURE__ */ (0,
|
|
4209
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "px-4 py-3 border-t border-gray-100 bg-gray-50/50 shrink-0", children: [
|
|
4210
|
+
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: [
|
|
4211
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.FileSpreadsheet, { className: "h-4 w-4 text-blue-600" }),
|
|
4212
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs text-blue-700 flex-1 truncate", children: pendingFile.name }),
|
|
4213
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4030
4214
|
"button",
|
|
4031
4215
|
{
|
|
4032
4216
|
type: "button",
|
|
@@ -4035,12 +4219,12 @@ ${userText}`
|
|
|
4035
4219
|
if (fileInputRef.current) fileInputRef.current.value = "";
|
|
4036
4220
|
},
|
|
4037
4221
|
className: "text-blue-600 hover:text-blue-800",
|
|
4038
|
-
children: /* @__PURE__ */ (0,
|
|
4222
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.X, { className: "h-4 w-4" })
|
|
4039
4223
|
}
|
|
4040
4224
|
)
|
|
4041
4225
|
] }),
|
|
4042
|
-
/* @__PURE__ */ (0,
|
|
4043
|
-
/* @__PURE__ */ (0,
|
|
4226
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("form", { onSubmit: handleSubmit, className: "w-full", children: [
|
|
4227
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4044
4228
|
"input",
|
|
4045
4229
|
{
|
|
4046
4230
|
ref: fileInputRef,
|
|
@@ -4055,8 +4239,8 @@ ${userText}`
|
|
|
4055
4239
|
}
|
|
4056
4240
|
}
|
|
4057
4241
|
),
|
|
4058
|
-
/* @__PURE__ */ (0,
|
|
4059
|
-
/* @__PURE__ */ (0,
|
|
4242
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex w-full items-start gap-2 rounded-xl border border-gray-200 bg-white px-3 py-2 shadow-sm", children: [
|
|
4243
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4060
4244
|
Button,
|
|
4061
4245
|
{
|
|
4062
4246
|
type: "button",
|
|
@@ -4065,15 +4249,20 @@ ${userText}`
|
|
|
4065
4249
|
onClick: () => fileInputRef.current?.click(),
|
|
4066
4250
|
className: "h-5 w-5 rounded-full text-gray-400 hover:text-gray-600 hover:bg-gray-100",
|
|
4067
4251
|
title: "Upload CSV for bulk operations",
|
|
4068
|
-
children: /* @__PURE__ */ (0,
|
|
4252
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Paperclip, { className: "h-2.5 w-2.5" })
|
|
4069
4253
|
}
|
|
4070
4254
|
),
|
|
4071
|
-
/* @__PURE__ */ (0,
|
|
4255
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4072
4256
|
"textarea",
|
|
4073
4257
|
{
|
|
4074
4258
|
placeholder: pendingFile ? "Describe what to do with this CSV..." : "Ask anything...",
|
|
4075
4259
|
value: input,
|
|
4076
|
-
onChange: (e) =>
|
|
4260
|
+
onChange: (e) => {
|
|
4261
|
+
setInput(e.target.value);
|
|
4262
|
+
if (e.target.value.length > 0) {
|
|
4263
|
+
handleTypingStart();
|
|
4264
|
+
}
|
|
4265
|
+
},
|
|
4077
4266
|
rows: 1,
|
|
4078
4267
|
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",
|
|
4079
4268
|
style: { minHeight: "20px", maxHeight: "120px" },
|
|
@@ -4124,20 +4313,20 @@ ${userText}`
|
|
|
4124
4313
|
}
|
|
4125
4314
|
}
|
|
4126
4315
|
),
|
|
4127
|
-
/* @__PURE__ */ (0,
|
|
4316
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4128
4317
|
Button,
|
|
4129
4318
|
{
|
|
4130
4319
|
type: "submit",
|
|
4131
4320
|
size: "icon",
|
|
4132
4321
|
disabled: !input.trim() && !pendingFile,
|
|
4133
4322
|
className: "h-6 w-6 rounded-full bg-gray-900 hover:bg-gray-800 disabled:bg-gray-300",
|
|
4134
|
-
children: /* @__PURE__ */ (0,
|
|
4323
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ArrowUp, { className: "h-2.5 w-2.5" })
|
|
4135
4324
|
}
|
|
4136
4325
|
)
|
|
4137
4326
|
] })
|
|
4138
4327
|
] })
|
|
4139
4328
|
] }),
|
|
4140
|
-
/* @__PURE__ */ (0,
|
|
4329
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4141
4330
|
GuideCursor,
|
|
4142
4331
|
{
|
|
4143
4332
|
x: cursorState.x,
|
|
@@ -4164,7 +4353,9 @@ function ChatPanelWithToggle({
|
|
|
4164
4353
|
orgId,
|
|
4165
4354
|
userName,
|
|
4166
4355
|
userEmail,
|
|
4167
|
-
userOrganization
|
|
4356
|
+
userOrganization,
|
|
4357
|
+
supabaseUrl,
|
|
4358
|
+
supabaseAnonKey
|
|
4168
4359
|
}) {
|
|
4169
4360
|
const [internalIsOpen, setInternalIsOpen] = React4.useState(defaultOpen);
|
|
4170
4361
|
const isOpen = controlledIsOpen !== void 0 ? controlledIsOpen : internalIsOpen;
|
|
@@ -4184,7 +4375,7 @@ function ChatPanelWithToggle({
|
|
|
4184
4375
|
document.body.style.transition = originalTransition;
|
|
4185
4376
|
};
|
|
4186
4377
|
}, [isOpen]);
|
|
4187
|
-
return /* @__PURE__ */ (0,
|
|
4378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4188
4379
|
ChatPanel,
|
|
4189
4380
|
{
|
|
4190
4381
|
isOpen,
|
|
@@ -4200,13 +4391,15 @@ function ChatPanelWithToggle({
|
|
|
4200
4391
|
orgId,
|
|
4201
4392
|
userName,
|
|
4202
4393
|
userEmail,
|
|
4203
|
-
userOrganization
|
|
4394
|
+
userOrganization,
|
|
4395
|
+
supabaseUrl,
|
|
4396
|
+
supabaseAnonKey
|
|
4204
4397
|
}
|
|
4205
4398
|
);
|
|
4206
4399
|
}
|
|
4207
4400
|
|
|
4208
4401
|
// src/createKiteChat.tsx
|
|
4209
|
-
var
|
|
4402
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
4210
4403
|
function KiteChatWrapper({
|
|
4211
4404
|
initialConfig,
|
|
4212
4405
|
onConfigUpdate,
|
|
@@ -4243,7 +4436,7 @@ function KiteChatWrapper({
|
|
|
4243
4436
|
container.classList.toggle("dark", prefersDark);
|
|
4244
4437
|
}
|
|
4245
4438
|
}, [config.theme]);
|
|
4246
|
-
return /* @__PURE__ */ (0,
|
|
4439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
4247
4440
|
ChatPanelWithToggle,
|
|
4248
4441
|
{
|
|
4249
4442
|
isOpen,
|
|
@@ -4258,7 +4451,9 @@ function KiteChatWrapper({
|
|
|
4258
4451
|
orgId: config.orgId,
|
|
4259
4452
|
userName: config.userName,
|
|
4260
4453
|
userEmail: config.userEmail,
|
|
4261
|
-
userOrganization: config.userOrganization
|
|
4454
|
+
userOrganization: config.userOrganization,
|
|
4455
|
+
supabaseUrl: config.supabaseUrl,
|
|
4456
|
+
supabaseAnonKey: config.supabaseAnonKey
|
|
4262
4457
|
}
|
|
4263
4458
|
);
|
|
4264
4459
|
}
|
|
@@ -4288,7 +4483,7 @@ function createKiteChat(config) {
|
|
|
4288
4483
|
}
|
|
4289
4484
|
root = (0, import_client.createRoot)(containerElement);
|
|
4290
4485
|
root.render(
|
|
4291
|
-
/* @__PURE__ */ (0,
|
|
4486
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
4292
4487
|
KiteChatWrapper,
|
|
4293
4488
|
{
|
|
4294
4489
|
initialConfig: currentConfig,
|