@burtson-labs/bandit-engine 2.0.155 → 2.0.156
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/{chat-W5E6FD2Z.mjs → chat-HM563VOV.mjs} +4 -4
- package/dist/{chunk-HQZXTOOK.mjs → chunk-2X3ZTDUW.mjs} +3 -3
- package/dist/{chunk-HQZXTOOK.mjs.map → chunk-2X3ZTDUW.mjs.map} +1 -1
- package/dist/{chunk-6JTXYVOW.mjs → chunk-7HC6ONWM.mjs} +6 -6
- package/dist/chunk-7HC6ONWM.mjs.map +1 -0
- package/dist/{chunk-YWCROXF2.mjs → chunk-F5JS4W2K.mjs} +14 -21
- package/dist/chunk-F5JS4W2K.mjs.map +1 -0
- package/dist/{chunk-NTG4V34T.mjs → chunk-GZDJNVAS.mjs} +4 -89
- package/dist/chunk-GZDJNVAS.mjs.map +1 -0
- package/dist/{chunk-XONVE5DJ.mjs → chunk-R45DM35B.mjs} +2 -2
- package/dist/index.js +950 -950
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/dist/management/management.js +942 -942
- package/dist/management/management.js.map +1 -1
- package/dist/management/management.mjs +4 -4
- package/dist/modals/chat-modal/chat-modal.js +348 -348
- package/dist/modals/chat-modal/chat-modal.js.map +1 -1
- package/dist/modals/chat-modal/chat-modal.mjs +2 -2
- package/package.json +5 -5
- package/dist/chunk-6JTXYVOW.mjs.map +0 -1
- package/dist/chunk-NTG4V34T.mjs.map +0 -1
- package/dist/chunk-YWCROXF2.mjs.map +0 -1
- /package/dist/{chat-W5E6FD2Z.mjs.map → chat-HM563VOV.mjs.map} +0 -0
- /package/dist/{chunk-XONVE5DJ.mjs.map → chunk-R45DM35B.mjs.map} +0 -0
|
@@ -4537,7 +4537,7 @@ __export(chat_modal_exports, {
|
|
|
4537
4537
|
default: () => chat_modal_default
|
|
4538
4538
|
});
|
|
4539
4539
|
module.exports = __toCommonJS(chat_modal_exports);
|
|
4540
|
-
var
|
|
4540
|
+
var import_react27 = require("react");
|
|
4541
4541
|
var import_material18 = require("@mui/material");
|
|
4542
4542
|
var import_react_router_dom = require("react-router-dom");
|
|
4543
4543
|
|
|
@@ -4628,13 +4628,13 @@ var DraggableBox = import_react.default.forwardRef(
|
|
|
4628
4628
|
var draggable_box_default = DraggableBox;
|
|
4629
4629
|
|
|
4630
4630
|
// src/modals/chat-modal/modal-header.tsx
|
|
4631
|
-
var
|
|
4631
|
+
var import_react4 = require("react");
|
|
4632
4632
|
var import_material3 = require("@mui/material");
|
|
4633
4633
|
|
|
4634
4634
|
// src/icons/lucide-icons.tsx
|
|
4635
4635
|
var import_react2 = __toESM(require("react"));
|
|
4636
4636
|
var import_material2 = require("@mui/material");
|
|
4637
|
-
var
|
|
4637
|
+
var import_react3 = require("@burtson-labs/icons/react");
|
|
4638
4638
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
4639
4639
|
var fontSizeMap = {
|
|
4640
4640
|
inherit: "inherit",
|
|
@@ -4702,107 +4702,107 @@ var createMuiLucideIcon = (Icon) => {
|
|
|
4702
4702
|
MuiLucideIcon.displayName = `${Icon.displayName ?? Icon.name ?? "Lucide"}MuiIcon`;
|
|
4703
4703
|
return MuiLucideIcon;
|
|
4704
4704
|
};
|
|
4705
|
-
var AddIcon = createMuiLucideIcon(
|
|
4706
|
-
var GhostIcon = createMuiLucideIcon(
|
|
4707
|
-
var PanelLeftIcon = createMuiLucideIcon(
|
|
4708
|
-
var ComposeIcon = createMuiLucideIcon(
|
|
4709
|
-
var CloudDoneIcon = createMuiLucideIcon(
|
|
4710
|
-
var CloudOffIcon = createMuiLucideIcon(
|
|
4711
|
-
var ErrorOutlineIcon = createMuiLucideIcon(
|
|
4712
|
-
var HomeIcon = createMuiLucideIcon(
|
|
4713
|
-
var NotesIcon = createMuiLucideIcon(
|
|
4714
|
-
var NotesIconOutlined = createMuiLucideIcon(
|
|
4715
|
-
var RecordVoiceOverIcon = createMuiLucideIcon(
|
|
4716
|
-
var SettingsIcon = createMuiLucideIcon(
|
|
4717
|
-
var SyncIcon = createMuiLucideIcon(
|
|
4718
|
-
var ArrowUpwardIcon = createMuiLucideIcon(
|
|
4719
|
-
var CloseIcon = createMuiLucideIcon(
|
|
4720
|
-
var ExpandMoreIcon = createMuiLucideIcon(
|
|
4721
|
-
var FeedbackIcon = createMuiLucideIcon(
|
|
4722
|
-
var GraphicEqIcon = createMuiLucideIcon(
|
|
4723
|
-
var HearingDisabledIcon = createMuiLucideIcon(
|
|
4724
|
-
var PsychologyIcon = createMuiLucideIcon(
|
|
4725
|
-
var ArrowDownwardIcon = createMuiLucideIcon(
|
|
4726
|
-
var CheckCircleIcon = createMuiLucideIcon(
|
|
4727
|
-
var SignalWifi2BarIcon = createMuiLucideIcon(
|
|
4728
|
-
var SignalWifiStatusbar4BarIcon = createMuiLucideIcon(
|
|
4729
|
-
var WifiOffIcon = createMuiLucideIcon(
|
|
4730
|
-
var DeleteIcon = createMuiLucideIcon(
|
|
4731
|
-
var PushPinIcon = createMuiLucideIcon(
|
|
4732
|
-
var PushPinOutlinedIcon = createMuiLucideIcon(
|
|
4733
|
-
var CloudSyncIcon = createMuiLucideIcon(
|
|
4734
|
-
var RotateLeftIcon = createMuiLucideIcon(
|
|
4735
|
-
var RotateRightIcon = createMuiLucideIcon(
|
|
4736
|
-
var ZoomInIcon = createMuiLucideIcon(
|
|
4737
|
-
var ZoomOutIcon = createMuiLucideIcon(
|
|
4738
|
-
var WifiIcon = createMuiLucideIcon(
|
|
4739
|
-
var Crop169Icon = createMuiLucideIcon(
|
|
4740
|
-
var CropPortraitIcon = createMuiLucideIcon(
|
|
4741
|
-
var CropSquareIcon = createMuiLucideIcon(
|
|
4742
|
-
var ContentCopyIcon = createMuiLucideIcon(
|
|
4743
|
-
var FileUploadIcon = createMuiLucideIcon(
|
|
4744
|
-
var PreviewIcon = createMuiLucideIcon(
|
|
4745
|
-
var RestoreIcon = createMuiLucideIcon(
|
|
4746
|
-
var SaveIcon = createMuiLucideIcon(
|
|
4747
|
-
var UploadIcon = createMuiLucideIcon(
|
|
4748
|
-
var AutoAwesomeIcon = createMuiLucideIcon(
|
|
4749
|
-
var AutoStoriesIcon = createMuiLucideIcon(
|
|
4750
|
-
var DescriptionIcon = createMuiLucideIcon(
|
|
4751
|
-
var ArticleIcon = createMuiLucideIcon(
|
|
4752
|
-
var CheckIcon = createMuiLucideIcon(
|
|
4753
|
-
var CodeIcon = createMuiLucideIcon(
|
|
4754
|
-
var DataObjectIcon = createMuiLucideIcon(
|
|
4755
|
-
var DownloadIcon = createMuiLucideIcon(
|
|
4756
|
-
var ErrorIcon = createMuiLucideIcon(
|
|
4757
|
-
var FolderIcon = createMuiLucideIcon(
|
|
4758
|
-
var GroupIcon = createMuiLucideIcon(
|
|
4759
|
-
var LockIcon = createMuiLucideIcon(
|
|
4760
|
-
var PersonIcon = createMuiLucideIcon(
|
|
4761
|
-
var PictureAsPdfIcon = createMuiLucideIcon(
|
|
4762
|
-
var PublicIcon = createMuiLucideIcon(
|
|
4763
|
-
var SearchIcon = createMuiLucideIcon(
|
|
4764
|
-
var UploadFileIcon = createMuiLucideIcon(
|
|
4765
|
-
var ViewListIcon = createMuiLucideIcon(
|
|
4766
|
-
var ViewModuleIcon = createMuiLucideIcon(
|
|
4767
|
-
var AddCircleIcon = createMuiLucideIcon(
|
|
4768
|
-
var EditIcon = createMuiLucideIcon(
|
|
4769
|
-
var PlayArrowIcon = createMuiLucideIcon(
|
|
4770
|
-
var VisibilityIcon = createMuiLucideIcon(
|
|
4771
|
-
var HealthAndSafetyIcon = createMuiLucideIcon(
|
|
4772
|
-
var RefreshIcon = createMuiLucideIcon(
|
|
4773
|
-
var EditNoteOutlinedIcon = createMuiLucideIcon(
|
|
4774
|
-
var ManageAccountsOutlinedIcon = createMuiLucideIcon(
|
|
4775
|
-
var PlayArrowRoundedIcon = createMuiLucideIcon(
|
|
4776
|
-
var RocketLaunchOutlinedIcon = createMuiLucideIcon(
|
|
4777
|
-
var ViewModuleOutlinedIcon = createMuiLucideIcon(
|
|
4778
|
-
var LinkIcon = createMuiLucideIcon(
|
|
4779
|
-
var ArchiveIcon = createMuiLucideIcon(
|
|
4780
|
-
var FolderOpenIcon = createMuiLucideIcon(
|
|
4781
|
-
var PublishIcon = createMuiLucideIcon(
|
|
4782
|
-
var ChatIcon = createMuiLucideIcon(
|
|
4783
|
-
var CleaningServicesIcon = createMuiLucideIcon(
|
|
4784
|
-
var InfoIcon = createMuiLucideIcon(
|
|
4785
|
-
var WarningIcon = createMuiLucideIcon(
|
|
4786
|
-
var BrushIcon = createMuiLucideIcon(
|
|
4787
|
-
var BuildIcon = createMuiLucideIcon(
|
|
4788
|
-
var ChevronLeftIcon = createMuiLucideIcon(
|
|
4789
|
-
var CloudIcon = createMuiLucideIcon(
|
|
4790
|
-
var FaceRetouchingNaturalIcon = createMuiLucideIcon(
|
|
4791
|
-
var MenuBookIcon = createMuiLucideIcon(
|
|
4792
|
-
var StorageIcon = createMuiLucideIcon(
|
|
4793
|
-
var TuneIcon = createMuiLucideIcon(
|
|
4794
|
-
var SendIcon = createMuiLucideIcon(
|
|
4795
|
-
var ExpandLessIcon = createMuiLucideIcon(
|
|
4796
|
-
var HistoryIcon = createMuiLucideIcon(
|
|
4797
|
-
var InfoOutlinedIcon = createMuiLucideIcon(
|
|
4798
|
-
var MemoryIcon = createMuiLucideIcon(
|
|
4799
|
-
var FullscreenIcon = createMuiLucideIcon(
|
|
4800
|
-
var FullscreenExitIcon = createMuiLucideIcon(
|
|
4801
|
-
var MinimizeIcon = createMuiLucideIcon(
|
|
4802
|
-
var DragIndicatorIcon = createMuiLucideIcon(
|
|
4803
|
-
var MicIcon = createMuiLucideIcon(
|
|
4804
|
-
var TextFieldsIcon = createMuiLucideIcon(
|
|
4805
|
-
var TriangleAlertIcon = createMuiLucideIcon(
|
|
4705
|
+
var AddIcon = createMuiLucideIcon(import_react3.Plus);
|
|
4706
|
+
var GhostIcon = createMuiLucideIcon(import_react3.Ghost);
|
|
4707
|
+
var PanelLeftIcon = createMuiLucideIcon(import_react3.PanelLeft);
|
|
4708
|
+
var ComposeIcon = createMuiLucideIcon(import_react3.EditSquare);
|
|
4709
|
+
var CloudDoneIcon = createMuiLucideIcon(import_react3.CloudCheck);
|
|
4710
|
+
var CloudOffIcon = createMuiLucideIcon(import_react3.CloudOff);
|
|
4711
|
+
var ErrorOutlineIcon = createMuiLucideIcon(import_react3.AlertCircle);
|
|
4712
|
+
var HomeIcon = createMuiLucideIcon(import_react3.Home);
|
|
4713
|
+
var NotesIcon = createMuiLucideIcon(import_react3.NotebookPen);
|
|
4714
|
+
var NotesIconOutlined = createMuiLucideIcon(import_react3.NotebookPen);
|
|
4715
|
+
var RecordVoiceOverIcon = createMuiLucideIcon(import_react3.Mic);
|
|
4716
|
+
var SettingsIcon = createMuiLucideIcon(import_react3.Settings);
|
|
4717
|
+
var SyncIcon = createMuiLucideIcon(import_react3.Refresh);
|
|
4718
|
+
var ArrowUpwardIcon = createMuiLucideIcon(import_react3.ArrowUp);
|
|
4719
|
+
var CloseIcon = createMuiLucideIcon(import_react3.X);
|
|
4720
|
+
var ExpandMoreIcon = createMuiLucideIcon(import_react3.ChevronDown);
|
|
4721
|
+
var FeedbackIcon = createMuiLucideIcon(import_react3.MessageSquare);
|
|
4722
|
+
var GraphicEqIcon = createMuiLucideIcon(import_react3.Waveform);
|
|
4723
|
+
var HearingDisabledIcon = createMuiLucideIcon(import_react3.EarOff);
|
|
4724
|
+
var PsychologyIcon = createMuiLucideIcon(import_react3.Agent);
|
|
4725
|
+
var ArrowDownwardIcon = createMuiLucideIcon(import_react3.ArrowDown);
|
|
4726
|
+
var CheckCircleIcon = createMuiLucideIcon(import_react3.CheckCircle);
|
|
4727
|
+
var SignalWifi2BarIcon = createMuiLucideIcon(import_react3.Wifi);
|
|
4728
|
+
var SignalWifiStatusbar4BarIcon = createMuiLucideIcon(import_react3.Wifi);
|
|
4729
|
+
var WifiOffIcon = createMuiLucideIcon(import_react3.WifiOff);
|
|
4730
|
+
var DeleteIcon = createMuiLucideIcon(import_react3.Trash);
|
|
4731
|
+
var PushPinIcon = createMuiLucideIcon(import_react3.Pin);
|
|
4732
|
+
var PushPinOutlinedIcon = createMuiLucideIcon(import_react3.PinOff);
|
|
4733
|
+
var CloudSyncIcon = createMuiLucideIcon(import_react3.Refresh);
|
|
4734
|
+
var RotateLeftIcon = createMuiLucideIcon(import_react3.RotateCcw);
|
|
4735
|
+
var RotateRightIcon = createMuiLucideIcon(import_react3.RotateCw);
|
|
4736
|
+
var ZoomInIcon = createMuiLucideIcon(import_react3.ZoomIn);
|
|
4737
|
+
var ZoomOutIcon = createMuiLucideIcon(import_react3.ZoomOut);
|
|
4738
|
+
var WifiIcon = createMuiLucideIcon(import_react3.Wifi);
|
|
4739
|
+
var Crop169Icon = createMuiLucideIcon(import_react3.RectangleHorizontal);
|
|
4740
|
+
var CropPortraitIcon = createMuiLucideIcon(import_react3.RectangleVertical);
|
|
4741
|
+
var CropSquareIcon = createMuiLucideIcon(import_react3.Square);
|
|
4742
|
+
var ContentCopyIcon = createMuiLucideIcon(import_react3.Copy);
|
|
4743
|
+
var FileUploadIcon = createMuiLucideIcon(import_react3.FileUp);
|
|
4744
|
+
var PreviewIcon = createMuiLucideIcon(import_react3.Eye);
|
|
4745
|
+
var RestoreIcon = createMuiLucideIcon(import_react3.RotateCcw);
|
|
4746
|
+
var SaveIcon = createMuiLucideIcon(import_react3.Save);
|
|
4747
|
+
var UploadIcon = createMuiLucideIcon(import_react3.Upload);
|
|
4748
|
+
var AutoAwesomeIcon = createMuiLucideIcon(import_react3.Sparkles);
|
|
4749
|
+
var AutoStoriesIcon = createMuiLucideIcon(import_react3.BookOpenText);
|
|
4750
|
+
var DescriptionIcon = createMuiLucideIcon(import_react3.FileText);
|
|
4751
|
+
var ArticleIcon = createMuiLucideIcon(import_react3.FileText);
|
|
4752
|
+
var CheckIcon = createMuiLucideIcon(import_react3.Check);
|
|
4753
|
+
var CodeIcon = createMuiLucideIcon(import_react3.Braces);
|
|
4754
|
+
var DataObjectIcon = createMuiLucideIcon(import_react3.Braces);
|
|
4755
|
+
var DownloadIcon = createMuiLucideIcon(import_react3.Download);
|
|
4756
|
+
var ErrorIcon = createMuiLucideIcon(import_react3.AlertCircle);
|
|
4757
|
+
var FolderIcon = createMuiLucideIcon(import_react3.Folder);
|
|
4758
|
+
var GroupIcon = createMuiLucideIcon(import_react3.Users);
|
|
4759
|
+
var LockIcon = createMuiLucideIcon(import_react3.Lock);
|
|
4760
|
+
var PersonIcon = createMuiLucideIcon(import_react3.User);
|
|
4761
|
+
var PictureAsPdfIcon = createMuiLucideIcon(import_react3.FileText);
|
|
4762
|
+
var PublicIcon = createMuiLucideIcon(import_react3.Globe);
|
|
4763
|
+
var SearchIcon = createMuiLucideIcon(import_react3.Search);
|
|
4764
|
+
var UploadFileIcon = createMuiLucideIcon(import_react3.FileUp);
|
|
4765
|
+
var ViewListIcon = createMuiLucideIcon(import_react3.List);
|
|
4766
|
+
var ViewModuleIcon = createMuiLucideIcon(import_react3.LayoutGrid);
|
|
4767
|
+
var AddCircleIcon = createMuiLucideIcon(import_react3.Plus);
|
|
4768
|
+
var EditIcon = createMuiLucideIcon(import_react3.Edit);
|
|
4769
|
+
var PlayArrowIcon = createMuiLucideIcon(import_react3.Play);
|
|
4770
|
+
var VisibilityIcon = createMuiLucideIcon(import_react3.Eye);
|
|
4771
|
+
var HealthAndSafetyIcon = createMuiLucideIcon(import_react3.ShieldProof);
|
|
4772
|
+
var RefreshIcon = createMuiLucideIcon(import_react3.Refresh);
|
|
4773
|
+
var EditNoteOutlinedIcon = createMuiLucideIcon(import_react3.NotebookPen);
|
|
4774
|
+
var ManageAccountsOutlinedIcon = createMuiLucideIcon(import_react3.UserCog);
|
|
4775
|
+
var PlayArrowRoundedIcon = createMuiLucideIcon(import_react3.Play);
|
|
4776
|
+
var RocketLaunchOutlinedIcon = createMuiLucideIcon(import_react3.Rocket);
|
|
4777
|
+
var ViewModuleOutlinedIcon = createMuiLucideIcon(import_react3.LayoutGrid);
|
|
4778
|
+
var LinkIcon = createMuiLucideIcon(import_react3.Link);
|
|
4779
|
+
var ArchiveIcon = createMuiLucideIcon(import_react3.Archive);
|
|
4780
|
+
var FolderOpenIcon = createMuiLucideIcon(import_react3.FolderOpen);
|
|
4781
|
+
var PublishIcon = createMuiLucideIcon(import_react3.Upload);
|
|
4782
|
+
var ChatIcon = createMuiLucideIcon(import_react3.MessageSquare);
|
|
4783
|
+
var CleaningServicesIcon = createMuiLucideIcon(import_react3.BrushCleaning);
|
|
4784
|
+
var InfoIcon = createMuiLucideIcon(import_react3.Info);
|
|
4785
|
+
var WarningIcon = createMuiLucideIcon(import_react3.AlertTriangle);
|
|
4786
|
+
var BrushIcon = createMuiLucideIcon(import_react3.Palette);
|
|
4787
|
+
var BuildIcon = createMuiLucideIcon(import_react3.Wrench);
|
|
4788
|
+
var ChevronLeftIcon = createMuiLucideIcon(import_react3.ChevronLeft);
|
|
4789
|
+
var CloudIcon = createMuiLucideIcon(import_react3.Cloud);
|
|
4790
|
+
var FaceRetouchingNaturalIcon = createMuiLucideIcon(import_react3.ScanFace);
|
|
4791
|
+
var MenuBookIcon = createMuiLucideIcon(import_react3.BookOpen);
|
|
4792
|
+
var StorageIcon = createMuiLucideIcon(import_react3.VectorStore);
|
|
4793
|
+
var TuneIcon = createMuiLucideIcon(import_react3.Sliders);
|
|
4794
|
+
var SendIcon = createMuiLucideIcon(import_react3.Send);
|
|
4795
|
+
var ExpandLessIcon = createMuiLucideIcon(import_react3.ChevronUp);
|
|
4796
|
+
var HistoryIcon = createMuiLucideIcon(import_react3.History);
|
|
4797
|
+
var InfoOutlinedIcon = createMuiLucideIcon(import_react3.Info);
|
|
4798
|
+
var MemoryIcon = createMuiLucideIcon(import_react3.Cpu);
|
|
4799
|
+
var FullscreenIcon = createMuiLucideIcon(import_react3.Maximize);
|
|
4800
|
+
var FullscreenExitIcon = createMuiLucideIcon(import_react3.Minimize);
|
|
4801
|
+
var MinimizeIcon = createMuiLucideIcon(import_react3.Minus);
|
|
4802
|
+
var DragIndicatorIcon = createMuiLucideIcon(import_react3.Grip);
|
|
4803
|
+
var MicIcon = createMuiLucideIcon(import_react3.Mic);
|
|
4804
|
+
var TextFieldsIcon = createMuiLucideIcon(import_react3.Type);
|
|
4805
|
+
var TriangleAlertIcon = createMuiLucideIcon(import_react3.AlertTriangle);
|
|
4806
4806
|
|
|
4807
4807
|
// src/modals/chat-modal/modal-header.tsx
|
|
4808
4808
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
@@ -4822,7 +4822,7 @@ var ModalHeader = ({
|
|
|
4822
4822
|
const theme = (0, import_material3.useTheme)();
|
|
4823
4823
|
const isMobile = (0, import_material3.useMediaQuery)((theme2) => theme2.breakpoints.down("sm"));
|
|
4824
4824
|
const displayLogo = logo && logo !== banditaiLogo ? logo : banditHead;
|
|
4825
|
-
const [isHovering, setIsHovering] = (0,
|
|
4825
|
+
const [isHovering, setIsHovering] = (0, import_react4.useState)(false);
|
|
4826
4826
|
const buttonStyles = {
|
|
4827
4827
|
transition: "all 0.15s ease-out",
|
|
4828
4828
|
borderRadius: "8px",
|
|
@@ -5020,7 +5020,7 @@ var ModalHeader = ({
|
|
|
5020
5020
|
var modal_header_default = ModalHeader;
|
|
5021
5021
|
|
|
5022
5022
|
// src/modals/chat-modal/query-input.tsx
|
|
5023
|
-
var
|
|
5023
|
+
var import_react5 = require("react");
|
|
5024
5024
|
var import_material4 = require("@mui/material");
|
|
5025
5025
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
5026
5026
|
var QueryInput = ({
|
|
@@ -5037,7 +5037,7 @@ var QueryInput = ({
|
|
|
5037
5037
|
// Destructure endAdornment
|
|
5038
5038
|
}) => {
|
|
5039
5039
|
const theme = (0, import_material4.useTheme)();
|
|
5040
|
-
const inputRef = (0,
|
|
5040
|
+
const inputRef = (0, import_react5.useRef)(null);
|
|
5041
5041
|
const handleSend = (e, payload) => {
|
|
5042
5042
|
onSend(e, payload);
|
|
5043
5043
|
};
|
|
@@ -5100,15 +5100,15 @@ var QueryInput = ({
|
|
|
5100
5100
|
var query_input_default = QueryInput;
|
|
5101
5101
|
|
|
5102
5102
|
// src/modals/chat-modal/ai-response-text-field.tsx
|
|
5103
|
-
var
|
|
5103
|
+
var import_react16 = __toESM(require("react"));
|
|
5104
5104
|
|
|
5105
5105
|
// src/shared/DocumentCard.tsx
|
|
5106
|
-
var
|
|
5106
|
+
var import_react10 = require("react");
|
|
5107
5107
|
var import_material5 = require("@mui/material");
|
|
5108
5108
|
init_debugLogger();
|
|
5109
5109
|
|
|
5110
5110
|
// src/chat/hooks/useKnowledgeStore.tsx
|
|
5111
|
-
var
|
|
5111
|
+
var import_react9 = require("react");
|
|
5112
5112
|
|
|
5113
5113
|
// src/store/knowledgeStore.ts
|
|
5114
5114
|
var import_zustand = require("zustand");
|
|
@@ -6751,7 +6751,7 @@ if (typeof window !== "undefined") {
|
|
|
6751
6751
|
}
|
|
6752
6752
|
|
|
6753
6753
|
// src/hooks/useVectorStore.tsx
|
|
6754
|
-
var
|
|
6754
|
+
var import_react8 = require("react");
|
|
6755
6755
|
init_debugLogger();
|
|
6756
6756
|
|
|
6757
6757
|
// src/services/vectorDatabase/vectorMigrationService.ts
|
|
@@ -7179,17 +7179,17 @@ init_authenticationStore();
|
|
|
7179
7179
|
init_packageSettingsStore();
|
|
7180
7180
|
|
|
7181
7181
|
// src/hooks/useFeatures.ts
|
|
7182
|
-
var
|
|
7182
|
+
var import_react7 = require("react");
|
|
7183
7183
|
|
|
7184
7184
|
// src/contexts/FeatureFlagContext.tsx
|
|
7185
|
-
var
|
|
7185
|
+
var import_react6 = require("react");
|
|
7186
7186
|
init_debugLogger();
|
|
7187
7187
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
7188
|
-
var FeatureFlagContext = (0,
|
|
7188
|
+
var FeatureFlagContext = (0, import_react6.createContext)(void 0);
|
|
7189
7189
|
|
|
7190
7190
|
// src/hooks/useFeatures.ts
|
|
7191
7191
|
var useFeatures = () => {
|
|
7192
|
-
const featureFlag = (0,
|
|
7192
|
+
const featureFlag = (0, import_react7.useContext)(FeatureFlagContext);
|
|
7193
7193
|
if (!featureFlag) {
|
|
7194
7194
|
return {
|
|
7195
7195
|
hasFeature: () => true,
|
|
@@ -9278,7 +9278,7 @@ var rawFileRecordToVectorDocument = (record) => {
|
|
|
9278
9278
|
};
|
|
9279
9279
|
};
|
|
9280
9280
|
var useVectorStore = () => {
|
|
9281
|
-
const [status, setStatus] = (0,
|
|
9281
|
+
const [status, setStatus] = (0, import_react8.useState)({
|
|
9282
9282
|
isEnabled: false,
|
|
9283
9283
|
isAvailable: false,
|
|
9284
9284
|
isMigrating: false,
|
|
@@ -9291,8 +9291,8 @@ var useVectorStore = () => {
|
|
|
9291
9291
|
const isAdvancedVectorFeaturesEnabled = useConversationSyncStore((state) => state.isAdvancedVectorFeaturesEnabled);
|
|
9292
9292
|
const hasAnyAdvancedFeatures = isAdvancedVectorFeaturesEnabled;
|
|
9293
9293
|
const hasVectorAccess = features.isAdmin() || features.hasAdvancedSearch() || features.hasAdvancedMemories();
|
|
9294
|
-
const [hasCompatibleProvider, setHasCompatibleProvider] = (0,
|
|
9295
|
-
const checkProviderCompatibility = (0,
|
|
9294
|
+
const [hasCompatibleProvider, setHasCompatibleProvider] = (0, import_react8.useState)(false);
|
|
9295
|
+
const checkProviderCompatibility = (0, import_react8.useCallback)(async () => {
|
|
9296
9296
|
try {
|
|
9297
9297
|
const { useAIProviderStore: useAIProviderStore2 } = await Promise.resolve().then(() => (init_aiProviderStore(), aiProviderStore_exports));
|
|
9298
9298
|
const aiProviderState = useAIProviderStore2.getState();
|
|
@@ -9315,10 +9315,10 @@ var useVectorStore = () => {
|
|
|
9315
9315
|
return false;
|
|
9316
9316
|
}
|
|
9317
9317
|
}, []);
|
|
9318
|
-
(0,
|
|
9318
|
+
(0, import_react8.useEffect)(() => {
|
|
9319
9319
|
checkProviderCompatibility();
|
|
9320
9320
|
}, [checkProviderCompatibility]);
|
|
9321
|
-
(0,
|
|
9321
|
+
(0, import_react8.useEffect)(() => {
|
|
9322
9322
|
const checkOnProviderChange = async () => {
|
|
9323
9323
|
setTimeout(() => {
|
|
9324
9324
|
checkProviderCompatibility();
|
|
@@ -9326,7 +9326,7 @@ var useVectorStore = () => {
|
|
|
9326
9326
|
};
|
|
9327
9327
|
checkOnProviderChange();
|
|
9328
9328
|
}, [authStore.token, checkProviderCompatibility]);
|
|
9329
|
-
(0,
|
|
9329
|
+
(0, import_react8.useEffect)(() => {
|
|
9330
9330
|
const interval = setInterval(() => {
|
|
9331
9331
|
if (!hasCompatibleProvider) {
|
|
9332
9332
|
checkProviderCompatibility();
|
|
@@ -9334,7 +9334,7 @@ var useVectorStore = () => {
|
|
|
9334
9334
|
}, 2e3);
|
|
9335
9335
|
return () => clearInterval(interval);
|
|
9336
9336
|
}, [hasCompatibleProvider, checkProviderCompatibility]);
|
|
9337
|
-
const initializeVectorService = (0,
|
|
9337
|
+
const initializeVectorService = (0, import_react8.useCallback)(async () => {
|
|
9338
9338
|
try {
|
|
9339
9339
|
const packageSettings = usePackageSettingsStore.getState().getSettings();
|
|
9340
9340
|
if (!packageSettings) {
|
|
@@ -9371,10 +9371,10 @@ var useVectorStore = () => {
|
|
|
9371
9371
|
}));
|
|
9372
9372
|
}
|
|
9373
9373
|
}, [authStore.token, hasAnyAdvancedFeatures, hasVectorAccess, hasCompatibleProvider, isAdvancedVectorFeaturesEnabled]);
|
|
9374
|
-
(0,
|
|
9374
|
+
(0, import_react8.useEffect)(() => {
|
|
9375
9375
|
initializeVectorService();
|
|
9376
9376
|
}, [initializeVectorService]);
|
|
9377
|
-
const performMigration = (0,
|
|
9377
|
+
const performMigration = (0, import_react8.useCallback)(async (options) => {
|
|
9378
9378
|
debugLogger.info("Starting vector database migration");
|
|
9379
9379
|
setStatus((prev) => ({ ...prev, isMigrating: true, lastError: void 0 }));
|
|
9380
9380
|
const progressCallback = (progress) => {
|
|
@@ -9418,7 +9418,7 @@ var useVectorStore = () => {
|
|
|
9418
9418
|
vectorMigrationService.removeProgressCallback(progressCallback);
|
|
9419
9419
|
}
|
|
9420
9420
|
}, [memoryStore, knowledgeStore]);
|
|
9421
|
-
const addMemory = (0,
|
|
9421
|
+
const addMemory = (0, import_react8.useCallback)(async (content, tags = [], source = "user", options = {}) => {
|
|
9422
9422
|
if (status.isEnabled && !status.migrationRequired) {
|
|
9423
9423
|
try {
|
|
9424
9424
|
const result = await vectorDatabaseService.createMemory(
|
|
@@ -9459,7 +9459,7 @@ var useVectorStore = () => {
|
|
|
9459
9459
|
}
|
|
9460
9460
|
}
|
|
9461
9461
|
}, [status.isEnabled, status.migrationRequired, memoryStore]);
|
|
9462
|
-
const searchMemories = (0,
|
|
9462
|
+
const searchMemories = (0, import_react8.useCallback)(async (query, options = {}) => {
|
|
9463
9463
|
const {
|
|
9464
9464
|
memoryLimit = 10,
|
|
9465
9465
|
scoreThreshold = 0.6,
|
|
@@ -9496,7 +9496,7 @@ var useVectorStore = () => {
|
|
|
9496
9496
|
metadata: void 0
|
|
9497
9497
|
}));
|
|
9498
9498
|
}, [status.isEnabled, status.migrationRequired, memoryStore]);
|
|
9499
|
-
const getUserMemories = (0,
|
|
9499
|
+
const getUserMemories = (0, import_react8.useCallback)(async (skip = 0, limit = 50) => {
|
|
9500
9500
|
if (status.isEnabled && !status.migrationRequired) {
|
|
9501
9501
|
try {
|
|
9502
9502
|
const results = await vectorDatabaseService.getMyMemories(skip, limit);
|
|
@@ -9512,7 +9512,7 @@ var useVectorStore = () => {
|
|
|
9512
9512
|
debugLogger.info("IndexedDB memories retrieved", { count: paginatedEntries.length });
|
|
9513
9513
|
return paginatedEntries.map(memoryEntryToVectorMemory);
|
|
9514
9514
|
}, [status.isEnabled, status.migrationRequired, memoryStore]);
|
|
9515
|
-
const deleteMemory = (0,
|
|
9515
|
+
const deleteMemory = (0, import_react8.useCallback)(async (memoryId) => {
|
|
9516
9516
|
if (status.isEnabled && !status.migrationRequired) {
|
|
9517
9517
|
try {
|
|
9518
9518
|
const success = await vectorDatabaseService.deleteMemory(memoryId);
|
|
@@ -9543,7 +9543,7 @@ var useVectorStore = () => {
|
|
|
9543
9543
|
}
|
|
9544
9544
|
}
|
|
9545
9545
|
}, [status.isEnabled, status.migrationRequired, memoryStore]);
|
|
9546
|
-
const updateMemory = (0,
|
|
9546
|
+
const updateMemory = (0, import_react8.useCallback)(async (memoryId, updates) => {
|
|
9547
9547
|
if (status.isEnabled && !status.migrationRequired) {
|
|
9548
9548
|
try {
|
|
9549
9549
|
const success = await vectorDatabaseService.updateMemory(memoryId, updates);
|
|
@@ -9577,7 +9577,7 @@ var useVectorStore = () => {
|
|
|
9577
9577
|
return { success: false, error: "Update not supported for IndexedDB" };
|
|
9578
9578
|
}
|
|
9579
9579
|
}, [status.isEnabled, status.migrationRequired, memoryStore]);
|
|
9580
|
-
const batchCreateMemories = (0,
|
|
9580
|
+
const batchCreateMemories = (0, import_react8.useCallback)(async (memories, mode = "append", clearExisting = false) => {
|
|
9581
9581
|
if (status.isEnabled && !status.migrationRequired) {
|
|
9582
9582
|
try {
|
|
9583
9583
|
const result = await vectorDatabaseService.batchCreateMemories(memories, mode, clearExisting);
|
|
@@ -9646,7 +9646,7 @@ var useVectorStore = () => {
|
|
|
9646
9646
|
};
|
|
9647
9647
|
}
|
|
9648
9648
|
}, [status.isEnabled, status.migrationRequired, memoryStore]);
|
|
9649
|
-
const batchCreateMemoriesAdvanced = (0,
|
|
9649
|
+
const batchCreateMemoriesAdvanced = (0, import_react8.useCallback)(async (memories, options = {}) => {
|
|
9650
9650
|
if (status.isEnabled && !status.migrationRequired) {
|
|
9651
9651
|
return await vectorDatabaseService.batchCreateMemoriesAdvanced(memories, options);
|
|
9652
9652
|
} else {
|
|
@@ -9669,7 +9669,7 @@ var useVectorStore = () => {
|
|
|
9669
9669
|
};
|
|
9670
9670
|
}
|
|
9671
9671
|
}, [status.isEnabled, status.migrationRequired, batchCreateMemories]);
|
|
9672
|
-
const batchImportMemories = (0,
|
|
9672
|
+
const batchImportMemories = (0, import_react8.useCallback)(async (fromIndexedDB = true, mode = "append") => {
|
|
9673
9673
|
if (!status.isEnabled || status.migrationRequired) {
|
|
9674
9674
|
return {
|
|
9675
9675
|
success: false,
|
|
@@ -9728,7 +9728,7 @@ var useVectorStore = () => {
|
|
|
9728
9728
|
};
|
|
9729
9729
|
}
|
|
9730
9730
|
}, [status.isEnabled, status.migrationRequired, memoryStore]);
|
|
9731
|
-
const uploadDocument = (0,
|
|
9731
|
+
const uploadDocument = (0, import_react8.useCallback)(async (file, shareWithTeam = true) => {
|
|
9732
9732
|
if (!status.isEnabled || status.migrationRequired) {
|
|
9733
9733
|
return {
|
|
9734
9734
|
success: false,
|
|
@@ -9757,7 +9757,7 @@ var useVectorStore = () => {
|
|
|
9757
9757
|
};
|
|
9758
9758
|
}
|
|
9759
9759
|
}, [status.isEnabled, status.migrationRequired]);
|
|
9760
|
-
const searchDocuments = (0,
|
|
9760
|
+
const searchDocuments = (0, import_react8.useCallback)(async (query, options = {}) => {
|
|
9761
9761
|
const { documentLimit = 20, scoreThreshold = 0.7 } = options;
|
|
9762
9762
|
if (!status.isEnabled || status.migrationRequired) {
|
|
9763
9763
|
debugLogger.warn("Vector document search not available, falling back to knowledge store");
|
|
@@ -9778,7 +9778,7 @@ var useVectorStore = () => {
|
|
|
9778
9778
|
return [];
|
|
9779
9779
|
}
|
|
9780
9780
|
}, [status.isEnabled, status.migrationRequired, knowledgeStore.docs]);
|
|
9781
|
-
const searchAll = (0,
|
|
9781
|
+
const searchAll = (0, import_react8.useCallback)(async (query, options = {}) => {
|
|
9782
9782
|
if (status.isEnabled && !status.migrationRequired) {
|
|
9783
9783
|
try {
|
|
9784
9784
|
const result = await vectorDatabaseService.searchAll(
|
|
@@ -9814,13 +9814,13 @@ var useVectorStore = () => {
|
|
|
9814
9814
|
};
|
|
9815
9815
|
}
|
|
9816
9816
|
}, [status.isEnabled, status.migrationRequired, searchMemories, searchDocuments]);
|
|
9817
|
-
const getMigrationEstimate = (0,
|
|
9817
|
+
const getMigrationEstimate = (0, import_react8.useCallback)(async () => {
|
|
9818
9818
|
return vectorMigrationService.estimateMigration();
|
|
9819
9819
|
}, []);
|
|
9820
|
-
(0,
|
|
9820
|
+
(0, import_react8.useEffect)(() => {
|
|
9821
9821
|
initializeVectorService();
|
|
9822
9822
|
}, [initializeVectorService]);
|
|
9823
|
-
const getUserDocuments = (0,
|
|
9823
|
+
const getUserDocuments = (0, import_react8.useCallback)(async (skip = 0, limit = 50) => {
|
|
9824
9824
|
if (!status.isEnabled || status.migrationRequired) {
|
|
9825
9825
|
return [];
|
|
9826
9826
|
}
|
|
@@ -9836,7 +9836,7 @@ var useVectorStore = () => {
|
|
|
9836
9836
|
return [];
|
|
9837
9837
|
}
|
|
9838
9838
|
}, [status.isEnabled, status.migrationRequired]);
|
|
9839
|
-
const deleteDocument = (0,
|
|
9839
|
+
const deleteDocument = (0, import_react8.useCallback)(async (fileId) => {
|
|
9840
9840
|
if (!status.isEnabled || status.migrationRequired) {
|
|
9841
9841
|
return {
|
|
9842
9842
|
success: false,
|
|
@@ -9859,7 +9859,7 @@ var useVectorStore = () => {
|
|
|
9859
9859
|
};
|
|
9860
9860
|
}
|
|
9861
9861
|
}, [status.isEnabled, status.migrationRequired]);
|
|
9862
|
-
(0,
|
|
9862
|
+
(0, import_react8.useEffect)(() => {
|
|
9863
9863
|
if (status.migrationRequired && status.isAvailable && !status.isMigrating) {
|
|
9864
9864
|
debugLogger.info("Auto-triggering vector migration for newly enabled advanced features");
|
|
9865
9865
|
performMigration({ cleanupAfterMigration: false }).then((result) => {
|
|
@@ -9869,7 +9869,7 @@ var useVectorStore = () => {
|
|
|
9869
9869
|
});
|
|
9870
9870
|
}
|
|
9871
9871
|
}, [status.migrationRequired, status.isAvailable, status.isMigrating, performMigration]);
|
|
9872
|
-
const downloadVectorFile = (0,
|
|
9872
|
+
const downloadVectorFile = (0, import_react8.useCallback)(async (fileId, filename) => {
|
|
9873
9873
|
if (!status.isEnabled) {
|
|
9874
9874
|
throw new Error("Vector database not enabled");
|
|
9875
9875
|
}
|
|
@@ -9881,7 +9881,7 @@ var useVectorStore = () => {
|
|
|
9881
9881
|
throw error;
|
|
9882
9882
|
}
|
|
9883
9883
|
}, [status.isEnabled]);
|
|
9884
|
-
const getFilePreview = (0,
|
|
9884
|
+
const getFilePreview = (0, import_react8.useCallback)(async (fileId) => {
|
|
9885
9885
|
if (!status.isEnabled) {
|
|
9886
9886
|
return null;
|
|
9887
9887
|
}
|
|
@@ -9894,7 +9894,7 @@ var useVectorStore = () => {
|
|
|
9894
9894
|
return null;
|
|
9895
9895
|
}
|
|
9896
9896
|
}, [status.isEnabled]);
|
|
9897
|
-
const getFileBlob = (0,
|
|
9897
|
+
const getFileBlob = (0, import_react8.useCallback)(async (fileId) => {
|
|
9898
9898
|
if (!status.isEnabled) {
|
|
9899
9899
|
throw new Error("Vector database not enabled");
|
|
9900
9900
|
}
|
|
@@ -9907,7 +9907,7 @@ var useVectorStore = () => {
|
|
|
9907
9907
|
throw error;
|
|
9908
9908
|
}
|
|
9909
9909
|
}, [status.isEnabled]);
|
|
9910
|
-
const refreshCompatibilityCheck = (0,
|
|
9910
|
+
const refreshCompatibilityCheck = (0, import_react8.useCallback)(() => {
|
|
9911
9911
|
checkProviderCompatibility();
|
|
9912
9912
|
}, [checkProviderCompatibility]);
|
|
9913
9913
|
return {
|
|
@@ -9950,11 +9950,11 @@ var MAX_FILES = 20;
|
|
|
9950
9950
|
var hasVectorMetadata = (doc) => typeof doc === "object" && doc !== null && "_vectorResult" in doc;
|
|
9951
9951
|
var isTextItem = (item) => typeof item === "object" && item !== null && "str" in item;
|
|
9952
9952
|
var useKnowledgeStore2 = () => {
|
|
9953
|
-
const [documents, setDocuments] = (0,
|
|
9953
|
+
const [documents, setDocuments] = (0, import_react9.useState)([]);
|
|
9954
9954
|
const vectorStore = useVectorStore();
|
|
9955
9955
|
const { isVectorEnabled, uploadDocument } = vectorStore;
|
|
9956
|
-
const storeConfigs6 = (0,
|
|
9957
|
-
const loadDocuments = (0,
|
|
9956
|
+
const storeConfigs6 = (0, import_react9.useMemo)(() => [{ name: STORE_NAME6, keyPath: "id" }], []);
|
|
9957
|
+
const loadDocuments = (0, import_react9.useCallback)(async () => {
|
|
9958
9958
|
const docs = await indexedDBService_default.getAll(DB_NAME6, 1, STORE_NAME6, storeConfigs6);
|
|
9959
9959
|
setDocuments(docs);
|
|
9960
9960
|
useKnowledgeStore.setState({
|
|
@@ -10227,9 +10227,9 @@ var DocumentCard = ({
|
|
|
10227
10227
|
const theme = (0, import_styles.useTheme)();
|
|
10228
10228
|
const { isVectorDocument } = useKnowledgeStore2();
|
|
10229
10229
|
const { downloadVectorFile, isVectorEnabled } = useVectorStore();
|
|
10230
|
-
const [documentState, setDocumentState] = (0,
|
|
10231
|
-
const [errorMessage, setErrorMessage] = (0,
|
|
10232
|
-
(0,
|
|
10230
|
+
const [documentState, setDocumentState] = (0, import_react10.useState)("checking");
|
|
10231
|
+
const [errorMessage, setErrorMessage] = (0, import_react10.useState)("");
|
|
10232
|
+
(0, import_react10.useEffect)(() => {
|
|
10233
10233
|
const checkDocumentStatus = async () => {
|
|
10234
10234
|
try {
|
|
10235
10235
|
const isVector = isVectorDocument(doc);
|
|
@@ -10742,7 +10742,7 @@ var DocumentCard = ({
|
|
|
10742
10742
|
var DocumentCard_default = DocumentCard;
|
|
10743
10743
|
|
|
10744
10744
|
// src/modals/knowlege/knowledge-file-modal.tsx
|
|
10745
|
-
var
|
|
10745
|
+
var import_react12 = require("react");
|
|
10746
10746
|
var import_material7 = require("@mui/material");
|
|
10747
10747
|
init_packageSettingsStore();
|
|
10748
10748
|
var pdfjsLib2 = __toESM(require("pdfjs-dist/legacy/build/pdf"));
|
|
@@ -10827,7 +10827,7 @@ function getHighlightTree(code, language) {
|
|
|
10827
10827
|
}
|
|
10828
10828
|
|
|
10829
10829
|
// src/utils/markdownRendering.tsx
|
|
10830
|
-
var
|
|
10830
|
+
var import_react11 = __toESM(require("react"));
|
|
10831
10831
|
var import_material6 = require("@mui/material");
|
|
10832
10832
|
var import_rehype_sanitize = require("rehype-sanitize");
|
|
10833
10833
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
@@ -10933,7 +10933,7 @@ var renderLowlightChildren = (nodes, keyPrefix) => nodes.map((node, index) => {
|
|
|
10933
10933
|
reactProps[propKey] = value;
|
|
10934
10934
|
}
|
|
10935
10935
|
});
|
|
10936
|
-
return
|
|
10936
|
+
return import_react11.default.createElement(
|
|
10937
10937
|
tagName,
|
|
10938
10938
|
reactProps,
|
|
10939
10939
|
renderLowlightChildren(children, key)
|
|
@@ -11078,27 +11078,27 @@ var getFormattedContent = (content, filename) => {
|
|
|
11078
11078
|
return content;
|
|
11079
11079
|
};
|
|
11080
11080
|
var KnowledgeFileModal = ({ open, onClose, doc, isVectorDocument = false }) => {
|
|
11081
|
-
const [fullContent, setFullContent] = (0,
|
|
11082
|
-
const [loading, setLoading] = (0,
|
|
11083
|
-
const [error, setError] = (0,
|
|
11084
|
-
const [pdfDocument, setPdfDocument] = (0,
|
|
11085
|
-
const [currentPage, setCurrentPage] = (0,
|
|
11086
|
-
const [totalPages, setTotalPages] = (0,
|
|
11087
|
-
const [pdfScale, setPdfScale] = (0,
|
|
11088
|
-
const [pdfCanvases, setPdfCanvases] = (0,
|
|
11089
|
-
const [viewMode, setViewMode] = (0,
|
|
11090
|
-
const zoomTimeoutRef = (0,
|
|
11081
|
+
const [fullContent, setFullContent] = (0, import_react12.useState)("");
|
|
11082
|
+
const [loading, setLoading] = (0, import_react12.useState)(false);
|
|
11083
|
+
const [error, setError] = (0, import_react12.useState)(null);
|
|
11084
|
+
const [pdfDocument, setPdfDocument] = (0, import_react12.useState)(null);
|
|
11085
|
+
const [currentPage, setCurrentPage] = (0, import_react12.useState)(1);
|
|
11086
|
+
const [totalPages, setTotalPages] = (0, import_react12.useState)(0);
|
|
11087
|
+
const [pdfScale, setPdfScale] = (0, import_react12.useState)(1.2);
|
|
11088
|
+
const [pdfCanvases, setPdfCanvases] = (0, import_react12.useState)([]);
|
|
11089
|
+
const [viewMode, setViewMode] = (0, import_react12.useState)("formatted");
|
|
11090
|
+
const zoomTimeoutRef = (0, import_react12.useRef)(null);
|
|
11091
11091
|
const { downloadVectorFile, getFileBlob } = useVectorStore();
|
|
11092
11092
|
const packageSettings = usePackageSettingsStore();
|
|
11093
11093
|
const theme = (0, import_material7.useTheme)();
|
|
11094
11094
|
const isMobile = (0, import_material7.useMediaQuery)(theme.breakpoints.down("md"));
|
|
11095
11095
|
const isDarkTheme = theme.palette.mode === "dark";
|
|
11096
|
-
(0,
|
|
11096
|
+
(0, import_react12.useEffect)(() => {
|
|
11097
11097
|
if (typeof window !== "undefined") {
|
|
11098
11098
|
pdfjsLib2.GlobalWorkerOptions.workerSrc = "https://cdn.burtson.ai/scripts/pdf.worker.js";
|
|
11099
11099
|
}
|
|
11100
11100
|
}, []);
|
|
11101
|
-
(0,
|
|
11101
|
+
(0, import_react12.useEffect)(() => {
|
|
11102
11102
|
return () => {
|
|
11103
11103
|
if (zoomTimeoutRef.current) {
|
|
11104
11104
|
clearTimeout(zoomTimeoutRef.current);
|
|
@@ -11107,23 +11107,23 @@ var KnowledgeFileModal = ({ open, onClose, doc, isVectorDocument = false }) => {
|
|
|
11107
11107
|
}, []);
|
|
11108
11108
|
const baseContent = fullContent || doc?.content || "";
|
|
11109
11109
|
const filename = doc?.name || "";
|
|
11110
|
-
const formattedContent = (0,
|
|
11110
|
+
const formattedContent = (0, import_react12.useMemo)(
|
|
11111
11111
|
() => getFormattedContent(baseContent, filename),
|
|
11112
11112
|
[baseContent, filename]
|
|
11113
11113
|
);
|
|
11114
|
-
const highlightLanguage = (0,
|
|
11114
|
+
const highlightLanguage = (0, import_react12.useMemo)(() => {
|
|
11115
11115
|
if (!filename || !isCodeFile(filename)) {
|
|
11116
11116
|
return "";
|
|
11117
11117
|
}
|
|
11118
11118
|
return getLanguageFromFilename(filename).toLowerCase();
|
|
11119
11119
|
}, [filename]);
|
|
11120
|
-
const highlightTree = (0,
|
|
11120
|
+
const highlightTree = (0, import_react12.useMemo)(() => {
|
|
11121
11121
|
if (!highlightLanguage) {
|
|
11122
11122
|
return null;
|
|
11123
11123
|
}
|
|
11124
11124
|
return getHighlightTree(formattedContent, highlightLanguage);
|
|
11125
11125
|
}, [formattedContent, highlightLanguage]);
|
|
11126
|
-
const highlightedNodes = (0,
|
|
11126
|
+
const highlightedNodes = (0, import_react12.useMemo)(() => {
|
|
11127
11127
|
if (!highlightTree) {
|
|
11128
11128
|
return [];
|
|
11129
11129
|
}
|
|
@@ -11135,7 +11135,7 @@ var KnowledgeFileModal = ({ open, onClose, doc, isVectorDocument = false }) => {
|
|
|
11135
11135
|
`hl-doc-${highlightLanguage || "auto"}`
|
|
11136
11136
|
);
|
|
11137
11137
|
}, [highlightTree, highlightLanguage]);
|
|
11138
|
-
const resolvedHighlightLanguage = (0,
|
|
11138
|
+
const resolvedHighlightLanguage = (0, import_react12.useMemo)(() => {
|
|
11139
11139
|
const data = highlightTree?.data;
|
|
11140
11140
|
if (data && typeof data === "object" && data !== null && "language" in data) {
|
|
11141
11141
|
const languageValue = data.language;
|
|
@@ -11162,7 +11162,7 @@ var KnowledgeFileModal = ({ open, onClose, doc, isVectorDocument = false }) => {
|
|
|
11162
11162
|
await page.render(renderContext).promise;
|
|
11163
11163
|
return canvas;
|
|
11164
11164
|
};
|
|
11165
|
-
const loadPdfDocument = (0,
|
|
11165
|
+
const loadPdfDocument = (0, import_react12.useCallback)(async (arrayBuffer) => {
|
|
11166
11166
|
try {
|
|
11167
11167
|
const pdf = await pdfjsLib2.getDocument({ data: arrayBuffer }).promise;
|
|
11168
11168
|
setPdfDocument(pdf);
|
|
@@ -11205,7 +11205,7 @@ var KnowledgeFileModal = ({ open, onClose, doc, isVectorDocument = false }) => {
|
|
|
11205
11205
|
setLoading(false);
|
|
11206
11206
|
}
|
|
11207
11207
|
};
|
|
11208
|
-
const loadFullContent = (0,
|
|
11208
|
+
const loadFullContent = (0, import_react12.useCallback)(async () => {
|
|
11209
11209
|
if (!doc) return;
|
|
11210
11210
|
setLoading(true);
|
|
11211
11211
|
setError(null);
|
|
@@ -11231,7 +11231,7 @@ var KnowledgeFileModal = ({ open, onClose, doc, isVectorDocument = false }) => {
|
|
|
11231
11231
|
setLoading(false);
|
|
11232
11232
|
}
|
|
11233
11233
|
}, [doc, getFileBlob, loadPdfDocument]);
|
|
11234
|
-
(0,
|
|
11234
|
+
(0, import_react12.useEffect)(() => {
|
|
11235
11235
|
if (open && doc && isVectorDocument) {
|
|
11236
11236
|
loadFullContent();
|
|
11237
11237
|
} else if (open && doc) {
|
|
@@ -11687,7 +11687,7 @@ var maybeHandleFileLinkClick = (event, href) => {
|
|
|
11687
11687
|
};
|
|
11688
11688
|
|
|
11689
11689
|
// src/modals/chat-modal/ai-response-action-bar.tsx
|
|
11690
|
-
var
|
|
11690
|
+
var import_react14 = require("react");
|
|
11691
11691
|
|
|
11692
11692
|
// src/store/voiceStore.ts
|
|
11693
11693
|
var import_zustand12 = require("zustand");
|
|
@@ -12200,28 +12200,28 @@ var useCanvasStore = (0, import_zustand13.create)((set) => ({
|
|
|
12200
12200
|
}));
|
|
12201
12201
|
|
|
12202
12202
|
// src/hooks/useTTS.ts
|
|
12203
|
-
var
|
|
12203
|
+
var import_react13 = require("react");
|
|
12204
12204
|
init_preferencesStore();
|
|
12205
12205
|
init_packageSettingsStore();
|
|
12206
12206
|
init_modelStore();
|
|
12207
12207
|
init_debugLogger();
|
|
12208
12208
|
var useTTS = () => {
|
|
12209
|
-
const [state, setState] = (0,
|
|
12210
|
-
const [progress, setProgress] = (0,
|
|
12211
|
-
const [error, setError] = (0,
|
|
12212
|
-
const progressSubscriptionRef = (0,
|
|
12213
|
-
const stateSubscriptionRef = (0,
|
|
12214
|
-
const speakSubscriptionRef = (0,
|
|
12215
|
-
const previousVoiceRef = (0,
|
|
12216
|
-
const previousModelRef = (0,
|
|
12217
|
-
const requestIdRef = (0,
|
|
12209
|
+
const [state, setState] = (0, import_react13.useState)("IDLE" /* IDLE */);
|
|
12210
|
+
const [progress, setProgress] = (0, import_react13.useState)(null);
|
|
12211
|
+
const [error, setError] = (0, import_react13.useState)(null);
|
|
12212
|
+
const progressSubscriptionRef = (0, import_react13.useRef)(null);
|
|
12213
|
+
const stateSubscriptionRef = (0, import_react13.useRef)(null);
|
|
12214
|
+
const speakSubscriptionRef = (0, import_react13.useRef)(null);
|
|
12215
|
+
const previousVoiceRef = (0, import_react13.useRef)(null);
|
|
12216
|
+
const previousModelRef = (0, import_react13.useRef)(null);
|
|
12217
|
+
const requestIdRef = (0, import_react13.useRef)(0);
|
|
12218
12218
|
const { selectedVoice, isServiceAvailable } = useVoiceStore();
|
|
12219
12219
|
const { preferences } = usePreferencesStore();
|
|
12220
12220
|
const { settings: packageSettings } = usePackageSettingsStore();
|
|
12221
12221
|
const { selectedModel } = useModelStore();
|
|
12222
12222
|
const isAvailable = !!(packageSettings?.gatewayApiUrl && preferences.ttsEnabled && isServiceAvailable);
|
|
12223
|
-
const ttsClient = (0,
|
|
12224
|
-
(0,
|
|
12223
|
+
const ttsClient = (0, import_react13.useMemo)(() => getStreamingTTSClient(), []);
|
|
12224
|
+
(0, import_react13.useEffect)(() => {
|
|
12225
12225
|
if (progressSubscriptionRef.current) {
|
|
12226
12226
|
progressSubscriptionRef.current.unsubscribe();
|
|
12227
12227
|
}
|
|
@@ -12256,7 +12256,7 @@ var useTTS = () => {
|
|
|
12256
12256
|
}
|
|
12257
12257
|
};
|
|
12258
12258
|
}, [error, ttsClient]);
|
|
12259
|
-
(0,
|
|
12259
|
+
(0, import_react13.useEffect)(() => {
|
|
12260
12260
|
const isVoiceChange = previousVoiceRef.current !== null && previousVoiceRef.current !== selectedVoice;
|
|
12261
12261
|
const isModelChange = previousModelRef.current !== null && previousModelRef.current !== selectedModel;
|
|
12262
12262
|
if (isVoiceChange || isModelChange) {
|
|
@@ -12283,7 +12283,7 @@ var useTTS = () => {
|
|
|
12283
12283
|
previousModelRef.current = selectedModel;
|
|
12284
12284
|
}
|
|
12285
12285
|
}, [selectedVoice, selectedModel, ttsClient]);
|
|
12286
|
-
const speak = (0,
|
|
12286
|
+
const speak = (0, import_react13.useCallback)(async (text, options = {}) => {
|
|
12287
12287
|
if (!isAvailable) {
|
|
12288
12288
|
const errorMsg = "TTS service is not available";
|
|
12289
12289
|
setError(errorMsg);
|
|
@@ -12355,7 +12355,7 @@ var useTTS = () => {
|
|
|
12355
12355
|
throw err instanceof Error ? err : new Error(errorMsg);
|
|
12356
12356
|
}
|
|
12357
12357
|
}, [isAvailable, selectedVoice, selectedModel, ttsClient]);
|
|
12358
|
-
const stop = (0,
|
|
12358
|
+
const stop = (0, import_react13.useCallback)(() => {
|
|
12359
12359
|
const currentRequestId = requestIdRef.current;
|
|
12360
12360
|
setState("IDLE" /* IDLE */);
|
|
12361
12361
|
requestIdRef.current++;
|
|
@@ -12366,13 +12366,13 @@ var useTTS = () => {
|
|
|
12366
12366
|
ttsClient.stop();
|
|
12367
12367
|
setError(null);
|
|
12368
12368
|
}, [ttsClient]);
|
|
12369
|
-
const pause = (0,
|
|
12369
|
+
const pause = (0, import_react13.useCallback)(() => {
|
|
12370
12370
|
ttsClient.pause();
|
|
12371
12371
|
}, [ttsClient]);
|
|
12372
|
-
const resume = (0,
|
|
12372
|
+
const resume = (0, import_react13.useCallback)(() => {
|
|
12373
12373
|
ttsClient.resume();
|
|
12374
12374
|
}, [ttsClient]);
|
|
12375
|
-
const forcePlay = (0,
|
|
12375
|
+
const forcePlay = (0, import_react13.useCallback)(async () => {
|
|
12376
12376
|
try {
|
|
12377
12377
|
if (ttsClient.getCurrentState() === "PAUSED" /* PAUSED */) {
|
|
12378
12378
|
ttsClient.resume();
|
|
@@ -12383,7 +12383,7 @@ var useTTS = () => {
|
|
|
12383
12383
|
throw err instanceof Error ? err : new Error(errorMsg);
|
|
12384
12384
|
}
|
|
12385
12385
|
}, [ttsClient]);
|
|
12386
|
-
(0,
|
|
12386
|
+
(0, import_react13.useEffect)(() => {
|
|
12387
12387
|
return () => {
|
|
12388
12388
|
if (speakSubscriptionRef.current) {
|
|
12389
12389
|
speakSubscriptionRef.current.unsubscribe();
|
|
@@ -12396,7 +12396,7 @@ var useTTS = () => {
|
|
|
12396
12396
|
}
|
|
12397
12397
|
};
|
|
12398
12398
|
}, []);
|
|
12399
|
-
(0,
|
|
12399
|
+
(0, import_react13.useEffect)(() => {
|
|
12400
12400
|
if (!isAvailable && (state === "PLAYING" /* PLAYING */ || state === "LOADING" /* LOADING */)) {
|
|
12401
12401
|
stop();
|
|
12402
12402
|
}
|
|
@@ -12423,12 +12423,12 @@ var useTTS = () => {
|
|
|
12423
12423
|
|
|
12424
12424
|
// src/modals/chat-modal/ai-response-action-bar.tsx
|
|
12425
12425
|
var import_material8 = require("@mui/material");
|
|
12426
|
-
var
|
|
12426
|
+
var import_react15 = require("@burtson-labs/icons/react");
|
|
12427
12427
|
init_debugLogger();
|
|
12428
12428
|
init_authenticationService();
|
|
12429
12429
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
12430
12430
|
var AiResponseActionsBar = ({ text }) => {
|
|
12431
|
-
const [copied, setCopied] = (0,
|
|
12431
|
+
const [copied, setCopied] = (0, import_react14.useState)(false);
|
|
12432
12432
|
const openCanvas = useCanvasStore((s) => s.openCanvas);
|
|
12433
12433
|
const openInCanvas = () => {
|
|
12434
12434
|
const plain = text || "";
|
|
@@ -12438,7 +12438,7 @@ var AiResponseActionsBar = ({ text }) => {
|
|
|
12438
12438
|
const title = rawTitle.length > 60 ? `${rawTitle.slice(0, 57)}\u2026` : rawTitle || "Untitled";
|
|
12439
12439
|
openCanvas({ content: plain, title });
|
|
12440
12440
|
};
|
|
12441
|
-
const [feedback, setFeedback] = (0,
|
|
12441
|
+
const [feedback, setFeedback] = (0, import_react14.useState)(null);
|
|
12442
12442
|
const {
|
|
12443
12443
|
isPlaying,
|
|
12444
12444
|
isPaused,
|
|
@@ -12453,7 +12453,7 @@ var AiResponseActionsBar = ({ text }) => {
|
|
|
12453
12453
|
const { availableVoices, loadVoicesFromAPI, initialized } = useVoiceStore();
|
|
12454
12454
|
const { preferences } = usePreferencesStore();
|
|
12455
12455
|
const { settings: packageSettings } = usePackageSettingsStore();
|
|
12456
|
-
(0,
|
|
12456
|
+
(0, import_react14.useEffect)(() => {
|
|
12457
12457
|
const isAuthenticated = authenticationService.isAuthenticated();
|
|
12458
12458
|
const token = authenticationService.getToken();
|
|
12459
12459
|
if (!initialized || availableVoices.length === 0) {
|
|
@@ -12465,7 +12465,7 @@ var AiResponseActionsBar = ({ text }) => {
|
|
|
12465
12465
|
}
|
|
12466
12466
|
}
|
|
12467
12467
|
}, [initialized, availableVoices.length, loadVoicesFromAPI]);
|
|
12468
|
-
(0,
|
|
12468
|
+
(0, import_react14.useEffect)(() => {
|
|
12469
12469
|
if (ttsError) {
|
|
12470
12470
|
debugLogger.error("TTS Error in action bar:", { error: ttsError });
|
|
12471
12471
|
}
|
|
@@ -12521,7 +12521,7 @@ var AiResponseActionsBar = ({ text }) => {
|
|
|
12521
12521
|
color: (theme) => theme.palette.mode === "dark" ? "#fff" : "#000"
|
|
12522
12522
|
}
|
|
12523
12523
|
},
|
|
12524
|
-
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
12524
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react15.Check, { size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react15.Copy, { size: 18 })
|
|
12525
12525
|
}
|
|
12526
12526
|
) }),
|
|
12527
12527
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Tooltip, { title: "Open in canvas \u2014 edit & export", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
@@ -12535,7 +12535,7 @@ var AiResponseActionsBar = ({ text }) => {
|
|
|
12535
12535
|
color: (theme) => theme.palette.mode === "dark" ? "#fff" : "#000"
|
|
12536
12536
|
}
|
|
12537
12537
|
},
|
|
12538
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
12538
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react15.PanelRight, { size: 18 })
|
|
12539
12539
|
}
|
|
12540
12540
|
) }),
|
|
12541
12541
|
isTTSAvailable && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
@@ -12558,7 +12558,7 @@ var AiResponseActionsBar = ({ text }) => {
|
|
|
12558
12558
|
color: (theme) => theme.palette.mode === "dark" ? "#666" : "#aaa"
|
|
12559
12559
|
}
|
|
12560
12560
|
},
|
|
12561
|
-
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.CircularProgress, { size: 18 }) : isPaused ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
12561
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.CircularProgress, { size: 18 }) : isPaused ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react15.Play, { size: 18 }) : !isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react15.Megaphone, { size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react15.Megaphone, { size: 18, color: "#4caf50" })
|
|
12562
12562
|
}
|
|
12563
12563
|
)
|
|
12564
12564
|
}
|
|
@@ -12574,7 +12574,7 @@ var AiResponseActionsBar = ({ text }) => {
|
|
|
12574
12574
|
color: (theme) => theme.palette.mode === "dark" ? "#fff" : "#000"
|
|
12575
12575
|
}
|
|
12576
12576
|
},
|
|
12577
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
12577
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react15.Pause, { size: 18 })
|
|
12578
12578
|
}
|
|
12579
12579
|
) }),
|
|
12580
12580
|
(isPlaying || isPaused) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Tooltip, { title: "Stop playback", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
@@ -12588,7 +12588,7 @@ var AiResponseActionsBar = ({ text }) => {
|
|
|
12588
12588
|
color: (theme) => theme.palette.mode === "dark" ? "#fff" : "#000"
|
|
12589
12589
|
}
|
|
12590
12590
|
},
|
|
12591
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
12591
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react15.Square, { size: 18 })
|
|
12592
12592
|
}
|
|
12593
12593
|
) })
|
|
12594
12594
|
] }),
|
|
@@ -12603,7 +12603,7 @@ var AiResponseActionsBar = ({ text }) => {
|
|
|
12603
12603
|
color: feedback === "like" ? "#00e676" : (theme) => theme.palette.mode === "dark" ? "#fff" : "#000"
|
|
12604
12604
|
}
|
|
12605
12605
|
},
|
|
12606
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
12606
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react15.ThumbsUp, { size: 18 })
|
|
12607
12607
|
}
|
|
12608
12608
|
) }),
|
|
12609
12609
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Tooltip, { title: "Dislike this response", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
@@ -12616,7 +12616,7 @@ var AiResponseActionsBar = ({ text }) => {
|
|
|
12616
12616
|
color: feedback === "dislike" ? "#ff1744" : (theme) => theme.palette.mode === "dark" ? "#fff" : "#000"
|
|
12617
12617
|
}
|
|
12618
12618
|
},
|
|
12619
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
12619
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react15.ThumbsDown, { size: 18 })
|
|
12620
12620
|
}
|
|
12621
12621
|
) })
|
|
12622
12622
|
] });
|
|
@@ -12694,17 +12694,17 @@ var MarkdownCodeBlock = ({
|
|
|
12694
12694
|
const requestedLanguage = match?.[1]?.toLowerCase() || "";
|
|
12695
12695
|
const codeText = String(children).replace(/\n$/, "");
|
|
12696
12696
|
const isProbablyBlock = codeText.includes("\n") || Boolean(requestedLanguage);
|
|
12697
|
-
const [copied, setCopied] = (0,
|
|
12697
|
+
const [copied, setCopied] = (0, import_react16.useState)(false);
|
|
12698
12698
|
const handleCopy = () => {
|
|
12699
12699
|
navigator.clipboard.writeText(codeText);
|
|
12700
12700
|
setCopied(true);
|
|
12701
12701
|
setTimeout(() => setCopied(false), 2e3);
|
|
12702
12702
|
};
|
|
12703
|
-
const highlightTree = (0,
|
|
12703
|
+
const highlightTree = (0, import_react16.useMemo)(
|
|
12704
12704
|
() => isProbablyBlock ? getHighlightTree(codeText, requestedLanguage) : null,
|
|
12705
12705
|
[codeText, requestedLanguage, isProbablyBlock]
|
|
12706
12706
|
);
|
|
12707
|
-
const highlightedNodes = (0,
|
|
12707
|
+
const highlightedNodes = (0, import_react16.useMemo)(
|
|
12708
12708
|
() => isProbablyBlock ? renderLowlightChildren(
|
|
12709
12709
|
(highlightTree?.children || []).filter((node) => {
|
|
12710
12710
|
if (!node) {
|
|
@@ -12857,16 +12857,16 @@ var AIResponseTextField = ({
|
|
|
12857
12857
|
cancelled = false,
|
|
12858
12858
|
revealActionsOnHover = false
|
|
12859
12859
|
}) => {
|
|
12860
|
-
(0,
|
|
12861
|
-
if (typeof response !== "string" && !
|
|
12860
|
+
(0, import_react16.useEffect)(() => {
|
|
12861
|
+
if (typeof response !== "string" && !import_react16.default.isValidElement(response)) {
|
|
12862
12862
|
debugLogger.warn("\u26A0\uFE0F AIResponseTextField received a non-string, non-ReactElement response:", { response });
|
|
12863
12863
|
}
|
|
12864
12864
|
}, [response]);
|
|
12865
|
-
const [openImage, setOpenImage] = (0,
|
|
12866
|
-
const [showMemoryUpdated, setShowMemoryUpdated] = (0,
|
|
12867
|
-
const [openDoc, setOpenDoc] = (0,
|
|
12865
|
+
const [openImage, setOpenImage] = (0, import_react16.useState)(null);
|
|
12866
|
+
const [showMemoryUpdated, setShowMemoryUpdated] = (0, import_react16.useState)(memoryUpdated ?? false);
|
|
12867
|
+
const [openDoc, setOpenDoc] = (0, import_react16.useState)(null);
|
|
12868
12868
|
const { isVectorDocument } = useKnowledgeStore2();
|
|
12869
|
-
const normalizeSourceFiles = (0,
|
|
12869
|
+
const normalizeSourceFiles = (0, import_react16.useCallback)((files) => {
|
|
12870
12870
|
return files.map((file) => {
|
|
12871
12871
|
const vectorResult = file._vectorResult ?? void 0;
|
|
12872
12872
|
const metadata = file.metadata ?? void 0;
|
|
@@ -12941,12 +12941,12 @@ var AIResponseTextField = ({
|
|
|
12941
12941
|
return normalizedDoc;
|
|
12942
12942
|
}).filter((doc) => doc !== null);
|
|
12943
12943
|
}, []);
|
|
12944
|
-
const normalizedSourceFiles = (0,
|
|
12944
|
+
const normalizedSourceFiles = (0, import_react16.useMemo)(
|
|
12945
12945
|
() => sourceFiles ? normalizeSourceFiles(sourceFiles) : [],
|
|
12946
12946
|
[sourceFiles, normalizeSourceFiles]
|
|
12947
12947
|
);
|
|
12948
|
-
const sourceCacheRef = (0,
|
|
12949
|
-
const displaySourceFiles = (0,
|
|
12948
|
+
const sourceCacheRef = (0, import_react16.useRef)([]);
|
|
12949
|
+
const displaySourceFiles = (0, import_react16.useMemo)(() => {
|
|
12950
12950
|
if (normalizedSourceFiles.length > 0) {
|
|
12951
12951
|
sourceCacheRef.current = normalizedSourceFiles;
|
|
12952
12952
|
return normalizedSourceFiles;
|
|
@@ -12958,7 +12958,7 @@ var AIResponseTextField = ({
|
|
|
12958
12958
|
return [];
|
|
12959
12959
|
}, [normalizedSourceFiles, sourceFiles]);
|
|
12960
12960
|
const sourcesMarkdownList = displaySourceFiles.map((doc, index) => `- ${index + 1}. ${doc.name}`);
|
|
12961
|
-
(0,
|
|
12961
|
+
(0, import_react16.useEffect)(() => {
|
|
12962
12962
|
if (sourceFiles && sourceFiles.length > 0) {
|
|
12963
12963
|
debugLogger.debug("AI response source files normalization", {
|
|
12964
12964
|
sourceFileCount: sourceFiles.length,
|
|
@@ -12966,7 +12966,7 @@ var AIResponseTextField = ({
|
|
|
12966
12966
|
});
|
|
12967
12967
|
}
|
|
12968
12968
|
}, [sourceFiles, normalizedSourceFiles]);
|
|
12969
|
-
(0,
|
|
12969
|
+
(0, import_react16.useEffect)(() => {
|
|
12970
12970
|
if (!memoryUpdated) return;
|
|
12971
12971
|
setShowMemoryUpdated(true);
|
|
12972
12972
|
const timeout3 = setTimeout(() => setShowMemoryUpdated(false), 3e3);
|
|
@@ -12985,7 +12985,7 @@ var AIResponseTextField = ({
|
|
|
12985
12985
|
sanitized = normalizeTables(sanitized);
|
|
12986
12986
|
return sanitized;
|
|
12987
12987
|
};
|
|
12988
|
-
const enrichedMarkdown = (0,
|
|
12988
|
+
const enrichedMarkdown = (0, import_react16.useMemo)(() => {
|
|
12989
12989
|
if (typeof response !== "string") {
|
|
12990
12990
|
return null;
|
|
12991
12991
|
}
|
|
@@ -13004,7 +13004,7 @@ ${sourcesMarkdownList.join("\n")}`;
|
|
|
13004
13004
|
const components = {
|
|
13005
13005
|
img: MarkdownImage,
|
|
13006
13006
|
mark({ children, node: _node, className, style, ...markProps }) {
|
|
13007
|
-
const contentText =
|
|
13007
|
+
const contentText = import_react16.default.Children.toArray(children).map((child) => typeof child === "string" ? child : "").join("").trim();
|
|
13008
13008
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
13009
13009
|
import_material9.Box,
|
|
13010
13010
|
{
|
|
@@ -13089,7 +13089,7 @@ ${sourcesMarkdownList.join("\n")}`;
|
|
|
13089
13089
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("em", { className, style, ...emProps, children });
|
|
13090
13090
|
},
|
|
13091
13091
|
ol({ children, node: _node, style, ...orderedListProps }) {
|
|
13092
|
-
const childArray =
|
|
13092
|
+
const childArray = import_react16.default.Children.toArray(children);
|
|
13093
13093
|
const cleanedChildren = [];
|
|
13094
13094
|
for (let i = 0; i < childArray.length; i++) {
|
|
13095
13095
|
const item = childArray[i];
|
|
@@ -13143,7 +13143,7 @@ ${sourcesMarkdownList.join("\n")}`;
|
|
|
13143
13143
|
listStyle: "disc",
|
|
13144
13144
|
...style ?? {}
|
|
13145
13145
|
},
|
|
13146
|
-
children:
|
|
13146
|
+
children: import_react16.default.Children.toArray(children).filter((child) => {
|
|
13147
13147
|
if (typeof child === "string" && child.trim() === ":") return false;
|
|
13148
13148
|
return true;
|
|
13149
13149
|
})
|
|
@@ -13151,8 +13151,8 @@ ${sourcesMarkdownList.join("\n")}`;
|
|
|
13151
13151
|
);
|
|
13152
13152
|
},
|
|
13153
13153
|
li({ children, node: _node, style, ...listItemProps }) {
|
|
13154
|
-
const childArray =
|
|
13155
|
-
if (childArray.length >= 2 &&
|
|
13154
|
+
const childArray = import_react16.default.Children.toArray(children);
|
|
13155
|
+
if (childArray.length >= 2 && import_react16.default.isValidElement(childArray[0]) && childArray[0].type === "strong") {
|
|
13156
13156
|
let labelText = "";
|
|
13157
13157
|
const strongChild = childArray[0];
|
|
13158
13158
|
if (typeof strongChild.props.children === "string") {
|
|
@@ -13166,7 +13166,7 @@ ${sourcesMarkdownList.join("\n")}`;
|
|
|
13166
13166
|
if (typeof labelText === "string" && labelText.trim().endsWith(":")) {
|
|
13167
13167
|
const rest = childArray.slice(1);
|
|
13168
13168
|
const isAllInline = rest.every(
|
|
13169
|
-
(el) => typeof el === "string" ||
|
|
13169
|
+
(el) => typeof el === "string" || import_react16.default.isValidElement(el) && // allow inline tags, but not <Box>
|
|
13170
13170
|
el.type !== import_material9.Box
|
|
13171
13171
|
);
|
|
13172
13172
|
if (isAllInline) {
|
|
@@ -13196,7 +13196,7 @@ ${sourcesMarkdownList.join("\n")}`;
|
|
|
13196
13196
|
}
|
|
13197
13197
|
}
|
|
13198
13198
|
}
|
|
13199
|
-
if (childArray.length === 2 &&
|
|
13199
|
+
if (childArray.length === 2 && import_react16.default.isValidElement(childArray[0]) && childArray[0].type === "strong" && import_react16.default.isValidElement(childArray[1]) && childArray[1].type === import_material9.Box) {
|
|
13200
13200
|
const label = childArray[0].props.children;
|
|
13201
13201
|
const desc = childArray[1].props.children;
|
|
13202
13202
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
@@ -13219,9 +13219,9 @@ ${sourcesMarkdownList.join("\n")}`;
|
|
|
13219
13219
|
if (typeof item === "string" && item.trim() === ":") continue;
|
|
13220
13220
|
if (i > 0 && typeof item === "string" && item.trim().startsWith(":")) {
|
|
13221
13221
|
const prev = contentArray[i - 1];
|
|
13222
|
-
if (
|
|
13222
|
+
if (import_react16.default.isValidElement(prev) && prev.type === "strong") {
|
|
13223
13223
|
const desc = item.replace(/^:\s*/, "");
|
|
13224
|
-
const prevKey =
|
|
13224
|
+
const prevKey = import_react16.default.isValidElement(prev) && prev.key != null ? prev.key : `li-strong-${i}`;
|
|
13225
13225
|
filtered.pop();
|
|
13226
13226
|
filtered.push(
|
|
13227
13227
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
@@ -13265,11 +13265,11 @@ ${sourcesMarkdownList.join("\n")}`;
|
|
|
13265
13265
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.TableHead, { ...tableHeadProps, children });
|
|
13266
13266
|
},
|
|
13267
13267
|
tbody({ children, node: _node, ...tableBodyProps }) {
|
|
13268
|
-
const rows =
|
|
13269
|
-
if (!
|
|
13270
|
-
const cells =
|
|
13268
|
+
const rows = import_react16.default.Children.toArray(children).filter((row) => {
|
|
13269
|
+
if (!import_react16.default.isValidElement(row)) return true;
|
|
13270
|
+
const cells = import_react16.default.Children.toArray(row.props.children);
|
|
13271
13271
|
return !cells.every(
|
|
13272
|
-
(cell) =>
|
|
13272
|
+
(cell) => import_react16.default.isValidElement(cell) && typeof cell.props.children === "string" && /^-+$/.test(cell.props.children.trim())
|
|
13273
13273
|
);
|
|
13274
13274
|
});
|
|
13275
13275
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.TableBody, { ...tableBodyProps, children: rows });
|
|
@@ -13310,7 +13310,7 @@ ${sourcesMarkdownList.join("\n")}`;
|
|
|
13310
13310
|
);
|
|
13311
13311
|
},
|
|
13312
13312
|
p({ children, node: _node, className, style, ...paragraphProps }) {
|
|
13313
|
-
const flattened =
|
|
13313
|
+
const flattened = import_react16.default.Children.toArray(children).flat();
|
|
13314
13314
|
const hasBlock = flattened.some(
|
|
13315
13315
|
(child) => typeof child === "object" && child !== null && "type" in child && typeof child.type === "string" && ["div", "Box", "section", "ul", "ol", "table"].includes(child.type)
|
|
13316
13316
|
);
|
|
@@ -13444,7 +13444,7 @@ ${sourcesMarkdownList.join("\n")}`;
|
|
|
13444
13444
|
components,
|
|
13445
13445
|
children: enrichedMarkdown ?? sanitizeMarkdown(response)
|
|
13446
13446
|
}
|
|
13447
|
-
) :
|
|
13447
|
+
) : import_react16.default.isValidElement(response) ? response : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Typography, { color: "error", children: "\u26A0\uFE0F Invalid AI response" }) })
|
|
13448
13448
|
] }),
|
|
13449
13449
|
!!(responseText || typeof response === "string" && response) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
13450
13450
|
import_material9.Box,
|
|
@@ -13553,7 +13553,7 @@ var ai_response_text_field_default = AIResponseTextField;
|
|
|
13553
13553
|
init_indexedDBService();
|
|
13554
13554
|
|
|
13555
13555
|
// src/modals/chat-modal/chat-drawer.tsx
|
|
13556
|
-
var
|
|
13556
|
+
var import_react18 = __toESM(require("react"));
|
|
13557
13557
|
var import_material11 = require("@mui/material");
|
|
13558
13558
|
init_preferencesStore();
|
|
13559
13559
|
init_packageSettingsStore();
|
|
@@ -13561,7 +13561,7 @@ init_aiProviderStore();
|
|
|
13561
13561
|
init_modelStore();
|
|
13562
13562
|
|
|
13563
13563
|
// src/chat/memory-modal.tsx
|
|
13564
|
-
var
|
|
13564
|
+
var import_react17 = __toESM(require("react"));
|
|
13565
13565
|
var import_styles3 = require("@mui/material/styles");
|
|
13566
13566
|
var import_material10 = require("@mui/material");
|
|
13567
13567
|
init_debugLogger();
|
|
@@ -13582,7 +13582,7 @@ var MemoryModal = ({ open, onClose }) => {
|
|
|
13582
13582
|
updateMemory: updateVectorMemory
|
|
13583
13583
|
} = useVectorStore();
|
|
13584
13584
|
const shouldUseVectorForMemories = isVectorEnabled && isAdvancedVectorFeaturesEnabled;
|
|
13585
|
-
(0,
|
|
13585
|
+
(0, import_react17.useEffect)(() => {
|
|
13586
13586
|
if (open) {
|
|
13587
13587
|
debugLogger.memoryDebug("Memory modal opened", {
|
|
13588
13588
|
isVectorEnabled,
|
|
@@ -13591,18 +13591,18 @@ var MemoryModal = ({ open, onClose }) => {
|
|
|
13591
13591
|
});
|
|
13592
13592
|
}
|
|
13593
13593
|
}, [open, isVectorEnabled, isAdvancedVectorFeaturesEnabled, shouldUseVectorForMemories]);
|
|
13594
|
-
const [newMemory, setNewMemory] = (0,
|
|
13595
|
-
const [selectedTab, setSelectedTab] = (0,
|
|
13596
|
-
const [editingId, setEditingId] = (0,
|
|
13597
|
-
const [editedContent, setEditedContent] = (0,
|
|
13598
|
-
const [multiSelectMode, setMultiSelectMode] = (0,
|
|
13599
|
-
const [selectedIds, setSelectedIds] = (0,
|
|
13600
|
-
const [confirmOpen, setConfirmOpen] = (0,
|
|
13601
|
-
const [clearAllOpen, setClearAllOpen] = (0,
|
|
13602
|
-
const [clearOption, setClearOption] = (0,
|
|
13603
|
-
const [vectorMemories, setVectorMemories] = (0,
|
|
13604
|
-
const [bulkImportOpen, setBulkImportOpen] = (0,
|
|
13605
|
-
const [importProgress, setImportProgress] = (0,
|
|
13594
|
+
const [newMemory, setNewMemory] = (0, import_react17.useState)("");
|
|
13595
|
+
const [selectedTab, setSelectedTab] = (0, import_react17.useState)("user");
|
|
13596
|
+
const [editingId, setEditingId] = (0, import_react17.useState)(null);
|
|
13597
|
+
const [editedContent, setEditedContent] = (0, import_react17.useState)("");
|
|
13598
|
+
const [multiSelectMode, setMultiSelectMode] = (0, import_react17.useState)(false);
|
|
13599
|
+
const [selectedIds, setSelectedIds] = (0, import_react17.useState)([]);
|
|
13600
|
+
const [confirmOpen, setConfirmOpen] = (0, import_react17.useState)(false);
|
|
13601
|
+
const [clearAllOpen, setClearAllOpen] = (0, import_react17.useState)(false);
|
|
13602
|
+
const [clearOption, setClearOption] = (0, import_react17.useState)("both");
|
|
13603
|
+
const [vectorMemories, setVectorMemories] = (0, import_react17.useState)([]);
|
|
13604
|
+
const [bulkImportOpen, setBulkImportOpen] = (0, import_react17.useState)(false);
|
|
13605
|
+
const [importProgress, setImportProgress] = (0, import_react17.useState)({
|
|
13606
13606
|
isImporting: false,
|
|
13607
13607
|
progress: ""
|
|
13608
13608
|
});
|
|
@@ -13655,7 +13655,7 @@ var MemoryModal = ({ open, onClose }) => {
|
|
|
13655
13655
|
setNewMemory("");
|
|
13656
13656
|
}
|
|
13657
13657
|
};
|
|
13658
|
-
(0,
|
|
13658
|
+
(0, import_react17.useEffect)(() => {
|
|
13659
13659
|
if (open && shouldUseVectorForMemories) {
|
|
13660
13660
|
const loadVectorMemories = async () => {
|
|
13661
13661
|
try {
|
|
@@ -13673,7 +13673,7 @@ var MemoryModal = ({ open, onClose }) => {
|
|
|
13673
13673
|
loadVectorMemories();
|
|
13674
13674
|
}
|
|
13675
13675
|
}, [open, shouldUseVectorForMemories, getVectorMemories]);
|
|
13676
|
-
(0,
|
|
13676
|
+
(0, import_react17.useEffect)(() => {
|
|
13677
13677
|
if (open && !shouldUseVectorForMemories) {
|
|
13678
13678
|
const loadLocalMemories = async () => {
|
|
13679
13679
|
try {
|
|
@@ -13685,7 +13685,7 @@ var MemoryModal = ({ open, onClose }) => {
|
|
|
13685
13685
|
loadLocalMemories();
|
|
13686
13686
|
}
|
|
13687
13687
|
}, [open, shouldUseVectorForMemories, hydrate]);
|
|
13688
|
-
(0,
|
|
13688
|
+
(0, import_react17.useEffect)(() => {
|
|
13689
13689
|
if (!shouldUseVectorForMemories && !_hasHydrated) {
|
|
13690
13690
|
const initialHydrate = async () => {
|
|
13691
13691
|
try {
|
|
@@ -14378,7 +14378,7 @@ var MemoryModal = ({ open, onClose }) => {
|
|
|
14378
14378
|
}, children: selectedTab === "user" ? shouldUseVectorForMemories ? "Start by adding something you'd like me to remember. Your memories will be kept in a private workspace for quick recall." : "Start by adding something you'd like me to remember about you or your preferences." : shouldUseVectorForMemories ? "Auto memories are created automatically based on our conversations and kept in your private workspace for better answers." : "Auto memories are created automatically based on our conversations." })
|
|
14379
14379
|
] }) : filteredMemories.map((memory) => {
|
|
14380
14380
|
const isSelected = selectedIds.includes(memory.id);
|
|
14381
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
14381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react17.default.Fragment, { children: [
|
|
14382
14382
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material10.List, { sx: { listStyle: "none", pl: 0, m: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
14383
14383
|
import_material10.ListItem,
|
|
14384
14384
|
{
|
|
@@ -15059,23 +15059,23 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
|
|
|
15059
15059
|
const { settings: packageSettings } = usePackageSettingsStore();
|
|
15060
15060
|
const provider = useAIProviderStore((state) => state.provider);
|
|
15061
15061
|
const { selectedModel, availableModels } = useModelStore();
|
|
15062
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
15063
|
-
const [expandedItems, setExpandedItems] = (0,
|
|
15064
|
-
const [expandedConversations, setExpandedConversations] = (0,
|
|
15065
|
-
const [confirmClearOpen, setConfirmClearOpen] = (0,
|
|
15066
|
-
const [infoDialogOpen, setInfoDialogOpen] = (0,
|
|
15067
|
-
const [memoryModalOpen, setMemoryModalOpen] = (0,
|
|
15068
|
-
const [contextMode, setContextMode] = (0,
|
|
15069
|
-
const [expandedSections, setExpandedSections] = (0,
|
|
15070
|
-
const [audioSub, setAudioSub] = (0,
|
|
15071
|
-
const [isContextSwitching, setIsContextSwitching] = (0,
|
|
15072
|
-
const [isDrawerLoading, setIsDrawerLoading] = (0,
|
|
15073
|
-
(0,
|
|
15062
|
+
const [searchTerm, setSearchTerm] = (0, import_react18.useState)("");
|
|
15063
|
+
const [expandedItems, setExpandedItems] = (0, import_react18.useState)(/* @__PURE__ */ new Set());
|
|
15064
|
+
const [expandedConversations, setExpandedConversations] = (0, import_react18.useState)(/* @__PURE__ */ new Set());
|
|
15065
|
+
const [confirmClearOpen, setConfirmClearOpen] = (0, import_react18.useState)(false);
|
|
15066
|
+
const [infoDialogOpen, setInfoDialogOpen] = (0, import_react18.useState)(false);
|
|
15067
|
+
const [memoryModalOpen, setMemoryModalOpen] = (0, import_react18.useState)(false);
|
|
15068
|
+
const [contextMode, setContextMode] = (0, import_react18.useState)("local");
|
|
15069
|
+
const [expandedSections, setExpandedSections] = (0, import_react18.useState)(/* @__PURE__ */ new Set(["history", "voice"]));
|
|
15070
|
+
const [audioSub, setAudioSub] = (0, import_react18.useState)(new import_rxjs18.Subscription());
|
|
15071
|
+
const [isContextSwitching, setIsContextSwitching] = (0, import_react18.useState)(false);
|
|
15072
|
+
const [isDrawerLoading, setIsDrawerLoading] = (0, import_react18.useState)(false);
|
|
15073
|
+
(0, import_react18.useEffect)(() => {
|
|
15074
15074
|
if (drawerOpen && !_hasHydrated) {
|
|
15075
15075
|
hydrate();
|
|
15076
15076
|
}
|
|
15077
15077
|
}, [drawerOpen, _hasHydrated, hydrate]);
|
|
15078
|
-
(0,
|
|
15078
|
+
(0, import_react18.useEffect)(() => {
|
|
15079
15079
|
if (!drawerOpen) {
|
|
15080
15080
|
setIsDrawerLoading(false);
|
|
15081
15081
|
const cleanupTimer = setTimeout(() => {
|
|
@@ -15086,7 +15086,7 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
|
|
|
15086
15086
|
return () => clearTimeout(cleanupTimer);
|
|
15087
15087
|
}
|
|
15088
15088
|
}, [drawerOpen]);
|
|
15089
|
-
(0,
|
|
15089
|
+
(0, import_react18.useEffect)(() => {
|
|
15090
15090
|
return () => {
|
|
15091
15091
|
audioSub.unsubscribe();
|
|
15092
15092
|
};
|
|
@@ -15133,7 +15133,7 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
|
|
|
15133
15133
|
const currentConversation = conversations.find((c) => c.id === currentId);
|
|
15134
15134
|
const isInitialLoading = !_hasHydrated && contextMode === "main";
|
|
15135
15135
|
const isContentLoading = isContextSwitching || isInitialLoading;
|
|
15136
|
-
(0,
|
|
15136
|
+
(0, import_react18.useEffect)(() => {
|
|
15137
15137
|
if (drawerOpen) {
|
|
15138
15138
|
const debugTimer = setTimeout(() => {
|
|
15139
15139
|
debugLogger.debug("Chat drawer loading states", {
|
|
@@ -15148,7 +15148,7 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
|
|
|
15148
15148
|
return () => clearTimeout(debugTimer);
|
|
15149
15149
|
}
|
|
15150
15150
|
}, [drawerOpen, _hasHydrated, isDrawerLoading, isContentLoading, contextMode]);
|
|
15151
|
-
(0,
|
|
15151
|
+
(0, import_react18.useEffect)(() => {
|
|
15152
15152
|
debugLogger.debug("Chat drawer voice availability check", {
|
|
15153
15153
|
isServiceAvailable,
|
|
15154
15154
|
ttsEnabled: preferences.ttsEnabled,
|
|
@@ -15159,14 +15159,14 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
|
|
|
15159
15159
|
storeState: "modal-chat-drawer-voice"
|
|
15160
15160
|
});
|
|
15161
15161
|
}, [isServiceAvailable, preferences.ttsEnabled, packageSettings?.gatewayApiUrl, isVoiceAvailable, availableVoices.length, selectedVoice]);
|
|
15162
|
-
const activeHistory = (0,
|
|
15162
|
+
const activeHistory = (0, import_react18.useMemo)(() => {
|
|
15163
15163
|
if (contextMode === "local") {
|
|
15164
15164
|
return history;
|
|
15165
15165
|
}
|
|
15166
15166
|
return currentConversation?.history ?? [];
|
|
15167
15167
|
}, [contextMode, history, currentConversation]);
|
|
15168
15168
|
const effectiveContextMode = contextMode === "main" && (!currentConversation || currentConversation.history.length === 0) ? "local" : contextMode;
|
|
15169
|
-
(0,
|
|
15169
|
+
(0, import_react18.useEffect)(() => {
|
|
15170
15170
|
debugLogger.debug("Chat drawer context state", {
|
|
15171
15171
|
contextMode,
|
|
15172
15172
|
effectiveContextMode,
|
|
@@ -15179,13 +15179,13 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
|
|
|
15179
15179
|
storeState: "modal-chat-drawer"
|
|
15180
15180
|
});
|
|
15181
15181
|
}, [contextMode, effectiveContextMode, conversations.length, currentId, currentConversation, history.length, _hasHydrated]);
|
|
15182
|
-
const filteredHistory = (0,
|
|
15182
|
+
const filteredHistory = (0, import_react18.useMemo)(() => {
|
|
15183
15183
|
const filtered = activeHistory.filter(
|
|
15184
15184
|
(entry) => entry.question.toLowerCase().includes(searchTerm.toLowerCase()) || entry.answer.toLowerCase().includes(searchTerm.toLowerCase())
|
|
15185
15185
|
);
|
|
15186
15186
|
return filtered.slice(-20);
|
|
15187
15187
|
}, [activeHistory, searchTerm]);
|
|
15188
|
-
const filteredConversations = (0,
|
|
15188
|
+
const filteredConversations = (0, import_react18.useMemo)(() => {
|
|
15189
15189
|
const filtered = conversations.filter(
|
|
15190
15190
|
(conversation) => conversation.name.toLowerCase().includes(searchTerm.toLowerCase()) || conversation.history.some(
|
|
15191
15191
|
(entry) => entry.question.toLowerCase().includes(searchTerm.toLowerCase()) || entry.answer.toLowerCase().includes(searchTerm.toLowerCase())
|
|
@@ -16071,7 +16071,7 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
|
|
|
16071
16071
|
}
|
|
16072
16072
|
) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_material11.List, { sx: { p: 0 }, children: [...filteredHistory].reverse().map((entry, index) => {
|
|
16073
16073
|
const isExpanded = expandedItems.has(index);
|
|
16074
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
16074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react18.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
16075
16075
|
import_material11.ListItem,
|
|
16076
16076
|
{
|
|
16077
16077
|
sx: {
|
|
@@ -16548,15 +16548,15 @@ var GenericLoader = ({
|
|
|
16548
16548
|
var generic_loader_default = GenericLoader;
|
|
16549
16549
|
|
|
16550
16550
|
// src/components/feedback/FeedbackButton.tsx
|
|
16551
|
-
var
|
|
16551
|
+
var import_react21 = require("react");
|
|
16552
16552
|
var import_material15 = require("@mui/material");
|
|
16553
|
-
var
|
|
16553
|
+
var import_react22 = require("@burtson-labs/icons/react");
|
|
16554
16554
|
|
|
16555
16555
|
// src/components/feedback/FeedbackModal.tsx
|
|
16556
|
-
var
|
|
16556
|
+
var import_react19 = require("react");
|
|
16557
16557
|
var import_material13 = require("@mui/material");
|
|
16558
16558
|
var import_material14 = require("@mui/material");
|
|
16559
|
-
var
|
|
16559
|
+
var import_react20 = require("@burtson-labs/icons/react");
|
|
16560
16560
|
init_modelStore();
|
|
16561
16561
|
init_packageSettingsStore();
|
|
16562
16562
|
init_gateway_service();
|
|
@@ -16618,11 +16618,11 @@ var feedbackPriorities = {
|
|
|
16618
16618
|
}
|
|
16619
16619
|
};
|
|
16620
16620
|
var iconMap = {
|
|
16621
|
-
BugReport:
|
|
16622
|
-
Lightbulb:
|
|
16623
|
-
TrendingUp:
|
|
16624
|
-
Help:
|
|
16625
|
-
Message:
|
|
16621
|
+
BugReport: import_react20.Bug,
|
|
16622
|
+
Lightbulb: import_react20.Lightbulb,
|
|
16623
|
+
TrendingUp: import_react20.TrendingUp,
|
|
16624
|
+
Help: import_react20.HelpCircle,
|
|
16625
|
+
Message: import_react20.MessageSquare
|
|
16626
16626
|
};
|
|
16627
16627
|
var FeedbackModal = ({
|
|
16628
16628
|
open,
|
|
@@ -16631,11 +16631,11 @@ var FeedbackModal = ({
|
|
|
16631
16631
|
}) => {
|
|
16632
16632
|
const theme = (0, import_styles4.useTheme)();
|
|
16633
16633
|
const isMobile = (0, import_material14.useMediaQuery)(theme.breakpoints.down("sm"));
|
|
16634
|
-
const fileInputRef = (0,
|
|
16634
|
+
const fileInputRef = (0, import_react19.useRef)(null);
|
|
16635
16635
|
const { selectedModel } = useModelStore();
|
|
16636
16636
|
const { conversations } = useConversationStore();
|
|
16637
16637
|
const { settings } = usePackageSettingsStore();
|
|
16638
|
-
const [formData, setFormData] = (0,
|
|
16638
|
+
const [formData, setFormData] = (0, import_react19.useState)({
|
|
16639
16639
|
title: "",
|
|
16640
16640
|
description: "",
|
|
16641
16641
|
category: "bug",
|
|
@@ -16646,15 +16646,15 @@ var FeedbackModal = ({
|
|
|
16646
16646
|
annoyanceLevel: 3
|
|
16647
16647
|
// 1-5 scale, 3 = neutral
|
|
16648
16648
|
});
|
|
16649
|
-
const [isSubmitting, setIsSubmitting] = (0,
|
|
16650
|
-
const [submitStatus, setSubmitStatus] = (0,
|
|
16651
|
-
const [errorMessage, setErrorMessage] = (0,
|
|
16652
|
-
const [snackbarOpen, setSnackbarOpen] = (0,
|
|
16653
|
-
const [snackbarMessage, setSnackbarMessage] = (0,
|
|
16654
|
-
const [confirmDialogOpen, setConfirmDialogOpen] = (0,
|
|
16655
|
-
const touchStartYRef = (0,
|
|
16656
|
-
const touchLatestYRef = (0,
|
|
16657
|
-
const getBrowserInfo = (0,
|
|
16649
|
+
const [isSubmitting, setIsSubmitting] = (0, import_react19.useState)(false);
|
|
16650
|
+
const [submitStatus, setSubmitStatus] = (0, import_react19.useState)("idle");
|
|
16651
|
+
const [errorMessage, setErrorMessage] = (0, import_react19.useState)("");
|
|
16652
|
+
const [snackbarOpen, setSnackbarOpen] = (0, import_react19.useState)(false);
|
|
16653
|
+
const [snackbarMessage, setSnackbarMessage] = (0, import_react19.useState)("");
|
|
16654
|
+
const [confirmDialogOpen, setConfirmDialogOpen] = (0, import_react19.useState)(false);
|
|
16655
|
+
const touchStartYRef = (0, import_react19.useRef)(null);
|
|
16656
|
+
const touchLatestYRef = (0, import_react19.useRef)(null);
|
|
16657
|
+
const getBrowserInfo = (0, import_react19.useCallback)(() => {
|
|
16658
16658
|
const ua = navigator.userAgent;
|
|
16659
16659
|
let browserName = "Unknown";
|
|
16660
16660
|
let browserVersion = "Unknown";
|
|
@@ -16764,7 +16764,7 @@ var FeedbackModal = ({
|
|
|
16764
16764
|
attachments: prev.attachments?.filter((_, i) => i !== index) || []
|
|
16765
16765
|
}));
|
|
16766
16766
|
};
|
|
16767
|
-
const getSessionInfo = (0,
|
|
16767
|
+
const getSessionInfo = (0, import_react19.useCallback)(() => {
|
|
16768
16768
|
const currentConversation = conversations[0];
|
|
16769
16769
|
return {
|
|
16770
16770
|
currentModel: selectedModel,
|
|
@@ -16861,7 +16861,7 @@ var FeedbackModal = ({
|
|
|
16861
16861
|
};
|
|
16862
16862
|
const selectedCategory = feedbackCategories[formData.category];
|
|
16863
16863
|
const selectedPriority = feedbackPriorities[formData.priority];
|
|
16864
|
-
const IconComponent = iconMap[selectedCategory?.icon] ||
|
|
16864
|
+
const IconComponent = iconMap[selectedCategory?.icon] || import_react20.MessageSquare;
|
|
16865
16865
|
const isValid = !!formData.title?.trim() && !!formData.description?.trim();
|
|
16866
16866
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
16867
16867
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material13.GlobalStyles, { styles: {
|
|
@@ -16964,7 +16964,7 @@ var FeedbackModal = ({
|
|
|
16964
16964
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material14.Typography, { variant: "h6", fontWeight: "bold", noWrap: true, children: "Send Feedback" }),
|
|
16965
16965
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material14.Typography, { variant: "body2", color: "text.secondary", noWrap: true, children: "Help us improve Bandit AI" })
|
|
16966
16966
|
] }),
|
|
16967
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material14.IconButton, { onClick: handleClose, size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
16967
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material14.IconButton, { onClick: handleClose, size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react20.X, {}) })
|
|
16968
16968
|
]
|
|
16969
16969
|
}
|
|
16970
16970
|
)
|
|
@@ -17312,7 +17312,7 @@ var FeedbackModal = ({
|
|
|
17312
17312
|
"&:hover": { borderColor: theme.palette.primary.main, color: theme.palette.primary.main }
|
|
17313
17313
|
},
|
|
17314
17314
|
children: [
|
|
17315
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
17315
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react20.Paperclip, { size: 18 }),
|
|
17316
17316
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material14.Typography, { variant: "body2", sx: { fontWeight: 500 }, children: "Attach an image" }),
|
|
17317
17317
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material14.Typography, { variant: "caption", color: "text.secondary", sx: { ml: "auto" }, children: "JPG/PNG/GIF \xB7 10MB" })
|
|
17318
17318
|
]
|
|
@@ -17343,7 +17343,7 @@ var FeedbackModal = ({
|
|
|
17343
17343
|
] }) }),
|
|
17344
17344
|
formData.images && formData.images.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_material14.Box, { sx: { mt: 2 }, children: [
|
|
17345
17345
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_material14.Box, { sx: { display: "flex", alignItems: "center", gap: 1, mb: 1.5 }, children: [
|
|
17346
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
17346
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react20.Camera, { size: 16 }),
|
|
17347
17347
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material14.Typography, { variant: "subtitle2", sx: { fontWeight: 600 }, children: "Attached Image" })
|
|
17348
17348
|
] }),
|
|
17349
17349
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_material14.Box, { sx: { display: "flex", gap: 1.5 }, children: [
|
|
@@ -17393,7 +17393,7 @@ var FeedbackModal = ({
|
|
|
17393
17393
|
transform: "scale(1.1)"
|
|
17394
17394
|
}
|
|
17395
17395
|
},
|
|
17396
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
17396
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react20.Trash, { size: 14 })
|
|
17397
17397
|
}
|
|
17398
17398
|
)
|
|
17399
17399
|
]
|
|
@@ -17406,7 +17406,7 @@ var FeedbackModal = ({
|
|
|
17406
17406
|
variant: "outlined",
|
|
17407
17407
|
size: "small",
|
|
17408
17408
|
onClick: copyImageToClipboard,
|
|
17409
|
-
startIcon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
17409
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react20.Paperclip, {}),
|
|
17410
17410
|
sx: {
|
|
17411
17411
|
mb: 1,
|
|
17412
17412
|
borderColor: theme.palette.primary.main + "50",
|
|
@@ -17434,7 +17434,7 @@ var FeedbackModal = ({
|
|
|
17434
17434
|
{
|
|
17435
17435
|
label: attachment.name,
|
|
17436
17436
|
onDelete: () => removeAttachment(index),
|
|
17437
|
-
deleteIcon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
17437
|
+
deleteIcon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react20.Trash, {}),
|
|
17438
17438
|
variant: "outlined",
|
|
17439
17439
|
sx: { maxWidth: 200 }
|
|
17440
17440
|
},
|
|
@@ -17471,7 +17471,7 @@ var FeedbackModal = ({
|
|
|
17471
17471
|
import_material14.Button,
|
|
17472
17472
|
{
|
|
17473
17473
|
fullWidth: true,
|
|
17474
|
-
startIcon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
17474
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react20.Mail, {}),
|
|
17475
17475
|
disabled: !isValid,
|
|
17476
17476
|
onClick: handleSubmit,
|
|
17477
17477
|
variant: "contained",
|
|
@@ -17537,7 +17537,7 @@ var FeedbackModal = ({
|
|
|
17537
17537
|
width: 40,
|
|
17538
17538
|
height: 40
|
|
17539
17539
|
},
|
|
17540
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
17540
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react20.Camera, {})
|
|
17541
17541
|
}
|
|
17542
17542
|
),
|
|
17543
17543
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_material14.Box, { children: [
|
|
@@ -17629,7 +17629,7 @@ var FeedbackModal = ({
|
|
|
17629
17629
|
variant: "contained",
|
|
17630
17630
|
onClick: performSubmit,
|
|
17631
17631
|
disabled: isSubmitting,
|
|
17632
|
-
startIcon: isSubmitting ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material14.CircularProgress, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
17632
|
+
startIcon: isSubmitting ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material14.CircularProgress, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react20.Mail, {}),
|
|
17633
17633
|
sx: {
|
|
17634
17634
|
background: `linear-gradient(135deg, ${theme.palette.primary.main} 0%, ${theme.palette.primary.dark} 100%)`,
|
|
17635
17635
|
"&:hover": {
|
|
@@ -17660,7 +17660,7 @@ var FeedbackButton = ({
|
|
|
17660
17660
|
absolute = false
|
|
17661
17661
|
}) => {
|
|
17662
17662
|
const theme = (0, import_material15.useTheme)();
|
|
17663
|
-
const [open, setOpen] = (0,
|
|
17663
|
+
const [open, setOpen] = (0, import_react21.useState)(false);
|
|
17664
17664
|
const handleOpen = () => setOpen(true);
|
|
17665
17665
|
const handleClose = () => setOpen(false);
|
|
17666
17666
|
if (inline) {
|
|
@@ -17669,7 +17669,7 @@ var FeedbackButton = ({
|
|
|
17669
17669
|
import_material15.Button,
|
|
17670
17670
|
{
|
|
17671
17671
|
variant: "outlined",
|
|
17672
|
-
startIcon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
17672
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react22.MessageCircle, {}),
|
|
17673
17673
|
onClick: handleOpen,
|
|
17674
17674
|
className,
|
|
17675
17675
|
size,
|
|
@@ -17698,7 +17698,7 @@ var FeedbackButton = ({
|
|
|
17698
17698
|
transform: "translateY(-1px)"
|
|
17699
17699
|
}
|
|
17700
17700
|
},
|
|
17701
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
17701
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react22.MessageCircle, {})
|
|
17702
17702
|
}
|
|
17703
17703
|
) }),
|
|
17704
17704
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
@@ -17757,7 +17757,7 @@ var FeedbackButton = ({
|
|
|
17757
17757
|
}
|
|
17758
17758
|
}
|
|
17759
17759
|
},
|
|
17760
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
17760
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react22.MessageCircle, {})
|
|
17761
17761
|
}
|
|
17762
17762
|
)
|
|
17763
17763
|
}
|
|
@@ -17774,7 +17774,7 @@ var FeedbackButton = ({
|
|
|
17774
17774
|
};
|
|
17775
17775
|
|
|
17776
17776
|
// src/hooks/useAiChat.ts
|
|
17777
|
-
var
|
|
17777
|
+
var import_react23 = require("react");
|
|
17778
17778
|
var import_material16 = require("@mui/material");
|
|
17779
17779
|
init_aiProviderStore();
|
|
17780
17780
|
init_modelStore();
|
|
@@ -17785,10 +17785,10 @@ var useAIChat = () => {
|
|
|
17785
17785
|
const provider = useAIProviderStore((state) => state.provider);
|
|
17786
17786
|
const SYSTEM_PROMPT = useModelStore((state) => state.systemPrompt);
|
|
17787
17787
|
const OLLAMA_MODEL = usePackageSettingsStore((state) => state.settings?.defaultModel || "");
|
|
17788
|
-
const [fullScreen, setFullScreen] = (0,
|
|
17789
|
-
const [drawerOpen, setDrawerOpen] = (0,
|
|
17790
|
-
const [showSettings, setShowSettings] = (0,
|
|
17791
|
-
const [, setAutoFullscreenTriggered] = (0,
|
|
17788
|
+
const [fullScreen, setFullScreen] = (0, import_react23.useState)(isMobile);
|
|
17789
|
+
const [drawerOpen, setDrawerOpen] = (0, import_react23.useState)(false);
|
|
17790
|
+
const [showSettings, setShowSettings] = (0, import_react23.useState)(false);
|
|
17791
|
+
const [, setAutoFullscreenTriggered] = (0, import_react23.useState)(false);
|
|
17792
17792
|
const {
|
|
17793
17793
|
apiKey,
|
|
17794
17794
|
inputValue,
|
|
@@ -17876,7 +17876,7 @@ var useAIChat = () => {
|
|
|
17876
17876
|
}
|
|
17877
17877
|
sendWithAIProvider();
|
|
17878
17878
|
};
|
|
17879
|
-
(0,
|
|
17879
|
+
(0, import_react23.useEffect)(() => {
|
|
17880
17880
|
setFullScreen(isMobile);
|
|
17881
17881
|
}, [isMobile]);
|
|
17882
17882
|
return {
|
|
@@ -17892,12 +17892,12 @@ var useAIChat = () => {
|
|
|
17892
17892
|
var useAiChat_default = useAIChat;
|
|
17893
17893
|
|
|
17894
17894
|
// src/hooks/useDraggable.ts
|
|
17895
|
-
var
|
|
17895
|
+
var import_react24 = require("react");
|
|
17896
17896
|
var useDraggable = () => {
|
|
17897
|
-
const modalRef = (0,
|
|
17898
|
-
const [dragging, setDragging] = (0,
|
|
17899
|
-
const [offset, setOffset] = (0,
|
|
17900
|
-
const [position, setPosition] = (0,
|
|
17897
|
+
const modalRef = (0, import_react24.useRef)(null);
|
|
17898
|
+
const [dragging, setDragging] = (0, import_react24.useState)(false);
|
|
17899
|
+
const [offset, setOffset] = (0, import_react24.useState)({ x: 0, y: 0 });
|
|
17900
|
+
const [position, setPosition] = (0, import_react24.useState)({ x: 0, y: 0 });
|
|
17901
17901
|
const handleHeaderMouseDown = (e) => {
|
|
17902
17902
|
const rect = modalRef.current?.getBoundingClientRect();
|
|
17903
17903
|
if (rect) {
|
|
@@ -17905,7 +17905,7 @@ var useDraggable = () => {
|
|
|
17905
17905
|
setDragging(true);
|
|
17906
17906
|
}
|
|
17907
17907
|
};
|
|
17908
|
-
const handleHeaderMouseMove = (0,
|
|
17908
|
+
const handleHeaderMouseMove = (0, import_react24.useCallback)(
|
|
17909
17909
|
(e) => {
|
|
17910
17910
|
if (dragging) {
|
|
17911
17911
|
setPosition({ x: e.clientX - offset.x, y: e.clientY - offset.y });
|
|
@@ -17916,7 +17916,7 @@ var useDraggable = () => {
|
|
|
17916
17916
|
const handleHeaderMouseUp = () => {
|
|
17917
17917
|
setDragging(false);
|
|
17918
17918
|
};
|
|
17919
|
-
(0,
|
|
17919
|
+
(0, import_react24.useEffect)(() => {
|
|
17920
17920
|
if (dragging) {
|
|
17921
17921
|
document.addEventListener("mousemove", handleHeaderMouseMove);
|
|
17922
17922
|
document.addEventListener("mouseup", handleHeaderMouseUp);
|
|
@@ -17945,15 +17945,15 @@ init_preferencesStore();
|
|
|
17945
17945
|
init_packageSettingsStore();
|
|
17946
17946
|
|
|
17947
17947
|
// src/hooks/useNotificationService.ts
|
|
17948
|
-
var
|
|
17948
|
+
var import_react26 = require("react");
|
|
17949
17949
|
|
|
17950
17950
|
// src/shared/components/NotificationProvider.tsx
|
|
17951
|
-
var
|
|
17951
|
+
var import_react25 = require("react");
|
|
17952
17952
|
var import_material17 = require("@mui/material");
|
|
17953
17953
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
17954
|
-
var NotificationContext = (0,
|
|
17954
|
+
var NotificationContext = (0, import_react25.createContext)(void 0);
|
|
17955
17955
|
var useNotification = () => {
|
|
17956
|
-
const context = (0,
|
|
17956
|
+
const context = (0, import_react25.useContext)(NotificationContext);
|
|
17957
17957
|
if (!context) {
|
|
17958
17958
|
throw new Error("useNotification must be used within a NotificationProvider");
|
|
17959
17959
|
}
|
|
@@ -17963,7 +17963,7 @@ var useNotification = () => {
|
|
|
17963
17963
|
// src/hooks/useNotificationService.ts
|
|
17964
17964
|
var useNotificationService = () => {
|
|
17965
17965
|
const notificationContext = useNotification();
|
|
17966
|
-
(0,
|
|
17966
|
+
(0, import_react26.useEffect)(() => {
|
|
17967
17967
|
notificationService.setContext(notificationContext);
|
|
17968
17968
|
}, [notificationContext]);
|
|
17969
17969
|
return {
|
|
@@ -20430,7 +20430,7 @@ var modelAvatars = {
|
|
|
20430
20430
|
"Bandit-Exec": `${CDN_BASE}/avatars/exec-avatar.png`
|
|
20431
20431
|
};
|
|
20432
20432
|
var useOptionalNavigate = () => {
|
|
20433
|
-
const hasLoggedRef = (0,
|
|
20433
|
+
const hasLoggedRef = (0, import_react27.useRef)(false);
|
|
20434
20434
|
try {
|
|
20435
20435
|
return (0, import_react_router_dom.useNavigate)();
|
|
20436
20436
|
} catch (error) {
|
|
@@ -20479,17 +20479,17 @@ var ChatModal = ({
|
|
|
20479
20479
|
handleSend
|
|
20480
20480
|
} = useAiChat_default();
|
|
20481
20481
|
const { modalRef, position, setPosition, handleDrag, handleHeaderMouseDown } = useDraggable_default();
|
|
20482
|
-
const [pastedImages, setPastedImages] = (0,
|
|
20483
|
-
const [responseStarted, setResponseStarted] = (0,
|
|
20484
|
-
const [modalLogo, setModalLogo] = (0,
|
|
20485
|
-
const [modelAnchorEl, setModelAnchorEl] = (0,
|
|
20486
|
-
const [voiceAnchorEl, setVoiceAnchorEl] = (0,
|
|
20487
|
-
const [audioSub, setAudioSub] = (0,
|
|
20488
|
-
const [selectedTheme, setSelectedTheme] = (0,
|
|
20489
|
-
const [themeLoading, setThemeLoading] = (0,
|
|
20490
|
-
const [autoFullscreenTriggered, setAutoFullscreenTriggered] = (0,
|
|
20491
|
-
const [userHasDragged, setUserHasDragged] = (0,
|
|
20492
|
-
const [manualFullscreenToggleTime, setManualFullscreenToggleTime] = (0,
|
|
20482
|
+
const [pastedImages, setPastedImages] = (0, import_react27.useState)([]);
|
|
20483
|
+
const [responseStarted, setResponseStarted] = (0, import_react27.useState)(false);
|
|
20484
|
+
const [modalLogo, setModalLogo] = (0, import_react27.useState)("https://cdn.burtson.ai/logos/bandit-ai-logo.png");
|
|
20485
|
+
const [modelAnchorEl, setModelAnchorEl] = (0, import_react27.useState)(null);
|
|
20486
|
+
const [voiceAnchorEl, setVoiceAnchorEl] = (0, import_react27.useState)(null);
|
|
20487
|
+
const [audioSub, setAudioSub] = (0, import_react27.useState)(new import_rxjs19.Subscription());
|
|
20488
|
+
const [selectedTheme, setSelectedTheme] = (0, import_react27.useState)(null);
|
|
20489
|
+
const [themeLoading, setThemeLoading] = (0, import_react27.useState)(true);
|
|
20490
|
+
const [autoFullscreenTriggered, setAutoFullscreenTriggered] = (0, import_react27.useState)(false);
|
|
20491
|
+
const [userHasDragged, setUserHasDragged] = (0, import_react27.useState)(false);
|
|
20492
|
+
const [manualFullscreenToggleTime, setManualFullscreenToggleTime] = (0, import_react27.useState)(0);
|
|
20493
20493
|
const handleExitFullscreen = () => {
|
|
20494
20494
|
setPosition({
|
|
20495
20495
|
x: Math.max(0, window.innerWidth / 2 - 300),
|
|
@@ -20535,7 +20535,7 @@ var ChatModal = ({
|
|
|
20535
20535
|
const toTitleCase2 = (str) => {
|
|
20536
20536
|
return str.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());
|
|
20537
20537
|
};
|
|
20538
|
-
(0,
|
|
20538
|
+
(0, import_react27.useEffect)(() => {
|
|
20539
20539
|
if (!SYSTEM_PROMPT) {
|
|
20540
20540
|
const defaultModel = availableModels.length > 0 ? availableModels[0] : null;
|
|
20541
20541
|
if (defaultModel) {
|
|
@@ -20543,12 +20543,12 @@ var ChatModal = ({
|
|
|
20543
20543
|
}
|
|
20544
20544
|
}
|
|
20545
20545
|
}, [SYSTEM_PROMPT, availableModels, setSelectedModel]);
|
|
20546
|
-
(0,
|
|
20546
|
+
(0, import_react27.useEffect)(() => {
|
|
20547
20547
|
return () => {
|
|
20548
20548
|
audioSub.unsubscribe();
|
|
20549
20549
|
};
|
|
20550
20550
|
}, [audioSub]);
|
|
20551
|
-
(0,
|
|
20551
|
+
(0, import_react27.useEffect)(() => {
|
|
20552
20552
|
if (open) {
|
|
20553
20553
|
setPosition({
|
|
20554
20554
|
x: Math.max(0, window.innerWidth / 2 - 300),
|
|
@@ -20560,7 +20560,7 @@ var ChatModal = ({
|
|
|
20560
20560
|
getOptimalLogo().then(setModalLogo);
|
|
20561
20561
|
}
|
|
20562
20562
|
}, [open, setPosition]);
|
|
20563
|
-
(0,
|
|
20563
|
+
(0, import_react27.useEffect)(() => {
|
|
20564
20564
|
if (!open) return;
|
|
20565
20565
|
const fetchTheme = async () => {
|
|
20566
20566
|
try {
|
|
@@ -20594,7 +20594,7 @@ var ChatModal = ({
|
|
|
20594
20594
|
window.removeEventListener("bandit-theme-changed", handleThemeChange);
|
|
20595
20595
|
};
|
|
20596
20596
|
}, [open]);
|
|
20597
|
-
(0,
|
|
20597
|
+
(0, import_react27.useLayoutEffect)(() => {
|
|
20598
20598
|
const timeSinceManualToggle = Date.now() - manualFullscreenToggleTime;
|
|
20599
20599
|
const manualToggleRecentlyUsed = timeSinceManualToggle < 5e3;
|
|
20600
20600
|
if (modalRef.current && response && !fullScreen && !autoFullscreenTriggered && !manualToggleRecentlyUsed) {
|
|
@@ -20619,7 +20619,7 @@ var ChatModal = ({
|
|
|
20619
20619
|
setFullScreen,
|
|
20620
20620
|
setAutoFullscreenTriggered
|
|
20621
20621
|
]);
|
|
20622
|
-
(0,
|
|
20622
|
+
(0, import_react27.useEffect)(() => {
|
|
20623
20623
|
const handlePaste = (e) => {
|
|
20624
20624
|
const items = e.clipboardData?.items;
|
|
20625
20625
|
if (items) {
|
|
@@ -20644,7 +20644,7 @@ var ChatModal = ({
|
|
|
20644
20644
|
document.removeEventListener("paste", handlePaste);
|
|
20645
20645
|
};
|
|
20646
20646
|
}, []);
|
|
20647
|
-
(0,
|
|
20647
|
+
(0, import_react27.useEffect)(() => {
|
|
20648
20648
|
if (response && !responseStarted) {
|
|
20649
20649
|
setResponseStarted(true);
|
|
20650
20650
|
}
|