@burtson-labs/bandit-engine 2.0.81 → 2.0.82
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-EY3MIZVY.mjs → chat-WYUPU7KD.mjs} +2 -2
- package/dist/{chunk-VXK5FNOU.mjs → chunk-NB3N4BKW.mjs} +756 -639
- package/dist/chunk-NB3N4BKW.mjs.map +1 -0
- package/dist/{chunk-RZFI2HR4.mjs → chunk-ZMXWFP65.mjs} +2 -2
- package/dist/index.js +3555 -3433
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/management/management.js +1128 -1006
- package/dist/management/management.js.map +1 -1
- package/dist/management/management.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-VXK5FNOU.mjs.map +0 -1
- /package/dist/{chat-EY3MIZVY.mjs.map → chat-WYUPU7KD.mjs.map} +0 -0
- /package/dist/{chunk-RZFI2HR4.mjs.map → chunk-ZMXWFP65.mjs.map} +0 -0
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
} from "./chunk-KCI46M23.mjs";
|
|
85
85
|
|
|
86
86
|
// src/chat/chat.tsx
|
|
87
|
-
import { useCallback as useCallback6, useEffect as useEffect15, useLayoutEffect, useMemo as
|
|
87
|
+
import { useCallback as useCallback6, useEffect as useEffect15, useLayoutEffect, useMemo as useMemo4, useRef as useRef13, useState as useState16 } from "react";
|
|
88
88
|
|
|
89
89
|
// src/chat/custom-logo.tsx
|
|
90
90
|
import React, { useEffect } from "react";
|
|
@@ -171,7 +171,7 @@ var Logo = ({ visible, atTop = false }) => {
|
|
|
171
171
|
var custom_logo_default = Logo;
|
|
172
172
|
|
|
173
173
|
// src/chat/chat.tsx
|
|
174
|
-
import { Box as
|
|
174
|
+
import { Box as Box16, ThemeProvider, CssBaseline, CircularProgress as CircularProgress4, Typography as Typography11 } from "@mui/material";
|
|
175
175
|
import { createTheme } from "@mui/material/styles";
|
|
176
176
|
import { Navigate } from "react-router-dom";
|
|
177
177
|
|
|
@@ -248,8 +248,122 @@ var BanditChatLogo = ({ atTop = false, visible = false }) => {
|
|
|
248
248
|
var bandit_chat_logo_default = BanditChatLogo;
|
|
249
249
|
|
|
250
250
|
// src/chat/chat-messages.tsx
|
|
251
|
-
import { Box as
|
|
251
|
+
import { Box as Box3 } from "@mui/material";
|
|
252
|
+
|
|
253
|
+
// src/chat/source-chips.tsx
|
|
254
|
+
import { useMemo, useState as useState2 } from "react";
|
|
255
|
+
import { Box as Box2, Tooltip } from "@mui/material";
|
|
252
256
|
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
257
|
+
var parseWebSources = (content) => {
|
|
258
|
+
if (!content) return [];
|
|
259
|
+
const idx = content.lastIndexOf("**Sources**");
|
|
260
|
+
if (idx === -1) return [];
|
|
261
|
+
const section = content.slice(idx);
|
|
262
|
+
const out = [];
|
|
263
|
+
const re = /^\s*[-*]\s*\[([^\]]+)\]\(([^)\s]+)\)/gm;
|
|
264
|
+
let m;
|
|
265
|
+
while ((m = re.exec(section)) !== null) {
|
|
266
|
+
const url = m[2].trim();
|
|
267
|
+
if (/^https?:\/\//i.test(url)) {
|
|
268
|
+
out.push({ title: m[1].trim(), url });
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
const seen = /* @__PURE__ */ new Set();
|
|
272
|
+
return out.filter((s) => seen.has(s.url) ? false : (seen.add(s.url), true));
|
|
273
|
+
};
|
|
274
|
+
var domainOf = (url) => {
|
|
275
|
+
try {
|
|
276
|
+
return new URL(url).hostname.replace(/^www\./, "");
|
|
277
|
+
} catch {
|
|
278
|
+
return url;
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
var SourceChip = ({ source }) => {
|
|
282
|
+
const [failed, setFailed] = useState2(false);
|
|
283
|
+
const domain = domainOf(source.url);
|
|
284
|
+
const label = source.title?.trim() || domain;
|
|
285
|
+
return /* @__PURE__ */ jsx4(Tooltip, { title: `${label} \xB7 ${domain}`, arrow: true, children: /* @__PURE__ */ jsxs(
|
|
286
|
+
Box2,
|
|
287
|
+
{
|
|
288
|
+
component: "a",
|
|
289
|
+
href: source.url,
|
|
290
|
+
target: "_blank",
|
|
291
|
+
rel: "noopener noreferrer",
|
|
292
|
+
sx: {
|
|
293
|
+
display: "inline-flex",
|
|
294
|
+
alignItems: "center",
|
|
295
|
+
gap: 0.75,
|
|
296
|
+
maxWidth: 240,
|
|
297
|
+
px: 1,
|
|
298
|
+
py: 0.4,
|
|
299
|
+
borderRadius: 999,
|
|
300
|
+
border: "1px solid",
|
|
301
|
+
borderColor: "divider",
|
|
302
|
+
bgcolor: "action.hover",
|
|
303
|
+
textDecoration: "none",
|
|
304
|
+
color: "text.primary",
|
|
305
|
+
fontSize: 12.5,
|
|
306
|
+
lineHeight: 1.4,
|
|
307
|
+
transition: "border-color 0.15s ease, background-color 0.15s ease",
|
|
308
|
+
"&:hover": { borderColor: "primary.main", bgcolor: "action.selected" }
|
|
309
|
+
},
|
|
310
|
+
children: [
|
|
311
|
+
failed ? /* @__PURE__ */ jsx4(
|
|
312
|
+
Box2,
|
|
313
|
+
{
|
|
314
|
+
sx: {
|
|
315
|
+
width: 16,
|
|
316
|
+
height: 16,
|
|
317
|
+
borderRadius: "4px",
|
|
318
|
+
bgcolor: "primary.main",
|
|
319
|
+
color: "primary.contrastText",
|
|
320
|
+
display: "grid",
|
|
321
|
+
placeItems: "center",
|
|
322
|
+
fontSize: 9,
|
|
323
|
+
fontWeight: 700,
|
|
324
|
+
flexShrink: 0
|
|
325
|
+
},
|
|
326
|
+
children: domain.charAt(0).toUpperCase()
|
|
327
|
+
}
|
|
328
|
+
) : /* @__PURE__ */ jsx4(
|
|
329
|
+
Box2,
|
|
330
|
+
{
|
|
331
|
+
component: "img",
|
|
332
|
+
src: `https://icons.duckduckgo.com/ip3/${domain}.ico`,
|
|
333
|
+
alt: "",
|
|
334
|
+
loading: "lazy",
|
|
335
|
+
onError: () => setFailed(true),
|
|
336
|
+
sx: { width: 16, height: 16, borderRadius: "4px", flexShrink: 0 }
|
|
337
|
+
}
|
|
338
|
+
),
|
|
339
|
+
/* @__PURE__ */ jsx4(
|
|
340
|
+
Box2,
|
|
341
|
+
{
|
|
342
|
+
component: "span",
|
|
343
|
+
sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
|
|
344
|
+
children: label
|
|
345
|
+
}
|
|
346
|
+
)
|
|
347
|
+
]
|
|
348
|
+
}
|
|
349
|
+
) });
|
|
350
|
+
};
|
|
351
|
+
var SourceChips = ({ content }) => {
|
|
352
|
+
const sources = useMemo(() => parseWebSources(content), [content]);
|
|
353
|
+
if (sources.length === 0) return null;
|
|
354
|
+
return /* @__PURE__ */ jsx4(
|
|
355
|
+
Box2,
|
|
356
|
+
{
|
|
357
|
+
sx: { display: "flex", flexWrap: "wrap", gap: 0.75, mt: 1.5 },
|
|
358
|
+
"aria-label": "Sources",
|
|
359
|
+
children: sources.map((s, i) => /* @__PURE__ */ jsx4(SourceChip, { source: s }, `${s.url}-${i}`))
|
|
360
|
+
}
|
|
361
|
+
);
|
|
362
|
+
};
|
|
363
|
+
var source_chips_default = SourceChips;
|
|
364
|
+
|
|
365
|
+
// src/chat/chat-messages.tsx
|
|
366
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
253
367
|
var ChatMessages = ({
|
|
254
368
|
pendingMessage,
|
|
255
369
|
streamBuffer,
|
|
@@ -269,7 +383,7 @@ var ChatMessages = ({
|
|
|
269
383
|
const lastIndex = history.length - 1;
|
|
270
384
|
const hasActivePlaceholder = lastIndex >= 0 && history[lastIndex]?.answer === "...";
|
|
271
385
|
if (!responseStarted && !pendingMessage && history.length === 0) return null;
|
|
272
|
-
return /* @__PURE__ */
|
|
386
|
+
return /* @__PURE__ */ jsxs2(Box3, { sx: { px: isMobile ? 0 : 0, pt: "100px", display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
273
387
|
history.map((entry, index) => {
|
|
274
388
|
const isLast = index === lastIndex;
|
|
275
389
|
const isPlaceholder = entry.answer === "...";
|
|
@@ -278,8 +392,8 @@ var ChatMessages = ({
|
|
|
278
392
|
const content = isLast ? isStreaming ? streamBuffer || "" : isPlaceholder ? "" : entry.answer : entry.answer;
|
|
279
393
|
const rawSources = entry.sourceFiles;
|
|
280
394
|
const sourceSummaries = rawSources ? rawSources.filter((doc) => doc && typeof doc.name === "string" && doc.name.trim()).map((doc) => ({ id: doc.id || doc.name, name: doc.name.trim() })) : void 0;
|
|
281
|
-
const responseNode = /* @__PURE__ */
|
|
282
|
-
|
|
395
|
+
const responseNode = /* @__PURE__ */ jsxs2(
|
|
396
|
+
Box3,
|
|
283
397
|
{
|
|
284
398
|
sx: {
|
|
285
399
|
minHeight: isLast ? isMobile ? "80px" : "60px" : void 0,
|
|
@@ -288,8 +402,8 @@ var ChatMessages = ({
|
|
|
288
402
|
transition: "min-height 0.25s cubic-bezier(0.4, 0, 0.2, 1)"
|
|
289
403
|
},
|
|
290
404
|
children: [
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
|
|
405
|
+
/* @__PURE__ */ jsx5(
|
|
406
|
+
Box3,
|
|
293
407
|
{
|
|
294
408
|
sx: {
|
|
295
409
|
position: showLoader ? "static" : "absolute",
|
|
@@ -302,14 +416,14 @@ var ChatMessages = ({
|
|
|
302
416
|
pointerEvents: showLoader ? "auto" : "none",
|
|
303
417
|
zIndex: showLoader ? 1 : 0
|
|
304
418
|
},
|
|
305
|
-
children: /* @__PURE__ */
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
/* @__PURE__ */
|
|
309
|
-
/* @__PURE__ */
|
|
419
|
+
children: /* @__PURE__ */ jsxs2(Box3, { sx: { display: "flex", alignItems: "center", gap: 1, minHeight: "40px", pl: 2 }, children: [
|
|
420
|
+
/* @__PURE__ */ jsxs2("div", { className: "typing-only", children: [
|
|
421
|
+
/* @__PURE__ */ jsx5("span", { className: "dot" }),
|
|
422
|
+
/* @__PURE__ */ jsx5("span", { className: "dot" }),
|
|
423
|
+
/* @__PURE__ */ jsx5("span", { className: "dot" })
|
|
310
424
|
] }),
|
|
311
|
-
showThinking && /* @__PURE__ */
|
|
312
|
-
|
|
425
|
+
showThinking && /* @__PURE__ */ jsx5(
|
|
426
|
+
Box3,
|
|
313
427
|
{
|
|
314
428
|
component: "span",
|
|
315
429
|
sx: {
|
|
@@ -325,8 +439,8 @@ var ChatMessages = ({
|
|
|
325
439
|
] })
|
|
326
440
|
}
|
|
327
441
|
),
|
|
328
|
-
/* @__PURE__ */
|
|
329
|
-
|
|
442
|
+
/* @__PURE__ */ jsxs2(
|
|
443
|
+
Box3,
|
|
330
444
|
{
|
|
331
445
|
sx: {
|
|
332
446
|
position: showLoader ? "absolute" : "static",
|
|
@@ -339,20 +453,23 @@ var ChatMessages = ({
|
|
|
339
453
|
pointerEvents: showLoader ? "none" : "auto",
|
|
340
454
|
zIndex: 1
|
|
341
455
|
},
|
|
342
|
-
children:
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
456
|
+
children: [
|
|
457
|
+
/* @__PURE__ */ jsx5(
|
|
458
|
+
StreamingMarkdown_default,
|
|
459
|
+
{
|
|
460
|
+
content,
|
|
461
|
+
isStreaming: isStreaming && isLast,
|
|
462
|
+
sources: sourceSummaries
|
|
463
|
+
}
|
|
464
|
+
),
|
|
465
|
+
/* @__PURE__ */ jsx5(source_chips_default, { content })
|
|
466
|
+
]
|
|
350
467
|
}
|
|
351
468
|
)
|
|
352
469
|
]
|
|
353
470
|
}
|
|
354
471
|
);
|
|
355
|
-
return /* @__PURE__ */
|
|
472
|
+
return /* @__PURE__ */ jsx5(Box3, { children: /* @__PURE__ */ jsx5(
|
|
356
473
|
ai_response_text_field_default,
|
|
357
474
|
{
|
|
358
475
|
question: entry.question,
|
|
@@ -367,17 +484,17 @@ var ChatMessages = ({
|
|
|
367
484
|
}
|
|
368
485
|
) }, index);
|
|
369
486
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ jsx5("div", { style: { height: "1px" }, ref: scrollTargetRef })
|
|
371
488
|
] });
|
|
372
489
|
};
|
|
373
490
|
var chat_messages_default = ChatMessages;
|
|
374
491
|
|
|
375
492
|
// src/chat/chat-input.tsx
|
|
376
|
-
import { useEffect as useEffect3, useRef as useRef2, useState as
|
|
377
|
-
import { Box as
|
|
493
|
+
import { useEffect as useEffect3, useRef as useRef2, useState as useState4 } from "react";
|
|
494
|
+
import { Box as Box4, TextField, IconButton as IconButton3, Tooltip as Tooltip2, Avatar as Avatar2, Typography, CircularProgress as CircularProgress2, Collapse } from "@mui/material";
|
|
378
495
|
|
|
379
496
|
// src/services/stt/transcriber.tsx
|
|
380
|
-
import { useState as
|
|
497
|
+
import { useState as useState3, useRef } from "react";
|
|
381
498
|
|
|
382
499
|
// src/services/stt/sound-recorder.service.ts
|
|
383
500
|
import { first, from, fromEvent, map, shareReplay, switchMap } from "rxjs";
|
|
@@ -523,7 +640,7 @@ var STTClient = class {
|
|
|
523
640
|
// src/services/stt/transcriber.tsx
|
|
524
641
|
import { CircularProgress, IconButton as IconButton2, useTheme as useTheme3 } from "@mui/material";
|
|
525
642
|
import { from as from2, Subscription, switchMap as switchMap2 } from "rxjs";
|
|
526
|
-
import { Fragment as Fragment2, jsx as
|
|
643
|
+
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
527
644
|
var initialButtonStyles = (badgeBackground, fileText, hoverBadgeBackground) => ({
|
|
528
645
|
bgcolor: badgeBackground,
|
|
529
646
|
color: fileText,
|
|
@@ -537,10 +654,10 @@ var Transcriber = ({ onTranscriptionCompleted }) => {
|
|
|
537
654
|
const badgeBackground = theme.palette.chat.badge;
|
|
538
655
|
const fileText = theme.palette.chat.fileText;
|
|
539
656
|
const hoverBadgeBackground = theme.palette.chat.badgeHover;
|
|
540
|
-
const [status, setStatus] =
|
|
657
|
+
const [status, setStatus] = useState3("IDLE");
|
|
541
658
|
const recorderRef = useRef(new SoundRecorderService());
|
|
542
|
-
const [iconButtonStyles] =
|
|
543
|
-
const [recordingSub, setRecordingSub] =
|
|
659
|
+
const [iconButtonStyles] = useState3(() => initialButtonStyles(badgeBackground, fileText, hoverBadgeBackground));
|
|
660
|
+
const [recordingSub, setRecordingSub] = useState3(() => new Subscription());
|
|
544
661
|
const start = () => {
|
|
545
662
|
recordingSub.unsubscribe();
|
|
546
663
|
const recording = recorderRef.current.start();
|
|
@@ -571,7 +688,7 @@ var Transcriber = ({ onTranscriptionCompleted }) => {
|
|
|
571
688
|
setStatus("LOADING");
|
|
572
689
|
stop();
|
|
573
690
|
};
|
|
574
|
-
return /* @__PURE__ */
|
|
691
|
+
return /* @__PURE__ */ jsx6(
|
|
575
692
|
"div",
|
|
576
693
|
{
|
|
577
694
|
style: {
|
|
@@ -581,16 +698,16 @@ var Transcriber = ({ onTranscriptionCompleted }) => {
|
|
|
581
698
|
backgroundColor: status === "RECORDING" ? "rgba(0,0,0,.3)" : "rgba(0,0,0,0)",
|
|
582
699
|
borderRadius: "50px"
|
|
583
700
|
},
|
|
584
|
-
children: status === "IDLE" ? /* @__PURE__ */
|
|
585
|
-
/* @__PURE__ */
|
|
701
|
+
children: status === "IDLE" ? /* @__PURE__ */ jsx6(IconButton2, { sx: { ...iconButtonStyles }, onClick: handleRecordClick, children: /* @__PURE__ */ jsx6(MicIcon, { sx: { color: "#aaa", cursor: "pointer" } }) }) : status === "RECORDING" ? /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
702
|
+
/* @__PURE__ */ jsx6(
|
|
586
703
|
IconButton2,
|
|
587
704
|
{
|
|
588
705
|
onClick: handleCancelClick,
|
|
589
706
|
sx: { ...iconButtonStyles, marginRight: 1 },
|
|
590
|
-
children: /* @__PURE__ */
|
|
707
|
+
children: /* @__PURE__ */ jsx6(CloseIcon, {})
|
|
591
708
|
}
|
|
592
709
|
),
|
|
593
|
-
/* @__PURE__ */
|
|
710
|
+
/* @__PURE__ */ jsx6(
|
|
594
711
|
IconButton2,
|
|
595
712
|
{
|
|
596
713
|
sx: {
|
|
@@ -598,10 +715,10 @@ var Transcriber = ({ onTranscriptionCompleted }) => {
|
|
|
598
715
|
filter: "invert(110%)"
|
|
599
716
|
},
|
|
600
717
|
onClick: handleSubmitClick,
|
|
601
|
-
children: /* @__PURE__ */
|
|
718
|
+
children: /* @__PURE__ */ jsx6(CheckIcon, {})
|
|
602
719
|
}
|
|
603
720
|
)
|
|
604
|
-
] }) : status === "LOADING" ? /* @__PURE__ */
|
|
721
|
+
] }) : status === "LOADING" ? /* @__PURE__ */ jsx6(IconButton2, { sx: { ...iconButtonStyles }, children: /* @__PURE__ */ jsx6(CircularProgress, { size: 20 }) }) : null
|
|
605
722
|
}
|
|
606
723
|
);
|
|
607
724
|
};
|
|
@@ -647,7 +764,7 @@ var useVoiceModeStore = create((set) => ({
|
|
|
647
764
|
|
|
648
765
|
// src/chat/chat-input.tsx
|
|
649
766
|
import { shallow } from "zustand/shallow";
|
|
650
|
-
import { Fragment as Fragment3, jsx as
|
|
767
|
+
import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
651
768
|
var ChatInput = (props) => {
|
|
652
769
|
const {
|
|
653
770
|
inputValue,
|
|
@@ -690,13 +807,13 @@ var ChatInput = (props) => {
|
|
|
690
807
|
}),
|
|
691
808
|
shallow
|
|
692
809
|
);
|
|
693
|
-
const [memoryOpen, setMemoryOpen] =
|
|
694
|
-
const [fileInputs, setFileInputs] =
|
|
810
|
+
const [memoryOpen, setMemoryOpen] = useState4(false);
|
|
811
|
+
const [fileInputs, setFileInputs] = useState4([]);
|
|
695
812
|
const fileInputRef = useRef2(null);
|
|
696
|
-
const [brandingText, setBrandingText] =
|
|
697
|
-
const [feedbackModalOpen, setFeedbackModalOpen] =
|
|
698
|
-
const [isKeyboardOpen, setKeyboardOpen] =
|
|
699
|
-
const [moreActionsOpen, setMoreActionsOpen] =
|
|
813
|
+
const [brandingText, setBrandingText] = useState4("");
|
|
814
|
+
const [feedbackModalOpen, setFeedbackModalOpen] = useState4(false);
|
|
815
|
+
const [isKeyboardOpen, setKeyboardOpen] = useState4(false);
|
|
816
|
+
const [moreActionsOpen, setMoreActionsOpen] = useState4(false);
|
|
700
817
|
const compactMobile = isMobile;
|
|
701
818
|
const primaryIconSize = isMobile ? 32 : 40;
|
|
702
819
|
const sendIconSize = isMobile ? 36 : 44;
|
|
@@ -944,7 +1061,7 @@ ${sanitize(
|
|
|
944
1061
|
}, [isMobile, hasSecondaryActions]);
|
|
945
1062
|
const renderAttachmentButton = (key) => {
|
|
946
1063
|
if (!hasAttachmentAction) return null;
|
|
947
|
-
return /* @__PURE__ */
|
|
1064
|
+
return /* @__PURE__ */ jsx7(Tooltip2, { title: "Attach files or images", children: /* @__PURE__ */ jsx7(
|
|
948
1065
|
IconButton3,
|
|
949
1066
|
{
|
|
950
1067
|
onClick: () => fileInputRef.current?.click(),
|
|
@@ -962,7 +1079,7 @@ ${sanitize(
|
|
|
962
1079
|
};
|
|
963
1080
|
const renderMemoryButton = (key) => {
|
|
964
1081
|
if (!hasMemoryAction) return null;
|
|
965
|
-
return /* @__PURE__ */
|
|
1082
|
+
return /* @__PURE__ */ jsx7(Tooltip2, { title: "Memory", children: /* @__PURE__ */ jsx7(
|
|
966
1083
|
IconButton3,
|
|
967
1084
|
{
|
|
968
1085
|
onClick: () => setMemoryOpen(true),
|
|
@@ -974,13 +1091,13 @@ ${sanitize(
|
|
|
974
1091
|
borderRadius: "50%",
|
|
975
1092
|
"&:hover": { bgcolor: hoverBadgeBackground }
|
|
976
1093
|
},
|
|
977
|
-
children: /* @__PURE__ */
|
|
1094
|
+
children: /* @__PURE__ */ jsx7(PsychologyIcon, { fontSize: "small" })
|
|
978
1095
|
}
|
|
979
1096
|
) }, key ?? "memory");
|
|
980
1097
|
};
|
|
981
1098
|
const renderFeedbackButton = (key) => {
|
|
982
1099
|
if (!hasFeedbackAction) return null;
|
|
983
|
-
return /* @__PURE__ */
|
|
1100
|
+
return /* @__PURE__ */ jsx7(Tooltip2, { title: "Send Feedback", children: /* @__PURE__ */ jsx7(
|
|
984
1101
|
IconButton3,
|
|
985
1102
|
{
|
|
986
1103
|
onClick: () => setFeedbackModalOpen(true),
|
|
@@ -992,17 +1109,17 @@ ${sanitize(
|
|
|
992
1109
|
borderRadius: "50%",
|
|
993
1110
|
"&:hover": { bgcolor: hoverBadgeBackground }
|
|
994
1111
|
},
|
|
995
|
-
children: /* @__PURE__ */
|
|
1112
|
+
children: /* @__PURE__ */ jsx7(FeedbackIcon, { fontSize: "small" })
|
|
996
1113
|
}
|
|
997
1114
|
) }, key ?? "feedback");
|
|
998
1115
|
};
|
|
999
1116
|
const renderSttButton = (key) => {
|
|
1000
1117
|
if (!hasSttAction) return null;
|
|
1001
|
-
return /* @__PURE__ */
|
|
1118
|
+
return /* @__PURE__ */ jsx7(Box4, { sx: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsx7(transcriber_default, { onTranscriptionCompleted: handleTranscriptionCompleted }) }, key ?? "stt");
|
|
1002
1119
|
};
|
|
1003
|
-
return /* @__PURE__ */
|
|
1004
|
-
/* @__PURE__ */
|
|
1005
|
-
|
|
1120
|
+
return /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
1121
|
+
/* @__PURE__ */ jsxs4(
|
|
1122
|
+
Box4,
|
|
1006
1123
|
{
|
|
1007
1124
|
sx: {
|
|
1008
1125
|
width: "100%",
|
|
@@ -1021,8 +1138,8 @@ ${sanitize(
|
|
|
1021
1138
|
},
|
|
1022
1139
|
ref: inputContainerRef,
|
|
1023
1140
|
children: [
|
|
1024
|
-
/* @__PURE__ */
|
|
1025
|
-
|
|
1141
|
+
/* @__PURE__ */ jsxs4(
|
|
1142
|
+
Box4,
|
|
1026
1143
|
{
|
|
1027
1144
|
sx: {
|
|
1028
1145
|
width: "100%",
|
|
@@ -1037,8 +1154,8 @@ ${sanitize(
|
|
|
1037
1154
|
gap: isMobile ? compactMobile ? 0.75 : 1 : 1
|
|
1038
1155
|
},
|
|
1039
1156
|
children: [
|
|
1040
|
-
/* @__PURE__ */
|
|
1041
|
-
|
|
1157
|
+
/* @__PURE__ */ jsxs4(
|
|
1158
|
+
Box4,
|
|
1042
1159
|
{
|
|
1043
1160
|
sx: {
|
|
1044
1161
|
display: "flex",
|
|
@@ -1048,8 +1165,8 @@ ${sanitize(
|
|
|
1048
1165
|
flexDirection: "row"
|
|
1049
1166
|
},
|
|
1050
1167
|
children: [
|
|
1051
|
-
fileInputs.map((file, idx) => /* @__PURE__ */
|
|
1052
|
-
|
|
1168
|
+
fileInputs.map((file, idx) => /* @__PURE__ */ jsxs4(
|
|
1169
|
+
Box4,
|
|
1053
1170
|
{
|
|
1054
1171
|
sx: {
|
|
1055
1172
|
position: "relative",
|
|
@@ -1062,7 +1179,7 @@ ${sanitize(
|
|
|
1062
1179
|
gap: isMobile ? compactMobile ? 0.6 : 0.9 : 1
|
|
1063
1180
|
},
|
|
1064
1181
|
children: [
|
|
1065
|
-
/* @__PURE__ */
|
|
1182
|
+
/* @__PURE__ */ jsx7(
|
|
1066
1183
|
Avatar2,
|
|
1067
1184
|
{
|
|
1068
1185
|
sx: {
|
|
@@ -1076,22 +1193,22 @@ ${sanitize(
|
|
|
1076
1193
|
children: getFileIcon(file.name)
|
|
1077
1194
|
}
|
|
1078
1195
|
),
|
|
1079
|
-
/* @__PURE__ */
|
|
1080
|
-
/* @__PURE__ */
|
|
1196
|
+
/* @__PURE__ */ jsx7(Typography, { variant: "caption", sx: { color: fileText }, children: file.name }),
|
|
1197
|
+
/* @__PURE__ */ jsx7(
|
|
1081
1198
|
IconButton3,
|
|
1082
1199
|
{
|
|
1083
1200
|
size: "small",
|
|
1084
1201
|
onClick: () => setFileInputs((prev) => prev.filter((_, i) => i !== idx)),
|
|
1085
1202
|
sx: { ml: 0.5, color: theme.palette.mode === "dark" ? "#aaa" : "#444" },
|
|
1086
|
-
children: /* @__PURE__ */
|
|
1203
|
+
children: /* @__PURE__ */ jsx7(CloseIcon, { sx: { fontSize: 14 } })
|
|
1087
1204
|
}
|
|
1088
1205
|
)
|
|
1089
1206
|
]
|
|
1090
1207
|
},
|
|
1091
1208
|
idx
|
|
1092
1209
|
)),
|
|
1093
|
-
pastedImages.map((img, idx) => /* @__PURE__ */
|
|
1094
|
-
/* @__PURE__ */
|
|
1210
|
+
pastedImages.map((img, idx) => /* @__PURE__ */ jsxs4(Box4, { sx: { position: "relative" }, children: [
|
|
1211
|
+
/* @__PURE__ */ jsx7(
|
|
1095
1212
|
Avatar2,
|
|
1096
1213
|
{
|
|
1097
1214
|
src: img,
|
|
@@ -1103,7 +1220,7 @@ ${sanitize(
|
|
|
1103
1220
|
}
|
|
1104
1221
|
}
|
|
1105
1222
|
),
|
|
1106
|
-
/* @__PURE__ */
|
|
1223
|
+
/* @__PURE__ */ jsx7(
|
|
1107
1224
|
IconButton3,
|
|
1108
1225
|
{
|
|
1109
1226
|
size: "small",
|
|
@@ -1120,7 +1237,7 @@ ${sanitize(
|
|
|
1120
1237
|
bgcolor: "rgba(255, 5, 5, 0.85)"
|
|
1121
1238
|
}
|
|
1122
1239
|
},
|
|
1123
|
-
children: /* @__PURE__ */
|
|
1240
|
+
children: /* @__PURE__ */ jsx7(
|
|
1124
1241
|
CloseIcon,
|
|
1125
1242
|
{
|
|
1126
1243
|
sx: {
|
|
@@ -1132,7 +1249,7 @@ ${sanitize(
|
|
|
1132
1249
|
}
|
|
1133
1250
|
)
|
|
1134
1251
|
] }, `img-${idx}`)),
|
|
1135
|
-
/* @__PURE__ */
|
|
1252
|
+
/* @__PURE__ */ jsx7(
|
|
1136
1253
|
"input",
|
|
1137
1254
|
{
|
|
1138
1255
|
type: "file",
|
|
@@ -1169,15 +1286,15 @@ ${sanitize(
|
|
|
1169
1286
|
]
|
|
1170
1287
|
}
|
|
1171
1288
|
),
|
|
1172
|
-
/* @__PURE__ */
|
|
1173
|
-
|
|
1289
|
+
/* @__PURE__ */ jsx7(
|
|
1290
|
+
Box4,
|
|
1174
1291
|
{
|
|
1175
1292
|
sx: {
|
|
1176
1293
|
display: "flex",
|
|
1177
1294
|
maxHeight: "200px",
|
|
1178
1295
|
overflowY: "auto"
|
|
1179
1296
|
},
|
|
1180
|
-
children: /* @__PURE__ */
|
|
1297
|
+
children: /* @__PURE__ */ jsx7(
|
|
1181
1298
|
TextField,
|
|
1182
1299
|
{
|
|
1183
1300
|
fullWidth: true,
|
|
@@ -1209,8 +1326,8 @@ ${sanitize(
|
|
|
1209
1326
|
)
|
|
1210
1327
|
}
|
|
1211
1328
|
),
|
|
1212
|
-
/* @__PURE__ */
|
|
1213
|
-
|
|
1329
|
+
/* @__PURE__ */ jsxs4(
|
|
1330
|
+
Box4,
|
|
1214
1331
|
{
|
|
1215
1332
|
sx: {
|
|
1216
1333
|
display: "flex",
|
|
@@ -1220,8 +1337,8 @@ ${sanitize(
|
|
|
1220
1337
|
mt: isMobile ? 0.5 : 1
|
|
1221
1338
|
},
|
|
1222
1339
|
children: [
|
|
1223
|
-
/* @__PURE__ */
|
|
1224
|
-
|
|
1340
|
+
/* @__PURE__ */ jsxs4(
|
|
1341
|
+
Box4,
|
|
1225
1342
|
{
|
|
1226
1343
|
sx: {
|
|
1227
1344
|
display: "flex",
|
|
@@ -1230,12 +1347,12 @@ ${sanitize(
|
|
|
1230
1347
|
minHeight: primaryIconSize
|
|
1231
1348
|
},
|
|
1232
1349
|
children: [
|
|
1233
|
-
isVoiceModeEligible && /* @__PURE__ */
|
|
1234
|
-
/* @__PURE__ */
|
|
1235
|
-
|
|
1350
|
+
isVoiceModeEligible && /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
1351
|
+
/* @__PURE__ */ jsx7(
|
|
1352
|
+
Tooltip2,
|
|
1236
1353
|
{
|
|
1237
1354
|
title: !isVoiceModeEnabled ? "Enable voice mode" : voiceStatus === "error" ? voiceError || "Voice mode error" : voiceStatus === "processing" ? "Transcribing your speech" : voiceStatus === "recording" ? "Recording - click to stop" : voiceStatus === "initializing" ? "Preparing microphone" : "Listening - click to turn off",
|
|
1238
|
-
children: /* @__PURE__ */
|
|
1355
|
+
children: /* @__PURE__ */ jsx7(
|
|
1239
1356
|
IconButton3,
|
|
1240
1357
|
{
|
|
1241
1358
|
onClick: toggleVoiceMode,
|
|
@@ -1252,12 +1369,12 @@ ${sanitize(
|
|
|
1252
1369
|
bgcolor: isVoiceModeEnabled ? alpha(theme.palette.error.main, theme.palette.mode === "dark" ? 0.55 : 0.38) : hoverBadgeBackground
|
|
1253
1370
|
}
|
|
1254
1371
|
},
|
|
1255
|
-
children: !isVoiceModeEnabled ? /* @__PURE__ */
|
|
1372
|
+
children: !isVoiceModeEnabled ? /* @__PURE__ */ jsx7(GraphicEqIcon, { fontSize: "small", sx: { color: theme.palette.mode === "dark" ? fileText : theme.palette.text.secondary } }) : voiceStatus === "processing" || voiceStatus === "initializing" ? /* @__PURE__ */ jsx7(CircularProgress2, { size: 18, sx: { color: fileText } }) : voiceStatus === "error" ? /* @__PURE__ */ jsx7(HearingDisabledIcon, { fontSize: "small", sx: { color: theme.palette.error.light } }) : voiceStatus === "recording" ? /* @__PURE__ */ jsx7(GraphicEqIcon, { fontSize: "small", sx: { color: theme.palette.error.light } }) : /* @__PURE__ */ jsx7(GraphicEqIcon, { fontSize: "small", sx: { color: theme.palette.common.white } })
|
|
1256
1373
|
}
|
|
1257
1374
|
)
|
|
1258
1375
|
}
|
|
1259
1376
|
),
|
|
1260
|
-
!isMobile && isVoiceModeEnabled && /* @__PURE__ */
|
|
1377
|
+
!isMobile && isVoiceModeEnabled && /* @__PURE__ */ jsx7(
|
|
1261
1378
|
Typography,
|
|
1262
1379
|
{
|
|
1263
1380
|
variant: "caption",
|
|
@@ -1275,7 +1392,7 @@ ${sanitize(
|
|
|
1275
1392
|
!isMobile && renderAttachmentButton("attach-inline"),
|
|
1276
1393
|
!isMobile && renderMemoryButton("memory-inline"),
|
|
1277
1394
|
!isMobile && renderSttButton("stt-inline"),
|
|
1278
|
-
isMobile && hasSecondaryActions && /* @__PURE__ */
|
|
1395
|
+
isMobile && hasSecondaryActions && /* @__PURE__ */ jsx7(
|
|
1279
1396
|
IconButton3,
|
|
1280
1397
|
{
|
|
1281
1398
|
onClick: () => setMoreActionsOpen((prev) => !prev),
|
|
@@ -1288,7 +1405,7 @@ ${sanitize(
|
|
|
1288
1405
|
transition: "background-color 0.2s ease",
|
|
1289
1406
|
"&:hover": { bgcolor: hoverBadgeBackground }
|
|
1290
1407
|
},
|
|
1291
|
-
children: /* @__PURE__ */
|
|
1408
|
+
children: /* @__PURE__ */ jsx7(
|
|
1292
1409
|
ExpandMoreIcon,
|
|
1293
1410
|
{
|
|
1294
1411
|
fontSize: "small",
|
|
@@ -1303,7 +1420,7 @@ ${sanitize(
|
|
|
1303
1420
|
]
|
|
1304
1421
|
}
|
|
1305
1422
|
),
|
|
1306
|
-
/* @__PURE__ */
|
|
1423
|
+
/* @__PURE__ */ jsx7(Box4, { sx: { display: "flex", alignItems: "center", gap: isMobile ? 0.6 : 1 }, children: /* @__PURE__ */ jsx7(Tooltip2, { title: isStreaming ? "Stop response" : "Send message", children: /* @__PURE__ */ jsx7("span", { children: /* @__PURE__ */ jsx7(
|
|
1307
1424
|
IconButton3,
|
|
1308
1425
|
{
|
|
1309
1426
|
onClick: isStreaming ? onStop || (() => {
|
|
@@ -1320,14 +1437,14 @@ ${sanitize(
|
|
|
1320
1437
|
"&:hover": { bgcolor: sendButtonHover },
|
|
1321
1438
|
"&.Mui-disabled": { opacity: 0.5 }
|
|
1322
1439
|
},
|
|
1323
|
-
children: isStreaming ? /* @__PURE__ */
|
|
1440
|
+
children: isStreaming ? /* @__PURE__ */ jsx7(CloseIcon, { fontSize: "small" }) : /* @__PURE__ */ jsx7(ArrowUpwardIcon, { fontSize: "small" })
|
|
1324
1441
|
}
|
|
1325
1442
|
) }) }) })
|
|
1326
1443
|
]
|
|
1327
1444
|
}
|
|
1328
1445
|
),
|
|
1329
|
-
isMobile && hasSecondaryActions && /* @__PURE__ */
|
|
1330
|
-
|
|
1446
|
+
isMobile && hasSecondaryActions && /* @__PURE__ */ jsx7(Collapse, { in: moreActionsOpen, unmountOnExit: true, children: /* @__PURE__ */ jsxs4(
|
|
1447
|
+
Box4,
|
|
1331
1448
|
{
|
|
1332
1449
|
sx: {
|
|
1333
1450
|
display: "flex",
|
|
@@ -1348,7 +1465,7 @@ ${sanitize(
|
|
|
1348
1465
|
]
|
|
1349
1466
|
}
|
|
1350
1467
|
),
|
|
1351
|
-
/* @__PURE__ */
|
|
1468
|
+
/* @__PURE__ */ jsxs4(
|
|
1352
1469
|
Typography,
|
|
1353
1470
|
{
|
|
1354
1471
|
variant: "caption",
|
|
@@ -1374,8 +1491,8 @@ ${sanitize(
|
|
|
1374
1491
|
]
|
|
1375
1492
|
}
|
|
1376
1493
|
),
|
|
1377
|
-
isMemoryEnabled && /* @__PURE__ */
|
|
1378
|
-
isFeedbackEnabled && /* @__PURE__ */
|
|
1494
|
+
isMemoryEnabled && /* @__PURE__ */ jsx7(memory_modal_default, { open: memoryOpen, onClose: () => setMemoryOpen(false) }),
|
|
1495
|
+
isFeedbackEnabled && /* @__PURE__ */ jsx7(
|
|
1379
1496
|
FeedbackModal,
|
|
1380
1497
|
{
|
|
1381
1498
|
open: feedbackModalOpen,
|
|
@@ -1388,8 +1505,8 @@ ${sanitize(
|
|
|
1388
1505
|
var chat_input_default = ChatInput;
|
|
1389
1506
|
|
|
1390
1507
|
// src/chat/ask-user-card.tsx
|
|
1391
|
-
import { useEffect as useEffect4, useState as
|
|
1392
|
-
import { Box as
|
|
1508
|
+
import { useEffect as useEffect4, useState as useState5 } from "react";
|
|
1509
|
+
import { Box as Box5, Paper, Typography as Typography2, Button, TextField as TextField2, Chip, Stack } from "@mui/material";
|
|
1393
1510
|
import { useTheme as useTheme5, alpha as alpha2 } from "@mui/material/styles";
|
|
1394
1511
|
|
|
1395
1512
|
// src/store/askUserStore.ts
|
|
@@ -1455,12 +1572,12 @@ var parseAskUserQuestions = (rawJson) => {
|
|
|
1455
1572
|
};
|
|
1456
1573
|
|
|
1457
1574
|
// src/chat/ask-user-card.tsx
|
|
1458
|
-
import { jsx as
|
|
1575
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1459
1576
|
var AskUserCard = () => {
|
|
1460
1577
|
const theme = useTheme5();
|
|
1461
1578
|
const { pending, submit, cancel } = useAskUserStore();
|
|
1462
|
-
const [selected, setSelected] =
|
|
1463
|
-
const [freeform, setFreeform] =
|
|
1579
|
+
const [selected, setSelected] = useState5({});
|
|
1580
|
+
const [freeform, setFreeform] = useState5({});
|
|
1464
1581
|
useEffect4(() => {
|
|
1465
1582
|
if (!pending) return;
|
|
1466
1583
|
const preselected = {};
|
|
@@ -1481,7 +1598,7 @@ var AskUserCard = () => {
|
|
|
1481
1598
|
});
|
|
1482
1599
|
submit(final);
|
|
1483
1600
|
};
|
|
1484
|
-
return /* @__PURE__ */
|
|
1601
|
+
return /* @__PURE__ */ jsx8(Box5, { sx: { width: "100%", display: "flex", justifyContent: "center", px: { xs: 1, sm: 2 }, mb: 1.5 }, children: /* @__PURE__ */ jsxs5(
|
|
1485
1602
|
Paper,
|
|
1486
1603
|
{
|
|
1487
1604
|
elevation: 0,
|
|
@@ -1494,13 +1611,13 @@ var AskUserCard = () => {
|
|
|
1494
1611
|
bgcolor: alpha2(theme.palette.primary.main, 0.06)
|
|
1495
1612
|
},
|
|
1496
1613
|
children: [
|
|
1497
|
-
/* @__PURE__ */
|
|
1498
|
-
pending.questions.map((q) => /* @__PURE__ */
|
|
1499
|
-
q.header && /* @__PURE__ */
|
|
1500
|
-
/* @__PURE__ */
|
|
1501
|
-
q.options && q.options.length > 0 && /* @__PURE__ */
|
|
1614
|
+
/* @__PURE__ */ jsx8(Typography2, { variant: "caption", sx: { color: theme.palette.primary.main, fontWeight: 700, letterSpacing: 0.4 }, children: "BANDIT NEEDS A QUICK DECISION" }),
|
|
1615
|
+
pending.questions.map((q) => /* @__PURE__ */ jsxs5(Box5, { sx: { mt: 1.5 }, children: [
|
|
1616
|
+
q.header && /* @__PURE__ */ jsx8(Chip, { label: q.header, size: "small", sx: { mb: 0.75, fontWeight: 600 }, color: "primary", variant: "outlined" }),
|
|
1617
|
+
/* @__PURE__ */ jsx8(Typography2, { sx: { fontWeight: 600, color: theme.palette.text.primary, mb: 1 }, children: q.question }),
|
|
1618
|
+
q.options && q.options.length > 0 && /* @__PURE__ */ jsx8(Stack, { spacing: 1, children: q.options.map((opt) => {
|
|
1502
1619
|
const isSel = selected[q.id] === opt.label && !freeform[q.id]?.trim();
|
|
1503
|
-
return /* @__PURE__ */
|
|
1620
|
+
return /* @__PURE__ */ jsx8(
|
|
1504
1621
|
Button,
|
|
1505
1622
|
{
|
|
1506
1623
|
onClick: () => {
|
|
@@ -1517,9 +1634,9 @@ var AskUserCard = () => {
|
|
|
1517
1634
|
px: 1.5,
|
|
1518
1635
|
borderColor: alpha2(theme.palette.primary.main, 0.4)
|
|
1519
1636
|
},
|
|
1520
|
-
children: /* @__PURE__ */
|
|
1521
|
-
/* @__PURE__ */
|
|
1522
|
-
opt.description && /* @__PURE__ */
|
|
1637
|
+
children: /* @__PURE__ */ jsxs5(Box5, { children: [
|
|
1638
|
+
/* @__PURE__ */ jsx8(Typography2, { sx: { fontWeight: 600, lineHeight: 1.3 }, children: opt.label }),
|
|
1639
|
+
opt.description && /* @__PURE__ */ jsx8(
|
|
1523
1640
|
Typography2,
|
|
1524
1641
|
{
|
|
1525
1642
|
variant: "caption",
|
|
@@ -1532,7 +1649,7 @@ var AskUserCard = () => {
|
|
|
1532
1649
|
opt.label
|
|
1533
1650
|
);
|
|
1534
1651
|
}) }),
|
|
1535
|
-
q.allowFreeform !== false && /* @__PURE__ */
|
|
1652
|
+
q.allowFreeform !== false && /* @__PURE__ */ jsx8(
|
|
1536
1653
|
TextField2,
|
|
1537
1654
|
{
|
|
1538
1655
|
fullWidth: true,
|
|
@@ -1544,9 +1661,9 @@ var AskUserCard = () => {
|
|
|
1544
1661
|
}
|
|
1545
1662
|
)
|
|
1546
1663
|
] }, q.id)),
|
|
1547
|
-
/* @__PURE__ */
|
|
1548
|
-
/* @__PURE__ */
|
|
1549
|
-
/* @__PURE__ */
|
|
1664
|
+
/* @__PURE__ */ jsxs5(Box5, { sx: { display: "flex", justifyContent: "flex-end", gap: 1, mt: 2 }, children: [
|
|
1665
|
+
/* @__PURE__ */ jsx8(Button, { onClick: cancel, color: "inherit", sx: { textTransform: "none", color: theme.palette.text.secondary }, children: "Skip" }),
|
|
1666
|
+
/* @__PURE__ */ jsx8(Button, { onClick: handleSubmit, disabled: !allAnswered, variant: "contained", sx: { textTransform: "none" }, children: "Submit" })
|
|
1550
1667
|
] })
|
|
1551
1668
|
]
|
|
1552
1669
|
}
|
|
@@ -2438,9 +2555,9 @@ The user explicitly asked you to remember this. Respond with a short third-perso
|
|
|
2438
2555
|
};
|
|
2439
2556
|
|
|
2440
2557
|
// src/chat/hooks/useMoodEngine.tsx
|
|
2441
|
-
import { useState as
|
|
2558
|
+
import { useState as useState6 } from "react";
|
|
2442
2559
|
var useMoodEngine = () => {
|
|
2443
|
-
const [mood, setMood] =
|
|
2560
|
+
const [mood, setMood] = useState6("neutral");
|
|
2444
2561
|
const analyzeMood = async (message) => {
|
|
2445
2562
|
try {
|
|
2446
2563
|
const detected = await detectMessageMood(message);
|
|
@@ -4130,9 +4247,9 @@ var useAutoScroll = (options = {}) => {
|
|
|
4130
4247
|
};
|
|
4131
4248
|
|
|
4132
4249
|
// src/hooks/useNetworkStatus.ts
|
|
4133
|
-
import { useState as
|
|
4250
|
+
import { useState as useState7, useEffect as useEffect6, useCallback as useCallback3 } from "react";
|
|
4134
4251
|
var useNetworkStatus = () => {
|
|
4135
|
-
const [networkStatus, setNetworkStatus] =
|
|
4252
|
+
const [networkStatus, setNetworkStatus] = useState7({
|
|
4136
4253
|
isOnline: navigator.onLine,
|
|
4137
4254
|
isSlowConnection: false,
|
|
4138
4255
|
connectionQuality: "fast",
|
|
@@ -4211,13 +4328,13 @@ var useNetworkStatus = () => {
|
|
|
4211
4328
|
|
|
4212
4329
|
// src/chat/chat-app-bar.tsx
|
|
4213
4330
|
import { Avatar as Avatar8 } from "@mui/material";
|
|
4214
|
-
import { useEffect as useEffect12, useRef as useRef10, useState as
|
|
4331
|
+
import { useEffect as useEffect12, useRef as useRef10, useState as useState14 } from "react";
|
|
4215
4332
|
import {
|
|
4216
|
-
Box as
|
|
4333
|
+
Box as Box12,
|
|
4217
4334
|
IconButton as IconButton9,
|
|
4218
4335
|
Menu as Menu5,
|
|
4219
4336
|
MenuItem as MenuItem5,
|
|
4220
|
-
Tooltip as
|
|
4337
|
+
Tooltip as Tooltip5,
|
|
4221
4338
|
useMediaQuery as useMediaQuery5,
|
|
4222
4339
|
useTheme as useTheme12,
|
|
4223
4340
|
Dialog as Dialog5,
|
|
@@ -4230,13 +4347,13 @@ import {
|
|
|
4230
4347
|
import { useNavigate } from "react-router-dom";
|
|
4231
4348
|
|
|
4232
4349
|
// src/chat/conversation-drawer.tsx
|
|
4233
|
-
import { useState as
|
|
4350
|
+
import { useState as useState12, useMemo as useMemo2, useEffect as useEffect10, useRef as useRef8, useCallback as useCallback4 } from "react";
|
|
4234
4351
|
import {
|
|
4235
4352
|
Drawer,
|
|
4236
|
-
Box as
|
|
4353
|
+
Box as Box10,
|
|
4237
4354
|
Typography as Typography7,
|
|
4238
4355
|
IconButton as IconButton7,
|
|
4239
|
-
Tooltip as
|
|
4356
|
+
Tooltip as Tooltip4,
|
|
4240
4357
|
TextField as TextField6,
|
|
4241
4358
|
InputAdornment,
|
|
4242
4359
|
useMediaQuery as useMediaQuery4,
|
|
@@ -4258,7 +4375,7 @@ import { X as CloseIcon4, X as ClearIcon, Search as SearchIcon, Folder as Folder
|
|
|
4258
4375
|
import { useTheme as useTheme10 } from "@mui/material/styles";
|
|
4259
4376
|
|
|
4260
4377
|
// src/chat/project-management-modal.tsx
|
|
4261
|
-
import { useState as
|
|
4378
|
+
import { useState as useState8, useEffect as useEffect7, useRef as useRef5 } from "react";
|
|
4262
4379
|
import {
|
|
4263
4380
|
Modal,
|
|
4264
4381
|
Button as Button2,
|
|
@@ -4266,7 +4383,7 @@ import {
|
|
|
4266
4383
|
List,
|
|
4267
4384
|
ListItem,
|
|
4268
4385
|
IconButton as IconButton4,
|
|
4269
|
-
Box as
|
|
4386
|
+
Box as Box6,
|
|
4270
4387
|
Typography as Typography3,
|
|
4271
4388
|
Avatar as Avatar3,
|
|
4272
4389
|
Chip as Chip2,
|
|
@@ -4279,7 +4396,7 @@ import {
|
|
|
4279
4396
|
} from "@mui/material";
|
|
4280
4397
|
import { Plus as AddIcon2, Pencil as EditIcon, Trash2 as DeleteIcon, MoreVertical as MoreVertIcon, Folder as FolderIcon, X as CloseIcon2, ArrowLeft as ArrowBackIcon } from "lucide-react";
|
|
4281
4398
|
import { useTheme as useTheme6, alpha as alpha3 } from "@mui/material/styles";
|
|
4282
|
-
import { Fragment as Fragment4, jsx as
|
|
4399
|
+
import { Fragment as Fragment4, jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
4283
4400
|
var DEFAULT_COLORS = [
|
|
4284
4401
|
"#2196F3",
|
|
4285
4402
|
"#4CAF50",
|
|
@@ -4308,17 +4425,17 @@ var ProjectManagementModal = ({
|
|
|
4308
4425
|
hydrate
|
|
4309
4426
|
} = useProjectStore();
|
|
4310
4427
|
const { getConversationsByProject } = useConversationStore();
|
|
4311
|
-
const [showCreateForm, setShowCreateForm] =
|
|
4312
|
-
const [editingProject, setEditingProject] =
|
|
4313
|
-
const [formData, setFormData] =
|
|
4428
|
+
const [showCreateForm, setShowCreateForm] = useState8(false);
|
|
4429
|
+
const [editingProject, setEditingProject] = useState8(null);
|
|
4430
|
+
const [formData, setFormData] = useState8({
|
|
4314
4431
|
name: "",
|
|
4315
4432
|
description: "",
|
|
4316
4433
|
color: DEFAULT_COLORS[0]
|
|
4317
4434
|
});
|
|
4318
|
-
const [menuAnchor, setMenuAnchor] =
|
|
4319
|
-
const [selectedProject, setSelectedProject] =
|
|
4320
|
-
const [loading, setLoading] =
|
|
4321
|
-
const [error, setError] =
|
|
4435
|
+
const [menuAnchor, setMenuAnchor] = useState8(null);
|
|
4436
|
+
const [selectedProject, setSelectedProject] = useState8(null);
|
|
4437
|
+
const [loading, setLoading] = useState8(false);
|
|
4438
|
+
const [error, setError] = useState8(null);
|
|
4322
4439
|
const modalContainerRef = useRef5(null);
|
|
4323
4440
|
useEffect7(() => {
|
|
4324
4441
|
if (open && !_hasHydrated) {
|
|
@@ -4427,8 +4544,8 @@ var ProjectManagementModal = ({
|
|
|
4427
4544
|
const hoverSurface = alpha3(theme.palette.primary.main, theme.palette.mode === "dark" ? 0.22 : 0.08);
|
|
4428
4545
|
const headerTitle = showCreateForm ? editingProject ? "Edit Project" : "Create Project" : "Manage Projects";
|
|
4429
4546
|
const headerSubtitle = showCreateForm ? "Name, describe, and color-code your project." : "Organize conversations into cohesive projects.";
|
|
4430
|
-
const content = /* @__PURE__ */
|
|
4431
|
-
|
|
4547
|
+
const content = /* @__PURE__ */ jsxs6(
|
|
4548
|
+
Box6,
|
|
4432
4549
|
{
|
|
4433
4550
|
ref: modalContainerRef,
|
|
4434
4551
|
sx: {
|
|
@@ -4446,8 +4563,8 @@ var ProjectManagementModal = ({
|
|
|
4446
4563
|
position: "relative"
|
|
4447
4564
|
},
|
|
4448
4565
|
children: [
|
|
4449
|
-
isMobile && /* @__PURE__ */
|
|
4450
|
-
|
|
4566
|
+
isMobile && /* @__PURE__ */ jsx9(
|
|
4567
|
+
Box6,
|
|
4451
4568
|
{
|
|
4452
4569
|
sx: {
|
|
4453
4570
|
width: 56,
|
|
@@ -4460,8 +4577,8 @@ var ProjectManagementModal = ({
|
|
|
4460
4577
|
}
|
|
4461
4578
|
}
|
|
4462
4579
|
),
|
|
4463
|
-
/* @__PURE__ */
|
|
4464
|
-
|
|
4580
|
+
/* @__PURE__ */ jsxs6(
|
|
4581
|
+
Box6,
|
|
4465
4582
|
{
|
|
4466
4583
|
sx: {
|
|
4467
4584
|
px: isMobile ? 1.5 : 2.75,
|
|
@@ -4473,8 +4590,8 @@ var ProjectManagementModal = ({
|
|
|
4473
4590
|
gap: 1
|
|
4474
4591
|
},
|
|
4475
4592
|
children: [
|
|
4476
|
-
/* @__PURE__ */
|
|
4477
|
-
|
|
4593
|
+
/* @__PURE__ */ jsxs6(
|
|
4594
|
+
Box6,
|
|
4478
4595
|
{
|
|
4479
4596
|
sx: {
|
|
4480
4597
|
display: "flex",
|
|
@@ -4483,8 +4600,8 @@ var ProjectManagementModal = ({
|
|
|
4483
4600
|
gap: 1
|
|
4484
4601
|
},
|
|
4485
4602
|
children: [
|
|
4486
|
-
/* @__PURE__ */
|
|
4487
|
-
|
|
4603
|
+
/* @__PURE__ */ jsxs6(
|
|
4604
|
+
Box6,
|
|
4488
4605
|
{
|
|
4489
4606
|
sx: {
|
|
4490
4607
|
display: "flex",
|
|
@@ -4494,8 +4611,8 @@ var ProjectManagementModal = ({
|
|
|
4494
4611
|
flex: 1
|
|
4495
4612
|
},
|
|
4496
4613
|
children: [
|
|
4497
|
-
showCreateForm && /* @__PURE__ */
|
|
4498
|
-
/* @__PURE__ */
|
|
4614
|
+
showCreateForm && /* @__PURE__ */ jsx9(IconButton4, { onClick: resetForm, size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ jsx9(ArrowBackIcon, { size: 16 }) }),
|
|
4615
|
+
/* @__PURE__ */ jsx9(
|
|
4499
4616
|
Typography3,
|
|
4500
4617
|
{
|
|
4501
4618
|
variant: "h6",
|
|
@@ -4512,16 +4629,16 @@ var ProjectManagementModal = ({
|
|
|
4512
4629
|
]
|
|
4513
4630
|
}
|
|
4514
4631
|
),
|
|
4515
|
-
/* @__PURE__ */
|
|
4632
|
+
/* @__PURE__ */ jsx9(IconButton4, { onClick: handleClose, size: "small", children: /* @__PURE__ */ jsx9(CloseIcon2, {}) })
|
|
4516
4633
|
]
|
|
4517
4634
|
}
|
|
4518
4635
|
),
|
|
4519
|
-
/* @__PURE__ */
|
|
4636
|
+
/* @__PURE__ */ jsx9(Typography3, { variant: "body2", color: "text.secondary", children: headerSubtitle })
|
|
4520
4637
|
]
|
|
4521
4638
|
}
|
|
4522
4639
|
),
|
|
4523
|
-
/* @__PURE__ */
|
|
4524
|
-
|
|
4640
|
+
/* @__PURE__ */ jsxs6(
|
|
4641
|
+
Box6,
|
|
4525
4642
|
{
|
|
4526
4643
|
sx: {
|
|
4527
4644
|
flex: 1,
|
|
@@ -4533,9 +4650,9 @@ var ProjectManagementModal = ({
|
|
|
4533
4650
|
gap: 2.5
|
|
4534
4651
|
},
|
|
4535
4652
|
children: [
|
|
4536
|
-
error && /* @__PURE__ */
|
|
4537
|
-
showCreateForm ? /* @__PURE__ */
|
|
4538
|
-
/* @__PURE__ */
|
|
4653
|
+
error && /* @__PURE__ */ jsx9(Alert, { severity: "error", onClose: () => setError(null), children: error }),
|
|
4654
|
+
showCreateForm ? /* @__PURE__ */ jsxs6(Box6, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
4655
|
+
/* @__PURE__ */ jsx9(
|
|
4539
4656
|
TextField3,
|
|
4540
4657
|
{
|
|
4541
4658
|
label: "Project name",
|
|
@@ -4547,7 +4664,7 @@ var ProjectManagementModal = ({
|
|
|
4547
4664
|
autoFocus: true
|
|
4548
4665
|
}
|
|
4549
4666
|
),
|
|
4550
|
-
/* @__PURE__ */
|
|
4667
|
+
/* @__PURE__ */ jsx9(
|
|
4551
4668
|
TextField3,
|
|
4552
4669
|
{
|
|
4553
4670
|
label: "Description (optional)",
|
|
@@ -4559,10 +4676,10 @@ var ProjectManagementModal = ({
|
|
|
4559
4676
|
disabled: loading
|
|
4560
4677
|
}
|
|
4561
4678
|
),
|
|
4562
|
-
/* @__PURE__ */
|
|
4563
|
-
/* @__PURE__ */
|
|
4564
|
-
/* @__PURE__ */
|
|
4565
|
-
|
|
4679
|
+
/* @__PURE__ */ jsxs6(Box6, { children: [
|
|
4680
|
+
/* @__PURE__ */ jsx9(Typography3, { variant: "subtitle2", sx: { mb: 1 }, children: "Color" }),
|
|
4681
|
+
/* @__PURE__ */ jsx9(Box6, { sx: { display: "flex", flexWrap: "wrap", gap: 1 }, children: DEFAULT_COLORS.map((color) => /* @__PURE__ */ jsx9(
|
|
4682
|
+
Box6,
|
|
4566
4683
|
{
|
|
4567
4684
|
sx: {
|
|
4568
4685
|
width: 32,
|
|
@@ -4582,11 +4699,11 @@ var ProjectManagementModal = ({
|
|
|
4582
4699
|
color
|
|
4583
4700
|
)) })
|
|
4584
4701
|
] })
|
|
4585
|
-
] }) : /* @__PURE__ */
|
|
4586
|
-
/* @__PURE__ */
|
|
4702
|
+
] }) : /* @__PURE__ */ jsxs6(Box6, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
4703
|
+
/* @__PURE__ */ jsx9(
|
|
4587
4704
|
Button2,
|
|
4588
4705
|
{
|
|
4589
|
-
startIcon: /* @__PURE__ */
|
|
4706
|
+
startIcon: /* @__PURE__ */ jsx9(AddIcon2, {}),
|
|
4590
4707
|
onClick: () => setShowCreateForm(true),
|
|
4591
4708
|
variant: "contained",
|
|
4592
4709
|
sx: {
|
|
@@ -4598,8 +4715,8 @@ var ProjectManagementModal = ({
|
|
|
4598
4715
|
children: "Create project"
|
|
4599
4716
|
}
|
|
4600
4717
|
),
|
|
4601
|
-
projects.length === 0 ? /* @__PURE__ */
|
|
4602
|
-
|
|
4718
|
+
projects.length === 0 ? /* @__PURE__ */ jsxs6(
|
|
4719
|
+
Box6,
|
|
4603
4720
|
{
|
|
4604
4721
|
sx: {
|
|
4605
4722
|
textAlign: "center",
|
|
@@ -4611,15 +4728,15 @@ var ProjectManagementModal = ({
|
|
|
4611
4728
|
backgroundColor: subtleSurface
|
|
4612
4729
|
},
|
|
4613
4730
|
children: [
|
|
4614
|
-
/* @__PURE__ */
|
|
4615
|
-
/* @__PURE__ */
|
|
4616
|
-
/* @__PURE__ */
|
|
4731
|
+
/* @__PURE__ */ jsx9(FolderIcon, { size: 48, style: { marginBottom: 8, opacity: 0.5 } }),
|
|
4732
|
+
/* @__PURE__ */ jsx9(Typography3, { variant: "body1", sx: { fontWeight: 600 }, children: "No projects yet" }),
|
|
4733
|
+
/* @__PURE__ */ jsx9(Typography3, { variant: "body2", children: "Create your first project to organize conversations." })
|
|
4617
4734
|
]
|
|
4618
4735
|
}
|
|
4619
|
-
) : /* @__PURE__ */
|
|
4736
|
+
) : /* @__PURE__ */ jsx9(List, { sx: { display: "flex", flexDirection: "column", gap: 1.25, py: 0 }, children: projects.map((project) => {
|
|
4620
4737
|
const conversationCount = getConversationsByProject(project.id).length;
|
|
4621
|
-
return /* @__PURE__ */
|
|
4622
|
-
|
|
4738
|
+
return /* @__PURE__ */ jsx9(ListItem, { disablePadding: true, children: /* @__PURE__ */ jsxs6(
|
|
4739
|
+
Box6,
|
|
4623
4740
|
{
|
|
4624
4741
|
sx: {
|
|
4625
4742
|
display: "flex",
|
|
@@ -4637,7 +4754,7 @@ var ProjectManagementModal = ({
|
|
|
4637
4754
|
}
|
|
4638
4755
|
},
|
|
4639
4756
|
children: [
|
|
4640
|
-
/* @__PURE__ */
|
|
4757
|
+
/* @__PURE__ */ jsx9(
|
|
4641
4758
|
Avatar3,
|
|
4642
4759
|
{
|
|
4643
4760
|
sx: {
|
|
@@ -4646,12 +4763,12 @@ var ProjectManagementModal = ({
|
|
|
4646
4763
|
height: 36,
|
|
4647
4764
|
fontSize: "1rem"
|
|
4648
4765
|
},
|
|
4649
|
-
children: /* @__PURE__ */
|
|
4766
|
+
children: /* @__PURE__ */ jsx9(FolderIcon, { size: 16 })
|
|
4650
4767
|
}
|
|
4651
4768
|
),
|
|
4652
|
-
/* @__PURE__ */
|
|
4653
|
-
/* @__PURE__ */
|
|
4654
|
-
/* @__PURE__ */
|
|
4769
|
+
/* @__PURE__ */ jsxs6(Box6, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
4770
|
+
/* @__PURE__ */ jsxs6(Box6, { sx: { display: "flex", alignItems: "center", gap: 1, flexWrap: "wrap" }, children: [
|
|
4771
|
+
/* @__PURE__ */ jsx9(
|
|
4655
4772
|
Typography3,
|
|
4656
4773
|
{
|
|
4657
4774
|
variant: "subtitle1",
|
|
@@ -4659,7 +4776,7 @@ var ProjectManagementModal = ({
|
|
|
4659
4776
|
children: project.name
|
|
4660
4777
|
}
|
|
4661
4778
|
),
|
|
4662
|
-
/* @__PURE__ */
|
|
4779
|
+
/* @__PURE__ */ jsx9(
|
|
4663
4780
|
Chip2,
|
|
4664
4781
|
{
|
|
4665
4782
|
label: `${conversationCount}`,
|
|
@@ -4674,7 +4791,7 @@ var ProjectManagementModal = ({
|
|
|
4674
4791
|
}
|
|
4675
4792
|
)
|
|
4676
4793
|
] }),
|
|
4677
|
-
project.description && /* @__PURE__ */
|
|
4794
|
+
project.description && /* @__PURE__ */ jsx9(
|
|
4678
4795
|
Typography3,
|
|
4679
4796
|
{
|
|
4680
4797
|
variant: "body2",
|
|
@@ -4684,7 +4801,7 @@ var ProjectManagementModal = ({
|
|
|
4684
4801
|
}
|
|
4685
4802
|
)
|
|
4686
4803
|
] }),
|
|
4687
|
-
/* @__PURE__ */
|
|
4804
|
+
/* @__PURE__ */ jsx9(
|
|
4688
4805
|
IconButton4,
|
|
4689
4806
|
{
|
|
4690
4807
|
onClick: (e) => {
|
|
@@ -4697,7 +4814,7 @@ var ProjectManagementModal = ({
|
|
|
4697
4814
|
mt: 0.25,
|
|
4698
4815
|
zIndex: 1
|
|
4699
4816
|
},
|
|
4700
|
-
children: /* @__PURE__ */
|
|
4817
|
+
children: /* @__PURE__ */ jsx9(MoreVertIcon, { size: 16 })
|
|
4701
4818
|
}
|
|
4702
4819
|
)
|
|
4703
4820
|
]
|
|
@@ -4708,8 +4825,8 @@ var ProjectManagementModal = ({
|
|
|
4708
4825
|
]
|
|
4709
4826
|
}
|
|
4710
4827
|
),
|
|
4711
|
-
/* @__PURE__ */
|
|
4712
|
-
|
|
4828
|
+
/* @__PURE__ */ jsx9(
|
|
4829
|
+
Box6,
|
|
4713
4830
|
{
|
|
4714
4831
|
sx: {
|
|
4715
4832
|
px: isMobile ? 1.5 : 2.75,
|
|
@@ -4719,8 +4836,8 @@ var ProjectManagementModal = ({
|
|
|
4719
4836
|
justifyContent: "flex-end",
|
|
4720
4837
|
gap: 1
|
|
4721
4838
|
},
|
|
4722
|
-
children: showCreateForm ? /* @__PURE__ */
|
|
4723
|
-
/* @__PURE__ */
|
|
4839
|
+
children: showCreateForm ? /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
4840
|
+
/* @__PURE__ */ jsx9(
|
|
4724
4841
|
Button2,
|
|
4725
4842
|
{
|
|
4726
4843
|
onClick: resetForm,
|
|
@@ -4729,21 +4846,21 @@ var ProjectManagementModal = ({
|
|
|
4729
4846
|
children: "Cancel"
|
|
4730
4847
|
}
|
|
4731
4848
|
),
|
|
4732
|
-
/* @__PURE__ */
|
|
4849
|
+
/* @__PURE__ */ jsx9(
|
|
4733
4850
|
Button2,
|
|
4734
4851
|
{
|
|
4735
4852
|
onClick: editingProject ? handleEditProject : handleCreateProject,
|
|
4736
4853
|
variant: "contained",
|
|
4737
4854
|
disabled: loading,
|
|
4738
|
-
startIcon: loading ? /* @__PURE__ */
|
|
4855
|
+
startIcon: loading ? /* @__PURE__ */ jsx9(CircularProgress3, { size: 16 }) : void 0,
|
|
4739
4856
|
sx: { textTransform: "none", borderRadius: 2 },
|
|
4740
4857
|
children: editingProject ? "Update project" : "Create project"
|
|
4741
4858
|
}
|
|
4742
4859
|
)
|
|
4743
|
-
] }) : /* @__PURE__ */
|
|
4860
|
+
] }) : /* @__PURE__ */ jsx9(Button2, { onClick: handleClose, sx: { textTransform: "none", borderRadius: 2 }, children: "Close" })
|
|
4744
4861
|
}
|
|
4745
4862
|
),
|
|
4746
|
-
/* @__PURE__ */
|
|
4863
|
+
/* @__PURE__ */ jsxs6(
|
|
4747
4864
|
Menu,
|
|
4748
4865
|
{
|
|
4749
4866
|
anchorEl: menuAnchor,
|
|
@@ -4765,20 +4882,20 @@ var ProjectManagementModal = ({
|
|
|
4765
4882
|
}
|
|
4766
4883
|
},
|
|
4767
4884
|
children: [
|
|
4768
|
-
/* @__PURE__ */
|
|
4885
|
+
/* @__PURE__ */ jsx9(
|
|
4769
4886
|
MenuItem,
|
|
4770
4887
|
{
|
|
4771
4888
|
onClick: () => {
|
|
4772
4889
|
if (!selectedProject) return;
|
|
4773
4890
|
startEdit(selectedProject);
|
|
4774
4891
|
},
|
|
4775
|
-
children: /* @__PURE__ */
|
|
4776
|
-
/* @__PURE__ */
|
|
4777
|
-
/* @__PURE__ */
|
|
4892
|
+
children: /* @__PURE__ */ jsxs6(Box6, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
4893
|
+
/* @__PURE__ */ jsx9(EditIcon, { size: 16 }),
|
|
4894
|
+
/* @__PURE__ */ jsx9(Typography3, { variant: "body2", color: "inherit", children: "Edit" })
|
|
4778
4895
|
] })
|
|
4779
4896
|
}
|
|
4780
4897
|
),
|
|
4781
|
-
/* @__PURE__ */
|
|
4898
|
+
/* @__PURE__ */ jsx9(
|
|
4782
4899
|
MenuItem,
|
|
4783
4900
|
{
|
|
4784
4901
|
onClick: () => {
|
|
@@ -4786,9 +4903,9 @@ var ProjectManagementModal = ({
|
|
|
4786
4903
|
handleDeleteProject(selectedProject);
|
|
4787
4904
|
},
|
|
4788
4905
|
sx: { color: theme.palette.error.main },
|
|
4789
|
-
children: /* @__PURE__ */
|
|
4790
|
-
/* @__PURE__ */
|
|
4791
|
-
/* @__PURE__ */
|
|
4906
|
+
children: /* @__PURE__ */ jsxs6(Box6, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
4907
|
+
/* @__PURE__ */ jsx9(DeleteIcon, { size: 16 }),
|
|
4908
|
+
/* @__PURE__ */ jsx9(Typography3, { variant: "body2", color: "inherit", children: "Delete" })
|
|
4792
4909
|
] })
|
|
4793
4910
|
}
|
|
4794
4911
|
)
|
|
@@ -4798,7 +4915,7 @@ var ProjectManagementModal = ({
|
|
|
4798
4915
|
]
|
|
4799
4916
|
}
|
|
4800
4917
|
);
|
|
4801
|
-
return /* @__PURE__ */
|
|
4918
|
+
return /* @__PURE__ */ jsx9(Fragment4, { children: isMobile ? /* @__PURE__ */ jsx9(
|
|
4802
4919
|
SwipeableDrawer,
|
|
4803
4920
|
{
|
|
4804
4921
|
anchor: "bottom",
|
|
@@ -4818,7 +4935,7 @@ var ProjectManagementModal = ({
|
|
|
4818
4935
|
},
|
|
4819
4936
|
children: content
|
|
4820
4937
|
}
|
|
4821
|
-
) : /* @__PURE__ */
|
|
4938
|
+
) : /* @__PURE__ */ jsx9(
|
|
4822
4939
|
Modal,
|
|
4823
4940
|
{
|
|
4824
4941
|
open,
|
|
@@ -4837,7 +4954,7 @@ var ProjectManagementModal = ({
|
|
|
4837
4954
|
var project_management_modal_default = ProjectManagementModal;
|
|
4838
4955
|
|
|
4839
4956
|
// src/chat/move-conversation-modal.tsx
|
|
4840
|
-
import { useState as
|
|
4957
|
+
import { useState as useState9, useEffect as useEffect8 } from "react";
|
|
4841
4958
|
import {
|
|
4842
4959
|
Dialog,
|
|
4843
4960
|
DialogTitle,
|
|
@@ -4852,12 +4969,12 @@ import {
|
|
|
4852
4969
|
Typography as Typography4,
|
|
4853
4970
|
Avatar as Avatar4,
|
|
4854
4971
|
Radio,
|
|
4855
|
-
Box as
|
|
4972
|
+
Box as Box7,
|
|
4856
4973
|
Divider
|
|
4857
4974
|
} from "@mui/material";
|
|
4858
4975
|
import { Folder as FolderIcon2, Inbox as InboxIcon } from "lucide-react";
|
|
4859
4976
|
import { useTheme as useTheme7 } from "@mui/material/styles";
|
|
4860
|
-
import { jsx as
|
|
4977
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
4861
4978
|
var MoveConversationModal = ({
|
|
4862
4979
|
open,
|
|
4863
4980
|
onClose,
|
|
@@ -4867,7 +4984,7 @@ var MoveConversationModal = ({
|
|
|
4867
4984
|
const theme = useTheme7();
|
|
4868
4985
|
const { projects, _hasHydrated, hydrate } = useProjectStore();
|
|
4869
4986
|
const { moveConversationToProject } = useConversationStore();
|
|
4870
|
-
const [selectedProjectId, setSelectedProjectId] =
|
|
4987
|
+
const [selectedProjectId, setSelectedProjectId] = useState9(
|
|
4871
4988
|
currentProjectId
|
|
4872
4989
|
);
|
|
4873
4990
|
useEffect8(() => {
|
|
@@ -4894,7 +5011,7 @@ var MoveConversationModal = ({
|
|
|
4894
5011
|
};
|
|
4895
5012
|
const conversationCount = conversations.length;
|
|
4896
5013
|
const isMultiple = conversationCount > 1;
|
|
4897
|
-
return /* @__PURE__ */
|
|
5014
|
+
return /* @__PURE__ */ jsxs7(
|
|
4898
5015
|
Dialog,
|
|
4899
5016
|
{
|
|
4900
5017
|
open,
|
|
@@ -4908,20 +5025,20 @@ var MoveConversationModal = ({
|
|
|
4908
5025
|
}
|
|
4909
5026
|
},
|
|
4910
5027
|
children: [
|
|
4911
|
-
/* @__PURE__ */
|
|
5028
|
+
/* @__PURE__ */ jsxs7(DialogTitle, { children: [
|
|
4912
5029
|
"Move ",
|
|
4913
5030
|
isMultiple ? `${conversationCount} Conversations` : "Conversation"
|
|
4914
5031
|
] }),
|
|
4915
|
-
/* @__PURE__ */
|
|
4916
|
-
/* @__PURE__ */
|
|
4917
|
-
/* @__PURE__ */
|
|
4918
|
-
/* @__PURE__ */
|
|
5032
|
+
/* @__PURE__ */ jsxs7(DialogContent, { sx: { px: 3 }, children: [
|
|
5033
|
+
/* @__PURE__ */ jsx10(Typography4, { variant: "body2", color: "text.secondary", sx: { mb: 2 }, children: isMultiple ? `Select a project to move ${conversationCount} conversations to:` : `Select a project to move "${conversations[0]?.name}" to:` }),
|
|
5034
|
+
/* @__PURE__ */ jsxs7(List2, { children: [
|
|
5035
|
+
/* @__PURE__ */ jsx10(ListItem2, { disablePadding: true, children: /* @__PURE__ */ jsxs7(
|
|
4919
5036
|
ListItemButton,
|
|
4920
5037
|
{
|
|
4921
5038
|
onClick: () => setSelectedProjectId(null),
|
|
4922
5039
|
selected: selectedProjectId === null,
|
|
4923
5040
|
children: [
|
|
4924
|
-
/* @__PURE__ */
|
|
5041
|
+
/* @__PURE__ */ jsx10(ListItemIcon, { children: /* @__PURE__ */ jsx10(
|
|
4925
5042
|
Radio,
|
|
4926
5043
|
{
|
|
4927
5044
|
checked: selectedProjectId === null,
|
|
@@ -4929,7 +5046,7 @@ var MoveConversationModal = ({
|
|
|
4929
5046
|
size: "small"
|
|
4930
5047
|
}
|
|
4931
5048
|
) }),
|
|
4932
|
-
/* @__PURE__ */
|
|
5049
|
+
/* @__PURE__ */ jsx10(ListItemIcon, { children: /* @__PURE__ */ jsx10(
|
|
4933
5050
|
Avatar4,
|
|
4934
5051
|
{
|
|
4935
5052
|
sx: {
|
|
@@ -4937,10 +5054,10 @@ var MoveConversationModal = ({
|
|
|
4937
5054
|
width: 32,
|
|
4938
5055
|
height: 32
|
|
4939
5056
|
},
|
|
4940
|
-
children: /* @__PURE__ */
|
|
5057
|
+
children: /* @__PURE__ */ jsx10(InboxIcon, {})
|
|
4941
5058
|
}
|
|
4942
5059
|
) }),
|
|
4943
|
-
/* @__PURE__ */
|
|
5060
|
+
/* @__PURE__ */ jsx10(
|
|
4944
5061
|
ListItemText,
|
|
4945
5062
|
{
|
|
4946
5063
|
primary: "No Project",
|
|
@@ -4950,14 +5067,14 @@ var MoveConversationModal = ({
|
|
|
4950
5067
|
]
|
|
4951
5068
|
}
|
|
4952
5069
|
) }),
|
|
4953
|
-
/* @__PURE__ */
|
|
4954
|
-
projects.map((project) => /* @__PURE__ */
|
|
5070
|
+
/* @__PURE__ */ jsx10(Divider, { sx: { my: 1 } }),
|
|
5071
|
+
projects.map((project) => /* @__PURE__ */ jsx10(ListItem2, { disablePadding: true, children: /* @__PURE__ */ jsxs7(
|
|
4955
5072
|
ListItemButton,
|
|
4956
5073
|
{
|
|
4957
5074
|
onClick: () => setSelectedProjectId(project.id),
|
|
4958
5075
|
selected: selectedProjectId === project.id,
|
|
4959
5076
|
children: [
|
|
4960
|
-
/* @__PURE__ */
|
|
5077
|
+
/* @__PURE__ */ jsx10(ListItemIcon, { children: /* @__PURE__ */ jsx10(
|
|
4961
5078
|
Radio,
|
|
4962
5079
|
{
|
|
4963
5080
|
checked: selectedProjectId === project.id,
|
|
@@ -4965,7 +5082,7 @@ var MoveConversationModal = ({
|
|
|
4965
5082
|
size: "small"
|
|
4966
5083
|
}
|
|
4967
5084
|
) }),
|
|
4968
|
-
/* @__PURE__ */
|
|
5085
|
+
/* @__PURE__ */ jsx10(ListItemIcon, { children: /* @__PURE__ */ jsx10(
|
|
4969
5086
|
Avatar4,
|
|
4970
5087
|
{
|
|
4971
5088
|
sx: {
|
|
@@ -4973,10 +5090,10 @@ var MoveConversationModal = ({
|
|
|
4973
5090
|
width: 32,
|
|
4974
5091
|
height: 32
|
|
4975
5092
|
},
|
|
4976
|
-
children: /* @__PURE__ */
|
|
5093
|
+
children: /* @__PURE__ */ jsx10(FolderIcon2, {})
|
|
4977
5094
|
}
|
|
4978
5095
|
) }),
|
|
4979
|
-
/* @__PURE__ */
|
|
5096
|
+
/* @__PURE__ */ jsx10(
|
|
4980
5097
|
ListItemText,
|
|
4981
5098
|
{
|
|
4982
5099
|
primary: project.name,
|
|
@@ -4986,16 +5103,16 @@ var MoveConversationModal = ({
|
|
|
4986
5103
|
]
|
|
4987
5104
|
}
|
|
4988
5105
|
) }, project.id)),
|
|
4989
|
-
projects.length === 0 && /* @__PURE__ */
|
|
5106
|
+
projects.length === 0 && /* @__PURE__ */ jsx10(Box7, { sx: {
|
|
4990
5107
|
textAlign: "center",
|
|
4991
5108
|
py: 2,
|
|
4992
5109
|
color: theme.palette.text.secondary
|
|
4993
|
-
}, children: /* @__PURE__ */
|
|
5110
|
+
}, children: /* @__PURE__ */ jsx10(Typography4, { variant: "body2", children: "No projects available. Create a project first to organize conversations." }) })
|
|
4994
5111
|
] })
|
|
4995
5112
|
] }),
|
|
4996
|
-
/* @__PURE__ */
|
|
4997
|
-
/* @__PURE__ */
|
|
4998
|
-
/* @__PURE__ */
|
|
5113
|
+
/* @__PURE__ */ jsxs7(DialogActions, { sx: { px: 3, pb: 2 }, children: [
|
|
5114
|
+
/* @__PURE__ */ jsx10(Button3, { onClick: onClose, children: "Cancel" }),
|
|
5115
|
+
/* @__PURE__ */ jsxs7(
|
|
4999
5116
|
Button3,
|
|
5000
5117
|
{
|
|
5001
5118
|
onClick: handleMove,
|
|
@@ -5015,9 +5132,9 @@ var MoveConversationModal = ({
|
|
|
5015
5132
|
var move_conversation_modal_default = MoveConversationModal;
|
|
5016
5133
|
|
|
5017
5134
|
// src/chat/simple-conversation-item.tsx
|
|
5018
|
-
import { useState as
|
|
5135
|
+
import { useState as useState10, useRef as useRef6, useEffect as useEffect9 } from "react";
|
|
5019
5136
|
import {
|
|
5020
|
-
Box as
|
|
5137
|
+
Box as Box8,
|
|
5021
5138
|
Typography as Typography5,
|
|
5022
5139
|
IconButton as IconButton5,
|
|
5023
5140
|
Menu as Menu2,
|
|
@@ -5034,7 +5151,7 @@ import {
|
|
|
5034
5151
|
} from "@mui/material";
|
|
5035
5152
|
import { MoreVertical as MoreVertIcon2, Pencil as EditIcon2, Trash2 as DeleteIcon2, GripVertical as DragIcon, MailOpen as MoveIcon } from "lucide-react";
|
|
5036
5153
|
import { useTheme as useTheme8, alpha as alpha4 } from "@mui/material/styles";
|
|
5037
|
-
import { Fragment as Fragment5, jsx as
|
|
5154
|
+
import { Fragment as Fragment5, jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
5038
5155
|
var SimpleConversationItem = ({
|
|
5039
5156
|
conversation,
|
|
5040
5157
|
isSelected,
|
|
@@ -5052,12 +5169,12 @@ var SimpleConversationItem = ({
|
|
|
5052
5169
|
}) => {
|
|
5053
5170
|
const theme = useTheme8();
|
|
5054
5171
|
const isMobile = useMediaQuery3(theme.breakpoints.down("sm"));
|
|
5055
|
-
const [anchorEl, setAnchorEl] =
|
|
5056
|
-
const [isEditing, setIsEditing] =
|
|
5057
|
-
const [editName, setEditName] =
|
|
5058
|
-
const [isDragging, setIsDragging] =
|
|
5059
|
-
const [isTouchDragging, setIsTouchDragging] =
|
|
5060
|
-
const [showRenameDialog, setShowRenameDialog] =
|
|
5172
|
+
const [anchorEl, setAnchorEl] = useState10(null);
|
|
5173
|
+
const [isEditing, setIsEditing] = useState10(false);
|
|
5174
|
+
const [editName, setEditName] = useState10(conversation.name);
|
|
5175
|
+
const [isDragging, setIsDragging] = useState10(false);
|
|
5176
|
+
const [isTouchDragging, setIsTouchDragging] = useState10(false);
|
|
5177
|
+
const [showRenameDialog, setShowRenameDialog] = useState10(false);
|
|
5061
5178
|
const longPressTimeoutRef = useRef6(null);
|
|
5062
5179
|
const touchStartPointRef = useRef6(null);
|
|
5063
5180
|
const activeTouchIdRef = useRef6(null);
|
|
@@ -5069,8 +5186,8 @@ var SimpleConversationItem = ({
|
|
|
5069
5186
|
const regex = new RegExp(`(${query.trim()})`, "gi");
|
|
5070
5187
|
const parts = text.split(regex);
|
|
5071
5188
|
return parts.map(
|
|
5072
|
-
(part, index) => regex.test(part) ? /* @__PURE__ */
|
|
5073
|
-
|
|
5189
|
+
(part, index) => regex.test(part) ? /* @__PURE__ */ jsx11(
|
|
5190
|
+
Box8,
|
|
5074
5191
|
{
|
|
5075
5192
|
component: "span",
|
|
5076
5193
|
sx: {
|
|
@@ -5205,9 +5322,9 @@ var SimpleConversationItem = ({
|
|
|
5205
5322
|
setIsTouchDragging(false);
|
|
5206
5323
|
}
|
|
5207
5324
|
}, [isTouchDragActive, isTouchDragging]);
|
|
5208
|
-
return /* @__PURE__ */
|
|
5209
|
-
/* @__PURE__ */
|
|
5210
|
-
|
|
5325
|
+
return /* @__PURE__ */ jsxs8(Fragment5, { children: [
|
|
5326
|
+
/* @__PURE__ */ jsxs8(
|
|
5327
|
+
Box8,
|
|
5211
5328
|
{
|
|
5212
5329
|
"data-project-id": conversation.projectId ?? "__ungrouped",
|
|
5213
5330
|
draggable: !isMobile && !isEditing,
|
|
@@ -5259,7 +5376,7 @@ var SimpleConversationItem = ({
|
|
|
5259
5376
|
}
|
|
5260
5377
|
},
|
|
5261
5378
|
children: [
|
|
5262
|
-
!isMobile && !isEditing && /* @__PURE__ */
|
|
5379
|
+
!isMobile && !isEditing && /* @__PURE__ */ jsx11(
|
|
5263
5380
|
DragIcon,
|
|
5264
5381
|
{
|
|
5265
5382
|
size: 16,
|
|
@@ -5267,8 +5384,8 @@ var SimpleConversationItem = ({
|
|
|
5267
5384
|
style: { marginRight: 4, cursor: "grab" }
|
|
5268
5385
|
}
|
|
5269
5386
|
),
|
|
5270
|
-
/* @__PURE__ */
|
|
5271
|
-
isEditing ? /* @__PURE__ */
|
|
5387
|
+
/* @__PURE__ */ jsxs8(Box8, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
5388
|
+
isEditing ? /* @__PURE__ */ jsx11(
|
|
5272
5389
|
TextField4,
|
|
5273
5390
|
{
|
|
5274
5391
|
value: editName,
|
|
@@ -5291,7 +5408,7 @@ var SimpleConversationItem = ({
|
|
|
5291
5408
|
}
|
|
5292
5409
|
}
|
|
5293
5410
|
}
|
|
5294
|
-
) : /* @__PURE__ */
|
|
5411
|
+
) : /* @__PURE__ */ jsx11(
|
|
5295
5412
|
Typography5,
|
|
5296
5413
|
{
|
|
5297
5414
|
variant: "body2",
|
|
@@ -5306,7 +5423,7 @@ var SimpleConversationItem = ({
|
|
|
5306
5423
|
children: highlightText(conversation.name, searchQuery)
|
|
5307
5424
|
}
|
|
5308
5425
|
),
|
|
5309
|
-
!isEditing && snippet && /* @__PURE__ */
|
|
5426
|
+
!isEditing && snippet && /* @__PURE__ */ jsx11(
|
|
5310
5427
|
Typography5,
|
|
5311
5428
|
{
|
|
5312
5429
|
variant: "caption",
|
|
@@ -5325,7 +5442,7 @@ var SimpleConversationItem = ({
|
|
|
5325
5442
|
}
|
|
5326
5443
|
)
|
|
5327
5444
|
] }),
|
|
5328
|
-
!isEditing && /* @__PURE__ */
|
|
5445
|
+
!isEditing && /* @__PURE__ */ jsx11(
|
|
5329
5446
|
IconButton5,
|
|
5330
5447
|
{
|
|
5331
5448
|
onClick: handleMenuOpen,
|
|
@@ -5354,10 +5471,10 @@ var SimpleConversationItem = ({
|
|
|
5354
5471
|
}
|
|
5355
5472
|
}
|
|
5356
5473
|
},
|
|
5357
|
-
children: /* @__PURE__ */
|
|
5474
|
+
children: /* @__PURE__ */ jsx11(MoreVertIcon2, { size: 16 })
|
|
5358
5475
|
}
|
|
5359
5476
|
),
|
|
5360
|
-
/* @__PURE__ */
|
|
5477
|
+
/* @__PURE__ */ jsxs8(
|
|
5361
5478
|
Menu2,
|
|
5362
5479
|
{
|
|
5363
5480
|
anchorEl,
|
|
@@ -5384,17 +5501,17 @@ var SimpleConversationItem = ({
|
|
|
5384
5501
|
}
|
|
5385
5502
|
},
|
|
5386
5503
|
children: [
|
|
5387
|
-
onRename && /* @__PURE__ */
|
|
5388
|
-
/* @__PURE__ */
|
|
5389
|
-
/* @__PURE__ */
|
|
5504
|
+
onRename && /* @__PURE__ */ jsxs8(MenuItem2, { onClick: handleEdit, children: [
|
|
5505
|
+
/* @__PURE__ */ jsx11(ListItemIcon2, { children: /* @__PURE__ */ jsx11(EditIcon2, { size: 16 }) }),
|
|
5506
|
+
/* @__PURE__ */ jsx11(ListItemText2, { children: "Rename" })
|
|
5390
5507
|
] }),
|
|
5391
|
-
onMove && /* @__PURE__ */
|
|
5392
|
-
/* @__PURE__ */
|
|
5393
|
-
/* @__PURE__ */
|
|
5508
|
+
onMove && /* @__PURE__ */ jsxs8(MenuItem2, { onClick: handleMove, children: [
|
|
5509
|
+
/* @__PURE__ */ jsx11(ListItemIcon2, { children: /* @__PURE__ */ jsx11(MoveIcon, { size: 16 }) }),
|
|
5510
|
+
/* @__PURE__ */ jsx11(ListItemText2, { children: "Move to Project" })
|
|
5394
5511
|
] }),
|
|
5395
|
-
/* @__PURE__ */
|
|
5396
|
-
/* @__PURE__ */
|
|
5397
|
-
/* @__PURE__ */
|
|
5512
|
+
/* @__PURE__ */ jsxs8(MenuItem2, { onClick: handleDelete, children: [
|
|
5513
|
+
/* @__PURE__ */ jsx11(ListItemIcon2, { children: /* @__PURE__ */ jsx11(DeleteIcon2, { size: 16 }) }),
|
|
5514
|
+
/* @__PURE__ */ jsx11(ListItemText2, { children: "Delete" })
|
|
5398
5515
|
] })
|
|
5399
5516
|
]
|
|
5400
5517
|
}
|
|
@@ -5402,7 +5519,7 @@ var SimpleConversationItem = ({
|
|
|
5402
5519
|
]
|
|
5403
5520
|
}
|
|
5404
5521
|
),
|
|
5405
|
-
isMobile && /* @__PURE__ */
|
|
5522
|
+
isMobile && /* @__PURE__ */ jsxs8(
|
|
5406
5523
|
Dialog2,
|
|
5407
5524
|
{
|
|
5408
5525
|
open: showRenameDialog,
|
|
@@ -5418,8 +5535,8 @@ var SimpleConversationItem = ({
|
|
|
5418
5535
|
}
|
|
5419
5536
|
},
|
|
5420
5537
|
children: [
|
|
5421
|
-
/* @__PURE__ */
|
|
5422
|
-
/* @__PURE__ */
|
|
5538
|
+
/* @__PURE__ */ jsx11(DialogTitle2, { sx: { pb: 1 }, children: "Rename Conversation" }),
|
|
5539
|
+
/* @__PURE__ */ jsx11(DialogContent2, { children: /* @__PURE__ */ jsx11(
|
|
5423
5540
|
TextField4,
|
|
5424
5541
|
{
|
|
5425
5542
|
value: editName,
|
|
@@ -5432,8 +5549,8 @@ var SimpleConversationItem = ({
|
|
|
5432
5549
|
}
|
|
5433
5550
|
}
|
|
5434
5551
|
) }),
|
|
5435
|
-
/* @__PURE__ */
|
|
5436
|
-
/* @__PURE__ */
|
|
5552
|
+
/* @__PURE__ */ jsxs8(DialogActions2, { sx: { px: 3, pb: 2 }, children: [
|
|
5553
|
+
/* @__PURE__ */ jsx11(
|
|
5437
5554
|
Button4,
|
|
5438
5555
|
{
|
|
5439
5556
|
onClick: () => {
|
|
@@ -5443,7 +5560,7 @@ var SimpleConversationItem = ({
|
|
|
5443
5560
|
children: "Cancel"
|
|
5444
5561
|
}
|
|
5445
5562
|
),
|
|
5446
|
-
/* @__PURE__ */
|
|
5563
|
+
/* @__PURE__ */ jsx11(
|
|
5447
5564
|
Button4,
|
|
5448
5565
|
{
|
|
5449
5566
|
onClick: () => {
|
|
@@ -5464,20 +5581,20 @@ var SimpleConversationItem = ({
|
|
|
5464
5581
|
var simple_conversation_item_default = SimpleConversationItem;
|
|
5465
5582
|
|
|
5466
5583
|
// src/chat/project-header.tsx
|
|
5467
|
-
import { useRef as useRef7, useState as
|
|
5584
|
+
import { useRef as useRef7, useState as useState11 } from "react";
|
|
5468
5585
|
import {
|
|
5469
|
-
Box as
|
|
5586
|
+
Box as Box9,
|
|
5470
5587
|
Typography as Typography6,
|
|
5471
5588
|
IconButton as IconButton6,
|
|
5472
5589
|
Avatar as Avatar5,
|
|
5473
5590
|
Chip as Chip3,
|
|
5474
|
-
Tooltip as
|
|
5591
|
+
Tooltip as Tooltip3,
|
|
5475
5592
|
TextField as TextField5,
|
|
5476
5593
|
alpha as alpha5
|
|
5477
5594
|
} from "@mui/material";
|
|
5478
5595
|
import { ChevronDown as ExpandMoreIcon2, ChevronUp as ExpandLessIcon, Plus as AddIcon3, Folder as FolderIcon3, FolderOpen as FolderOpenIcon, Inbox as InboxIcon2, X as CloseIcon3, Check as CheckIcon2 } from "lucide-react";
|
|
5479
5596
|
import { useTheme as useTheme9 } from "@mui/material/styles";
|
|
5480
|
-
import { jsx as
|
|
5597
|
+
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
5481
5598
|
var ProjectHeader = ({
|
|
5482
5599
|
projectId,
|
|
5483
5600
|
projectName,
|
|
@@ -5494,9 +5611,9 @@ var ProjectHeader = ({
|
|
|
5494
5611
|
const theme = useTheme9();
|
|
5495
5612
|
const { createNewConversation } = useConversationStore();
|
|
5496
5613
|
const { renameProject } = useProjectStore();
|
|
5497
|
-
const [isHovered, setIsHovered] =
|
|
5498
|
-
const [isDragOver, setIsDragOver] =
|
|
5499
|
-
const [renameDraft, setRenameDraft] =
|
|
5614
|
+
const [isHovered, setIsHovered] = useState11(false);
|
|
5615
|
+
const [isDragOver, setIsDragOver] = useState11(false);
|
|
5616
|
+
const [renameDraft, setRenameDraft] = useState11(projectName);
|
|
5500
5617
|
const renameActionRef = useRef7("none");
|
|
5501
5618
|
const isUngrouped = projectId === null;
|
|
5502
5619
|
const Icon = isCollapsed ? FolderIcon3 : FolderOpenIcon;
|
|
@@ -5543,8 +5660,8 @@ var ProjectHeader = ({
|
|
|
5543
5660
|
setRenameDraft(projectName);
|
|
5544
5661
|
onRenameComplete?.();
|
|
5545
5662
|
};
|
|
5546
|
-
return /* @__PURE__ */
|
|
5547
|
-
|
|
5663
|
+
return /* @__PURE__ */ jsxs9(
|
|
5664
|
+
Box9,
|
|
5548
5665
|
{
|
|
5549
5666
|
"data-project-id": projectId ?? "__ungrouped",
|
|
5550
5667
|
onMouseEnter: () => setIsHovered(true),
|
|
@@ -5570,7 +5687,7 @@ var ProjectHeader = ({
|
|
|
5570
5687
|
} : {}
|
|
5571
5688
|
},
|
|
5572
5689
|
children: [
|
|
5573
|
-
/* @__PURE__ */
|
|
5690
|
+
/* @__PURE__ */ jsx12(
|
|
5574
5691
|
Avatar5,
|
|
5575
5692
|
{
|
|
5576
5693
|
sx: {
|
|
@@ -5579,17 +5696,17 @@ var ProjectHeader = ({
|
|
|
5579
5696
|
height: 28,
|
|
5580
5697
|
mr: 1.5
|
|
5581
5698
|
},
|
|
5582
|
-
children: isUngrouped ? /* @__PURE__ */
|
|
5699
|
+
children: isUngrouped ? /* @__PURE__ */ jsx12(
|
|
5583
5700
|
InboxIcon2,
|
|
5584
5701
|
{
|
|
5585
5702
|
size: 16,
|
|
5586
5703
|
color: theme.palette.text.disabled,
|
|
5587
5704
|
style: { opacity: 0.7 }
|
|
5588
5705
|
}
|
|
5589
|
-
) : /* @__PURE__ */
|
|
5706
|
+
) : /* @__PURE__ */ jsx12(Icon, { size: 16 })
|
|
5590
5707
|
}
|
|
5591
5708
|
),
|
|
5592
|
-
isRenaming && !isUngrouped ? /* @__PURE__ */
|
|
5709
|
+
isRenaming && !isUngrouped ? /* @__PURE__ */ jsx12(
|
|
5593
5710
|
TextField5,
|
|
5594
5711
|
{
|
|
5595
5712
|
value: renameDraft,
|
|
@@ -5636,7 +5753,7 @@ var ProjectHeader = ({
|
|
|
5636
5753
|
}
|
|
5637
5754
|
}
|
|
5638
5755
|
}
|
|
5639
|
-
) : /* @__PURE__ */
|
|
5756
|
+
) : /* @__PURE__ */ jsxs9(
|
|
5640
5757
|
Typography6,
|
|
5641
5758
|
{
|
|
5642
5759
|
variant: "subtitle2",
|
|
@@ -5649,7 +5766,7 @@ var ProjectHeader = ({
|
|
|
5649
5766
|
},
|
|
5650
5767
|
children: [
|
|
5651
5768
|
projectName,
|
|
5652
|
-
isDragOver && /* @__PURE__ */
|
|
5769
|
+
isDragOver && /* @__PURE__ */ jsx12(
|
|
5653
5770
|
Typography6,
|
|
5654
5771
|
{
|
|
5655
5772
|
component: "span",
|
|
@@ -5665,7 +5782,7 @@ var ProjectHeader = ({
|
|
|
5665
5782
|
]
|
|
5666
5783
|
}
|
|
5667
5784
|
),
|
|
5668
|
-
/* @__PURE__ */
|
|
5785
|
+
/* @__PURE__ */ jsx12(
|
|
5669
5786
|
Chip3,
|
|
5670
5787
|
{
|
|
5671
5788
|
label: conversationCount,
|
|
@@ -5685,8 +5802,8 @@ var ProjectHeader = ({
|
|
|
5685
5802
|
}
|
|
5686
5803
|
}
|
|
5687
5804
|
),
|
|
5688
|
-
isRenaming && !isUngrouped && /* @__PURE__ */
|
|
5689
|
-
/* @__PURE__ */
|
|
5805
|
+
isRenaming && !isUngrouped && /* @__PURE__ */ jsxs9(Box9, { sx: { display: "flex", alignItems: "center", gap: 0.5, ml: 1 }, children: [
|
|
5806
|
+
/* @__PURE__ */ jsx12(Tooltip3, { title: "Cancel and remove", children: /* @__PURE__ */ jsx12(
|
|
5690
5807
|
IconButton6,
|
|
5691
5808
|
{
|
|
5692
5809
|
size: "small",
|
|
@@ -5696,10 +5813,10 @@ var ProjectHeader = ({
|
|
|
5696
5813
|
onRenameCancelDelete ? onRenameCancelDelete() : cancelRename();
|
|
5697
5814
|
},
|
|
5698
5815
|
sx: { color: alpha5(theme.palette.error.main, 0.9) },
|
|
5699
|
-
children: /* @__PURE__ */
|
|
5816
|
+
children: /* @__PURE__ */ jsx12(CloseIcon3, { size: 16 })
|
|
5700
5817
|
}
|
|
5701
5818
|
) }),
|
|
5702
|
-
/* @__PURE__ */
|
|
5819
|
+
/* @__PURE__ */ jsx12(Tooltip3, { title: "Save", children: /* @__PURE__ */ jsx12(
|
|
5703
5820
|
IconButton6,
|
|
5704
5821
|
{
|
|
5705
5822
|
size: "small",
|
|
@@ -5709,11 +5826,11 @@ var ProjectHeader = ({
|
|
|
5709
5826
|
commitRename();
|
|
5710
5827
|
},
|
|
5711
5828
|
sx: { color: theme.palette.success.main },
|
|
5712
|
-
children: /* @__PURE__ */
|
|
5829
|
+
children: /* @__PURE__ */ jsx12(CheckIcon2, { size: 16 })
|
|
5713
5830
|
}
|
|
5714
5831
|
) })
|
|
5715
5832
|
] }),
|
|
5716
|
-
isHovered && !isDragOver && !isUngrouped && !isRenaming && /* @__PURE__ */
|
|
5833
|
+
isHovered && !isDragOver && !isUngrouped && !isRenaming && /* @__PURE__ */ jsx12(Tooltip3, { title: `Add conversation to ${projectName.toLowerCase()}`, arrow: true, children: /* @__PURE__ */ jsx12(
|
|
5717
5834
|
IconButton6,
|
|
5718
5835
|
{
|
|
5719
5836
|
onClick: handleAddConversation,
|
|
@@ -5730,10 +5847,10 @@ var ProjectHeader = ({
|
|
|
5730
5847
|
},
|
|
5731
5848
|
transition: "all 0.2s ease"
|
|
5732
5849
|
},
|
|
5733
|
-
children: /* @__PURE__ */
|
|
5850
|
+
children: /* @__PURE__ */ jsx12(AddIcon3, { size: 16 })
|
|
5734
5851
|
}
|
|
5735
5852
|
) }),
|
|
5736
|
-
!isUngrouped && !isRenaming && /* @__PURE__ */
|
|
5853
|
+
!isUngrouped && !isRenaming && /* @__PURE__ */ jsx12(
|
|
5737
5854
|
IconButton6,
|
|
5738
5855
|
{
|
|
5739
5856
|
size: "small",
|
|
@@ -5741,7 +5858,7 @@ var ProjectHeader = ({
|
|
|
5741
5858
|
color: theme.palette.text.secondary,
|
|
5742
5859
|
transition: "transform 0.2s ease"
|
|
5743
5860
|
},
|
|
5744
|
-
children: isCollapsed ? /* @__PURE__ */
|
|
5861
|
+
children: isCollapsed ? /* @__PURE__ */ jsx12(ExpandMoreIcon2, { size: 16 }) : /* @__PURE__ */ jsx12(ExpandLessIcon, { size: 16 })
|
|
5745
5862
|
}
|
|
5746
5863
|
)
|
|
5747
5864
|
]
|
|
@@ -5763,7 +5880,7 @@ var TOOLTIP_COPY = {
|
|
|
5763
5880
|
var tooltip = (key) => TOOLTIP_COPY[key];
|
|
5764
5881
|
|
|
5765
5882
|
// src/chat/conversation-drawer.tsx
|
|
5766
|
-
import { Fragment as Fragment6, jsx as
|
|
5883
|
+
import { Fragment as Fragment6, jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
5767
5884
|
var BANDIT_AVATAR = "https://cdn.burtson.ai/images/bandit-head.png";
|
|
5768
5885
|
var coerceOptionalString = (value) => {
|
|
5769
5886
|
if (typeof value !== "string") return void 0;
|
|
@@ -5814,22 +5931,22 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5814
5931
|
createProject,
|
|
5815
5932
|
deleteProject
|
|
5816
5933
|
} = useProjectStore();
|
|
5817
|
-
const [projectManagementOpen, setProjectManagementOpen] =
|
|
5818
|
-
const [memoryModalOpen, setMemoryModalOpen] =
|
|
5819
|
-
const [collapsedProjects, setCollapsedProjects] =
|
|
5934
|
+
const [projectManagementOpen, setProjectManagementOpen] = useState12(false);
|
|
5935
|
+
const [memoryModalOpen, setMemoryModalOpen] = useState12(false);
|
|
5936
|
+
const [collapsedProjects, setCollapsedProjects] = useState12(/* @__PURE__ */ new Set());
|
|
5820
5937
|
const didInitCollapseRef = useRef8(false);
|
|
5821
|
-
const [searchQuery, setSearchQuery] =
|
|
5822
|
-
const [menuAnchorEl, setMenuAnchorEl] =
|
|
5823
|
-
const [clearConfirmOpen, setClearConfirmOpen] =
|
|
5824
|
-
const [moveModalOpen, setMoveModalOpen] =
|
|
5825
|
-
const [conversationToMove, setConversationToMove] =
|
|
5826
|
-
const [renameProjectId, setRenameProjectId] =
|
|
5938
|
+
const [searchQuery, setSearchQuery] = useState12("");
|
|
5939
|
+
const [menuAnchorEl, setMenuAnchorEl] = useState12(null);
|
|
5940
|
+
const [clearConfirmOpen, setClearConfirmOpen] = useState12(false);
|
|
5941
|
+
const [moveModalOpen, setMoveModalOpen] = useState12(false);
|
|
5942
|
+
const [conversationToMove, setConversationToMove] = useState12(null);
|
|
5943
|
+
const [renameProjectId, setRenameProjectId] = useState12(null);
|
|
5827
5944
|
const getCustomClaim = useCallback4((key) => {
|
|
5828
5945
|
if (!user) return void 0;
|
|
5829
5946
|
const record = user;
|
|
5830
5947
|
return coerceOptionalString(record[key]);
|
|
5831
5948
|
}, [user]);
|
|
5832
|
-
const userDisplayName =
|
|
5949
|
+
const userDisplayName = useMemo2(() => {
|
|
5833
5950
|
if (!user) return void 0;
|
|
5834
5951
|
const candidateFields = [
|
|
5835
5952
|
coerceOptionalString(user.name),
|
|
@@ -5844,7 +5961,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5844
5961
|
if (trimmedEmail) return trimmedEmail;
|
|
5845
5962
|
return user.sub;
|
|
5846
5963
|
}, [user, getCustomClaim]);
|
|
5847
|
-
const userSecondaryText =
|
|
5964
|
+
const userSecondaryText = useMemo2(() => {
|
|
5848
5965
|
if (!user) return void 0;
|
|
5849
5966
|
const trimmedEmail = coerceOptionalString(user.email);
|
|
5850
5967
|
if (trimmedEmail && trimmedEmail !== userDisplayName) {
|
|
@@ -5856,7 +5973,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5856
5973
|
}
|
|
5857
5974
|
return void 0;
|
|
5858
5975
|
}, [user, userDisplayName]);
|
|
5859
|
-
const [avatarImage, setAvatarImage] =
|
|
5976
|
+
const [avatarImage, setAvatarImage] = useState12(BANDIT_AVATAR);
|
|
5860
5977
|
useEffect10(() => {
|
|
5861
5978
|
let active2 = true;
|
|
5862
5979
|
let objectUrl = null;
|
|
@@ -5898,7 +6015,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5898
6015
|
};
|
|
5899
6016
|
}, [getCustomClaim]);
|
|
5900
6017
|
const avatarLabel = userDisplayName || user?.email || "Bandit";
|
|
5901
|
-
const avatarInitials =
|
|
6018
|
+
const avatarInitials = useMemo2(() => deriveInitials(avatarLabel), [avatarLabel]);
|
|
5902
6019
|
useEffect10(() => {
|
|
5903
6020
|
if (!projectsHydrated) {
|
|
5904
6021
|
hydrateProjects();
|
|
@@ -5917,7 +6034,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5917
6034
|
const end = Math.min(text.length, idx + query.length + 60);
|
|
5918
6035
|
return text.slice(start, end).replace(/\s+/g, " ").trim();
|
|
5919
6036
|
};
|
|
5920
|
-
const projectGroups =
|
|
6037
|
+
const projectGroups = useMemo2(() => {
|
|
5921
6038
|
const groups = projects.map((project) => ({
|
|
5922
6039
|
id: project.id,
|
|
5923
6040
|
name: project.name,
|
|
@@ -5940,7 +6057,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
5940
6057
|
}
|
|
5941
6058
|
return groups.filter((group) => group.conversations.length > 0 || group.id !== null);
|
|
5942
6059
|
}, [projects, conversations, collapsedProjects]);
|
|
5943
|
-
const filteredProjectGroups =
|
|
6060
|
+
const filteredProjectGroups = useMemo2(() => {
|
|
5944
6061
|
if (!searchQuery.trim()) return projectGroups;
|
|
5945
6062
|
const query = searchQuery.toLowerCase();
|
|
5946
6063
|
return projectGroups.map((group) => {
|
|
@@ -6011,8 +6128,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6011
6128
|
setMoveModalOpen(false);
|
|
6012
6129
|
setConversationToMove(null);
|
|
6013
6130
|
};
|
|
6014
|
-
return /* @__PURE__ */
|
|
6015
|
-
/* @__PURE__ */
|
|
6131
|
+
return /* @__PURE__ */ jsxs10(Fragment6, { children: [
|
|
6132
|
+
/* @__PURE__ */ jsxs10(
|
|
6016
6133
|
Drawer,
|
|
6017
6134
|
{
|
|
6018
6135
|
anchor: "left",
|
|
@@ -6054,8 +6171,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6054
6171
|
}
|
|
6055
6172
|
},
|
|
6056
6173
|
children: [
|
|
6057
|
-
/* @__PURE__ */
|
|
6058
|
-
|
|
6174
|
+
/* @__PURE__ */ jsxs10(
|
|
6175
|
+
Box10,
|
|
6059
6176
|
{
|
|
6060
6177
|
sx: {
|
|
6061
6178
|
p: 2,
|
|
@@ -6066,7 +6183,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6066
6183
|
gap: 1
|
|
6067
6184
|
},
|
|
6068
6185
|
children: [
|
|
6069
|
-
/* @__PURE__ */
|
|
6186
|
+
/* @__PURE__ */ jsx13(Tooltip4, { title: "Memories", arrow: true, children: /* @__PURE__ */ jsx13(
|
|
6070
6187
|
IconButton7,
|
|
6071
6188
|
{
|
|
6072
6189
|
onClick: () => setMemoryModalOpen(true),
|
|
@@ -6079,10 +6196,10 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6079
6196
|
bgcolor: alpha6(theme.palette.primary.main, 0.1)
|
|
6080
6197
|
}
|
|
6081
6198
|
},
|
|
6082
|
-
children: /* @__PURE__ */
|
|
6199
|
+
children: /* @__PURE__ */ jsx13(MemoryIcon, {})
|
|
6083
6200
|
}
|
|
6084
6201
|
) }),
|
|
6085
|
-
/* @__PURE__ */
|
|
6202
|
+
/* @__PURE__ */ jsx13(Tooltip4, { title: tooltip("manageProjects"), arrow: true, children: /* @__PURE__ */ jsx13(
|
|
6086
6203
|
IconButton7,
|
|
6087
6204
|
{
|
|
6088
6205
|
onClick: () => setProjectManagementOpen(true),
|
|
@@ -6095,10 +6212,10 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6095
6212
|
bgcolor: alpha6(theme.palette.primary.main, 0.1)
|
|
6096
6213
|
}
|
|
6097
6214
|
},
|
|
6098
|
-
children: /* @__PURE__ */
|
|
6215
|
+
children: /* @__PURE__ */ jsx13(FolderIcon4, {})
|
|
6099
6216
|
}
|
|
6100
6217
|
) }),
|
|
6101
|
-
/* @__PURE__ */
|
|
6218
|
+
/* @__PURE__ */ jsx13(Tooltip4, { title: tooltip("conversationOptions"), arrow: true, children: /* @__PURE__ */ jsx13(
|
|
6102
6219
|
IconButton7,
|
|
6103
6220
|
{
|
|
6104
6221
|
onClick: handleMenuOpen,
|
|
@@ -6111,10 +6228,10 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6111
6228
|
bgcolor: alpha6(theme.palette.text.primary, 0.1)
|
|
6112
6229
|
}
|
|
6113
6230
|
},
|
|
6114
|
-
children: /* @__PURE__ */
|
|
6231
|
+
children: /* @__PURE__ */ jsx13(MoreVertIcon3, {})
|
|
6115
6232
|
}
|
|
6116
6233
|
) }),
|
|
6117
|
-
isMobile && /* @__PURE__ */
|
|
6234
|
+
isMobile && /* @__PURE__ */ jsx13(Tooltip4, { title: tooltip("closeConversationsPanel"), children: /* @__PURE__ */ jsx13(
|
|
6118
6235
|
IconButton7,
|
|
6119
6236
|
{
|
|
6120
6237
|
onClick: (e) => {
|
|
@@ -6131,13 +6248,13 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6131
6248
|
bgcolor: alpha6(theme.palette.error.main, 0.1)
|
|
6132
6249
|
}
|
|
6133
6250
|
},
|
|
6134
|
-
children: /* @__PURE__ */
|
|
6251
|
+
children: /* @__PURE__ */ jsx13(CloseIcon4, {})
|
|
6135
6252
|
}
|
|
6136
6253
|
) })
|
|
6137
6254
|
]
|
|
6138
6255
|
}
|
|
6139
6256
|
),
|
|
6140
|
-
/* @__PURE__ */
|
|
6257
|
+
/* @__PURE__ */ jsx13(Box10, { sx: { p: 2, pb: 1 }, children: /* @__PURE__ */ jsx13(
|
|
6141
6258
|
TextField6,
|
|
6142
6259
|
{
|
|
6143
6260
|
fullWidth: true,
|
|
@@ -6147,8 +6264,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6147
6264
|
onChange: (e) => setSearchQuery(e.target.value),
|
|
6148
6265
|
variant: "outlined",
|
|
6149
6266
|
InputProps: {
|
|
6150
|
-
startAdornment: /* @__PURE__ */
|
|
6151
|
-
endAdornment: searchQuery && /* @__PURE__ */
|
|
6267
|
+
startAdornment: /* @__PURE__ */ jsx13(InputAdornment, { position: "start", children: /* @__PURE__ */ jsx13(SearchIcon, { size: 16, color: theme.palette.text.secondary }) }),
|
|
6268
|
+
endAdornment: searchQuery && /* @__PURE__ */ jsx13(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx13(Tooltip4, { title: tooltip("clearSearch"), children: /* @__PURE__ */ jsx13(
|
|
6152
6269
|
IconButton7,
|
|
6153
6270
|
{
|
|
6154
6271
|
onClick: handleSearchClear,
|
|
@@ -6156,7 +6273,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6156
6273
|
edge: "end",
|
|
6157
6274
|
"aria-label": tooltip("clearSearch"),
|
|
6158
6275
|
sx: { color: theme.palette.text.secondary },
|
|
6159
|
-
children: /* @__PURE__ */
|
|
6276
|
+
children: /* @__PURE__ */ jsx13(ClearIcon, { size: 16 })
|
|
6160
6277
|
}
|
|
6161
6278
|
) }) })
|
|
6162
6279
|
},
|
|
@@ -6173,9 +6290,9 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6173
6290
|
}
|
|
6174
6291
|
}
|
|
6175
6292
|
) }),
|
|
6176
|
-
/* @__PURE__ */
|
|
6177
|
-
/* @__PURE__ */
|
|
6178
|
-
|
|
6293
|
+
/* @__PURE__ */ jsxs10(Box10, { sx: { flex: 1, overflow: "auto", display: "flex", flexDirection: "column" }, children: [
|
|
6294
|
+
/* @__PURE__ */ jsxs10(
|
|
6295
|
+
Box10,
|
|
6179
6296
|
{
|
|
6180
6297
|
onClick: async () => {
|
|
6181
6298
|
const names = new Set(projects.map((p) => p.name));
|
|
@@ -6209,8 +6326,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6209
6326
|
"&:hover": { bgcolor: alpha6(theme.palette.text.primary, 0.04) }
|
|
6210
6327
|
},
|
|
6211
6328
|
children: [
|
|
6212
|
-
/* @__PURE__ */
|
|
6213
|
-
|
|
6329
|
+
/* @__PURE__ */ jsx13(
|
|
6330
|
+
Box10,
|
|
6214
6331
|
{
|
|
6215
6332
|
sx: {
|
|
6216
6333
|
width: 28,
|
|
@@ -6222,10 +6339,10 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6222
6339
|
justifyContent: "center",
|
|
6223
6340
|
flexShrink: 0
|
|
6224
6341
|
},
|
|
6225
|
-
children: /* @__PURE__ */
|
|
6342
|
+
children: /* @__PURE__ */ jsx13(FolderIcon4, { size: 16, color: theme.palette.success.main })
|
|
6226
6343
|
}
|
|
6227
6344
|
),
|
|
6228
|
-
/* @__PURE__ */
|
|
6345
|
+
/* @__PURE__ */ jsx13(
|
|
6229
6346
|
Typography7,
|
|
6230
6347
|
{
|
|
6231
6348
|
variant: "subtitle2",
|
|
@@ -6233,22 +6350,22 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6233
6350
|
children: "New Project"
|
|
6234
6351
|
}
|
|
6235
6352
|
),
|
|
6236
|
-
/* @__PURE__ */
|
|
6353
|
+
/* @__PURE__ */ jsx13(Tooltip4, { title: tooltip("addProject"), arrow: true, children: /* @__PURE__ */ jsx13(
|
|
6237
6354
|
IconButton7,
|
|
6238
6355
|
{
|
|
6239
6356
|
size: "small",
|
|
6240
6357
|
"aria-label": tooltip("addProject"),
|
|
6241
6358
|
sx: { color: theme.palette.success.main },
|
|
6242
|
-
children: /* @__PURE__ */
|
|
6359
|
+
children: /* @__PURE__ */ jsx13(AddIcon4, { size: 16 })
|
|
6243
6360
|
}
|
|
6244
6361
|
) })
|
|
6245
6362
|
]
|
|
6246
6363
|
}
|
|
6247
6364
|
),
|
|
6248
|
-
/* @__PURE__ */
|
|
6249
|
-
filteredProjectGroups.map((group, index) => /* @__PURE__ */
|
|
6250
|
-
group.id === null && filteredProjectGroups.length > 1 && /* @__PURE__ */
|
|
6251
|
-
|
|
6365
|
+
/* @__PURE__ */ jsx13(Divider2, { sx: { opacity: 0.3 } }),
|
|
6366
|
+
filteredProjectGroups.map((group, index) => /* @__PURE__ */ jsxs10(Box10, { children: [
|
|
6367
|
+
group.id === null && filteredProjectGroups.length > 1 && /* @__PURE__ */ jsxs10(
|
|
6368
|
+
Box10,
|
|
6252
6369
|
{
|
|
6253
6370
|
sx: {
|
|
6254
6371
|
py: 2,
|
|
@@ -6258,9 +6375,9 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6258
6375
|
gap: 2
|
|
6259
6376
|
},
|
|
6260
6377
|
children: [
|
|
6261
|
-
/* @__PURE__ */
|
|
6262
|
-
/* @__PURE__ */
|
|
6263
|
-
/* @__PURE__ */
|
|
6378
|
+
/* @__PURE__ */ jsx13(Divider2, { sx: { flex: 1, opacity: 0.6 } }),
|
|
6379
|
+
/* @__PURE__ */ jsxs10(Box10, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
6380
|
+
/* @__PURE__ */ jsx13(
|
|
6264
6381
|
InboxIcon3,
|
|
6265
6382
|
{
|
|
6266
6383
|
size: 14,
|
|
@@ -6268,7 +6385,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6268
6385
|
style: { opacity: 0.7 }
|
|
6269
6386
|
}
|
|
6270
6387
|
),
|
|
6271
|
-
/* @__PURE__ */
|
|
6388
|
+
/* @__PURE__ */ jsx13(
|
|
6272
6389
|
Typography7,
|
|
6273
6390
|
{
|
|
6274
6391
|
variant: "caption",
|
|
@@ -6283,12 +6400,12 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6283
6400
|
}
|
|
6284
6401
|
)
|
|
6285
6402
|
] }),
|
|
6286
|
-
/* @__PURE__ */
|
|
6403
|
+
/* @__PURE__ */ jsx13(Divider2, { sx: { flex: 1, opacity: 0.6 } })
|
|
6287
6404
|
]
|
|
6288
6405
|
}
|
|
6289
6406
|
),
|
|
6290
|
-
group.id !== null ? /* @__PURE__ */
|
|
6291
|
-
/* @__PURE__ */
|
|
6407
|
+
group.id !== null ? /* @__PURE__ */ jsxs10(Fragment6, { children: [
|
|
6408
|
+
/* @__PURE__ */ jsx13(
|
|
6292
6409
|
project_header_default,
|
|
6293
6410
|
{
|
|
6294
6411
|
projectId: group.id,
|
|
@@ -6317,8 +6434,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6317
6434
|
}
|
|
6318
6435
|
}
|
|
6319
6436
|
),
|
|
6320
|
-
/* @__PURE__ */
|
|
6321
|
-
group.conversations.map((conversation) => /* @__PURE__ */
|
|
6437
|
+
/* @__PURE__ */ jsx13(Collapse2, { in: !group.collapsed, children: /* @__PURE__ */ jsxs10(Box10, { sx: { pb: 1 }, children: [
|
|
6438
|
+
group.conversations.map((conversation) => /* @__PURE__ */ jsx13(
|
|
6322
6439
|
simple_conversation_item_default,
|
|
6323
6440
|
{
|
|
6324
6441
|
conversation,
|
|
@@ -6338,8 +6455,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6338
6455
|
},
|
|
6339
6456
|
conversation.id
|
|
6340
6457
|
)),
|
|
6341
|
-
group.conversations.length === 0 && !group.collapsed && group.id !== null && /* @__PURE__ */
|
|
6342
|
-
|
|
6458
|
+
group.conversations.length === 0 && !group.collapsed && group.id !== null && /* @__PURE__ */ jsxs10(
|
|
6459
|
+
Box10,
|
|
6343
6460
|
{
|
|
6344
6461
|
sx: {
|
|
6345
6462
|
p: 3,
|
|
@@ -6347,17 +6464,17 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6347
6464
|
color: theme.palette.text.secondary
|
|
6348
6465
|
},
|
|
6349
6466
|
children: [
|
|
6350
|
-
/* @__PURE__ */
|
|
6351
|
-
/* @__PURE__ */
|
|
6467
|
+
/* @__PURE__ */ jsx13(Typography7, { variant: "body2", children: "No conversations in this project yet" }),
|
|
6468
|
+
/* @__PURE__ */ jsx13(Typography7, { variant: "caption", sx: { mt: 1, display: "block" }, children: "Drag conversations here or use the + button above" })
|
|
6352
6469
|
]
|
|
6353
6470
|
}
|
|
6354
6471
|
)
|
|
6355
6472
|
] }) }),
|
|
6356
|
-
/* @__PURE__ */
|
|
6473
|
+
/* @__PURE__ */ jsx13(Divider2, { sx: { opacity: 0.3 } })
|
|
6357
6474
|
] }) : (
|
|
6358
6475
|
// Special handling for ungrouped - no header, just conversations in scrollable area
|
|
6359
|
-
/* @__PURE__ */
|
|
6360
|
-
|
|
6476
|
+
/* @__PURE__ */ jsx13(
|
|
6477
|
+
Box10,
|
|
6361
6478
|
{
|
|
6362
6479
|
sx: {
|
|
6363
6480
|
minHeight: 0,
|
|
@@ -6370,7 +6487,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6370
6487
|
mx: 1,
|
|
6371
6488
|
mb: 1
|
|
6372
6489
|
},
|
|
6373
|
-
children: group.conversations.map((conversation) => /* @__PURE__ */
|
|
6490
|
+
children: group.conversations.map((conversation) => /* @__PURE__ */ jsx13(
|
|
6374
6491
|
simple_conversation_item_default,
|
|
6375
6492
|
{
|
|
6376
6493
|
conversation,
|
|
@@ -6394,8 +6511,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6394
6511
|
)
|
|
6395
6512
|
)
|
|
6396
6513
|
] }, group.id || "ungrouped")),
|
|
6397
|
-
filteredProjectGroups.length === 0 && /* @__PURE__ */
|
|
6398
|
-
|
|
6514
|
+
filteredProjectGroups.length === 0 && /* @__PURE__ */ jsxs10(
|
|
6515
|
+
Box10,
|
|
6399
6516
|
{
|
|
6400
6517
|
sx: {
|
|
6401
6518
|
flex: 1,
|
|
@@ -6408,14 +6525,14 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6408
6525
|
color: theme.palette.text.secondary
|
|
6409
6526
|
},
|
|
6410
6527
|
children: [
|
|
6411
|
-
/* @__PURE__ */
|
|
6412
|
-
/* @__PURE__ */
|
|
6528
|
+
/* @__PURE__ */ jsx13(Typography7, { variant: "h6", sx: { mb: 1 }, children: searchQuery ? "No conversations found" : "No conversations yet" }),
|
|
6529
|
+
/* @__PURE__ */ jsx13(Typography7, { variant: "body2", sx: { mb: 3, maxWidth: 280 }, children: searchQuery ? `No conversations match "${searchQuery}"` : "Start your first conversation to begin organizing your chats into projects" })
|
|
6413
6530
|
]
|
|
6414
6531
|
}
|
|
6415
6532
|
)
|
|
6416
6533
|
] }),
|
|
6417
|
-
/* @__PURE__ */
|
|
6418
|
-
|
|
6534
|
+
/* @__PURE__ */ jsxs10(
|
|
6535
|
+
Box10,
|
|
6419
6536
|
{
|
|
6420
6537
|
onClick: user ? () => {
|
|
6421
6538
|
window.location.href = "/profile";
|
|
@@ -6436,7 +6553,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6436
6553
|
"&:hover": user ? { bgcolor: alpha6(theme.palette.primary.main, 0.08) } : void 0
|
|
6437
6554
|
},
|
|
6438
6555
|
children: [
|
|
6439
|
-
/* @__PURE__ */
|
|
6556
|
+
/* @__PURE__ */ jsx13(
|
|
6440
6557
|
Avatar6,
|
|
6441
6558
|
{
|
|
6442
6559
|
src: avatarImage,
|
|
@@ -6451,8 +6568,8 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6451
6568
|
children: avatarInitials
|
|
6452
6569
|
}
|
|
6453
6570
|
),
|
|
6454
|
-
/* @__PURE__ */
|
|
6455
|
-
|
|
6571
|
+
/* @__PURE__ */ jsxs10(
|
|
6572
|
+
Box10,
|
|
6456
6573
|
{
|
|
6457
6574
|
sx: {
|
|
6458
6575
|
minWidth: 0,
|
|
@@ -6464,7 +6581,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6464
6581
|
gap: 0.25
|
|
6465
6582
|
},
|
|
6466
6583
|
children: [
|
|
6467
|
-
/* @__PURE__ */
|
|
6584
|
+
/* @__PURE__ */ jsx13(
|
|
6468
6585
|
Typography7,
|
|
6469
6586
|
{
|
|
6470
6587
|
variant: "subtitle2",
|
|
@@ -6473,7 +6590,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6473
6590
|
children: user ? userDisplayName : "Not signed in"
|
|
6474
6591
|
}
|
|
6475
6592
|
),
|
|
6476
|
-
/* @__PURE__ */
|
|
6593
|
+
/* @__PURE__ */ jsx13(
|
|
6477
6594
|
Typography7,
|
|
6478
6595
|
{
|
|
6479
6596
|
variant: "caption",
|
|
@@ -6485,7 +6602,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6485
6602
|
]
|
|
6486
6603
|
}
|
|
6487
6604
|
),
|
|
6488
|
-
user && /* @__PURE__ */
|
|
6605
|
+
user && /* @__PURE__ */ jsx13(
|
|
6489
6606
|
SettingsIcon2,
|
|
6490
6607
|
{
|
|
6491
6608
|
size: 18,
|
|
@@ -6499,15 +6616,15 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6499
6616
|
]
|
|
6500
6617
|
}
|
|
6501
6618
|
),
|
|
6502
|
-
/* @__PURE__ */
|
|
6619
|
+
/* @__PURE__ */ jsx13(
|
|
6503
6620
|
project_management_modal_default,
|
|
6504
6621
|
{
|
|
6505
6622
|
open: projectManagementOpen,
|
|
6506
6623
|
onClose: () => setProjectManagementOpen(false)
|
|
6507
6624
|
}
|
|
6508
6625
|
),
|
|
6509
|
-
/* @__PURE__ */
|
|
6510
|
-
conversationToMove && /* @__PURE__ */
|
|
6626
|
+
/* @__PURE__ */ jsx13(memory_modal_default, { open: memoryModalOpen, onClose: () => setMemoryModalOpen(false) }),
|
|
6627
|
+
conversationToMove && /* @__PURE__ */ jsx13(
|
|
6511
6628
|
move_conversation_modal_default,
|
|
6512
6629
|
{
|
|
6513
6630
|
open: moveModalOpen,
|
|
@@ -6516,7 +6633,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6516
6633
|
currentProjectId: conversationToMove.projectId
|
|
6517
6634
|
}
|
|
6518
6635
|
),
|
|
6519
|
-
/* @__PURE__ */
|
|
6636
|
+
/* @__PURE__ */ jsx13(
|
|
6520
6637
|
Menu3,
|
|
6521
6638
|
{
|
|
6522
6639
|
anchorEl: menuAnchorEl,
|
|
@@ -6530,7 +6647,7 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6530
6647
|
vertical: "bottom",
|
|
6531
6648
|
horizontal: "right"
|
|
6532
6649
|
},
|
|
6533
|
-
children: /* @__PURE__ */
|
|
6650
|
+
children: /* @__PURE__ */ jsxs10(
|
|
6534
6651
|
MenuItem3,
|
|
6535
6652
|
{
|
|
6536
6653
|
onClick: () => {
|
|
@@ -6539,14 +6656,14 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6539
6656
|
},
|
|
6540
6657
|
sx: { color: theme.palette.error.main },
|
|
6541
6658
|
children: [
|
|
6542
|
-
/* @__PURE__ */
|
|
6543
|
-
/* @__PURE__ */
|
|
6659
|
+
/* @__PURE__ */ jsx13(ListItemIcon3, { children: /* @__PURE__ */ jsx13(DeleteSweepIcon, { size: 16, color: theme.palette.error.main }) }),
|
|
6660
|
+
/* @__PURE__ */ jsx13(ListItemText3, { children: "Clear All Conversations" })
|
|
6544
6661
|
]
|
|
6545
6662
|
}
|
|
6546
6663
|
)
|
|
6547
6664
|
}
|
|
6548
6665
|
),
|
|
6549
|
-
/* @__PURE__ */
|
|
6666
|
+
/* @__PURE__ */ jsxs10(
|
|
6550
6667
|
Dialog3,
|
|
6551
6668
|
{
|
|
6552
6669
|
open: clearConfirmOpen,
|
|
@@ -6554,11 +6671,11 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6554
6671
|
maxWidth: "sm",
|
|
6555
6672
|
fullWidth: true,
|
|
6556
6673
|
children: [
|
|
6557
|
-
/* @__PURE__ */
|
|
6558
|
-
/* @__PURE__ */
|
|
6559
|
-
/* @__PURE__ */
|
|
6560
|
-
/* @__PURE__ */
|
|
6561
|
-
/* @__PURE__ */
|
|
6674
|
+
/* @__PURE__ */ jsx13(DialogTitle3, { children: "Clear All Conversations?" }),
|
|
6675
|
+
/* @__PURE__ */ jsx13(DialogContent3, { children: /* @__PURE__ */ jsx13(Typography7, { children: "This will permanently delete all conversations and cannot be undone. Are you sure you want to continue?" }) }),
|
|
6676
|
+
/* @__PURE__ */ jsxs10(DialogActions3, { children: [
|
|
6677
|
+
/* @__PURE__ */ jsx13(Button5, { onClick: () => setClearConfirmOpen(false), children: "Cancel" }),
|
|
6678
|
+
/* @__PURE__ */ jsx13(
|
|
6562
6679
|
Button5,
|
|
6563
6680
|
{
|
|
6564
6681
|
onClick: handleClearAllConfirm,
|
|
@@ -6576,9 +6693,9 @@ var ConversationDrawer = ({ open, onClose }) => {
|
|
|
6576
6693
|
var conversation_drawer_default = ConversationDrawer;
|
|
6577
6694
|
|
|
6578
6695
|
// src/chat/enhanced-mobile-conversations-modal.tsx
|
|
6579
|
-
import { useState as
|
|
6696
|
+
import { useState as useState13, useMemo as useMemo3, useEffect as useEffect11, useRef as useRef9, useCallback as useCallback5 } from "react";
|
|
6580
6697
|
import {
|
|
6581
|
-
Box as
|
|
6698
|
+
Box as Box11,
|
|
6582
6699
|
IconButton as IconButton8,
|
|
6583
6700
|
Modal as Modal2,
|
|
6584
6701
|
Typography as Typography8,
|
|
@@ -6603,7 +6720,7 @@ import {
|
|
|
6603
6720
|
} from "@mui/material";
|
|
6604
6721
|
import { X as CloseIcon5, X as ClearIcon2, Search as SearchIcon2, Folder as FolderIcon5, MoreVertical as MoreVertIcon4, Trash2 as DeleteSweepIcon2, Inbox as InboxIcon4, Plus as AddIcon5 } from "lucide-react";
|
|
6605
6722
|
import { useTheme as useTheme11, alpha as alpha7 } from "@mui/material/styles";
|
|
6606
|
-
import { Fragment as Fragment7, jsx as
|
|
6723
|
+
import { Fragment as Fragment7, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
6607
6724
|
var BANDIT_AVATAR2 = "https://cdn.burtson.ai/images/bandit-head.png";
|
|
6608
6725
|
var coerceOptionalString2 = (value) => {
|
|
6609
6726
|
if (typeof value !== "string") return void 0;
|
|
@@ -6654,24 +6771,24 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6654
6771
|
createProject,
|
|
6655
6772
|
deleteProject
|
|
6656
6773
|
} = useProjectStore();
|
|
6657
|
-
const [projectManagementOpen, setProjectManagementOpen] =
|
|
6658
|
-
const [collapsedProjects, setCollapsedProjects] =
|
|
6774
|
+
const [projectManagementOpen, setProjectManagementOpen] = useState13(false);
|
|
6775
|
+
const [collapsedProjects, setCollapsedProjects] = useState13(/* @__PURE__ */ new Set());
|
|
6659
6776
|
const didInitCollapseRef = useRef9(false);
|
|
6660
|
-
const [searchQuery, setSearchQuery] =
|
|
6661
|
-
const [menuAnchorEl, setMenuAnchorEl] =
|
|
6662
|
-
const [clearConfirmOpen, setClearConfirmOpen] =
|
|
6663
|
-
const [moveModalOpen, setMoveModalOpen] =
|
|
6664
|
-
const [conversationToMove, setConversationToMove] =
|
|
6665
|
-
const [renameProjectId, setRenameProjectId] =
|
|
6666
|
-
const [deletedConversationIds, setDeletedConversationIds] =
|
|
6667
|
-
const [touchDragState, setTouchDragState] =
|
|
6668
|
-
const [avatarImage, setAvatarImage] =
|
|
6777
|
+
const [searchQuery, setSearchQuery] = useState13("");
|
|
6778
|
+
const [menuAnchorEl, setMenuAnchorEl] = useState13(null);
|
|
6779
|
+
const [clearConfirmOpen, setClearConfirmOpen] = useState13(false);
|
|
6780
|
+
const [moveModalOpen, setMoveModalOpen] = useState13(false);
|
|
6781
|
+
const [conversationToMove, setConversationToMove] = useState13(null);
|
|
6782
|
+
const [renameProjectId, setRenameProjectId] = useState13(null);
|
|
6783
|
+
const [deletedConversationIds, setDeletedConversationIds] = useState13(/* @__PURE__ */ new Set());
|
|
6784
|
+
const [touchDragState, setTouchDragState] = useState13({ conversationId: null, originProjectId: null, hoverProjectId: null });
|
|
6785
|
+
const [avatarImage, setAvatarImage] = useState13(BANDIT_AVATAR2);
|
|
6669
6786
|
const getCustomClaim = useCallback5((key) => {
|
|
6670
6787
|
if (!user) return void 0;
|
|
6671
6788
|
const record = user;
|
|
6672
6789
|
return coerceOptionalString2(record[key]);
|
|
6673
6790
|
}, [user]);
|
|
6674
|
-
const userDisplayName =
|
|
6791
|
+
const userDisplayName = useMemo3(() => {
|
|
6675
6792
|
if (!user) return void 0;
|
|
6676
6793
|
const candidateFields = [
|
|
6677
6794
|
coerceOptionalString2(user.name),
|
|
@@ -6686,7 +6803,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6686
6803
|
if (trimmedEmail) return trimmedEmail;
|
|
6687
6804
|
return user.sub;
|
|
6688
6805
|
}, [user, getCustomClaim]);
|
|
6689
|
-
const userSecondaryText =
|
|
6806
|
+
const userSecondaryText = useMemo3(() => {
|
|
6690
6807
|
if (!user) return void 0;
|
|
6691
6808
|
const trimmedEmail = coerceOptionalString2(user.email);
|
|
6692
6809
|
if (trimmedEmail && trimmedEmail !== userDisplayName) {
|
|
@@ -6715,7 +6832,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6715
6832
|
}
|
|
6716
6833
|
}, [open]);
|
|
6717
6834
|
const avatarLabel = userDisplayName || user?.email || "Bandit";
|
|
6718
|
-
const avatarInitials =
|
|
6835
|
+
const avatarInitials = useMemo3(() => deriveInitials2(avatarLabel), [avatarLabel]);
|
|
6719
6836
|
const buildSnippet = (text, query, idx) => {
|
|
6720
6837
|
const start = Math.max(0, idx - 40);
|
|
6721
6838
|
const end = Math.min(text.length, idx + query.length + 60);
|
|
@@ -6734,7 +6851,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6734
6851
|
}
|
|
6735
6852
|
}
|
|
6736
6853
|
}, [projectsHydrated, projects]);
|
|
6737
|
-
const projectGroups =
|
|
6854
|
+
const projectGroups = useMemo3(() => {
|
|
6738
6855
|
const visibleConversations = conversations.filter(
|
|
6739
6856
|
(conversation) => !deletedConversationIds.has(conversation.id)
|
|
6740
6857
|
);
|
|
@@ -6760,11 +6877,11 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6760
6877
|
}
|
|
6761
6878
|
return groups.filter((group) => group.conversations.length > 0 || group.id !== null);
|
|
6762
6879
|
}, [projects, conversations, collapsedProjects, deletedConversationIds]);
|
|
6763
|
-
const visibleConversationCount =
|
|
6880
|
+
const visibleConversationCount = useMemo3(
|
|
6764
6881
|
() => projectGroups.reduce((total, group) => total + group.conversations.length, 0),
|
|
6765
6882
|
[projectGroups]
|
|
6766
6883
|
);
|
|
6767
|
-
const filteredProjectGroups =
|
|
6884
|
+
const filteredProjectGroups = useMemo3(() => {
|
|
6768
6885
|
if (!searchQuery.trim()) return projectGroups;
|
|
6769
6886
|
const query = searchQuery.toLowerCase();
|
|
6770
6887
|
return projectGroups.map((group) => {
|
|
@@ -6840,11 +6957,11 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6840
6957
|
return { conversationId: null, originProjectId: null, hoverProjectId: null };
|
|
6841
6958
|
});
|
|
6842
6959
|
}, [getProjectIdFromPoint, moveConversationToProject]);
|
|
6843
|
-
const activeDragConversation =
|
|
6960
|
+
const activeDragConversation = useMemo3(() => {
|
|
6844
6961
|
if (!touchDragState.conversationId) return null;
|
|
6845
6962
|
return conversations.find((conv) => conv.id === touchDragState.conversationId) || null;
|
|
6846
6963
|
}, [touchDragState.conversationId, conversations]);
|
|
6847
|
-
const activeHoverLabel =
|
|
6964
|
+
const activeHoverLabel = useMemo3(() => {
|
|
6848
6965
|
if (!touchDragState.hoverProjectId) return "";
|
|
6849
6966
|
if (touchDragState.hoverProjectId === "__ungrouped") return "Ungrouped";
|
|
6850
6967
|
const project = projects.find((p) => p.id === touchDragState.hoverProjectId);
|
|
@@ -6908,8 +7025,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6908
7025
|
return changed ? next : prev;
|
|
6909
7026
|
});
|
|
6910
7027
|
}, [conversations]);
|
|
6911
|
-
return /* @__PURE__ */
|
|
6912
|
-
/* @__PURE__ */
|
|
7028
|
+
return /* @__PURE__ */ jsxs11(Fragment7, { children: [
|
|
7029
|
+
/* @__PURE__ */ jsx14(
|
|
6913
7030
|
Modal2,
|
|
6914
7031
|
{
|
|
6915
7032
|
open,
|
|
@@ -6918,8 +7035,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6918
7035
|
display: "flex",
|
|
6919
7036
|
alignItems: "flex-end"
|
|
6920
7037
|
},
|
|
6921
|
-
children: /* @__PURE__ */
|
|
6922
|
-
|
|
7038
|
+
children: /* @__PURE__ */ jsx14(Slide, { direction: "up", in: open, children: /* @__PURE__ */ jsxs11(
|
|
7039
|
+
Box11,
|
|
6923
7040
|
{
|
|
6924
7041
|
sx: {
|
|
6925
7042
|
width: "100%",
|
|
@@ -6932,7 +7049,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6932
7049
|
overflow: "hidden"
|
|
6933
7050
|
},
|
|
6934
7051
|
children: [
|
|
6935
|
-
/* @__PURE__ */
|
|
7052
|
+
/* @__PURE__ */ jsx14(
|
|
6936
7053
|
AppBar,
|
|
6937
7054
|
{
|
|
6938
7055
|
position: "static",
|
|
@@ -6942,9 +7059,9 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6942
7059
|
color: theme.palette.text.primary,
|
|
6943
7060
|
borderBottom: `1px solid ${theme.palette.divider}`
|
|
6944
7061
|
},
|
|
6945
|
-
children: /* @__PURE__ */
|
|
6946
|
-
/* @__PURE__ */
|
|
6947
|
-
visibleConversationCount > 0 && /* @__PURE__ */
|
|
7062
|
+
children: /* @__PURE__ */ jsxs11(Toolbar, { children: [
|
|
7063
|
+
/* @__PURE__ */ jsx14(Typography8, { variant: "h6", sx: { flex: 1, fontWeight: 600 }, children: "Conversations" }),
|
|
7064
|
+
visibleConversationCount > 0 && /* @__PURE__ */ jsx14(
|
|
6948
7065
|
Chip4,
|
|
6949
7066
|
{
|
|
6950
7067
|
label: visibleConversationCount,
|
|
@@ -6957,34 +7074,34 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6957
7074
|
}
|
|
6958
7075
|
}
|
|
6959
7076
|
),
|
|
6960
|
-
/* @__PURE__ */
|
|
7077
|
+
/* @__PURE__ */ jsx14(
|
|
6961
7078
|
IconButton8,
|
|
6962
7079
|
{
|
|
6963
7080
|
onClick: () => setProjectManagementOpen(true),
|
|
6964
7081
|
sx: { color: theme.palette.text.secondary },
|
|
6965
|
-
children: /* @__PURE__ */
|
|
7082
|
+
children: /* @__PURE__ */ jsx14(FolderIcon5, {})
|
|
6966
7083
|
}
|
|
6967
7084
|
),
|
|
6968
|
-
/* @__PURE__ */
|
|
7085
|
+
/* @__PURE__ */ jsx14(
|
|
6969
7086
|
IconButton8,
|
|
6970
7087
|
{
|
|
6971
7088
|
onClick: handleMenuOpen,
|
|
6972
7089
|
sx: { color: theme.palette.text.secondary },
|
|
6973
|
-
children: /* @__PURE__ */
|
|
7090
|
+
children: /* @__PURE__ */ jsx14(MoreVertIcon4, {})
|
|
6974
7091
|
}
|
|
6975
7092
|
),
|
|
6976
|
-
/* @__PURE__ */
|
|
7093
|
+
/* @__PURE__ */ jsx14(
|
|
6977
7094
|
IconButton8,
|
|
6978
7095
|
{
|
|
6979
7096
|
onClick: onClose,
|
|
6980
7097
|
sx: { color: theme.palette.text.secondary },
|
|
6981
|
-
children: /* @__PURE__ */
|
|
7098
|
+
children: /* @__PURE__ */ jsx14(CloseIcon5, {})
|
|
6982
7099
|
}
|
|
6983
7100
|
)
|
|
6984
7101
|
] })
|
|
6985
7102
|
}
|
|
6986
7103
|
),
|
|
6987
|
-
/* @__PURE__ */
|
|
7104
|
+
/* @__PURE__ */ jsx14(Box11, { sx: { p: 2, pb: 1 }, children: /* @__PURE__ */ jsx14(
|
|
6988
7105
|
TextField7,
|
|
6989
7106
|
{
|
|
6990
7107
|
fullWidth: true,
|
|
@@ -6994,22 +7111,22 @@ var EnhancedMobileConversationsModal = ({
|
|
|
6994
7111
|
onChange: (e) => setSearchQuery(e.target.value),
|
|
6995
7112
|
variant: "outlined",
|
|
6996
7113
|
InputProps: {
|
|
6997
|
-
startAdornment: /* @__PURE__ */
|
|
6998
|
-
endAdornment: searchQuery && /* @__PURE__ */
|
|
7114
|
+
startAdornment: /* @__PURE__ */ jsx14(InputAdornment2, { position: "start", children: /* @__PURE__ */ jsx14(SearchIcon2, { size: 16, color: theme.palette.text.secondary }) }),
|
|
7115
|
+
endAdornment: searchQuery && /* @__PURE__ */ jsx14(InputAdornment2, { position: "end", children: /* @__PURE__ */ jsx14(
|
|
6999
7116
|
IconButton8,
|
|
7000
7117
|
{
|
|
7001
7118
|
onClick: handleSearchClear,
|
|
7002
7119
|
size: "small",
|
|
7003
7120
|
edge: "end",
|
|
7004
7121
|
sx: { color: theme.palette.text.secondary },
|
|
7005
|
-
children: /* @__PURE__ */
|
|
7122
|
+
children: /* @__PURE__ */ jsx14(ClearIcon2, { size: 16 })
|
|
7006
7123
|
}
|
|
7007
7124
|
) })
|
|
7008
7125
|
}
|
|
7009
7126
|
}
|
|
7010
7127
|
) }),
|
|
7011
|
-
/* @__PURE__ */
|
|
7012
|
-
|
|
7128
|
+
/* @__PURE__ */ jsxs11(
|
|
7129
|
+
Box11,
|
|
7013
7130
|
{
|
|
7014
7131
|
sx: {
|
|
7015
7132
|
flex: 1,
|
|
@@ -7020,8 +7137,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7020
7137
|
pb: 2
|
|
7021
7138
|
},
|
|
7022
7139
|
children: [
|
|
7023
|
-
touchDragActive && activeDragConversation && /* @__PURE__ */
|
|
7024
|
-
|
|
7140
|
+
touchDragActive && activeDragConversation && /* @__PURE__ */ jsxs11(
|
|
7141
|
+
Box11,
|
|
7025
7142
|
{
|
|
7026
7143
|
sx: {
|
|
7027
7144
|
position: "absolute",
|
|
@@ -7046,7 +7163,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7046
7163
|
overflow: "hidden"
|
|
7047
7164
|
},
|
|
7048
7165
|
children: [
|
|
7049
|
-
/* @__PURE__ */
|
|
7166
|
+
/* @__PURE__ */ jsxs11(
|
|
7050
7167
|
Typography8,
|
|
7051
7168
|
{
|
|
7052
7169
|
variant: "caption",
|
|
@@ -7059,8 +7176,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7059
7176
|
},
|
|
7060
7177
|
children: [
|
|
7061
7178
|
"Move",
|
|
7062
|
-
/* @__PURE__ */
|
|
7063
|
-
|
|
7179
|
+
/* @__PURE__ */ jsxs11(
|
|
7180
|
+
Box11,
|
|
7064
7181
|
{
|
|
7065
7182
|
component: "span",
|
|
7066
7183
|
sx: {
|
|
@@ -7080,7 +7197,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7080
7197
|
]
|
|
7081
7198
|
}
|
|
7082
7199
|
),
|
|
7083
|
-
/* @__PURE__ */
|
|
7200
|
+
/* @__PURE__ */ jsx14(
|
|
7084
7201
|
Typography8,
|
|
7085
7202
|
{
|
|
7086
7203
|
variant: "caption",
|
|
@@ -7089,11 +7206,11 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7089
7206
|
fontWeight: 500,
|
|
7090
7207
|
whiteSpace: "nowrap"
|
|
7091
7208
|
},
|
|
7092
|
-
children: activeHoverLabel ? /* @__PURE__ */
|
|
7209
|
+
children: activeHoverLabel ? /* @__PURE__ */ jsxs11(Fragment7, { children: [
|
|
7093
7210
|
"to",
|
|
7094
7211
|
" ",
|
|
7095
|
-
/* @__PURE__ */
|
|
7096
|
-
|
|
7212
|
+
/* @__PURE__ */ jsx14(
|
|
7213
|
+
Box11,
|
|
7097
7214
|
{
|
|
7098
7215
|
component: "span",
|
|
7099
7216
|
sx: {
|
|
@@ -7109,8 +7226,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7109
7226
|
]
|
|
7110
7227
|
}
|
|
7111
7228
|
),
|
|
7112
|
-
/* @__PURE__ */
|
|
7113
|
-
|
|
7229
|
+
/* @__PURE__ */ jsxs11(
|
|
7230
|
+
Box11,
|
|
7114
7231
|
{
|
|
7115
7232
|
onClick: async () => {
|
|
7116
7233
|
const names = new Set(projects.map((p) => p.name));
|
|
@@ -7144,8 +7261,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7144
7261
|
"&:hover": { bgcolor: alpha7(theme.palette.text.primary, 0.04) }
|
|
7145
7262
|
},
|
|
7146
7263
|
children: [
|
|
7147
|
-
/* @__PURE__ */
|
|
7148
|
-
|
|
7264
|
+
/* @__PURE__ */ jsx14(
|
|
7265
|
+
Box11,
|
|
7149
7266
|
{
|
|
7150
7267
|
sx: {
|
|
7151
7268
|
width: 28,
|
|
@@ -7157,10 +7274,10 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7157
7274
|
justifyContent: "center",
|
|
7158
7275
|
flexShrink: 0
|
|
7159
7276
|
},
|
|
7160
|
-
children: /* @__PURE__ */
|
|
7277
|
+
children: /* @__PURE__ */ jsx14(FolderIcon5, { size: 16, color: theme.palette.success.main })
|
|
7161
7278
|
}
|
|
7162
7279
|
),
|
|
7163
|
-
/* @__PURE__ */
|
|
7280
|
+
/* @__PURE__ */ jsx14(
|
|
7164
7281
|
Typography8,
|
|
7165
7282
|
{
|
|
7166
7283
|
variant: "subtitle2",
|
|
@@ -7168,14 +7285,14 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7168
7285
|
children: "New Project"
|
|
7169
7286
|
}
|
|
7170
7287
|
),
|
|
7171
|
-
/* @__PURE__ */
|
|
7288
|
+
/* @__PURE__ */ jsx14(IconButton8, { size: "small", sx: { color: theme.palette.success.main }, children: /* @__PURE__ */ jsx14(AddIcon5, { size: 16 }) })
|
|
7172
7289
|
]
|
|
7173
7290
|
}
|
|
7174
7291
|
),
|
|
7175
|
-
/* @__PURE__ */
|
|
7176
|
-
filteredProjectGroups.map((group, index) => /* @__PURE__ */
|
|
7177
|
-
group.id === null && filteredProjectGroups.length > 1 && /* @__PURE__ */
|
|
7178
|
-
|
|
7292
|
+
/* @__PURE__ */ jsx14(Divider3, { sx: { opacity: 0.3 } }),
|
|
7293
|
+
filteredProjectGroups.map((group, index) => /* @__PURE__ */ jsxs11(Box11, { children: [
|
|
7294
|
+
group.id === null && filteredProjectGroups.length > 1 && /* @__PURE__ */ jsxs11(
|
|
7295
|
+
Box11,
|
|
7179
7296
|
{
|
|
7180
7297
|
sx: {
|
|
7181
7298
|
py: 2,
|
|
@@ -7185,9 +7302,9 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7185
7302
|
gap: 2
|
|
7186
7303
|
},
|
|
7187
7304
|
children: [
|
|
7188
|
-
/* @__PURE__ */
|
|
7189
|
-
/* @__PURE__ */
|
|
7190
|
-
/* @__PURE__ */
|
|
7305
|
+
/* @__PURE__ */ jsx14(Divider3, { sx: { flex: 1, opacity: 0.6 } }),
|
|
7306
|
+
/* @__PURE__ */ jsxs11(Box11, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
7307
|
+
/* @__PURE__ */ jsx14(
|
|
7191
7308
|
InboxIcon4,
|
|
7192
7309
|
{
|
|
7193
7310
|
size: 14,
|
|
@@ -7195,7 +7312,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7195
7312
|
style: { opacity: 0.7 }
|
|
7196
7313
|
}
|
|
7197
7314
|
),
|
|
7198
|
-
/* @__PURE__ */
|
|
7315
|
+
/* @__PURE__ */ jsx14(
|
|
7199
7316
|
Typography8,
|
|
7200
7317
|
{
|
|
7201
7318
|
variant: "caption",
|
|
@@ -7210,12 +7327,12 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7210
7327
|
}
|
|
7211
7328
|
)
|
|
7212
7329
|
] }),
|
|
7213
|
-
/* @__PURE__ */
|
|
7330
|
+
/* @__PURE__ */ jsx14(Divider3, { sx: { flex: 1, opacity: 0.6 } })
|
|
7214
7331
|
]
|
|
7215
7332
|
}
|
|
7216
7333
|
),
|
|
7217
|
-
group.id !== null ? /* @__PURE__ */
|
|
7218
|
-
/* @__PURE__ */
|
|
7334
|
+
group.id !== null ? /* @__PURE__ */ jsxs11(Fragment7, { children: [
|
|
7335
|
+
/* @__PURE__ */ jsx14(
|
|
7219
7336
|
project_header_default,
|
|
7220
7337
|
{
|
|
7221
7338
|
projectId: group.id,
|
|
@@ -7245,8 +7362,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7245
7362
|
isTouchTarget: touchDragActive && touchDragState.hoverProjectId === group.id
|
|
7246
7363
|
}
|
|
7247
7364
|
),
|
|
7248
|
-
/* @__PURE__ */
|
|
7249
|
-
|
|
7365
|
+
/* @__PURE__ */ jsx14(Collapse3, { in: !group.collapsed, children: /* @__PURE__ */ jsx14(
|
|
7366
|
+
Box11,
|
|
7250
7367
|
{
|
|
7251
7368
|
"data-project-id": group.id ?? "__ungrouped",
|
|
7252
7369
|
sx: {
|
|
@@ -7256,7 +7373,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7256
7373
|
transition: "border 0.2s ease, background-color 0.2s ease",
|
|
7257
7374
|
backgroundColor: touchDragActive && touchDragState.hoverProjectId === group.id ? alpha7(theme.palette.primary.main, 0.08) : "transparent"
|
|
7258
7375
|
},
|
|
7259
|
-
children: group.conversations.map((conversation) => /* @__PURE__ */
|
|
7376
|
+
children: group.conversations.map((conversation) => /* @__PURE__ */ jsx14(
|
|
7260
7377
|
simple_conversation_item_default,
|
|
7261
7378
|
{
|
|
7262
7379
|
conversation,
|
|
@@ -7290,8 +7407,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7290
7407
|
) })
|
|
7291
7408
|
] }) : (
|
|
7292
7409
|
// Special handling for ungrouped - no header, just conversations in scrollable area
|
|
7293
|
-
/* @__PURE__ */
|
|
7294
|
-
|
|
7410
|
+
/* @__PURE__ */ jsx14(
|
|
7411
|
+
Box11,
|
|
7295
7412
|
{
|
|
7296
7413
|
sx: {
|
|
7297
7414
|
minHeight: 0,
|
|
@@ -7307,7 +7424,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7307
7424
|
backgroundColor: touchDragActive && touchDragState.hoverProjectId === "__ungrouped" ? alpha7(theme.palette.primary.main, 0.08) : alpha7(theme.palette.background.default, 0.3)
|
|
7308
7425
|
},
|
|
7309
7426
|
"data-project-id": "__ungrouped",
|
|
7310
|
-
children: group.conversations.map((conversation) => /* @__PURE__ */
|
|
7427
|
+
children: group.conversations.map((conversation) => /* @__PURE__ */ jsx14(
|
|
7311
7428
|
simple_conversation_item_default,
|
|
7312
7429
|
{
|
|
7313
7430
|
conversation,
|
|
@@ -7341,8 +7458,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7341
7458
|
)
|
|
7342
7459
|
)
|
|
7343
7460
|
] }, group.id || "ungrouped")),
|
|
7344
|
-
filteredProjectGroups.length === 0 && /* @__PURE__ */
|
|
7345
|
-
|
|
7461
|
+
filteredProjectGroups.length === 0 && /* @__PURE__ */ jsxs11(
|
|
7462
|
+
Box11,
|
|
7346
7463
|
{
|
|
7347
7464
|
sx: {
|
|
7348
7465
|
flex: 1,
|
|
@@ -7355,16 +7472,16 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7355
7472
|
color: theme.palette.text.secondary
|
|
7356
7473
|
},
|
|
7357
7474
|
children: [
|
|
7358
|
-
/* @__PURE__ */
|
|
7359
|
-
/* @__PURE__ */
|
|
7475
|
+
/* @__PURE__ */ jsx14(Typography8, { variant: "h6", sx: { mb: 1 }, children: searchQuery ? "No conversations found" : "No conversations yet" }),
|
|
7476
|
+
/* @__PURE__ */ jsx14(Typography8, { variant: "body2", sx: { mb: 3, maxWidth: 280 }, children: searchQuery ? `No conversations match "${searchQuery}"` : "Start your first conversation to begin organizing your chats into projects" })
|
|
7360
7477
|
]
|
|
7361
7478
|
}
|
|
7362
7479
|
)
|
|
7363
7480
|
]
|
|
7364
7481
|
}
|
|
7365
7482
|
),
|
|
7366
|
-
/* @__PURE__ */
|
|
7367
|
-
|
|
7483
|
+
/* @__PURE__ */ jsxs11(
|
|
7484
|
+
Box11,
|
|
7368
7485
|
{
|
|
7369
7486
|
sx: {
|
|
7370
7487
|
mt: "auto",
|
|
@@ -7379,7 +7496,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7379
7496
|
flexWrap: "wrap"
|
|
7380
7497
|
},
|
|
7381
7498
|
children: [
|
|
7382
|
-
/* @__PURE__ */
|
|
7499
|
+
/* @__PURE__ */ jsx14(
|
|
7383
7500
|
Avatar7,
|
|
7384
7501
|
{
|
|
7385
7502
|
src: avatarImage,
|
|
@@ -7394,8 +7511,8 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7394
7511
|
children: avatarInitials
|
|
7395
7512
|
}
|
|
7396
7513
|
),
|
|
7397
|
-
/* @__PURE__ */
|
|
7398
|
-
/* @__PURE__ */
|
|
7514
|
+
/* @__PURE__ */ jsxs11(Box11, { sx: { display: "flex", flexDirection: "column", alignItems: "center", gap: 0.5, minWidth: 0 }, children: [
|
|
7515
|
+
/* @__PURE__ */ jsx14(
|
|
7399
7516
|
Typography8,
|
|
7400
7517
|
{
|
|
7401
7518
|
variant: "subtitle2",
|
|
@@ -7404,7 +7521,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7404
7521
|
children: user ? userDisplayName : "Not signed in"
|
|
7405
7522
|
}
|
|
7406
7523
|
),
|
|
7407
|
-
!user && /* @__PURE__ */
|
|
7524
|
+
!user && /* @__PURE__ */ jsx14(
|
|
7408
7525
|
Typography8,
|
|
7409
7526
|
{
|
|
7410
7527
|
variant: "caption",
|
|
@@ -7422,14 +7539,14 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7422
7539
|
) })
|
|
7423
7540
|
}
|
|
7424
7541
|
),
|
|
7425
|
-
/* @__PURE__ */
|
|
7542
|
+
/* @__PURE__ */ jsx14(
|
|
7426
7543
|
project_management_modal_default,
|
|
7427
7544
|
{
|
|
7428
7545
|
open: projectManagementOpen,
|
|
7429
7546
|
onClose: () => setProjectManagementOpen(false)
|
|
7430
7547
|
}
|
|
7431
7548
|
),
|
|
7432
|
-
conversationToMove && /* @__PURE__ */
|
|
7549
|
+
conversationToMove && /* @__PURE__ */ jsx14(
|
|
7433
7550
|
move_conversation_modal_default,
|
|
7434
7551
|
{
|
|
7435
7552
|
open: moveModalOpen,
|
|
@@ -7438,7 +7555,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7438
7555
|
currentProjectId: conversationToMove.projectId
|
|
7439
7556
|
}
|
|
7440
7557
|
),
|
|
7441
|
-
/* @__PURE__ */
|
|
7558
|
+
/* @__PURE__ */ jsx14(
|
|
7442
7559
|
Menu4,
|
|
7443
7560
|
{
|
|
7444
7561
|
anchorEl: menuAnchorEl,
|
|
@@ -7452,7 +7569,7 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7452
7569
|
vertical: "bottom",
|
|
7453
7570
|
horizontal: "right"
|
|
7454
7571
|
},
|
|
7455
|
-
children: /* @__PURE__ */
|
|
7572
|
+
children: /* @__PURE__ */ jsxs11(
|
|
7456
7573
|
MenuItem4,
|
|
7457
7574
|
{
|
|
7458
7575
|
onClick: () => {
|
|
@@ -7462,14 +7579,14 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7462
7579
|
disabled: visibleConversationCount === 0,
|
|
7463
7580
|
sx: { color: theme.palette.error.main },
|
|
7464
7581
|
children: [
|
|
7465
|
-
/* @__PURE__ */
|
|
7466
|
-
/* @__PURE__ */
|
|
7582
|
+
/* @__PURE__ */ jsx14(ListItemIcon4, { children: /* @__PURE__ */ jsx14(DeleteSweepIcon2, { size: 16, color: theme.palette.error.main }) }),
|
|
7583
|
+
/* @__PURE__ */ jsx14(ListItemText4, { children: "Clear All Conversations" })
|
|
7467
7584
|
]
|
|
7468
7585
|
}
|
|
7469
7586
|
)
|
|
7470
7587
|
}
|
|
7471
7588
|
),
|
|
7472
|
-
/* @__PURE__ */
|
|
7589
|
+
/* @__PURE__ */ jsxs11(
|
|
7473
7590
|
Dialog4,
|
|
7474
7591
|
{
|
|
7475
7592
|
open: clearConfirmOpen,
|
|
@@ -7477,11 +7594,11 @@ var EnhancedMobileConversationsModal = ({
|
|
|
7477
7594
|
maxWidth: "sm",
|
|
7478
7595
|
fullWidth: true,
|
|
7479
7596
|
children: [
|
|
7480
|
-
/* @__PURE__ */
|
|
7481
|
-
/* @__PURE__ */
|
|
7482
|
-
/* @__PURE__ */
|
|
7483
|
-
/* @__PURE__ */
|
|
7484
|
-
/* @__PURE__ */
|
|
7597
|
+
/* @__PURE__ */ jsx14(DialogTitle4, { children: "Clear All Conversations?" }),
|
|
7598
|
+
/* @__PURE__ */ jsx14(DialogContent4, { children: /* @__PURE__ */ jsx14(Typography8, { children: visibleConversationCount === 0 ? "No conversations available to clear." : `This will permanently delete ${visibleConversationCount} conversation${visibleConversationCount === 1 ? "" : "s"} and cannot be undone.` }) }),
|
|
7599
|
+
/* @__PURE__ */ jsxs11(DialogActions4, { children: [
|
|
7600
|
+
/* @__PURE__ */ jsx14(Button6, { onClick: () => setClearConfirmOpen(false), children: "Cancel" }),
|
|
7601
|
+
/* @__PURE__ */ jsx14(
|
|
7485
7602
|
Button6,
|
|
7486
7603
|
{
|
|
7487
7604
|
onClick: handleClearAllConfirm,
|
|
@@ -7500,7 +7617,7 @@ var enhanced_mobile_conversations_modal_default = EnhancedMobileConversationsMod
|
|
|
7500
7617
|
|
|
7501
7618
|
// src/chat/chat-app-bar.tsx
|
|
7502
7619
|
import { shallow as shallow2 } from "zustand/shallow";
|
|
7503
|
-
import { Fragment as Fragment8, jsx as
|
|
7620
|
+
import { Fragment as Fragment8, jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
7504
7621
|
var CDN_BASE = "https://cdn.burtson.ai/";
|
|
7505
7622
|
var banditHead = `${CDN_BASE}/images/bandit-head.png`;
|
|
7506
7623
|
var modelAvatars = {
|
|
@@ -7547,12 +7664,12 @@ var ChatAppBar = ({
|
|
|
7547
7664
|
menuBackground,
|
|
7548
7665
|
menuText
|
|
7549
7666
|
} = theme.palette.chat.appBar;
|
|
7550
|
-
const [modelAnchorEl, setModelAnchorEl] =
|
|
7551
|
-
const [engineAnchorEl, setEngineAnchorEl] =
|
|
7552
|
-
const [voiceAnchorEl, setVoiceAnchorEl] =
|
|
7553
|
-
const [modalOpen, setModalOpen] =
|
|
7554
|
-
const [confirmModelChangeOpen, setConfirmModelChangeOpen] =
|
|
7555
|
-
const [pendingModel, setPendingModel] =
|
|
7667
|
+
const [modelAnchorEl, setModelAnchorEl] = useState14(null);
|
|
7668
|
+
const [engineAnchorEl, setEngineAnchorEl] = useState14(null);
|
|
7669
|
+
const [voiceAnchorEl, setVoiceAnchorEl] = useState14(null);
|
|
7670
|
+
const [modalOpen, setModalOpen] = useState14(false);
|
|
7671
|
+
const [confirmModelChangeOpen, setConfirmModelChangeOpen] = useState14(false);
|
|
7672
|
+
const [pendingModel, setPendingModel] = useState14(null);
|
|
7556
7673
|
const { conversations, currentId, createNewConversation, _hasHydrated } = useConversationStore();
|
|
7557
7674
|
const { preferences } = usePreferencesStore();
|
|
7558
7675
|
const { settings: packageSettings } = usePackageSettingsStore();
|
|
@@ -7596,16 +7713,16 @@ var ChatAppBar = ({
|
|
|
7596
7713
|
};
|
|
7597
7714
|
const syncIndicatorIcon = (() => {
|
|
7598
7715
|
if (isPlaygroundMode2 || !syncEnabled) {
|
|
7599
|
-
return /* @__PURE__ */
|
|
7716
|
+
return /* @__PURE__ */ jsx15(CloudOffIcon, { fontSize: "small", color: "disabled" });
|
|
7600
7717
|
}
|
|
7601
7718
|
switch (syncStatus) {
|
|
7602
7719
|
case "syncing":
|
|
7603
|
-
return /* @__PURE__ */
|
|
7720
|
+
return /* @__PURE__ */ jsx15(SyncIcon, { fontSize: "small", sx: syncSpinSx, color: "primary" });
|
|
7604
7721
|
case "error":
|
|
7605
|
-
return /* @__PURE__ */
|
|
7722
|
+
return /* @__PURE__ */ jsx15(ErrorOutlineIcon, { fontSize: "small", color: "error" });
|
|
7606
7723
|
case "idle":
|
|
7607
7724
|
default:
|
|
7608
|
-
return /* @__PURE__ */
|
|
7725
|
+
return /* @__PURE__ */ jsx15(CloudDoneIcon, { fontSize: "small", color: "success" });
|
|
7609
7726
|
}
|
|
7610
7727
|
})();
|
|
7611
7728
|
const syncTooltip = (() => {
|
|
@@ -7711,9 +7828,9 @@ var ChatAppBar = ({
|
|
|
7711
7828
|
}
|
|
7712
7829
|
safeNavigate("/");
|
|
7713
7830
|
}
|
|
7714
|
-
return /* @__PURE__ */
|
|
7715
|
-
/* @__PURE__ */
|
|
7716
|
-
|
|
7831
|
+
return /* @__PURE__ */ jsxs12(Fragment8, { children: [
|
|
7832
|
+
/* @__PURE__ */ jsxs12(
|
|
7833
|
+
Box12,
|
|
7717
7834
|
{
|
|
7718
7835
|
sx: {
|
|
7719
7836
|
position: "fixed",
|
|
@@ -7733,8 +7850,8 @@ var ChatAppBar = ({
|
|
|
7733
7850
|
}
|
|
7734
7851
|
},
|
|
7735
7852
|
children: [
|
|
7736
|
-
/* @__PURE__ */
|
|
7737
|
-
|
|
7853
|
+
/* @__PURE__ */ jsxs12(
|
|
7854
|
+
Box12,
|
|
7738
7855
|
{
|
|
7739
7856
|
sx: {
|
|
7740
7857
|
display: "flex",
|
|
@@ -7754,16 +7871,16 @@ var ChatAppBar = ({
|
|
|
7754
7871
|
}
|
|
7755
7872
|
},
|
|
7756
7873
|
children: [
|
|
7757
|
-
/* @__PURE__ */
|
|
7874
|
+
/* @__PURE__ */ jsx15(Tooltip5, { title: homeTooltip, arrow: true, children: /* @__PURE__ */ jsx15(
|
|
7758
7875
|
IconButton9,
|
|
7759
7876
|
{
|
|
7760
7877
|
onClick: goToHome,
|
|
7761
7878
|
sx: pillButtonStyles,
|
|
7762
7879
|
"aria-label": "Go to home page",
|
|
7763
|
-
children: /* @__PURE__ */
|
|
7880
|
+
children: /* @__PURE__ */ jsx15(HomeIcon, {})
|
|
7764
7881
|
}
|
|
7765
7882
|
) }),
|
|
7766
|
-
showLimitedAdminPanel() && /* @__PURE__ */
|
|
7883
|
+
showLimitedAdminPanel() && /* @__PURE__ */ jsx15(Tooltip5, { title: "Management & Settings", arrow: true, children: /* @__PURE__ */ jsx15(
|
|
7767
7884
|
IconButton9,
|
|
7768
7885
|
{
|
|
7769
7886
|
onClick: () => safeNavigate(managementPath),
|
|
@@ -7775,10 +7892,10 @@ var ChatAppBar = ({
|
|
|
7775
7892
|
}
|
|
7776
7893
|
},
|
|
7777
7894
|
"aria-label": "Open management settings",
|
|
7778
|
-
children: /* @__PURE__ */
|
|
7895
|
+
children: /* @__PURE__ */ jsx15(SettingsIcon, {})
|
|
7779
7896
|
}
|
|
7780
7897
|
) }),
|
|
7781
|
-
/* @__PURE__ */
|
|
7898
|
+
/* @__PURE__ */ jsx15(Tooltip5, { title: syncTooltip, arrow: true, children: /* @__PURE__ */ jsxs12(
|
|
7782
7899
|
IconButton9,
|
|
7783
7900
|
{
|
|
7784
7901
|
onClick: handleSyncBadgeClick,
|
|
@@ -7794,8 +7911,8 @@ var ChatAppBar = ({
|
|
|
7794
7911
|
"aria-label": "Conversation sync status",
|
|
7795
7912
|
children: [
|
|
7796
7913
|
syncIndicatorIcon,
|
|
7797
|
-
pendingCount > 0 && !syncButtonDisabled && syncStatus !== "syncing" && /* @__PURE__ */
|
|
7798
|
-
|
|
7914
|
+
pendingCount > 0 && !syncButtonDisabled && syncStatus !== "syncing" && /* @__PURE__ */ jsx15(
|
|
7915
|
+
Box12,
|
|
7799
7916
|
{
|
|
7800
7917
|
sx: {
|
|
7801
7918
|
position: "absolute",
|
|
@@ -7820,7 +7937,7 @@ var ChatAppBar = ({
|
|
|
7820
7937
|
]
|
|
7821
7938
|
}
|
|
7822
7939
|
) }),
|
|
7823
|
-
!isMobile && /* @__PURE__ */
|
|
7940
|
+
!isMobile && /* @__PURE__ */ jsx15(Tooltip5, { title: `${drawerOpen ? "Close" : "Open"} Conversations`, arrow: true, children: /* @__PURE__ */ jsxs12(
|
|
7824
7941
|
IconButton9,
|
|
7825
7942
|
{
|
|
7826
7943
|
onClick: () => setDrawerOpen(!drawerOpen),
|
|
@@ -7834,9 +7951,9 @@ var ChatAppBar = ({
|
|
|
7834
7951
|
"aria-label": `${drawerOpen ? "Close" : "Open"} conversations drawer`,
|
|
7835
7952
|
"aria-pressed": drawerOpen,
|
|
7836
7953
|
children: [
|
|
7837
|
-
drawerOpen ? /* @__PURE__ */
|
|
7838
|
-
conversations.length > 0 && /* @__PURE__ */
|
|
7839
|
-
|
|
7954
|
+
drawerOpen ? /* @__PURE__ */ jsx15(NotesIcon, {}) : /* @__PURE__ */ jsx15(NotesIconOutlined, {}),
|
|
7955
|
+
conversations.length > 0 && /* @__PURE__ */ jsx15(
|
|
7956
|
+
Box12,
|
|
7840
7957
|
{
|
|
7841
7958
|
sx: {
|
|
7842
7959
|
position: "absolute",
|
|
@@ -7861,7 +7978,7 @@ var ChatAppBar = ({
|
|
|
7861
7978
|
]
|
|
7862
7979
|
}
|
|
7863
7980
|
) }),
|
|
7864
|
-
!isMobile && canShowNewConversationButton && /* @__PURE__ */
|
|
7981
|
+
!isMobile && canShowNewConversationButton && /* @__PURE__ */ jsx15(Tooltip5, { title: "Start New Conversation", arrow: true, children: /* @__PURE__ */ jsx15(
|
|
7865
7982
|
IconButton9,
|
|
7866
7983
|
{
|
|
7867
7984
|
onClick: () => createNewConversation(),
|
|
@@ -7875,14 +7992,14 @@ var ChatAppBar = ({
|
|
|
7875
7992
|
}
|
|
7876
7993
|
},
|
|
7877
7994
|
"aria-label": "Create new conversation",
|
|
7878
|
-
children: /* @__PURE__ */
|
|
7995
|
+
children: /* @__PURE__ */ jsx15(AddIcon, {})
|
|
7879
7996
|
}
|
|
7880
7997
|
) })
|
|
7881
7998
|
]
|
|
7882
7999
|
}
|
|
7883
8000
|
),
|
|
7884
|
-
/* @__PURE__ */
|
|
7885
|
-
|
|
8001
|
+
/* @__PURE__ */ jsxs12(
|
|
8002
|
+
Box12,
|
|
7886
8003
|
{
|
|
7887
8004
|
sx: {
|
|
7888
8005
|
display: "flex",
|
|
@@ -7902,7 +8019,7 @@ var ChatAppBar = ({
|
|
|
7902
8019
|
}
|
|
7903
8020
|
},
|
|
7904
8021
|
children: [
|
|
7905
|
-
isMobile && /* @__PURE__ */
|
|
8022
|
+
isMobile && /* @__PURE__ */ jsx15(Tooltip5, { title: `Conversations (${conversations.length})`, arrow: true, children: /* @__PURE__ */ jsxs12(
|
|
7906
8023
|
IconButton9,
|
|
7907
8024
|
{
|
|
7908
8025
|
onClick: () => setModalOpen(true),
|
|
@@ -7912,9 +8029,9 @@ var ChatAppBar = ({
|
|
|
7912
8029
|
},
|
|
7913
8030
|
"aria-label": `Open conversations modal with ${conversations.length} conversations`,
|
|
7914
8031
|
children: [
|
|
7915
|
-
/* @__PURE__ */
|
|
7916
|
-
conversations.length > 0 && /* @__PURE__ */
|
|
7917
|
-
|
|
8032
|
+
/* @__PURE__ */ jsx15(NotesIcon, { fontSize: "small" }),
|
|
8033
|
+
conversations.length > 0 && /* @__PURE__ */ jsx15(
|
|
8034
|
+
Box12,
|
|
7918
8035
|
{
|
|
7919
8036
|
sx: {
|
|
7920
8037
|
position: "absolute",
|
|
@@ -7939,7 +8056,7 @@ var ChatAppBar = ({
|
|
|
7939
8056
|
]
|
|
7940
8057
|
}
|
|
7941
8058
|
) }),
|
|
7942
|
-
isMobile && canShowNewConversationButton && /* @__PURE__ */
|
|
8059
|
+
isMobile && canShowNewConversationButton && /* @__PURE__ */ jsx15(Tooltip5, { title: "Start New Conversation", arrow: true, children: /* @__PURE__ */ jsx15(
|
|
7943
8060
|
IconButton9,
|
|
7944
8061
|
{
|
|
7945
8062
|
onClick: () => {
|
|
@@ -7956,10 +8073,10 @@ var ChatAppBar = ({
|
|
|
7956
8073
|
}
|
|
7957
8074
|
},
|
|
7958
8075
|
"aria-label": "Create new conversation",
|
|
7959
|
-
children: /* @__PURE__ */
|
|
8076
|
+
children: /* @__PURE__ */ jsx15(AddIcon, { fontSize: "small" })
|
|
7960
8077
|
}
|
|
7961
8078
|
) }),
|
|
7962
|
-
/* @__PURE__ */
|
|
8079
|
+
/* @__PURE__ */ jsx15(Tooltip5, { title: `Current AI: ${selectedModel.replace("Bandit-", "")}`, arrow: true, children: /* @__PURE__ */ jsx15(
|
|
7963
8080
|
IconButton9,
|
|
7964
8081
|
{
|
|
7965
8082
|
onClick: (e) => setModelAnchorEl(e.currentTarget),
|
|
@@ -7974,7 +8091,7 @@ var ChatAppBar = ({
|
|
|
7974
8091
|
}
|
|
7975
8092
|
},
|
|
7976
8093
|
"aria-label": `Change AI personality. Currently using ${selectedModel}`,
|
|
7977
|
-
children: /* @__PURE__ */
|
|
8094
|
+
children: /* @__PURE__ */ jsx15(
|
|
7978
8095
|
Avatar8,
|
|
7979
8096
|
{
|
|
7980
8097
|
src: currentAvatar,
|
|
@@ -7991,16 +8108,16 @@ var ChatAppBar = ({
|
|
|
7991
8108
|
)
|
|
7992
8109
|
}
|
|
7993
8110
|
) }),
|
|
7994
|
-
/* @__PURE__ */
|
|
8111
|
+
/* @__PURE__ */ jsx15(Tooltip5, { title: `Engine \xB7 ${engineDisplay}`, arrow: true, children: /* @__PURE__ */ jsx15(
|
|
7995
8112
|
IconButton9,
|
|
7996
8113
|
{
|
|
7997
8114
|
onClick: (e) => setEngineAnchorEl(e.currentTarget),
|
|
7998
8115
|
sx: pillButtonStyles,
|
|
7999
8116
|
"aria-label": `Change base model (engine). Currently ${engineDisplay}`,
|
|
8000
|
-
children: /* @__PURE__ */
|
|
8117
|
+
children: /* @__PURE__ */ jsx15(AutoAwesomeIcon, { fontSize: "small" })
|
|
8001
8118
|
}
|
|
8002
8119
|
) }),
|
|
8003
|
-
/* @__PURE__ */
|
|
8120
|
+
/* @__PURE__ */ jsxs12(
|
|
8004
8121
|
Menu5,
|
|
8005
8122
|
{
|
|
8006
8123
|
anchorEl: engineAnchorEl,
|
|
@@ -8009,8 +8126,8 @@ var ChatAppBar = ({
|
|
|
8009
8126
|
transformOrigin: { horizontal: "right", vertical: "top" },
|
|
8010
8127
|
anchorOrigin: { horizontal: "right", vertical: "bottom" },
|
|
8011
8128
|
children: [
|
|
8012
|
-
/* @__PURE__ */
|
|
8013
|
-
engines.length === 0 && /* @__PURE__ */
|
|
8129
|
+
/* @__PURE__ */ jsx15(Typography9, { variant: "overline", sx: { px: 2, color: theme.palette.text.secondary }, children: "Engine \xB7 base model" }),
|
|
8130
|
+
engines.length === 0 && /* @__PURE__ */ jsx15(MenuItem5, { disabled: true, children: /* @__PURE__ */ jsx15(Typography9, { variant: "body2", children: "No engines available" }) }),
|
|
8014
8131
|
engines.map((engine) => {
|
|
8015
8132
|
const badges = [
|
|
8016
8133
|
engine.vision && "vision",
|
|
@@ -8018,7 +8135,7 @@ var ChatAppBar = ({
|
|
|
8018
8135
|
engine.thinking && "thinking",
|
|
8019
8136
|
engine.cloud && "cloud"
|
|
8020
8137
|
].filter(Boolean);
|
|
8021
|
-
return /* @__PURE__ */
|
|
8138
|
+
return /* @__PURE__ */ jsxs12(
|
|
8022
8139
|
MenuItem5,
|
|
8023
8140
|
{
|
|
8024
8141
|
selected: engine.id === resolvedEngineId,
|
|
@@ -8038,13 +8155,13 @@ var ChatAppBar = ({
|
|
|
8038
8155
|
whiteSpace: "normal"
|
|
8039
8156
|
},
|
|
8040
8157
|
children: [
|
|
8041
|
-
/* @__PURE__ */
|
|
8042
|
-
/* @__PURE__ */
|
|
8043
|
-
engine.id === resolvedEngineId && /* @__PURE__ */
|
|
8158
|
+
/* @__PURE__ */ jsxs12(Box12, { sx: { display: "flex", alignItems: "center", gap: 1, width: "100%" }, children: [
|
|
8159
|
+
/* @__PURE__ */ jsx15(Typography9, { variant: "body2", sx: { fontWeight: 600, flex: 1 }, children: cleanEngineName(engine.displayName) }),
|
|
8160
|
+
engine.id === resolvedEngineId && /* @__PURE__ */ jsx15(Box12, { sx: { width: 8, height: 8, borderRadius: "50%", bgcolor: theme.palette.primary.main } })
|
|
8044
8161
|
] }),
|
|
8045
|
-
/* @__PURE__ */
|
|
8046
|
-
badges.length > 0 && /* @__PURE__ */
|
|
8047
|
-
|
|
8162
|
+
/* @__PURE__ */ jsx15(Typography9, { variant: "caption", sx: { color: theme.palette.text.secondary }, children: engine.available ? engine.description : engine.unavailableReason || "Unavailable" }),
|
|
8163
|
+
badges.length > 0 && /* @__PURE__ */ jsx15(Box12, { sx: { display: "flex", gap: 0.5, flexWrap: "wrap", mt: 0.25 }, children: badges.map((b) => /* @__PURE__ */ jsx15(
|
|
8164
|
+
Box12,
|
|
8048
8165
|
{
|
|
8049
8166
|
sx: {
|
|
8050
8167
|
fontSize: "0.65rem",
|
|
@@ -8066,7 +8183,7 @@ var ChatAppBar = ({
|
|
|
8066
8183
|
]
|
|
8067
8184
|
}
|
|
8068
8185
|
),
|
|
8069
|
-
/* @__PURE__ */
|
|
8186
|
+
/* @__PURE__ */ jsx15(
|
|
8070
8187
|
Menu5,
|
|
8071
8188
|
{
|
|
8072
8189
|
anchorEl: modelAnchorEl,
|
|
@@ -8102,7 +8219,7 @@ var ChatAppBar = ({
|
|
|
8102
8219
|
}
|
|
8103
8220
|
}
|
|
8104
8221
|
},
|
|
8105
|
-
children: availableModels.map((model) => /* @__PURE__ */
|
|
8222
|
+
children: availableModels.map((model) => /* @__PURE__ */ jsxs12(
|
|
8106
8223
|
MenuItem5,
|
|
8107
8224
|
{
|
|
8108
8225
|
selected: model.name === selectedModel,
|
|
@@ -8149,7 +8266,7 @@ var ChatAppBar = ({
|
|
|
8149
8266
|
px: 2
|
|
8150
8267
|
},
|
|
8151
8268
|
children: [
|
|
8152
|
-
/* @__PURE__ */
|
|
8269
|
+
/* @__PURE__ */ jsx15(
|
|
8153
8270
|
Avatar8,
|
|
8154
8271
|
{
|
|
8155
8272
|
src: model.avatarBase64 || modelAvatars[model.name] || banditHead,
|
|
@@ -8162,12 +8279,12 @@ var ChatAppBar = ({
|
|
|
8162
8279
|
}
|
|
8163
8280
|
}
|
|
8164
8281
|
),
|
|
8165
|
-
/* @__PURE__ */
|
|
8166
|
-
/* @__PURE__ */
|
|
8167
|
-
/* @__PURE__ */
|
|
8282
|
+
/* @__PURE__ */ jsxs12(Box12, { sx: { flex: 1 }, children: [
|
|
8283
|
+
/* @__PURE__ */ jsx15(Typography9, { variant: "body2", sx: { fontWeight: 500 }, children: model.name.replace("Bandit-", "") }),
|
|
8284
|
+
/* @__PURE__ */ jsx15(Typography9, { variant: "caption", sx: { color: theme.palette.text.secondary, display: "block" }, children: model.name === selectedModel ? "Currently active" : "Switch to this AI" })
|
|
8168
8285
|
] }),
|
|
8169
|
-
model.name === selectedModel && /* @__PURE__ */
|
|
8170
|
-
|
|
8286
|
+
model.name === selectedModel && /* @__PURE__ */ jsx15(
|
|
8287
|
+
Box12,
|
|
8171
8288
|
{
|
|
8172
8289
|
sx: {
|
|
8173
8290
|
width: 8,
|
|
@@ -8183,8 +8300,8 @@ var ChatAppBar = ({
|
|
|
8183
8300
|
))
|
|
8184
8301
|
}
|
|
8185
8302
|
),
|
|
8186
|
-
isTTSAvailable && /* @__PURE__ */
|
|
8187
|
-
/* @__PURE__ */
|
|
8303
|
+
isTTSAvailable && /* @__PURE__ */ jsxs12(Fragment8, { children: [
|
|
8304
|
+
/* @__PURE__ */ jsx15(Tooltip5, { title: `Voice: ${selectedVoice ? toTitleCase(selectedVoice.split("-")[1]) : "Default"}`, arrow: true, children: /* @__PURE__ */ jsx15(
|
|
8188
8305
|
IconButton9,
|
|
8189
8306
|
{
|
|
8190
8307
|
onClick: (e) => setVoiceAnchorEl(e.currentTarget),
|
|
@@ -8198,10 +8315,10 @@ var ChatAppBar = ({
|
|
|
8198
8315
|
}
|
|
8199
8316
|
},
|
|
8200
8317
|
"aria-label": `Change voice. Currently using ${selectedVoice ? toTitleCase(selectedVoice.split("-")[1]) : "default"}`,
|
|
8201
|
-
children: /* @__PURE__ */
|
|
8318
|
+
children: /* @__PURE__ */ jsx15(RecordVoiceOverIcon, { fontSize: "small" })
|
|
8202
8319
|
}
|
|
8203
8320
|
) }),
|
|
8204
|
-
/* @__PURE__ */
|
|
8321
|
+
/* @__PURE__ */ jsx15(
|
|
8205
8322
|
Menu5,
|
|
8206
8323
|
{
|
|
8207
8324
|
anchorEl: voiceAnchorEl,
|
|
@@ -8238,7 +8355,7 @@ var ChatAppBar = ({
|
|
|
8238
8355
|
}
|
|
8239
8356
|
}
|
|
8240
8357
|
},
|
|
8241
|
-
children: availableVoices.length > 0 ? availableVoices.map((voice) => /* @__PURE__ */
|
|
8358
|
+
children: availableVoices.length > 0 ? availableVoices.map((voice) => /* @__PURE__ */ jsx15(
|
|
8242
8359
|
MenuItem5,
|
|
8243
8360
|
{
|
|
8244
8361
|
selected: voice === selectedVoice,
|
|
@@ -8246,14 +8363,14 @@ var ChatAppBar = ({
|
|
|
8246
8363
|
handleVoiceChange(voice);
|
|
8247
8364
|
setVoiceAnchorEl(null);
|
|
8248
8365
|
},
|
|
8249
|
-
children: /* @__PURE__ */
|
|
8250
|
-
/* @__PURE__ */
|
|
8251
|
-
/* @__PURE__ */
|
|
8252
|
-
/* @__PURE__ */
|
|
8253
|
-
/* @__PURE__ */
|
|
8366
|
+
children: /* @__PURE__ */ jsxs12(Box12, { sx: { display: "flex", alignItems: "center", gap: 1, width: "100%" }, children: [
|
|
8367
|
+
/* @__PURE__ */ jsx15(RecordVoiceOverIcon, { fontSize: "small", sx: { color: theme.palette.text.secondary } }),
|
|
8368
|
+
/* @__PURE__ */ jsxs12(Box12, { sx: { flex: 1 }, children: [
|
|
8369
|
+
/* @__PURE__ */ jsx15(Typography9, { variant: "body2", children: toTitleCase(voice.split("-")[1]) }),
|
|
8370
|
+
/* @__PURE__ */ jsx15(Typography9, { variant: "caption", sx: { color: theme.palette.text.secondary }, children: voice === selectedVoice ? "Currently active" : "Switch to this voice" })
|
|
8254
8371
|
] }),
|
|
8255
|
-
voice === selectedVoice && /* @__PURE__ */
|
|
8256
|
-
|
|
8372
|
+
voice === selectedVoice && /* @__PURE__ */ jsx15(
|
|
8373
|
+
Box12,
|
|
8257
8374
|
{
|
|
8258
8375
|
sx: {
|
|
8259
8376
|
width: 8,
|
|
@@ -8266,7 +8383,7 @@ var ChatAppBar = ({
|
|
|
8266
8383
|
] })
|
|
8267
8384
|
},
|
|
8268
8385
|
voice
|
|
8269
|
-
)) : /* @__PURE__ */
|
|
8386
|
+
)) : /* @__PURE__ */ jsx15(MenuItem5, { disabled: true, children: /* @__PURE__ */ jsx15(Typography9, { variant: "body2", color: "text.secondary", children: "No voices available" }) })
|
|
8270
8387
|
}
|
|
8271
8388
|
)
|
|
8272
8389
|
] })
|
|
@@ -8276,17 +8393,17 @@ var ChatAppBar = ({
|
|
|
8276
8393
|
]
|
|
8277
8394
|
}
|
|
8278
8395
|
),
|
|
8279
|
-
/* @__PURE__ */
|
|
8280
|
-
/* @__PURE__ */
|
|
8281
|
-
/* @__PURE__ */
|
|
8396
|
+
/* @__PURE__ */ jsx15(conversation_drawer_default, { open: drawerOpen, onClose: () => setDrawerOpen(false) }),
|
|
8397
|
+
/* @__PURE__ */ jsx15(enhanced_mobile_conversations_modal_default, { open: modalOpen, onClose: () => setModalOpen(false) }),
|
|
8398
|
+
/* @__PURE__ */ jsxs12(
|
|
8282
8399
|
Dialog5,
|
|
8283
8400
|
{
|
|
8284
8401
|
open: confirmModelChangeOpen,
|
|
8285
8402
|
onClose: () => setConfirmModelChangeOpen(false),
|
|
8286
8403
|
children: [
|
|
8287
|
-
/* @__PURE__ */
|
|
8288
|
-
/* @__PURE__ */
|
|
8289
|
-
/* @__PURE__ */
|
|
8404
|
+
/* @__PURE__ */ jsx15(DialogTitle5, { children: "Change personality and start new conversation?" }),
|
|
8405
|
+
/* @__PURE__ */ jsx15(DialogContent5, { children: /* @__PURE__ */ jsxs12(Box12, { display: "flex", alignItems: "center", gap: 2, mt: 1, justifyContent: "center", children: [
|
|
8406
|
+
/* @__PURE__ */ jsx15(
|
|
8290
8407
|
Avatar8,
|
|
8291
8408
|
{
|
|
8292
8409
|
src: pendingModelAvatar,
|
|
@@ -8294,15 +8411,15 @@ var ChatAppBar = ({
|
|
|
8294
8411
|
sx: { width: 40, height: 40, filter: "brightness(1.7)" }
|
|
8295
8412
|
}
|
|
8296
8413
|
),
|
|
8297
|
-
/* @__PURE__ */
|
|
8414
|
+
/* @__PURE__ */ jsxs12(Typography9, { variant: "body2", children: [
|
|
8298
8415
|
"Your current conversation will be saved, and a new one will begin with ",
|
|
8299
|
-
/* @__PURE__ */
|
|
8416
|
+
/* @__PURE__ */ jsx15("strong", { children: pendingModel }),
|
|
8300
8417
|
"."
|
|
8301
8418
|
] })
|
|
8302
8419
|
] }) }),
|
|
8303
|
-
/* @__PURE__ */
|
|
8304
|
-
/* @__PURE__ */
|
|
8305
|
-
/* @__PURE__ */
|
|
8420
|
+
/* @__PURE__ */ jsxs12(DialogActions5, { children: [
|
|
8421
|
+
/* @__PURE__ */ jsx15(Button7, { onClick: () => setConfirmModelChangeOpen(false), children: "Cancel" }),
|
|
8422
|
+
/* @__PURE__ */ jsx15(
|
|
8306
8423
|
Button7,
|
|
8307
8424
|
{
|
|
8308
8425
|
onClick: () => {
|
|
@@ -8405,19 +8522,19 @@ Respond with just the title and nothing else.
|
|
|
8405
8522
|
};
|
|
8406
8523
|
|
|
8407
8524
|
// src/chat/query-suggestion-picker.tsx
|
|
8408
|
-
import { useEffect as useEffect13, useRef as useRef11, useState as
|
|
8409
|
-
import { Box as
|
|
8525
|
+
import { useEffect as useEffect13, useRef as useRef11, useState as useState15 } from "react";
|
|
8526
|
+
import { Box as Box13, useMediaQuery as useMediaQuery6 } from "@mui/material";
|
|
8410
8527
|
import { useTheme as useTheme13, alpha as alpha8 } from "@mui/material/styles";
|
|
8411
8528
|
import ReactMarkdown from "react-markdown";
|
|
8412
8529
|
import remarkGfm from "remark-gfm";
|
|
8413
8530
|
import rehypeRaw from "rehype-raw";
|
|
8414
|
-
import { Fragment as Fragment9, jsx as
|
|
8531
|
+
import { Fragment as Fragment9, jsx as jsx16 } from "react/jsx-runtime";
|
|
8415
8532
|
var markdownComponents = {
|
|
8416
|
-
p: ({ node, ...props }) => /* @__PURE__ */
|
|
8417
|
-
mark: ({ node, children, ...props }) => /* @__PURE__ */
|
|
8533
|
+
p: ({ node, ...props }) => /* @__PURE__ */ jsx16("span", { ...props }),
|
|
8534
|
+
mark: ({ node, children, ...props }) => /* @__PURE__ */ jsx16("mark", { ...props, children }),
|
|
8418
8535
|
code: ({ node, children, ...props }) => {
|
|
8419
8536
|
const { inline, ...rest } = props;
|
|
8420
|
-
return inline ? /* @__PURE__ */
|
|
8537
|
+
return inline ? /* @__PURE__ */ jsx16("code", { ...rest, children }) : /* @__PURE__ */ jsx16("code", { ...rest, children });
|
|
8421
8538
|
}
|
|
8422
8539
|
};
|
|
8423
8540
|
var QuerySuggestionPicker = ({
|
|
@@ -8425,9 +8542,9 @@ var QuerySuggestionPicker = ({
|
|
|
8425
8542
|
inputHeight
|
|
8426
8543
|
}) => {
|
|
8427
8544
|
const hasGenerated = useRef11(false);
|
|
8428
|
-
const [hasSentPrompt, setHasSentPrompt] =
|
|
8429
|
-
const [examplePrompts, setExamplePrompts] =
|
|
8430
|
-
const [visiblePrompts, setVisiblePrompts] =
|
|
8545
|
+
const [hasSentPrompt, setHasSentPrompt] = useState15(false);
|
|
8546
|
+
const [examplePrompts, setExamplePrompts] = useState15([]);
|
|
8547
|
+
const [visiblePrompts, setVisiblePrompts] = useState15([]);
|
|
8431
8548
|
const scrollRef = useRef11(null);
|
|
8432
8549
|
const theme = useTheme13();
|
|
8433
8550
|
const isMobile = useMediaQuery6((theme2) => theme2.breakpoints.down("sm"));
|
|
@@ -8490,8 +8607,8 @@ var QuerySuggestionPicker = ({
|
|
|
8490
8607
|
return () => clearInterval(interval);
|
|
8491
8608
|
}, [hasSentPrompt, examplePrompts.length]);
|
|
8492
8609
|
const displayPrompts = isMobile ? visiblePrompts.slice(0, Math.min(visiblePrompts.length, 6)) : visiblePrompts;
|
|
8493
|
-
return displayPrompts.length > 0 && /* @__PURE__ */
|
|
8494
|
-
|
|
8610
|
+
return displayPrompts.length > 0 && /* @__PURE__ */ jsx16(Fragment9, { children: /* @__PURE__ */ jsx16(
|
|
8611
|
+
Box13,
|
|
8495
8612
|
{
|
|
8496
8613
|
ref: scrollRef,
|
|
8497
8614
|
sx: {
|
|
@@ -8507,8 +8624,8 @@ var QuerySuggestionPicker = ({
|
|
|
8507
8624
|
pb: isMobile ? 0.4 : 0,
|
|
8508
8625
|
"&::-webkit-scrollbar": { display: "none" }
|
|
8509
8626
|
},
|
|
8510
|
-
children: displayPrompts.map((prompt, i) => /* @__PURE__ */
|
|
8511
|
-
|
|
8627
|
+
children: displayPrompts.map((prompt, i) => /* @__PURE__ */ jsx16(
|
|
8628
|
+
Box13,
|
|
8512
8629
|
{
|
|
8513
8630
|
sx: {
|
|
8514
8631
|
px: isMobile ? 1.4 : 2,
|
|
@@ -8542,8 +8659,8 @@ var QuerySuggestionPicker = ({
|
|
|
8542
8659
|
onSend(prompt, []);
|
|
8543
8660
|
setHasSentPrompt(true);
|
|
8544
8661
|
},
|
|
8545
|
-
children: /* @__PURE__ */
|
|
8546
|
-
|
|
8662
|
+
children: /* @__PURE__ */ jsx16(
|
|
8663
|
+
Box13,
|
|
8547
8664
|
{
|
|
8548
8665
|
sx: {
|
|
8549
8666
|
flex: 1,
|
|
@@ -8567,7 +8684,7 @@ var QuerySuggestionPicker = ({
|
|
|
8567
8684
|
padding: "0.1em 0.25em"
|
|
8568
8685
|
}
|
|
8569
8686
|
},
|
|
8570
|
-
children: /* @__PURE__ */
|
|
8687
|
+
children: /* @__PURE__ */ jsx16(
|
|
8571
8688
|
ReactMarkdown,
|
|
8572
8689
|
{
|
|
8573
8690
|
remarkPlugins: [remarkGfm],
|
|
@@ -8586,9 +8703,9 @@ var QuerySuggestionPicker = ({
|
|
|
8586
8703
|
};
|
|
8587
8704
|
|
|
8588
8705
|
// ../../src/pages/under-review.tsx
|
|
8589
|
-
import { Box as
|
|
8706
|
+
import { Box as Box14, Typography as Typography10, useTheme as useTheme14 } from "@mui/material";
|
|
8590
8707
|
import { useNavigate as useNavigate2 } from "react-router-dom";
|
|
8591
|
-
import { jsx as
|
|
8708
|
+
import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
8592
8709
|
var UnderReview = () => {
|
|
8593
8710
|
const theme = useTheme14();
|
|
8594
8711
|
const navigate = useNavigate2();
|
|
@@ -8596,8 +8713,8 @@ var UnderReview = () => {
|
|
|
8596
8713
|
localStorage.removeItem("authToken");
|
|
8597
8714
|
navigate("/login");
|
|
8598
8715
|
};
|
|
8599
|
-
return /* @__PURE__ */
|
|
8600
|
-
|
|
8716
|
+
return /* @__PURE__ */ jsxs13(
|
|
8717
|
+
Box14,
|
|
8601
8718
|
{
|
|
8602
8719
|
sx: {
|
|
8603
8720
|
minHeight: "100vh",
|
|
@@ -8612,8 +8729,8 @@ var UnderReview = () => {
|
|
|
8612
8729
|
position: "relative"
|
|
8613
8730
|
},
|
|
8614
8731
|
children: [
|
|
8615
|
-
/* @__PURE__ */
|
|
8616
|
-
|
|
8732
|
+
/* @__PURE__ */ jsx17(
|
|
8733
|
+
Box14,
|
|
8617
8734
|
{
|
|
8618
8735
|
onClick: handleSneakyLogout,
|
|
8619
8736
|
sx: {
|
|
@@ -8638,13 +8755,13 @@ var UnderReview = () => {
|
|
|
8638
8755
|
title: "Reset session"
|
|
8639
8756
|
}
|
|
8640
8757
|
),
|
|
8641
|
-
/* @__PURE__ */
|
|
8642
|
-
/* @__PURE__ */
|
|
8758
|
+
/* @__PURE__ */ jsx17(Typography10, { variant: "h4", sx: { mb: 2, fontWeight: 700, color: theme.palette.error.main }, children: "Under Review" }),
|
|
8759
|
+
/* @__PURE__ */ jsxs13(Typography10, { variant: "body1", sx: { mb: 2, color: theme.palette.text.secondary }, children: [
|
|
8643
8760
|
"Your request to use our services is currently being reviewed.",
|
|
8644
|
-
/* @__PURE__ */
|
|
8761
|
+
/* @__PURE__ */ jsx17("br", {}),
|
|
8645
8762
|
"For more info, please contact ",
|
|
8646
8763
|
" ",
|
|
8647
|
-
/* @__PURE__ */
|
|
8764
|
+
/* @__PURE__ */ jsx17("a", { href: "mailto:team@banditai.ai", style: { color: theme.palette.primary.main, fontWeight: 600 }, children: "team@banditai.ai" })
|
|
8648
8765
|
] })
|
|
8649
8766
|
]
|
|
8650
8767
|
}
|
|
@@ -8653,8 +8770,8 @@ var UnderReview = () => {
|
|
|
8653
8770
|
var under_review_default = UnderReview;
|
|
8654
8771
|
|
|
8655
8772
|
// src/components/ConnectionStatus.tsx
|
|
8656
|
-
import { Box as
|
|
8657
|
-
import { jsx as
|
|
8773
|
+
import { Box as Box15, Chip as Chip5, useTheme as useTheme15 } from "@mui/material";
|
|
8774
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
8658
8775
|
var ConnectionStatus = ({
|
|
8659
8776
|
showWhenGood = false,
|
|
8660
8777
|
position = "top"
|
|
@@ -8668,28 +8785,28 @@ var ConnectionStatus = ({
|
|
|
8668
8785
|
switch (connectionQuality) {
|
|
8669
8786
|
case "offline":
|
|
8670
8787
|
return {
|
|
8671
|
-
icon: /* @__PURE__ */
|
|
8788
|
+
icon: /* @__PURE__ */ jsx18(WifiOffIcon, { sx: { fontSize: 16 } }),
|
|
8672
8789
|
label: "Offline",
|
|
8673
8790
|
color: "error",
|
|
8674
8791
|
severity: "high"
|
|
8675
8792
|
};
|
|
8676
8793
|
case "slow":
|
|
8677
8794
|
return {
|
|
8678
|
-
icon: /* @__PURE__ */
|
|
8795
|
+
icon: /* @__PURE__ */ jsx18(SignalWifi2BarIcon, { sx: { fontSize: 16 } }),
|
|
8679
8796
|
label: "Slow connection",
|
|
8680
8797
|
color: "warning",
|
|
8681
8798
|
severity: "medium"
|
|
8682
8799
|
};
|
|
8683
8800
|
case "fast":
|
|
8684
8801
|
return {
|
|
8685
|
-
icon: /* @__PURE__ */
|
|
8802
|
+
icon: /* @__PURE__ */ jsx18(WifiIcon, { sx: { fontSize: 16 } }),
|
|
8686
8803
|
label: "Connected",
|
|
8687
8804
|
color: "success",
|
|
8688
8805
|
severity: "low"
|
|
8689
8806
|
};
|
|
8690
8807
|
default:
|
|
8691
8808
|
return {
|
|
8692
|
-
icon: /* @__PURE__ */
|
|
8809
|
+
icon: /* @__PURE__ */ jsx18(WifiIcon, { sx: { fontSize: 16 } }),
|
|
8693
8810
|
label: "Unknown",
|
|
8694
8811
|
color: "default",
|
|
8695
8812
|
severity: "low"
|
|
@@ -8697,8 +8814,8 @@ var ConnectionStatus = ({
|
|
|
8697
8814
|
}
|
|
8698
8815
|
};
|
|
8699
8816
|
const config = getStatusConfig();
|
|
8700
|
-
return /* @__PURE__ */
|
|
8701
|
-
|
|
8817
|
+
return /* @__PURE__ */ jsx18(
|
|
8818
|
+
Box15,
|
|
8702
8819
|
{
|
|
8703
8820
|
sx: {
|
|
8704
8821
|
position: "fixed",
|
|
@@ -8713,7 +8830,7 @@ var ConnectionStatus = ({
|
|
|
8713
8830
|
"100%": { opacity: 1 }
|
|
8714
8831
|
}
|
|
8715
8832
|
},
|
|
8716
|
-
children: /* @__PURE__ */
|
|
8833
|
+
children: /* @__PURE__ */ jsx18(
|
|
8717
8834
|
Chip5,
|
|
8718
8835
|
{
|
|
8719
8836
|
icon: config.icon,
|
|
@@ -9026,7 +9143,7 @@ var useVoiceMode = (config) => {
|
|
|
9026
9143
|
};
|
|
9027
9144
|
|
|
9028
9145
|
// src/chat/chat.tsx
|
|
9029
|
-
import { jsx as
|
|
9146
|
+
import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
9030
9147
|
var ChatContent = () => {
|
|
9031
9148
|
const packageSettings = usePackageSettingsStore((state) => state.settings);
|
|
9032
9149
|
const featureFlag = useFeatureFlag();
|
|
@@ -9034,12 +9151,12 @@ var ChatContent = () => {
|
|
|
9034
9151
|
const ossMode = isOSSMode() || !packageSettings?.featureFlags?.subscriptionType;
|
|
9035
9152
|
const playgroundBypassAccess = packageSettings?.playgroundBypassAuth || typeof window !== "undefined" && window.location.pathname.includes("/playground");
|
|
9036
9153
|
const notificationService = useNotificationService();
|
|
9037
|
-
const [selectedTheme, setSelectedTheme] =
|
|
9038
|
-
const [themeLoading, setThemeLoading] =
|
|
9154
|
+
const [selectedTheme, setSelectedTheme] = useState16(null);
|
|
9155
|
+
const [themeLoading, setThemeLoading] = useState16(true);
|
|
9039
9156
|
const token = authenticationService.getToken();
|
|
9040
9157
|
const claims = token ? authenticationService.parseJwtClaims(token) : null;
|
|
9041
9158
|
const baseTheme = themeMap_default[selectedTheme ?? "bandit-dark"] || banditDarkTheme;
|
|
9042
|
-
const banditTheme =
|
|
9159
|
+
const banditTheme = useMemo4(() => {
|
|
9043
9160
|
return createTheme(baseTheme, {
|
|
9044
9161
|
components: {
|
|
9045
9162
|
MuiInputBase: {
|
|
@@ -9123,14 +9240,14 @@ var ChatContent = () => {
|
|
|
9123
9240
|
}, [packageSettings?.gatewayApiUrl, availableVoices.length, initialized, loadVoicesFromAPI, token]);
|
|
9124
9241
|
const provider = useAIProviderStore((state) => state.provider);
|
|
9125
9242
|
const inputRef = useRef13(null);
|
|
9126
|
-
const [pastedImages, setPastedImages] =
|
|
9243
|
+
const [pastedImages, setPastedImages] = useState16([]);
|
|
9127
9244
|
const inputContainerRef = useRef13(null);
|
|
9128
|
-
const [inputHeight, setInputHeight] =
|
|
9129
|
-
const [isSubmitting, setIsSubmitting] =
|
|
9130
|
-
const [pendingMessage, setPendingMessage] =
|
|
9245
|
+
const [inputHeight, setInputHeight] = useState16(80);
|
|
9246
|
+
const [isSubmitting, setIsSubmitting] = useState16(false);
|
|
9247
|
+
const [pendingMessage, setPendingMessage] = useState16(null);
|
|
9131
9248
|
const { conversations, currentId, _hasHydrated, hydrate } = useConversationStore();
|
|
9132
|
-
const [isMobile, setIsMobile] =
|
|
9133
|
-
const [drawerOpen, setDrawerOpen] =
|
|
9249
|
+
const [isMobile, setIsMobile] = useState16(false);
|
|
9250
|
+
const [drawerOpen, setDrawerOpen] = useState16(false);
|
|
9134
9251
|
const { generateName } = useConversationNameGenerator();
|
|
9135
9252
|
const { preferences } = usePreferencesStore();
|
|
9136
9253
|
const { containerRef: chatContainerRef, targetRef: scrollTargetRef, scrollToBottom, getScrollState } = useAutoScroll({
|
|
@@ -9142,14 +9259,14 @@ var ChatContent = () => {
|
|
|
9142
9259
|
const chatContainerEl = chatContainerRef.current;
|
|
9143
9260
|
const scrollTargetEl = scrollTargetRef.current;
|
|
9144
9261
|
const { isSlowConnection, connectionQuality, trackRequestStart, trackRequestEnd } = useNetworkStatus();
|
|
9145
|
-
const [showScrollToBottom, setShowScrollToBottom] =
|
|
9146
|
-
const [streamBuffer, setStreamBuffer] =
|
|
9147
|
-
const [responseStarted, setResponseStarted] =
|
|
9148
|
-
const [isStreaming, setIsStreaming] =
|
|
9149
|
-
const [isThinking, setIsThinking] =
|
|
9262
|
+
const [showScrollToBottom, setShowScrollToBottom] = useState16(false);
|
|
9263
|
+
const [streamBuffer, setStreamBuffer] = useState16("");
|
|
9264
|
+
const [responseStarted, setResponseStarted] = useState16(false);
|
|
9265
|
+
const [isStreaming, setIsStreaming] = useState16(false);
|
|
9266
|
+
const [isThinking, setIsThinking] = useState16(false);
|
|
9150
9267
|
const initialLogoState = history.length === 0;
|
|
9151
|
-
const [logoVisible, setLogoVisible] =
|
|
9152
|
-
const [logoShouldRender, setLogoShouldRender] =
|
|
9268
|
+
const [logoVisible, setLogoVisible] = useState16(initialLogoState);
|
|
9269
|
+
const [logoShouldRender, setLogoShouldRender] = useState16(initialLogoState);
|
|
9153
9270
|
const streamingGraceUntilRef = useRef13(0);
|
|
9154
9271
|
const GRACE_MS = 450;
|
|
9155
9272
|
const GRACE_OFFSET_DESKTOP = 28;
|
|
@@ -9158,8 +9275,8 @@ var ChatContent = () => {
|
|
|
9158
9275
|
const lastSpokenResponseRef = useRef13(null);
|
|
9159
9276
|
const previousConversationIdRef = useRef13(null);
|
|
9160
9277
|
const logoFadeTimeoutRef = useRef13(null);
|
|
9161
|
-
const [branding, setBranding] =
|
|
9162
|
-
const [brandingLoading, setBrandingLoading] =
|
|
9278
|
+
const [branding, setBranding] = useState16(null);
|
|
9279
|
+
const [brandingLoading, setBrandingLoading] = useState16(true);
|
|
9163
9280
|
const isBrandingLoadInProgressRef = useRef13(false);
|
|
9164
9281
|
const logoOnly = history.length === 0 && !brandingLoading;
|
|
9165
9282
|
useEffect15(() => {
|
|
@@ -9927,10 +10044,10 @@ var ChatContent = () => {
|
|
|
9927
10044
|
}
|
|
9928
10045
|
};
|
|
9929
10046
|
if (!hydrated || brandingLoading || themeLoading) {
|
|
9930
|
-
return /* @__PURE__ */
|
|
9931
|
-
/* @__PURE__ */
|
|
9932
|
-
/* @__PURE__ */
|
|
9933
|
-
|
|
10047
|
+
return /* @__PURE__ */ jsxs14(ThemeProvider, { theme: banditTheme, children: [
|
|
10048
|
+
/* @__PURE__ */ jsx19(CssBaseline, {}),
|
|
10049
|
+
/* @__PURE__ */ jsxs14(
|
|
10050
|
+
Box16,
|
|
9934
10051
|
{
|
|
9935
10052
|
sx: (theme) => ({
|
|
9936
10053
|
minHeight: "100dvh",
|
|
@@ -9943,8 +10060,8 @@ var ChatContent = () => {
|
|
|
9943
10060
|
color: theme.palette.text.primary
|
|
9944
10061
|
}),
|
|
9945
10062
|
children: [
|
|
9946
|
-
/* @__PURE__ */
|
|
9947
|
-
/* @__PURE__ */
|
|
10063
|
+
/* @__PURE__ */ jsx19(CircularProgress4, { size: 32, thickness: 4 }),
|
|
10064
|
+
/* @__PURE__ */ jsx19(Typography11, { variant: "body2", color: "text.secondary", children: "Preparing your workspace..." })
|
|
9948
10065
|
]
|
|
9949
10066
|
}
|
|
9950
10067
|
)
|
|
@@ -9952,15 +10069,15 @@ var ChatContent = () => {
|
|
|
9952
10069
|
}
|
|
9953
10070
|
const userHasAccess = playgroundBypassAccess || ossMode || claims?.roles?.includes("super-user") || claims?.roles?.includes("admin");
|
|
9954
10071
|
if (!userHasAccess) {
|
|
9955
|
-
return /* @__PURE__ */
|
|
9956
|
-
/* @__PURE__ */
|
|
9957
|
-
/* @__PURE__ */
|
|
10072
|
+
return /* @__PURE__ */ jsxs14(ThemeProvider, { theme: banditTheme, children: [
|
|
10073
|
+
/* @__PURE__ */ jsx19(CssBaseline, {}),
|
|
10074
|
+
/* @__PURE__ */ jsx19(under_review_default, {})
|
|
9958
10075
|
] });
|
|
9959
10076
|
}
|
|
9960
|
-
return /* @__PURE__ */
|
|
9961
|
-
/* @__PURE__ */
|
|
9962
|
-
/* @__PURE__ */
|
|
9963
|
-
|
|
10077
|
+
return /* @__PURE__ */ jsxs14(ThemeProvider, { theme: banditTheme, children: [
|
|
10078
|
+
/* @__PURE__ */ jsx19(CssBaseline, {}),
|
|
10079
|
+
/* @__PURE__ */ jsxs14(
|
|
10080
|
+
Box16,
|
|
9964
10081
|
{
|
|
9965
10082
|
sx: (theme) => ({
|
|
9966
10083
|
display: "flex",
|
|
@@ -9978,7 +10095,7 @@ var ChatContent = () => {
|
|
|
9978
10095
|
transition: "left 0.3s ease-in-out, width 0.3s ease-in-out"
|
|
9979
10096
|
}),
|
|
9980
10097
|
children: [
|
|
9981
|
-
/* @__PURE__ */
|
|
10098
|
+
/* @__PURE__ */ jsx19(
|
|
9982
10099
|
chat_app_bar_default,
|
|
9983
10100
|
{
|
|
9984
10101
|
availableModels,
|
|
@@ -9990,8 +10107,8 @@ var ChatContent = () => {
|
|
|
9990
10107
|
setDrawerOpen
|
|
9991
10108
|
}
|
|
9992
10109
|
),
|
|
9993
|
-
/* @__PURE__ */
|
|
9994
|
-
|
|
10110
|
+
/* @__PURE__ */ jsx19(
|
|
10111
|
+
Box16,
|
|
9995
10112
|
{
|
|
9996
10113
|
ref: chatContainerRef,
|
|
9997
10114
|
sx: {
|
|
@@ -10011,8 +10128,8 @@ var ChatContent = () => {
|
|
|
10011
10128
|
msOverflowStyle: "none",
|
|
10012
10129
|
"&::-webkit-scrollbar": { display: "none" }
|
|
10013
10130
|
},
|
|
10014
|
-
children: /* @__PURE__ */
|
|
10015
|
-
|
|
10131
|
+
children: /* @__PURE__ */ jsxs14(
|
|
10132
|
+
Box16,
|
|
10016
10133
|
{
|
|
10017
10134
|
sx: {
|
|
10018
10135
|
width: "100%",
|
|
@@ -10022,9 +10139,9 @@ var ChatContent = () => {
|
|
|
10022
10139
|
pt: 2
|
|
10023
10140
|
},
|
|
10024
10141
|
children: [
|
|
10025
|
-
logoShouldRender && !brandingLoading && (branding?.logoBase64 ? /* @__PURE__ */
|
|
10026
|
-
/* @__PURE__ */
|
|
10027
|
-
|
|
10142
|
+
logoShouldRender && !brandingLoading && (branding?.logoBase64 ? /* @__PURE__ */ jsx19(custom_logo_default, { visible: logoVisible, atTop: true }) : /* @__PURE__ */ jsx19(bandit_chat_logo_default, { visible: logoVisible, atTop: true })),
|
|
10143
|
+
/* @__PURE__ */ jsx19(
|
|
10144
|
+
Box16,
|
|
10028
10145
|
{
|
|
10029
10146
|
sx: {
|
|
10030
10147
|
margin: "0 auto",
|
|
@@ -10033,7 +10150,7 @@ var ChatContent = () => {
|
|
|
10033
10150
|
flexShrink: 0,
|
|
10034
10151
|
px: isMobile ? 0 : 0
|
|
10035
10152
|
},
|
|
10036
|
-
children: /* @__PURE__ */
|
|
10153
|
+
children: /* @__PURE__ */ jsx19(
|
|
10037
10154
|
chat_messages_default,
|
|
10038
10155
|
{
|
|
10039
10156
|
isStreaming,
|
|
@@ -10057,7 +10174,7 @@ var ChatContent = () => {
|
|
|
10057
10174
|
)
|
|
10058
10175
|
}
|
|
10059
10176
|
),
|
|
10060
|
-
showScrollToBottom && /* @__PURE__ */
|
|
10177
|
+
showScrollToBottom && /* @__PURE__ */ jsx19(
|
|
10061
10178
|
chat_scroll_to_bottom_button_default,
|
|
10062
10179
|
{
|
|
10063
10180
|
inputHeight,
|
|
@@ -10066,8 +10183,8 @@ var ChatContent = () => {
|
|
|
10066
10183
|
onClick: handleScrollToBottomClick
|
|
10067
10184
|
}
|
|
10068
10185
|
),
|
|
10069
|
-
history.length === 0 && componentStatus !== "Loading" && !isMobile && /* @__PURE__ */
|
|
10070
|
-
|
|
10186
|
+
history.length === 0 && componentStatus !== "Loading" && !isMobile && /* @__PURE__ */ jsx19(
|
|
10187
|
+
Box16,
|
|
10071
10188
|
{
|
|
10072
10189
|
sx: (theme) => ({
|
|
10073
10190
|
position: "absolute",
|
|
@@ -10085,8 +10202,8 @@ var ChatContent = () => {
|
|
|
10085
10202
|
})
|
|
10086
10203
|
}
|
|
10087
10204
|
),
|
|
10088
|
-
/* @__PURE__ */
|
|
10089
|
-
|
|
10205
|
+
/* @__PURE__ */ jsxs14(
|
|
10206
|
+
Box16,
|
|
10090
10207
|
{
|
|
10091
10208
|
sx: {
|
|
10092
10209
|
display: "flex",
|
|
@@ -10097,10 +10214,10 @@ var ChatContent = () => {
|
|
|
10097
10214
|
maxWidth: "768px"
|
|
10098
10215
|
},
|
|
10099
10216
|
children: [
|
|
10100
|
-
/* @__PURE__ */
|
|
10101
|
-
history.length === 0 && componentStatus !== "Loading" && !pendingMessage && preferences.chatSuggestionsEnabled && /* @__PURE__ */
|
|
10102
|
-
/* @__PURE__ */
|
|
10103
|
-
/* @__PURE__ */
|
|
10217
|
+
/* @__PURE__ */ jsx19(Box16, { sx: { flex: "1 1 auto" } }),
|
|
10218
|
+
history.length === 0 && componentStatus !== "Loading" && !pendingMessage && preferences.chatSuggestionsEnabled && /* @__PURE__ */ jsx19(Box16, { sx: { marginBottom: "20px" }, children: /* @__PURE__ */ jsx19(QuerySuggestionPicker, { onSend: handleSend, inputHeight }) }),
|
|
10219
|
+
/* @__PURE__ */ jsx19(ask_user_card_default, {}),
|
|
10220
|
+
/* @__PURE__ */ jsx19(
|
|
10104
10221
|
chat_input_default,
|
|
10105
10222
|
{
|
|
10106
10223
|
inputValue,
|
|
@@ -10127,7 +10244,7 @@ var ChatContent = () => {
|
|
|
10127
10244
|
]
|
|
10128
10245
|
}
|
|
10129
10246
|
),
|
|
10130
|
-
preferences.feedbackEnabled && !isMobile && /* @__PURE__ */
|
|
10247
|
+
preferences.feedbackEnabled && !isMobile && /* @__PURE__ */ jsx19(
|
|
10131
10248
|
FeedbackButton,
|
|
10132
10249
|
{
|
|
10133
10250
|
fullScreen: false,
|
|
@@ -10140,7 +10257,7 @@ var ChatContent = () => {
|
|
|
10140
10257
|
}
|
|
10141
10258
|
}
|
|
10142
10259
|
),
|
|
10143
|
-
/* @__PURE__ */
|
|
10260
|
+
/* @__PURE__ */ jsx19(ConnectionStatus, { position: "top", showWhenGood: false })
|
|
10144
10261
|
]
|
|
10145
10262
|
}
|
|
10146
10263
|
)
|
|
@@ -10169,13 +10286,13 @@ var Chat = () => {
|
|
|
10169
10286
|
});
|
|
10170
10287
|
if (!allowUnauthenticated && !bypassAuth && !authenticationService.isAuthenticated()) {
|
|
10171
10288
|
debugLogger.debug("User is not authenticated, redirecting to login");
|
|
10172
|
-
return /* @__PURE__ */
|
|
10289
|
+
return /* @__PURE__ */ jsx19(Navigate, { to: "/login", replace: true });
|
|
10173
10290
|
}
|
|
10174
|
-
return /* @__PURE__ */
|
|
10291
|
+
return /* @__PURE__ */ jsx19(ChatContent, {});
|
|
10175
10292
|
};
|
|
10176
10293
|
var chat_default = Chat;
|
|
10177
10294
|
|
|
10178
10295
|
export {
|
|
10179
10296
|
chat_default
|
|
10180
10297
|
};
|
|
10181
|
-
//# sourceMappingURL=chunk-
|
|
10298
|
+
//# sourceMappingURL=chunk-NB3N4BKW.mjs.map
|