@copilotz/chat-ui 0.1.4 → 0.1.6

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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/components/chat/ChatUI.tsx
2
- import { useState as useState8, useEffect as useEffect10, useRef as useRef7, useCallback as useCallback4 } from "react";
2
+ import { useState as useState8, useEffect as useEffect10, useRef as useRef7, useCallback as useCallback4, useMemo as useMemo3 } from "react";
3
3
 
4
4
  // src/config/chatConfig.ts
5
5
  var defaultChatConfig = {
@@ -237,10 +237,9 @@ var configUtils = {
237
237
  };
238
238
 
239
239
  // src/components/chat/Message.tsx
240
- import { useState, useRef, memo, Component } from "react";
240
+ import { useState, useRef, memo } from "react";
241
241
  import ReactMarkdown from "react-markdown";
242
242
  import remarkGfm from "remark-gfm";
243
- import remarkBreaks from "remark-breaks";
244
243
  import rehypeHighlight from "rehype-highlight";
245
244
 
246
245
  // src/components/ui/button.tsx
@@ -531,24 +530,6 @@ import {
531
530
  ChevronDown
532
531
  } from "lucide-react";
533
532
  import { Fragment, jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
534
- var MarkdownErrorBoundary = class extends Component {
535
- constructor(props) {
536
- super(props);
537
- this.state = { hasError: false };
538
- }
539
- static getDerivedStateFromError(_error) {
540
- return { hasError: true };
541
- }
542
- componentDidCatch(error, errorInfo) {
543
- console.warn("[Markdown] Falling back to simple rendering due to:", error.message);
544
- }
545
- render() {
546
- if (this.state.hasError) {
547
- return this.props.fallback;
548
- }
549
- return this.props.children;
550
- }
551
- };
552
533
  var ThinkingIndicator = memo(function ThinkingIndicator2({ label = "Thinking..." }) {
553
534
  return /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 py-2", children: [
554
535
  /* @__PURE__ */ jsxs2("div", { className: "flex gap-1", children: [
@@ -584,38 +565,9 @@ var markdownComponents = {
584
565
  return !inline && match ? /* @__PURE__ */ jsx7("pre", { className: "relative", children: /* @__PURE__ */ jsx7("code", { className, ...props, children }) }) : /* @__PURE__ */ jsx7("code", { className: "bg-muted px-1 py-0.5 rounded text-sm", ...props, children });
585
566
  }
586
567
  };
587
- var remarkPluginsWithGfm = [remarkGfm, remarkBreaks];
588
- var remarkPluginsSimple = [remarkBreaks];
568
+ var remarkPluginsDefault = [remarkGfm];
589
569
  var rehypePluginsDefault = [rehypeHighlight];
590
570
  var rehypePluginsEmpty = [];
591
- var SimpleMarkdown = memo(function SimpleMarkdown2({
592
- content,
593
- isStreaming = false
594
- }) {
595
- return /* @__PURE__ */ jsx7(
596
- ReactMarkdown,
597
- {
598
- remarkPlugins: remarkPluginsSimple,
599
- rehypePlugins: isStreaming ? rehypePluginsEmpty : rehypePluginsDefault,
600
- components: markdownComponents,
601
- children: content
602
- }
603
- );
604
- });
605
- var FullMarkdown = memo(function FullMarkdown2({
606
- content,
607
- isStreaming = false
608
- }) {
609
- return /* @__PURE__ */ jsx7(
610
- ReactMarkdown,
611
- {
612
- remarkPlugins: remarkPluginsWithGfm,
613
- rehypePlugins: isStreaming ? rehypePluginsEmpty : rehypePluginsDefault,
614
- components: markdownComponents,
615
- children: content
616
- }
617
- );
618
- });
619
571
  var StreamingText = memo(function StreamingText2({
620
572
  content,
621
573
  isStreaming = false,
@@ -623,7 +575,15 @@ var StreamingText = memo(function StreamingText2({
623
575
  }) {
624
576
  const hasContent = content.trim().length > 0;
625
577
  return /* @__PURE__ */ jsxs2("div", { className: "prose prose-sm max-w-none dark:prose-invert", children: [
626
- hasContent ? /* @__PURE__ */ jsx7(MarkdownErrorBoundary, { fallback: /* @__PURE__ */ jsx7(SimpleMarkdown, { content, isStreaming }), children: /* @__PURE__ */ jsx7(FullMarkdown, { content, isStreaming }) }) : isStreaming ? (
578
+ hasContent ? /* @__PURE__ */ jsx7(
579
+ ReactMarkdown,
580
+ {
581
+ remarkPlugins: remarkPluginsDefault,
582
+ rehypePlugins: isStreaming ? rehypePluginsEmpty : rehypePluginsDefault,
583
+ components: markdownComponents,
584
+ children: content
585
+ }
586
+ ) : isStreaming ? (
627
587
  // Show thinking indicator while waiting for first token
628
588
  /* @__PURE__ */ jsx7(ThinkingIndicator, { label: thinkingLabel })
629
589
  ) : null,
@@ -776,27 +736,7 @@ var ToolCallsDisplay = memo(function ToolCallsDisplay2({ toolCalls, label }) {
776
736
  ] });
777
737
  });
778
738
  var arePropsEqual = (prevProps, nextProps) => {
779
- if (prevProps.message.id !== nextProps.message.id) return false;
780
- if (prevProps.message.content !== nextProps.message.content) return false;
781
- if (prevProps.message.isStreaming !== nextProps.message.isStreaming) return false;
782
- if (prevProps.message.isComplete !== nextProps.message.isComplete) return false;
783
- if (prevProps.message.isEdited !== nextProps.message.isEdited) return false;
784
- if (prevProps.message.timestamp !== nextProps.message.timestamp) return false;
785
- if (prevProps.message.toolCalls !== nextProps.message.toolCalls) {
786
- const prevCalls = prevProps.message.toolCalls;
787
- const nextCalls = nextProps.message.toolCalls;
788
- if (!prevCalls || !nextCalls || prevCalls.length !== nextCalls.length) return false;
789
- for (let i = 0; i < prevCalls.length; i++) {
790
- if (prevCalls[i].id !== nextCalls[i].id || prevCalls[i].status !== nextCalls[i].status || prevCalls[i].result !== nextCalls[i].result) {
791
- return false;
792
- }
793
- }
794
- }
795
- if (prevProps.message.attachments !== nextProps.message.attachments) {
796
- const prevAtt = prevProps.message.attachments;
797
- const nextAtt = nextProps.message.attachments;
798
- if (!prevAtt || !nextAtt || prevAtt.length !== nextAtt.length) return false;
799
- }
739
+ if (prevProps.message !== nextProps.message) return false;
800
740
  if (prevProps.isUser !== nextProps.isUser) return false;
801
741
  if (prevProps.userAvatar !== nextProps.userAvatar) return false;
802
742
  if (prevProps.userName !== nextProps.userName) return false;
@@ -1005,26 +945,18 @@ import { PanelLeftIcon } from "lucide-react";
1005
945
  // src/hooks/use-mobile.ts
1006
946
  import * as React2 from "react";
1007
947
  var MOBILE_BREAKPOINT = 768;
1008
- function getInitialIsMobile() {
1009
- if (typeof window === "undefined") return false;
1010
- return window.innerWidth < MOBILE_BREAKPOINT;
1011
- }
1012
948
  function useIsMobile() {
1013
- const [isMobile, setIsMobile] = React2.useState(getInitialIsMobile);
949
+ const [isMobile, setIsMobile] = React2.useState(void 0);
1014
950
  React2.useEffect(() => {
1015
951
  const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
1016
952
  const onChange = () => {
1017
953
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
1018
954
  };
1019
955
  mql.addEventListener("change", onChange);
1020
- window.addEventListener("resize", onChange);
1021
956
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
1022
- return () => {
1023
- mql.removeEventListener("change", onChange);
1024
- window.removeEventListener("resize", onChange);
1025
- };
957
+ return () => mql.removeEventListener("change", onChange);
1026
958
  }, []);
1027
- return isMobile;
959
+ return !!isMobile;
1028
960
  }
1029
961
 
1030
962
  // src/components/ui/separator.tsx
@@ -1171,8 +1103,21 @@ function SheetDescription({
1171
1103
  );
1172
1104
  }
1173
1105
 
1106
+ // src/components/ui/skeleton.tsx
1107
+ import { jsx as jsx11 } from "react/jsx-runtime";
1108
+ function Skeleton({ className, ...props }) {
1109
+ return /* @__PURE__ */ jsx11(
1110
+ "div",
1111
+ {
1112
+ "data-slot": "skeleton",
1113
+ className: cn("bg-accent animate-pulse rounded-md", className),
1114
+ ...props
1115
+ }
1116
+ );
1117
+ }
1118
+
1174
1119
  // src/components/ui/sidebar.tsx
1175
- import { jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
1120
+ import { jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
1176
1121
  var SIDEBAR_COOKIE_NAME = "sidebar_state";
1177
1122
  var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
1178
1123
  var SIDEBAR_WIDTH = "16rem";
@@ -1238,7 +1183,7 @@ function SidebarProvider({
1238
1183
  }),
1239
1184
  [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
1240
1185
  );
1241
- return /* @__PURE__ */ jsx11(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx11(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx11(
1186
+ return /* @__PURE__ */ jsx12(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx12(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx12(
1242
1187
  "div",
1243
1188
  {
1244
1189
  "data-slot": "sidebar-wrapper",
@@ -1266,7 +1211,7 @@ function Sidebar({
1266
1211
  }) {
1267
1212
  const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
1268
1213
  if (collapsible === "none") {
1269
- return /* @__PURE__ */ jsx11(
1214
+ return /* @__PURE__ */ jsx12(
1270
1215
  "div",
1271
1216
  {
1272
1217
  "data-slot": "sidebar",
@@ -1280,7 +1225,7 @@ function Sidebar({
1280
1225
  );
1281
1226
  }
1282
1227
  if (isMobile) {
1283
- return /* @__PURE__ */ jsx11(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs4(
1228
+ return /* @__PURE__ */ jsx12(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs4(
1284
1229
  SheetContent,
1285
1230
  {
1286
1231
  "data-sidebar": "sidebar",
@@ -1293,69 +1238,49 @@ function Sidebar({
1293
1238
  side,
1294
1239
  children: [
1295
1240
  /* @__PURE__ */ jsxs4(SheetHeader, { className: "sr-only", children: [
1296
- /* @__PURE__ */ jsx11(SheetTitle, { children: "Sidebar" }),
1297
- /* @__PURE__ */ jsx11(SheetDescription, { children: "Displays the mobile sidebar." })
1241
+ /* @__PURE__ */ jsx12(SheetTitle, { children: "Sidebar" }),
1242
+ /* @__PURE__ */ jsx12(SheetDescription, { children: "Displays the mobile sidebar." })
1298
1243
  ] }),
1299
- /* @__PURE__ */ jsx11("div", { className: "flex h-full w-full flex-col", children })
1244
+ /* @__PURE__ */ jsx12("div", { className: "flex h-full w-full flex-col", children })
1300
1245
  ]
1301
1246
  }
1302
1247
  ) });
1303
1248
  }
1304
- const isCollapsed = state === "collapsed";
1305
- const currentCollapsible = isCollapsed ? collapsible : "";
1306
- const getGapWidth = () => {
1307
- if (currentCollapsible === "offcanvas") return "0px";
1308
- if (currentCollapsible === "icon") return SIDEBAR_WIDTH_ICON;
1309
- return SIDEBAR_WIDTH;
1310
- };
1311
- const getContainerWidth = () => {
1312
- if (currentCollapsible === "icon") return SIDEBAR_WIDTH_ICON;
1313
- return SIDEBAR_WIDTH;
1314
- };
1315
- const getContainerOffset = () => {
1316
- if (currentCollapsible === "offcanvas") {
1317
- return side === "left" ? `calc(${SIDEBAR_WIDTH} * -1)` : `calc(${SIDEBAR_WIDTH} * -1)`;
1318
- }
1319
- return "0";
1320
- };
1321
1249
  return /* @__PURE__ */ jsxs4(
1322
1250
  "div",
1323
1251
  {
1324
- className: "group peer text-sidebar-foreground",
1252
+ className: "group peer text-sidebar-foreground hidden md:block",
1325
1253
  "data-state": state,
1326
- "data-collapsible": currentCollapsible,
1254
+ "data-collapsible": state === "collapsed" ? collapsible : "",
1327
1255
  "data-variant": variant,
1328
1256
  "data-side": side,
1329
1257
  "data-slot": "sidebar",
1330
1258
  children: [
1331
- /* @__PURE__ */ jsx11(
1259
+ /* @__PURE__ */ jsx12(
1332
1260
  "div",
1333
1261
  {
1334
1262
  "data-slot": "sidebar-gap",
1335
1263
  className: cn(
1336
- "relative bg-transparent transition-[width] duration-200 ease-linear",
1337
- "group-data-[side=right]:rotate-180"
1338
- ),
1339
- style: { width: getGapWidth() }
1264
+ "relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
1265
+ "group-data-[collapsible=offcanvas]:w-0",
1266
+ "group-data-[side=right]:rotate-180",
1267
+ variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
1268
+ )
1340
1269
  }
1341
1270
  ),
1342
- /* @__PURE__ */ jsx11(
1271
+ /* @__PURE__ */ jsx12(
1343
1272
  "div",
1344
1273
  {
1345
1274
  "data-slot": "sidebar-container",
1346
1275
  className: cn(
1347
- "fixed inset-y-0 z-10 h-screen transition-[left,right,width] duration-200 ease-linear",
1276
+ "fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
1277
+ side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
1348
1278
  // Adjust the padding for floating and inset variants.
1349
- variant === "floating" || variant === "inset" ? "p-2" : side === "left" ? "border-r" : "border-l",
1279
+ variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
1350
1280
  className
1351
1281
  ),
1352
- style: {
1353
- display: "flex",
1354
- width: getContainerWidth(),
1355
- [side === "left" ? "left" : "right"]: getContainerOffset()
1356
- },
1357
1282
  ...props,
1358
- children: /* @__PURE__ */ jsx11(
1283
+ children: /* @__PURE__ */ jsx12(
1359
1284
  "div",
1360
1285
  {
1361
1286
  "data-sidebar": "sidebar",
@@ -1376,15 +1301,6 @@ function SidebarTrigger({
1376
1301
  ...props
1377
1302
  }) {
1378
1303
  const { toggleSidebar } = useSidebar();
1379
- const handleActivation = React4.useCallback((event) => {
1380
- if (event.type === "touchend") {
1381
- event.preventDefault();
1382
- }
1383
- if ("onClick" in event && onClick) {
1384
- onClick(event);
1385
- }
1386
- toggleSidebar();
1387
- }, [onClick, toggleSidebar]);
1388
1304
  return /* @__PURE__ */ jsxs4(
1389
1305
  Button,
1390
1306
  {
@@ -1393,19 +1309,21 @@ function SidebarTrigger({
1393
1309
  variant: "ghost",
1394
1310
  size: "icon",
1395
1311
  className: cn("size-7", className),
1396
- onClick: handleActivation,
1397
- onTouchEnd: handleActivation,
1312
+ onClick: (event) => {
1313
+ onClick?.(event);
1314
+ toggleSidebar();
1315
+ },
1398
1316
  ...props,
1399
1317
  children: [
1400
- /* @__PURE__ */ jsx11(PanelLeftIcon, {}),
1401
- /* @__PURE__ */ jsx11("span", { className: "sr-only", children: "Toggle Sidebar" })
1318
+ /* @__PURE__ */ jsx12(PanelLeftIcon, {}),
1319
+ /* @__PURE__ */ jsx12("span", { className: "sr-only", children: "Toggle Sidebar" })
1402
1320
  ]
1403
1321
  }
1404
1322
  );
1405
1323
  }
1406
1324
  function SidebarRail({ className, ...props }) {
1407
1325
  const { toggleSidebar } = useSidebar();
1408
- return /* @__PURE__ */ jsx11(
1326
+ return /* @__PURE__ */ jsx12(
1409
1327
  "button",
1410
1328
  {
1411
1329
  "data-sidebar": "rail",
@@ -1428,7 +1346,7 @@ function SidebarRail({ className, ...props }) {
1428
1346
  );
1429
1347
  }
1430
1348
  function SidebarInset({ className, ...props }) {
1431
- return /* @__PURE__ */ jsx11(
1349
+ return /* @__PURE__ */ jsx12(
1432
1350
  "main",
1433
1351
  {
1434
1352
  "data-slot": "sidebar-inset",
@@ -1442,7 +1360,7 @@ function SidebarInset({ className, ...props }) {
1442
1360
  );
1443
1361
  }
1444
1362
  function SidebarHeader({ className, ...props }) {
1445
- return /* @__PURE__ */ jsx11(
1363
+ return /* @__PURE__ */ jsx12(
1446
1364
  "div",
1447
1365
  {
1448
1366
  "data-slot": "sidebar-header",
@@ -1453,7 +1371,7 @@ function SidebarHeader({ className, ...props }) {
1453
1371
  );
1454
1372
  }
1455
1373
  function SidebarFooter({ className, ...props }) {
1456
- return /* @__PURE__ */ jsx11(
1374
+ return /* @__PURE__ */ jsx12(
1457
1375
  "div",
1458
1376
  {
1459
1377
  "data-slot": "sidebar-footer",
@@ -1464,7 +1382,7 @@ function SidebarFooter({ className, ...props }) {
1464
1382
  );
1465
1383
  }
1466
1384
  function SidebarContent({ className, ...props }) {
1467
- return /* @__PURE__ */ jsx11(
1385
+ return /* @__PURE__ */ jsx12(
1468
1386
  "div",
1469
1387
  {
1470
1388
  "data-slot": "sidebar-content",
@@ -1478,7 +1396,7 @@ function SidebarContent({ className, ...props }) {
1478
1396
  );
1479
1397
  }
1480
1398
  function SidebarGroup({ className, ...props }) {
1481
- return /* @__PURE__ */ jsx11(
1399
+ return /* @__PURE__ */ jsx12(
1482
1400
  "div",
1483
1401
  {
1484
1402
  "data-slot": "sidebar-group",
@@ -1494,7 +1412,7 @@ function SidebarGroupLabel({
1494
1412
  ...props
1495
1413
  }) {
1496
1414
  const Comp = asChild ? Slot3 : "div";
1497
- return /* @__PURE__ */ jsx11(
1415
+ return /* @__PURE__ */ jsx12(
1498
1416
  Comp,
1499
1417
  {
1500
1418
  "data-slot": "sidebar-group-label",
@@ -1512,7 +1430,7 @@ function SidebarGroupContent({
1512
1430
  className,
1513
1431
  ...props
1514
1432
  }) {
1515
- return /* @__PURE__ */ jsx11(
1433
+ return /* @__PURE__ */ jsx12(
1516
1434
  "div",
1517
1435
  {
1518
1436
  "data-slot": "sidebar-group-content",
@@ -1523,7 +1441,7 @@ function SidebarGroupContent({
1523
1441
  );
1524
1442
  }
1525
1443
  function SidebarMenu({ className, ...props }) {
1526
- return /* @__PURE__ */ jsx11(
1444
+ return /* @__PURE__ */ jsx12(
1527
1445
  "ul",
1528
1446
  {
1529
1447
  "data-slot": "sidebar-menu",
@@ -1534,7 +1452,7 @@ function SidebarMenu({ className, ...props }) {
1534
1452
  );
1535
1453
  }
1536
1454
  function SidebarMenuItem({ className, ...props }) {
1537
- return /* @__PURE__ */ jsx11(
1455
+ return /* @__PURE__ */ jsx12(
1538
1456
  "li",
1539
1457
  {
1540
1458
  "data-slot": "sidebar-menu-item",
@@ -1575,7 +1493,7 @@ function SidebarMenuButton({
1575
1493
  }) {
1576
1494
  const Comp = asChild ? Slot3 : "button";
1577
1495
  const { isMobile, state } = useSidebar();
1578
- const button = /* @__PURE__ */ jsx11(
1496
+ const button = /* @__PURE__ */ jsx12(
1579
1497
  Comp,
1580
1498
  {
1581
1499
  "data-slot": "sidebar-menu-button",
@@ -1595,8 +1513,8 @@ function SidebarMenuButton({
1595
1513
  };
1596
1514
  }
1597
1515
  return /* @__PURE__ */ jsxs4(Tooltip, { children: [
1598
- /* @__PURE__ */ jsx11(TooltipTrigger, { asChild: true, children: button }),
1599
- /* @__PURE__ */ jsx11(
1516
+ /* @__PURE__ */ jsx12(TooltipTrigger, { asChild: true, children: button }),
1517
+ /* @__PURE__ */ jsx12(
1600
1518
  TooltipContent,
1601
1519
  {
1602
1520
  side: "right",
@@ -1614,7 +1532,7 @@ function SidebarMenuAction({
1614
1532
  ...props
1615
1533
  }) {
1616
1534
  const Comp = asChild ? Slot3 : "button";
1617
- return /* @__PURE__ */ jsx11(
1535
+ return /* @__PURE__ */ jsx12(
1618
1536
  Comp,
1619
1537
  {
1620
1538
  "data-slot": "sidebar-menu-action",
@@ -1639,7 +1557,7 @@ function SidebarMenuAction({
1639
1557
  import * as React5 from "react";
1640
1558
  import * as DialogPrimitive from "@radix-ui/react-dialog";
1641
1559
  import { XIcon as XIcon2 } from "lucide-react";
1642
- import { jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
1560
+ import { jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
1643
1561
  function cleanupBodyStyles2() {
1644
1562
  if (typeof document !== "undefined" && document.body.style.pointerEvents === "none") {
1645
1563
  document.body.style.pointerEvents = "";
@@ -1663,23 +1581,23 @@ function Dialog({
1663
1581
  cleanupBodyStyles2();
1664
1582
  };
1665
1583
  }, []);
1666
- return /* @__PURE__ */ jsx12(DialogPrimitive.Root, { "data-slot": "dialog", open, onOpenChange, ...props });
1584
+ return /* @__PURE__ */ jsx13(DialogPrimitive.Root, { "data-slot": "dialog", open, onOpenChange, ...props });
1667
1585
  }
1668
1586
  function DialogTrigger({
1669
1587
  ...props
1670
1588
  }) {
1671
- return /* @__PURE__ */ jsx12(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
1589
+ return /* @__PURE__ */ jsx13(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
1672
1590
  }
1673
1591
  function DialogPortal({
1674
1592
  ...props
1675
1593
  }) {
1676
- return /* @__PURE__ */ jsx12(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
1594
+ return /* @__PURE__ */ jsx13(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
1677
1595
  }
1678
1596
  function DialogOverlay({
1679
1597
  className,
1680
1598
  ...props
1681
1599
  }) {
1682
- return /* @__PURE__ */ jsx12(
1600
+ return /* @__PURE__ */ jsx13(
1683
1601
  DialogPrimitive.Overlay,
1684
1602
  {
1685
1603
  "data-slot": "dialog-overlay",
@@ -1701,7 +1619,7 @@ function DialogContent({
1701
1619
  ...props
1702
1620
  }) {
1703
1621
  return /* @__PURE__ */ jsxs5(DialogPortal, { "data-slot": "dialog-portal", children: [
1704
- /* @__PURE__ */ jsx12(DialogOverlay, {}),
1622
+ /* @__PURE__ */ jsx13(DialogOverlay, {}),
1705
1623
  /* @__PURE__ */ jsxs5(
1706
1624
  DialogPrimitive.Content,
1707
1625
  {
@@ -1720,8 +1638,8 @@ function DialogContent({
1720
1638
  "data-slot": "dialog-close",
1721
1639
  className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1722
1640
  children: [
1723
- /* @__PURE__ */ jsx12(XIcon2, {}),
1724
- /* @__PURE__ */ jsx12("span", { className: "sr-only", children: "Close" })
1641
+ /* @__PURE__ */ jsx13(XIcon2, {}),
1642
+ /* @__PURE__ */ jsx13("span", { className: "sr-only", children: "Close" })
1725
1643
  ]
1726
1644
  }
1727
1645
  )
@@ -1731,7 +1649,7 @@ function DialogContent({
1731
1649
  ] });
1732
1650
  }
1733
1651
  function DialogHeader({ className, ...props }) {
1734
- return /* @__PURE__ */ jsx12(
1652
+ return /* @__PURE__ */ jsx13(
1735
1653
  "div",
1736
1654
  {
1737
1655
  "data-slot": "dialog-header",
@@ -1741,7 +1659,7 @@ function DialogHeader({ className, ...props }) {
1741
1659
  );
1742
1660
  }
1743
1661
  function DialogFooter({ className, ...props }) {
1744
- return /* @__PURE__ */ jsx12(
1662
+ return /* @__PURE__ */ jsx13(
1745
1663
  "div",
1746
1664
  {
1747
1665
  "data-slot": "dialog-footer",
@@ -1757,7 +1675,7 @@ function DialogTitle({
1757
1675
  className,
1758
1676
  ...props
1759
1677
  }) {
1760
- return /* @__PURE__ */ jsx12(
1678
+ return /* @__PURE__ */ jsx13(
1761
1679
  DialogPrimitive.Title,
1762
1680
  {
1763
1681
  "data-slot": "dialog-title",
@@ -1770,7 +1688,7 @@ function DialogDescription({
1770
1688
  className,
1771
1689
  ...props
1772
1690
  }) {
1773
- return /* @__PURE__ */ jsx12(
1691
+ return /* @__PURE__ */ jsx13(
1774
1692
  DialogPrimitive.Description,
1775
1693
  {
1776
1694
  "data-slot": "dialog-description",
@@ -1783,7 +1701,7 @@ function DialogDescription({
1783
1701
  // src/components/ui/alert-dialog.tsx
1784
1702
  import * as React6 from "react";
1785
1703
  import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
1786
- import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
1704
+ import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
1787
1705
  function cleanupBodyStyles3() {
1788
1706
  if (typeof document !== "undefined" && document.body.style.pointerEvents === "none") {
1789
1707
  document.body.style.pointerEvents = "";
@@ -1807,18 +1725,18 @@ function AlertDialog({
1807
1725
  cleanupBodyStyles3();
1808
1726
  };
1809
1727
  }, []);
1810
- return /* @__PURE__ */ jsx13(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", open, onOpenChange, ...props });
1728
+ return /* @__PURE__ */ jsx14(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", open, onOpenChange, ...props });
1811
1729
  }
1812
1730
  function AlertDialogPortal({
1813
1731
  ...props
1814
1732
  }) {
1815
- return /* @__PURE__ */ jsx13(AlertDialogPrimitive.Portal, { "data-slot": "alert-dialog-portal", ...props });
1733
+ return /* @__PURE__ */ jsx14(AlertDialogPrimitive.Portal, { "data-slot": "alert-dialog-portal", ...props });
1816
1734
  }
1817
1735
  function AlertDialogOverlay({
1818
1736
  className,
1819
1737
  ...props
1820
1738
  }) {
1821
- return /* @__PURE__ */ jsx13(
1739
+ return /* @__PURE__ */ jsx14(
1822
1740
  AlertDialogPrimitive.Overlay,
1823
1741
  {
1824
1742
  "data-slot": "alert-dialog-overlay",
@@ -1838,8 +1756,8 @@ function AlertDialogContent({
1838
1756
  ...props
1839
1757
  }) {
1840
1758
  return /* @__PURE__ */ jsxs6(AlertDialogPortal, { children: [
1841
- /* @__PURE__ */ jsx13(AlertDialogOverlay, {}),
1842
- /* @__PURE__ */ jsx13(
1759
+ /* @__PURE__ */ jsx14(AlertDialogOverlay, {}),
1760
+ /* @__PURE__ */ jsx14(
1843
1761
  AlertDialogPrimitive.Content,
1844
1762
  {
1845
1763
  "data-slot": "alert-dialog-content",
@@ -1856,7 +1774,7 @@ function AlertDialogHeader({
1856
1774
  className,
1857
1775
  ...props
1858
1776
  }) {
1859
- return /* @__PURE__ */ jsx13(
1777
+ return /* @__PURE__ */ jsx14(
1860
1778
  "div",
1861
1779
  {
1862
1780
  "data-slot": "alert-dialog-header",
@@ -1869,7 +1787,7 @@ function AlertDialogFooter({
1869
1787
  className,
1870
1788
  ...props
1871
1789
  }) {
1872
- return /* @__PURE__ */ jsx13(
1790
+ return /* @__PURE__ */ jsx14(
1873
1791
  "div",
1874
1792
  {
1875
1793
  "data-slot": "alert-dialog-footer",
@@ -1885,7 +1803,7 @@ function AlertDialogTitle({
1885
1803
  className,
1886
1804
  ...props
1887
1805
  }) {
1888
- return /* @__PURE__ */ jsx13(
1806
+ return /* @__PURE__ */ jsx14(
1889
1807
  AlertDialogPrimitive.Title,
1890
1808
  {
1891
1809
  "data-slot": "alert-dialog-title",
@@ -1898,7 +1816,7 @@ function AlertDialogDescription({
1898
1816
  className,
1899
1817
  ...props
1900
1818
  }) {
1901
- return /* @__PURE__ */ jsx13(
1819
+ return /* @__PURE__ */ jsx14(
1902
1820
  AlertDialogPrimitive.Description,
1903
1821
  {
1904
1822
  "data-slot": "alert-dialog-description",
@@ -1911,7 +1829,7 @@ function AlertDialogAction({
1911
1829
  className,
1912
1830
  ...props
1913
1831
  }) {
1914
- return /* @__PURE__ */ jsx13(
1832
+ return /* @__PURE__ */ jsx14(
1915
1833
  AlertDialogPrimitive.Action,
1916
1834
  {
1917
1835
  className: cn(buttonVariants(), className),
@@ -1923,7 +1841,7 @@ function AlertDialogCancel({
1923
1841
  className,
1924
1842
  ...props
1925
1843
  }) {
1926
- return /* @__PURE__ */ jsx13(
1844
+ return /* @__PURE__ */ jsx14(
1927
1845
  AlertDialogPrimitive.Cancel,
1928
1846
  {
1929
1847
  className: cn(buttonVariants({ variant: "outline" }), className),
@@ -1935,16 +1853,16 @@ function AlertDialogCancel({
1935
1853
  // src/components/ui/dropdown-menu.tsx
1936
1854
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
1937
1855
  import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
1938
- import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
1856
+ import { jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
1939
1857
  function DropdownMenu({
1940
1858
  ...props
1941
1859
  }) {
1942
- return /* @__PURE__ */ jsx14(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
1860
+ return /* @__PURE__ */ jsx15(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
1943
1861
  }
1944
1862
  function DropdownMenuTrigger({
1945
1863
  ...props
1946
1864
  }) {
1947
- return /* @__PURE__ */ jsx14(
1865
+ return /* @__PURE__ */ jsx15(
1948
1866
  DropdownMenuPrimitive.Trigger,
1949
1867
  {
1950
1868
  "data-slot": "dropdown-menu-trigger",
@@ -1957,7 +1875,7 @@ function DropdownMenuContent({
1957
1875
  sideOffset = 4,
1958
1876
  ...props
1959
1877
  }) {
1960
- return /* @__PURE__ */ jsx14(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx14(
1878
+ return /* @__PURE__ */ jsx15(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx15(
1961
1879
  DropdownMenuPrimitive.Content,
1962
1880
  {
1963
1881
  "data-slot": "dropdown-menu-content",
@@ -1976,7 +1894,7 @@ function DropdownMenuItem({
1976
1894
  variant = "default",
1977
1895
  ...props
1978
1896
  }) {
1979
- return /* @__PURE__ */ jsx14(
1897
+ return /* @__PURE__ */ jsx15(
1980
1898
  DropdownMenuPrimitive.Item,
1981
1899
  {
1982
1900
  "data-slot": "dropdown-menu-item",
@@ -1995,7 +1913,7 @@ function DropdownMenuLabel({
1995
1913
  inset,
1996
1914
  ...props
1997
1915
  }) {
1998
- return /* @__PURE__ */ jsx14(
1916
+ return /* @__PURE__ */ jsx15(
1999
1917
  DropdownMenuPrimitive.Label,
2000
1918
  {
2001
1919
  "data-slot": "dropdown-menu-label",
@@ -2012,7 +1930,7 @@ function DropdownMenuSeparator({
2012
1930
  className,
2013
1931
  ...props
2014
1932
  }) {
2015
- return /* @__PURE__ */ jsx14(
1933
+ return /* @__PURE__ */ jsx15(
2016
1934
  DropdownMenuPrimitive.Separator,
2017
1935
  {
2018
1936
  "data-slot": "dropdown-menu-separator",
@@ -2044,7 +1962,7 @@ import {
2044
1962
  Sun,
2045
1963
  Palette
2046
1964
  } from "lucide-react";
2047
- import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
1965
+ import { Fragment as Fragment2, jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
2048
1966
  var getInitials = (name, email) => {
2049
1967
  if (name) {
2050
1968
  return name.split(" ").map((n) => n[0]).slice(0, 2).join("").toUpperCase();
@@ -2079,8 +1997,8 @@ var UserMenu = ({
2079
1997
  };
2080
1998
  const displayName = getDisplayName(user, labels.guest);
2081
1999
  const initials = getInitials(user?.name, user?.email);
2082
- return /* @__PURE__ */ jsx15(SidebarMenu, { children: /* @__PURE__ */ jsx15(SidebarMenuItem, { children: /* @__PURE__ */ jsxs8(DropdownMenu, { children: [
2083
- /* @__PURE__ */ jsx15(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs8(
2000
+ return /* @__PURE__ */ jsx16(SidebarMenu, { children: /* @__PURE__ */ jsx16(SidebarMenuItem, { children: /* @__PURE__ */ jsxs8(DropdownMenu, { children: [
2001
+ /* @__PURE__ */ jsx16(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs8(
2084
2002
  SidebarMenuButton,
2085
2003
  {
2086
2004
  size: "lg",
@@ -2088,14 +2006,14 @@ var UserMenu = ({
2088
2006
  tooltip: displayName,
2089
2007
  children: [
2090
2008
  /* @__PURE__ */ jsxs8(Avatar, { className: "h-8 w-8 rounded-lg", children: [
2091
- user?.avatar && /* @__PURE__ */ jsx15(AvatarImage, { src: user.avatar, alt: displayName }),
2092
- /* @__PURE__ */ jsx15(AvatarFallback, { className: "rounded-lg bg-primary/10 text-primary text-xs font-medium", children: initials })
2009
+ user?.avatar && /* @__PURE__ */ jsx16(AvatarImage, { src: user.avatar, alt: displayName }),
2010
+ /* @__PURE__ */ jsx16(AvatarFallback, { className: "rounded-lg bg-primary/10 text-primary text-xs font-medium", children: initials })
2093
2011
  ] }),
2094
2012
  /* @__PURE__ */ jsxs8("div", { className: "grid flex-1 text-left text-sm leading-tight group-data-[collapsible=icon]:hidden", children: [
2095
- /* @__PURE__ */ jsx15("span", { className: "truncate font-medium", children: displayName }),
2096
- user?.email && /* @__PURE__ */ jsx15("span", { className: "truncate text-xs text-muted-foreground", children: user.email })
2013
+ /* @__PURE__ */ jsx16("span", { className: "truncate font-medium", children: displayName }),
2014
+ user?.email && /* @__PURE__ */ jsx16("span", { className: "truncate text-xs text-muted-foreground", children: user.email })
2097
2015
  ] }),
2098
- /* @__PURE__ */ jsx15(ChevronsUpDown, { className: "ml-auto size-4 group-data-[collapsible=icon]:hidden" })
2016
+ /* @__PURE__ */ jsx16(ChevronsUpDown, { className: "ml-auto size-4 group-data-[collapsible=icon]:hidden" })
2099
2017
  ]
2100
2018
  }
2101
2019
  ) }),
@@ -2107,36 +2025,36 @@ var UserMenu = ({
2107
2025
  align: "end",
2108
2026
  sideOffset: 4,
2109
2027
  children: [
2110
- /* @__PURE__ */ jsx15(DropdownMenuLabel, { className: "p-0 font-normal", children: /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm", children: [
2028
+ /* @__PURE__ */ jsx16(DropdownMenuLabel, { className: "p-0 font-normal", children: /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm", children: [
2111
2029
  /* @__PURE__ */ jsxs8(Avatar, { className: "h-8 w-8 rounded-lg", children: [
2112
- user?.avatar && /* @__PURE__ */ jsx15(AvatarImage, { src: user.avatar, alt: displayName }),
2113
- /* @__PURE__ */ jsx15(AvatarFallback, { className: "rounded-lg bg-primary/10 text-primary text-xs font-medium", children: initials })
2030
+ user?.avatar && /* @__PURE__ */ jsx16(AvatarImage, { src: user.avatar, alt: displayName }),
2031
+ /* @__PURE__ */ jsx16(AvatarFallback, { className: "rounded-lg bg-primary/10 text-primary text-xs font-medium", children: initials })
2114
2032
  ] }),
2115
2033
  /* @__PURE__ */ jsxs8("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
2116
- /* @__PURE__ */ jsx15("span", { className: "truncate font-medium", children: displayName }),
2117
- user?.email && /* @__PURE__ */ jsx15("span", { className: "truncate text-xs text-muted-foreground", children: user.email })
2034
+ /* @__PURE__ */ jsx16("span", { className: "truncate font-medium", children: displayName }),
2035
+ user?.email && /* @__PURE__ */ jsx16("span", { className: "truncate text-xs text-muted-foreground", children: user.email })
2118
2036
  ] })
2119
2037
  ] }) }),
2120
- /* @__PURE__ */ jsx15(DropdownMenuSeparator, {}),
2038
+ /* @__PURE__ */ jsx16(DropdownMenuSeparator, {}),
2121
2039
  callbacks?.onViewProfile && /* @__PURE__ */ jsxs8(DropdownMenuItem, { onClick: callbacks.onViewProfile, children: [
2122
- /* @__PURE__ */ jsx15(User, { className: "mr-2 h-4 w-4" }),
2123
- /* @__PURE__ */ jsx15("span", { children: labels.profile })
2040
+ /* @__PURE__ */ jsx16(User, { className: "mr-2 h-4 w-4" }),
2041
+ /* @__PURE__ */ jsx16("span", { children: labels.profile })
2124
2042
  ] }),
2125
2043
  callbacks?.onOpenSettings && /* @__PURE__ */ jsxs8(DropdownMenuItem, { onClick: callbacks.onOpenSettings, children: [
2126
- /* @__PURE__ */ jsx15(Settings, { className: "mr-2 h-4 w-4" }),
2127
- /* @__PURE__ */ jsx15("span", { children: labels.settings })
2044
+ /* @__PURE__ */ jsx16(Settings, { className: "mr-2 h-4 w-4" }),
2045
+ /* @__PURE__ */ jsx16("span", { children: labels.settings })
2128
2046
  ] }),
2129
2047
  additionalItems,
2130
2048
  showThemeOptions && callbacks?.onThemeChange && /* @__PURE__ */ jsxs8(Fragment2, { children: [
2131
- /* @__PURE__ */ jsx15(DropdownMenuSeparator, {}),
2049
+ /* @__PURE__ */ jsx16(DropdownMenuSeparator, {}),
2132
2050
  /* @__PURE__ */ jsxs8(
2133
2051
  DropdownMenuItem,
2134
2052
  {
2135
2053
  onClick: () => callbacks.onThemeChange?.("light"),
2136
2054
  className: currentTheme === "light" ? "bg-accent" : "",
2137
2055
  children: [
2138
- /* @__PURE__ */ jsx15(Sun, { className: "mr-2 h-4 w-4" }),
2139
- /* @__PURE__ */ jsx15("span", { children: labels.lightMode })
2056
+ /* @__PURE__ */ jsx16(Sun, { className: "mr-2 h-4 w-4" }),
2057
+ /* @__PURE__ */ jsx16("span", { children: labels.lightMode })
2140
2058
  ]
2141
2059
  }
2142
2060
  ),
@@ -2146,8 +2064,8 @@ var UserMenu = ({
2146
2064
  onClick: () => callbacks.onThemeChange?.("dark"),
2147
2065
  className: currentTheme === "dark" ? "bg-accent" : "",
2148
2066
  children: [
2149
- /* @__PURE__ */ jsx15(Moon, { className: "mr-2 h-4 w-4" }),
2150
- /* @__PURE__ */ jsx15("span", { children: labels.darkMode })
2067
+ /* @__PURE__ */ jsx16(Moon, { className: "mr-2 h-4 w-4" }),
2068
+ /* @__PURE__ */ jsx16("span", { children: labels.darkMode })
2151
2069
  ]
2152
2070
  }
2153
2071
  ),
@@ -2157,22 +2075,22 @@ var UserMenu = ({
2157
2075
  onClick: () => callbacks.onThemeChange?.("system"),
2158
2076
  className: currentTheme === "system" ? "bg-accent" : "",
2159
2077
  children: [
2160
- /* @__PURE__ */ jsx15(Palette, { className: "mr-2 h-4 w-4" }),
2161
- /* @__PURE__ */ jsx15("span", { children: labels.systemTheme })
2078
+ /* @__PURE__ */ jsx16(Palette, { className: "mr-2 h-4 w-4" }),
2079
+ /* @__PURE__ */ jsx16("span", { children: labels.systemTheme })
2162
2080
  ]
2163
2081
  }
2164
2082
  )
2165
2083
  ] }),
2166
2084
  callbacks?.onLogout && /* @__PURE__ */ jsxs8(Fragment2, { children: [
2167
- /* @__PURE__ */ jsx15(DropdownMenuSeparator, {}),
2085
+ /* @__PURE__ */ jsx16(DropdownMenuSeparator, {}),
2168
2086
  /* @__PURE__ */ jsxs8(
2169
2087
  DropdownMenuItem,
2170
2088
  {
2171
2089
  onClick: callbacks.onLogout,
2172
2090
  className: "text-destructive focus:text-destructive focus:bg-destructive/10",
2173
2091
  children: [
2174
- /* @__PURE__ */ jsx15(LogOut, { className: "mr-2 h-4 w-4" }),
2175
- /* @__PURE__ */ jsx15("span", { children: labels.logout })
2092
+ /* @__PURE__ */ jsx16(LogOut, { className: "mr-2 h-4 w-4" }),
2093
+ /* @__PURE__ */ jsx16("span", { children: labels.logout })
2176
2094
  ]
2177
2095
  }
2178
2096
  )
@@ -2184,7 +2102,7 @@ var UserMenu = ({
2184
2102
  };
2185
2103
 
2186
2104
  // src/components/chat/Sidebar.tsx
2187
- import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
2105
+ import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
2188
2106
  var CreateThreadDialog = ({ config, onCreateThread, trigger }) => {
2189
2107
  const [title, setTitle] = useState4("");
2190
2108
  const [isOpen, setIsOpen] = useState4(false);
@@ -2194,16 +2112,16 @@ var CreateThreadDialog = ({ config, onCreateThread, trigger }) => {
2194
2112
  setIsOpen(false);
2195
2113
  };
2196
2114
  return /* @__PURE__ */ jsxs9(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: [
2197
- /* @__PURE__ */ jsx16(DialogTrigger, { asChild: true, children: trigger || /* @__PURE__ */ jsxs9(Button, { className: "w-full justify-start", variant: "outline", children: [
2198
- /* @__PURE__ */ jsx16(Plus, { className: "mr-2 h-4 w-4" }),
2115
+ /* @__PURE__ */ jsx17(DialogTrigger, { asChild: true, children: trigger || /* @__PURE__ */ jsxs9(Button, { className: "w-full justify-start", variant: "outline", children: [
2116
+ /* @__PURE__ */ jsx17(Plus, { className: "mr-2 h-4 w-4" }),
2199
2117
  config.labels?.newChat || "New Chat"
2200
2118
  ] }) }),
2201
2119
  /* @__PURE__ */ jsxs9(DialogContent, { children: [
2202
2120
  /* @__PURE__ */ jsxs9(DialogHeader, { children: [
2203
- /* @__PURE__ */ jsx16(DialogTitle, { children: config.labels?.createNewThread || "New Conversation" }),
2204
- /* @__PURE__ */ jsx16(DialogDescription, { children: "Give your new conversation a name or leave blank to auto-generate one." })
2121
+ /* @__PURE__ */ jsx17(DialogTitle, { children: config.labels?.createNewThread || "New Conversation" }),
2122
+ /* @__PURE__ */ jsx17(DialogDescription, { children: "Give your new conversation a name or leave blank to auto-generate one." })
2205
2123
  ] }),
2206
- /* @__PURE__ */ jsx16(
2124
+ /* @__PURE__ */ jsx17(
2207
2125
  Input,
2208
2126
  {
2209
2127
  value: title,
@@ -2214,15 +2132,15 @@ var CreateThreadDialog = ({ config, onCreateThread, trigger }) => {
2214
2132
  }
2215
2133
  ),
2216
2134
  /* @__PURE__ */ jsxs9(DialogFooter, { children: [
2217
- /* @__PURE__ */ jsx16(Button, { variant: "outline", onClick: () => setIsOpen(false), children: config.labels?.cancel || "Cancel" }),
2218
- /* @__PURE__ */ jsx16(Button, { onClick: handleCreate, children: config.labels?.create || "Create" })
2135
+ /* @__PURE__ */ jsx17(Button, { variant: "outline", onClick: () => setIsOpen(false), children: config.labels?.cancel || "Cancel" }),
2136
+ /* @__PURE__ */ jsx17(Button, { onClick: handleCreate, children: config.labels?.create || "Create" })
2219
2137
  ] })
2220
2138
  ] })
2221
2139
  ] });
2222
2140
  };
2223
2141
  var ThreadInitialsIcon = ({ title }) => {
2224
2142
  const initials = title?.split(" ").map((n) => n[0]).slice(0, 2).join("").toUpperCase() || "?";
2225
- return /* @__PURE__ */ jsx16("div", { className: "flex shrink-0 items-center justify-center rounded bg-muted text-[10px] font-medium", children: initials });
2143
+ return /* @__PURE__ */ jsx17("div", { className: "flex shrink-0 items-center justify-center rounded bg-muted text-[10px] font-medium", children: initials });
2226
2144
  };
2227
2145
  var Sidebar2 = ({
2228
2146
  threads,
@@ -2302,26 +2220,26 @@ var Sidebar2 = ({
2302
2220
  return /* @__PURE__ */ jsxs9(Sidebar, { collapsible: "icon", ...props, children: [
2303
2221
  /* @__PURE__ */ jsxs9(SidebarHeader, { children: [
2304
2222
  /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-3 px-2 py-3", children: [
2305
- /* @__PURE__ */ jsx16("div", { className: "flex items-center justify-center shrink-0", children: config.branding?.logo || /* @__PURE__ */ jsx16(Avatar, { className: "h-8 w-8", children: /* @__PURE__ */ jsx16(AvatarFallback, { className: "bg-primary text-primary-foreground", children: /* @__PURE__ */ jsx16(Bot, { className: "h-4 w-4" }) }) }) }),
2223
+ /* @__PURE__ */ jsx17("div", { className: "flex items-center justify-center shrink-0", children: config.branding?.logo || /* @__PURE__ */ jsx17(Avatar, { className: "h-8 w-8", children: /* @__PURE__ */ jsx17(AvatarFallback, { className: "bg-primary text-primary-foreground", children: /* @__PURE__ */ jsx17(Bot, { className: "h-4 w-4" }) }) }) }),
2306
2224
  /* @__PURE__ */ jsxs9("div", { className: "flex flex-col min-w-0 group-data-[collapsible=icon]:hidden", children: [
2307
- /* @__PURE__ */ jsx16("span", { className: "text-sm font-semibold truncate", children: config.branding?.title || "Chat" }),
2308
- config.branding?.subtitle && /* @__PURE__ */ jsx16("span", { className: "text-xs text-muted-foreground truncate", children: config.branding.subtitle })
2225
+ /* @__PURE__ */ jsx17("span", { className: "text-sm font-semibold truncate", children: config.branding?.title || "Chat" }),
2226
+ config.branding?.subtitle && /* @__PURE__ */ jsx17("span", { className: "text-xs text-muted-foreground truncate", children: config.branding.subtitle })
2309
2227
  ] })
2310
2228
  ] }),
2311
- onCreateThread && /* @__PURE__ */ jsx16(
2229
+ onCreateThread && /* @__PURE__ */ jsx17(
2312
2230
  CreateThreadDialog,
2313
2231
  {
2314
2232
  config,
2315
2233
  onCreateThread,
2316
- trigger: /* @__PURE__ */ jsx16(SidebarMenu, { children: /* @__PURE__ */ jsx16(SidebarMenuItem, { children: /* @__PURE__ */ jsxs9(
2234
+ trigger: /* @__PURE__ */ jsx17(SidebarMenu, { children: /* @__PURE__ */ jsx17(SidebarMenuItem, { children: /* @__PURE__ */ jsxs9(
2317
2235
  SidebarMenuButton,
2318
2236
  {
2319
2237
  size: "lg",
2320
2238
  className: "w-full justify-start gap-2 border border-sidebar-border shadow-sm hover:bg-sidebar-accent hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:justify-center",
2321
2239
  tooltip: config.labels?.newChat || "New Chat",
2322
2240
  children: [
2323
- /* @__PURE__ */ jsx16(Plus, { className: "size-4" }),
2324
- /* @__PURE__ */ jsx16("span", { className: "group-data-[collapsible=icon]:hidden", children: config.labels?.newChat || "New Chat" })
2241
+ /* @__PURE__ */ jsx17(Plus, { className: "size-4" }),
2242
+ /* @__PURE__ */ jsx17("span", { className: "group-data-[collapsible=icon]:hidden", children: config.labels?.newChat || "New Chat" })
2325
2243
  ]
2326
2244
  }
2327
2245
  ) }) })
@@ -2329,8 +2247,8 @@ var Sidebar2 = ({
2329
2247
  ),
2330
2248
  /* @__PURE__ */ jsxs9("div", { className: "px-2 py-1 mt-4", children: [
2331
2249
  /* @__PURE__ */ jsxs9("div", { className: "relative group-data-[collapsible=icon]:hidden", children: [
2332
- /* @__PURE__ */ jsx16(Search, { className: "pointer-events-none absolute left-2 top-1/2 size-4 -translate-y-1/2 select-none opacity-50" }),
2333
- /* @__PURE__ */ jsx16(
2250
+ /* @__PURE__ */ jsx17(Search, { className: "pointer-events-none absolute left-2 top-1/2 size-4 -translate-y-1/2 select-none opacity-50" }),
2251
+ /* @__PURE__ */ jsx17(
2334
2252
  Input,
2335
2253
  {
2336
2254
  className: "pl-8 h-8 bg-sidebar-accent/50 border-sidebar-border focus-visible:ring-1 focus-visible:ring-sidebar-ring",
@@ -2340,7 +2258,7 @@ var Sidebar2 = ({
2340
2258
  }
2341
2259
  )
2342
2260
  ] }),
2343
- /* @__PURE__ */ jsx16("div", { className: "hidden group-data-[collapsible=icon]:flex justify-center", children: /* @__PURE__ */ jsx16(
2261
+ /* @__PURE__ */ jsx17("div", { className: "hidden group-data-[collapsible=icon]:flex justify-center", children: /* @__PURE__ */ jsx17(
2344
2262
  Button,
2345
2263
  {
2346
2264
  variant: "ghost",
@@ -2348,13 +2266,13 @@ var Sidebar2 = ({
2348
2266
  className: "h-7 w-7",
2349
2267
  onClick: () => setOpen(true),
2350
2268
  title: config.labels?.search || "Search",
2351
- children: /* @__PURE__ */ jsx16(Search, { className: "h-4 w-4" })
2269
+ children: /* @__PURE__ */ jsx17(Search, { className: "h-4 w-4" })
2352
2270
  }
2353
2271
  ) })
2354
2272
  ] })
2355
2273
  ] }),
2356
2274
  /* @__PURE__ */ jsxs9(SidebarContent, { children: [
2357
- threads.some((t) => t.isArchived) && /* @__PURE__ */ jsx16("div", { className: "px-4 py-2 mt-2 group-data-[collapsible=icon]:hidden", children: /* @__PURE__ */ jsxs9(
2275
+ threads.some((t) => t.isArchived) && /* @__PURE__ */ jsx17("div", { className: "px-4 py-2 mt-2 group-data-[collapsible=icon]:hidden", children: /* @__PURE__ */ jsxs9(
2358
2276
  Button,
2359
2277
  {
2360
2278
  variant: "ghost",
@@ -2362,18 +2280,18 @@ var Sidebar2 = ({
2362
2280
  onClick: () => setShowArchived(!showArchived),
2363
2281
  className: "h-6 text-xs w-full justify-start text-muted-foreground",
2364
2282
  children: [
2365
- /* @__PURE__ */ jsx16(Filter, { className: "mr-2 h-3 w-3" }),
2283
+ /* @__PURE__ */ jsx17(Filter, { className: "mr-2 h-3 w-3" }),
2366
2284
  showArchived ? config.labels?.hideArchived || "Hide Archived" : config.labels?.showArchived || "Show Archived"
2367
2285
  ]
2368
2286
  }
2369
2287
  ) }),
2370
2288
  Object.keys(groupedThreads).length === 0 ? /* @__PURE__ */ jsxs9("div", { className: "px-4 py-8 text-center text-muted-foreground group-data-[collapsible=icon]:hidden", children: [
2371
- /* @__PURE__ */ jsx16("div", { className: "mx-auto h-8 w-8 mb-2 flex items-center justify-center rounded-full bg-muted/50", children: /* @__PURE__ */ jsx16(Plus, { className: "h-4 w-4 opacity-50" }) }),
2372
- /* @__PURE__ */ jsx16("p", { className: "text-xs", children: searchQuery ? config.labels?.noThreadsFound || "No conversations found" : config.labels?.noThreadsYet || "No conversations yet" })
2289
+ /* @__PURE__ */ jsx17("div", { className: "mx-auto h-8 w-8 mb-2 flex items-center justify-center rounded-full bg-muted/50", children: /* @__PURE__ */ jsx17(Plus, { className: "h-4 w-4 opacity-50" }) }),
2290
+ /* @__PURE__ */ jsx17("p", { className: "text-xs", children: searchQuery ? config.labels?.noThreadsFound || "No conversations found" : config.labels?.noThreadsYet || "No conversations yet" })
2373
2291
  ] }) : Object.entries(groupedThreads).map(([group, groupThreads]) => /* @__PURE__ */ jsxs9(SidebarGroup, { className: "mt-2", children: [
2374
- /* @__PURE__ */ jsx16(SidebarGroupLabel, { className: "group-data-[collapsible=icon]:hidden", children: group }),
2375
- /* @__PURE__ */ jsx16(SidebarGroupContent, { children: /* @__PURE__ */ jsx16(SidebarMenu, { children: groupThreads.map((thread) => /* @__PURE__ */ jsxs9(SidebarMenuItem, { children: [
2376
- editingThreadId === thread.id ? /* @__PURE__ */ jsx16("div", { className: "flex items-center gap-1 px-2 py-1", children: /* @__PURE__ */ jsx16(
2292
+ /* @__PURE__ */ jsx17(SidebarGroupLabel, { className: "group-data-[collapsible=icon]:hidden", children: group }),
2293
+ /* @__PURE__ */ jsx17(SidebarGroupContent, { children: /* @__PURE__ */ jsx17(SidebarMenu, { children: groupThreads.map((thread) => /* @__PURE__ */ jsxs9(SidebarMenuItem, { children: [
2294
+ editingThreadId === thread.id ? /* @__PURE__ */ jsx17("div", { className: "flex items-center gap-1 px-2 py-1", children: /* @__PURE__ */ jsx17(
2377
2295
  Input,
2378
2296
  {
2379
2297
  ref: inputRef,
@@ -2393,35 +2311,35 @@ var Sidebar2 = ({
2393
2311
  onClick: () => onSelectThread?.(thread.id),
2394
2312
  tooltip: thread.title,
2395
2313
  children: [
2396
- /* @__PURE__ */ jsx16(ThreadInitialsIcon, { title: thread.title || "?" }),
2397
- /* @__PURE__ */ jsx16("div", { className: "flex flex-col items-start gap-0.5 flex-1 min-w-0 group-data-[collapsible=icon]:hidden", children: /* @__PURE__ */ jsx16("span", { className: "truncate w-full", children: thread.title || "New Chat" }) }),
2398
- thread.isArchived && /* @__PURE__ */ jsx16(Archive, { className: "ml-auto h-3 w-3 opacity-50 group-data-[collapsible=icon]:hidden" })
2314
+ /* @__PURE__ */ jsx17(ThreadInitialsIcon, { title: thread.title || "?" }),
2315
+ /* @__PURE__ */ jsx17("div", { className: "flex flex-col items-start gap-0.5 flex-1 min-w-0 group-data-[collapsible=icon]:hidden", children: /* @__PURE__ */ jsx17("span", { className: "truncate w-full", children: thread.title || "New Chat" }) }),
2316
+ thread.isArchived && /* @__PURE__ */ jsx17(Archive, { className: "ml-auto h-3 w-3 opacity-50 group-data-[collapsible=icon]:hidden" })
2399
2317
  ]
2400
2318
  }
2401
2319
  ),
2402
2320
  !editingThreadId && /* @__PURE__ */ jsxs9(DropdownMenu, { children: [
2403
- /* @__PURE__ */ jsx16(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs9(SidebarMenuAction, { showOnHover: true, children: [
2404
- /* @__PURE__ */ jsx16(MoreHorizontal, {}),
2405
- /* @__PURE__ */ jsx16("span", { className: "sr-only", children: "More" })
2321
+ /* @__PURE__ */ jsx17(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs9(SidebarMenuAction, { showOnHover: true, children: [
2322
+ /* @__PURE__ */ jsx17(MoreHorizontal, {}),
2323
+ /* @__PURE__ */ jsx17("span", { className: "sr-only", children: "More" })
2406
2324
  ] }) }),
2407
2325
  /* @__PURE__ */ jsxs9(DropdownMenuContent, { className: "w-48", side: "right", align: "start", children: [
2408
2326
  /* @__PURE__ */ jsxs9(DropdownMenuItem, { onClick: () => startEditing(thread), children: [
2409
- /* @__PURE__ */ jsx16(Edit2, { className: "mr-2 h-4 w-4" }),
2410
- /* @__PURE__ */ jsx16("span", { children: config.labels?.renameThread || "Rename" })
2327
+ /* @__PURE__ */ jsx17(Edit2, { className: "mr-2 h-4 w-4" }),
2328
+ /* @__PURE__ */ jsx17("span", { children: config.labels?.renameThread || "Rename" })
2411
2329
  ] }),
2412
2330
  /* @__PURE__ */ jsxs9(DropdownMenuItem, { onClick: () => onArchiveThread?.(thread.id), children: [
2413
- /* @__PURE__ */ jsx16(Archive, { className: "mr-2 h-4 w-4" }),
2414
- /* @__PURE__ */ jsx16("span", { children: thread.isArchived ? config.labels?.unarchiveThread || "Unarchive" : config.labels?.archiveThread || "Archive" })
2331
+ /* @__PURE__ */ jsx17(Archive, { className: "mr-2 h-4 w-4" }),
2332
+ /* @__PURE__ */ jsx17("span", { children: thread.isArchived ? config.labels?.unarchiveThread || "Unarchive" : config.labels?.archiveThread || "Archive" })
2415
2333
  ] }),
2416
- /* @__PURE__ */ jsx16(DropdownMenuSeparator, {}),
2334
+ /* @__PURE__ */ jsx17(DropdownMenuSeparator, {}),
2417
2335
  /* @__PURE__ */ jsxs9(
2418
2336
  DropdownMenuItem,
2419
2337
  {
2420
2338
  onClick: () => setDeleteThreadId(thread.id),
2421
2339
  className: "text-destructive focus:text-destructive",
2422
2340
  children: [
2423
- /* @__PURE__ */ jsx16(Trash2, { className: "mr-2 h-4 w-4" }),
2424
- /* @__PURE__ */ jsx16("span", { children: config.labels?.deleteThread || "Delete" })
2341
+ /* @__PURE__ */ jsx17(Trash2, { className: "mr-2 h-4 w-4" }),
2342
+ /* @__PURE__ */ jsx17("span", { children: config.labels?.deleteThread || "Delete" })
2425
2343
  ]
2426
2344
  }
2427
2345
  )
@@ -2430,7 +2348,7 @@ var Sidebar2 = ({
2430
2348
  ] }, thread.id)) }) })
2431
2349
  ] }, group))
2432
2350
  ] }),
2433
- /* @__PURE__ */ jsx16(SidebarFooter, { children: /* @__PURE__ */ jsx16(
2351
+ /* @__PURE__ */ jsx17(SidebarFooter, { children: /* @__PURE__ */ jsx17(
2434
2352
  UserMenu,
2435
2353
  {
2436
2354
  user,
@@ -2441,15 +2359,15 @@ var Sidebar2 = ({
2441
2359
  additionalItems: userMenuAdditionalItems
2442
2360
  }
2443
2361
  ) }),
2444
- /* @__PURE__ */ jsx16(SidebarRail, {}),
2445
- deleteThreadId && /* @__PURE__ */ jsx16(AlertDialog, { open: !!deleteThreadId, onOpenChange: () => setDeleteThreadId(null), children: /* @__PURE__ */ jsxs9(AlertDialogContent, { children: [
2362
+ /* @__PURE__ */ jsx17(SidebarRail, {}),
2363
+ deleteThreadId && /* @__PURE__ */ jsx17(AlertDialog, { open: !!deleteThreadId, onOpenChange: () => setDeleteThreadId(null), children: /* @__PURE__ */ jsxs9(AlertDialogContent, { children: [
2446
2364
  /* @__PURE__ */ jsxs9(AlertDialogHeader, { children: [
2447
- /* @__PURE__ */ jsx16(AlertDialogTitle, { children: config.labels?.deleteConfirmTitle || "Delete Conversation" }),
2448
- /* @__PURE__ */ jsx16(AlertDialogDescription, { children: config.labels?.deleteConfirmDescription || "Are you sure you want to delete this conversation? This action cannot be undone." })
2365
+ /* @__PURE__ */ jsx17(AlertDialogTitle, { children: config.labels?.deleteConfirmTitle || "Delete Conversation" }),
2366
+ /* @__PURE__ */ jsx17(AlertDialogDescription, { children: config.labels?.deleteConfirmDescription || "Are you sure you want to delete this conversation? This action cannot be undone." })
2449
2367
  ] }),
2450
2368
  /* @__PURE__ */ jsxs9(AlertDialogFooter, { children: [
2451
- /* @__PURE__ */ jsx16(AlertDialogCancel, { children: config.labels?.cancel || "Cancel" }),
2452
- /* @__PURE__ */ jsx16(
2369
+ /* @__PURE__ */ jsx17(AlertDialogCancel, { children: config.labels?.cancel || "Cancel" }),
2370
+ /* @__PURE__ */ jsx17(
2453
2371
  AlertDialogAction,
2454
2372
  {
2455
2373
  onClick: () => deleteThreadId && handleDeleteThread(deleteThreadId),
@@ -2477,7 +2395,7 @@ import {
2477
2395
  ChevronDown as ChevronDown2,
2478
2396
  Check as Check2
2479
2397
  } from "lucide-react";
2480
- import { Fragment as Fragment3, jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
2398
+ import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
2481
2399
  var ChatHeader = ({
2482
2400
  config,
2483
2401
  currentThreadTitle,
@@ -2545,35 +2463,35 @@ var ChatHeader = ({
2545
2463
  };
2546
2464
  const selectedAgent = agentOptions.find((agent) => agent.id === selectedAgentId) || null;
2547
2465
  const agentPlaceholder = config.agentSelector?.label || "Select agent";
2548
- return /* @__PURE__ */ jsx17(
2466
+ return /* @__PURE__ */ jsx18(
2549
2467
  Card,
2550
2468
  {
2551
2469
  "data-chat-header": true,
2552
2470
  className: `py-0 border-b rounded-none relative z-10 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80 ${className}`,
2553
2471
  style: isMobile ? { paddingTop: "env(safe-area-inset-top)" } : void 0,
2554
- children: /* @__PURE__ */ jsx17(CardHeader, { className: "p-2", children: /* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-between gap-2", children: [
2472
+ children: /* @__PURE__ */ jsx18(CardHeader, { className: "p-2", children: /* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-between gap-2", children: [
2555
2473
  /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-1", children: [
2556
2474
  /* @__PURE__ */ jsxs10(Tooltip, { children: [
2557
- /* @__PURE__ */ jsx17(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx17(SidebarTrigger, { className: "-ml-1" }) }),
2558
- /* @__PURE__ */ jsx17(TooltipContent, { children: config.labels?.sidebarToggle || "Toggle Sidebar" })
2475
+ /* @__PURE__ */ jsx18(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx18(SidebarTrigger, { className: "-ml-1" }) }),
2476
+ /* @__PURE__ */ jsx18(TooltipContent, { children: config.labels?.sidebarToggle || "Toggle Sidebar" })
2559
2477
  ] }),
2560
2478
  showAgentSelector && /* @__PURE__ */ jsxs10(DropdownMenu, { children: [
2561
- /* @__PURE__ */ jsx17(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs10(
2479
+ /* @__PURE__ */ jsx18(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs10(
2562
2480
  Button,
2563
2481
  {
2564
2482
  variant: "ghost",
2565
2483
  className: "h-9 px-3 gap-1.5 font-medium text-base hover:bg-accent/50",
2566
2484
  children: [
2567
2485
  selectedAgent?.avatarUrl ? /* @__PURE__ */ jsxs10(Avatar, { className: "h-5 w-5", children: [
2568
- /* @__PURE__ */ jsx17(AvatarImage, { src: selectedAgent.avatarUrl, alt: selectedAgent.name }),
2569
- /* @__PURE__ */ jsx17(AvatarFallback, { className: "text-[10px]", children: selectedAgent.name.charAt(0).toUpperCase() })
2486
+ /* @__PURE__ */ jsx18(AvatarImage, { src: selectedAgent.avatarUrl, alt: selectedAgent.name }),
2487
+ /* @__PURE__ */ jsx18(AvatarFallback, { className: "text-[10px]", children: selectedAgent.name.charAt(0).toUpperCase() })
2570
2488
  ] }) : null,
2571
- /* @__PURE__ */ jsx17("span", { className: "max-w-[200px] truncate", children: selectedAgent?.name || agentPlaceholder }),
2572
- /* @__PURE__ */ jsx17(ChevronDown2, { className: "h-4 w-4 opacity-50" })
2489
+ /* @__PURE__ */ jsx18("span", { className: "max-w-[200px] truncate", children: selectedAgent?.name || agentPlaceholder }),
2490
+ /* @__PURE__ */ jsx18(ChevronDown2, { className: "h-4 w-4 opacity-50" })
2573
2491
  ]
2574
2492
  }
2575
2493
  ) }),
2576
- /* @__PURE__ */ jsx17(DropdownMenuContent, { align: "start", className: "w-[280px]", children: agentOptions.map((agent) => {
2494
+ /* @__PURE__ */ jsx18(DropdownMenuContent, { align: "start", className: "w-[280px]", children: agentOptions.map((agent) => {
2577
2495
  const isSelected = agent.id === selectedAgentId;
2578
2496
  return /* @__PURE__ */ jsxs10(
2579
2497
  DropdownMenuItem,
@@ -2582,15 +2500,15 @@ var ChatHeader = ({
2582
2500
  className: "flex items-start gap-3 p-3 cursor-pointer",
2583
2501
  children: [
2584
2502
  agent.avatarUrl ? /* @__PURE__ */ jsxs10(Avatar, { className: "h-6 w-6 mt-0.5 shrink-0", children: [
2585
- /* @__PURE__ */ jsx17(AvatarImage, { src: agent.avatarUrl, alt: agent.name }),
2586
- /* @__PURE__ */ jsx17(AvatarFallback, { className: "text-[10px]", children: agent.name.charAt(0).toUpperCase() })
2587
- ] }) : /* @__PURE__ */ jsx17("div", { className: "h-6 w-6 mt-0.5 shrink-0 flex items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ jsx17(Bot2, { className: "h-3.5 w-3.5 text-primary" }) }),
2503
+ /* @__PURE__ */ jsx18(AvatarImage, { src: agent.avatarUrl, alt: agent.name }),
2504
+ /* @__PURE__ */ jsx18(AvatarFallback, { className: "text-[10px]", children: agent.name.charAt(0).toUpperCase() })
2505
+ ] }) : /* @__PURE__ */ jsx18("div", { className: "h-6 w-6 mt-0.5 shrink-0 flex items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ jsx18(Bot2, { className: "h-3.5 w-3.5 text-primary" }) }),
2588
2506
  /* @__PURE__ */ jsxs10("div", { className: "flex-1 min-w-0", children: [
2589
2507
  /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2", children: [
2590
- /* @__PURE__ */ jsx17("span", { className: "font-medium text-sm", children: agent.name }),
2591
- isSelected && /* @__PURE__ */ jsx17(Check2, { className: "h-4 w-4 text-primary shrink-0" })
2508
+ /* @__PURE__ */ jsx18("span", { className: "font-medium text-sm", children: agent.name }),
2509
+ isSelected && /* @__PURE__ */ jsx18(Check2, { className: "h-4 w-4 text-primary shrink-0" })
2592
2510
  ] }),
2593
- agent.description && /* @__PURE__ */ jsx17("p", { className: "text-xs text-muted-foreground mt-0.5 line-clamp-2", children: agent.description })
2511
+ agent.description && /* @__PURE__ */ jsx18("p", { className: "text-xs text-muted-foreground mt-0.5 line-clamp-2", children: agent.description })
2594
2512
  ] })
2595
2513
  ]
2596
2514
  },
@@ -2598,59 +2516,59 @@ var ChatHeader = ({
2598
2516
  );
2599
2517
  }) })
2600
2518
  ] }),
2601
- !showAgentSelector && isMobile && /* @__PURE__ */ jsx17("span", { className: "text-sm font-medium truncate max-w-[150px] ml-2", children: currentThreadTitle || config.branding?.title || "Chat" })
2519
+ !showAgentSelector && isMobile && /* @__PURE__ */ jsx18("span", { className: "text-sm font-medium truncate max-w-[150px] ml-2", children: currentThreadTitle || config.branding?.title || "Chat" })
2602
2520
  ] }),
2603
- /* @__PURE__ */ jsx17("div", { className: "flex-1" }),
2521
+ /* @__PURE__ */ jsx18("div", { className: "flex-1" }),
2604
2522
  /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-1", children: [
2605
2523
  showCustomComponentButton && config.customComponent && /* @__PURE__ */ jsxs10(Tooltip, { children: [
2606
- /* @__PURE__ */ jsx17(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx17(
2524
+ /* @__PURE__ */ jsx18(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx18(
2607
2525
  Button,
2608
2526
  {
2609
2527
  variant: "ghost",
2610
2528
  size: "icon",
2611
2529
  className: "h-8 w-8",
2612
2530
  onClick: onCustomComponentToggle,
2613
- children: config.customComponent.icon || /* @__PURE__ */ jsx17(Menu, { className: "h-4 w-4" })
2531
+ children: config.customComponent.icon || /* @__PURE__ */ jsx18(Menu, { className: "h-4 w-4" })
2614
2532
  }
2615
2533
  ) }),
2616
- /* @__PURE__ */ jsx17(TooltipContent, { children: config.customComponent.label || config.labels?.customComponentToggle || "Toggle" })
2534
+ /* @__PURE__ */ jsx18(TooltipContent, { children: config.customComponent.label || config.labels?.customComponentToggle || "Toggle" })
2617
2535
  ] }),
2618
2536
  config.headerActions,
2619
2537
  /* @__PURE__ */ jsxs10(DropdownMenu, { children: [
2620
- /* @__PURE__ */ jsx17(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx17(Button, { variant: "ghost", size: "icon", className: "h-8 w-8", children: /* @__PURE__ */ jsx17(MoreVertical, { className: "h-4 w-4" }) }) }),
2538
+ /* @__PURE__ */ jsx18(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx18(Button, { variant: "ghost", size: "icon", className: "h-8 w-8", children: /* @__PURE__ */ jsx18(MoreVertical, { className: "h-4 w-4" }) }) }),
2621
2539
  /* @__PURE__ */ jsxs10(DropdownMenuContent, { align: "end", children: [
2622
2540
  onNewThread && /* @__PURE__ */ jsxs10(Fragment3, { children: [
2623
2541
  /* @__PURE__ */ jsxs10(DropdownMenuItem, { onClick: () => onNewThread?.(), className: "font-medium text-primary", children: [
2624
- /* @__PURE__ */ jsx17(Plus2, { className: "h-4 w-4 mr-2" }),
2542
+ /* @__PURE__ */ jsx18(Plus2, { className: "h-4 w-4 mr-2" }),
2625
2543
  config.labels?.newThread || "New Thread"
2626
2544
  ] }),
2627
- /* @__PURE__ */ jsx17(DropdownMenuSeparator, {})
2545
+ /* @__PURE__ */ jsx18(DropdownMenuSeparator, {})
2628
2546
  ] }),
2629
2547
  onExportData && /* @__PURE__ */ jsxs10(DropdownMenuItem, { onClick: onExportData, children: [
2630
- /* @__PURE__ */ jsx17(Download, { className: "h-4 w-4 mr-2" }),
2548
+ /* @__PURE__ */ jsx18(Download, { className: "h-4 w-4 mr-2" }),
2631
2549
  config.labels?.exportData || "Export Data"
2632
2550
  ] }),
2633
2551
  onImportData && /* @__PURE__ */ jsxs10(DropdownMenuItem, { onClick: handleImportClick, children: [
2634
- /* @__PURE__ */ jsx17(Upload, { className: "h-4 w-4 mr-2" }),
2552
+ /* @__PURE__ */ jsx18(Upload, { className: "h-4 w-4 mr-2" }),
2635
2553
  config.labels?.importData || "Import Data"
2636
2554
  ] }),
2637
- (onExportData || onImportData) && /* @__PURE__ */ jsx17(DropdownMenuSeparator, {}),
2638
- /* @__PURE__ */ jsx17(DropdownMenuItem, { onClick: toggleDarkMode, children: isDarkMode ? /* @__PURE__ */ jsxs10(Fragment3, { children: [
2639
- /* @__PURE__ */ jsx17(Sun2, { className: "h-4 w-4 mr-2" }),
2555
+ (onExportData || onImportData) && /* @__PURE__ */ jsx18(DropdownMenuSeparator, {}),
2556
+ /* @__PURE__ */ jsx18(DropdownMenuItem, { onClick: toggleDarkMode, children: isDarkMode ? /* @__PURE__ */ jsxs10(Fragment3, { children: [
2557
+ /* @__PURE__ */ jsx18(Sun2, { className: "h-4 w-4 mr-2" }),
2640
2558
  config.labels?.lightMode || "Light Mode"
2641
2559
  ] }) : /* @__PURE__ */ jsxs10(Fragment3, { children: [
2642
- /* @__PURE__ */ jsx17(Moon2, { className: "h-4 w-4 mr-2" }),
2560
+ /* @__PURE__ */ jsx18(Moon2, { className: "h-4 w-4 mr-2" }),
2643
2561
  config.labels?.darkMode || "Dark Mode"
2644
2562
  ] }) }),
2645
2563
  onClearAll && /* @__PURE__ */ jsxs10(Fragment3, { children: [
2646
- /* @__PURE__ */ jsx17(DropdownMenuSeparator, {}),
2564
+ /* @__PURE__ */ jsx18(DropdownMenuSeparator, {}),
2647
2565
  /* @__PURE__ */ jsxs10(
2648
2566
  DropdownMenuItem,
2649
2567
  {
2650
2568
  onClick: onClearAll,
2651
2569
  className: "text-destructive",
2652
2570
  children: [
2653
- /* @__PURE__ */ jsx17(Trash22, { className: "h-4 w-4 mr-2" }),
2571
+ /* @__PURE__ */ jsx18(Trash22, { className: "h-4 w-4 mr-2" }),
2654
2572
  config.labels?.clearAll || "Clear All"
2655
2573
  ]
2656
2574
  }
@@ -2669,7 +2587,7 @@ import { useState as useState6, useRef as useRef6, useCallback as useCallback3,
2669
2587
 
2670
2588
  // src/components/chat/UserContext.tsx
2671
2589
  import { createContext as createContext2, useCallback as useCallback2, useContext as useContext2, useEffect as useEffect8, useMemo as useMemo2, useState as useState5 } from "react";
2672
- import { jsx as jsx18 } from "react/jsx-runtime";
2590
+ import { jsx as jsx19 } from "react/jsx-runtime";
2673
2591
  var Ctx = createContext2(void 0);
2674
2592
  var ChatUserContextProvider = ({ children, initial }) => {
2675
2593
  const [ctx, setCtx] = useState5(() => ({
@@ -2695,7 +2613,7 @@ var ChatUserContextProvider = ({ children, initial }) => {
2695
2613
  setContext: setPartial,
2696
2614
  resetContext: () => setCtx({ updatedAt: Date.now() })
2697
2615
  }), [ctx, setPartial]);
2698
- return /* @__PURE__ */ jsx18(Ctx.Provider, { value, children });
2616
+ return /* @__PURE__ */ jsx19(Ctx.Provider, { value, children });
2699
2617
  };
2700
2618
  function useChatUserContext() {
2701
2619
  const v = useContext2(Ctx);
@@ -2705,13 +2623,13 @@ function useChatUserContext() {
2705
2623
 
2706
2624
  // src/components/ui/progress.tsx
2707
2625
  import * as ProgressPrimitive from "@radix-ui/react-progress";
2708
- import { jsx as jsx19 } from "react/jsx-runtime";
2626
+ import { jsx as jsx20 } from "react/jsx-runtime";
2709
2627
  function Progress({
2710
2628
  className,
2711
2629
  value,
2712
2630
  ...props
2713
2631
  }) {
2714
- return /* @__PURE__ */ jsx19(
2632
+ return /* @__PURE__ */ jsx20(
2715
2633
  ProgressPrimitive.Root,
2716
2634
  {
2717
2635
  "data-slot": "progress",
@@ -2720,7 +2638,7 @@ function Progress({
2720
2638
  className
2721
2639
  ),
2722
2640
  ...props,
2723
- children: /* @__PURE__ */ jsx19(
2641
+ children: /* @__PURE__ */ jsx20(
2724
2642
  ProgressPrimitive.Indicator,
2725
2643
  {
2726
2644
  "data-slot": "progress-indicator",
@@ -2746,7 +2664,7 @@ import {
2746
2664
  Pause as Pause2,
2747
2665
  Loader2
2748
2666
  } from "lucide-react";
2749
- import { Fragment as Fragment4, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
2667
+ import { Fragment as Fragment4, jsx as jsx21, jsxs as jsxs11 } from "react/jsx-runtime";
2750
2668
  var FileUploadItem = memo2(function FileUploadItem2({ file, progress, onCancel }) {
2751
2669
  const guessTypeFromName = (name) => {
2752
2670
  const ext = (name || "").split(".").pop()?.toLowerCase();
@@ -2775,10 +2693,10 @@ var FileUploadItem = memo2(function FileUploadItem2({ file, progress, onCancel }
2775
2693
  };
2776
2694
  const getFileIcon = (type, name) => {
2777
2695
  const t = typeof type === "string" && type.length > 0 ? type : guessTypeFromName(name);
2778
- if (t.startsWith("image/")) return /* @__PURE__ */ jsx20(Image2, { className: "h-4 w-4" });
2779
- if (t.startsWith("video/")) return /* @__PURE__ */ jsx20(Video, { className: "h-4 w-4" });
2780
- if (t.startsWith("audio/")) return /* @__PURE__ */ jsx20(Mic, { className: "h-4 w-4" });
2781
- return /* @__PURE__ */ jsx20(FileText, { className: "h-4 w-4" });
2696
+ if (t.startsWith("image/")) return /* @__PURE__ */ jsx21(Image2, { className: "h-4 w-4" });
2697
+ if (t.startsWith("video/")) return /* @__PURE__ */ jsx21(Video, { className: "h-4 w-4" });
2698
+ if (t.startsWith("audio/")) return /* @__PURE__ */ jsx21(Mic, { className: "h-4 w-4" });
2699
+ return /* @__PURE__ */ jsx21(FileText, { className: "h-4 w-4" });
2782
2700
  };
2783
2701
  const formatFileSize = (bytes) => {
2784
2702
  if (bytes === 0) return "0 Bytes";
@@ -2787,21 +2705,21 @@ var FileUploadItem = memo2(function FileUploadItem2({ file, progress, onCancel }
2787
2705
  const i = Math.floor(Math.log(bytes) / Math.log(k));
2788
2706
  return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
2789
2707
  };
2790
- return /* @__PURE__ */ jsx20(Card, { className: "relative", children: /* @__PURE__ */ jsx20(CardContent, { className: "p-3", children: /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-3", children: [
2708
+ return /* @__PURE__ */ jsx21(Card, { className: "relative", children: /* @__PURE__ */ jsx21(CardContent, { className: "p-3", children: /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-3", children: [
2791
2709
  getFileIcon(file.type, file.name),
2792
2710
  /* @__PURE__ */ jsxs11("div", { className: "flex-1 min-w-0", children: [
2793
- /* @__PURE__ */ jsx20("p", { className: "text-sm font-medium truncate", children: file.name }),
2794
- /* @__PURE__ */ jsx20("p", { className: "text-xs text-muted-foreground", children: formatFileSize(file.size ?? 0) }),
2795
- /* @__PURE__ */ jsx20(Progress, { value: progress, className: "h-1 mt-1" })
2711
+ /* @__PURE__ */ jsx21("p", { className: "text-sm font-medium truncate", children: file.name }),
2712
+ /* @__PURE__ */ jsx21("p", { className: "text-xs text-muted-foreground", children: formatFileSize(file.size ?? 0) }),
2713
+ /* @__PURE__ */ jsx21(Progress, { value: progress, className: "h-1 mt-1" })
2796
2714
  ] }),
2797
- /* @__PURE__ */ jsx20(
2715
+ /* @__PURE__ */ jsx21(
2798
2716
  Button,
2799
2717
  {
2800
2718
  variant: "ghost",
2801
2719
  size: "icon",
2802
2720
  className: "h-6 w-6",
2803
2721
  onClick: onCancel,
2804
- children: /* @__PURE__ */ jsx20(X2, { className: "h-3 w-3" })
2722
+ children: /* @__PURE__ */ jsx21(X2, { className: "h-3 w-3" })
2805
2723
  }
2806
2724
  )
2807
2725
  ] }) }) });
@@ -2825,9 +2743,9 @@ var AttachmentPreview = memo2(function AttachmentPreview2({ attachment, onRemove
2825
2743
  const minutes = Math.floor(seconds / 60);
2826
2744
  return `${minutes}:${(seconds % 60).toString().padStart(2, "0")}`;
2827
2745
  };
2828
- return /* @__PURE__ */ jsx20(Card, { className: "relative group", children: /* @__PURE__ */ jsxs11(CardContent, { className: "p-2", children: [
2746
+ return /* @__PURE__ */ jsx21(Card, { className: "relative group", children: /* @__PURE__ */ jsxs11(CardContent, { className: "p-2", children: [
2829
2747
  attachment.kind === "image" && /* @__PURE__ */ jsxs11("div", { className: "relative", children: [
2830
- /* @__PURE__ */ jsx20(
2748
+ /* @__PURE__ */ jsx21(
2831
2749
  "img",
2832
2750
  {
2833
2751
  src: attachment.dataUrl,
@@ -2835,19 +2753,19 @@ var AttachmentPreview = memo2(function AttachmentPreview2({ attachment, onRemove
2835
2753
  className: "w-full h-20 object-cover rounded"
2836
2754
  }
2837
2755
  ),
2838
- /* @__PURE__ */ jsx20("div", { className: "absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity rounded flex items-center justify-center", children: /* @__PURE__ */ jsx20(
2756
+ /* @__PURE__ */ jsx21("div", { className: "absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity rounded flex items-center justify-center", children: /* @__PURE__ */ jsx21(
2839
2757
  Button,
2840
2758
  {
2841
2759
  variant: "destructive",
2842
2760
  size: "icon",
2843
2761
  className: "h-6 w-6",
2844
2762
  onClick: onRemove,
2845
- children: /* @__PURE__ */ jsx20(X2, { className: "h-3 w-3" })
2763
+ children: /* @__PURE__ */ jsx21(X2, { className: "h-3 w-3" })
2846
2764
  }
2847
2765
  ) })
2848
2766
  ] }),
2849
2767
  attachment.kind === "video" && /* @__PURE__ */ jsxs11("div", { className: "relative", children: [
2850
- /* @__PURE__ */ jsx20(
2768
+ /* @__PURE__ */ jsx21(
2851
2769
  "video",
2852
2770
  {
2853
2771
  src: attachment.dataUrl,
@@ -2856,34 +2774,34 @@ var AttachmentPreview = memo2(function AttachmentPreview2({ attachment, onRemove
2856
2774
  muted: true
2857
2775
  }
2858
2776
  ),
2859
- /* @__PURE__ */ jsx20("div", { className: "absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity rounded flex items-center justify-center", children: /* @__PURE__ */ jsx20(
2777
+ /* @__PURE__ */ jsx21("div", { className: "absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity rounded flex items-center justify-center", children: /* @__PURE__ */ jsx21(
2860
2778
  Button,
2861
2779
  {
2862
2780
  variant: "destructive",
2863
2781
  size: "icon",
2864
2782
  className: "h-6 w-6",
2865
2783
  onClick: onRemove,
2866
- children: /* @__PURE__ */ jsx20(X2, { className: "h-3 w-3" })
2784
+ children: /* @__PURE__ */ jsx21(X2, { className: "h-3 w-3" })
2867
2785
  }
2868
2786
  ) }),
2869
- /* @__PURE__ */ jsx20(Badge, { className: "absolute bottom-1 right-1 text-xs", children: formatDuration(attachment.durationMs) })
2787
+ /* @__PURE__ */ jsx21(Badge, { className: "absolute bottom-1 right-1 text-xs", children: formatDuration(attachment.durationMs) })
2870
2788
  ] }),
2871
2789
  attachment.kind === "audio" && /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 p-2", children: [
2872
- /* @__PURE__ */ jsx20(
2790
+ /* @__PURE__ */ jsx21(
2873
2791
  Button,
2874
2792
  {
2875
2793
  variant: "outline",
2876
2794
  size: "icon",
2877
2795
  className: "h-8 w-8",
2878
2796
  onClick: handlePlayPause,
2879
- children: isPlaying ? /* @__PURE__ */ jsx20(Pause2, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx20(Play2, { className: "h-3 w-3" })
2797
+ children: isPlaying ? /* @__PURE__ */ jsx21(Pause2, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx21(Play2, { className: "h-3 w-3" })
2880
2798
  }
2881
2799
  ),
2882
2800
  /* @__PURE__ */ jsxs11("div", { className: "flex-1", children: [
2883
- /* @__PURE__ */ jsx20("p", { className: "text-xs font-medium", children: attachment.fileName || "\xC1udio" }),
2884
- /* @__PURE__ */ jsx20("p", { className: "text-xs text-muted-foreground", children: formatDuration(attachment.durationMs) })
2801
+ /* @__PURE__ */ jsx21("p", { className: "text-xs font-medium", children: attachment.fileName || "\xC1udio" }),
2802
+ /* @__PURE__ */ jsx21("p", { className: "text-xs text-muted-foreground", children: formatDuration(attachment.durationMs) })
2885
2803
  ] }),
2886
- /* @__PURE__ */ jsx20(
2804
+ /* @__PURE__ */ jsx21(
2887
2805
  "audio",
2888
2806
  {
2889
2807
  ref: audioRef,
@@ -2893,18 +2811,18 @@ var AttachmentPreview = memo2(function AttachmentPreview2({ attachment, onRemove
2893
2811
  onEnded: () => setIsPlaying(false)
2894
2812
  }
2895
2813
  ),
2896
- /* @__PURE__ */ jsx20(
2814
+ /* @__PURE__ */ jsx21(
2897
2815
  Button,
2898
2816
  {
2899
2817
  variant: "ghost",
2900
2818
  size: "icon",
2901
2819
  className: "h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity",
2902
2820
  onClick: onRemove,
2903
- children: /* @__PURE__ */ jsx20(X2, { className: "h-3 w-3" })
2821
+ children: /* @__PURE__ */ jsx21(X2, { className: "h-3 w-3" })
2904
2822
  }
2905
2823
  )
2906
2824
  ] }),
2907
- attachment.fileName && attachment.kind !== "audio" && /* @__PURE__ */ jsx20("div", { className: "absolute bottom-0 left-0 right-0 bg-black/70 text-white text-xs p-1 rounded-b", children: /* @__PURE__ */ jsx20("p", { className: "truncate", children: attachment.fileName }) })
2825
+ attachment.fileName && attachment.kind !== "audio" && /* @__PURE__ */ jsx21("div", { className: "absolute bottom-0 left-0 right-0 bg-black/70 text-white text-xs p-1 rounded-b", children: /* @__PURE__ */ jsx21("p", { className: "truncate", children: attachment.fileName }) })
2908
2826
  ] }) });
2909
2827
  });
2910
2828
  var AudioRecorder = memo2(function AudioRecorder2({ isRecording, onStartRecording, onStopRecording, onCancel, recordingDuration, config }) {
@@ -2915,25 +2833,25 @@ var AudioRecorder = memo2(function AudioRecorder2({ isRecording, onStartRecordin
2915
2833
  };
2916
2834
  if (!isRecording) {
2917
2835
  return /* @__PURE__ */ jsxs11(Tooltip, { children: [
2918
- /* @__PURE__ */ jsx20(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx20(
2836
+ /* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(
2919
2837
  Button,
2920
2838
  {
2921
2839
  variant: "outline",
2922
2840
  size: "icon",
2923
2841
  onClick: onStartRecording,
2924
2842
  className: "h-10 w-10",
2925
- children: /* @__PURE__ */ jsx20(Mic, { className: "h-4 w-4" })
2843
+ children: /* @__PURE__ */ jsx21(Mic, { className: "h-4 w-4" })
2926
2844
  }
2927
2845
  ) }),
2928
- /* @__PURE__ */ jsx20(TooltipContent, { children: config?.labels?.recordAudioTooltip })
2846
+ /* @__PURE__ */ jsx21(TooltipContent, { children: config?.labels?.recordAudioTooltip })
2929
2847
  ] });
2930
2848
  }
2931
- return /* @__PURE__ */ jsx20(Card, { className: "border-red-200 bg-red-50 dark:border-red-800 dark:bg-red-950", children: /* @__PURE__ */ jsx20(CardContent, { className: "p-3", children: /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-3", children: [
2849
+ return /* @__PURE__ */ jsx21(Card, { className: "border-red-200 bg-red-50 dark:border-red-800 dark:bg-red-950", children: /* @__PURE__ */ jsx21(CardContent, { className: "p-3", children: /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-3", children: [
2932
2850
  /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
2933
- /* @__PURE__ */ jsx20("div", { className: "h-3 w-3 bg-red-500 rounded-full animate-pulse" }),
2934
- /* @__PURE__ */ jsx20("span", { className: "text-sm font-medium text-red-700 dark:text-red-300", children: "Gravando" })
2851
+ /* @__PURE__ */ jsx21("div", { className: "h-3 w-3 bg-red-500 rounded-full animate-pulse" }),
2852
+ /* @__PURE__ */ jsx21("span", { className: "text-sm font-medium text-red-700 dark:text-red-300", children: "Gravando" })
2935
2853
  ] }),
2936
- /* @__PURE__ */ jsx20(Badge, { variant: "outline", className: "text-xs", children: formatTime(recordingDuration) }),
2854
+ /* @__PURE__ */ jsx21(Badge, { variant: "outline", className: "text-xs", children: formatTime(recordingDuration) }),
2937
2855
  /* @__PURE__ */ jsxs11("div", { className: "flex gap-1 ml-auto", children: [
2938
2856
  /* @__PURE__ */ jsxs11(
2939
2857
  Button,
@@ -2942,7 +2860,7 @@ var AudioRecorder = memo2(function AudioRecorder2({ isRecording, onStartRecordin
2942
2860
  size: "sm",
2943
2861
  onClick: onCancel,
2944
2862
  children: [
2945
- /* @__PURE__ */ jsx20(X2, { className: "h-3 w-3 mr-1" }),
2863
+ /* @__PURE__ */ jsx21(X2, { className: "h-3 w-3 mr-1" }),
2946
2864
  "Cancelar"
2947
2865
  ]
2948
2866
  }
@@ -2954,7 +2872,7 @@ var AudioRecorder = memo2(function AudioRecorder2({ isRecording, onStartRecordin
2954
2872
  size: "sm",
2955
2873
  onClick: onStopRecording,
2956
2874
  children: [
2957
- /* @__PURE__ */ jsx20(Square, { className: "h-3 w-3 mr-1" }),
2875
+ /* @__PURE__ */ jsx21(Square, { className: "h-3 w-3 mr-1" }),
2958
2876
  "Parar"
2959
2877
  ]
2960
2878
  }
@@ -3180,8 +3098,8 @@ var ChatInput = memo2(function ChatInput2({
3180
3098
  onAttachmentsChange(newAttachments);
3181
3099
  };
3182
3100
  const canAddMoreAttachments = attachments.length < maxAttachments;
3183
- return /* @__PURE__ */ jsx20(TooltipProvider, { children: /* @__PURE__ */ jsx20("div", { className: `border-t py-0 bg-transparent ${className}`, children: /* @__PURE__ */ jsxs11("div", { className: "px-0 md:p-2 pb-1 space-y-4 bg-transparent", children: [
3184
- uploadProgress.size > 0 && /* @__PURE__ */ jsx20("div", { className: "space-y-2", children: Array.from(uploadProgress.entries()).map(([id, progress]) => /* @__PURE__ */ jsx20(
3101
+ return /* @__PURE__ */ jsx21(TooltipProvider, { children: /* @__PURE__ */ jsx21("div", { className: `border-t py-0 bg-transparent ${className}`, children: /* @__PURE__ */ jsxs11("div", { className: "px-0 md:p-2 pb-1 space-y-4 bg-transparent", children: [
3102
+ uploadProgress.size > 0 && /* @__PURE__ */ jsx21("div", { className: "space-y-2", children: Array.from(uploadProgress.entries()).map(([id, progress]) => /* @__PURE__ */ jsx21(
3185
3103
  FileUploadItem,
3186
3104
  {
3187
3105
  file: { name: progress.fileName },
@@ -3196,7 +3114,7 @@ var ChatInput = memo2(function ChatInput2({
3196
3114
  },
3197
3115
  id
3198
3116
  )) }),
3199
- isRecording && /* @__PURE__ */ jsx20(
3117
+ isRecording && /* @__PURE__ */ jsx21(
3200
3118
  AudioRecorder,
3201
3119
  {
3202
3120
  isRecording,
@@ -3207,7 +3125,7 @@ var ChatInput = memo2(function ChatInput2({
3207
3125
  config
3208
3126
  }
3209
3127
  ),
3210
- attachments.length > 0 && /* @__PURE__ */ jsx20("div", { className: "grid grid-cols-4 gap-2", children: attachments.map((attachment, index) => /* @__PURE__ */ jsx20(
3128
+ attachments.length > 0 && /* @__PURE__ */ jsx21("div", { className: "grid grid-cols-4 gap-2", children: attachments.map((attachment, index) => /* @__PURE__ */ jsx21(
3211
3129
  AttachmentPreview,
3212
3130
  {
3213
3131
  attachment,
@@ -3215,7 +3133,7 @@ var ChatInput = memo2(function ChatInput2({
3215
3133
  },
3216
3134
  index
3217
3135
  )) }),
3218
- /* @__PURE__ */ jsx20("form", { onSubmit: handleSubmit, className: "mb-1 flex justify-center", children: /* @__PURE__ */ jsxs11(
3136
+ /* @__PURE__ */ jsx21("form", { onSubmit: handleSubmit, className: "mb-1 flex justify-center", children: /* @__PURE__ */ jsxs11(
3219
3137
  "div",
3220
3138
  {
3221
3139
  className: "flex items-end gap-2 p-3 border rounded-lg bg-background w-full md:min-w-3xl max-w-3xl",
@@ -3223,7 +3141,7 @@ var ChatInput = memo2(function ChatInput2({
3223
3141
  onDragOver: handleDragOver,
3224
3142
  children: [
3225
3143
  enableFileUpload && canAddMoreAttachments && /* @__PURE__ */ jsxs11(Fragment4, { children: [
3226
- /* @__PURE__ */ jsx20(
3144
+ /* @__PURE__ */ jsx21(
3227
3145
  "input",
3228
3146
  {
3229
3147
  ref: fileInputRef,
@@ -3235,7 +3153,7 @@ var ChatInput = memo2(function ChatInput2({
3235
3153
  }
3236
3154
  ),
3237
3155
  /* @__PURE__ */ jsxs11(Tooltip, { children: [
3238
- /* @__PURE__ */ jsx20(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx20(
3156
+ /* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(
3239
3157
  Button,
3240
3158
  {
3241
3159
  type: "button",
@@ -3248,13 +3166,13 @@ var ChatInput = memo2(function ChatInput2({
3248
3166
  fileInputRef.current?.click();
3249
3167
  },
3250
3168
  disabled,
3251
- children: /* @__PURE__ */ jsx20(Paperclip, { className: "h-4 w-4" })
3169
+ children: /* @__PURE__ */ jsx21(Paperclip, { className: "h-4 w-4" })
3252
3170
  }
3253
3171
  ) }),
3254
- /* @__PURE__ */ jsx20(TooltipContent, { children: config?.labels?.attachFileTooltip })
3172
+ /* @__PURE__ */ jsx21(TooltipContent, { children: config?.labels?.attachFileTooltip })
3255
3173
  ] })
3256
3174
  ] }),
3257
- /* @__PURE__ */ jsx20("div", { className: "flex-1", children: /* @__PURE__ */ jsx20(
3175
+ /* @__PURE__ */ jsx21("div", { className: "flex-1", children: /* @__PURE__ */ jsx21(
3258
3176
  Textarea,
3259
3177
  {
3260
3178
  ref: textareaRef,
@@ -3267,7 +3185,7 @@ var ChatInput = memo2(function ChatInput2({
3267
3185
  rows: 1
3268
3186
  }
3269
3187
  ) }),
3270
- enableAudioRecording && !isRecording && canAddMoreAttachments && !value.trim() && /* @__PURE__ */ jsx20(
3188
+ enableAudioRecording && !isRecording && canAddMoreAttachments && !value.trim() && /* @__PURE__ */ jsx21(
3271
3189
  AudioRecorder,
3272
3190
  {
3273
3191
  isRecording,
@@ -3279,7 +3197,7 @@ var ChatInput = memo2(function ChatInput2({
3279
3197
  }
3280
3198
  ),
3281
3199
  isGenerating ? /* @__PURE__ */ jsxs11(Tooltip, { children: [
3282
- /* @__PURE__ */ jsx20(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx20(
3200
+ /* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(
3283
3201
  Button,
3284
3202
  {
3285
3203
  type: "button",
@@ -3287,22 +3205,22 @@ var ChatInput = memo2(function ChatInput2({
3287
3205
  size: "icon",
3288
3206
  className: "h-10 w-10",
3289
3207
  onClick: onStopGeneration,
3290
- children: /* @__PURE__ */ jsx20(Square, { className: "h-4 w-4" })
3208
+ children: /* @__PURE__ */ jsx21(Square, { className: "h-4 w-4" })
3291
3209
  }
3292
3210
  ) }),
3293
- /* @__PURE__ */ jsx20(TooltipContent, { children: config?.labels?.stopGenerationTooltip })
3211
+ /* @__PURE__ */ jsx21(TooltipContent, { children: config?.labels?.stopGenerationTooltip })
3294
3212
  ] }) : /* @__PURE__ */ jsxs11(Tooltip, { children: [
3295
- /* @__PURE__ */ jsx20(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx20(
3213
+ /* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx21(
3296
3214
  Button,
3297
3215
  {
3298
3216
  type: "submit",
3299
3217
  size: "icon",
3300
3218
  className: "h-10 w-10",
3301
3219
  disabled: disabled || !value.trim() && attachments.length === 0,
3302
- children: disabled ? /* @__PURE__ */ jsx20(Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx20(Send, { className: "h-4 w-4" })
3220
+ children: disabled ? /* @__PURE__ */ jsx21(Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx21(Send, { className: "h-4 w-4" })
3303
3221
  }
3304
3222
  ) }),
3305
- /* @__PURE__ */ jsx20(TooltipContent, { children: config?.labels?.sendMessageTooltip })
3223
+ /* @__PURE__ */ jsx21(TooltipContent, { children: config?.labels?.sendMessageTooltip })
3306
3224
  ] })
3307
3225
  ]
3308
3226
  }
@@ -3330,7 +3248,7 @@ import { useState as useState7 } from "react";
3330
3248
  // src/components/ui/scroll-area.tsx
3331
3249
  import * as React11 from "react";
3332
3250
  import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
3333
- import { jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
3251
+ import { jsx as jsx22, jsxs as jsxs12 } from "react/jsx-runtime";
3334
3252
  var ScrollArea = React11.forwardRef(({ className, children, viewportClassName, onScroll, onScrollCapture, ...props }, ref) => {
3335
3253
  return /* @__PURE__ */ jsxs12(
3336
3254
  ScrollAreaPrimitive.Root,
@@ -3339,7 +3257,7 @@ var ScrollArea = React11.forwardRef(({ className, children, viewportClassName, o
3339
3257
  className: cn("relative", className),
3340
3258
  ...props,
3341
3259
  children: [
3342
- /* @__PURE__ */ jsx21(
3260
+ /* @__PURE__ */ jsx22(
3343
3261
  ScrollAreaPrimitive.Viewport,
3344
3262
  {
3345
3263
  ref,
@@ -3353,8 +3271,8 @@ var ScrollArea = React11.forwardRef(({ className, children, viewportClassName, o
3353
3271
  children
3354
3272
  }
3355
3273
  ),
3356
- /* @__PURE__ */ jsx21(ScrollBar, {}),
3357
- /* @__PURE__ */ jsx21(ScrollAreaPrimitive.Corner, {})
3274
+ /* @__PURE__ */ jsx22(ScrollBar, {}),
3275
+ /* @__PURE__ */ jsx22(ScrollAreaPrimitive.Corner, {})
3358
3276
  ]
3359
3277
  }
3360
3278
  );
@@ -3365,7 +3283,7 @@ function ScrollBar({
3365
3283
  orientation = "vertical",
3366
3284
  ...props
3367
3285
  }) {
3368
- return /* @__PURE__ */ jsx21(
3286
+ return /* @__PURE__ */ jsx22(
3369
3287
  ScrollAreaPrimitive.ScrollAreaScrollbar,
3370
3288
  {
3371
3289
  "data-slot": "scroll-area-scrollbar",
@@ -3377,7 +3295,7 @@ function ScrollBar({
3377
3295
  className
3378
3296
  ),
3379
3297
  ...props,
3380
- children: /* @__PURE__ */ jsx21(
3298
+ children: /* @__PURE__ */ jsx22(
3381
3299
  ScrollAreaPrimitive.ScrollAreaThumb,
3382
3300
  {
3383
3301
  "data-slot": "scroll-area-thumb",
@@ -3416,7 +3334,7 @@ import {
3416
3334
  Check as Check3,
3417
3335
  X as X3
3418
3336
  } from "lucide-react";
3419
- import { Fragment as Fragment5, jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
3337
+ import { Fragment as Fragment5, jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
3420
3338
  var getInitials2 = (name, email) => {
3421
3339
  if (name) {
3422
3340
  return name.split(" ").map((n) => n[0]).slice(0, 2).join("").toUpperCase();
@@ -3430,29 +3348,29 @@ var getFieldIcon = (type, key) => {
3430
3348
  const iconClass = "h-4 w-4 text-muted-foreground";
3431
3349
  switch (type) {
3432
3350
  case "email":
3433
- return /* @__PURE__ */ jsx22(Mail, { className: iconClass });
3351
+ return /* @__PURE__ */ jsx23(Mail, { className: iconClass });
3434
3352
  case "phone":
3435
- return /* @__PURE__ */ jsx22(Phone, { className: iconClass });
3353
+ return /* @__PURE__ */ jsx23(Phone, { className: iconClass });
3436
3354
  case "url":
3437
- return /* @__PURE__ */ jsx22(Globe, { className: iconClass });
3355
+ return /* @__PURE__ */ jsx23(Globe, { className: iconClass });
3438
3356
  case "date":
3439
- return /* @__PURE__ */ jsx22(Calendar, { className: iconClass });
3357
+ return /* @__PURE__ */ jsx23(Calendar, { className: iconClass });
3440
3358
  }
3441
3359
  const lowerKey = key?.toLowerCase() || "";
3442
- if (lowerKey.includes("follower")) return /* @__PURE__ */ jsx22(Users, { className: iconClass });
3443
- if (lowerKey.includes("following")) return /* @__PURE__ */ jsx22(UserPlus, { className: iconClass });
3444
- if (lowerKey.includes("post") || lowerKey.includes("publication")) return /* @__PURE__ */ jsx22(Image3, { className: iconClass });
3445
- if (lowerKey.includes("verified") || lowerKey.includes("badge")) return /* @__PURE__ */ jsx22(BadgeCheck, { className: iconClass });
3446
- if (lowerKey.includes("bio")) return /* @__PURE__ */ jsx22(FileText2, { className: iconClass });
3447
- if (lowerKey.includes("email")) return /* @__PURE__ */ jsx22(Mail, { className: iconClass });
3448
- if (lowerKey.includes("phone") || lowerKey.includes("tel")) return /* @__PURE__ */ jsx22(Phone, { className: iconClass });
3449
- if (lowerKey.includes("location") || lowerKey.includes("address") || lowerKey.includes("city")) return /* @__PURE__ */ jsx22(MapPin, { className: iconClass });
3450
- if (lowerKey.includes("company") || lowerKey.includes("org")) return /* @__PURE__ */ jsx22(Building, { className: iconClass });
3451
- if (lowerKey.includes("job") || lowerKey.includes("role") || lowerKey.includes("title") || lowerKey.includes("position")) return /* @__PURE__ */ jsx22(Briefcase, { className: iconClass });
3452
- if (lowerKey.includes("website") || lowerKey.includes("url") || lowerKey.includes("link")) return /* @__PURE__ */ jsx22(Globe, { className: iconClass });
3453
- if (lowerKey.includes("username") || lowerKey.includes("handle")) return /* @__PURE__ */ jsx22(AtSign, { className: iconClass });
3454
- if (lowerKey.includes("date") || lowerKey.includes("birthday") || lowerKey.includes("joined")) return /* @__PURE__ */ jsx22(Calendar, { className: iconClass });
3455
- return /* @__PURE__ */ jsx22(User2, { className: iconClass });
3360
+ if (lowerKey.includes("follower")) return /* @__PURE__ */ jsx23(Users, { className: iconClass });
3361
+ if (lowerKey.includes("following")) return /* @__PURE__ */ jsx23(UserPlus, { className: iconClass });
3362
+ if (lowerKey.includes("post") || lowerKey.includes("publication")) return /* @__PURE__ */ jsx23(Image3, { className: iconClass });
3363
+ if (lowerKey.includes("verified") || lowerKey.includes("badge")) return /* @__PURE__ */ jsx23(BadgeCheck, { className: iconClass });
3364
+ if (lowerKey.includes("bio")) return /* @__PURE__ */ jsx23(FileText2, { className: iconClass });
3365
+ if (lowerKey.includes("email")) return /* @__PURE__ */ jsx23(Mail, { className: iconClass });
3366
+ if (lowerKey.includes("phone") || lowerKey.includes("tel")) return /* @__PURE__ */ jsx23(Phone, { className: iconClass });
3367
+ if (lowerKey.includes("location") || lowerKey.includes("address") || lowerKey.includes("city")) return /* @__PURE__ */ jsx23(MapPin, { className: iconClass });
3368
+ if (lowerKey.includes("company") || lowerKey.includes("org")) return /* @__PURE__ */ jsx23(Building, { className: iconClass });
3369
+ if (lowerKey.includes("job") || lowerKey.includes("role") || lowerKey.includes("title") || lowerKey.includes("position")) return /* @__PURE__ */ jsx23(Briefcase, { className: iconClass });
3370
+ if (lowerKey.includes("website") || lowerKey.includes("url") || lowerKey.includes("link")) return /* @__PURE__ */ jsx23(Globe, { className: iconClass });
3371
+ if (lowerKey.includes("username") || lowerKey.includes("handle")) return /* @__PURE__ */ jsx23(AtSign, { className: iconClass });
3372
+ if (lowerKey.includes("date") || lowerKey.includes("birthday") || lowerKey.includes("joined")) return /* @__PURE__ */ jsx23(Calendar, { className: iconClass });
3373
+ return /* @__PURE__ */ jsx23(User2, { className: iconClass });
3456
3374
  };
3457
3375
  var formatValue = (value, type, key) => {
3458
3376
  if (value === null || value === void 0) return "-";
@@ -3486,15 +3404,15 @@ var getMemoryCategoryIcon = (category) => {
3486
3404
  const iconClass = "h-4 w-4 text-muted-foreground";
3487
3405
  switch (category) {
3488
3406
  case "preference":
3489
- return /* @__PURE__ */ jsx22(Heart, { className: iconClass });
3407
+ return /* @__PURE__ */ jsx23(Heart, { className: iconClass });
3490
3408
  case "fact":
3491
- return /* @__PURE__ */ jsx22(Info, { className: iconClass });
3409
+ return /* @__PURE__ */ jsx23(Info, { className: iconClass });
3492
3410
  case "goal":
3493
- return /* @__PURE__ */ jsx22(Target, { className: iconClass });
3411
+ return /* @__PURE__ */ jsx23(Target, { className: iconClass });
3494
3412
  case "context":
3495
- return /* @__PURE__ */ jsx22(Lightbulb, { className: iconClass });
3413
+ return /* @__PURE__ */ jsx23(Lightbulb, { className: iconClass });
3496
3414
  default:
3497
- return /* @__PURE__ */ jsx22(Brain, { className: iconClass });
3415
+ return /* @__PURE__ */ jsx23(Brain, { className: iconClass });
3498
3416
  }
3499
3417
  };
3500
3418
  var getMemoryCategoryLabel = (category) => {
@@ -3564,66 +3482,66 @@ var UserProfile = ({
3564
3482
  const displayName = user?.name || user?.email?.split("@")[0] || "User";
3565
3483
  const initials = getInitials2(user?.name, user?.email);
3566
3484
  const normalizedFields = normalizeCustomFields(customFields);
3567
- return /* @__PURE__ */ jsx22(Sheet, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs13(
3485
+ return /* @__PURE__ */ jsx23(Sheet, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs13(
3568
3486
  SheetContent,
3569
3487
  {
3570
3488
  side: "right",
3571
3489
  className: cn("w-full sm:max-w-md p-0 flex flex-col h-full overflow-hidden", className),
3572
3490
  children: [
3573
- /* @__PURE__ */ jsx22(SheetHeader, { className: "px-6 py-4 border-b shrink-0", children: /* @__PURE__ */ jsx22("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsx22(SheetTitle, { children: labels.title }) }) }),
3574
- /* @__PURE__ */ jsx22(ScrollArea, { className: "flex-1 min-h-0", children: /* @__PURE__ */ jsxs13("div", { className: "p-6 space-y-6", children: [
3491
+ /* @__PURE__ */ jsx23(SheetHeader, { className: "px-6 py-4 border-b shrink-0", children: /* @__PURE__ */ jsx23("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsx23(SheetTitle, { children: labels.title }) }) }),
3492
+ /* @__PURE__ */ jsx23(ScrollArea, { className: "flex-1 min-h-0", children: /* @__PURE__ */ jsxs13("div", { className: "p-6 space-y-6", children: [
3575
3493
  /* @__PURE__ */ jsxs13("div", { className: "flex flex-col items-center text-center space-y-4", children: [
3576
3494
  /* @__PURE__ */ jsxs13(Avatar, { className: "h-24 w-24 shrink-0", children: [
3577
- user?.avatar && /* @__PURE__ */ jsx22(AvatarImage, { src: user.avatar, alt: displayName }),
3578
- /* @__PURE__ */ jsx22(AvatarFallback, { className: "text-2xl bg-primary/10 text-primary", children: initials })
3495
+ user?.avatar && /* @__PURE__ */ jsx23(AvatarImage, { src: user.avatar, alt: displayName }),
3496
+ /* @__PURE__ */ jsx23(AvatarFallback, { className: "text-2xl bg-primary/10 text-primary", children: initials })
3579
3497
  ] }),
3580
3498
  /* @__PURE__ */ jsxs13("div", { className: "w-full px-2", children: [
3581
- /* @__PURE__ */ jsx22("h2", { className: "text-xl font-semibold break-words", children: displayName }),
3582
- user?.email && /* @__PURE__ */ jsx22("p", { className: "text-sm text-muted-foreground break-words", children: user.email })
3499
+ /* @__PURE__ */ jsx23("h2", { className: "text-xl font-semibold break-words", children: displayName }),
3500
+ user?.email && /* @__PURE__ */ jsx23("p", { className: "text-sm text-muted-foreground break-words", children: user.email })
3583
3501
  ] })
3584
3502
  ] }),
3585
- /* @__PURE__ */ jsx22(Separator, {}),
3503
+ /* @__PURE__ */ jsx23(Separator, {}),
3586
3504
  /* @__PURE__ */ jsxs13("div", { className: "space-y-3", children: [
3587
- /* @__PURE__ */ jsx22("h3", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider", children: labels.basicInfo }),
3505
+ /* @__PURE__ */ jsx23("h3", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider", children: labels.basicInfo }),
3588
3506
  /* @__PURE__ */ jsxs13("div", { className: "space-y-2", children: [
3589
3507
  /* @__PURE__ */ jsxs13("div", { className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50", children: [
3590
- /* @__PURE__ */ jsx22(User2, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
3508
+ /* @__PURE__ */ jsx23(User2, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
3591
3509
  /* @__PURE__ */ jsxs13("div", { className: "flex-1 min-w-0", children: [
3592
- /* @__PURE__ */ jsx22("p", { className: "text-xs text-muted-foreground", children: "Name" }),
3593
- /* @__PURE__ */ jsx22("p", { className: "text-sm font-medium break-words", children: displayName })
3510
+ /* @__PURE__ */ jsx23("p", { className: "text-xs text-muted-foreground", children: "Name" }),
3511
+ /* @__PURE__ */ jsx23("p", { className: "text-sm font-medium break-words", children: displayName })
3594
3512
  ] })
3595
3513
  ] }),
3596
3514
  user?.email && /* @__PURE__ */ jsxs13("div", { className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50", children: [
3597
- /* @__PURE__ */ jsx22(AtSign, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
3515
+ /* @__PURE__ */ jsx23(AtSign, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
3598
3516
  /* @__PURE__ */ jsxs13("div", { className: "flex-1 min-w-0", children: [
3599
- /* @__PURE__ */ jsx22("p", { className: "text-xs text-muted-foreground", children: "Handle" }),
3600
- /* @__PURE__ */ jsx22("p", { className: "text-sm font-medium break-words", children: user.email })
3517
+ /* @__PURE__ */ jsx23("p", { className: "text-xs text-muted-foreground", children: "Handle" }),
3518
+ /* @__PURE__ */ jsx23("p", { className: "text-sm font-medium break-words", children: user.email })
3601
3519
  ] })
3602
3520
  ] }),
3603
3521
  user?.id && user.id !== user?.name && user.id !== user?.email && /* @__PURE__ */ jsxs13("div", { className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50", children: [
3604
- /* @__PURE__ */ jsx22(User2, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
3522
+ /* @__PURE__ */ jsx23(User2, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
3605
3523
  /* @__PURE__ */ jsxs13("div", { className: "flex-1 min-w-0", children: [
3606
- /* @__PURE__ */ jsx22("p", { className: "text-xs text-muted-foreground", children: "ID" }),
3607
- /* @__PURE__ */ jsx22("p", { className: "text-sm font-medium break-words", children: user.id })
3524
+ /* @__PURE__ */ jsx23("p", { className: "text-xs text-muted-foreground", children: "ID" }),
3525
+ /* @__PURE__ */ jsx23("p", { className: "text-sm font-medium break-words", children: user.id })
3608
3526
  ] })
3609
3527
  ] })
3610
3528
  ] })
3611
3529
  ] }),
3612
3530
  normalizedFields.length > 0 && /* @__PURE__ */ jsxs13(Fragment5, { children: [
3613
- /* @__PURE__ */ jsx22(Separator, {}),
3531
+ /* @__PURE__ */ jsx23(Separator, {}),
3614
3532
  /* @__PURE__ */ jsxs13("div", { className: "space-y-3", children: [
3615
- /* @__PURE__ */ jsx22("h3", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider", children: labels.customFields }),
3616
- /* @__PURE__ */ jsx22("div", { className: "space-y-2", children: normalizedFields.map((field) => {
3533
+ /* @__PURE__ */ jsx23("h3", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider", children: labels.customFields }),
3534
+ /* @__PURE__ */ jsx23("div", { className: "space-y-2", children: normalizedFields.map((field) => {
3617
3535
  const isBioField = field.key.toLowerCase().includes("bio");
3618
3536
  return /* @__PURE__ */ jsxs13(
3619
3537
  "div",
3620
3538
  {
3621
3539
  className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50",
3622
3540
  children: [
3623
- /* @__PURE__ */ jsx22("div", { className: "mt-0.5 shrink-0", children: field.icon || getFieldIcon(field.type, field.key) }),
3541
+ /* @__PURE__ */ jsx23("div", { className: "mt-0.5 shrink-0", children: field.icon || getFieldIcon(field.type, field.key) }),
3624
3542
  /* @__PURE__ */ jsxs13("div", { className: "flex-1 min-w-0", children: [
3625
- /* @__PURE__ */ jsx22("p", { className: "text-xs text-muted-foreground", children: field.label }),
3626
- /* @__PURE__ */ jsx22("p", { className: cn(
3543
+ /* @__PURE__ */ jsx23("p", { className: "text-xs text-muted-foreground", children: field.label }),
3544
+ /* @__PURE__ */ jsx23("p", { className: cn(
3627
3545
  "text-sm font-medium",
3628
3546
  isBioField ? "whitespace-pre-wrap break-words" : "break-words"
3629
3547
  ), children: formatValue(field.value, field.type, field.key) })
@@ -3635,26 +3553,26 @@ var UserProfile = ({
3635
3553
  }) })
3636
3554
  ] })
3637
3555
  ] }),
3638
- /* @__PURE__ */ jsx22(Separator, {}),
3556
+ /* @__PURE__ */ jsx23(Separator, {}),
3639
3557
  /* @__PURE__ */ jsxs13("div", { className: "space-y-3", children: [
3640
3558
  /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between", children: [
3641
3559
  /* @__PURE__ */ jsxs13("h3", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider flex items-center gap-2", children: [
3642
- /* @__PURE__ */ jsx22(Brain, { className: "h-4 w-4" }),
3560
+ /* @__PURE__ */ jsx23(Brain, { className: "h-4 w-4" }),
3643
3561
  labels.memories
3644
3562
  ] }),
3645
- onAddMemory && /* @__PURE__ */ jsx22(
3563
+ onAddMemory && /* @__PURE__ */ jsx23(
3646
3564
  Button,
3647
3565
  {
3648
3566
  variant: "ghost",
3649
3567
  size: "sm",
3650
3568
  className: "h-7 px-2",
3651
3569
  onClick: () => setIsAddingMemory(true),
3652
- children: /* @__PURE__ */ jsx22(Plus3, { className: "h-4 w-4" })
3570
+ children: /* @__PURE__ */ jsx23(Plus3, { className: "h-4 w-4" })
3653
3571
  }
3654
3572
  )
3655
3573
  ] }),
3656
3574
  isAddingMemory && onAddMemory && /* @__PURE__ */ jsxs13("div", { className: "flex gap-2", children: [
3657
- /* @__PURE__ */ jsx22(
3575
+ /* @__PURE__ */ jsx23(
3658
3576
  Input,
3659
3577
  {
3660
3578
  value: newMemoryContent,
@@ -3671,24 +3589,24 @@ var UserProfile = ({
3671
3589
  autoFocus: true
3672
3590
  }
3673
3591
  ),
3674
- /* @__PURE__ */ jsx22(Button, { size: "sm", onClick: handleAddMemory, disabled: !newMemoryContent.trim(), children: "Salvar" })
3592
+ /* @__PURE__ */ jsx23(Button, { size: "sm", onClick: handleAddMemory, disabled: !newMemoryContent.trim(), children: "Salvar" })
3675
3593
  ] }),
3676
- /* @__PURE__ */ jsx22("div", { className: "space-y-2", children: memories.length === 0 ? /* @__PURE__ */ jsx22("p", { className: "text-sm text-muted-foreground text-center py-4", children: labels.noMemories }) : memories.map((memory) => {
3594
+ /* @__PURE__ */ jsx23("div", { className: "space-y-2", children: memories.length === 0 ? /* @__PURE__ */ jsx23("p", { className: "text-sm text-muted-foreground text-center py-4", children: labels.noMemories }) : memories.map((memory) => {
3677
3595
  const isEditing = editingMemoryId === memory.id;
3678
3596
  return /* @__PURE__ */ jsxs13(
3679
3597
  "div",
3680
3598
  {
3681
3599
  className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50 group",
3682
3600
  children: [
3683
- /* @__PURE__ */ jsx22("div", { className: "mt-0.5 shrink-0", children: memory.source === "agent" ? /* @__PURE__ */ jsx22(Bot3, { className: "h-4 w-4 text-primary" }) : getMemoryCategoryIcon(memory.category) }),
3601
+ /* @__PURE__ */ jsx23("div", { className: "mt-0.5 shrink-0", children: memory.source === "agent" ? /* @__PURE__ */ jsx23(Bot3, { className: "h-4 w-4 text-primary" }) : getMemoryCategoryIcon(memory.category) }),
3684
3602
  /* @__PURE__ */ jsxs13("div", { className: "flex-1 min-w-0", children: [
3685
3603
  /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2 mb-0.5", children: [
3686
- /* @__PURE__ */ jsx22("span", { className: "text-xs text-muted-foreground", children: getMemoryCategoryLabel(memory.category) }),
3687
- /* @__PURE__ */ jsx22("span", { className: "text-xs text-muted-foreground", children: "\u2022" }),
3688
- /* @__PURE__ */ jsx22("span", { className: "text-xs text-muted-foreground", children: memory.source === "agent" ? "IA" : "Voc\xEA" })
3604
+ /* @__PURE__ */ jsx23("span", { className: "text-xs text-muted-foreground", children: getMemoryCategoryLabel(memory.category) }),
3605
+ /* @__PURE__ */ jsx23("span", { className: "text-xs text-muted-foreground", children: "\u2022" }),
3606
+ /* @__PURE__ */ jsx23("span", { className: "text-xs text-muted-foreground", children: memory.source === "agent" ? "IA" : "Voc\xEA" })
3689
3607
  ] }),
3690
3608
  isEditing ? /* @__PURE__ */ jsxs13("div", { className: "space-y-2", children: [
3691
- /* @__PURE__ */ jsx22(
3609
+ /* @__PURE__ */ jsx23(
3692
3610
  Textarea,
3693
3611
  {
3694
3612
  value: editingMemoryContent,
@@ -3714,7 +3632,7 @@ var UserProfile = ({
3714
3632
  className: "h-7 px-2",
3715
3633
  onClick: handleCancelEdit,
3716
3634
  children: [
3717
- /* @__PURE__ */ jsx22(X3, { className: "h-3.5 w-3.5 mr-1" }),
3635
+ /* @__PURE__ */ jsx23(X3, { className: "h-3.5 w-3.5 mr-1" }),
3718
3636
  "Cancelar"
3719
3637
  ]
3720
3638
  }
@@ -3727,33 +3645,33 @@ var UserProfile = ({
3727
3645
  onClick: handleSaveEdit,
3728
3646
  disabled: !editingMemoryContent.trim(),
3729
3647
  children: [
3730
- /* @__PURE__ */ jsx22(Check3, { className: "h-3.5 w-3.5 mr-1" }),
3648
+ /* @__PURE__ */ jsx23(Check3, { className: "h-3.5 w-3.5 mr-1" }),
3731
3649
  "Salvar"
3732
3650
  ]
3733
3651
  }
3734
3652
  )
3735
3653
  ] })
3736
- ] }) : /* @__PURE__ */ jsx22("p", { className: "text-sm break-words", children: memory.content })
3654
+ ] }) : /* @__PURE__ */ jsx23("p", { className: "text-sm break-words", children: memory.content })
3737
3655
  ] }),
3738
3656
  !isEditing && (onUpdateMemory || onDeleteMemory) && /* @__PURE__ */ jsxs13("div", { className: "flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity shrink-0", children: [
3739
- onUpdateMemory && /* @__PURE__ */ jsx22(
3657
+ onUpdateMemory && /* @__PURE__ */ jsx23(
3740
3658
  Button,
3741
3659
  {
3742
3660
  variant: "ghost",
3743
3661
  size: "icon",
3744
3662
  className: "h-7 w-7",
3745
3663
  onClick: () => handleStartEdit(memory),
3746
- children: /* @__PURE__ */ jsx22(Pencil, { className: "h-3.5 w-3.5 text-muted-foreground" })
3664
+ children: /* @__PURE__ */ jsx23(Pencil, { className: "h-3.5 w-3.5 text-muted-foreground" })
3747
3665
  }
3748
3666
  ),
3749
- onDeleteMemory && /* @__PURE__ */ jsx22(
3667
+ onDeleteMemory && /* @__PURE__ */ jsx23(
3750
3668
  Button,
3751
3669
  {
3752
3670
  variant: "ghost",
3753
3671
  size: "icon",
3754
3672
  className: "h-7 w-7",
3755
3673
  onClick: () => onDeleteMemory(memory.id),
3756
- children: /* @__PURE__ */ jsx22(Trash23, { className: "h-3.5 w-3.5 text-destructive" })
3674
+ children: /* @__PURE__ */ jsx23(Trash23, { className: "h-3.5 w-3.5 text-destructive" })
3757
3675
  }
3758
3676
  )
3759
3677
  ] })
@@ -3765,7 +3683,7 @@ var UserProfile = ({
3765
3683
  ] })
3766
3684
  ] }) }),
3767
3685
  /* @__PURE__ */ jsxs13("div", { className: "p-4 border-t space-y-2 shrink-0", children: [
3768
- onEditProfile && /* @__PURE__ */ jsx22(
3686
+ onEditProfile && /* @__PURE__ */ jsx23(
3769
3687
  Button,
3770
3688
  {
3771
3689
  variant: "outline",
@@ -3774,7 +3692,7 @@ var UserProfile = ({
3774
3692
  children: "Edit Profile"
3775
3693
  }
3776
3694
  ),
3777
- onLogout && /* @__PURE__ */ jsx22(
3695
+ onLogout && /* @__PURE__ */ jsx23(
3778
3696
  Button,
3779
3697
  {
3780
3698
  variant: "destructive",
@@ -3791,7 +3709,7 @@ var UserProfile = ({
3791
3709
 
3792
3710
  // src/components/chat/ChatUI.tsx
3793
3711
  import { Sparkles, ArrowRight, MessageSquare, Lightbulb as Lightbulb2, Zap, HelpCircle } from "lucide-react";
3794
- import { jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
3712
+ import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs14 } from "react/jsx-runtime";
3795
3713
  var ChatUI = ({
3796
3714
  messages = [],
3797
3715
  threads = [],
@@ -3799,6 +3717,7 @@ var ChatUI = ({
3799
3717
  config: userConfig,
3800
3718
  sidebar: _sidebar,
3801
3719
  isGenerating = false,
3720
+ isMessagesLoading = false,
3802
3721
  callbacks = {},
3803
3722
  user,
3804
3723
  assistant,
@@ -3814,7 +3733,10 @@ var ChatUI = ({
3814
3733
  initialInput,
3815
3734
  onInitialInputConsumed
3816
3735
  }) => {
3817
- const config = mergeConfig(defaultChatConfig, userConfig);
3736
+ const config = useMemo3(
3737
+ () => mergeConfig(defaultChatConfig, userConfig),
3738
+ [userConfig]
3739
+ );
3818
3740
  const [isMobile, setIsMobile] = useState8(false);
3819
3741
  const [isUserProfileOpen, setIsUserProfileOpen] = useState8(false);
3820
3742
  let userContext;
@@ -3980,11 +3902,11 @@ var ChatUI = ({
3980
3902
  if (messages.length > 0 || !suggestions.length) return null;
3981
3903
  return /* @__PURE__ */ jsxs14("div", { className: "flex flex-col items-center justify-center min-h-[60vh] py-8 px-4", children: [
3982
3904
  /* @__PURE__ */ jsxs14("div", { className: "text-center mb-8", children: [
3983
- /* @__PURE__ */ jsx23("div", { className: "inline-flex items-center justify-center w-14 h-14 rounded-2xl bg-gradient-to-br from-primary/20 to-primary/5 mb-4 shadow-sm", children: /* @__PURE__ */ jsx23(Sparkles, { className: "w-7 h-7 text-primary" }) }),
3984
- /* @__PURE__ */ jsx23("h2", { className: "text-xl font-semibold mb-2", children: config.branding.title }),
3985
- /* @__PURE__ */ jsx23("p", { className: "text-muted-foreground text-sm max-w-md", children: config.branding.subtitle })
3905
+ /* @__PURE__ */ jsx24("div", { className: "inline-flex items-center justify-center w-14 h-14 rounded-2xl bg-gradient-to-br from-primary/20 to-primary/5 mb-4 shadow-sm", children: /* @__PURE__ */ jsx24(Sparkles, { className: "w-7 h-7 text-primary" }) }),
3906
+ /* @__PURE__ */ jsx24("h2", { className: "text-xl font-semibold mb-2", children: config.branding.title }),
3907
+ /* @__PURE__ */ jsx24("p", { className: "text-muted-foreground text-sm max-w-md", children: config.branding.subtitle })
3986
3908
  ] }),
3987
- /* @__PURE__ */ jsx23("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 w-full max-w-2xl", children: suggestions.map((suggestion, index) => /* @__PURE__ */ jsxs14(
3909
+ /* @__PURE__ */ jsx24("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 w-full max-w-2xl", children: suggestions.map((suggestion, index) => /* @__PURE__ */ jsxs14(
3988
3910
  "button",
3989
3911
  {
3990
3912
  type: "button",
@@ -3993,10 +3915,10 @@ var ChatUI = ({
3993
3915
  children: [
3994
3916
  (() => {
3995
3917
  const IconComponent = SuggestionIconComponents[index % SuggestionIconComponents.length];
3996
- return /* @__PURE__ */ jsx23("div", { className: "flex items-center justify-center w-8 h-8 rounded-lg bg-primary/10 text-primary shrink-0 group-hover:bg-primary/15 transition-colors", children: /* @__PURE__ */ jsx23(IconComponent, { className: "h-4 w-4" }) });
3918
+ return /* @__PURE__ */ jsx24("div", { className: "flex items-center justify-center w-8 h-8 rounded-lg bg-primary/10 text-primary shrink-0 group-hover:bg-primary/15 transition-colors", children: /* @__PURE__ */ jsx24(IconComponent, { className: "h-4 w-4" }) });
3997
3919
  })(),
3998
- /* @__PURE__ */ jsx23("div", { className: "flex-1 min-w-0 pr-6", children: /* @__PURE__ */ jsx23("p", { className: "text-sm font-medium leading-snug line-clamp-2", children: suggestion }) }),
3999
- /* @__PURE__ */ jsx23(ArrowRight, { className: "absolute right-4 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity" })
3920
+ /* @__PURE__ */ jsx24("div", { className: "flex-1 min-w-0 pr-6", children: /* @__PURE__ */ jsx24("p", { className: "text-sm font-medium leading-snug line-clamp-2", children: suggestion }) }),
3921
+ /* @__PURE__ */ jsx24(ArrowRight, { className: "absolute right-4 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity" })
4000
3922
  ]
4001
3923
  },
4002
3924
  index
@@ -4006,25 +3928,100 @@ var ChatUI = ({
4006
3928
  const renderInlineSuggestions = (messageId) => {
4007
3929
  const items = messageSuggestions?.[messageId];
4008
3930
  if (!items || items.length === 0) return null;
4009
- return /* @__PURE__ */ jsx23("div", { className: "flex flex-wrap gap-2 mt-2 ml-11", children: items.map((suggestion, index) => /* @__PURE__ */ jsxs14(
3931
+ return /* @__PURE__ */ jsx24("div", { className: "flex flex-wrap gap-2 mt-2 ml-11", children: items.map((suggestion, index) => /* @__PURE__ */ jsxs14(
4010
3932
  "button",
4011
3933
  {
4012
3934
  type: "button",
4013
3935
  onClick: () => handleSendMessage(suggestion),
4014
3936
  className: "group inline-flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-full border border-border bg-background hover:bg-accent hover:border-accent-foreground/20 transition-all duration-150 text-foreground/80 hover:text-foreground",
4015
3937
  children: [
4016
- /* @__PURE__ */ jsx23(Sparkles, { className: "h-3 w-3 text-primary opacity-70 group-hover:opacity-100" }),
4017
- /* @__PURE__ */ jsx23("span", { className: "max-w-[200px] truncate", children: suggestion })
3938
+ /* @__PURE__ */ jsx24(Sparkles, { className: "h-3 w-3 text-primary opacity-70 group-hover:opacity-100" }),
3939
+ /* @__PURE__ */ jsx24("span", { className: "max-w-[200px] truncate", children: suggestion })
4018
3940
  ]
4019
3941
  },
4020
3942
  `${messageId}-suggestion-${index}`
4021
3943
  )) });
4022
3944
  };
3945
+ const renderMessageLoadingSkeleton = () => /* @__PURE__ */ jsx24("div", { className: "space-y-6 py-2", children: [0, 1, 2, 3].map((index) => {
3946
+ const isUserRow = index % 2 === 1;
3947
+ return /* @__PURE__ */ jsxs14(
3948
+ "div",
3949
+ {
3950
+ className: `flex gap-3 ${isUserRow ? "justify-end" : "justify-start"}`,
3951
+ children: [
3952
+ !isUserRow && /* @__PURE__ */ jsx24(Skeleton, { className: "h-8 w-8 rounded-full shrink-0" }),
3953
+ /* @__PURE__ */ jsxs14("div", { className: `space-y-2 ${isUserRow ? "w-[70%]" : "w-[75%]"}`, children: [
3954
+ /* @__PURE__ */ jsx24(Skeleton, { className: "h-4 w-24" }),
3955
+ /* @__PURE__ */ jsx24(Skeleton, { className: "h-4 w-full" }),
3956
+ /* @__PURE__ */ jsx24(Skeleton, { className: "h-4 w-[85%]" })
3957
+ ] }),
3958
+ isUserRow && /* @__PURE__ */ jsx24(Skeleton, { className: "h-8 w-8 rounded-full shrink-0" })
3959
+ ]
3960
+ },
3961
+ `message-skeleton-${index}`
3962
+ );
3963
+ }) });
3964
+ const renderedMessageList = useMemo3(() => {
3965
+ if (isMessagesLoading) return renderMessageLoadingSkeleton();
3966
+ return /* @__PURE__ */ jsxs14(Fragment6, { children: [
3967
+ renderSuggestions(),
3968
+ messages.map((message, index) => {
3969
+ const prevMessage = index > 0 ? messages[index - 1] : null;
3970
+ const isGrouped = prevMessage !== null && prevMessage.role === message.role;
3971
+ return /* @__PURE__ */ jsxs14("div", { className: isGrouped ? "space-y-1 -mt-2" : "space-y-2", children: [
3972
+ /* @__PURE__ */ jsx24(
3973
+ Message,
3974
+ {
3975
+ message,
3976
+ userAvatar: user?.avatar,
3977
+ userName: user?.name,
3978
+ assistantAvatar: assistant?.avatar,
3979
+ assistantName: assistant?.name,
3980
+ showTimestamp: config.ui.showTimestamps,
3981
+ showAvatar: config.ui.showAvatars,
3982
+ enableCopy: config.features.enableMessageCopy,
3983
+ enableEdit: config.features.enableMessageEditing,
3984
+ enableRegenerate: config.features.enableRegeneration,
3985
+ enableToolCallsDisplay: config.features.enableToolCallsDisplay,
3986
+ compactMode: config.ui.compactMode,
3987
+ onAction: handleMessageAction,
3988
+ toolUsedLabel: config.labels.toolUsed,
3989
+ thinkingLabel: config.labels.thinking,
3990
+ isGrouped
3991
+ }
3992
+ ),
3993
+ message.role === "assistant" && renderInlineSuggestions(message.id)
3994
+ ] }, message.id);
3995
+ })
3996
+ ] });
3997
+ }, [
3998
+ isMessagesLoading,
3999
+ messages,
4000
+ handleSendMessage,
4001
+ user?.avatar,
4002
+ user?.name,
4003
+ assistant?.avatar,
4004
+ assistant?.name,
4005
+ config.branding.title,
4006
+ config.branding.subtitle,
4007
+ config.ui.showTimestamps,
4008
+ config.ui.showAvatars,
4009
+ config.ui.compactMode,
4010
+ config.features.enableMessageCopy,
4011
+ config.features.enableMessageEditing,
4012
+ config.features.enableRegeneration,
4013
+ config.features.enableToolCallsDisplay,
4014
+ config.labels.toolUsed,
4015
+ config.labels.thinking,
4016
+ handleMessageAction,
4017
+ messageSuggestions,
4018
+ suggestions
4019
+ ]);
4023
4020
  const shouldShowAgentSelector = Boolean(
4024
4021
  config.agentSelector?.enabled && onSelectAgent && agentOptions.length > 0 && (!config.agentSelector?.hideIfSingle || agentOptions.length > 1)
4025
4022
  );
4026
- return /* @__PURE__ */ jsx23(TooltipProvider, { children: /* @__PURE__ */ jsx23(SidebarProvider, { defaultOpen: true, children: /* @__PURE__ */ jsxs14("div", { className: `flex h-[100svh] md:h-screen bg-background w-full overflow-hidden ${className}`, children: [
4027
- /* @__PURE__ */ jsx23(
4023
+ return /* @__PURE__ */ jsx24(TooltipProvider, { children: /* @__PURE__ */ jsx24(SidebarProvider, { defaultOpen: true, children: /* @__PURE__ */ jsxs14("div", { className: `flex h-[100svh] md:h-screen bg-background w-full overflow-hidden ${className}`, children: [
4024
+ /* @__PURE__ */ jsx24(
4028
4025
  Sidebar2,
4029
4026
  {
4030
4027
  threads,
@@ -4054,8 +4051,8 @@ var ChatUI = ({
4054
4051
  showThemeOptions: !!callbacks.onThemeChange
4055
4052
  }
4056
4053
  ),
4057
- /* @__PURE__ */ jsx23(SidebarInset, { children: /* @__PURE__ */ jsxs14("div", { className: "flex flex-col h-full min-h-0", children: [
4058
- /* @__PURE__ */ jsx23(
4054
+ /* @__PURE__ */ jsx24(SidebarInset, { children: /* @__PURE__ */ jsxs14("div", { className: "flex flex-col h-full min-h-0", children: [
4055
+ /* @__PURE__ */ jsx24(
4059
4056
  ChatHeader,
4060
4057
  {
4061
4058
  config,
@@ -4072,7 +4069,7 @@ var ChatUI = ({
4072
4069
  ),
4073
4070
  /* @__PURE__ */ jsxs14("div", { className: "flex flex-1 flex-row min-h-0 overflow-hidden", children: [
4074
4071
  /* @__PURE__ */ jsxs14("div", { className: "flex-1 flex flex-col min-h-0", children: [
4075
- /* @__PURE__ */ jsx23(
4072
+ /* @__PURE__ */ jsx24(
4076
4073
  ScrollArea,
4077
4074
  {
4078
4075
  ref: scrollAreaRef,
@@ -4080,40 +4077,12 @@ var ChatUI = ({
4080
4077
  viewportClassName: "p-4 overscroll-contain",
4081
4078
  onScrollCapture: handleScroll,
4082
4079
  children: /* @__PURE__ */ jsxs14("div", { className: "max-w-4xl mx-auto space-y-4 pb-4", children: [
4083
- renderSuggestions(),
4084
- messages.map((message, index) => {
4085
- const prevMessage = index > 0 ? messages[index - 1] : null;
4086
- const isGrouped = prevMessage !== null && prevMessage.role === message.role;
4087
- return /* @__PURE__ */ jsxs14("div", { className: isGrouped ? "space-y-1 -mt-2" : "space-y-2", children: [
4088
- /* @__PURE__ */ jsx23(
4089
- Message,
4090
- {
4091
- message,
4092
- userAvatar: user?.avatar,
4093
- userName: user?.name,
4094
- assistantAvatar: assistant?.avatar,
4095
- assistantName: assistant?.name,
4096
- showTimestamp: config.ui.showTimestamps,
4097
- showAvatar: config.ui.showAvatars,
4098
- enableCopy: config.features.enableMessageCopy,
4099
- enableEdit: config.features.enableMessageEditing,
4100
- enableRegenerate: config.features.enableRegeneration,
4101
- enableToolCallsDisplay: config.features.enableToolCallsDisplay,
4102
- compactMode: config.ui.compactMode,
4103
- onAction: handleMessageAction,
4104
- toolUsedLabel: config.labels.toolUsed,
4105
- thinkingLabel: config.labels.thinking,
4106
- isGrouped
4107
- }
4108
- ),
4109
- message.role === "assistant" && renderInlineSuggestions(message.id)
4110
- ] }, message.id);
4111
- }),
4112
- /* @__PURE__ */ jsx23("div", { ref: messagesEndRef })
4080
+ renderedMessageList,
4081
+ /* @__PURE__ */ jsx24("div", { ref: messagesEndRef })
4113
4082
  ] })
4114
4083
  }
4115
4084
  ),
4116
- /* @__PURE__ */ jsx23("div", { className: "bg-background pb-[env(safe-area-inset-bottom)]", children: /* @__PURE__ */ jsx23(
4085
+ /* @__PURE__ */ jsx24("div", { className: "bg-background pb-[env(safe-area-inset-bottom)]", children: /* @__PURE__ */ jsx24(
4117
4086
  ChatInput,
4118
4087
  {
4119
4088
  value: inputValue,
@@ -4139,17 +4108,17 @@ var ChatUI = ({
4139
4108
  }
4140
4109
  ) })
4141
4110
  ] }),
4142
- config?.customComponent?.component && !isMobile && /* @__PURE__ */ jsx23(
4111
+ config?.customComponent?.component && !isMobile && /* @__PURE__ */ jsx24(
4143
4112
  "div",
4144
4113
  {
4145
4114
  className: `h-full transition-all duration-300 ease-in-out overflow-hidden ${state.showSidebar ? "w-80" : "w-0"}`,
4146
- children: state.showSidebar && /* @__PURE__ */ jsx23("div", { className: "flex flex-col h-full border-l bg-background animate-in slide-in-from-right-4 duration-300 w-80", children: renderCustomComponent() })
4115
+ children: state.showSidebar && /* @__PURE__ */ jsx24("div", { className: "flex flex-col h-full border-l bg-background animate-in slide-in-from-right-4 duration-300 w-80", children: renderCustomComponent() })
4147
4116
  }
4148
4117
  )
4149
4118
  ] })
4150
4119
  ] }) }),
4151
4120
  isCustomMounted && config.customComponent?.component && isMobile && /* @__PURE__ */ jsxs14("div", { className: "fixed inset-0 z-50", children: [
4152
- /* @__PURE__ */ jsx23(
4121
+ /* @__PURE__ */ jsx24(
4153
4122
  "div",
4154
4123
  {
4155
4124
  className: `absolute inset-0 bg-background/80 backdrop-blur-sm transition-opacity duration-200 ease-out ${isCustomVisible ? "opacity-100" : "opacity-0"}`,
@@ -4157,16 +4126,16 @@ var ChatUI = ({
4157
4126
  onClick: closeSidebar
4158
4127
  }
4159
4128
  ),
4160
- /* @__PURE__ */ jsx23(
4129
+ /* @__PURE__ */ jsx24(
4161
4130
  "div",
4162
4131
  {
4163
4132
  className: `absolute top-0 right-0 h-full w-full bg-background transform-gpu transition-transform duration-200 ease-out ${isCustomVisible ? "translate-x-0" : "translate-x-full"}`,
4164
4133
  style: { willChange: "transform" },
4165
- children: /* @__PURE__ */ jsx23("div", { className: "h-full flex flex-col", children: renderCustomComponent() })
4134
+ children: /* @__PURE__ */ jsx24("div", { className: "h-full flex flex-col", children: renderCustomComponent() })
4166
4135
  }
4167
4136
  )
4168
4137
  ] }),
4169
- isUserProfileOpen && /* @__PURE__ */ jsx23(
4138
+ isUserProfileOpen && /* @__PURE__ */ jsx24(
4170
4139
  UserProfile,
4171
4140
  {
4172
4141
  isOpen: isUserProfileOpen,
@@ -4204,7 +4173,7 @@ import {
4204
4173
  X as X4,
4205
4174
  Check as Check4
4206
4175
  } from "lucide-react";
4207
- import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
4176
+ import { Fragment as Fragment7, jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
4208
4177
  var ThreadItem = ({ thread, isActive, config, onSelect, onRename, onDelete, onArchive }) => {
4209
4178
  const [isEditing, setIsEditing] = useState9(false);
4210
4179
  const [editTitle, setEditTitle] = useState9(thread.title);
@@ -4233,9 +4202,9 @@ var ThreadItem = ({ thread, isActive, config, onSelect, onRename, onDelete, onAr
4233
4202
  handleCancelEdit();
4234
4203
  }
4235
4204
  };
4236
- return /* @__PURE__ */ jsx24(Card, { className: `cursor-pointer transition-all duration-200 hover:shadow-md py-0 ${isActive ? "ring-2 ring-primary bg-primary/5" : "hover:bg-muted/50"}`, children: /* @__PURE__ */ jsx24(CardContent, { className: "p-3 max-w-sm", children: /* @__PURE__ */ jsxs15("div", { className: "flex items-start justify-between gap-2", children: [
4237
- /* @__PURE__ */ jsx24("div", { className: "flex-1 min-w-0", onClick: onSelect, children: isEditing ? /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
4238
- /* @__PURE__ */ jsx24(
4205
+ return /* @__PURE__ */ jsx25(Card, { className: `cursor-pointer transition-all duration-200 hover:shadow-md py-0 ${isActive ? "ring-2 ring-primary bg-primary/5" : "hover:bg-muted/50"}`, children: /* @__PURE__ */ jsx25(CardContent, { className: "p-3 max-w-sm", children: /* @__PURE__ */ jsxs15("div", { className: "flex items-start justify-between gap-2", children: [
4206
+ /* @__PURE__ */ jsx25("div", { className: "flex-1 min-w-0", onClick: onSelect, children: isEditing ? /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
4207
+ /* @__PURE__ */ jsx25(
4239
4208
  Input,
4240
4209
  {
4241
4210
  ref: inputRef,
@@ -4247,44 +4216,44 @@ var ThreadItem = ({ thread, isActive, config, onSelect, onRename, onDelete, onAr
4247
4216
  placeholder: config?.labels?.threadNamePlaceholder || "Conversation name"
4248
4217
  }
4249
4218
  ),
4250
- /* @__PURE__ */ jsx24(Button, { size: "sm", variant: "ghost", onClick: handleSaveEdit, children: /* @__PURE__ */ jsx24(Check4, { className: "h-3 w-3" }) }),
4251
- /* @__PURE__ */ jsx24(Button, { size: "sm", variant: "ghost", onClick: handleCancelEdit, children: /* @__PURE__ */ jsx24(X4, { className: "h-3 w-3" }) })
4252
- ] }) : /* @__PURE__ */ jsxs15(Fragment6, { children: [
4253
- /* @__PURE__ */ jsx24("h4", { className: "font-medium text-sm truncate mb-1", children: thread.title }),
4219
+ /* @__PURE__ */ jsx25(Button, { size: "sm", variant: "ghost", onClick: handleSaveEdit, children: /* @__PURE__ */ jsx25(Check4, { className: "h-3 w-3" }) }),
4220
+ /* @__PURE__ */ jsx25(Button, { size: "sm", variant: "ghost", onClick: handleCancelEdit, children: /* @__PURE__ */ jsx25(X4, { className: "h-3 w-3" }) })
4221
+ ] }) : /* @__PURE__ */ jsxs15(Fragment7, { children: [
4222
+ /* @__PURE__ */ jsx25("h4", { className: "font-medium text-sm truncate mb-1", children: thread.title }),
4254
4223
  /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
4255
4224
  /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1", children: [
4256
- /* @__PURE__ */ jsx24(Hash, { className: "h-3 w-3" }),
4225
+ /* @__PURE__ */ jsx25(Hash, { className: "h-3 w-3" }),
4257
4226
  thread.messageCount,
4258
4227
  " msgs"
4259
4228
  ] }),
4260
- /* @__PURE__ */ jsx24(Separator, { orientation: "vertical", className: "h-3" }),
4229
+ /* @__PURE__ */ jsx25(Separator, { orientation: "vertical", className: "h-3" }),
4261
4230
  /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1", children: [
4262
- /* @__PURE__ */ jsx24(Calendar2, { className: "h-3 w-3" }),
4231
+ /* @__PURE__ */ jsx25(Calendar2, { className: "h-3 w-3" }),
4263
4232
  formatDate(thread.updatedAt, config?.labels)
4264
4233
  ] }),
4265
- thread.isArchived && /* @__PURE__ */ jsxs15(Fragment6, { children: [
4266
- /* @__PURE__ */ jsx24(Separator, { orientation: "vertical", className: "h-3" }),
4234
+ thread.isArchived && /* @__PURE__ */ jsxs15(Fragment7, { children: [
4235
+ /* @__PURE__ */ jsx25(Separator, { orientation: "vertical", className: "h-3" }),
4267
4236
  /* @__PURE__ */ jsxs15(Badge, { variant: "secondary", className: "text-xs", children: [
4268
- /* @__PURE__ */ jsx24(Archive2, { className: "h-2 w-2 mr-1" }),
4237
+ /* @__PURE__ */ jsx25(Archive2, { className: "h-2 w-2 mr-1" }),
4269
4238
  config?.labels?.archiveThread || "Archived"
4270
4239
  ] })
4271
4240
  ] })
4272
4241
  ] })
4273
4242
  ] }) }),
4274
4243
  !isEditing && /* @__PURE__ */ jsxs15(DropdownMenu, { children: [
4275
- /* @__PURE__ */ jsx24(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx24(Button, { variant: "ghost", size: "icon", className: "h-6 w-6 m-auto", children: /* @__PURE__ */ jsx24(MoreVertical2, { className: "h-3 w-3" }) }) }),
4244
+ /* @__PURE__ */ jsx25(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx25(Button, { variant: "ghost", size: "icon", className: "h-6 w-6 m-auto", children: /* @__PURE__ */ jsx25(MoreVertical2, { className: "h-3 w-3" }) }) }),
4276
4245
  /* @__PURE__ */ jsxs15(DropdownMenuContent, { align: "end", children: [
4277
4246
  /* @__PURE__ */ jsxs15(DropdownMenuItem, { onClick: () => setIsEditing(true), children: [
4278
- /* @__PURE__ */ jsx24(Edit22, { className: "h-4 w-4 mr-2" }),
4247
+ /* @__PURE__ */ jsx25(Edit22, { className: "h-4 w-4 mr-2" }),
4279
4248
  config?.labels?.renameThread || "Rename"
4280
4249
  ] }),
4281
4250
  /* @__PURE__ */ jsxs15(DropdownMenuItem, { onClick: onArchive, children: [
4282
- /* @__PURE__ */ jsx24(Archive2, { className: "h-4 w-4 mr-2" }),
4251
+ /* @__PURE__ */ jsx25(Archive2, { className: "h-4 w-4 mr-2" }),
4283
4252
  thread.isArchived ? config?.labels?.unarchiveThread || "Unarchive" : config?.labels?.archiveThread || "Archive"
4284
4253
  ] }),
4285
- /* @__PURE__ */ jsx24(DropdownMenuSeparator, {}),
4254
+ /* @__PURE__ */ jsx25(DropdownMenuSeparator, {}),
4286
4255
  /* @__PURE__ */ jsxs15(DropdownMenuItem, { onClick: onDelete, className: "text-destructive", children: [
4287
- /* @__PURE__ */ jsx24(Trash24, { className: "h-4 w-4 mr-2" }),
4256
+ /* @__PURE__ */ jsx25(Trash24, { className: "h-4 w-4 mr-2" }),
4288
4257
  config?.labels?.deleteThread || "Delete"
4289
4258
  ] })
4290
4259
  ] })
@@ -4300,16 +4269,16 @@ var CreateThreadDialog2 = ({ onCreateThread, config }) => {
4300
4269
  setIsOpen(false);
4301
4270
  };
4302
4271
  return /* @__PURE__ */ jsxs15(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: [
4303
- /* @__PURE__ */ jsx24(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsxs15(Button, { variant: "outline", className: "w-full", children: [
4304
- /* @__PURE__ */ jsx24(Plus4, { className: "h-4 w-4 mr-2" }),
4272
+ /* @__PURE__ */ jsx25(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsxs15(Button, { variant: "outline", className: "w-full", children: [
4273
+ /* @__PURE__ */ jsx25(Plus4, { className: "h-4 w-4 mr-2" }),
4305
4274
  config?.labels?.createNewThread || "New Conversation"
4306
4275
  ] }) }),
4307
4276
  /* @__PURE__ */ jsxs15(DialogContent, { children: [
4308
4277
  /* @__PURE__ */ jsxs15(DialogHeader, { children: [
4309
- /* @__PURE__ */ jsx24(DialogTitle, { children: config?.labels?.createNewThread || "Create New Conversation" }),
4310
- /* @__PURE__ */ jsx24(DialogDescription, { children: "Give your new conversation a name or leave blank to auto-generate one." })
4278
+ /* @__PURE__ */ jsx25(DialogTitle, { children: config?.labels?.createNewThread || "Create New Conversation" }),
4279
+ /* @__PURE__ */ jsx25(DialogDescription, { children: "Give your new conversation a name or leave blank to auto-generate one." })
4311
4280
  ] }),
4312
- /* @__PURE__ */ jsx24(
4281
+ /* @__PURE__ */ jsx25(
4313
4282
  Input,
4314
4283
  {
4315
4284
  value: title,
@@ -4320,8 +4289,8 @@ var CreateThreadDialog2 = ({ onCreateThread, config }) => {
4320
4289
  }
4321
4290
  ),
4322
4291
  /* @__PURE__ */ jsxs15(DialogFooter, { children: [
4323
- /* @__PURE__ */ jsx24(Button, { variant: "outline", onClick: () => setIsOpen(false), children: config?.labels?.cancel || "Cancel" }),
4324
- /* @__PURE__ */ jsx24(Button, { onClick: handleCreate, children: config?.labels?.create || "Create" })
4292
+ /* @__PURE__ */ jsx25(Button, { variant: "outline", onClick: () => setIsOpen(false), children: config?.labels?.cancel || "Cancel" }),
4293
+ /* @__PURE__ */ jsx25(Button, { onClick: handleCreate, children: config?.labels?.create || "Create" })
4325
4294
  ] })
4326
4295
  ] })
4327
4296
  ] });
@@ -4375,20 +4344,20 @@ var ThreadManager = ({
4375
4344
  setDeleteThreadId(null);
4376
4345
  };
4377
4346
  if (!isOpen) return null;
4378
- return /* @__PURE__ */ jsx24(TooltipProvider, { children: /* @__PURE__ */ jsxs15("div", { className: `fixed inset-0 z-50 bg-background/80 backdrop-blur-sm ${className}`, children: [
4379
- /* @__PURE__ */ jsx24("div", { className: "fixed left-0 top-0 h-full w-full max-w-md border-r bg-background shadow-lg", children: /* @__PURE__ */ jsxs15(Card, { className: "h-full border-0 rounded-none", children: [
4347
+ return /* @__PURE__ */ jsx25(TooltipProvider, { children: /* @__PURE__ */ jsxs15("div", { className: `fixed inset-0 z-50 bg-background/80 backdrop-blur-sm ${className}`, children: [
4348
+ /* @__PURE__ */ jsx25("div", { className: "fixed left-0 top-0 h-full w-full max-w-md border-r bg-background shadow-lg", children: /* @__PURE__ */ jsxs15(Card, { className: "h-full border-0 rounded-none", children: [
4380
4349
  /* @__PURE__ */ jsxs15(CardHeader, { className: "border-b", children: [
4381
4350
  /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between", children: [
4382
4351
  /* @__PURE__ */ jsxs15(CardTitle, { className: "flex items-center gap-2", children: [
4383
- /* @__PURE__ */ jsx24(MessageSquare2, { className: "h-5 w-5" }),
4352
+ /* @__PURE__ */ jsx25(MessageSquare2, { className: "h-5 w-5" }),
4384
4353
  config?.labels?.newChat || "Conversations"
4385
4354
  ] }),
4386
- /* @__PURE__ */ jsx24(Button, { variant: "ghost", size: "icon", onClick: onClose, children: /* @__PURE__ */ jsx24(X4, { className: "h-4 w-4" }) })
4355
+ /* @__PURE__ */ jsx25(Button, { variant: "ghost", size: "icon", onClick: onClose, children: /* @__PURE__ */ jsx25(X4, { className: "h-4 w-4" }) })
4387
4356
  ] }),
4388
4357
  /* @__PURE__ */ jsxs15("div", { className: "space-y-3", children: [
4389
4358
  /* @__PURE__ */ jsxs15("div", { className: "relative", children: [
4390
- /* @__PURE__ */ jsx24(Search2, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
4391
- /* @__PURE__ */ jsx24(
4359
+ /* @__PURE__ */ jsx25(Search2, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
4360
+ /* @__PURE__ */ jsx25(
4392
4361
  Input,
4393
4362
  {
4394
4363
  placeholder: config?.labels?.search || "Search conversations...",
@@ -4407,7 +4376,7 @@ var ThreadManager = ({
4407
4376
  onClick: () => setShowArchived(!showArchived),
4408
4377
  className: "text-xs",
4409
4378
  children: [
4410
- /* @__PURE__ */ jsx24(Filter2, { className: "h-3 w-3 mr-1" }),
4379
+ /* @__PURE__ */ jsx25(Filter2, { className: "h-3 w-3 mr-1" }),
4411
4380
  showArchived ? config?.labels?.hideArchived || "Hide Archived" : config?.labels?.showArchived || "Show Archived"
4412
4381
  ]
4413
4382
  }
@@ -4421,13 +4390,13 @@ var ThreadManager = ({
4421
4390
  ] })
4422
4391
  ] }),
4423
4392
  /* @__PURE__ */ jsxs15(CardContent, { className: "p-0 flex-1", children: [
4424
- /* @__PURE__ */ jsx24("div", { className: "p-4", children: onCreateThread && /* @__PURE__ */ jsx24(CreateThreadDialog2, { onCreateThread, config }) }),
4425
- /* @__PURE__ */ jsx24(ScrollArea, { className: "h-[calc(100vh-280px)]", children: /* @__PURE__ */ jsx24("div", { className: "px-4 pb-4 space-y-4", children: Object.keys(groupedThreads).length === 0 ? /* @__PURE__ */ jsxs15("div", { className: "text-center py-8 text-muted-foreground", children: [
4426
- /* @__PURE__ */ jsx24(MessageSquare2, { className: "h-12 w-12 mx-auto mb-3 opacity-50" }),
4427
- /* @__PURE__ */ jsx24("p", { className: "text-sm", children: searchQuery ? config?.labels?.noThreadsFound || "No conversations found" : config?.labels?.noThreadsYet || "No conversations yet" })
4393
+ /* @__PURE__ */ jsx25("div", { className: "p-4", children: onCreateThread && /* @__PURE__ */ jsx25(CreateThreadDialog2, { onCreateThread, config }) }),
4394
+ /* @__PURE__ */ jsx25(ScrollArea, { className: "h-[calc(100vh-280px)]", children: /* @__PURE__ */ jsx25("div", { className: "px-4 pb-4 space-y-4", children: Object.keys(groupedThreads).length === 0 ? /* @__PURE__ */ jsxs15("div", { className: "text-center py-8 text-muted-foreground", children: [
4395
+ /* @__PURE__ */ jsx25(MessageSquare2, { className: "h-12 w-12 mx-auto mb-3 opacity-50" }),
4396
+ /* @__PURE__ */ jsx25("p", { className: "text-sm", children: searchQuery ? config?.labels?.noThreadsFound || "No conversations found" : config?.labels?.noThreadsYet || "No conversations yet" })
4428
4397
  ] }) : Object.entries(groupedThreads).map(([group, groupThreads]) => /* @__PURE__ */ jsxs15("div", { children: [
4429
- /* @__PURE__ */ jsx24("h3", { className: "text-sm font-medium text-muted-foreground mb-2 px-2", children: group }),
4430
- /* @__PURE__ */ jsx24("div", { className: "space-y-2", children: groupThreads.map((thread) => /* @__PURE__ */ jsx24(
4398
+ /* @__PURE__ */ jsx25("h3", { className: "text-sm font-medium text-muted-foreground mb-2 px-2", children: group }),
4399
+ /* @__PURE__ */ jsx25("div", { className: "space-y-2", children: groupThreads.map((thread) => /* @__PURE__ */ jsx25(
4431
4400
  ThreadItem,
4432
4401
  {
4433
4402
  thread,
@@ -4443,14 +4412,14 @@ var ThreadManager = ({
4443
4412
  ] }, group)) }) })
4444
4413
  ] })
4445
4414
  ] }) }),
4446
- deleteThreadId && /* @__PURE__ */ jsx24(AlertDialog, { open: !!deleteThreadId, onOpenChange: () => setDeleteThreadId(null), children: /* @__PURE__ */ jsxs15(AlertDialogContent, { children: [
4415
+ deleteThreadId && /* @__PURE__ */ jsx25(AlertDialog, { open: !!deleteThreadId, onOpenChange: () => setDeleteThreadId(null), children: /* @__PURE__ */ jsxs15(AlertDialogContent, { children: [
4447
4416
  /* @__PURE__ */ jsxs15(AlertDialogHeader, { children: [
4448
- /* @__PURE__ */ jsx24(AlertDialogTitle, { children: config?.labels?.deleteConfirmTitle || "Delete Conversation" }),
4449
- /* @__PURE__ */ jsx24(AlertDialogDescription, { children: config?.labels?.deleteConfirmDescription || "Are you sure you want to delete this conversation? This action cannot be undone." })
4417
+ /* @__PURE__ */ jsx25(AlertDialogTitle, { children: config?.labels?.deleteConfirmTitle || "Delete Conversation" }),
4418
+ /* @__PURE__ */ jsx25(AlertDialogDescription, { children: config?.labels?.deleteConfirmDescription || "Are you sure you want to delete this conversation? This action cannot be undone." })
4450
4419
  ] }),
4451
4420
  /* @__PURE__ */ jsxs15(AlertDialogFooter, { children: [
4452
- /* @__PURE__ */ jsx24(AlertDialogCancel, { children: config?.labels?.cancel || "Cancel" }),
4453
- /* @__PURE__ */ jsx24(
4421
+ /* @__PURE__ */ jsx25(AlertDialogCancel, { children: config?.labels?.cancel || "Cancel" }),
4422
+ /* @__PURE__ */ jsx25(
4454
4423
  AlertDialogAction,
4455
4424
  {
4456
4425
  onClick: () => deleteThreadId && handleDeleteThread(deleteThreadId),