@burtson-labs/bandit-engine 2.0.118 → 2.0.119

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.
@@ -21890,6 +21890,167 @@ var init_ask_user_card = __esm({
21890
21890
  }
21891
21891
  });
21892
21892
 
21893
+ // src/store/rateLimitStore.ts
21894
+ var import_zustand17, useRateLimitStore, parseRateLimitError;
21895
+ var init_rateLimitStore = __esm({
21896
+ "src/store/rateLimitStore.ts"() {
21897
+ "use strict";
21898
+ import_zustand17 = require("zustand");
21899
+ useRateLimitStore = (0, import_zustand17.create)((set) => ({
21900
+ prompt: null,
21901
+ show: (prompt) => set({ prompt }),
21902
+ dismiss: () => set({ prompt: null })
21903
+ }));
21904
+ parseRateLimitError = (error) => {
21905
+ if (!error || typeof error !== "object") {
21906
+ return null;
21907
+ }
21908
+ const response = error.response;
21909
+ const status = response?.status;
21910
+ const data = response?.data;
21911
+ const payload = data && typeof data === "object" ? data : {};
21912
+ const isRateLimited = status === 429 || payload.error === "rate_limited" || payload.upgrade === true;
21913
+ if (!isRateLimited) {
21914
+ return null;
21915
+ }
21916
+ const scope = payload.scope === "weekly" ? "weekly" : "session";
21917
+ const message = typeof payload.message === "string" ? payload.message : void 0;
21918
+ const haystack = `${message ?? ""}`.toLowerCase();
21919
+ const frontier = /frontier|premium|cloud|pro model/.test(haystack);
21920
+ return { scope, message, frontier };
21921
+ };
21922
+ }
21923
+ });
21924
+
21925
+ // src/chat/rate-limit-prompt.tsx
21926
+ var import_react47, import_material40, import_react_router_dom2, import_jsx_runtime40, RateLimitPrompt, rate_limit_prompt_default;
21927
+ var init_rate_limit_prompt = __esm({
21928
+ "src/chat/rate-limit-prompt.tsx"() {
21929
+ "use strict";
21930
+ import_react47 = require("react");
21931
+ import_material40 = require("@mui/material");
21932
+ import_react_router_dom2 = require("react-router-dom");
21933
+ init_lucide_icons();
21934
+ init_rateLimitStore();
21935
+ init_debugLogger();
21936
+ import_jsx_runtime40 = require("react/jsx-runtime");
21937
+ RateLimitPrompt = () => {
21938
+ const theme = (0, import_material40.useTheme)();
21939
+ const prompt = useRateLimitStore((s) => s.prompt);
21940
+ const dismiss = useRateLimitStore((s) => s.dismiss);
21941
+ const hasLoggedRouterWarningRef = (0, import_react47.useRef)(false);
21942
+ let navigate = null;
21943
+ try {
21944
+ navigate = (0, import_react_router_dom2.useNavigate)();
21945
+ } catch (error) {
21946
+ if (!hasLoggedRouterWarningRef.current) {
21947
+ debugLogger.warn("RateLimitPrompt: Navigation not available (missing Router context)", { error });
21948
+ hasLoggedRouterWarningRef.current = true;
21949
+ }
21950
+ navigate = null;
21951
+ }
21952
+ const safeNavigate = (to) => {
21953
+ if (navigate) {
21954
+ navigate(to);
21955
+ } else if (typeof window !== "undefined") {
21956
+ window.location.href = to;
21957
+ }
21958
+ };
21959
+ if (!prompt) {
21960
+ return null;
21961
+ }
21962
+ const { scope, frontier } = prompt;
21963
+ const title = scope === "weekly" ? "You've reached your weekly limit" : "You've hit your session limit";
21964
+ const body = (() => {
21965
+ if (frontier) {
21966
+ return scope === "weekly" ? "You've used your weekly allowance on premium engines. Upgrade to keep chatting on the most capable models." : "You've hit your session limit on premium engines. It resets soon \u2014 or upgrade for higher limits and uninterrupted access.";
21967
+ }
21968
+ return scope === "weekly" ? "Your weekly chat allowance is used up. Upgrade to keep going without waiting." : "It resets shortly. Upgrade for higher limits and keep the conversation flowing.";
21969
+ })();
21970
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
21971
+ import_material40.Box,
21972
+ {
21973
+ role: "status",
21974
+ sx: {
21975
+ mb: 1.5,
21976
+ px: 2,
21977
+ py: 1.5,
21978
+ borderRadius: 2,
21979
+ display: "flex",
21980
+ alignItems: "flex-start",
21981
+ gap: 1.5,
21982
+ border: `1px solid ${theme.palette.primary.main}33`,
21983
+ bgcolor: theme.palette.primary.main + "0F",
21984
+ backdropFilter: "blur(8px)"
21985
+ },
21986
+ children: [
21987
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
21988
+ import_material40.Box,
21989
+ {
21990
+ sx: {
21991
+ mt: 0.25,
21992
+ display: "flex",
21993
+ alignItems: "center",
21994
+ justifyContent: "center",
21995
+ width: 32,
21996
+ height: 32,
21997
+ flexShrink: 0,
21998
+ borderRadius: "50%",
21999
+ bgcolor: theme.palette.primary.main + "22",
22000
+ color: theme.palette.primary.main
22001
+ },
22002
+ children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AutoAwesomeIcon, { fontSize: "small" })
22003
+ }
22004
+ ),
22005
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_material40.Box, { sx: { flex: 1, minWidth: 0 }, children: [
22006
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material40.Typography, { variant: "subtitle2", sx: { fontWeight: 600, color: theme.palette.text.primary }, children: title }),
22007
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material40.Typography, { variant: "body2", sx: { color: theme.palette.text.secondary, mt: 0.25 }, children: body }),
22008
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_material40.Box, { sx: { display: "flex", gap: 1, mt: 1, flexWrap: "wrap" }, children: [
22009
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
22010
+ import_material40.Button,
22011
+ {
22012
+ size: "small",
22013
+ variant: "contained",
22014
+ disableElevation: true,
22015
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AutoAwesomeIcon, { sx: { fontSize: "0.9rem" } }),
22016
+ onClick: () => {
22017
+ dismiss();
22018
+ safeNavigate("/plans");
22019
+ },
22020
+ sx: { textTransform: "none", fontWeight: 600, borderRadius: 2 },
22021
+ children: "Upgrade to keep chatting"
22022
+ }
22023
+ ),
22024
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
22025
+ import_material40.Button,
22026
+ {
22027
+ size: "small",
22028
+ variant: "text",
22029
+ onClick: () => dismiss(),
22030
+ sx: { textTransform: "none", color: theme.palette.text.secondary },
22031
+ children: scope === "weekly" ? "Maybe later" : "I'll wait"
22032
+ }
22033
+ )
22034
+ ] })
22035
+ ] }),
22036
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
22037
+ import_material40.IconButton,
22038
+ {
22039
+ size: "small",
22040
+ "aria-label": "Dismiss upgrade prompt",
22041
+ onClick: () => dismiss(),
22042
+ sx: { color: theme.palette.text.secondary, mt: -0.5, mr: -0.5 },
22043
+ children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CloseIcon, { fontSize: "small" })
22044
+ }
22045
+ )
22046
+ ]
22047
+ }
22048
+ );
22049
+ };
22050
+ rate_limit_prompt_default = RateLimitPrompt;
22051
+ }
22052
+ });
22053
+
21893
22054
  // src/services/telemetry/otlpExporter.ts
21894
22055
  function redactSecretsString(s) {
21895
22056
  return s.replace(/\b(?:sk|tvly|ghp|gho|pk|rk)[-_][A-Za-z0-9]{8,}\b/gi, "[redacted]").replace(/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g, "[redacted-jwt]").replace(/\bBearer\s+[A-Za-z0-9._-]{8,}/gi, "Bearer [redacted]");
@@ -22215,11 +22376,11 @@ var init_telemetry = __esm({
22215
22376
  });
22216
22377
 
22217
22378
  // src/store/engineStore.ts
22218
- var import_zustand17, STORAGE_KEY2, readStored, useEngineStore;
22379
+ var import_zustand18, STORAGE_KEY2, readStored, useEngineStore;
22219
22380
  var init_engineStore = __esm({
22220
22381
  "src/store/engineStore.ts"() {
22221
22382
  "use strict";
22222
- import_zustand17 = require("zustand");
22383
+ import_zustand18 = require("zustand");
22223
22384
  init_packageSettingsStore();
22224
22385
  init_authenticationService();
22225
22386
  init_debugLogger();
@@ -22231,7 +22392,7 @@ var init_engineStore = __esm({
22231
22392
  return null;
22232
22393
  }
22233
22394
  };
22234
- useEngineStore = (0, import_zustand17.create)((set, get) => ({
22395
+ useEngineStore = (0, import_zustand18.create)((set, get) => ({
22235
22396
  selectedEngine: readStored(),
22236
22397
  engines: [],
22237
22398
  loaded: false,
@@ -22811,15 +22972,15 @@ The user explicitly asked you to remember this. Respond with a short third-perso
22811
22972
  });
22812
22973
 
22813
22974
  // src/chat/hooks/useMoodEngine.tsx
22814
- var import_react47, useMoodEngine, moodPromptMap;
22975
+ var import_react48, useMoodEngine, moodPromptMap;
22815
22976
  var init_useMoodEngine = __esm({
22816
22977
  "src/chat/hooks/useMoodEngine.tsx"() {
22817
22978
  "use strict";
22818
- import_react47 = require("react");
22979
+ import_react48 = require("react");
22819
22980
  init_prompts();
22820
22981
  init_debugLogger();
22821
22982
  useMoodEngine = () => {
22822
- const [mood, setMood] = (0, import_react47.useState)("neutral");
22983
+ const [mood, setMood] = (0, import_react48.useState)("neutral");
22823
22984
  const analyzeMood = async (message) => {
22824
22985
  try {
22825
22986
  const detected = await detectMessageMood(message);
@@ -23033,12 +23194,12 @@ var init_mcp = __esm({
23033
23194
  });
23034
23195
 
23035
23196
  // src/chat/hooks/useAIProvider.tsx
23036
- var import_react48, lightBudget, medBudget, heavyBudget, modelConfigs, PERSONAL_TAG_HINTS, PERSONAL_TOPIC_HINTS, clamp, parseDateToEpoch, normalizeVectorMemory, isPersonalMemory, computeRecencyBoost, computeBoostedScore, formatMemoryLine, prepareAdvancedMemoryContext, useAIProvider;
23197
+ var import_react49, lightBudget, medBudget, heavyBudget, modelConfigs, PERSONAL_TAG_HINTS, PERSONAL_TOPIC_HINTS, clamp, parseDateToEpoch, normalizeVectorMemory, isPersonalMemory, computeRecencyBoost, computeBoostedScore, formatMemoryLine, prepareAdvancedMemoryContext, useAIProvider;
23037
23198
  var init_useAIProvider = __esm({
23038
23199
  "src/chat/hooks/useAIProvider.tsx"() {
23039
23200
  "use strict";
23040
23201
  init_debugLogger();
23041
- import_react48 = require("react");
23202
+ import_react49 = require("react");
23042
23203
  init_knowledgeStore();
23043
23204
  init_aiProviderStore();
23044
23205
  init_telemetry();
@@ -23053,6 +23214,7 @@ var init_useAIProvider = __esm({
23053
23214
  init_preferencesStore();
23054
23215
  init_mcp();
23055
23216
  init_askUserStore();
23217
+ init_rateLimitStore();
23056
23218
  lightBudget = {
23057
23219
  maxTokens: 2048,
23058
23220
  memoryTokenBudget: 750,
@@ -23340,25 +23502,25 @@ var init_useAIProvider = __esm({
23340
23502
  inputRef,
23341
23503
  onError
23342
23504
  }) => {
23343
- const currentSubRef = (0, import_react48.useRef)(null);
23344
- const lastPartialRef = (0, import_react48.useRef)({
23505
+ const currentSubRef = (0, import_react49.useRef)(null);
23506
+ const lastPartialRef = (0, import_react49.useRef)({
23345
23507
  text: "",
23346
23508
  images: [],
23347
23509
  usedDocs: [],
23348
23510
  question: ""
23349
23511
  });
23350
- const flushTimerRef = (0, import_react48.useRef)(null);
23512
+ const flushTimerRef = (0, import_react49.useRef)(null);
23351
23513
  const { provider } = useAIProviderStore.getState();
23352
23514
  const { preferences } = usePreferencesStore.getState();
23353
23515
  const { docs } = useKnowledgeStore.getState();
23354
23516
  const { analyzeMood, moodTokenBoost } = useMoodEngine();
23355
23517
  const { runMemoryScan } = useMemoryEnhancer();
23356
23518
  const { isVectorEnabled, searchMemories, searchDocuments, getUserMemories } = useVectorStore();
23357
- const pinnedVectorCacheRef = (0, import_react48.useRef)({
23519
+ const pinnedVectorCacheRef = (0, import_react49.useRef)({
23358
23520
  fetchedAt: 0,
23359
23521
  memories: []
23360
23522
  });
23361
- const getPinnedVectorMemories = (0, import_react48.useCallback)(async () => {
23523
+ const getPinnedVectorMemories = (0, import_react49.useCallback)(async () => {
23362
23524
  if (!isVectorEnabled) {
23363
23525
  return [];
23364
23526
  }
@@ -23383,7 +23545,7 @@ var init_useAIProvider = __esm({
23383
23545
  flushTimerRef.current = null;
23384
23546
  }
23385
23547
  };
23386
- const runAIProvider = (0, import_react48.useCallback)(
23548
+ const runAIProvider = (0, import_react49.useCallback)(
23387
23549
  async (systemPrompt, question, images) => {
23388
23550
  if (!provider) {
23389
23551
  debugLogger.error("No AI provider configured");
@@ -23400,6 +23562,7 @@ var init_useAIProvider = __esm({
23400
23562
  setResponse("");
23401
23563
  setStreamBuffer("");
23402
23564
  clearFlushTimer();
23565
+ useRateLimitStore.getState().dismiss();
23403
23566
  const imageList = Array.isArray(images) ? [...images] : [];
23404
23567
  const conversationStoreState = useConversationStore.getState();
23405
23568
  const { addToCurrent, replaceLastAnswer, conversations, currentId } = conversationStoreState;
@@ -23916,6 +24079,29 @@ ${protocol}`;
23916
24079
  overrideComponentStatus("Idle");
23917
24080
  setIsSubmitting(false);
23918
24081
  setIsStreaming(false);
24082
+ const rateLimit = parseRateLimitError(err);
24083
+ if (rateLimit) {
24084
+ debugLogger.info("Chat hit usage limit (429) \u2014 showing upgrade prompt", {
24085
+ scope: rateLimit.scope,
24086
+ frontier: rateLimit.frontier
24087
+ });
24088
+ const { replaceLastAnswer: replaceLastAnswer2 } = useConversationStore.getState();
24089
+ replaceLastAnswer2(
24090
+ rateLimit.scope === "weekly" ? "_You've reached your weekly limit. Upgrade to keep chatting._" : "_You've hit your session limit. It resets soon \u2014 or upgrade for higher limits._",
24091
+ lastPartialRef.current.images,
24092
+ false,
24093
+ lastPartialRef.current.usedDocs,
24094
+ true
24095
+ );
24096
+ setResponse("");
24097
+ setStreamBuffer("");
24098
+ setIsThinking?.(false);
24099
+ setPendingMessage(null);
24100
+ setLogoVisible(false);
24101
+ useRateLimitStore.getState().show(rateLimit);
24102
+ telemetryEndTurn({ error: "rate_limited" });
24103
+ return;
24104
+ }
23919
24105
  flushNow();
23920
24106
  let partial = lastPartialRef.current.text || latestDisplayMessage || fullMessage;
23921
24107
  if (partial && !partial.trim().endsWith("\u2026") && !partial.trim().endsWith("...")) {
@@ -24509,11 +24695,11 @@ ${inlineImageBlocks.join("\n\n")}` : "");
24509
24695
  });
24510
24696
 
24511
24697
  // src/hooks/useAutoScroll.ts
24512
- var import_react49, SCROLL_STATE_CHANGED_EVENT, useAutoScroll;
24698
+ var import_react50, SCROLL_STATE_CHANGED_EVENT, useAutoScroll;
24513
24699
  var init_useAutoScroll = __esm({
24514
24700
  "src/hooks/useAutoScroll.ts"() {
24515
24701
  "use strict";
24516
- import_react49 = require("react");
24702
+ import_react50 = require("react");
24517
24703
  SCROLL_STATE_CHANGED_EVENT = "scrollStateChanged";
24518
24704
  useAutoScroll = (options = {}) => {
24519
24705
  const {
@@ -24522,10 +24708,10 @@ var init_useAutoScroll = __esm({
24522
24708
  enabled = true,
24523
24709
  isMobile = false
24524
24710
  } = options;
24525
- const containerRef = (0, import_react49.useRef)(null);
24526
- const targetRef = (0, import_react49.useRef)(null);
24527
- const shouldAutoScrollRef = (0, import_react49.useRef)(true);
24528
- const isNearBottom = (0, import_react49.useCallback)(() => {
24711
+ const containerRef = (0, import_react50.useRef)(null);
24712
+ const targetRef = (0, import_react50.useRef)(null);
24713
+ const shouldAutoScrollRef = (0, import_react50.useRef)(true);
24714
+ const isNearBottom = (0, import_react50.useCallback)(() => {
24529
24715
  const container = containerRef.current;
24530
24716
  if (!container) return true;
24531
24717
  const { scrollTop, scrollHeight, clientHeight } = container;
@@ -24533,7 +24719,7 @@ var init_useAutoScroll = __esm({
24533
24719
  const effectiveThreshold = Math.max(threshold, 10);
24534
24720
  return distanceFromBottom <= effectiveThreshold;
24535
24721
  }, [threshold]);
24536
- const scrollToBottom = (0, import_react49.useCallback)((forceBehavior) => {
24722
+ const scrollToBottom = (0, import_react50.useCallback)((forceBehavior) => {
24537
24723
  if (!enabled) return;
24538
24724
  const container = containerRef.current;
24539
24725
  if (container) {
@@ -24560,7 +24746,7 @@ var init_useAutoScroll = __esm({
24560
24746
  }
24561
24747
  }
24562
24748
  }, [enabled, behavior, isMobile]);
24563
- const forceScrollToBottom = (0, import_react49.useCallback)(() => {
24749
+ const forceScrollToBottom = (0, import_react50.useCallback)(() => {
24564
24750
  scrollToBottom("smooth");
24565
24751
  const container = containerRef.current;
24566
24752
  if (container) {
@@ -24578,7 +24764,7 @@ var init_useAutoScroll = __esm({
24578
24764
  rafId = requestAnimationFrame(tick);
24579
24765
  }
24580
24766
  }, [scrollToBottom, isNearBottom]);
24581
- const autoScrollIfNeeded = (0, import_react49.useCallback)(() => {
24767
+ const autoScrollIfNeeded = (0, import_react50.useCallback)(() => {
24582
24768
  if (enabled && shouldAutoScrollRef.current && isNearBottom()) {
24583
24769
  scrollToBottom();
24584
24770
  const container = containerRef.current;
@@ -24599,7 +24785,7 @@ var init_useAutoScroll = __esm({
24599
24785
  }
24600
24786
  }, [enabled, isNearBottom, scrollToBottom]);
24601
24787
  const containerElement = containerRef.current;
24602
- (0, import_react49.useEffect)(() => {
24788
+ (0, import_react50.useEffect)(() => {
24603
24789
  if (!containerElement) return;
24604
24790
  const handleScroll = () => {
24605
24791
  const currentlyNearBottom = isNearBottom();
@@ -24609,10 +24795,10 @@ var init_useAutoScroll = __esm({
24609
24795
  containerElement.addEventListener("scroll", handleScroll, { passive: true });
24610
24796
  return () => containerElement.removeEventListener("scroll", handleScroll);
24611
24797
  }, [containerElement, isNearBottom]);
24612
- (0, import_react49.useEffect)(() => {
24798
+ (0, import_react50.useEffect)(() => {
24613
24799
  autoScrollIfNeeded();
24614
24800
  });
24615
- const getScrollState = (0, import_react49.useCallback)(() => {
24801
+ const getScrollState = (0, import_react50.useCallback)(() => {
24616
24802
  const container = containerRef.current;
24617
24803
  if (!container) {
24618
24804
  return {
@@ -24650,24 +24836,24 @@ var init_useAutoScroll = __esm({
24650
24836
  });
24651
24837
 
24652
24838
  // src/hooks/useNetworkStatus.ts
24653
- var import_react50, useNetworkStatus;
24839
+ var import_react51, useNetworkStatus;
24654
24840
  var init_useNetworkStatus = __esm({
24655
24841
  "src/hooks/useNetworkStatus.ts"() {
24656
24842
  "use strict";
24657
- import_react50 = require("react");
24843
+ import_react51 = require("react");
24658
24844
  useNetworkStatus = () => {
24659
- const [networkStatus, setNetworkStatus] = (0, import_react50.useState)({
24845
+ const [networkStatus, setNetworkStatus] = (0, import_react51.useState)({
24660
24846
  isOnline: navigator.onLine,
24661
24847
  isSlowConnection: false,
24662
24848
  connectionQuality: "fast",
24663
24849
  lastRequestTime: 0
24664
24850
  });
24665
- const trackRequestStart = (0, import_react50.useCallback)(() => {
24851
+ const trackRequestStart = (0, import_react51.useCallback)(() => {
24666
24852
  const startTime = Date.now();
24667
24853
  setNetworkStatus((prev) => ({ ...prev, lastRequestTime: startTime }));
24668
24854
  return startTime;
24669
24855
  }, []);
24670
- const trackRequestEnd = (0, import_react50.useCallback)((startTime) => {
24856
+ const trackRequestEnd = (0, import_react51.useCallback)((startTime) => {
24671
24857
  const duration = Date.now() - startTime;
24672
24858
  const isSlowConnection = duration > 2e3;
24673
24859
  setNetworkStatus((prev) => ({
@@ -24676,7 +24862,7 @@ var init_useNetworkStatus = __esm({
24676
24862
  connectionQuality: !navigator.onLine ? "offline" : isSlowConnection ? "slow" : "fast"
24677
24863
  }));
24678
24864
  }, []);
24679
- (0, import_react50.useEffect)(() => {
24865
+ (0, import_react51.useEffect)(() => {
24680
24866
  const handleOnline = () => {
24681
24867
  setNetworkStatus((prev) => ({
24682
24868
  ...prev,
@@ -24698,7 +24884,7 @@ var init_useNetworkStatus = __esm({
24698
24884
  window.removeEventListener("offline", handleOffline);
24699
24885
  };
24700
24886
  }, []);
24701
- (0, import_react50.useEffect)(() => {
24887
+ (0, import_react51.useEffect)(() => {
24702
24888
  const { connection } = navigator;
24703
24889
  if (connection) {
24704
24890
  const updateConnectionInfo = () => {
@@ -24736,17 +24922,17 @@ var init_useNetworkStatus = __esm({
24736
24922
  });
24737
24923
 
24738
24924
  // src/chat/project-management-modal.tsx
24739
- var import_react51, import_material40, import_lucide_react7, import_styles24, import_jsx_runtime40, DEFAULT_COLORS2, ProjectManagementModal, project_management_modal_default;
24925
+ var import_react52, import_material41, import_lucide_react7, import_styles24, import_jsx_runtime41, DEFAULT_COLORS2, ProjectManagementModal, project_management_modal_default;
24740
24926
  var init_project_management_modal = __esm({
24741
24927
  "src/chat/project-management-modal.tsx"() {
24742
24928
  "use strict";
24743
- import_react51 = require("react");
24744
- import_material40 = require("@mui/material");
24929
+ import_react52 = require("react");
24930
+ import_material41 = require("@mui/material");
24745
24931
  import_lucide_react7 = require("lucide-react");
24746
24932
  import_styles24 = require("@mui/material/styles");
24747
24933
  init_projectStore();
24748
24934
  init_conversationStore();
24749
- import_jsx_runtime40 = require("react/jsx-runtime");
24935
+ import_jsx_runtime41 = require("react/jsx-runtime");
24750
24936
  DEFAULT_COLORS2 = [
24751
24937
  "#2196F3",
24752
24938
  "#4CAF50",
@@ -24764,7 +24950,7 @@ var init_project_management_modal = __esm({
24764
24950
  onClose
24765
24951
  }) => {
24766
24952
  const theme = (0, import_styles24.useTheme)();
24767
- const isMobile = (0, import_material40.useMediaQuery)(theme.breakpoints.down("sm"));
24953
+ const isMobile = (0, import_material41.useMediaQuery)(theme.breakpoints.down("sm"));
24768
24954
  const {
24769
24955
  projects,
24770
24956
  _hasHydrated,
@@ -24776,25 +24962,25 @@ var init_project_management_modal = __esm({
24776
24962
  hydrate
24777
24963
  } = useProjectStore();
24778
24964
  const { getConversationsByProject } = useConversationStore();
24779
- const [showCreateForm, setShowCreateForm] = (0, import_react51.useState)(false);
24780
- const [editingProject, setEditingProject] = (0, import_react51.useState)(null);
24781
- const [formData, setFormData] = (0, import_react51.useState)({
24965
+ const [showCreateForm, setShowCreateForm] = (0, import_react52.useState)(false);
24966
+ const [editingProject, setEditingProject] = (0, import_react52.useState)(null);
24967
+ const [formData, setFormData] = (0, import_react52.useState)({
24782
24968
  name: "",
24783
24969
  description: "",
24784
24970
  instructions: "",
24785
24971
  color: DEFAULT_COLORS2[0]
24786
24972
  });
24787
- const [menuAnchor, setMenuAnchor] = (0, import_react51.useState)(null);
24788
- const [selectedProject, setSelectedProject] = (0, import_react51.useState)(null);
24789
- const [loading, setLoading] = (0, import_react51.useState)(false);
24790
- const [error, setError] = (0, import_react51.useState)(null);
24791
- const modalContainerRef = (0, import_react51.useRef)(null);
24792
- (0, import_react51.useEffect)(() => {
24973
+ const [menuAnchor, setMenuAnchor] = (0, import_react52.useState)(null);
24974
+ const [selectedProject, setSelectedProject] = (0, import_react52.useState)(null);
24975
+ const [loading, setLoading] = (0, import_react52.useState)(false);
24976
+ const [error, setError] = (0, import_react52.useState)(null);
24977
+ const modalContainerRef = (0, import_react52.useRef)(null);
24978
+ (0, import_react52.useEffect)(() => {
24793
24979
  if (open && !_hasHydrated) {
24794
24980
  hydrate();
24795
24981
  }
24796
24982
  }, [open, _hasHydrated, hydrate]);
24797
- (0, import_react51.useEffect)(() => {
24983
+ (0, import_react52.useEffect)(() => {
24798
24984
  if (!open) {
24799
24985
  setMenuAnchor(null);
24800
24986
  setSelectedProject(null);
@@ -24904,8 +25090,8 @@ var init_project_management_modal = __esm({
24904
25090
  const hoverSurface = (0, import_styles24.alpha)(theme.palette.primary.main, theme.palette.mode === "dark" ? 0.22 : 0.08);
24905
25091
  const headerTitle = showCreateForm ? editingProject ? "Edit Project" : "Create Project" : "Manage Projects";
24906
25092
  const headerSubtitle = showCreateForm ? "Name, describe, and color-code your project." : "Organize conversations into cohesive projects.";
24907
- const content = /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
24908
- import_material40.Box,
25093
+ const content = /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
25094
+ import_material41.Box,
24909
25095
  {
24910
25096
  ref: modalContainerRef,
24911
25097
  sx: {
@@ -24923,8 +25109,8 @@ var init_project_management_modal = __esm({
24923
25109
  position: "relative"
24924
25110
  },
24925
25111
  children: [
24926
- isMobile && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
24927
- import_material40.Box,
25112
+ isMobile && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25113
+ import_material41.Box,
24928
25114
  {
24929
25115
  sx: {
24930
25116
  width: 56,
@@ -24937,8 +25123,8 @@ var init_project_management_modal = __esm({
24937
25123
  }
24938
25124
  }
24939
25125
  ),
24940
- /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
24941
- import_material40.Box,
25126
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
25127
+ import_material41.Box,
24942
25128
  {
24943
25129
  sx: {
24944
25130
  px: isMobile ? 1.5 : 2.75,
@@ -24950,8 +25136,8 @@ var init_project_management_modal = __esm({
24950
25136
  gap: 1
24951
25137
  },
24952
25138
  children: [
24953
- /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
24954
- import_material40.Box,
25139
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
25140
+ import_material41.Box,
24955
25141
  {
24956
25142
  sx: {
24957
25143
  display: "flex",
@@ -24960,8 +25146,8 @@ var init_project_management_modal = __esm({
24960
25146
  gap: 1
24961
25147
  },
24962
25148
  children: [
24963
- /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
24964
- import_material40.Box,
25149
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
25150
+ import_material41.Box,
24965
25151
  {
24966
25152
  sx: {
24967
25153
  display: "flex",
@@ -24971,9 +25157,9 @@ var init_project_management_modal = __esm({
24971
25157
  flex: 1
24972
25158
  },
24973
25159
  children: [
24974
- showCreateForm && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material40.IconButton, { onClick: resetForm, size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react7.ArrowLeft, { size: 16 }) }),
24975
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
24976
- import_material40.Typography,
25160
+ showCreateForm && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.IconButton, { onClick: resetForm, size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.ArrowLeft, { size: 16 }) }),
25161
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25162
+ import_material41.Typography,
24977
25163
  {
24978
25164
  variant: "h6",
24979
25165
  sx: {
@@ -24989,16 +25175,16 @@ var init_project_management_modal = __esm({
24989
25175
  ]
24990
25176
  }
24991
25177
  ),
24992
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material40.IconButton, { onClick: handleClose, size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react7.X, {}) })
25178
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.IconButton, { onClick: handleClose, size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.X, {}) })
24993
25179
  ]
24994
25180
  }
24995
25181
  ),
24996
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material40.Typography, { variant: "body2", color: "text.secondary", children: headerSubtitle })
25182
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Typography, { variant: "body2", color: "text.secondary", children: headerSubtitle })
24997
25183
  ]
24998
25184
  }
24999
25185
  ),
25000
- /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
25001
- import_material40.Box,
25186
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
25187
+ import_material41.Box,
25002
25188
  {
25003
25189
  sx: {
25004
25190
  flex: 1,
@@ -25010,10 +25196,10 @@ var init_project_management_modal = __esm({
25010
25196
  gap: 2.5
25011
25197
  },
25012
25198
  children: [
25013
- error && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material40.Alert, { severity: "error", onClose: () => setError(null), children: error }),
25014
- showCreateForm ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_material40.Box, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: [
25015
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
25016
- import_material40.TextField,
25199
+ error && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Alert, { severity: "error", onClose: () => setError(null), children: error }),
25200
+ showCreateForm ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_material41.Box, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: [
25201
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25202
+ import_material41.TextField,
25017
25203
  {
25018
25204
  label: "Project name",
25019
25205
  value: formData.name,
@@ -25024,8 +25210,8 @@ var init_project_management_modal = __esm({
25024
25210
  autoFocus: true
25025
25211
  }
25026
25212
  ),
25027
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
25028
- import_material40.TextField,
25213
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25214
+ import_material41.TextField,
25029
25215
  {
25030
25216
  label: "Description (optional)",
25031
25217
  value: formData.description,
@@ -25036,8 +25222,8 @@ var init_project_management_modal = __esm({
25036
25222
  disabled: loading
25037
25223
  }
25038
25224
  ),
25039
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
25040
- import_material40.TextField,
25225
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25226
+ import_material41.TextField,
25041
25227
  {
25042
25228
  label: "Project instructions (optional)",
25043
25229
  helperText: "Standing context the assistant uses for every chat in this project \u2014 goals, tone, key facts.",
@@ -25049,10 +25235,10 @@ var init_project_management_modal = __esm({
25049
25235
  disabled: loading
25050
25236
  }
25051
25237
  ),
25052
- /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_material40.Box, { children: [
25053
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material40.Typography, { variant: "subtitle2", sx: { mb: 1 }, children: "Color" }),
25054
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material40.Box, { sx: { display: "flex", flexWrap: "wrap", gap: 1 }, children: DEFAULT_COLORS2.map((color) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
25055
- import_material40.Box,
25238
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_material41.Box, { children: [
25239
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Typography, { variant: "subtitle2", sx: { mb: 1 }, children: "Color" }),
25240
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Box, { sx: { display: "flex", flexWrap: "wrap", gap: 1 }, children: DEFAULT_COLORS2.map((color) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25241
+ import_material41.Box,
25056
25242
  {
25057
25243
  sx: {
25058
25244
  width: 32,
@@ -25072,11 +25258,11 @@ var init_project_management_modal = __esm({
25072
25258
  color
25073
25259
  )) })
25074
25260
  ] })
25075
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_material40.Box, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: [
25076
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
25077
- import_material40.Button,
25261
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_material41.Box, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: [
25262
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25263
+ import_material41.Button,
25078
25264
  {
25079
- startIcon: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react7.Plus, {}),
25265
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.Plus, {}),
25080
25266
  onClick: () => setShowCreateForm(true),
25081
25267
  variant: "contained",
25082
25268
  sx: {
@@ -25088,8 +25274,8 @@ var init_project_management_modal = __esm({
25088
25274
  children: "Create project"
25089
25275
  }
25090
25276
  ),
25091
- projects.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
25092
- import_material40.Box,
25277
+ projects.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
25278
+ import_material41.Box,
25093
25279
  {
25094
25280
  sx: {
25095
25281
  textAlign: "center",
@@ -25101,15 +25287,15 @@ var init_project_management_modal = __esm({
25101
25287
  backgroundColor: subtleSurface
25102
25288
  },
25103
25289
  children: [
25104
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react7.Folder, { size: 48, style: { marginBottom: 8, opacity: 0.5 } }),
25105
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material40.Typography, { variant: "body1", sx: { fontWeight: 600 }, children: "No projects yet" }),
25106
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material40.Typography, { variant: "body2", children: "Create your first project to organize conversations." })
25290
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.Folder, { size: 48, style: { marginBottom: 8, opacity: 0.5 } }),
25291
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Typography, { variant: "body1", sx: { fontWeight: 600 }, children: "No projects yet" }),
25292
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Typography, { variant: "body2", children: "Create your first project to organize conversations." })
25107
25293
  ]
25108
25294
  }
25109
- ) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material40.List, { sx: { display: "flex", flexDirection: "column", gap: 1.25, py: 0 }, children: projects.map((project) => {
25295
+ ) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.List, { sx: { display: "flex", flexDirection: "column", gap: 1.25, py: 0 }, children: projects.map((project) => {
25110
25296
  const conversationCount = getConversationsByProject(project.id).length;
25111
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material40.ListItem, { disablePadding: true, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
25112
- import_material40.Box,
25297
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.ListItem, { disablePadding: true, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
25298
+ import_material41.Box,
25113
25299
  {
25114
25300
  sx: {
25115
25301
  display: "flex",
@@ -25127,8 +25313,8 @@ var init_project_management_modal = __esm({
25127
25313
  }
25128
25314
  },
25129
25315
  children: [
25130
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
25131
- import_material40.Avatar,
25316
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25317
+ import_material41.Avatar,
25132
25318
  {
25133
25319
  sx: {
25134
25320
  bgcolor: project.color,
@@ -25136,21 +25322,21 @@ var init_project_management_modal = __esm({
25136
25322
  height: 36,
25137
25323
  fontSize: "1rem"
25138
25324
  },
25139
- children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react7.Folder, { size: 16 })
25325
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.Folder, { size: 16 })
25140
25326
  }
25141
25327
  ),
25142
- /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_material40.Box, { sx: { flex: 1, minWidth: 0 }, children: [
25143
- /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_material40.Box, { sx: { display: "flex", alignItems: "center", gap: 1, flexWrap: "wrap" }, children: [
25144
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
25145
- import_material40.Typography,
25328
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_material41.Box, { sx: { flex: 1, minWidth: 0 }, children: [
25329
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_material41.Box, { sx: { display: "flex", alignItems: "center", gap: 1, flexWrap: "wrap" }, children: [
25330
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25331
+ import_material41.Typography,
25146
25332
  {
25147
25333
  variant: "subtitle1",
25148
25334
  sx: { fontWeight: 600, overflow: "hidden", textOverflow: "ellipsis" },
25149
25335
  children: project.name
25150
25336
  }
25151
25337
  ),
25152
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
25153
- import_material40.Chip,
25338
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25339
+ import_material41.Chip,
25154
25340
  {
25155
25341
  label: `${conversationCount}`,
25156
25342
  size: "small",
@@ -25164,8 +25350,8 @@ var init_project_management_modal = __esm({
25164
25350
  }
25165
25351
  )
25166
25352
  ] }),
25167
- project.description && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
25168
- import_material40.Typography,
25353
+ project.description && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25354
+ import_material41.Typography,
25169
25355
  {
25170
25356
  variant: "body2",
25171
25357
  color: "text.secondary",
@@ -25174,8 +25360,8 @@ var init_project_management_modal = __esm({
25174
25360
  }
25175
25361
  )
25176
25362
  ] }),
25177
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
25178
- import_material40.IconButton,
25363
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25364
+ import_material41.IconButton,
25179
25365
  {
25180
25366
  onClick: (e) => {
25181
25367
  e.stopPropagation();
@@ -25187,7 +25373,7 @@ var init_project_management_modal = __esm({
25187
25373
  mt: 0.25,
25188
25374
  zIndex: 1
25189
25375
  },
25190
- children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react7.MoreVertical, { size: 16 })
25376
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.MoreVertical, { size: 16 })
25191
25377
  }
25192
25378
  )
25193
25379
  ]
@@ -25198,8 +25384,8 @@ var init_project_management_modal = __esm({
25198
25384
  ]
25199
25385
  }
25200
25386
  ),
25201
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
25202
- import_material40.Box,
25387
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25388
+ import_material41.Box,
25203
25389
  {
25204
25390
  sx: {
25205
25391
  px: isMobile ? 1.5 : 2.75,
@@ -25209,9 +25395,9 @@ var init_project_management_modal = __esm({
25209
25395
  justifyContent: "flex-end",
25210
25396
  gap: 1
25211
25397
  },
25212
- children: showCreateForm ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
25213
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
25214
- import_material40.Button,
25398
+ children: showCreateForm ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
25399
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25400
+ import_material41.Button,
25215
25401
  {
25216
25402
  onClick: resetForm,
25217
25403
  disabled: loading,
@@ -25219,22 +25405,22 @@ var init_project_management_modal = __esm({
25219
25405
  children: "Cancel"
25220
25406
  }
25221
25407
  ),
25222
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
25223
- import_material40.Button,
25408
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25409
+ import_material41.Button,
25224
25410
  {
25225
25411
  onClick: editingProject ? handleEditProject : handleCreateProject,
25226
25412
  variant: "contained",
25227
25413
  disabled: loading,
25228
- startIcon: loading ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material40.CircularProgress, { size: 16 }) : void 0,
25414
+ startIcon: loading ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.CircularProgress, { size: 16 }) : void 0,
25229
25415
  sx: { textTransform: "none", borderRadius: 2 },
25230
25416
  children: editingProject ? "Update project" : "Create project"
25231
25417
  }
25232
25418
  )
25233
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material40.Button, { onClick: handleClose, sx: { textTransform: "none", borderRadius: 2 }, children: "Close" })
25419
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Button, { onClick: handleClose, sx: { textTransform: "none", borderRadius: 2 }, children: "Close" })
25234
25420
  }
25235
25421
  ),
25236
- /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
25237
- import_material40.Menu,
25422
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
25423
+ import_material41.Menu,
25238
25424
  {
25239
25425
  anchorEl: menuAnchor,
25240
25426
  open: Boolean(menuAnchor),
@@ -25255,30 +25441,30 @@ var init_project_management_modal = __esm({
25255
25441
  }
25256
25442
  },
25257
25443
  children: [
25258
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
25259
- import_material40.MenuItem,
25444
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25445
+ import_material41.MenuItem,
25260
25446
  {
25261
25447
  onClick: () => {
25262
25448
  if (!selectedProject) return;
25263
25449
  startEdit(selectedProject);
25264
25450
  },
25265
- children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_material40.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
25266
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react7.Pencil, { size: 16 }),
25267
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material40.Typography, { variant: "body2", color: "inherit", children: "Edit" })
25451
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_material41.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
25452
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.Pencil, { size: 16 }),
25453
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Typography, { variant: "body2", color: "inherit", children: "Edit" })
25268
25454
  ] })
25269
25455
  }
25270
25456
  ),
25271
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
25272
- import_material40.MenuItem,
25457
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25458
+ import_material41.MenuItem,
25273
25459
  {
25274
25460
  onClick: () => {
25275
25461
  if (!selectedProject) return;
25276
25462
  handleDeleteProject(selectedProject);
25277
25463
  },
25278
25464
  sx: { color: theme.palette.error.main },
25279
- children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_material40.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
25280
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react7.Trash2, { size: 16 }),
25281
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_material40.Typography, { variant: "body2", color: "inherit", children: "Delete" })
25465
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_material41.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
25466
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.Trash2, { size: 16 }),
25467
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Typography, { variant: "body2", color: "inherit", children: "Delete" })
25282
25468
  ] })
25283
25469
  }
25284
25470
  )
@@ -25288,8 +25474,8 @@ var init_project_management_modal = __esm({
25288
25474
  ]
25289
25475
  }
25290
25476
  );
25291
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_jsx_runtime40.Fragment, { children: isMobile ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
25292
- import_material40.SwipeableDrawer,
25477
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_jsx_runtime41.Fragment, { children: isMobile ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25478
+ import_material41.SwipeableDrawer,
25293
25479
  {
25294
25480
  anchor: "bottom",
25295
25481
  open,
@@ -25308,8 +25494,8 @@ var init_project_management_modal = __esm({
25308
25494
  },
25309
25495
  children: content
25310
25496
  }
25311
- ) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
25312
- import_material40.Modal,
25497
+ ) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25498
+ import_material41.Modal,
25313
25499
  {
25314
25500
  open,
25315
25501
  onClose: handleClose,
@@ -25329,18 +25515,18 @@ var init_project_management_modal = __esm({
25329
25515
  });
25330
25516
 
25331
25517
  // src/chat/move-conversation-modal.tsx
25332
- var import_react52, import_material41, import_lucide_react8, import_styles25, import_jsx_runtime41, MoveConversationModal, move_conversation_modal_default;
25518
+ var import_react53, import_material42, import_lucide_react8, import_styles25, import_jsx_runtime42, MoveConversationModal, move_conversation_modal_default;
25333
25519
  var init_move_conversation_modal = __esm({
25334
25520
  "src/chat/move-conversation-modal.tsx"() {
25335
25521
  "use strict";
25336
- import_react52 = require("react");
25337
- import_material41 = require("@mui/material");
25522
+ import_react53 = require("react");
25523
+ import_material42 = require("@mui/material");
25338
25524
  import_lucide_react8 = require("lucide-react");
25339
25525
  import_styles25 = require("@mui/material/styles");
25340
25526
  init_projectStore();
25341
25527
  init_conversationStore();
25342
25528
  init_debugLogger();
25343
- import_jsx_runtime41 = require("react/jsx-runtime");
25529
+ import_jsx_runtime42 = require("react/jsx-runtime");
25344
25530
  MoveConversationModal = ({
25345
25531
  open,
25346
25532
  onClose,
@@ -25350,15 +25536,15 @@ var init_move_conversation_modal = __esm({
25350
25536
  const theme = (0, import_styles25.useTheme)();
25351
25537
  const { projects, _hasHydrated, hydrate } = useProjectStore();
25352
25538
  const { moveConversationToProject } = useConversationStore();
25353
- const [selectedProjectId, setSelectedProjectId] = (0, import_react52.useState)(
25539
+ const [selectedProjectId, setSelectedProjectId] = (0, import_react53.useState)(
25354
25540
  currentProjectId
25355
25541
  );
25356
- (0, import_react52.useEffect)(() => {
25542
+ (0, import_react53.useEffect)(() => {
25357
25543
  if (open && !_hasHydrated) {
25358
25544
  hydrate();
25359
25545
  }
25360
25546
  }, [open, _hasHydrated, hydrate]);
25361
- (0, import_react52.useEffect)(() => {
25547
+ (0, import_react53.useEffect)(() => {
25362
25548
  setSelectedProjectId(currentProjectId);
25363
25549
  }, [currentProjectId, open]);
25364
25550
  const handleMove = async () => {
@@ -25377,8 +25563,8 @@ var init_move_conversation_modal = __esm({
25377
25563
  };
25378
25564
  const conversationCount = conversations.length;
25379
25565
  const isMultiple = conversationCount > 1;
25380
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
25381
- import_material41.Dialog,
25566
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
25567
+ import_material42.Dialog,
25382
25568
  {
25383
25569
  open,
25384
25570
  onClose,
@@ -25391,40 +25577,40 @@ var init_move_conversation_modal = __esm({
25391
25577
  }
25392
25578
  },
25393
25579
  children: [
25394
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_material41.DialogTitle, { children: [
25580
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.DialogTitle, { children: [
25395
25581
  "Move ",
25396
25582
  isMultiple ? `${conversationCount} Conversations` : "Conversation"
25397
25583
  ] }),
25398
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_material41.DialogContent, { sx: { px: 3 }, children: [
25399
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Typography, { 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:` }),
25400
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_material41.List, { children: [
25401
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.ListItem, { disablePadding: true, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
25402
- import_material41.ListItemButton,
25584
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.DialogContent, { sx: { px: 3 }, children: [
25585
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Typography, { 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:` }),
25586
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.List, { children: [
25587
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.ListItem, { disablePadding: true, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
25588
+ import_material42.ListItemButton,
25403
25589
  {
25404
25590
  onClick: () => setSelectedProjectId(null),
25405
25591
  selected: selectedProjectId === null,
25406
25592
  children: [
25407
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25408
- import_material41.Radio,
25593
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
25594
+ import_material42.Radio,
25409
25595
  {
25410
25596
  checked: selectedProjectId === null,
25411
25597
  onChange: () => setSelectedProjectId(null),
25412
25598
  size: "small"
25413
25599
  }
25414
25600
  ) }),
25415
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25416
- import_material41.Avatar,
25601
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
25602
+ import_material42.Avatar,
25417
25603
  {
25418
25604
  sx: {
25419
25605
  bgcolor: theme.palette.grey[400],
25420
25606
  width: 32,
25421
25607
  height: 32
25422
25608
  },
25423
- children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react8.Inbox, {})
25609
+ children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react8.Inbox, {})
25424
25610
  }
25425
25611
  ) }),
25426
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25427
- import_material41.ListItemText,
25612
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
25613
+ import_material42.ListItemText,
25428
25614
  {
25429
25615
  primary: "No Project",
25430
25616
  secondary: "Keep conversations ungrouped"
@@ -25433,34 +25619,34 @@ var init_move_conversation_modal = __esm({
25433
25619
  ]
25434
25620
  }
25435
25621
  ) }),
25436
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Divider, { sx: { my: 1 } }),
25437
- projects.map((project) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.ListItem, { disablePadding: true, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
25438
- import_material41.ListItemButton,
25622
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Divider, { sx: { my: 1 } }),
25623
+ projects.map((project) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.ListItem, { disablePadding: true, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
25624
+ import_material42.ListItemButton,
25439
25625
  {
25440
25626
  onClick: () => setSelectedProjectId(project.id),
25441
25627
  selected: selectedProjectId === project.id,
25442
25628
  children: [
25443
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25444
- import_material41.Radio,
25629
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
25630
+ import_material42.Radio,
25445
25631
  {
25446
25632
  checked: selectedProjectId === project.id,
25447
25633
  onChange: () => setSelectedProjectId(project.id),
25448
25634
  size: "small"
25449
25635
  }
25450
25636
  ) }),
25451
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25452
- import_material41.Avatar,
25637
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
25638
+ import_material42.Avatar,
25453
25639
  {
25454
25640
  sx: {
25455
25641
  bgcolor: project.color,
25456
25642
  width: 32,
25457
25643
  height: 32
25458
25644
  },
25459
- children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react8.Folder, {})
25645
+ children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react8.Folder, {})
25460
25646
  }
25461
25647
  ) }),
25462
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
25463
- import_material41.ListItemText,
25648
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
25649
+ import_material42.ListItemText,
25464
25650
  {
25465
25651
  primary: project.name,
25466
25652
  secondary: project.description
@@ -25469,17 +25655,17 @@ var init_move_conversation_modal = __esm({
25469
25655
  ]
25470
25656
  }
25471
25657
  ) }, project.id)),
25472
- projects.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Box, { sx: {
25658
+ projects.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Box, { sx: {
25473
25659
  textAlign: "center",
25474
25660
  py: 2,
25475
25661
  color: theme.palette.text.secondary
25476
- }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Typography, { variant: "body2", children: "No projects available. Create a project first to organize conversations." }) })
25662
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Typography, { variant: "body2", children: "No projects available. Create a project first to organize conversations." }) })
25477
25663
  ] })
25478
25664
  ] }),
25479
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_material41.DialogActions, { sx: { px: 3, pb: 2 }, children: [
25480
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material41.Button, { onClick: onClose, children: "Cancel" }),
25481
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
25482
- import_material41.Button,
25665
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.DialogActions, { sx: { px: 3, pb: 2 }, children: [
25666
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Button, { onClick: onClose, children: "Cancel" }),
25667
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
25668
+ import_material42.Button,
25483
25669
  {
25484
25670
  onClick: handleMove,
25485
25671
  variant: "contained",
@@ -25500,15 +25686,15 @@ var init_move_conversation_modal = __esm({
25500
25686
  });
25501
25687
 
25502
25688
  // src/chat/simple-conversation-item.tsx
25503
- var import_react53, import_material42, import_lucide_react9, import_styles26, import_jsx_runtime42, SimpleConversationItem, simple_conversation_item_default;
25689
+ var import_react54, import_material43, import_lucide_react9, import_styles26, import_jsx_runtime43, SimpleConversationItem, simple_conversation_item_default;
25504
25690
  var init_simple_conversation_item = __esm({
25505
25691
  "src/chat/simple-conversation-item.tsx"() {
25506
25692
  "use strict";
25507
- import_react53 = require("react");
25508
- import_material42 = require("@mui/material");
25693
+ import_react54 = require("react");
25694
+ import_material43 = require("@mui/material");
25509
25695
  import_lucide_react9 = require("lucide-react");
25510
25696
  import_styles26 = require("@mui/material/styles");
25511
- import_jsx_runtime42 = require("react/jsx-runtime");
25697
+ import_jsx_runtime43 = require("react/jsx-runtime");
25512
25698
  SimpleConversationItem = ({
25513
25699
  conversation,
25514
25700
  isSelected,
@@ -25525,17 +25711,17 @@ var init_simple_conversation_item = __esm({
25525
25711
  isTouchDragActive
25526
25712
  }) => {
25527
25713
  const theme = (0, import_styles26.useTheme)();
25528
- const isMobile = (0, import_material42.useMediaQuery)(theme.breakpoints.down("sm"));
25529
- const [anchorEl, setAnchorEl] = (0, import_react53.useState)(null);
25530
- const [isEditing, setIsEditing] = (0, import_react53.useState)(false);
25531
- const [editName, setEditName] = (0, import_react53.useState)(conversation.name);
25532
- const [isDragging, setIsDragging] = (0, import_react53.useState)(false);
25533
- const [isTouchDragging, setIsTouchDragging] = (0, import_react53.useState)(false);
25534
- const [showRenameDialog, setShowRenameDialog] = (0, import_react53.useState)(false);
25535
- const longPressTimeoutRef = (0, import_react53.useRef)(null);
25536
- const touchStartPointRef = (0, import_react53.useRef)(null);
25537
- const activeTouchIdRef = (0, import_react53.useRef)(null);
25538
- const suppressClickRef = (0, import_react53.useRef)(false);
25714
+ const isMobile = (0, import_material43.useMediaQuery)(theme.breakpoints.down("sm"));
25715
+ const [anchorEl, setAnchorEl] = (0, import_react54.useState)(null);
25716
+ const [isEditing, setIsEditing] = (0, import_react54.useState)(false);
25717
+ const [editName, setEditName] = (0, import_react54.useState)(conversation.name);
25718
+ const [isDragging, setIsDragging] = (0, import_react54.useState)(false);
25719
+ const [isTouchDragging, setIsTouchDragging] = (0, import_react54.useState)(false);
25720
+ const [showRenameDialog, setShowRenameDialog] = (0, import_react54.useState)(false);
25721
+ const longPressTimeoutRef = (0, import_react54.useRef)(null);
25722
+ const touchStartPointRef = (0, import_react54.useRef)(null);
25723
+ const activeTouchIdRef = (0, import_react54.useRef)(null);
25724
+ const suppressClickRef = (0, import_react54.useRef)(false);
25539
25725
  const highlightText = (text, query) => {
25540
25726
  if (!query || !query.trim()) {
25541
25727
  return text;
@@ -25543,8 +25729,8 @@ var init_simple_conversation_item = __esm({
25543
25729
  const regex = new RegExp(`(${query.trim()})`, "gi");
25544
25730
  const parts = text.split(regex);
25545
25731
  return parts.map(
25546
- (part, index) => regex.test(part) ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
25547
- import_material42.Box,
25732
+ (part, index) => regex.test(part) ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
25733
+ import_material43.Box,
25548
25734
  {
25549
25735
  component: "span",
25550
25736
  sx: {
@@ -25674,14 +25860,14 @@ var init_simple_conversation_item = __esm({
25674
25860
  if (!isMobile) return;
25675
25861
  finalizeTouchDrag();
25676
25862
  };
25677
- (0, import_react53.useEffect)(() => {
25863
+ (0, import_react54.useEffect)(() => {
25678
25864
  if (!isTouchDragActive && isTouchDragging) {
25679
25865
  setIsTouchDragging(false);
25680
25866
  }
25681
25867
  }, [isTouchDragActive, isTouchDragging]);
25682
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
25683
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
25684
- import_material42.Box,
25868
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
25869
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
25870
+ import_material43.Box,
25685
25871
  {
25686
25872
  "data-project-id": conversation.projectId ?? "__ungrouped",
25687
25873
  draggable: !isMobile && !isEditing,
@@ -25733,7 +25919,7 @@ var init_simple_conversation_item = __esm({
25733
25919
  }
25734
25920
  },
25735
25921
  children: [
25736
- !isMobile && !isEditing && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
25922
+ !isMobile && !isEditing && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
25737
25923
  import_lucide_react9.GripVertical,
25738
25924
  {
25739
25925
  size: 16,
@@ -25741,9 +25927,9 @@ var init_simple_conversation_item = __esm({
25741
25927
  style: { marginRight: 4, cursor: "grab" }
25742
25928
  }
25743
25929
  ),
25744
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Box, { sx: { flex: 1, minWidth: 0 }, children: [
25745
- isEditing ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
25746
- import_material42.TextField,
25930
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_material43.Box, { sx: { flex: 1, minWidth: 0 }, children: [
25931
+ isEditing ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
25932
+ import_material43.TextField,
25747
25933
  {
25748
25934
  value: editName,
25749
25935
  onChange: (e) => setEditName(e.target.value),
@@ -25765,8 +25951,8 @@ var init_simple_conversation_item = __esm({
25765
25951
  }
25766
25952
  }
25767
25953
  }
25768
- ) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
25769
- import_material42.Typography,
25954
+ ) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
25955
+ import_material43.Typography,
25770
25956
  {
25771
25957
  variant: "body2",
25772
25958
  sx: {
@@ -25780,8 +25966,8 @@ var init_simple_conversation_item = __esm({
25780
25966
  children: highlightText(conversation.name, searchQuery)
25781
25967
  }
25782
25968
  ),
25783
- !isEditing && snippet && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
25784
- import_material42.Typography,
25969
+ !isEditing && snippet && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
25970
+ import_material43.Typography,
25785
25971
  {
25786
25972
  variant: "caption",
25787
25973
  sx: {
@@ -25799,8 +25985,8 @@ var init_simple_conversation_item = __esm({
25799
25985
  }
25800
25986
  )
25801
25987
  ] }),
25802
- !isEditing && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
25803
- import_material42.IconButton,
25988
+ !isEditing && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
25989
+ import_material43.IconButton,
25804
25990
  {
25805
25991
  onClick: handleMenuOpen,
25806
25992
  size: "small",
@@ -25828,11 +26014,11 @@ var init_simple_conversation_item = __esm({
25828
26014
  }
25829
26015
  }
25830
26016
  },
25831
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react9.MoreVertical, { size: 16 })
26017
+ children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react9.MoreVertical, { size: 16 })
25832
26018
  }
25833
26019
  ),
25834
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
25835
- import_material42.Menu,
26020
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
26021
+ import_material43.Menu,
25836
26022
  {
25837
26023
  anchorEl,
25838
26024
  open: Boolean(anchorEl),
@@ -25858,17 +26044,17 @@ var init_simple_conversation_item = __esm({
25858
26044
  }
25859
26045
  },
25860
26046
  children: [
25861
- onRename && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.MenuItem, { onClick: handleEdit, children: [
25862
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react9.Pencil, { size: 16 }) }),
25863
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.ListItemText, { children: "Rename" })
26047
+ onRename && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_material43.MenuItem, { onClick: handleEdit, children: [
26048
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react9.Pencil, { size: 16 }) }),
26049
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.ListItemText, { children: "Rename" })
25864
26050
  ] }),
25865
- onMove && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.MenuItem, { onClick: handleMove, children: [
25866
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react9.MailOpen, { size: 16 }) }),
25867
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.ListItemText, { children: "Move to Project" })
26051
+ onMove && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_material43.MenuItem, { onClick: handleMove, children: [
26052
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react9.MailOpen, { size: 16 }) }),
26053
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.ListItemText, { children: "Move to Project" })
25868
26054
  ] }),
25869
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.MenuItem, { onClick: handleDelete, children: [
25870
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react9.Trash2, { size: 16 }) }),
25871
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.ListItemText, { children: "Delete" })
26055
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_material43.MenuItem, { onClick: handleDelete, children: [
26056
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react9.Trash2, { size: 16 }) }),
26057
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.ListItemText, { children: "Delete" })
25872
26058
  ] })
25873
26059
  ]
25874
26060
  }
@@ -25876,8 +26062,8 @@ var init_simple_conversation_item = __esm({
25876
26062
  ]
25877
26063
  }
25878
26064
  ),
25879
- isMobile && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
25880
- import_material42.Dialog,
26065
+ isMobile && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
26066
+ import_material43.Dialog,
25881
26067
  {
25882
26068
  open: showRenameDialog,
25883
26069
  onClose: () => {
@@ -25892,9 +26078,9 @@ var init_simple_conversation_item = __esm({
25892
26078
  }
25893
26079
  },
25894
26080
  children: [
25895
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.DialogTitle, { sx: { pb: 1 }, children: "Rename Conversation" }),
25896
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.DialogContent, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
25897
- import_material42.TextField,
26081
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.DialogTitle, { sx: { pb: 1 }, children: "Rename Conversation" }),
26082
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.DialogContent, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
26083
+ import_material43.TextField,
25898
26084
  {
25899
26085
  value: editName,
25900
26086
  onChange: (e) => setEditName(e.target.value),
@@ -25906,9 +26092,9 @@ var init_simple_conversation_item = __esm({
25906
26092
  }
25907
26093
  }
25908
26094
  ) }),
25909
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.DialogActions, { sx: { px: 3, pb: 2 }, children: [
25910
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
25911
- import_material42.Button,
26095
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_material43.DialogActions, { sx: { px: 3, pb: 2 }, children: [
26096
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
26097
+ import_material43.Button,
25912
26098
  {
25913
26099
  onClick: () => {
25914
26100
  setShowRenameDialog(false);
@@ -25917,8 +26103,8 @@ var init_simple_conversation_item = __esm({
25917
26103
  children: "Cancel"
25918
26104
  }
25919
26105
  ),
25920
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
25921
- import_material42.Button,
26106
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
26107
+ import_material43.Button,
25922
26108
  {
25923
26109
  onClick: () => {
25924
26110
  commitRename();
@@ -25940,18 +26126,18 @@ var init_simple_conversation_item = __esm({
25940
26126
  });
25941
26127
 
25942
26128
  // src/chat/project-header.tsx
25943
- var import_react54, import_material43, import_lucide_react10, import_styles27, import_jsx_runtime43, ProjectHeader, project_header_default;
26129
+ var import_react55, import_material44, import_lucide_react10, import_styles27, import_jsx_runtime44, ProjectHeader, project_header_default;
25944
26130
  var init_project_header = __esm({
25945
26131
  "src/chat/project-header.tsx"() {
25946
26132
  "use strict";
25947
- import_react54 = require("react");
25948
- import_material43 = require("@mui/material");
26133
+ import_react55 = require("react");
26134
+ import_material44 = require("@mui/material");
25949
26135
  import_lucide_react10 = require("lucide-react");
25950
26136
  import_styles27 = require("@mui/material/styles");
25951
26137
  init_conversationStore();
25952
26138
  init_projectStore();
25953
26139
  init_debugLogger();
25954
- import_jsx_runtime43 = require("react/jsx-runtime");
26140
+ import_jsx_runtime44 = require("react/jsx-runtime");
25955
26141
  ProjectHeader = ({
25956
26142
  projectId,
25957
26143
  projectName,
@@ -25968,10 +26154,10 @@ var init_project_header = __esm({
25968
26154
  const theme = (0, import_styles27.useTheme)();
25969
26155
  const { createNewConversation } = useConversationStore();
25970
26156
  const { renameProject } = useProjectStore();
25971
- const [isHovered, setIsHovered] = (0, import_react54.useState)(false);
25972
- const [isDragOver, setIsDragOver] = (0, import_react54.useState)(false);
25973
- const [renameDraft, setRenameDraft] = (0, import_react54.useState)(projectName);
25974
- const renameActionRef = (0, import_react54.useRef)("none");
26157
+ const [isHovered, setIsHovered] = (0, import_react55.useState)(false);
26158
+ const [isDragOver, setIsDragOver] = (0, import_react55.useState)(false);
26159
+ const [renameDraft, setRenameDraft] = (0, import_react55.useState)(projectName);
26160
+ const renameActionRef = (0, import_react55.useRef)("none");
25975
26161
  const isUngrouped = projectId === null;
25976
26162
  const Icon = isCollapsed ? import_lucide_react10.Folder : import_lucide_react10.FolderOpen;
25977
26163
  const handleAddConversation = (e) => {
@@ -26017,8 +26203,8 @@ var init_project_header = __esm({
26017
26203
  setRenameDraft(projectName);
26018
26204
  onRenameComplete?.();
26019
26205
  };
26020
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
26021
- import_material43.Box,
26206
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
26207
+ import_material44.Box,
26022
26208
  {
26023
26209
  "data-project-id": projectId ?? "__ungrouped",
26024
26210
  onMouseEnter: () => setIsHovered(true),
@@ -26034,37 +26220,37 @@ var init_project_header = __esm({
26034
26220
  py: 1.5,
26035
26221
  cursor: isUngrouped ? "default" : "pointer",
26036
26222
  // No pointer cursor for ungrouped
26037
- bgcolor: isDragOver || isTouchTarget ? (0, import_material43.alpha)(projectColor || theme.palette.primary.main, 0.1) : void 0,
26223
+ bgcolor: isDragOver || isTouchTarget ? (0, import_material44.alpha)(projectColor || theme.palette.primary.main, 0.1) : void 0,
26038
26224
  border: isDragOver || isTouchTarget ? `2px dashed ${projectColor || theme.palette.primary.main}` : "2px solid transparent",
26039
26225
  borderRadius: isDragOver || isTouchTarget ? 1 : 0,
26040
26226
  transition: "all 0.2s ease",
26041
26227
  "&:hover": !isUngrouped ? {
26042
26228
  // Only show hover for projects, not ungrouped
26043
- bgcolor: (0, import_material43.alpha)(theme.palette.text.primary, 0.04)
26229
+ bgcolor: (0, import_material44.alpha)(theme.palette.text.primary, 0.04)
26044
26230
  } : {}
26045
26231
  },
26046
26232
  children: [
26047
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
26048
- import_material43.Avatar,
26233
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26234
+ import_material44.Avatar,
26049
26235
  {
26050
26236
  sx: {
26051
- bgcolor: isUngrouped ? (0, import_material43.alpha)(theme.palette.text.disabled, 0.1) : projectColor || theme.palette.grey[400],
26237
+ bgcolor: isUngrouped ? (0, import_material44.alpha)(theme.palette.text.disabled, 0.1) : projectColor || theme.palette.grey[400],
26052
26238
  width: 28,
26053
26239
  height: 28,
26054
26240
  mr: 1.5
26055
26241
  },
26056
- children: isUngrouped ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
26242
+ children: isUngrouped ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26057
26243
  import_lucide_react10.Inbox,
26058
26244
  {
26059
26245
  size: 16,
26060
26246
  color: theme.palette.text.disabled,
26061
26247
  style: { opacity: 0.7 }
26062
26248
  }
26063
- ) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Icon, { size: 16 })
26249
+ ) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Icon, { size: 16 })
26064
26250
  }
26065
26251
  ),
26066
- isRenaming && !isUngrouped ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
26067
- import_material43.TextField,
26252
+ isRenaming && !isUngrouped ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26253
+ import_material44.TextField,
26068
26254
  {
26069
26255
  value: renameDraft,
26070
26256
  onChange: (e) => setRenameDraft(e.target.value),
@@ -26110,8 +26296,8 @@ var init_project_header = __esm({
26110
26296
  }
26111
26297
  }
26112
26298
  }
26113
- ) : /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
26114
- import_material43.Typography,
26299
+ ) : /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
26300
+ import_material44.Typography,
26115
26301
  {
26116
26302
  variant: "subtitle2",
26117
26303
  sx: {
@@ -26123,8 +26309,8 @@ var init_project_header = __esm({
26123
26309
  },
26124
26310
  children: [
26125
26311
  projectName,
26126
- isDragOver && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
26127
- import_material43.Typography,
26312
+ isDragOver && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26313
+ import_material44.Typography,
26128
26314
  {
26129
26315
  component: "span",
26130
26316
  variant: "caption",
@@ -26139,13 +26325,13 @@ var init_project_header = __esm({
26139
26325
  ]
26140
26326
  }
26141
26327
  ),
26142
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
26143
- import_material43.Chip,
26328
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26329
+ import_material44.Chip,
26144
26330
  {
26145
26331
  label: conversationCount,
26146
26332
  size: "small",
26147
26333
  sx: {
26148
- bgcolor: isUngrouped ? (0, import_material43.alpha)(theme.palette.text.disabled, 0.1) : (0, import_material43.alpha)(projectColor || theme.palette.primary.main, 0.15),
26334
+ bgcolor: isUngrouped ? (0, import_material44.alpha)(theme.palette.text.disabled, 0.1) : (0, import_material44.alpha)(projectColor || theme.palette.primary.main, 0.15),
26149
26335
  color: isUngrouped ? theme.palette.text.disabled : projectColor || theme.palette.primary.main,
26150
26336
  minWidth: 28,
26151
26337
  height: 22,
@@ -26159,9 +26345,9 @@ var init_project_header = __esm({
26159
26345
  }
26160
26346
  }
26161
26347
  ),
26162
- isRenaming && !isUngrouped && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_material43.Box, { sx: { display: "flex", alignItems: "center", gap: 0.5, ml: 1 }, children: [
26163
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.Tooltip, { title: "Cancel and remove", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
26164
- import_material43.IconButton,
26348
+ isRenaming && !isUngrouped && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { display: "flex", alignItems: "center", gap: 0.5, ml: 1 }, children: [
26349
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Tooltip, { title: "Cancel and remove", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26350
+ import_material44.IconButton,
26165
26351
  {
26166
26352
  size: "small",
26167
26353
  onMouseDown: (e) => {
@@ -26169,12 +26355,12 @@ var init_project_header = __esm({
26169
26355
  renameActionRef.current = "delete";
26170
26356
  onRenameCancelDelete ? onRenameCancelDelete() : cancelRename();
26171
26357
  },
26172
- sx: { color: (0, import_material43.alpha)(theme.palette.error.main, 0.9) },
26173
- children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react10.X, { size: 16 })
26358
+ sx: { color: (0, import_material44.alpha)(theme.palette.error.main, 0.9) },
26359
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react10.X, { size: 16 })
26174
26360
  }
26175
26361
  ) }),
26176
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.Tooltip, { title: "Save", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
26177
- import_material43.IconButton,
26362
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Tooltip, { title: "Save", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26363
+ import_material44.IconButton,
26178
26364
  {
26179
26365
  size: "small",
26180
26366
  onMouseDown: (e) => {
@@ -26183,39 +26369,39 @@ var init_project_header = __esm({
26183
26369
  commitRename();
26184
26370
  },
26185
26371
  sx: { color: theme.palette.success.main },
26186
- children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react10.Check, { size: 16 })
26372
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react10.Check, { size: 16 })
26187
26373
  }
26188
26374
  ) })
26189
26375
  ] }),
26190
- isHovered && !isDragOver && !isUngrouped && !isRenaming && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.Tooltip, { title: `Add conversation to ${projectName.toLowerCase()}`, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
26191
- import_material43.IconButton,
26376
+ isHovered && !isDragOver && !isUngrouped && !isRenaming && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Tooltip, { title: `Add conversation to ${projectName.toLowerCase()}`, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26377
+ import_material44.IconButton,
26192
26378
  {
26193
26379
  onClick: handleAddConversation,
26194
26380
  size: "small",
26195
26381
  sx: {
26196
26382
  color: projectColor || theme.palette.primary.main,
26197
- bgcolor: (0, import_material43.alpha)(projectColor || theme.palette.primary.main, 0.1),
26383
+ bgcolor: (0, import_material44.alpha)(projectColor || theme.palette.primary.main, 0.1),
26198
26384
  width: 24,
26199
26385
  height: 24,
26200
26386
  mr: 0.5,
26201
26387
  "&:hover": {
26202
- bgcolor: (0, import_material43.alpha)(projectColor || theme.palette.primary.main, 0.2),
26388
+ bgcolor: (0, import_material44.alpha)(projectColor || theme.palette.primary.main, 0.2),
26203
26389
  transform: "scale(1.1)"
26204
26390
  },
26205
26391
  transition: "all 0.2s ease"
26206
26392
  },
26207
- children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react10.Plus, { size: 16 })
26393
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react10.Plus, { size: 16 })
26208
26394
  }
26209
26395
  ) }),
26210
- !isUngrouped && !isRenaming && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
26211
- import_material43.IconButton,
26396
+ !isUngrouped && !isRenaming && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26397
+ import_material44.IconButton,
26212
26398
  {
26213
26399
  size: "small",
26214
26400
  sx: {
26215
26401
  color: theme.palette.text.secondary,
26216
26402
  transition: "transform 0.2s ease"
26217
26403
  },
26218
- children: isCollapsed ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react10.ChevronDown, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react10.ChevronUp, { size: 16 })
26404
+ children: isCollapsed ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react10.ChevronDown, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react10.ChevronUp, { size: 16 })
26219
26405
  }
26220
26406
  )
26221
26407
  ]
@@ -26245,12 +26431,12 @@ var init_tooltips = __esm({
26245
26431
  });
26246
26432
 
26247
26433
  // src/chat/conversation-drawer.tsx
26248
- var import_react55, import_material44, import_lucide_react11, import_styles28, import_jsx_runtime44, BANDIT_AVATAR, coerceOptionalString, deriveInitials, ConversationDrawer, conversation_drawer_default;
26434
+ var import_react56, import_material45, import_lucide_react11, import_styles28, import_jsx_runtime45, BANDIT_AVATAR, coerceOptionalString, deriveInitials, ConversationDrawer, conversation_drawer_default;
26249
26435
  var init_conversation_drawer = __esm({
26250
26436
  "src/chat/conversation-drawer.tsx"() {
26251
26437
  "use strict";
26252
- import_react55 = require("react");
26253
- import_material44 = require("@mui/material");
26438
+ import_react56 = require("react");
26439
+ import_material45 = require("@mui/material");
26254
26440
  import_lucide_react11 = require("lucide-react");
26255
26441
  import_styles28 = require("@mui/material/styles");
26256
26442
  init_conversationStore();
@@ -26266,7 +26452,7 @@ var init_conversation_drawer = __esm({
26266
26452
  init_project_header();
26267
26453
  init_debugLogger();
26268
26454
  init_tooltips();
26269
- import_jsx_runtime44 = require("react/jsx-runtime");
26455
+ import_jsx_runtime45 = require("react/jsx-runtime");
26270
26456
  BANDIT_AVATAR = "https://cdn.burtson.ai/images/bandit-head.png";
26271
26457
  coerceOptionalString = (value) => {
26272
26458
  if (typeof value !== "string") return void 0;
@@ -26295,7 +26481,7 @@ var init_conversation_drawer = __esm({
26295
26481
  };
26296
26482
  ConversationDrawer = ({ open, onClose }) => {
26297
26483
  const theme = (0, import_styles28.useTheme)();
26298
- const isMobile = (0, import_material44.useMediaQuery)(theme.breakpoints.down("sm"));
26484
+ const isMobile = (0, import_material45.useMediaQuery)(theme.breakpoints.down("sm"));
26299
26485
  const { user: user2 } = useAuthenticationStore();
26300
26486
  const baseRadius = typeof theme.shape.borderRadius === "number" ? theme.shape.borderRadius : parseFloat(theme.shape.borderRadius) || 0;
26301
26487
  const drawerCornerRadius = baseRadius * 3;
@@ -26317,22 +26503,22 @@ var init_conversation_drawer = __esm({
26317
26503
  createProject,
26318
26504
  deleteProject
26319
26505
  } = useProjectStore();
26320
- const [projectManagementOpen, setProjectManagementOpen] = (0, import_react55.useState)(false);
26321
- const [memoryModalOpen, setMemoryModalOpen] = (0, import_react55.useState)(false);
26322
- const [collapsedProjects, setCollapsedProjects] = (0, import_react55.useState)(/* @__PURE__ */ new Set());
26323
- const didInitCollapseRef = (0, import_react55.useRef)(false);
26324
- const [searchQuery, setSearchQuery] = (0, import_react55.useState)("");
26325
- const [menuAnchorEl, setMenuAnchorEl] = (0, import_react55.useState)(null);
26326
- const [clearConfirmOpen, setClearConfirmOpen] = (0, import_react55.useState)(false);
26327
- const [moveModalOpen, setMoveModalOpen] = (0, import_react55.useState)(false);
26328
- const [conversationToMove, setConversationToMove] = (0, import_react55.useState)(null);
26329
- const [renameProjectId, setRenameProjectId] = (0, import_react55.useState)(null);
26330
- const getCustomClaim = (0, import_react55.useCallback)((key) => {
26506
+ const [projectManagementOpen, setProjectManagementOpen] = (0, import_react56.useState)(false);
26507
+ const [memoryModalOpen, setMemoryModalOpen] = (0, import_react56.useState)(false);
26508
+ const [collapsedProjects, setCollapsedProjects] = (0, import_react56.useState)(/* @__PURE__ */ new Set());
26509
+ const didInitCollapseRef = (0, import_react56.useRef)(false);
26510
+ const [searchQuery, setSearchQuery] = (0, import_react56.useState)("");
26511
+ const [menuAnchorEl, setMenuAnchorEl] = (0, import_react56.useState)(null);
26512
+ const [clearConfirmOpen, setClearConfirmOpen] = (0, import_react56.useState)(false);
26513
+ const [moveModalOpen, setMoveModalOpen] = (0, import_react56.useState)(false);
26514
+ const [conversationToMove, setConversationToMove] = (0, import_react56.useState)(null);
26515
+ const [renameProjectId, setRenameProjectId] = (0, import_react56.useState)(null);
26516
+ const getCustomClaim = (0, import_react56.useCallback)((key) => {
26331
26517
  if (!user2) return void 0;
26332
26518
  const record = user2;
26333
26519
  return coerceOptionalString(record[key]);
26334
26520
  }, [user2]);
26335
- const userDisplayName = (0, import_react55.useMemo)(() => {
26521
+ const userDisplayName = (0, import_react56.useMemo)(() => {
26336
26522
  if (!user2) return void 0;
26337
26523
  const candidateFields = [
26338
26524
  coerceOptionalString(user2.name),
@@ -26347,7 +26533,7 @@ var init_conversation_drawer = __esm({
26347
26533
  if (trimmedEmail) return trimmedEmail;
26348
26534
  return user2.sub;
26349
26535
  }, [user2, getCustomClaim]);
26350
- const userSecondaryText = (0, import_react55.useMemo)(() => {
26536
+ const userSecondaryText = (0, import_react56.useMemo)(() => {
26351
26537
  if (!user2) return void 0;
26352
26538
  const trimmedEmail = coerceOptionalString(user2.email);
26353
26539
  if (trimmedEmail && trimmedEmail !== userDisplayName) {
@@ -26359,13 +26545,13 @@ var init_conversation_drawer = __esm({
26359
26545
  }
26360
26546
  return void 0;
26361
26547
  }, [user2, userDisplayName]);
26362
- const [avatarImage, setAvatarImage] = (0, import_react55.useState)(BANDIT_AVATAR);
26363
- (0, import_react55.useEffect)(() => {
26548
+ const [avatarImage, setAvatarImage] = (0, import_react56.useState)(BANDIT_AVATAR);
26549
+ (0, import_react56.useEffect)(() => {
26364
26550
  const fresh = readPersistedToken();
26365
26551
  const store = useAuthenticationStore.getState();
26366
26552
  if (fresh && fresh !== store.token) store.setToken(fresh);
26367
26553
  }, []);
26368
- (0, import_react55.useEffect)(() => {
26554
+ (0, import_react56.useEffect)(() => {
26369
26555
  let active2 = true;
26370
26556
  let objectUrl = null;
26371
26557
  const resolveAvatar2 = async () => {
@@ -26406,13 +26592,13 @@ var init_conversation_drawer = __esm({
26406
26592
  };
26407
26593
  }, [getCustomClaim]);
26408
26594
  const avatarLabel = userDisplayName || user2?.email || "Bandit";
26409
- const avatarInitials = (0, import_react55.useMemo)(() => deriveInitials(avatarLabel), [avatarLabel]);
26410
- (0, import_react55.useEffect)(() => {
26595
+ const avatarInitials = (0, import_react56.useMemo)(() => deriveInitials(avatarLabel), [avatarLabel]);
26596
+ (0, import_react56.useEffect)(() => {
26411
26597
  if (!projectsHydrated) {
26412
26598
  hydrateProjects();
26413
26599
  }
26414
26600
  }, [projectsHydrated, hydrateProjects]);
26415
- (0, import_react55.useEffect)(() => {
26601
+ (0, import_react56.useEffect)(() => {
26416
26602
  if (projectsHydrated && !didInitCollapseRef.current) {
26417
26603
  didInitCollapseRef.current = true;
26418
26604
  if (projects && projects.length > 0) {
@@ -26425,7 +26611,7 @@ var init_conversation_drawer = __esm({
26425
26611
  const end = Math.min(text.length, idx + query.length + 60);
26426
26612
  return text.slice(start, end).replace(/\s+/g, " ").trim();
26427
26613
  };
26428
- const projectGroups = (0, import_react55.useMemo)(() => {
26614
+ const projectGroups = (0, import_react56.useMemo)(() => {
26429
26615
  const groups = projects.map((project) => ({
26430
26616
  id: project.id,
26431
26617
  name: project.name,
@@ -26448,7 +26634,7 @@ var init_conversation_drawer = __esm({
26448
26634
  }
26449
26635
  return groups.filter((group) => group.conversations.length > 0 || group.id !== null);
26450
26636
  }, [projects, conversations, collapsedProjects]);
26451
- const filteredProjectGroups = (0, import_react55.useMemo)(() => {
26637
+ const filteredProjectGroups = (0, import_react56.useMemo)(() => {
26452
26638
  if (!searchQuery.trim()) return projectGroups;
26453
26639
  const query = searchQuery.toLowerCase();
26454
26640
  return projectGroups.map((group) => {
@@ -26519,9 +26705,9 @@ var init_conversation_drawer = __esm({
26519
26705
  setMoveModalOpen(false);
26520
26706
  setConversationToMove(null);
26521
26707
  };
26522
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
26523
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
26524
- import_material44.Drawer,
26708
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
26709
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
26710
+ import_material45.Drawer,
26525
26711
  {
26526
26712
  anchor: "left",
26527
26713
  open,
@@ -26534,7 +26720,7 @@ var init_conversation_drawer = __esm({
26534
26720
  width: isMobile ? `min(94vw, 360px)` : 340,
26535
26721
  maxWidth: 360,
26536
26722
  bgcolor: theme.palette.background.paper,
26537
- borderRight: `1px solid ${isMobile ? (0, import_material44.alpha)(theme.palette.divider, 0.4) : theme.palette.divider}`,
26723
+ borderRight: `1px solid ${isMobile ? (0, import_material45.alpha)(theme.palette.divider, 0.4) : theme.palette.divider}`,
26538
26724
  display: "flex",
26539
26725
  flexDirection: "column",
26540
26726
  height: isMobile ? `calc(100dvh - ${theme.spacing(4)})` : "100dvh",
@@ -26542,7 +26728,7 @@ var init_conversation_drawer = __esm({
26542
26728
  bottom: isMobile ? theme.spacing(2) : 0,
26543
26729
  left: 0,
26544
26730
  borderRadius: isMobile ? `0 ${drawerCornerRadius}px ${drawerCornerRadius}px 0` : 0,
26545
- boxShadow: isMobile ? `0 18px 36px ${(0, import_material44.alpha)(theme.palette.common.black, 0.28)}` : "none",
26731
+ boxShadow: isMobile ? `0 18px 36px ${(0, import_material45.alpha)(theme.palette.common.black, 0.28)}` : "none",
26546
26732
  overflow: "hidden"
26547
26733
  }
26548
26734
  },
@@ -26562,8 +26748,8 @@ var init_conversation_drawer = __esm({
26562
26748
  }
26563
26749
  },
26564
26750
  children: [
26565
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
26566
- import_material44.Box,
26751
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
26752
+ import_material45.Box,
26567
26753
  {
26568
26754
  sx: {
26569
26755
  p: 2,
@@ -26574,8 +26760,8 @@ var init_conversation_drawer = __esm({
26574
26760
  gap: 1
26575
26761
  },
26576
26762
  children: [
26577
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Tooltip, { title: "Memories", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26578
- import_material44.IconButton,
26763
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Tooltip, { title: "Memories", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
26764
+ import_material45.IconButton,
26579
26765
  {
26580
26766
  onClick: () => setMemoryModalOpen(true),
26581
26767
  size: "small",
@@ -26584,14 +26770,14 @@ var init_conversation_drawer = __esm({
26584
26770
  color: theme.palette.text.secondary,
26585
26771
  "&:hover": {
26586
26772
  color: theme.palette.primary.main,
26587
- bgcolor: (0, import_material44.alpha)(theme.palette.primary.main, 0.1)
26773
+ bgcolor: (0, import_material45.alpha)(theme.palette.primary.main, 0.1)
26588
26774
  }
26589
26775
  },
26590
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react11.Brain, {})
26776
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.Brain, {})
26591
26777
  }
26592
26778
  ) }),
26593
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Tooltip, { title: tooltip("manageProjects"), arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26594
- import_material44.IconButton,
26779
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Tooltip, { title: tooltip("manageProjects"), arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
26780
+ import_material45.IconButton,
26595
26781
  {
26596
26782
  onClick: () => setProjectManagementOpen(true),
26597
26783
  size: "small",
@@ -26600,14 +26786,14 @@ var init_conversation_drawer = __esm({
26600
26786
  color: theme.palette.text.secondary,
26601
26787
  "&:hover": {
26602
26788
  color: theme.palette.primary.main,
26603
- bgcolor: (0, import_material44.alpha)(theme.palette.primary.main, 0.1)
26789
+ bgcolor: (0, import_material45.alpha)(theme.palette.primary.main, 0.1)
26604
26790
  }
26605
26791
  },
26606
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react11.Folder, {})
26792
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.Folder, {})
26607
26793
  }
26608
26794
  ) }),
26609
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Tooltip, { title: tooltip("conversationOptions"), arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26610
- import_material44.IconButton,
26795
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Tooltip, { title: tooltip("conversationOptions"), arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
26796
+ import_material45.IconButton,
26611
26797
  {
26612
26798
  onClick: handleMenuOpen,
26613
26799
  size: "small",
@@ -26616,14 +26802,14 @@ var init_conversation_drawer = __esm({
26616
26802
  color: theme.palette.text.secondary,
26617
26803
  "&:hover": {
26618
26804
  color: theme.palette.text.primary,
26619
- bgcolor: (0, import_material44.alpha)(theme.palette.text.primary, 0.1)
26805
+ bgcolor: (0, import_material45.alpha)(theme.palette.text.primary, 0.1)
26620
26806
  }
26621
26807
  },
26622
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react11.MoreVertical, {})
26808
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.MoreVertical, {})
26623
26809
  }
26624
26810
  ) }),
26625
- isMobile && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Tooltip, { title: tooltip("closeConversationsPanel"), children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26626
- import_material44.IconButton,
26811
+ isMobile && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Tooltip, { title: tooltip("closeConversationsPanel"), children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
26812
+ import_material45.IconButton,
26627
26813
  {
26628
26814
  onClick: (e) => {
26629
26815
  e.preventDefault();
@@ -26636,17 +26822,17 @@ var init_conversation_drawer = __esm({
26636
26822
  color: theme.palette.text.secondary,
26637
26823
  "&:hover": {
26638
26824
  color: theme.palette.error.main,
26639
- bgcolor: (0, import_material44.alpha)(theme.palette.error.main, 0.1)
26825
+ bgcolor: (0, import_material45.alpha)(theme.palette.error.main, 0.1)
26640
26826
  }
26641
26827
  },
26642
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react11.X, {})
26828
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.X, {})
26643
26829
  }
26644
26830
  ) })
26645
26831
  ]
26646
26832
  }
26647
26833
  ),
26648
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Box, { sx: { p: 2, pb: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26649
- import_material44.TextField,
26834
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Box, { sx: { p: 2, pb: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
26835
+ import_material45.TextField,
26650
26836
  {
26651
26837
  fullWidth: true,
26652
26838
  size: "small",
@@ -26655,24 +26841,24 @@ var init_conversation_drawer = __esm({
26655
26841
  onChange: (e) => setSearchQuery(e.target.value),
26656
26842
  variant: "outlined",
26657
26843
  InputProps: {
26658
- startAdornment: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.InputAdornment, { position: "start", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react11.Search, { size: 16, color: theme.palette.text.secondary }) }),
26659
- endAdornment: searchQuery && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.InputAdornment, { position: "end", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Tooltip, { title: tooltip("clearSearch"), children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26660
- import_material44.IconButton,
26844
+ startAdornment: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.InputAdornment, { position: "start", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.Search, { size: 16, color: theme.palette.text.secondary }) }),
26845
+ endAdornment: searchQuery && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.InputAdornment, { position: "end", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Tooltip, { title: tooltip("clearSearch"), children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
26846
+ import_material45.IconButton,
26661
26847
  {
26662
26848
  onClick: handleSearchClear,
26663
26849
  size: "small",
26664
26850
  edge: "end",
26665
26851
  "aria-label": tooltip("clearSearch"),
26666
26852
  sx: { color: theme.palette.text.secondary },
26667
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react11.X, { size: 16 })
26853
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.X, { size: 16 })
26668
26854
  }
26669
26855
  ) }) })
26670
26856
  },
26671
26857
  sx: {
26672
26858
  "& .MuiOutlinedInput-root": {
26673
- bgcolor: (0, import_material44.alpha)(theme.palette.background.default, 0.5),
26859
+ bgcolor: (0, import_material45.alpha)(theme.palette.background.default, 0.5),
26674
26860
  "&:hover": {
26675
- bgcolor: (0, import_material44.alpha)(theme.palette.background.default, 0.8)
26861
+ bgcolor: (0, import_material45.alpha)(theme.palette.background.default, 0.8)
26676
26862
  },
26677
26863
  "&.Mui-focused": {
26678
26864
  bgcolor: theme.palette.background.default
@@ -26681,9 +26867,9 @@ var init_conversation_drawer = __esm({
26681
26867
  }
26682
26868
  }
26683
26869
  ) }),
26684
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { flex: 1, overflow: "auto", display: "flex", flexDirection: "column" }, children: [
26685
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
26686
- import_material44.Box,
26870
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Box, { sx: { flex: 1, overflow: "auto", display: "flex", flexDirection: "column" }, children: [
26871
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
26872
+ import_material45.Box,
26687
26873
  {
26688
26874
  onClick: async () => {
26689
26875
  const names = new Set(projects.map((p) => p.name));
@@ -26714,49 +26900,49 @@ var init_conversation_drawer = __esm({
26714
26900
  alignItems: "center",
26715
26901
  gap: 1.5,
26716
26902
  cursor: "pointer",
26717
- "&:hover": { bgcolor: (0, import_material44.alpha)(theme.palette.text.primary, 0.04) }
26903
+ "&:hover": { bgcolor: (0, import_material45.alpha)(theme.palette.text.primary, 0.04) }
26718
26904
  },
26719
26905
  children: [
26720
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26721
- import_material44.Box,
26906
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
26907
+ import_material45.Box,
26722
26908
  {
26723
26909
  sx: {
26724
26910
  width: 28,
26725
26911
  height: 28,
26726
26912
  borderRadius: "50%",
26727
- bgcolor: (0, import_material44.alpha)(theme.palette.success.main, 0.15),
26913
+ bgcolor: (0, import_material45.alpha)(theme.palette.success.main, 0.15),
26728
26914
  display: "flex",
26729
26915
  alignItems: "center",
26730
26916
  justifyContent: "center",
26731
26917
  flexShrink: 0
26732
26918
  },
26733
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react11.Folder, { size: 16, color: theme.palette.success.main })
26919
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.Folder, { size: 16, color: theme.palette.success.main })
26734
26920
  }
26735
26921
  ),
26736
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26737
- import_material44.Typography,
26922
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
26923
+ import_material45.Typography,
26738
26924
  {
26739
26925
  variant: "subtitle2",
26740
26926
  sx: { flex: 1, fontWeight: 600, fontSize: "0.875rem" },
26741
26927
  children: "New Project"
26742
26928
  }
26743
26929
  ),
26744
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Tooltip, { title: tooltip("addProject"), arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26745
- import_material44.IconButton,
26930
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Tooltip, { title: tooltip("addProject"), arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
26931
+ import_material45.IconButton,
26746
26932
  {
26747
26933
  size: "small",
26748
26934
  "aria-label": tooltip("addProject"),
26749
26935
  sx: { color: theme.palette.success.main },
26750
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react11.Plus, { size: 16 })
26936
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.Plus, { size: 16 })
26751
26937
  }
26752
26938
  ) })
26753
26939
  ]
26754
26940
  }
26755
26941
  ),
26756
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Divider, { sx: { opacity: 0.3 } }),
26757
- filteredProjectGroups.map((group, index) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { children: [
26758
- group.id === null && filteredProjectGroups.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
26759
- import_material44.Box,
26942
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Divider, { sx: { opacity: 0.3 } }),
26943
+ filteredProjectGroups.map((group, index) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Box, { children: [
26944
+ group.id === null && filteredProjectGroups.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
26945
+ import_material45.Box,
26760
26946
  {
26761
26947
  sx: {
26762
26948
  py: 2,
@@ -26766,9 +26952,9 @@ var init_conversation_drawer = __esm({
26766
26952
  gap: 2
26767
26953
  },
26768
26954
  children: [
26769
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Divider, { sx: { flex: 1, opacity: 0.6 } }),
26770
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
26771
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26955
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Divider, { sx: { flex: 1, opacity: 0.6 } }),
26956
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
26957
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
26772
26958
  import_lucide_react11.Inbox,
26773
26959
  {
26774
26960
  size: 14,
@@ -26776,8 +26962,8 @@ var init_conversation_drawer = __esm({
26776
26962
  style: { opacity: 0.7 }
26777
26963
  }
26778
26964
  ),
26779
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26780
- import_material44.Typography,
26965
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
26966
+ import_material45.Typography,
26781
26967
  {
26782
26968
  variant: "caption",
26783
26969
  sx: {
@@ -26791,12 +26977,12 @@ var init_conversation_drawer = __esm({
26791
26977
  }
26792
26978
  )
26793
26979
  ] }),
26794
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Divider, { sx: { flex: 1, opacity: 0.6 } })
26980
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Divider, { sx: { flex: 1, opacity: 0.6 } })
26795
26981
  ]
26796
26982
  }
26797
26983
  ),
26798
- group.id !== null ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
26799
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26984
+ group.id !== null ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
26985
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
26800
26986
  project_header_default,
26801
26987
  {
26802
26988
  projectId: group.id,
@@ -26825,8 +27011,8 @@ var init_conversation_drawer = __esm({
26825
27011
  }
26826
27012
  }
26827
27013
  ),
26828
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Collapse, { in: !group.collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { pb: 1 }, children: [
26829
- group.conversations.map((conversation) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
27014
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Collapse, { in: !group.collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Box, { sx: { pb: 1 }, children: [
27015
+ group.conversations.map((conversation) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
26830
27016
  simple_conversation_item_default,
26831
27017
  {
26832
27018
  conversation,
@@ -26846,8 +27032,8 @@ var init_conversation_drawer = __esm({
26846
27032
  },
26847
27033
  conversation.id
26848
27034
  )),
26849
- group.conversations.length === 0 && !group.collapsed && group.id !== null && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
26850
- import_material44.Box,
27035
+ group.conversations.length === 0 && !group.collapsed && group.id !== null && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
27036
+ import_material45.Box,
26851
27037
  {
26852
27038
  sx: {
26853
27039
  p: 3,
@@ -26855,17 +27041,17 @@ var init_conversation_drawer = __esm({
26855
27041
  color: theme.palette.text.secondary
26856
27042
  },
26857
27043
  children: [
26858
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Typography, { variant: "body2", children: "No conversations in this project yet" }),
26859
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Typography, { variant: "caption", sx: { mt: 1, display: "block" }, children: "Drag conversations here or use the + button above" })
27044
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Typography, { variant: "body2", children: "No conversations in this project yet" }),
27045
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Typography, { variant: "caption", sx: { mt: 1, display: "block" }, children: "Drag conversations here or use the + button above" })
26860
27046
  ]
26861
27047
  }
26862
27048
  )
26863
27049
  ] }) }),
26864
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Divider, { sx: { opacity: 0.3 } })
27050
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Divider, { sx: { opacity: 0.3 } })
26865
27051
  ] }) : (
26866
27052
  // Special handling for ungrouped - no header, just conversations in scrollable area
26867
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26868
- import_material44.Box,
27053
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27054
+ import_material45.Box,
26869
27055
  {
26870
27056
  sx: {
26871
27057
  minHeight: 0,
@@ -26873,12 +27059,12 @@ var init_conversation_drawer = __esm({
26873
27059
  overflow: "auto",
26874
27060
  px: 1,
26875
27061
  py: 1,
26876
- bgcolor: (0, import_material44.alpha)(theme.palette.background.default, 0.3),
27062
+ bgcolor: (0, import_material45.alpha)(theme.palette.background.default, 0.3),
26877
27063
  borderRadius: "8px 8px 0 0",
26878
27064
  mx: 1,
26879
27065
  mb: 1
26880
27066
  },
26881
- children: group.conversations.map((conversation) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
27067
+ children: group.conversations.map((conversation) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
26882
27068
  simple_conversation_item_default,
26883
27069
  {
26884
27070
  conversation,
@@ -26902,8 +27088,8 @@ var init_conversation_drawer = __esm({
26902
27088
  )
26903
27089
  )
26904
27090
  ] }, group.id || "ungrouped")),
26905
- filteredProjectGroups.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
26906
- import_material44.Box,
27091
+ filteredProjectGroups.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
27092
+ import_material45.Box,
26907
27093
  {
26908
27094
  sx: {
26909
27095
  flex: 1,
@@ -26916,14 +27102,14 @@ var init_conversation_drawer = __esm({
26916
27102
  color: theme.palette.text.secondary
26917
27103
  },
26918
27104
  children: [
26919
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Typography, { variant: "h6", sx: { mb: 1 }, children: searchQuery ? "No conversations found" : "No conversations yet" }),
26920
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Typography, { variant: "body2", sx: { mb: 3, maxWidth: 280 }, children: searchQuery ? `No conversations match "${searchQuery}"` : "Start your first conversation to begin organizing your chats into projects" })
27105
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Typography, { variant: "h6", sx: { mb: 1 }, children: searchQuery ? "No conversations found" : "No conversations yet" }),
27106
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Typography, { variant: "body2", sx: { mb: 3, maxWidth: 280 }, children: searchQuery ? `No conversations match "${searchQuery}"` : "Start your first conversation to begin organizing your chats into projects" })
26921
27107
  ]
26922
27108
  }
26923
27109
  )
26924
27110
  ] }),
26925
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
26926
- import_material44.Box,
27111
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
27112
+ import_material45.Box,
26927
27113
  {
26928
27114
  onClick: user2 ? () => {
26929
27115
  window.location.href = "/profile";
@@ -26933,19 +27119,19 @@ var init_conversation_drawer = __esm({
26933
27119
  mt: "auto",
26934
27120
  px: 2,
26935
27121
  py: 1.75,
26936
- borderTop: `1px solid ${(0, import_material44.alpha)(theme.palette.divider, 0.6)}`,
27122
+ borderTop: `1px solid ${(0, import_material45.alpha)(theme.palette.divider, 0.6)}`,
26937
27123
  display: "flex",
26938
27124
  alignItems: "center",
26939
27125
  gap: 1.5,
26940
27126
  justifyContent: "center",
26941
- bgcolor: (0, import_material44.alpha)(theme.palette.background.default, isMobile ? 0.9 : 0.6),
27127
+ bgcolor: (0, import_material45.alpha)(theme.palette.background.default, isMobile ? 0.9 : 0.6),
26942
27128
  cursor: user2 ? "pointer" : "default",
26943
27129
  transition: "background-color 0.15s ease",
26944
- "&:hover": user2 ? { bgcolor: (0, import_material44.alpha)(theme.palette.primary.main, 0.08) } : void 0
27130
+ "&:hover": user2 ? { bgcolor: (0, import_material45.alpha)(theme.palette.primary.main, 0.08) } : void 0
26945
27131
  },
26946
27132
  children: [
26947
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26948
- import_material44.Avatar,
27133
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27134
+ import_material45.Avatar,
26949
27135
  {
26950
27136
  src: avatarImage,
26951
27137
  alt: avatarLabel,
@@ -26953,14 +27139,14 @@ var init_conversation_drawer = __esm({
26953
27139
  width: 36,
26954
27140
  height: 36,
26955
27141
  fontSize: "0.95rem",
26956
- bgcolor: (0, import_material44.alpha)(theme.palette.primary.main, 0.12),
27142
+ bgcolor: (0, import_material45.alpha)(theme.palette.primary.main, 0.12),
26957
27143
  color: theme.palette.primary.main
26958
27144
  },
26959
27145
  children: avatarInitials
26960
27146
  }
26961
27147
  ),
26962
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
26963
- import_material44.Box,
27148
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
27149
+ import_material45.Box,
26964
27150
  {
26965
27151
  sx: {
26966
27152
  minWidth: 0,
@@ -26972,8 +27158,8 @@ var init_conversation_drawer = __esm({
26972
27158
  gap: 0.25
26973
27159
  },
26974
27160
  children: [
26975
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26976
- import_material44.Typography,
27161
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27162
+ import_material45.Typography,
26977
27163
  {
26978
27164
  variant: "subtitle2",
26979
27165
  noWrap: true,
@@ -26981,8 +27167,8 @@ var init_conversation_drawer = __esm({
26981
27167
  children: user2 ? userDisplayName : "Not signed in"
26982
27168
  }
26983
27169
  ),
26984
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26985
- import_material44.Typography,
27170
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27171
+ import_material45.Typography,
26986
27172
  {
26987
27173
  variant: "caption",
26988
27174
  noWrap: true,
@@ -26993,9 +27179,9 @@ var init_conversation_drawer = __esm({
26993
27179
  ]
26994
27180
  }
26995
27181
  ),
26996
- user2 && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
26997
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
26998
- import_material44.Box,
27182
+ user2 && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
27183
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27184
+ import_material45.Box,
26999
27185
  {
27000
27186
  sx: {
27001
27187
  flexShrink: 0,
@@ -27005,14 +27191,14 @@ var init_conversation_drawer = __esm({
27005
27191
  width: 30,
27006
27192
  height: 30,
27007
27193
  borderRadius: "50%",
27008
- border: `1px solid ${(0, import_material44.alpha)(theme.palette.divider, 0.8)}`,
27194
+ border: `1px solid ${(0, import_material45.alpha)(theme.palette.divider, 0.8)}`,
27009
27195
  color: theme.palette.text.secondary
27010
27196
  },
27011
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react11.Settings, { size: 16 })
27197
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.Settings, { size: 16 })
27012
27198
  }
27013
27199
  ),
27014
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
27015
- import_material44.IconButton,
27200
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27201
+ import_material45.IconButton,
27016
27202
  {
27017
27203
  "aria-label": "Sign out",
27018
27204
  title: "Sign out",
@@ -27025,11 +27211,11 @@ var init_conversation_drawer = __esm({
27025
27211
  flexShrink: 0,
27026
27212
  width: 30,
27027
27213
  height: 30,
27028
- border: `1px solid ${(0, import_material44.alpha)(theme.palette.error.main, 0.4)}`,
27214
+ border: `1px solid ${(0, import_material45.alpha)(theme.palette.error.main, 0.4)}`,
27029
27215
  color: theme.palette.error.main,
27030
- "&:hover": { bgcolor: (0, import_material44.alpha)(theme.palette.error.main, 0.1) }
27216
+ "&:hover": { bgcolor: (0, import_material45.alpha)(theme.palette.error.main, 0.1) }
27031
27217
  },
27032
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react11.LogOut, { size: 16 })
27218
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.LogOut, { size: 16 })
27033
27219
  }
27034
27220
  )
27035
27221
  ] })
@@ -27039,15 +27225,15 @@ var init_conversation_drawer = __esm({
27039
27225
  ]
27040
27226
  }
27041
27227
  ),
27042
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
27228
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27043
27229
  project_management_modal_default,
27044
27230
  {
27045
27231
  open: projectManagementOpen,
27046
27232
  onClose: () => setProjectManagementOpen(false)
27047
27233
  }
27048
27234
  ),
27049
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(memory_modal_default, { open: memoryModalOpen, onClose: () => setMemoryModalOpen(false) }),
27050
- conversationToMove && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
27235
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(memory_modal_default, { open: memoryModalOpen, onClose: () => setMemoryModalOpen(false) }),
27236
+ conversationToMove && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27051
27237
  move_conversation_modal_default,
27052
27238
  {
27053
27239
  open: moveModalOpen,
@@ -27056,8 +27242,8 @@ var init_conversation_drawer = __esm({
27056
27242
  currentProjectId: conversationToMove.projectId
27057
27243
  }
27058
27244
  ),
27059
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
27060
- import_material44.Menu,
27245
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27246
+ import_material45.Menu,
27061
27247
  {
27062
27248
  anchorEl: menuAnchorEl,
27063
27249
  open: Boolean(menuAnchorEl),
@@ -27070,8 +27256,8 @@ var init_conversation_drawer = __esm({
27070
27256
  vertical: "bottom",
27071
27257
  horizontal: "right"
27072
27258
  },
27073
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
27074
- import_material44.MenuItem,
27259
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
27260
+ import_material45.MenuItem,
27075
27261
  {
27076
27262
  onClick: () => {
27077
27263
  setClearConfirmOpen(true);
@@ -27079,27 +27265,27 @@ var init_conversation_drawer = __esm({
27079
27265
  },
27080
27266
  sx: { color: theme.palette.error.main },
27081
27267
  children: [
27082
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react11.Trash2, { size: 16, color: theme.palette.error.main }) }),
27083
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.ListItemText, { children: "Clear All Conversations" })
27268
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react11.Trash2, { size: 16, color: theme.palette.error.main }) }),
27269
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.ListItemText, { children: "Clear All Conversations" })
27084
27270
  ]
27085
27271
  }
27086
27272
  )
27087
27273
  }
27088
27274
  ),
27089
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
27090
- import_material44.Dialog,
27275
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
27276
+ import_material45.Dialog,
27091
27277
  {
27092
27278
  open: clearConfirmOpen,
27093
27279
  onClose: () => setClearConfirmOpen(false),
27094
27280
  maxWidth: "sm",
27095
27281
  fullWidth: true,
27096
27282
  children: [
27097
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.DialogTitle, { children: "Clear All Conversations?" }),
27098
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.DialogContent, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Typography, { children: "This will permanently delete all conversations and cannot be undone. Are you sure you want to continue?" }) }),
27099
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.DialogActions, { children: [
27100
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Button, { onClick: () => setClearConfirmOpen(false), children: "Cancel" }),
27101
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
27102
- import_material44.Button,
27283
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.DialogTitle, { children: "Clear All Conversations?" }),
27284
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.DialogContent, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Typography, { children: "This will permanently delete all conversations and cannot be undone. Are you sure you want to continue?" }) }),
27285
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.DialogActions, { children: [
27286
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Button, { onClick: () => setClearConfirmOpen(false), children: "Cancel" }),
27287
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27288
+ import_material45.Button,
27103
27289
  {
27104
27290
  onClick: handleClearAllConfirm,
27105
27291
  color: "error",
@@ -27118,12 +27304,12 @@ var init_conversation_drawer = __esm({
27118
27304
  });
27119
27305
 
27120
27306
  // src/chat/enhanced-mobile-conversations-modal.tsx
27121
- var import_react56, import_material45, import_lucide_react12, import_styles29, import_jsx_runtime45, BANDIT_AVATAR2, coerceOptionalString2, deriveInitials2, EnhancedMobileConversationsModal, enhanced_mobile_conversations_modal_default;
27307
+ var import_react57, import_material46, import_lucide_react12, import_styles29, import_jsx_runtime46, BANDIT_AVATAR2, coerceOptionalString2, deriveInitials2, EnhancedMobileConversationsModal, enhanced_mobile_conversations_modal_default;
27122
27308
  var init_enhanced_mobile_conversations_modal = __esm({
27123
27309
  "src/chat/enhanced-mobile-conversations-modal.tsx"() {
27124
27310
  "use strict";
27125
- import_react56 = require("react");
27126
- import_material45 = require("@mui/material");
27311
+ import_react57 = require("react");
27312
+ import_material46 = require("@mui/material");
27127
27313
  import_lucide_react12 = require("lucide-react");
27128
27314
  import_styles29 = require("@mui/material/styles");
27129
27315
  init_conversationStore();
@@ -27138,7 +27324,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
27138
27324
  init_simple_conversation_item();
27139
27325
  init_project_header();
27140
27326
  init_debugLogger();
27141
- import_jsx_runtime45 = require("react/jsx-runtime");
27327
+ import_jsx_runtime46 = require("react/jsx-runtime");
27142
27328
  BANDIT_AVATAR2 = "https://cdn.burtson.ai/images/bandit-head.png";
27143
27329
  coerceOptionalString2 = (value) => {
27144
27330
  if (typeof value !== "string") return void 0;
@@ -27189,25 +27375,25 @@ var init_enhanced_mobile_conversations_modal = __esm({
27189
27375
  createProject,
27190
27376
  deleteProject
27191
27377
  } = useProjectStore();
27192
- const [projectManagementOpen, setProjectManagementOpen] = (0, import_react56.useState)(false);
27193
- const [memoryModalOpen, setMemoryModalOpen] = (0, import_react56.useState)(false);
27194
- const [collapsedProjects, setCollapsedProjects] = (0, import_react56.useState)(/* @__PURE__ */ new Set());
27195
- const didInitCollapseRef = (0, import_react56.useRef)(false);
27196
- const [searchQuery, setSearchQuery] = (0, import_react56.useState)("");
27197
- const [menuAnchorEl, setMenuAnchorEl] = (0, import_react56.useState)(null);
27198
- const [clearConfirmOpen, setClearConfirmOpen] = (0, import_react56.useState)(false);
27199
- const [moveModalOpen, setMoveModalOpen] = (0, import_react56.useState)(false);
27200
- const [conversationToMove, setConversationToMove] = (0, import_react56.useState)(null);
27201
- const [renameProjectId, setRenameProjectId] = (0, import_react56.useState)(null);
27202
- const [deletedConversationIds, setDeletedConversationIds] = (0, import_react56.useState)(/* @__PURE__ */ new Set());
27203
- const [touchDragState, setTouchDragState] = (0, import_react56.useState)({ conversationId: null, originProjectId: null, hoverProjectId: null });
27204
- const [avatarImage, setAvatarImage] = (0, import_react56.useState)(BANDIT_AVATAR2);
27205
- const getCustomClaim = (0, import_react56.useCallback)((key) => {
27378
+ const [projectManagementOpen, setProjectManagementOpen] = (0, import_react57.useState)(false);
27379
+ const [memoryModalOpen, setMemoryModalOpen] = (0, import_react57.useState)(false);
27380
+ const [collapsedProjects, setCollapsedProjects] = (0, import_react57.useState)(/* @__PURE__ */ new Set());
27381
+ const didInitCollapseRef = (0, import_react57.useRef)(false);
27382
+ const [searchQuery, setSearchQuery] = (0, import_react57.useState)("");
27383
+ const [menuAnchorEl, setMenuAnchorEl] = (0, import_react57.useState)(null);
27384
+ const [clearConfirmOpen, setClearConfirmOpen] = (0, import_react57.useState)(false);
27385
+ const [moveModalOpen, setMoveModalOpen] = (0, import_react57.useState)(false);
27386
+ const [conversationToMove, setConversationToMove] = (0, import_react57.useState)(null);
27387
+ const [renameProjectId, setRenameProjectId] = (0, import_react57.useState)(null);
27388
+ const [deletedConversationIds, setDeletedConversationIds] = (0, import_react57.useState)(/* @__PURE__ */ new Set());
27389
+ const [touchDragState, setTouchDragState] = (0, import_react57.useState)({ conversationId: null, originProjectId: null, hoverProjectId: null });
27390
+ const [avatarImage, setAvatarImage] = (0, import_react57.useState)(BANDIT_AVATAR2);
27391
+ const getCustomClaim = (0, import_react57.useCallback)((key) => {
27206
27392
  if (!user2) return void 0;
27207
27393
  const record = user2;
27208
27394
  return coerceOptionalString2(record[key]);
27209
27395
  }, [user2]);
27210
- const userDisplayName = (0, import_react56.useMemo)(() => {
27396
+ const userDisplayName = (0, import_react57.useMemo)(() => {
27211
27397
  if (!user2) return void 0;
27212
27398
  const candidateFields = [
27213
27399
  coerceOptionalString2(user2.name),
@@ -27222,7 +27408,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
27222
27408
  if (trimmedEmail) return trimmedEmail;
27223
27409
  return user2.sub;
27224
27410
  }, [user2, getCustomClaim]);
27225
- const userSecondaryText = (0, import_react56.useMemo)(() => {
27411
+ const userSecondaryText = (0, import_react57.useMemo)(() => {
27226
27412
  if (!user2) return void 0;
27227
27413
  const trimmedEmail = coerceOptionalString2(user2.email);
27228
27414
  if (trimmedEmail && trimmedEmail !== userDisplayName) {
@@ -27234,7 +27420,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
27234
27420
  }
27235
27421
  return void 0;
27236
27422
  }, [user2, userDisplayName]);
27237
- (0, import_react56.useEffect)(() => {
27423
+ (0, import_react57.useEffect)(() => {
27238
27424
  if (!open) return;
27239
27425
  const fresh = readPersistedToken();
27240
27426
  const authStore = useAuthenticationStore.getState();
@@ -27279,18 +27465,18 @@ var init_enhanced_mobile_conversations_modal = __esm({
27279
27465
  };
27280
27466
  }, [open, getCustomClaim]);
27281
27467
  const avatarLabel = userDisplayName || user2?.email || "Bandit";
27282
- const avatarInitials = (0, import_react56.useMemo)(() => deriveInitials2(avatarLabel), [avatarLabel]);
27468
+ const avatarInitials = (0, import_react57.useMemo)(() => deriveInitials2(avatarLabel), [avatarLabel]);
27283
27469
  const buildSnippet = (text, query, idx) => {
27284
27470
  const start = Math.max(0, idx - 40);
27285
27471
  const end = Math.min(text.length, idx + query.length + 60);
27286
27472
  return text.slice(start, end).replace(/\s+/g, " ").trim();
27287
27473
  };
27288
- (0, import_react56.useEffect)(() => {
27474
+ (0, import_react57.useEffect)(() => {
27289
27475
  if (open && !projectsHydrated) {
27290
27476
  hydrateProjects();
27291
27477
  }
27292
27478
  }, [open, projectsHydrated, hydrateProjects]);
27293
- (0, import_react56.useEffect)(() => {
27479
+ (0, import_react57.useEffect)(() => {
27294
27480
  if (projectsHydrated && !didInitCollapseRef.current) {
27295
27481
  didInitCollapseRef.current = true;
27296
27482
  if (projects && projects.length > 0) {
@@ -27298,7 +27484,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
27298
27484
  }
27299
27485
  }
27300
27486
  }, [projectsHydrated, projects]);
27301
- const projectGroups = (0, import_react56.useMemo)(() => {
27487
+ const projectGroups = (0, import_react57.useMemo)(() => {
27302
27488
  const visibleConversations = conversations.filter(
27303
27489
  (conversation) => !deletedConversationIds.has(conversation.id)
27304
27490
  );
@@ -27324,11 +27510,11 @@ var init_enhanced_mobile_conversations_modal = __esm({
27324
27510
  }
27325
27511
  return groups.filter((group) => group.conversations.length > 0 || group.id !== null);
27326
27512
  }, [projects, conversations, collapsedProjects, deletedConversationIds]);
27327
- const visibleConversationCount = (0, import_react56.useMemo)(
27513
+ const visibleConversationCount = (0, import_react57.useMemo)(
27328
27514
  () => projectGroups.reduce((total, group) => total + group.conversations.length, 0),
27329
27515
  [projectGroups]
27330
27516
  );
27331
- const filteredProjectGroups = (0, import_react56.useMemo)(() => {
27517
+ const filteredProjectGroups = (0, import_react57.useMemo)(() => {
27332
27518
  if (!searchQuery.trim()) return projectGroups;
27333
27519
  const query = searchQuery.toLowerCase();
27334
27520
  return projectGroups.map((group) => {
@@ -27353,14 +27539,14 @@ var init_enhanced_mobile_conversations_modal = __esm({
27353
27539
  }).filter((group) => group.conversations.length > 0);
27354
27540
  }, [projectGroups, searchQuery]);
27355
27541
  const touchDragActive = Boolean(touchDragState.conversationId);
27356
- const getProjectIdFromPoint = (0, import_react56.useCallback)((clientX, clientY) => {
27542
+ const getProjectIdFromPoint = (0, import_react57.useCallback)((clientX, clientY) => {
27357
27543
  if (typeof document === "undefined") return null;
27358
27544
  const element = document.elementFromPoint(clientX, clientY);
27359
27545
  if (!element) return null;
27360
27546
  const projectNode = element.closest("[data-project-id]");
27361
27547
  return projectNode?.getAttribute("data-project-id") ?? null;
27362
27548
  }, []);
27363
- const handleTouchDragStart = (0, import_react56.useCallback)((conversation, touch) => {
27549
+ const handleTouchDragStart = (0, import_react57.useCallback)((conversation, touch) => {
27364
27550
  const initialHover = getProjectIdFromPoint(touch.clientX, touch.clientY);
27365
27551
  setTouchDragState({
27366
27552
  conversationId: conversation.id,
@@ -27368,7 +27554,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
27368
27554
  hoverProjectId: initialHover ?? (conversation.projectId ?? null)
27369
27555
  });
27370
27556
  }, [getProjectIdFromPoint]);
27371
- const handleTouchDragMove = (0, import_react56.useCallback)((touch) => {
27557
+ const handleTouchDragMove = (0, import_react57.useCallback)((touch) => {
27372
27558
  setTouchDragState((prev) => {
27373
27559
  if (!prev.conversationId) return prev;
27374
27560
  const hoverId = getProjectIdFromPoint(touch.clientX, touch.clientY);
@@ -27376,7 +27562,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
27376
27562
  return { ...prev, hoverProjectId: hoverId };
27377
27563
  });
27378
27564
  }, [getProjectIdFromPoint]);
27379
- const handleTouchDragEnd = (0, import_react56.useCallback)((touch) => {
27565
+ const handleTouchDragEnd = (0, import_react57.useCallback)((touch) => {
27380
27566
  setTouchDragState((prev) => {
27381
27567
  if (!prev.conversationId) {
27382
27568
  return { conversationId: null, originProjectId: null, hoverProjectId: null };
@@ -27404,11 +27590,11 @@ var init_enhanced_mobile_conversations_modal = __esm({
27404
27590
  return { conversationId: null, originProjectId: null, hoverProjectId: null };
27405
27591
  });
27406
27592
  }, [getProjectIdFromPoint, moveConversationToProject]);
27407
- const activeDragConversation = (0, import_react56.useMemo)(() => {
27593
+ const activeDragConversation = (0, import_react57.useMemo)(() => {
27408
27594
  if (!touchDragState.conversationId) return null;
27409
27595
  return conversations.find((conv) => conv.id === touchDragState.conversationId) || null;
27410
27596
  }, [touchDragState.conversationId, conversations]);
27411
- const activeHoverLabel = (0, import_react56.useMemo)(() => {
27597
+ const activeHoverLabel = (0, import_react57.useMemo)(() => {
27412
27598
  if (!touchDragState.hoverProjectId) return "";
27413
27599
  if (touchDragState.hoverProjectId === "__ungrouped") return "Ungrouped";
27414
27600
  const project = projects.find((p) => p.id === touchDragState.hoverProjectId);
@@ -27457,7 +27643,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
27457
27643
  setMoveModalOpen(false);
27458
27644
  setConversationToMove(null);
27459
27645
  };
27460
- (0, import_react56.useEffect)(() => {
27646
+ (0, import_react57.useEffect)(() => {
27461
27647
  setDeletedConversationIds((prev) => {
27462
27648
  let changed = false;
27463
27649
  const active2 = new Set(conversations.map((conv) => conv.id));
@@ -27472,9 +27658,9 @@ var init_enhanced_mobile_conversations_modal = __esm({
27472
27658
  return changed ? next : prev;
27473
27659
  });
27474
27660
  }, [conversations]);
27475
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
27476
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27477
- import_material45.Modal,
27661
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
27662
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
27663
+ import_material46.Modal,
27478
27664
  {
27479
27665
  open,
27480
27666
  onClose,
@@ -27482,8 +27668,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
27482
27668
  display: "flex",
27483
27669
  alignItems: "flex-end"
27484
27670
  },
27485
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Slide, { direction: "up", in: open, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
27486
- import_material45.Box,
27671
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Slide, { direction: "up", in: open, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
27672
+ import_material46.Box,
27487
27673
  {
27488
27674
  sx: {
27489
27675
  width: "100%",
@@ -27496,8 +27682,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
27496
27682
  overflow: "hidden"
27497
27683
  },
27498
27684
  children: [
27499
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27500
- import_material45.AppBar,
27685
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
27686
+ import_material46.AppBar,
27501
27687
  {
27502
27688
  position: "static",
27503
27689
  elevation: 0,
@@ -27506,10 +27692,10 @@ var init_enhanced_mobile_conversations_modal = __esm({
27506
27692
  color: theme.palette.text.primary,
27507
27693
  borderBottom: `1px solid ${theme.palette.divider}`
27508
27694
  },
27509
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Toolbar, { children: [
27510
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Typography, { variant: "h6", sx: { flex: 1, fontWeight: 600 }, children: "Conversations" }),
27511
- visibleConversationCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27512
- import_material45.Chip,
27695
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material46.Toolbar, { children: [
27696
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Typography, { variant: "h6", sx: { flex: 1, fontWeight: 600 }, children: "Conversations" }),
27697
+ visibleConversationCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
27698
+ import_material46.Chip,
27513
27699
  {
27514
27700
  label: visibleConversationCount,
27515
27701
  size: "small",
@@ -27521,44 +27707,44 @@ var init_enhanced_mobile_conversations_modal = __esm({
27521
27707
  }
27522
27708
  }
27523
27709
  ),
27524
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27525
- import_material45.IconButton,
27710
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
27711
+ import_material46.IconButton,
27526
27712
  {
27527
27713
  onClick: () => setMemoryModalOpen(true),
27528
27714
  "aria-label": "Memory",
27529
27715
  sx: { color: theme.palette.text.secondary },
27530
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react12.Brain, {})
27716
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.Brain, {})
27531
27717
  }
27532
27718
  ),
27533
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27534
- import_material45.IconButton,
27719
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
27720
+ import_material46.IconButton,
27535
27721
  {
27536
27722
  onClick: () => setProjectManagementOpen(true),
27537
27723
  sx: { color: theme.palette.text.secondary },
27538
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react12.Folder, {})
27724
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.Folder, {})
27539
27725
  }
27540
27726
  ),
27541
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27542
- import_material45.IconButton,
27727
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
27728
+ import_material46.IconButton,
27543
27729
  {
27544
27730
  onClick: handleMenuOpen,
27545
27731
  sx: { color: theme.palette.text.secondary },
27546
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react12.MoreVertical, {})
27732
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.MoreVertical, {})
27547
27733
  }
27548
27734
  ),
27549
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27550
- import_material45.IconButton,
27735
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
27736
+ import_material46.IconButton,
27551
27737
  {
27552
27738
  onClick: onClose,
27553
27739
  sx: { color: theme.palette.text.secondary },
27554
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react12.X, {})
27740
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.X, {})
27555
27741
  }
27556
27742
  )
27557
27743
  ] })
27558
27744
  }
27559
27745
  ),
27560
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Box, { sx: { p: 2, pb: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27561
- import_material45.TextField,
27746
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Box, { sx: { p: 2, pb: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
27747
+ import_material46.TextField,
27562
27748
  {
27563
27749
  fullWidth: true,
27564
27750
  size: "small",
@@ -27567,22 +27753,22 @@ var init_enhanced_mobile_conversations_modal = __esm({
27567
27753
  onChange: (e) => setSearchQuery(e.target.value),
27568
27754
  variant: "outlined",
27569
27755
  InputProps: {
27570
- startAdornment: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.InputAdornment, { position: "start", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react12.Search, { size: 16, color: theme.palette.text.secondary }) }),
27571
- endAdornment: searchQuery && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.InputAdornment, { position: "end", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27572
- import_material45.IconButton,
27756
+ startAdornment: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.InputAdornment, { position: "start", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.Search, { size: 16, color: theme.palette.text.secondary }) }),
27757
+ endAdornment: searchQuery && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.InputAdornment, { position: "end", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
27758
+ import_material46.IconButton,
27573
27759
  {
27574
27760
  onClick: handleSearchClear,
27575
27761
  size: "small",
27576
27762
  edge: "end",
27577
27763
  sx: { color: theme.palette.text.secondary },
27578
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react12.X, { size: 16 })
27764
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.X, { size: 16 })
27579
27765
  }
27580
27766
  ) })
27581
27767
  }
27582
27768
  }
27583
27769
  ) }),
27584
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
27585
- import_material45.Box,
27770
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
27771
+ import_material46.Box,
27586
27772
  {
27587
27773
  sx: {
27588
27774
  flex: 1,
@@ -27593,8 +27779,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
27593
27779
  pb: 2
27594
27780
  },
27595
27781
  children: [
27596
- touchDragActive && activeDragConversation && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
27597
- import_material45.Box,
27782
+ touchDragActive && activeDragConversation && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
27783
+ import_material46.Box,
27598
27784
  {
27599
27785
  sx: {
27600
27786
  position: "absolute",
@@ -27619,8 +27805,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
27619
27805
  overflow: "hidden"
27620
27806
  },
27621
27807
  children: [
27622
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
27623
- import_material45.Typography,
27808
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
27809
+ import_material46.Typography,
27624
27810
  {
27625
27811
  variant: "caption",
27626
27812
  sx: {
@@ -27632,8 +27818,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
27632
27818
  },
27633
27819
  children: [
27634
27820
  "Move",
27635
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
27636
- import_material45.Box,
27821
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
27822
+ import_material46.Box,
27637
27823
  {
27638
27824
  component: "span",
27639
27825
  sx: {
@@ -27653,8 +27839,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
27653
27839
  ]
27654
27840
  }
27655
27841
  ),
27656
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27657
- import_material45.Typography,
27842
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
27843
+ import_material46.Typography,
27658
27844
  {
27659
27845
  variant: "caption",
27660
27846
  color: "inherit",
@@ -27662,11 +27848,11 @@ var init_enhanced_mobile_conversations_modal = __esm({
27662
27848
  fontWeight: 500,
27663
27849
  whiteSpace: "nowrap"
27664
27850
  },
27665
- children: activeHoverLabel ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
27851
+ children: activeHoverLabel ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
27666
27852
  "to",
27667
27853
  " ",
27668
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27669
- import_material45.Box,
27854
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
27855
+ import_material46.Box,
27670
27856
  {
27671
27857
  component: "span",
27672
27858
  sx: {
@@ -27682,8 +27868,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
27682
27868
  ]
27683
27869
  }
27684
27870
  ),
27685
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
27686
- import_material45.Box,
27871
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
27872
+ import_material46.Box,
27687
27873
  {
27688
27874
  onClick: async () => {
27689
27875
  const names = new Set(projects.map((p) => p.name));
@@ -27717,8 +27903,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
27717
27903
  "&:hover": { bgcolor: (0, import_styles29.alpha)(theme.palette.text.primary, 0.04) }
27718
27904
  },
27719
27905
  children: [
27720
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27721
- import_material45.Box,
27906
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
27907
+ import_material46.Box,
27722
27908
  {
27723
27909
  sx: {
27724
27910
  width: 28,
@@ -27730,25 +27916,25 @@ var init_enhanced_mobile_conversations_modal = __esm({
27730
27916
  justifyContent: "center",
27731
27917
  flexShrink: 0
27732
27918
  },
27733
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react12.Folder, { size: 16, color: theme.palette.success.main })
27919
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.Folder, { size: 16, color: theme.palette.success.main })
27734
27920
  }
27735
27921
  ),
27736
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27737
- import_material45.Typography,
27922
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
27923
+ import_material46.Typography,
27738
27924
  {
27739
27925
  variant: "subtitle2",
27740
27926
  sx: { flex: 1, fontWeight: 600, fontSize: "0.875rem" },
27741
27927
  children: "New Project"
27742
27928
  }
27743
27929
  ),
27744
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.IconButton, { size: "small", sx: { color: theme.palette.success.main }, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react12.Plus, { size: 16 }) })
27930
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.IconButton, { size: "small", sx: { color: theme.palette.success.main }, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.Plus, { size: 16 }) })
27745
27931
  ]
27746
27932
  }
27747
27933
  ),
27748
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Divider, { sx: { opacity: 0.3 } }),
27749
- filteredProjectGroups.map((group, index) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Box, { children: [
27750
- group.id === null && filteredProjectGroups.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
27751
- import_material45.Box,
27934
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Divider, { sx: { opacity: 0.3 } }),
27935
+ filteredProjectGroups.map((group, index) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material46.Box, { children: [
27936
+ group.id === null && filteredProjectGroups.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
27937
+ import_material46.Box,
27752
27938
  {
27753
27939
  sx: {
27754
27940
  py: 2,
@@ -27758,9 +27944,9 @@ var init_enhanced_mobile_conversations_modal = __esm({
27758
27944
  gap: 2
27759
27945
  },
27760
27946
  children: [
27761
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Divider, { sx: { flex: 1, opacity: 0.6 } }),
27762
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
27763
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27947
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Divider, { sx: { flex: 1, opacity: 0.6 } }),
27948
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material46.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
27949
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
27764
27950
  import_lucide_react12.Inbox,
27765
27951
  {
27766
27952
  size: 14,
@@ -27768,8 +27954,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
27768
27954
  style: { opacity: 0.7 }
27769
27955
  }
27770
27956
  ),
27771
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27772
- import_material45.Typography,
27957
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
27958
+ import_material46.Typography,
27773
27959
  {
27774
27960
  variant: "caption",
27775
27961
  sx: {
@@ -27783,12 +27969,12 @@ var init_enhanced_mobile_conversations_modal = __esm({
27783
27969
  }
27784
27970
  )
27785
27971
  ] }),
27786
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Divider, { sx: { flex: 1, opacity: 0.6 } })
27972
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Divider, { sx: { flex: 1, opacity: 0.6 } })
27787
27973
  ]
27788
27974
  }
27789
27975
  ),
27790
- group.id !== null ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
27791
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27976
+ group.id !== null ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
27977
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
27792
27978
  project_header_default,
27793
27979
  {
27794
27980
  projectId: group.id,
@@ -27818,8 +28004,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
27818
28004
  isTouchTarget: touchDragActive && touchDragState.hoverProjectId === group.id
27819
28005
  }
27820
28006
  ),
27821
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Collapse, { in: !group.collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27822
- import_material45.Box,
28007
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Collapse, { in: !group.collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28008
+ import_material46.Box,
27823
28009
  {
27824
28010
  "data-project-id": group.id ?? "__ungrouped",
27825
28011
  sx: {
@@ -27829,7 +28015,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
27829
28015
  transition: "border 0.2s ease, background-color 0.2s ease",
27830
28016
  backgroundColor: touchDragActive && touchDragState.hoverProjectId === group.id ? (0, import_styles29.alpha)(theme.palette.primary.main, 0.08) : "transparent"
27831
28017
  },
27832
- children: group.conversations.map((conversation) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
28018
+ children: group.conversations.map((conversation) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
27833
28019
  simple_conversation_item_default,
27834
28020
  {
27835
28021
  conversation,
@@ -27863,8 +28049,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
27863
28049
  ) })
27864
28050
  ] }) : (
27865
28051
  // Special handling for ungrouped - no header, just conversations in scrollable area
27866
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27867
- import_material45.Box,
28052
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28053
+ import_material46.Box,
27868
28054
  {
27869
28055
  sx: {
27870
28056
  minHeight: 0,
@@ -27880,7 +28066,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
27880
28066
  backgroundColor: touchDragActive && touchDragState.hoverProjectId === "__ungrouped" ? (0, import_styles29.alpha)(theme.palette.primary.main, 0.08) : (0, import_styles29.alpha)(theme.palette.background.default, 0.3)
27881
28067
  },
27882
28068
  "data-project-id": "__ungrouped",
27883
- children: group.conversations.map((conversation) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
28069
+ children: group.conversations.map((conversation) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
27884
28070
  simple_conversation_item_default,
27885
28071
  {
27886
28072
  conversation,
@@ -27914,8 +28100,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
27914
28100
  )
27915
28101
  )
27916
28102
  ] }, group.id || "ungrouped")),
27917
- filteredProjectGroups.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
27918
- import_material45.Box,
28103
+ filteredProjectGroups.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
28104
+ import_material46.Box,
27919
28105
  {
27920
28106
  sx: {
27921
28107
  flex: 1,
@@ -27928,16 +28114,16 @@ var init_enhanced_mobile_conversations_modal = __esm({
27928
28114
  color: theme.palette.text.secondary
27929
28115
  },
27930
28116
  children: [
27931
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Typography, { variant: "h6", sx: { mb: 1 }, children: searchQuery ? "No conversations found" : "No conversations yet" }),
27932
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Typography, { variant: "body2", sx: { mb: 3, maxWidth: 280 }, children: searchQuery ? `No conversations match "${searchQuery}"` : "Start your first conversation to begin organizing your chats into projects" })
28117
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Typography, { variant: "h6", sx: { mb: 1 }, children: searchQuery ? "No conversations found" : "No conversations yet" }),
28118
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Typography, { variant: "body2", sx: { mb: 3, maxWidth: 280 }, children: searchQuery ? `No conversations match "${searchQuery}"` : "Start your first conversation to begin organizing your chats into projects" })
27933
28119
  ]
27934
28120
  }
27935
28121
  )
27936
28122
  ]
27937
28123
  }
27938
28124
  ),
27939
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
27940
- import_material45.Box,
28125
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
28126
+ import_material46.Box,
27941
28127
  {
27942
28128
  onClick: user2 ? () => {
27943
28129
  window.location.href = "/profile";
@@ -27954,8 +28140,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
27954
28140
  cursor: user2 ? "pointer" : "default"
27955
28141
  },
27956
28142
  children: [
27957
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27958
- import_material45.Avatar,
28143
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28144
+ import_material46.Avatar,
27959
28145
  {
27960
28146
  src: avatarImage,
27961
28147
  alt: avatarLabel,
@@ -27969,9 +28155,9 @@ var init_enhanced_mobile_conversations_modal = __esm({
27969
28155
  children: avatarInitials
27970
28156
  }
27971
28157
  ),
27972
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Box, { sx: { display: "flex", flexDirection: "column", flex: 1, minWidth: 0, gap: 0.25 }, children: [
27973
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27974
- import_material45.Typography,
28158
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material46.Box, { sx: { display: "flex", flexDirection: "column", flex: 1, minWidth: 0, gap: 0.25 }, children: [
28159
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28160
+ import_material46.Typography,
27975
28161
  {
27976
28162
  variant: "subtitle2",
27977
28163
  noWrap: true,
@@ -27979,8 +28165,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
27979
28165
  children: user2 ? userDisplayName : "Not signed in"
27980
28166
  }
27981
28167
  ),
27982
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27983
- import_material45.Typography,
28168
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28169
+ import_material46.Typography,
27984
28170
  {
27985
28171
  variant: "caption",
27986
28172
  noWrap: true,
@@ -27989,9 +28175,9 @@ var init_enhanced_mobile_conversations_modal = __esm({
27989
28175
  }
27990
28176
  )
27991
28177
  ] }),
27992
- user2 && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
27993
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
27994
- import_material45.Box,
28178
+ user2 && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
28179
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28180
+ import_material46.Box,
27995
28181
  {
27996
28182
  sx: {
27997
28183
  flexShrink: 0,
@@ -28004,11 +28190,11 @@ var init_enhanced_mobile_conversations_modal = __esm({
28004
28190
  border: `1px solid ${(0, import_styles29.alpha)(theme.palette.divider, 0.8)}`,
28005
28191
  color: theme.palette.text.secondary
28006
28192
  },
28007
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react12.Settings, { size: 16 })
28193
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.Settings, { size: 16 })
28008
28194
  }
28009
28195
  ),
28010
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
28011
- import_material45.IconButton,
28196
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28197
+ import_material46.IconButton,
28012
28198
  {
28013
28199
  "aria-label": "Sign out",
28014
28200
  title: "Sign out",
@@ -28025,7 +28211,7 @@ var init_enhanced_mobile_conversations_modal = __esm({
28025
28211
  color: theme.palette.error.main,
28026
28212
  "&:hover": { bgcolor: (0, import_styles29.alpha)(theme.palette.error.main, 0.1) }
28027
28213
  },
28028
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react12.LogOut, { size: 16 })
28214
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.LogOut, { size: 16 })
28029
28215
  }
28030
28216
  )
28031
28217
  ] })
@@ -28037,15 +28223,15 @@ var init_enhanced_mobile_conversations_modal = __esm({
28037
28223
  ) })
28038
28224
  }
28039
28225
  ),
28040
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
28226
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28041
28227
  project_management_modal_default,
28042
28228
  {
28043
28229
  open: projectManagementOpen,
28044
28230
  onClose: () => setProjectManagementOpen(false)
28045
28231
  }
28046
28232
  ),
28047
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(memory_modal_default, { open: memoryModalOpen, onClose: () => setMemoryModalOpen(false) }),
28048
- conversationToMove && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
28233
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(memory_modal_default, { open: memoryModalOpen, onClose: () => setMemoryModalOpen(false) }),
28234
+ conversationToMove && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28049
28235
  move_conversation_modal_default,
28050
28236
  {
28051
28237
  open: moveModalOpen,
@@ -28054,8 +28240,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
28054
28240
  currentProjectId: conversationToMove.projectId
28055
28241
  }
28056
28242
  ),
28057
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
28058
- import_material45.Menu,
28243
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28244
+ import_material46.Menu,
28059
28245
  {
28060
28246
  anchorEl: menuAnchorEl,
28061
28247
  open: Boolean(menuAnchorEl),
@@ -28068,8 +28254,8 @@ var init_enhanced_mobile_conversations_modal = __esm({
28068
28254
  vertical: "bottom",
28069
28255
  horizontal: "right"
28070
28256
  },
28071
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
28072
- import_material45.MenuItem,
28257
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
28258
+ import_material46.MenuItem,
28073
28259
  {
28074
28260
  onClick: () => {
28075
28261
  setClearConfirmOpen(true);
@@ -28078,27 +28264,27 @@ var init_enhanced_mobile_conversations_modal = __esm({
28078
28264
  disabled: visibleConversationCount === 0,
28079
28265
  sx: { color: theme.palette.error.main },
28080
28266
  children: [
28081
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react12.Trash2, { size: 16, color: theme.palette.error.main }) }),
28082
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.ListItemText, { children: "Clear All Conversations" })
28267
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react12.Trash2, { size: 16, color: theme.palette.error.main }) }),
28268
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.ListItemText, { children: "Clear All Conversations" })
28083
28269
  ]
28084
28270
  }
28085
28271
  )
28086
28272
  }
28087
28273
  ),
28088
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
28089
- import_material45.Dialog,
28274
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
28275
+ import_material46.Dialog,
28090
28276
  {
28091
28277
  open: clearConfirmOpen,
28092
28278
  onClose: () => setClearConfirmOpen(false),
28093
28279
  maxWidth: "sm",
28094
28280
  fullWidth: true,
28095
28281
  children: [
28096
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.DialogTitle, { children: "Clear All Conversations?" }),
28097
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.DialogContent, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Typography, { children: visibleConversationCount === 0 ? "No conversations available to clear." : `This will permanently delete ${visibleConversationCount} conversation${visibleConversationCount === 1 ? "" : "s"} and cannot be undone.` }) }),
28098
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.DialogActions, { children: [
28099
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Button, { onClick: () => setClearConfirmOpen(false), children: "Cancel" }),
28100
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
28101
- import_material45.Button,
28282
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.DialogTitle, { children: "Clear All Conversations?" }),
28283
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.DialogContent, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Typography, { children: visibleConversationCount === 0 ? "No conversations available to clear." : `This will permanently delete ${visibleConversationCount} conversation${visibleConversationCount === 1 ? "" : "s"} and cannot be undone.` }) }),
28284
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material46.DialogActions, { children: [
28285
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Button, { onClick: () => setClearConfirmOpen(false), children: "Cancel" }),
28286
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28287
+ import_material46.Button,
28102
28288
  {
28103
28289
  onClick: handleClearAllConfirm,
28104
28290
  color: "error",
@@ -28117,15 +28303,15 @@ var init_enhanced_mobile_conversations_modal = __esm({
28117
28303
  });
28118
28304
 
28119
28305
  // src/chat/chat-app-bar.tsx
28120
- var import_material46, import_react57, import_material47, import_react_router_dom2, import_shallow2, import_jsx_runtime46, CDN_BASE2, banditHead4, modelAvatars3, ChatAppBar, chat_app_bar_default;
28306
+ var import_material47, import_react58, import_material48, import_react_router_dom3, import_shallow2, import_jsx_runtime47, CDN_BASE2, banditHead4, modelAvatars3, ChatAppBar, chat_app_bar_default;
28121
28307
  var init_chat_app_bar = __esm({
28122
28308
  "src/chat/chat-app-bar.tsx"() {
28123
28309
  "use strict";
28124
- import_material46 = require("@mui/material");
28125
- init_modelStore();
28126
- import_react57 = require("react");
28127
28310
  import_material47 = require("@mui/material");
28128
- import_react_router_dom2 = require("react-router-dom");
28311
+ init_modelStore();
28312
+ import_react58 = require("react");
28313
+ import_material48 = require("@mui/material");
28314
+ import_react_router_dom3 = require("react-router-dom");
28129
28315
  init_lucide_icons();
28130
28316
  init_util();
28131
28317
  init_conversation_drawer();
@@ -28139,7 +28325,7 @@ var init_chat_app_bar = __esm({
28139
28325
  init_conversationSyncStore();
28140
28326
  init_engineStore();
28141
28327
  import_shallow2 = require("zustand/shallow");
28142
- import_jsx_runtime46 = require("react/jsx-runtime");
28328
+ import_jsx_runtime47 = require("react/jsx-runtime");
28143
28329
  CDN_BASE2 = "https://cdn.burtson.ai/";
28144
28330
  banditHead4 = `${CDN_BASE2}/images/bandit-head.png`;
28145
28331
  modelAvatars3 = {
@@ -28158,12 +28344,12 @@ var init_chat_app_bar = __esm({
28158
28344
  drawerOpen,
28159
28345
  setDrawerOpen
28160
28346
  }) => {
28161
- const theme = (0, import_material47.useTheme)();
28162
- const isMobile = (0, import_material47.useMediaQuery)(theme.breakpoints.down("sm"));
28163
- const hasLoggedRouterWarningRef = (0, import_react57.useRef)(false);
28347
+ const theme = (0, import_material48.useTheme)();
28348
+ const isMobile = (0, import_material48.useMediaQuery)(theme.breakpoints.down("sm"));
28349
+ const hasLoggedRouterWarningRef = (0, import_react58.useRef)(false);
28164
28350
  let navigate = null;
28165
28351
  try {
28166
- navigate = (0, import_react_router_dom2.useNavigate)();
28352
+ navigate = (0, import_react_router_dom3.useNavigate)();
28167
28353
  } catch (error) {
28168
28354
  if (!hasLoggedRouterWarningRef.current) {
28169
28355
  debugLogger.warn("ChatAppBar: Navigation not available (missing Router context)", { error });
@@ -28186,12 +28372,12 @@ var init_chat_app_bar = __esm({
28186
28372
  menuBackground,
28187
28373
  menuText
28188
28374
  } = theme.palette.chat.appBar;
28189
- const [modelAnchorEl, setModelAnchorEl] = (0, import_react57.useState)(null);
28190
- const [engineAnchorEl, setEngineAnchorEl] = (0, import_react57.useState)(null);
28191
- const [voiceAnchorEl, setVoiceAnchorEl] = (0, import_react57.useState)(null);
28192
- const [modalOpen, setModalOpen] = (0, import_react57.useState)(false);
28193
- const [confirmModelChangeOpen, setConfirmModelChangeOpen] = (0, import_react57.useState)(false);
28194
- const [pendingModel, setPendingModel] = (0, import_react57.useState)(null);
28375
+ const [modelAnchorEl, setModelAnchorEl] = (0, import_react58.useState)(null);
28376
+ const [engineAnchorEl, setEngineAnchorEl] = (0, import_react58.useState)(null);
28377
+ const [voiceAnchorEl, setVoiceAnchorEl] = (0, import_react58.useState)(null);
28378
+ const [modalOpen, setModalOpen] = (0, import_react58.useState)(false);
28379
+ const [confirmModelChangeOpen, setConfirmModelChangeOpen] = (0, import_react58.useState)(false);
28380
+ const [pendingModel, setPendingModel] = (0, import_react58.useState)(null);
28195
28381
  const { conversations, currentId, createNewConversation, _hasHydrated } = useConversationStore();
28196
28382
  const { preferences } = usePreferencesStore();
28197
28383
  const { settings: packageSettings } = usePackageSettingsStore();
@@ -28217,7 +28403,7 @@ var init_chat_app_bar = __esm({
28217
28403
  triggerSync: state.runSync,
28218
28404
  setSyncEnabled: state.setSyncEnabled
28219
28405
  }), import_shallow2.shallow);
28220
- (0, import_react57.useEffect)(() => {
28406
+ (0, import_react58.useEffect)(() => {
28221
28407
  if (isPlaygroundMode3 && syncEnabled) {
28222
28408
  void setSyncEnabled(false).catch((error) => {
28223
28409
  debugLogger.warn("ChatAppBar: Failed to disable sync in playground", {
@@ -28235,16 +28421,16 @@ var init_chat_app_bar = __esm({
28235
28421
  };
28236
28422
  const syncIndicatorIcon = (() => {
28237
28423
  if (isPlaygroundMode3 || !syncEnabled) {
28238
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(CloudOffIcon, { fontSize: "small", color: "disabled" });
28424
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(CloudOffIcon, { fontSize: "small", color: "disabled" });
28239
28425
  }
28240
28426
  switch (syncStatus) {
28241
28427
  case "syncing":
28242
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SyncIcon, { fontSize: "small", sx: syncSpinSx, color: "primary" });
28428
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SyncIcon, { fontSize: "small", sx: syncSpinSx, color: "primary" });
28243
28429
  case "error":
28244
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ErrorOutlineIcon, { fontSize: "small", color: "error" });
28430
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ErrorOutlineIcon, { fontSize: "small", color: "error" });
28245
28431
  case "idle":
28246
28432
  default:
28247
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(CloudDoneIcon, { fontSize: "small", color: "success" });
28433
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(CloudDoneIcon, { fontSize: "small", color: "success" });
28248
28434
  }
28249
28435
  })();
28250
28436
  const syncTooltip = (() => {
@@ -28321,7 +28507,7 @@ var init_chat_app_bar = __esm({
28321
28507
  const resolvedEngineId = currentEngine?.id ?? effectiveEngineId;
28322
28508
  const cleanEngineName = (name) => (name || "").replace(/\s*\([^)]*\)\s*$/, "").trim();
28323
28509
  const engineDisplay = cleanEngineName(currentEngine?.displayName) || "Engine";
28324
- (0, import_react57.useEffect)(() => {
28510
+ (0, import_react58.useEffect)(() => {
28325
28511
  useEngineStore.getState().fetchEngines();
28326
28512
  }, []);
28327
28513
  const pendingModelAvatar = useModelStore.getState().availableModels.find((m) => m.name === pendingModel)?.avatarBase64 || modelAvatars3[pendingModel || ""] || banditHead4;
@@ -28356,9 +28542,9 @@ var init_chat_app_bar = __esm({
28356
28542
  }
28357
28543
  safeNavigate("/");
28358
28544
  }
28359
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
28360
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
28361
- import_material47.Box,
28545
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
28546
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
28547
+ import_material48.Box,
28362
28548
  {
28363
28549
  sx: {
28364
28550
  position: "fixed",
@@ -28378,8 +28564,8 @@ var init_chat_app_bar = __esm({
28378
28564
  }
28379
28565
  },
28380
28566
  children: [
28381
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
28382
- import_material47.Box,
28567
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
28568
+ import_material48.Box,
28383
28569
  {
28384
28570
  sx: {
28385
28571
  display: "flex",
@@ -28399,17 +28585,17 @@ var init_chat_app_bar = __esm({
28399
28585
  }
28400
28586
  },
28401
28587
  children: [
28402
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Tooltip, { title: homeTooltip, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28403
- import_material47.IconButton,
28588
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Tooltip, { title: homeTooltip, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28589
+ import_material48.IconButton,
28404
28590
  {
28405
28591
  onClick: goToHome,
28406
28592
  sx: pillButtonStyles,
28407
28593
  "aria-label": "Go to home page",
28408
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(HomeIcon, {})
28594
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(HomeIcon, {})
28409
28595
  }
28410
28596
  ) }),
28411
- showLimitedAdminPanel() && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Tooltip, { title: "Management & Settings", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28412
- import_material47.IconButton,
28597
+ showLimitedAdminPanel() && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Tooltip, { title: "Management & Settings", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28598
+ import_material48.IconButton,
28413
28599
  {
28414
28600
  onClick: () => safeNavigate(managementPath),
28415
28601
  sx: {
@@ -28420,11 +28606,11 @@ var init_chat_app_bar = __esm({
28420
28606
  }
28421
28607
  },
28422
28608
  "aria-label": "Open management settings",
28423
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SettingsIcon, {})
28609
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SettingsIcon, {})
28424
28610
  }
28425
28611
  ) }),
28426
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Tooltip, { title: syncTooltip, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
28427
- import_material47.IconButton,
28612
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Tooltip, { title: syncTooltip, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
28613
+ import_material48.IconButton,
28428
28614
  {
28429
28615
  onClick: handleSyncBadgeClick,
28430
28616
  disabled: syncButtonDisabled,
@@ -28439,8 +28625,8 @@ var init_chat_app_bar = __esm({
28439
28625
  "aria-label": "Conversation sync status",
28440
28626
  children: [
28441
28627
  syncIndicatorIcon,
28442
- pendingCount > 0 && !syncButtonDisabled && syncStatus !== "syncing" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28443
- import_material47.Box,
28628
+ pendingCount > 0 && !syncButtonDisabled && syncStatus !== "syncing" && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28629
+ import_material48.Box,
28444
28630
  {
28445
28631
  sx: {
28446
28632
  position: "absolute",
@@ -28465,8 +28651,8 @@ var init_chat_app_bar = __esm({
28465
28651
  ]
28466
28652
  }
28467
28653
  ) }),
28468
- !isMobile && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Tooltip, { title: `${drawerOpen ? "Close" : "Open"} Conversations`, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
28469
- import_material47.IconButton,
28654
+ !isMobile && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Tooltip, { title: `${drawerOpen ? "Close" : "Open"} Conversations`, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
28655
+ import_material48.IconButton,
28470
28656
  {
28471
28657
  onClick: () => setDrawerOpen(!drawerOpen),
28472
28658
  sx: {
@@ -28479,9 +28665,9 @@ var init_chat_app_bar = __esm({
28479
28665
  "aria-label": `${drawerOpen ? "Close" : "Open"} conversations drawer`,
28480
28666
  "aria-pressed": drawerOpen,
28481
28667
  children: [
28482
- drawerOpen ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(NotesIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(NotesIconOutlined, {}),
28483
- conversations.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28484
- import_material47.Box,
28668
+ drawerOpen ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(NotesIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(NotesIconOutlined, {}),
28669
+ conversations.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28670
+ import_material48.Box,
28485
28671
  {
28486
28672
  sx: {
28487
28673
  position: "absolute",
@@ -28506,8 +28692,8 @@ var init_chat_app_bar = __esm({
28506
28692
  ]
28507
28693
  }
28508
28694
  ) }),
28509
- !isMobile && canShowNewConversationButton && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Tooltip, { title: "Start New Conversation", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28510
- import_material47.IconButton,
28695
+ !isMobile && canShowNewConversationButton && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Tooltip, { title: "Start New Conversation", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28696
+ import_material48.IconButton,
28511
28697
  {
28512
28698
  onClick: () => createNewConversation(),
28513
28699
  sx: {
@@ -28520,14 +28706,14 @@ var init_chat_app_bar = __esm({
28520
28706
  }
28521
28707
  },
28522
28708
  "aria-label": "Create new conversation",
28523
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AddIcon, {})
28709
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AddIcon, {})
28524
28710
  }
28525
28711
  ) })
28526
28712
  ]
28527
28713
  }
28528
28714
  ),
28529
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
28530
- import_material47.Box,
28715
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
28716
+ import_material48.Box,
28531
28717
  {
28532
28718
  sx: {
28533
28719
  display: "flex",
@@ -28547,8 +28733,8 @@ var init_chat_app_bar = __esm({
28547
28733
  }
28548
28734
  },
28549
28735
  children: [
28550
- isMobile && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Tooltip, { title: `Conversations (${conversations.length})`, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
28551
- import_material47.IconButton,
28736
+ isMobile && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Tooltip, { title: `Conversations (${conversations.length})`, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
28737
+ import_material48.IconButton,
28552
28738
  {
28553
28739
  onClick: () => setModalOpen(true),
28554
28740
  sx: {
@@ -28557,9 +28743,9 @@ var init_chat_app_bar = __esm({
28557
28743
  },
28558
28744
  "aria-label": `Open conversations modal with ${conversations.length} conversations`,
28559
28745
  children: [
28560
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(NotesIcon, { fontSize: "small" }),
28561
- conversations.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28562
- import_material47.Box,
28746
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(NotesIcon, { fontSize: "small" }),
28747
+ conversations.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28748
+ import_material48.Box,
28563
28749
  {
28564
28750
  sx: {
28565
28751
  position: "absolute",
@@ -28584,8 +28770,8 @@ var init_chat_app_bar = __esm({
28584
28770
  ]
28585
28771
  }
28586
28772
  ) }),
28587
- isMobile && canShowNewConversationButton && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Tooltip, { title: "Start New Conversation", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28588
- import_material47.IconButton,
28773
+ isMobile && canShowNewConversationButton && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Tooltip, { title: "Start New Conversation", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28774
+ import_material48.IconButton,
28589
28775
  {
28590
28776
  onClick: () => {
28591
28777
  createNewConversation();
@@ -28601,11 +28787,11 @@ var init_chat_app_bar = __esm({
28601
28787
  }
28602
28788
  },
28603
28789
  "aria-label": "Create new conversation",
28604
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AddIcon, { fontSize: "small" })
28790
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AddIcon, { fontSize: "small" })
28605
28791
  }
28606
28792
  ) }),
28607
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Tooltip, { title: `Current AI: ${selectedModel.replace("Bandit-", "")}`, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28608
- import_material47.IconButton,
28793
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Tooltip, { title: `Current AI: ${selectedModel.replace("Bandit-", "")}`, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28794
+ import_material48.IconButton,
28609
28795
  {
28610
28796
  onClick: (e) => setModelAnchorEl(e.currentTarget),
28611
28797
  sx: {
@@ -28619,8 +28805,8 @@ var init_chat_app_bar = __esm({
28619
28805
  }
28620
28806
  },
28621
28807
  "aria-label": `Change AI personality. Currently using ${selectedModel}`,
28622
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28623
- import_material46.Avatar,
28808
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28809
+ import_material47.Avatar,
28624
28810
  {
28625
28811
  src: currentAvatar,
28626
28812
  alt: selectedModel,
@@ -28636,17 +28822,17 @@ var init_chat_app_bar = __esm({
28636
28822
  )
28637
28823
  }
28638
28824
  ) }),
28639
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Tooltip, { title: `Engine \xB7 ${engineDisplay}`, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28640
- import_material47.IconButton,
28825
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Tooltip, { title: `Engine \xB7 ${engineDisplay}`, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28826
+ import_material48.IconButton,
28641
28827
  {
28642
28828
  onClick: (e) => setEngineAnchorEl(e.currentTarget),
28643
28829
  sx: pillButtonStyles,
28644
28830
  "aria-label": `Change base model (engine). Currently ${engineDisplay}`,
28645
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AutoAwesomeIcon, { fontSize: "small" })
28831
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AutoAwesomeIcon, { fontSize: "small" })
28646
28832
  }
28647
28833
  ) }),
28648
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
28649
- import_material47.Menu,
28834
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
28835
+ import_material48.Menu,
28650
28836
  {
28651
28837
  anchorEl: engineAnchorEl,
28652
28838
  open: Boolean(engineAnchorEl),
@@ -28654,8 +28840,8 @@ var init_chat_app_bar = __esm({
28654
28840
  transformOrigin: { horizontal: "right", vertical: "top" },
28655
28841
  anchorOrigin: { horizontal: "right", vertical: "bottom" },
28656
28842
  children: [
28657
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Typography, { variant: "overline", sx: { px: 2, color: theme.palette.text.secondary }, children: "Engine \xB7 base model" }),
28658
- engines.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.MenuItem, { disabled: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Typography, { variant: "body2", children: "No engines available" }) }),
28843
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Typography, { variant: "overline", sx: { px: 2, color: theme.palette.text.secondary }, children: "Engine \xB7 base model" }),
28844
+ engines.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.MenuItem, { disabled: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Typography, { variant: "body2", children: "No engines available" }) }),
28659
28845
  engines.map((engine) => {
28660
28846
  const badges = [
28661
28847
  engine.vision && "vision",
@@ -28664,8 +28850,8 @@ var init_chat_app_bar = __esm({
28664
28850
  engine.cloud && "cloud"
28665
28851
  ].filter(Boolean);
28666
28852
  const isGated = engine.cloud && !frontierEligible;
28667
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
28668
- import_material47.MenuItem,
28853
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
28854
+ import_material48.MenuItem,
28669
28855
  {
28670
28856
  selected: engine.id === resolvedEngineId,
28671
28857
  disabled: !engine.available || isGated,
@@ -28688,16 +28874,16 @@ var init_chat_app_bar = __esm({
28688
28874
  ...isGated ? { opacity: 1, "&.Mui-disabled": { opacity: 1 } } : {}
28689
28875
  },
28690
28876
  children: [
28691
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material47.Box, { sx: { display: "flex", alignItems: "center", gap: 1, width: "100%" }, children: [
28692
- isGated && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28877
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_material48.Box, { sx: { display: "flex", alignItems: "center", gap: 1, width: "100%" }, children: [
28878
+ isGated && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28693
28879
  LockIcon,
28694
28880
  {
28695
28881
  fontSize: "small",
28696
28882
  sx: { fontSize: "0.95rem", color: theme.palette.text.secondary }
28697
28883
  }
28698
28884
  ),
28699
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28700
- import_material47.Typography,
28885
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28886
+ import_material48.Typography,
28701
28887
  {
28702
28888
  variant: "body2",
28703
28889
  sx: {
@@ -28708,15 +28894,15 @@ var init_chat_app_bar = __esm({
28708
28894
  children: cleanEngineName(engine.displayName)
28709
28895
  }
28710
28896
  ),
28711
- engine.id === resolvedEngineId && !isGated && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Box, { sx: { width: 8, height: 8, borderRadius: "50%", bgcolor: theme.palette.primary.main } })
28897
+ engine.id === resolvedEngineId && !isGated && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Box, { sx: { width: 8, height: 8, borderRadius: "50%", bgcolor: theme.palette.primary.main } })
28712
28898
  ] }),
28713
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Typography, { variant: "caption", sx: { color: theme.palette.text.secondary }, children: isGated ? "Premium engine \u2014 available on a paid plan." : engine.available ? engine.description : engine.unavailableReason || "Unavailable" }),
28714
- isGated && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28715
- import_material47.Button,
28899
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Typography, { variant: "caption", sx: { color: theme.palette.text.secondary }, children: isGated ? "Premium engine \u2014 available on a paid plan." : engine.available ? engine.description : engine.unavailableReason || "Unavailable" }),
28900
+ isGated && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28901
+ import_material48.Button,
28716
28902
  {
28717
28903
  size: "small",
28718
28904
  variant: "text",
28719
- startIcon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(LockIcon, { sx: { fontSize: "0.85rem" } }),
28905
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(LockIcon, { sx: { fontSize: "0.85rem" } }),
28720
28906
  onClick: (e) => {
28721
28907
  e.stopPropagation();
28722
28908
  setEngineAnchorEl(null);
@@ -28737,8 +28923,8 @@ var init_chat_app_bar = __esm({
28737
28923
  children: "Upgrade to unlock"
28738
28924
  }
28739
28925
  ),
28740
- badges.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Box, { sx: { display: "flex", gap: 0.5, flexWrap: "wrap", mt: 0.25 }, children: badges.map((b) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28741
- import_material47.Box,
28926
+ badges.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Box, { sx: { display: "flex", gap: 0.5, flexWrap: "wrap", mt: 0.25 }, children: badges.map((b) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28927
+ import_material48.Box,
28742
28928
  {
28743
28929
  sx: {
28744
28930
  fontSize: "0.65rem",
@@ -28760,8 +28946,8 @@ var init_chat_app_bar = __esm({
28760
28946
  ]
28761
28947
  }
28762
28948
  ),
28763
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28764
- import_material47.Menu,
28949
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28950
+ import_material48.Menu,
28765
28951
  {
28766
28952
  anchorEl: modelAnchorEl,
28767
28953
  open: Boolean(modelAnchorEl),
@@ -28796,8 +28982,8 @@ var init_chat_app_bar = __esm({
28796
28982
  }
28797
28983
  }
28798
28984
  },
28799
- children: availableModels.map((model) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
28800
- import_material47.MenuItem,
28985
+ children: availableModels.map((model) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
28986
+ import_material48.MenuItem,
28801
28987
  {
28802
28988
  selected: model.name === selectedModel,
28803
28989
  onClick: () => {
@@ -28843,8 +29029,8 @@ var init_chat_app_bar = __esm({
28843
29029
  px: 2
28844
29030
  },
28845
29031
  children: [
28846
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28847
- import_material46.Avatar,
29032
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
29033
+ import_material47.Avatar,
28848
29034
  {
28849
29035
  src: model.avatarBase64 || modelAvatars3[model.name] || banditHead4,
28850
29036
  alt: model.name,
@@ -28856,12 +29042,12 @@ var init_chat_app_bar = __esm({
28856
29042
  }
28857
29043
  }
28858
29044
  ),
28859
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material47.Box, { sx: { flex: 1 }, children: [
28860
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Typography, { variant: "body2", sx: { fontWeight: 500 }, children: model.name.replace("Bandit-", "") }),
28861
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Typography, { variant: "caption", sx: { color: theme.palette.text.secondary, display: "block" }, children: model.name === selectedModel ? "Currently active" : "Switch to this AI" })
29045
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_material48.Box, { sx: { flex: 1 }, children: [
29046
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Typography, { variant: "body2", sx: { fontWeight: 500 }, children: model.name.replace("Bandit-", "") }),
29047
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Typography, { variant: "caption", sx: { color: theme.palette.text.secondary, display: "block" }, children: model.name === selectedModel ? "Currently active" : "Switch to this AI" })
28862
29048
  ] }),
28863
- model.name === selectedModel && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28864
- import_material47.Box,
29049
+ model.name === selectedModel && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
29050
+ import_material48.Box,
28865
29051
  {
28866
29052
  sx: {
28867
29053
  width: 8,
@@ -28877,9 +29063,9 @@ var init_chat_app_bar = __esm({
28877
29063
  ))
28878
29064
  }
28879
29065
  ),
28880
- isTTSAvailable && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
28881
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Tooltip, { title: `Voice: ${selectedVoice ? toTitleCase(selectedVoice.split("-")[1]) : "Default"}`, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28882
- import_material47.IconButton,
29066
+ isTTSAvailable && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
29067
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Tooltip, { title: `Voice: ${selectedVoice ? toTitleCase(selectedVoice.split("-")[1]) : "Default"}`, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
29068
+ import_material48.IconButton,
28883
29069
  {
28884
29070
  onClick: (e) => setVoiceAnchorEl(e.currentTarget),
28885
29071
  sx: {
@@ -28892,11 +29078,11 @@ var init_chat_app_bar = __esm({
28892
29078
  }
28893
29079
  },
28894
29080
  "aria-label": `Change voice. Currently using ${selectedVoice ? toTitleCase(selectedVoice.split("-")[1]) : "default"}`,
28895
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(RecordVoiceOverIcon, { fontSize: "small" })
29081
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(RecordVoiceOverIcon, { fontSize: "small" })
28896
29082
  }
28897
29083
  ) }),
28898
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28899
- import_material47.Menu,
29084
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
29085
+ import_material48.Menu,
28900
29086
  {
28901
29087
  anchorEl: voiceAnchorEl,
28902
29088
  open: Boolean(voiceAnchorEl),
@@ -28932,22 +29118,22 @@ var init_chat_app_bar = __esm({
28932
29118
  }
28933
29119
  }
28934
29120
  },
28935
- children: availableVoices.length > 0 ? availableVoices.map((voice) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28936
- import_material47.MenuItem,
29121
+ children: availableVoices.length > 0 ? availableVoices.map((voice) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
29122
+ import_material48.MenuItem,
28937
29123
  {
28938
29124
  selected: voice === selectedVoice,
28939
29125
  onClick: () => {
28940
29126
  handleVoiceChange(voice);
28941
29127
  setVoiceAnchorEl(null);
28942
29128
  },
28943
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material47.Box, { sx: { display: "flex", alignItems: "center", gap: 1, width: "100%" }, children: [
28944
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(RecordVoiceOverIcon, { fontSize: "small", sx: { color: theme.palette.text.secondary } }),
28945
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material47.Box, { sx: { flex: 1 }, children: [
28946
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Typography, { variant: "body2", children: toTitleCase(voice.split("-")[1]) }),
28947
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Typography, { variant: "caption", sx: { color: theme.palette.text.secondary }, children: voice === selectedVoice ? "Currently active" : "Switch to this voice" })
29129
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_material48.Box, { sx: { display: "flex", alignItems: "center", gap: 1, width: "100%" }, children: [
29130
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(RecordVoiceOverIcon, { fontSize: "small", sx: { color: theme.palette.text.secondary } }),
29131
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_material48.Box, { sx: { flex: 1 }, children: [
29132
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Typography, { variant: "body2", children: toTitleCase(voice.split("-")[1]) }),
29133
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Typography, { variant: "caption", sx: { color: theme.palette.text.secondary }, children: voice === selectedVoice ? "Currently active" : "Switch to this voice" })
28948
29134
  ] }),
28949
- voice === selectedVoice && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28950
- import_material47.Box,
29135
+ voice === selectedVoice && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
29136
+ import_material48.Box,
28951
29137
  {
28952
29138
  sx: {
28953
29139
  width: 8,
@@ -28960,7 +29146,7 @@ var init_chat_app_bar = __esm({
28960
29146
  ] })
28961
29147
  },
28962
29148
  voice
28963
- )) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.MenuItem, { disabled: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Typography, { variant: "body2", color: "text.secondary", children: "No voices available" }) })
29149
+ )) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.MenuItem, { disabled: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Typography, { variant: "body2", color: "text.secondary", children: "No voices available" }) })
28964
29150
  }
28965
29151
  )
28966
29152
  ] })
@@ -28970,34 +29156,34 @@ var init_chat_app_bar = __esm({
28970
29156
  ]
28971
29157
  }
28972
29158
  ),
28973
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(conversation_drawer_default, { open: drawerOpen, onClose: () => setDrawerOpen(false) }),
28974
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(enhanced_mobile_conversations_modal_default, { open: modalOpen, onClose: () => setModalOpen(false) }),
28975
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
28976
- import_material47.Dialog,
29159
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(conversation_drawer_default, { open: drawerOpen, onClose: () => setDrawerOpen(false) }),
29160
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(enhanced_mobile_conversations_modal_default, { open: modalOpen, onClose: () => setModalOpen(false) }),
29161
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
29162
+ import_material48.Dialog,
28977
29163
  {
28978
29164
  open: confirmModelChangeOpen,
28979
29165
  onClose: () => setConfirmModelChangeOpen(false),
28980
29166
  children: [
28981
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.DialogTitle, { children: "Change personality and start new conversation?" }),
28982
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.DialogContent, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material47.Box, { display: "flex", alignItems: "center", gap: 2, mt: 1, justifyContent: "center", children: [
28983
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28984
- import_material46.Avatar,
29167
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.DialogTitle, { children: "Change personality and start new conversation?" }),
29168
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.DialogContent, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_material48.Box, { display: "flex", alignItems: "center", gap: 2, mt: 1, justifyContent: "center", children: [
29169
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
29170
+ import_material47.Avatar,
28985
29171
  {
28986
29172
  src: pendingModelAvatar,
28987
29173
  alt: pendingModel || "Personality Avatar",
28988
29174
  sx: { width: 40, height: 40, filter: "brightness(1.7)" }
28989
29175
  }
28990
29176
  ),
28991
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material47.Typography, { variant: "body2", children: [
29177
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_material48.Typography, { variant: "body2", children: [
28992
29178
  "Your current conversation will be saved, and a new one will begin with ",
28993
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: pendingModel }),
29179
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("strong", { children: pendingModel }),
28994
29180
  "."
28995
29181
  ] })
28996
29182
  ] }) }),
28997
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material47.DialogActions, { children: [
28998
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Button, { onClick: () => setConfirmModelChangeOpen(false), children: "Cancel" }),
28999
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
29000
- import_material47.Button,
29183
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_material48.DialogActions, { children: [
29184
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material48.Button, { onClick: () => setConfirmModelChangeOpen(false), children: "Cancel" }),
29185
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
29186
+ import_material48.Button,
29001
29187
  {
29002
29188
  onClick: () => {
29003
29189
  if (pendingModel) {
@@ -29111,12 +29297,12 @@ Respond with just the title and nothing else.
29111
29297
  });
29112
29298
 
29113
29299
  // src/chat/query-suggestion-picker.tsx
29114
- var import_react58, import_material48, import_styles30, import_react_markdown3, import_remark_gfm3, import_rehype_raw3, import_jsx_runtime47, markdownComponents, QuerySuggestionPicker;
29300
+ var import_react59, import_material49, import_styles30, import_react_markdown3, import_remark_gfm3, import_rehype_raw3, import_jsx_runtime48, markdownComponents, QuerySuggestionPicker;
29115
29301
  var init_query_suggestion_picker = __esm({
29116
29302
  "src/chat/query-suggestion-picker.tsx"() {
29117
29303
  "use strict";
29118
- import_react58 = require("react");
29119
- import_material48 = require("@mui/material");
29304
+ import_react59 = require("react");
29305
+ import_material49 = require("@mui/material");
29120
29306
  import_styles30 = require("@mui/material/styles");
29121
29307
  import_react_markdown3 = __toESM(require("react-markdown"));
29122
29308
  import_remark_gfm3 = __toESM(require("remark-gfm"));
@@ -29127,29 +29313,29 @@ var init_query_suggestion_picker = __esm({
29127
29313
  init_preferencesStore();
29128
29314
  init_knowledgeStore();
29129
29315
  init_mcpToolsStore();
29130
- import_jsx_runtime47 = require("react/jsx-runtime");
29316
+ import_jsx_runtime48 = require("react/jsx-runtime");
29131
29317
  markdownComponents = {
29132
- p: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { ...props }),
29133
- mark: ({ node, children, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("mark", { ...props, children }),
29318
+ p: ({ node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { ...props }),
29319
+ mark: ({ node, children, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("mark", { ...props, children }),
29134
29320
  code: ({ node, children, ...props }) => {
29135
29321
  const { inline, ...rest } = props;
29136
- return inline ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("code", { ...rest, children }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("code", { ...rest, children });
29322
+ return inline ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("code", { ...rest, children }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("code", { ...rest, children });
29137
29323
  }
29138
29324
  };
29139
29325
  QuerySuggestionPicker = ({
29140
29326
  onSend,
29141
29327
  inputHeight
29142
29328
  }) => {
29143
- const hasGenerated = (0, import_react58.useRef)(false);
29144
- const [hasSentPrompt, setHasSentPrompt] = (0, import_react58.useState)(false);
29145
- const [examplePrompts, setExamplePrompts] = (0, import_react58.useState)([]);
29146
- const [visiblePrompts, setVisiblePrompts] = (0, import_react58.useState)([]);
29147
- const scrollRef = (0, import_react58.useRef)(null);
29329
+ const hasGenerated = (0, import_react59.useRef)(false);
29330
+ const [hasSentPrompt, setHasSentPrompt] = (0, import_react59.useState)(false);
29331
+ const [examplePrompts, setExamplePrompts] = (0, import_react59.useState)([]);
29332
+ const [visiblePrompts, setVisiblePrompts] = (0, import_react59.useState)([]);
29333
+ const scrollRef = (0, import_react59.useRef)(null);
29148
29334
  const theme = (0, import_styles30.useTheme)();
29149
- const isMobile = (0, import_material48.useMediaQuery)((theme2) => theme2.breakpoints.down("sm"));
29335
+ const isMobile = (0, import_material49.useMediaQuery)((theme2) => theme2.breakpoints.down("sm"));
29150
29336
  const { background, text, border, hoverBackground, hoverBorder } = theme.palette.chat.suggestion;
29151
29337
  const { getCurrentModel, isLoading } = useModelStore();
29152
- (0, import_react58.useEffect)(() => {
29338
+ (0, import_react59.useEffect)(() => {
29153
29339
  if (hasGenerated.current || isLoading) return;
29154
29340
  hasGenerated.current = true;
29155
29341
  const currentModel = getCurrentModel();
@@ -29182,12 +29368,12 @@ var init_query_suggestion_picker = __esm({
29182
29368
  hasGenerated.current = false;
29183
29369
  });
29184
29370
  }, [getCurrentModel, isLoading]);
29185
- (0, import_react58.useEffect)(() => {
29371
+ (0, import_react59.useEffect)(() => {
29186
29372
  if (!isLoading) {
29187
29373
  hasGenerated.current = false;
29188
29374
  }
29189
29375
  }, [isLoading]);
29190
- (0, import_react58.useEffect)(() => {
29376
+ (0, import_react59.useEffect)(() => {
29191
29377
  if (hasSentPrompt || examplePrompts.length === 0) return;
29192
29378
  const interval = setInterval(() => {
29193
29379
  setExamplePrompts((prev) => {
@@ -29206,8 +29392,8 @@ var init_query_suggestion_picker = __esm({
29206
29392
  return () => clearInterval(interval);
29207
29393
  }, [hasSentPrompt, examplePrompts.length]);
29208
29394
  const displayPrompts = isMobile ? visiblePrompts.slice(0, Math.min(visiblePrompts.length, 6)) : visiblePrompts;
29209
- return displayPrompts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_jsx_runtime47.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
29210
- import_material48.Box,
29395
+ return displayPrompts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_jsx_runtime48.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
29396
+ import_material49.Box,
29211
29397
  {
29212
29398
  ref: scrollRef,
29213
29399
  sx: {
@@ -29223,8 +29409,8 @@ var init_query_suggestion_picker = __esm({
29223
29409
  pb: isMobile ? 0.4 : 0,
29224
29410
  "&::-webkit-scrollbar": { display: "none" }
29225
29411
  },
29226
- children: displayPrompts.map((prompt, i) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
29227
- import_material48.Box,
29412
+ children: displayPrompts.map((prompt, i) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
29413
+ import_material49.Box,
29228
29414
  {
29229
29415
  sx: {
29230
29416
  px: isMobile ? 1.4 : 2,
@@ -29258,8 +29444,8 @@ var init_query_suggestion_picker = __esm({
29258
29444
  onSend(prompt, []);
29259
29445
  setHasSentPrompt(true);
29260
29446
  },
29261
- children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
29262
- import_material48.Box,
29447
+ children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
29448
+ import_material49.Box,
29263
29449
  {
29264
29450
  sx: {
29265
29451
  flex: 1,
@@ -29283,7 +29469,7 @@ var init_query_suggestion_picker = __esm({
29283
29469
  padding: "0.1em 0.25em"
29284
29470
  }
29285
29471
  },
29286
- children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
29472
+ children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
29287
29473
  import_react_markdown3.default,
29288
29474
  {
29289
29475
  remarkPlugins: [import_remark_gfm3.default],
@@ -29304,22 +29490,22 @@ var init_query_suggestion_picker = __esm({
29304
29490
  });
29305
29491
 
29306
29492
  // ../../src/pages/under-review.tsx
29307
- var import_material49, import_react_router_dom3, import_jsx_runtime48, UnderReview, under_review_default;
29493
+ var import_material50, import_react_router_dom4, import_jsx_runtime49, UnderReview, under_review_default;
29308
29494
  var init_under_review = __esm({
29309
29495
  "../../src/pages/under-review.tsx"() {
29310
29496
  "use strict";
29311
- import_material49 = require("@mui/material");
29312
- import_react_router_dom3 = require("react-router-dom");
29313
- import_jsx_runtime48 = require("react/jsx-runtime");
29497
+ import_material50 = require("@mui/material");
29498
+ import_react_router_dom4 = require("react-router-dom");
29499
+ import_jsx_runtime49 = require("react/jsx-runtime");
29314
29500
  UnderReview = () => {
29315
- const theme = (0, import_material49.useTheme)();
29316
- const navigate = (0, import_react_router_dom3.useNavigate)();
29501
+ const theme = (0, import_material50.useTheme)();
29502
+ const navigate = (0, import_react_router_dom4.useNavigate)();
29317
29503
  const handleSneakyLogout = () => {
29318
29504
  localStorage.removeItem("authToken");
29319
29505
  navigate("/login");
29320
29506
  };
29321
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
29322
- import_material49.Box,
29507
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
29508
+ import_material50.Box,
29323
29509
  {
29324
29510
  sx: {
29325
29511
  minHeight: "100vh",
@@ -29334,8 +29520,8 @@ var init_under_review = __esm({
29334
29520
  position: "relative"
29335
29521
  },
29336
29522
  children: [
29337
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
29338
- import_material49.Box,
29523
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
29524
+ import_material50.Box,
29339
29525
  {
29340
29526
  onClick: handleSneakyLogout,
29341
29527
  sx: {
@@ -29360,13 +29546,13 @@ var init_under_review = __esm({
29360
29546
  title: "Reset session"
29361
29547
  }
29362
29548
  ),
29363
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material49.Typography, { variant: "h4", sx: { mb: 2, fontWeight: 700, color: theme.palette.error.main }, children: "Under Review" }),
29364
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material49.Typography, { variant: "body1", sx: { mb: 2, color: theme.palette.text.secondary }, children: [
29549
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material50.Typography, { variant: "h4", sx: { mb: 2, fontWeight: 700, color: theme.palette.error.main }, children: "Under Review" }),
29550
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_material50.Typography, { variant: "body1", sx: { mb: 2, color: theme.palette.text.secondary }, children: [
29365
29551
  "Your request to use our services is currently being reviewed.",
29366
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("br", {}),
29552
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("br", {}),
29367
29553
  "For more info, please contact ",
29368
29554
  " ",
29369
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("a", { href: "mailto:team@banditai.ai", style: { color: theme.palette.primary.main, fontWeight: 600 }, children: "team@banditai.ai" })
29555
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("a", { href: "mailto:team@banditai.ai", style: { color: theme.palette.primary.main, fontWeight: 600 }, children: "team@banditai.ai" })
29370
29556
  ] })
29371
29557
  ]
29372
29558
  }
@@ -29377,19 +29563,19 @@ var init_under_review = __esm({
29377
29563
  });
29378
29564
 
29379
29565
  // src/components/ConnectionStatus.tsx
29380
- var import_material50, import_jsx_runtime49, ConnectionStatus;
29566
+ var import_material51, import_jsx_runtime50, ConnectionStatus;
29381
29567
  var init_ConnectionStatus = __esm({
29382
29568
  "src/components/ConnectionStatus.tsx"() {
29383
29569
  "use strict";
29384
- import_material50 = require("@mui/material");
29570
+ import_material51 = require("@mui/material");
29385
29571
  init_useNetworkStatus();
29386
29572
  init_lucide_icons();
29387
- import_jsx_runtime49 = require("react/jsx-runtime");
29573
+ import_jsx_runtime50 = require("react/jsx-runtime");
29388
29574
  ConnectionStatus = ({
29389
29575
  showWhenGood = false,
29390
29576
  position = "top"
29391
29577
  }) => {
29392
- const theme = (0, import_material50.useTheme)();
29578
+ const theme = (0, import_material51.useTheme)();
29393
29579
  const { isOnline, connectionQuality, isSlowConnection } = useNetworkStatus();
29394
29580
  if (connectionQuality === "fast" && !showWhenGood) {
29395
29581
  return null;
@@ -29398,28 +29584,28 @@ var init_ConnectionStatus = __esm({
29398
29584
  switch (connectionQuality) {
29399
29585
  case "offline":
29400
29586
  return {
29401
- icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(WifiOffIcon, { sx: { fontSize: 16 } }),
29587
+ icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(WifiOffIcon, { sx: { fontSize: 16 } }),
29402
29588
  label: "Offline",
29403
29589
  color: "error",
29404
29590
  severity: "high"
29405
29591
  };
29406
29592
  case "slow":
29407
29593
  return {
29408
- icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SignalWifi2BarIcon, { sx: { fontSize: 16 } }),
29594
+ icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SignalWifi2BarIcon, { sx: { fontSize: 16 } }),
29409
29595
  label: "Slow connection",
29410
29596
  color: "warning",
29411
29597
  severity: "medium"
29412
29598
  };
29413
29599
  case "fast":
29414
29600
  return {
29415
- icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(WifiIcon, { sx: { fontSize: 16 } }),
29601
+ icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(WifiIcon, { sx: { fontSize: 16 } }),
29416
29602
  label: "Connected",
29417
29603
  color: "success",
29418
29604
  severity: "low"
29419
29605
  };
29420
29606
  default:
29421
29607
  return {
29422
- icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(WifiIcon, { sx: { fontSize: 16 } }),
29608
+ icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(WifiIcon, { sx: { fontSize: 16 } }),
29423
29609
  label: "Unknown",
29424
29610
  color: "default",
29425
29611
  severity: "low"
@@ -29427,8 +29613,8 @@ var init_ConnectionStatus = __esm({
29427
29613
  }
29428
29614
  };
29429
29615
  const config = getStatusConfig();
29430
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
29431
- import_material50.Box,
29616
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
29617
+ import_material51.Box,
29432
29618
  {
29433
29619
  sx: {
29434
29620
  position: "fixed",
@@ -29443,8 +29629,8 @@ var init_ConnectionStatus = __esm({
29443
29629
  "100%": { opacity: 1 }
29444
29630
  }
29445
29631
  },
29446
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
29447
- import_material50.Chip,
29632
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
29633
+ import_material51.Chip,
29448
29634
  {
29449
29635
  icon: config.icon,
29450
29636
  label: config.label,
@@ -29469,11 +29655,11 @@ var init_ConnectionStatus = __esm({
29469
29655
  });
29470
29656
 
29471
29657
  // src/hooks/useVoiceMode.ts
29472
- var import_react59, RMS_BASELINE, RMS_NORMALIZER, computeRms, pickSupportedMimeType, useVoiceMode;
29658
+ var import_react60, RMS_BASELINE, RMS_NORMALIZER, computeRms, pickSupportedMimeType, useVoiceMode;
29473
29659
  var init_useVoiceMode = __esm({
29474
29660
  "src/hooks/useVoiceMode.ts"() {
29475
29661
  "use strict";
29476
- import_react59 = require("react");
29662
+ import_react60 = require("react");
29477
29663
  init_stt_client();
29478
29664
  init_debugLogger();
29479
29665
  init_voiceModeStore();
@@ -29506,11 +29692,11 @@ var init_useVoiceMode = __esm({
29506
29692
  const setError = useVoiceModeStore((state) => state.setError);
29507
29693
  const resetTransientState = useVoiceModeStore((state) => state.resetTransientState);
29508
29694
  const setLastTranscript = useVoiceModeStore((state) => state.setLastTranscript);
29509
- const configRef = (0, import_react59.useRef)(config);
29510
- (0, import_react59.useEffect)(() => {
29695
+ const configRef = (0, import_react60.useRef)(config);
29696
+ (0, import_react60.useEffect)(() => {
29511
29697
  configRef.current = config;
29512
29698
  }, [config]);
29513
- (0, import_react59.useEffect)(() => {
29699
+ (0, import_react60.useEffect)(() => {
29514
29700
  if (!enabled) {
29515
29701
  return () => void 0;
29516
29702
  }
@@ -29771,25 +29957,26 @@ var chat_exports = {};
29771
29957
  __export(chat_exports, {
29772
29958
  default: () => chat_default
29773
29959
  });
29774
- var import_react60, import_material51, import_styles31, import_react_router_dom4, import_jsx_runtime50, ChatContent, Chat, chat_default;
29960
+ var import_react61, import_material52, import_styles31, import_react_router_dom5, import_jsx_runtime51, ChatContent, Chat, chat_default;
29775
29961
  var init_chat2 = __esm({
29776
29962
  "src/chat/chat.tsx"() {
29777
29963
  "use strict";
29778
- import_react60 = require("react");
29964
+ import_react61 = require("react");
29779
29965
  init_custom_logo();
29780
29966
  init_indexedDBService();
29781
- import_material51 = require("@mui/material");
29967
+ import_material52 = require("@mui/material");
29782
29968
  import_styles31 = require("@mui/material/styles");
29783
29969
  init_aiQueryStore();
29784
29970
  init_modelStore();
29785
29971
  init_canvasStore();
29786
29972
  init_canvas_panel();
29787
- import_react_router_dom4 = require("react-router-dom");
29973
+ import_react_router_dom5 = require("react-router-dom");
29788
29974
  init_chat_scroll_to_bottom_button();
29789
29975
  init_bandit_chat_logo();
29790
29976
  init_chat_messages();
29791
29977
  init_chat_input();
29792
29978
  init_ask_user_card();
29979
+ init_rate_limit_prompt();
29793
29980
  init_useAIProvider();
29794
29981
  init_useAutoScroll();
29795
29982
  init_useNetworkStatus();
@@ -29816,7 +30003,7 @@ var init_chat2 = __esm({
29816
30003
  init_voiceModeStore();
29817
30004
  init_ttsSanitizer();
29818
30005
  init_FeatureFlagContext();
29819
- import_jsx_runtime50 = require("react/jsx-runtime");
30006
+ import_jsx_runtime51 = require("react/jsx-runtime");
29820
30007
  ChatContent = () => {
29821
30008
  const packageSettings = usePackageSettingsStore((state) => state.settings);
29822
30009
  const featureFlag = useFeatureFlag();
@@ -29824,12 +30011,12 @@ var init_chat2 = __esm({
29824
30011
  const ossMode = isOSSMode() || !packageSettings?.featureFlags?.subscriptionType;
29825
30012
  const playgroundBypassAccess = packageSettings?.playgroundBypassAuth || typeof window !== "undefined" && window.location.pathname.includes("/playground");
29826
30013
  const notificationService2 = useNotificationService();
29827
- const [selectedTheme, setSelectedTheme] = (0, import_react60.useState)(null);
29828
- const [themeLoading, setThemeLoading] = (0, import_react60.useState)(true);
30014
+ const [selectedTheme, setSelectedTheme] = (0, import_react61.useState)(null);
30015
+ const [themeLoading, setThemeLoading] = (0, import_react61.useState)(true);
29829
30016
  const token = authenticationService.getToken();
29830
30017
  const claims = token ? authenticationService.parseJwtClaims(token) : null;
29831
30018
  const baseTheme = themeMap_default[selectedTheme ?? "bandit-dark"] || banditDarkTheme;
29832
- const banditTheme = (0, import_react60.useMemo)(() => {
30019
+ const banditTheme = (0, import_react61.useMemo)(() => {
29833
30020
  return (0, import_styles31.createTheme)(baseTheme, {
29834
30021
  components: {
29835
30022
  MuiInputBase: {
@@ -29877,12 +30064,12 @@ var init_chat2 = __esm({
29877
30064
  } = useVoiceStore();
29878
30065
  const isVoiceModeEnabled = useVoiceModeStore((state) => state.enabled);
29879
30066
  const canvasOpen = useCanvasStore((state) => state.open);
29880
- const previousVoiceModeEnabledRef = (0, import_react60.useRef)(isVoiceModeEnabled);
29881
- const historyRef = (0, import_react60.useRef)(history);
29882
- (0, import_react60.useEffect)(() => {
30067
+ const previousVoiceModeEnabledRef = (0, import_react61.useRef)(isVoiceModeEnabled);
30068
+ const historyRef = (0, import_react61.useRef)(history);
30069
+ (0, import_react61.useEffect)(() => {
29883
30070
  historyRef.current = history;
29884
30071
  }, [history]);
29885
- (0, import_react60.useEffect)(() => {
30072
+ (0, import_react61.useEffect)(() => {
29886
30073
  if (!hydrated) return;
29887
30074
  const params = new URLSearchParams(window.location.search);
29888
30075
  const title = params.get("title") || "";
@@ -29898,7 +30085,7 @@ var init_chat2 = __esm({
29898
30085
  stop: ttsStop,
29899
30086
  isAvailable: isTTSAvailable
29900
30087
  } = useTTS();
29901
- (0, import_react60.useEffect)(() => {
30088
+ (0, import_react61.useEffect)(() => {
29902
30089
  const timer = setTimeout(() => {
29903
30090
  const isAuthenticated = authenticationService.isAuthenticated();
29904
30091
  if (!initialized || availableVoices.length === 0) {
@@ -29912,7 +30099,7 @@ var init_chat2 = __esm({
29912
30099
  }, 500);
29913
30100
  return () => clearTimeout(timer);
29914
30101
  }, [initialized, availableVoices.length, loadVoicesFromAPI, token]);
29915
- (0, import_react60.useEffect)(() => {
30102
+ (0, import_react61.useEffect)(() => {
29916
30103
  const isAuthenticated = authenticationService.isAuthenticated();
29917
30104
  if (packageSettings?.gatewayApiUrl && availableVoices.length === 0 && !initialized) {
29918
30105
  if (token && isAuthenticated) {
@@ -29924,15 +30111,15 @@ var init_chat2 = __esm({
29924
30111
  }
29925
30112
  }, [packageSettings?.gatewayApiUrl, availableVoices.length, initialized, loadVoicesFromAPI, token]);
29926
30113
  const provider = useAIProviderStore((state) => state.provider);
29927
- const inputRef = (0, import_react60.useRef)(null);
29928
- const [pastedImages, setPastedImages] = (0, import_react60.useState)([]);
29929
- const inputContainerRef = (0, import_react60.useRef)(null);
29930
- const [inputHeight, setInputHeight] = (0, import_react60.useState)(80);
29931
- const [isSubmitting, setIsSubmitting] = (0, import_react60.useState)(false);
29932
- const [pendingMessage, setPendingMessage] = (0, import_react60.useState)(null);
30114
+ const inputRef = (0, import_react61.useRef)(null);
30115
+ const [pastedImages, setPastedImages] = (0, import_react61.useState)([]);
30116
+ const inputContainerRef = (0, import_react61.useRef)(null);
30117
+ const [inputHeight, setInputHeight] = (0, import_react61.useState)(80);
30118
+ const [isSubmitting, setIsSubmitting] = (0, import_react61.useState)(false);
30119
+ const [pendingMessage, setPendingMessage] = (0, import_react61.useState)(null);
29933
30120
  const { conversations, currentId, _hasHydrated, hydrate } = useConversationStore();
29934
- const [isMobile, setIsMobile] = (0, import_react60.useState)(false);
29935
- const [drawerOpen, setDrawerOpen] = (0, import_react60.useState)(false);
30121
+ const [isMobile, setIsMobile] = (0, import_react61.useState)(false);
30122
+ const [drawerOpen, setDrawerOpen] = (0, import_react61.useState)(false);
29936
30123
  const { generateName } = useConversationNameGenerator();
29937
30124
  const { preferences } = usePreferencesStore();
29938
30125
  const { containerRef: chatContainerRef, targetRef: scrollTargetRef, scrollToBottom, getScrollState } = useAutoScroll({
@@ -29944,27 +30131,27 @@ var init_chat2 = __esm({
29944
30131
  const chatContainerEl = chatContainerRef.current;
29945
30132
  const scrollTargetEl = scrollTargetRef.current;
29946
30133
  const { isSlowConnection, connectionQuality, trackRequestStart, trackRequestEnd } = useNetworkStatus();
29947
- const [showScrollToBottom, setShowScrollToBottom] = (0, import_react60.useState)(false);
29948
- const [streamBuffer, setStreamBuffer] = (0, import_react60.useState)("");
29949
- const [responseStarted, setResponseStarted] = (0, import_react60.useState)(false);
29950
- const [isStreaming, setIsStreaming] = (0, import_react60.useState)(false);
29951
- const [isThinking, setIsThinking] = (0, import_react60.useState)(false);
30134
+ const [showScrollToBottom, setShowScrollToBottom] = (0, import_react61.useState)(false);
30135
+ const [streamBuffer, setStreamBuffer] = (0, import_react61.useState)("");
30136
+ const [responseStarted, setResponseStarted] = (0, import_react61.useState)(false);
30137
+ const [isStreaming, setIsStreaming] = (0, import_react61.useState)(false);
30138
+ const [isThinking, setIsThinking] = (0, import_react61.useState)(false);
29952
30139
  const initialLogoState = history.length === 0;
29953
- const [logoVisible, setLogoVisible] = (0, import_react60.useState)(initialLogoState);
29954
- const [logoShouldRender, setLogoShouldRender] = (0, import_react60.useState)(initialLogoState);
29955
- const streamingGraceUntilRef = (0, import_react60.useRef)(0);
30140
+ const [logoVisible, setLogoVisible] = (0, import_react61.useState)(initialLogoState);
30141
+ const [logoShouldRender, setLogoShouldRender] = (0, import_react61.useState)(initialLogoState);
30142
+ const streamingGraceUntilRef = (0, import_react61.useRef)(0);
29956
30143
  const GRACE_MS = 450;
29957
30144
  const GRACE_OFFSET_DESKTOP = 28;
29958
30145
  const GRACE_OFFSET_MOBILE = 20;
29959
- const followStreamRef = (0, import_react60.useRef)(true);
29960
- const lastSpokenResponseRef = (0, import_react60.useRef)(null);
29961
- const previousConversationIdRef = (0, import_react60.useRef)(null);
29962
- const logoFadeTimeoutRef = (0, import_react60.useRef)(null);
29963
- const [branding, setBranding] = (0, import_react60.useState)(null);
29964
- const [brandingLoading, setBrandingLoading] = (0, import_react60.useState)(true);
29965
- const isBrandingLoadInProgressRef = (0, import_react60.useRef)(false);
30146
+ const followStreamRef = (0, import_react61.useRef)(true);
30147
+ const lastSpokenResponseRef = (0, import_react61.useRef)(null);
30148
+ const previousConversationIdRef = (0, import_react61.useRef)(null);
30149
+ const logoFadeTimeoutRef = (0, import_react61.useRef)(null);
30150
+ const [branding, setBranding] = (0, import_react61.useState)(null);
30151
+ const [brandingLoading, setBrandingLoading] = (0, import_react61.useState)(true);
30152
+ const isBrandingLoadInProgressRef = (0, import_react61.useRef)(false);
29966
30153
  const logoOnly = history.length === 0 && !brandingLoading;
29967
- (0, import_react60.useEffect)(() => {
30154
+ (0, import_react61.useEffect)(() => {
29968
30155
  const isEmptyConversation = (history?.length ?? 0) === 0;
29969
30156
  const isSending = Boolean(pendingMessage);
29970
30157
  const shouldShowLogo = isEmptyConversation && !isSending;
@@ -29994,7 +30181,7 @@ var init_chat2 = __esm({
29994
30181
  }, 500);
29995
30182
  }
29996
30183
  }, [history, pendingMessage]);
29997
- (0, import_react60.useEffect)(() => {
30184
+ (0, import_react61.useEffect)(() => {
29998
30185
  if (!brandingLoading && !themeLoading) {
29999
30186
  return;
30000
30187
  }
@@ -30010,18 +30197,18 @@ var init_chat2 = __esm({
30010
30197
  }, 2500);
30011
30198
  return () => window.clearTimeout(timeoutId);
30012
30199
  }, [brandingLoading, themeLoading, selectedTheme]);
30013
- (0, import_react60.useEffect)(() => () => {
30200
+ (0, import_react61.useEffect)(() => () => {
30014
30201
  if (logoFadeTimeoutRef.current) {
30015
30202
  window.clearTimeout(logoFadeTimeoutRef.current);
30016
30203
  logoFadeTimeoutRef.current = null;
30017
30204
  }
30018
30205
  }, []);
30019
- (0, import_react60.useEffect)(() => {
30206
+ (0, import_react61.useEffect)(() => {
30020
30207
  if (isStreaming && streamBuffer.trim() === "") {
30021
30208
  streamingGraceUntilRef.current = Date.now() + GRACE_MS;
30022
30209
  }
30023
30210
  }, [isStreaming, streamBuffer]);
30024
- (0, import_react60.useEffect)(() => {
30211
+ (0, import_react61.useEffect)(() => {
30025
30212
  if (!isStreaming) return;
30026
30213
  const container = chatContainerRef.current;
30027
30214
  if (!container) return;
@@ -30032,13 +30219,13 @@ var init_chat2 = __esm({
30032
30219
  container.scrollTo({ top: targetTop, behavior: "smooth" });
30033
30220
  }
30034
30221
  }, [streamBuffer, isStreaming, isMobile, chatContainerRef]);
30035
- (0, import_react60.useEffect)(() => {
30222
+ (0, import_react61.useEffect)(() => {
30036
30223
  if (!_hasHydrated) {
30037
30224
  debugLogger.info("Chat component triggering conversation store hydration");
30038
30225
  hydrate();
30039
30226
  }
30040
30227
  }, [_hasHydrated, hydrate]);
30041
- (0, import_react60.useEffect)(() => {
30228
+ (0, import_react61.useEffect)(() => {
30042
30229
  const loadBrandingAndTheme = async () => {
30043
30230
  if (isBrandingLoadInProgressRef.current) {
30044
30231
  debugLogger.warn("Branding loading already in progress, skipping");
@@ -30225,19 +30412,19 @@ var init_chat2 = __esm({
30225
30412
  window.removeEventListener("bandit-theme-changed", handleThemeChange);
30226
30413
  };
30227
30414
  }, []);
30228
- (0, import_react60.useEffect)(() => {
30415
+ (0, import_react61.useEffect)(() => {
30229
30416
  if (!chatContainerEl) return;
30230
30417
  const blurInputOnScroll = () => inputRef.current?.blur();
30231
30418
  chatContainerEl.addEventListener("scroll", blurInputOnScroll);
30232
30419
  return () => chatContainerEl.removeEventListener("scroll", blurInputOnScroll);
30233
30420
  }, [chatContainerEl]);
30234
- (0, import_react60.useEffect)(() => {
30421
+ (0, import_react61.useEffect)(() => {
30235
30422
  const handleResize = () => setIsMobile(window.innerWidth <= 768);
30236
30423
  handleResize();
30237
30424
  window.addEventListener("resize", handleResize);
30238
30425
  return () => window.removeEventListener("resize", handleResize);
30239
30426
  }, []);
30240
- (0, import_react60.useEffect)(() => {
30427
+ (0, import_react61.useEffect)(() => {
30241
30428
  const setViewportHeight = () => {
30242
30429
  document.documentElement.style.setProperty(
30243
30430
  "--vh",
@@ -30248,7 +30435,7 @@ var init_chat2 = __esm({
30248
30435
  window.addEventListener("resize", setViewportHeight);
30249
30436
  return () => window.removeEventListener("resize", setViewportHeight);
30250
30437
  }, []);
30251
- (0, import_react60.useEffect)(() => {
30438
+ (0, import_react61.useEffect)(() => {
30252
30439
  if (!chatContainerEl) return;
30253
30440
  let rafId = null;
30254
30441
  const update = () => {
@@ -30267,7 +30454,7 @@ var init_chat2 = __esm({
30267
30454
  chatContainerEl.removeEventListener(SCROLL_STATE_CHANGED_EVENT, update);
30268
30455
  };
30269
30456
  }, [chatContainerEl, getScrollState]);
30270
- (0, import_react60.useEffect)(() => {
30457
+ (0, import_react61.useEffect)(() => {
30271
30458
  if (!chatContainerEl) return;
30272
30459
  let observer = null;
30273
30460
  let rafId = null;
@@ -30302,7 +30489,7 @@ var init_chat2 = __esm({
30302
30489
  if (observer) observer.disconnect();
30303
30490
  };
30304
30491
  }, [chatContainerEl, scrollTargetEl, scrollTargetRef, getScrollState, inputHeight, history.length]);
30305
- (0, import_react60.useEffect)(() => {
30492
+ (0, import_react61.useEffect)(() => {
30306
30493
  const isTransitioning = isStreaming || streamBuffer.trim() === "";
30307
30494
  const delay = isTransitioning ? 400 : 100;
30308
30495
  const timer = setTimeout(() => {
@@ -30311,7 +30498,7 @@ var init_chat2 = __esm({
30311
30498
  }, delay);
30312
30499
  return () => clearTimeout(timer);
30313
30500
  }, [history, streamBuffer, getScrollState, isStreaming]);
30314
- (0, import_react60.useLayoutEffect)(() => {
30501
+ (0, import_react61.useLayoutEffect)(() => {
30315
30502
  const scrollState = getScrollState();
30316
30503
  const now = Date.now();
30317
30504
  if (isStreaming && scrollState.shouldAutoScroll && followStreamRef.current) {
@@ -30345,7 +30532,7 @@ var init_chat2 = __esm({
30345
30532
  return () => clearTimeout(scrollTimer);
30346
30533
  }
30347
30534
  }, [history, isStreaming, scrollToBottom, getScrollState, isMobile, chatContainerRef]);
30348
- (0, import_react60.useEffect)(() => {
30535
+ (0, import_react61.useEffect)(() => {
30349
30536
  const observer = new ResizeObserver(() => {
30350
30537
  if (inputContainerRef.current)
30351
30538
  setInputHeight(inputContainerRef.current.offsetHeight);
@@ -30356,7 +30543,7 @@ var init_chat2 = __esm({
30356
30543
  }
30357
30544
  return () => observer.disconnect();
30358
30545
  }, []);
30359
- (0, import_react60.useEffect)(() => {
30546
+ (0, import_react61.useEffect)(() => {
30360
30547
  if (!hydrated || !_hasHydrated) return;
30361
30548
  if (currentId === null) {
30362
30549
  useAIQueryStore.setState({ history: [] });
@@ -30405,7 +30592,7 @@ var init_chat2 = __esm({
30405
30592
  setResponse,
30406
30593
  setComponentStatus
30407
30594
  ]);
30408
- (0, import_react60.useEffect)(() => {
30595
+ (0, import_react61.useEffect)(() => {
30409
30596
  debugLogger.info("Chat component conversation state", {
30410
30597
  hasHydrated: _hasHydrated,
30411
30598
  conversationCount: conversations.length,
@@ -30414,7 +30601,7 @@ var init_chat2 = __esm({
30414
30601
  storeState: "main-chat"
30415
30602
  });
30416
30603
  }, [_hasHydrated, conversations, currentId]);
30417
- (0, import_react60.useEffect)(() => {
30604
+ (0, import_react61.useEffect)(() => {
30418
30605
  if (!_hasHydrated || !chatContainerEl) return;
30419
30606
  let rafId = null;
30420
30607
  const sync = () => {
@@ -30449,7 +30636,7 @@ var init_chat2 = __esm({
30449
30636
  notificationService2?.handleHttpError(error);
30450
30637
  }
30451
30638
  });
30452
- const handleStop = (0, import_react60.useCallback)(() => {
30639
+ const handleStop = (0, import_react61.useCallback)(() => {
30453
30640
  try {
30454
30641
  aiProvider.cancel();
30455
30642
  } catch (error) {
@@ -30458,7 +30645,7 @@ var init_chat2 = __esm({
30458
30645
  });
30459
30646
  }
30460
30647
  }, [aiProvider]);
30461
- const handleVoiceInterrupt = (0, import_react60.useCallback)(() => {
30648
+ const handleVoiceInterrupt = (0, import_react61.useCallback)(() => {
30462
30649
  try {
30463
30650
  ttsStop();
30464
30651
  } catch (error) {
@@ -30477,7 +30664,7 @@ var init_chat2 = __esm({
30477
30664
  handleStop();
30478
30665
  }
30479
30666
  }, [ttsStop, isStreaming, handleStop]);
30480
- const handleSend = (0, import_react60.useCallback)(
30667
+ const handleSend = (0, import_react61.useCallback)(
30481
30668
  (question, images, displayQuestion) => {
30482
30669
  const requestStartTime = trackRequestStart();
30483
30670
  const questionForDisplay = displayQuestion || question;
@@ -30587,7 +30774,7 @@ var init_chat2 = __esm({
30587
30774
  trackRequestStart
30588
30775
  ]
30589
30776
  );
30590
- const handleVoiceTranscription = (0, import_react60.useCallback)(
30777
+ const handleVoiceTranscription = (0, import_react61.useCallback)(
30591
30778
  (text) => {
30592
30779
  const cleaned = text.trim();
30593
30780
  if (!cleaned) {
@@ -30604,7 +30791,7 @@ var init_chat2 = __esm({
30604
30791
  onInterrupt: handleVoiceInterrupt,
30605
30792
  onError: (message) => notificationService2?.showError?.(message)
30606
30793
  });
30607
- (0, import_react60.useEffect)(() => {
30794
+ (0, import_react61.useEffect)(() => {
30608
30795
  const previouslyEnabled = previousVoiceModeEnabledRef.current;
30609
30796
  previousVoiceModeEnabledRef.current = isVoiceModeEnabled;
30610
30797
  if (!previouslyEnabled && isVoiceModeEnabled) {
@@ -30629,7 +30816,7 @@ var init_chat2 = __esm({
30629
30816
  }
30630
30817
  }
30631
30818
  }, [isVoiceModeEnabled, ttsStop]);
30632
- (0, import_react60.useEffect)(() => {
30819
+ (0, import_react61.useEffect)(() => {
30633
30820
  if (!isVoiceModeEnabled || !isStreaming) {
30634
30821
  return;
30635
30822
  }
@@ -30649,7 +30836,7 @@ var init_chat2 = __esm({
30649
30836
  }
30650
30837
  lastSpokenResponseRef.current = null;
30651
30838
  }, [isStreaming, isVoiceModeEnabled, ttsStop]);
30652
- (0, import_react60.useEffect)(() => {
30839
+ (0, import_react61.useEffect)(() => {
30653
30840
  if (!isVoiceModeEnabled) {
30654
30841
  lastSpokenResponseRef.current = null;
30655
30842
  return;
@@ -30690,13 +30877,13 @@ var init_chat2 = __esm({
30690
30877
  cancelled = true;
30691
30878
  };
30692
30879
  }, [history, isStreaming, isVoiceModeEnabled, isTTSAvailable, ttsSpeak]);
30693
- const handleModelChange = (0, import_react60.useCallback)(
30880
+ const handleModelChange = (0, import_react61.useCallback)(
30694
30881
  (modelId) => {
30695
30882
  setSelectedModel(modelId);
30696
30883
  },
30697
30884
  [setSelectedModel]
30698
30885
  );
30699
- const handleVoiceChange = (0, import_react60.useCallback)(async (voiceId) => {
30886
+ const handleVoiceChange = (0, import_react61.useCallback)(async (voiceId) => {
30700
30887
  ttsStop();
30701
30888
  stopTTS();
30702
30889
  setSelectedVoice(voiceId);
@@ -30729,10 +30916,10 @@ var init_chat2 = __esm({
30729
30916
  }
30730
30917
  };
30731
30918
  if (!hydrated || brandingLoading || themeLoading) {
30732
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_material51.ThemeProvider, { theme: banditTheme, children: [
30733
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_material51.CssBaseline, {}),
30734
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
30735
- import_material51.Box,
30919
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_material52.ThemeProvider, { theme: banditTheme, children: [
30920
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.CssBaseline, {}),
30921
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
30922
+ import_material52.Box,
30736
30923
  {
30737
30924
  sx: (theme) => ({
30738
30925
  minHeight: "100dvh",
@@ -30745,8 +30932,8 @@ var init_chat2 = __esm({
30745
30932
  color: theme.palette.text.primary
30746
30933
  }),
30747
30934
  children: [
30748
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_material51.CircularProgress, { size: 32, thickness: 4 }),
30749
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_material51.Typography, { variant: "body2", color: "text.secondary", children: "Preparing your workspace..." })
30935
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.CircularProgress, { size: 32, thickness: 4 }),
30936
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.Typography, { variant: "body2", color: "text.secondary", children: "Preparing your workspace..." })
30750
30937
  ]
30751
30938
  }
30752
30939
  )
@@ -30754,15 +30941,15 @@ var init_chat2 = __esm({
30754
30941
  }
30755
30942
  const userHasAccess = playgroundBypassAccess || ossMode || claims?.roles?.includes("super-user") || claims?.roles?.includes("admin");
30756
30943
  if (!userHasAccess) {
30757
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_material51.ThemeProvider, { theme: banditTheme, children: [
30758
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_material51.CssBaseline, {}),
30759
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(under_review_default, {})
30944
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_material52.ThemeProvider, { theme: banditTheme, children: [
30945
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.CssBaseline, {}),
30946
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(under_review_default, {})
30760
30947
  ] });
30761
30948
  }
30762
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_material51.ThemeProvider, { theme: banditTheme, children: [
30763
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_material51.CssBaseline, {}),
30764
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
30765
- import_material51.Box,
30949
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_material52.ThemeProvider, { theme: banditTheme, children: [
30950
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.CssBaseline, {}),
30951
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
30952
+ import_material52.Box,
30766
30953
  {
30767
30954
  sx: (theme) => ({
30768
30955
  display: "flex",
@@ -30780,7 +30967,7 @@ var init_chat2 = __esm({
30780
30967
  transition: "left 0.3s ease-in-out, width 0.3s ease-in-out"
30781
30968
  }),
30782
30969
  children: [
30783
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
30970
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
30784
30971
  chat_app_bar_default,
30785
30972
  {
30786
30973
  availableModels,
@@ -30792,8 +30979,8 @@ var init_chat2 = __esm({
30792
30979
  setDrawerOpen
30793
30980
  }
30794
30981
  ),
30795
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
30796
- import_material51.Box,
30982
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
30983
+ import_material52.Box,
30797
30984
  {
30798
30985
  ref: chatContainerRef,
30799
30986
  sx: {
@@ -30813,8 +31000,8 @@ var init_chat2 = __esm({
30813
31000
  msOverflowStyle: "none",
30814
31001
  "&::-webkit-scrollbar": { display: "none" }
30815
31002
  },
30816
- children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
30817
- import_material51.Box,
31003
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
31004
+ import_material52.Box,
30818
31005
  {
30819
31006
  sx: {
30820
31007
  width: "100%",
@@ -30824,9 +31011,9 @@ var init_chat2 = __esm({
30824
31011
  pt: 2
30825
31012
  },
30826
31013
  children: [
30827
- logoShouldRender && !brandingLoading && (branding?.logoBase64 ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(custom_logo_default, { visible: logoVisible, atTop: true }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(bandit_chat_logo_default, { visible: logoVisible, atTop: true })),
30828
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
30829
- import_material51.Box,
31014
+ logoShouldRender && !brandingLoading && (branding?.logoBase64 ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(custom_logo_default, { visible: logoVisible, atTop: true }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(bandit_chat_logo_default, { visible: logoVisible, atTop: true })),
31015
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
31016
+ import_material52.Box,
30830
31017
  {
30831
31018
  sx: {
30832
31019
  margin: "0 auto",
@@ -30835,7 +31022,7 @@ var init_chat2 = __esm({
30835
31022
  flexShrink: 0,
30836
31023
  px: isMobile ? 0 : 0
30837
31024
  },
30838
- children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
31025
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
30839
31026
  chat_messages_default,
30840
31027
  {
30841
31028
  isStreaming,
@@ -30859,7 +31046,7 @@ var init_chat2 = __esm({
30859
31046
  )
30860
31047
  }
30861
31048
  ),
30862
- showScrollToBottom && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
31049
+ showScrollToBottom && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
30863
31050
  chat_scroll_to_bottom_button_default,
30864
31051
  {
30865
31052
  inputHeight,
@@ -30868,8 +31055,8 @@ var init_chat2 = __esm({
30868
31055
  onClick: handleScrollToBottomClick
30869
31056
  }
30870
31057
  ),
30871
- history.length === 0 && componentStatus !== "Loading" && !isMobile && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
30872
- import_material51.Box,
31058
+ history.length === 0 && componentStatus !== "Loading" && !isMobile && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
31059
+ import_material52.Box,
30873
31060
  {
30874
31061
  sx: (theme) => ({
30875
31062
  position: "absolute",
@@ -30887,8 +31074,8 @@ var init_chat2 = __esm({
30887
31074
  })
30888
31075
  }
30889
31076
  ),
30890
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
30891
- import_material51.Box,
31077
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
31078
+ import_material52.Box,
30892
31079
  {
30893
31080
  sx: {
30894
31081
  display: "flex",
@@ -30899,10 +31086,11 @@ var init_chat2 = __esm({
30899
31086
  maxWidth: "768px"
30900
31087
  },
30901
31088
  children: [
30902
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_material51.Box, { sx: { flex: "1 1 auto" } }),
30903
- history.length === 0 && componentStatus !== "Loading" && !pendingMessage && preferences.chatSuggestionsEnabled && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_material51.Box, { sx: { marginBottom: "20px" }, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(QuerySuggestionPicker, { onSend: handleSend, inputHeight }) }),
30904
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ask_user_card_default, {}),
30905
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
31089
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.Box, { sx: { flex: "1 1 auto" } }),
31090
+ history.length === 0 && componentStatus !== "Loading" && !pendingMessage && preferences.chatSuggestionsEnabled && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.Box, { sx: { marginBottom: "20px" }, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(QuerySuggestionPicker, { onSend: handleSend, inputHeight }) }),
31091
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(rate_limit_prompt_default, {}),
31092
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ask_user_card_default, {}),
31093
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
30906
31094
  chat_input_default,
30907
31095
  {
30908
31096
  inputValue,
@@ -30929,7 +31117,7 @@ var init_chat2 = __esm({
30929
31117
  ]
30930
31118
  }
30931
31119
  ),
30932
- preferences.feedbackEnabled && !isMobile && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
31120
+ preferences.feedbackEnabled && !isMobile && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
30933
31121
  FeedbackButton,
30934
31122
  {
30935
31123
  fullScreen: false,
@@ -30942,11 +31130,11 @@ var init_chat2 = __esm({
30942
31130
  }
30943
31131
  }
30944
31132
  ),
30945
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ConnectionStatus, { position: "top", showWhenGood: false })
31133
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ConnectionStatus, { position: "top", showWhenGood: false })
30946
31134
  ]
30947
31135
  }
30948
31136
  ),
30949
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(canvas_panel_default, { isMobile })
31137
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(canvas_panel_default, { isMobile })
30950
31138
  ] });
30951
31139
  };
30952
31140
  Chat = () => {
@@ -30972,9 +31160,9 @@ var init_chat2 = __esm({
30972
31160
  });
30973
31161
  if (!allowUnauthenticated && !bypassAuth && !authenticationService.isAuthenticated()) {
30974
31162
  debugLogger.debug("User is not authenticated, redirecting to login");
30975
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react_router_dom4.Navigate, { to: "/login", replace: true });
31163
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react_router_dom5.Navigate, { to: "/login", replace: true });
30976
31164
  }
30977
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ChatContent, {});
31165
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ChatContent, {});
30978
31166
  };
30979
31167
  chat_default = Chat;
30980
31168
  }
@@ -30986,13 +31174,13 @@ __export(management_exports, {
30986
31174
  default: () => management_default
30987
31175
  });
30988
31176
  module.exports = __toCommonJS(management_exports);
30989
- var import_react61 = require("react");
31177
+ var import_react62 = require("react");
30990
31178
  var import_useMediaQuery2 = __toESM(require("@mui/material/useMediaQuery"));
30991
31179
  var import_styles32 = require("@mui/material/styles");
30992
31180
  init_useKnowledgeStore();
30993
31181
  init_indexedDBService();
30994
- var import_material52 = require("@mui/material");
30995
- var import_react_router_dom5 = require("react-router-dom");
31182
+ var import_material53 = require("@mui/material");
31183
+ var import_react_router_dom6 = require("react-router-dom");
30996
31184
 
30997
31185
  // src/modals/chat-modal/chat-modal.tsx
30998
31186
  var import_react23 = require("react");
@@ -43484,7 +43672,7 @@ init_authenticationStore();
43484
43672
  init_useNotificationService();
43485
43673
  init_useFeatures();
43486
43674
  init_lucide_icons();
43487
- var import_jsx_runtime51 = require("react/jsx-runtime");
43675
+ var import_jsx_runtime52 = require("react/jsx-runtime");
43488
43676
  var preloadChatPage = () => Promise.resolve().then(() => (init_chat2(), chat_exports));
43489
43677
  var buildCapabilitiesUrl = (gatewayApiUrl) => {
43490
43678
  const trimmed = gatewayApiUrl.replace(/\/$/, "");
@@ -43494,10 +43682,10 @@ var buildCapabilitiesUrl = (gatewayApiUrl) => {
43494
43682
  return `${trimmed}/api/capabilities`;
43495
43683
  };
43496
43684
  var Management = () => {
43497
- const navigate = (0, import_react_router_dom5.useNavigate)();
43685
+ const navigate = (0, import_react_router_dom6.useNavigate)();
43498
43686
  const notificationService2 = useNotificationService();
43499
43687
  const isMobile = (0, import_useMediaQuery2.default)("(max-width:900px)");
43500
- const [sidebarOpen, setSidebarOpen] = (0, import_react61.useState)(false);
43688
+ const [sidebarOpen, setSidebarOpen] = (0, import_react62.useState)(false);
43501
43689
  const getOptimalFabLogo = async () => {
43502
43690
  const banditHead6 = "https://cdn.burtson.ai/images/bandit-head.png";
43503
43691
  try {
@@ -43537,16 +43725,16 @@ var Management = () => {
43537
43725
  hasTransparentLogo,
43538
43726
  setHasTransparentLogo
43539
43727
  } = useModelStore();
43540
- const [modalOpen, setModalOpen] = (0, import_react61.useState)(false);
43728
+ const [modalOpen, setModalOpen] = (0, import_react62.useState)(false);
43541
43729
  const banditHead5 = "https://cdn.burtson.ai/images/bandit-head.png";
43542
- const [fabLogo, setFabLogo] = (0, import_react61.useState)(banditHead5);
43543
- const [tabIndex, setTabIndex] = (0, import_react61.useState)(4);
43544
- const [logoFile, setLogoFile] = (0, import_react61.useState)(null);
43545
- const [logoBase64, setLogoBase64] = (0, import_react61.useState)(null);
43546
- const [brandingText, setBrandingText] = (0, import_react61.useState)("");
43547
- const [theme, setTheme] = (0, import_react61.useState)("bandit-dark");
43548
- const [customAvatarBase64, setCustomAvatarBase64] = (0, import_react61.useState)(null);
43549
- const [presetAvatar, setPresetAvatar] = (0, import_react61.useState)(null);
43730
+ const [fabLogo, setFabLogo] = (0, import_react62.useState)(banditHead5);
43731
+ const [tabIndex, setTabIndex] = (0, import_react62.useState)(4);
43732
+ const [logoFile, setLogoFile] = (0, import_react62.useState)(null);
43733
+ const [logoBase64, setLogoBase64] = (0, import_react62.useState)(null);
43734
+ const [brandingText, setBrandingText] = (0, import_react62.useState)("");
43735
+ const [theme, setTheme] = (0, import_react62.useState)("bandit-dark");
43736
+ const [customAvatarBase64, setCustomAvatarBase64] = (0, import_react62.useState)(null);
43737
+ const [presetAvatar, setPresetAvatar] = (0, import_react62.useState)(null);
43550
43738
  const showSnackbarMessage = (message, severity = "success") => {
43551
43739
  if (severity === "success") {
43552
43740
  notificationService2?.showSuccess(message);
@@ -43554,9 +43742,9 @@ var Management = () => {
43554
43742
  notificationService2?.showError(message);
43555
43743
  }
43556
43744
  };
43557
- const [restoreDialogOpen, setRestoreDialogOpen] = (0, import_react61.useState)(false);
43558
- const [brandingLoaded, setBrandingLoaded] = (0, import_react61.useState)(false);
43559
- const [isLoadingBranding, setIsLoadingBranding] = (0, import_react61.useState)(false);
43745
+ const [restoreDialogOpen, setRestoreDialogOpen] = (0, import_react62.useState)(false);
43746
+ const [brandingLoaded, setBrandingLoaded] = (0, import_react62.useState)(false);
43747
+ const [isLoadingBranding, setIsLoadingBranding] = (0, import_react62.useState)(false);
43560
43748
  const { initModels } = useModelStore();
43561
43749
  const { settings: packageSettings } = usePackageSettingsStore();
43562
43750
  const authToken = useAuthenticationStore((state) => state.token);
@@ -43564,8 +43752,8 @@ var Management = () => {
43564
43752
  const { hasAdminDashboard, hasLimitedAdminDashboard, getCurrentTier, hasAdvancedSearch } = useFeatures();
43565
43753
  const { showAdminPanel, showLimitedAdminPanel } = useFeatureVisibility();
43566
43754
  const { provider: currentProvider, config: currentProviderConfig } = useAIProviderStore();
43567
- const [seedPacksEnabled, setSeedPacksEnabled] = (0, import_react61.useState)(false);
43568
- const [localSelectedModel, setLocalSelectedModel] = (0, import_react61.useState)({
43755
+ const [seedPacksEnabled, setSeedPacksEnabled] = (0, import_react62.useState)(false);
43756
+ const [localSelectedModel, setLocalSelectedModel] = (0, import_react62.useState)({
43569
43757
  name: "",
43570
43758
  tagline: "",
43571
43759
  systemPrompt: "",
@@ -43578,7 +43766,7 @@ var Management = () => {
43578
43766
  loadDocuments,
43579
43767
  clearAllDocuments
43580
43768
  } = useKnowledgeStore2();
43581
- (0, import_react61.useEffect)(() => {
43769
+ (0, import_react62.useEffect)(() => {
43582
43770
  if (selectedModel) {
43583
43771
  const selected = availableModels.find((m) => m.name === selectedModel);
43584
43772
  if (selected) {
@@ -43602,7 +43790,7 @@ var Management = () => {
43602
43790
  }
43603
43791
  }
43604
43792
  }, [selectedModel, availableModels]);
43605
- const loadBrandingConfig = (0, import_react61.useCallback)(async () => {
43793
+ const loadBrandingConfig = (0, import_react62.useCallback)(async () => {
43606
43794
  if (isLoadingBranding || brandingLoaded) {
43607
43795
  debugLogger.warn("Branding loading already in progress or completed, skipping");
43608
43796
  return;
@@ -43717,15 +43905,15 @@ var Management = () => {
43717
43905
  setTagline,
43718
43906
  setTheme
43719
43907
  ]);
43720
- (0, import_react61.useEffect)(() => {
43908
+ (0, import_react62.useEffect)(() => {
43721
43909
  void loadBrandingConfig();
43722
43910
  }, [loadBrandingConfig]);
43723
43911
  const handleOpenModal = () => setModalOpen(true);
43724
43912
  const handleCloseModal = () => setModalOpen(false);
43725
- (0, import_react61.useEffect)(() => {
43913
+ (0, import_react62.useEffect)(() => {
43726
43914
  getOptimalFabLogo().then(setFabLogo);
43727
43915
  }, []);
43728
- (0, import_react61.useEffect)(() => {
43916
+ (0, import_react62.useEffect)(() => {
43729
43917
  if (logoBase64) {
43730
43918
  setFabLogo(logoBase64);
43731
43919
  } else {
@@ -44172,7 +44360,7 @@ var Management = () => {
44172
44360
  reader.readAsText(file);
44173
44361
  }
44174
44362
  };
44175
- (0, import_react61.useEffect)(() => {
44363
+ (0, import_react62.useEffect)(() => {
44176
44364
  if (localSelectedModel.selectedModel && !availableModels.some((m) => m.name === localSelectedModel.selectedModel)) {
44177
44365
  setLocalSelectedModel((prev) => ({
44178
44366
  ...prev,
@@ -44180,10 +44368,10 @@ var Management = () => {
44180
44368
  }));
44181
44369
  }
44182
44370
  }, [availableModels, localSelectedModel.selectedModel]);
44183
- (0, import_react61.useEffect)(() => {
44371
+ (0, import_react62.useEffect)(() => {
44184
44372
  loadDocuments();
44185
44373
  }, [loadDocuments]);
44186
- (0, import_react61.useEffect)(() => {
44374
+ (0, import_react62.useEffect)(() => {
44187
44375
  const gatewayApiUrl = packageSettings?.gatewayApiUrl;
44188
44376
  if (!gatewayApiUrl || gatewayApiUrl.toLowerCase().startsWith("playground://")) {
44189
44377
  setSeedPacksEnabled(false);
@@ -44226,7 +44414,7 @@ var Management = () => {
44226
44414
  isActive = false;
44227
44415
  };
44228
44416
  }, [packageSettings?.gatewayApiUrl, authToken]);
44229
- const currentTheme = (0, import_react61.useMemo)(() => {
44417
+ const currentTheme = (0, import_react62.useMemo)(() => {
44230
44418
  const baseTheme = predefinedThemes[theme] || banditDarkTheme;
44231
44419
  return (0, import_styles32.createTheme)(baseTheme, {
44232
44420
  // Management-scoped density: condenses every settings tab at once. This
@@ -44283,43 +44471,43 @@ var Management = () => {
44283
44471
  const allNavTabs = [
44284
44472
  {
44285
44473
  label: "Personalities",
44286
- icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(FaceRetouchingNaturalIcon, {}),
44474
+ icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(FaceRetouchingNaturalIcon, {}),
44287
44475
  requiresFeature: "limitedAdminDashboard",
44288
44476
  requiresAdmin: true
44289
44477
  },
44290
44478
  {
44291
44479
  label: "Branding",
44292
- icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(BrushIcon, {}),
44480
+ icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(BrushIcon, {}),
44293
44481
  requiresFeature: "limitedAdminDashboard",
44294
44482
  requiresAdmin: true
44295
44483
  },
44296
44484
  {
44297
44485
  label: "Knowledge",
44298
- icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(MenuBookIcon, {}),
44486
+ icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(MenuBookIcon, {}),
44299
44487
  requiresFeature: "limitedAdminDashboard",
44300
44488
  requiresAdmin: true
44301
44489
  },
44302
44490
  {
44303
44491
  label: "Storage",
44304
- icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(StorageIcon, {}),
44492
+ icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(StorageIcon, {}),
44305
44493
  requiresFeature: "limitedAdminDashboard",
44306
44494
  requiresAdmin: true
44307
44495
  },
44308
44496
  {
44309
44497
  label: "Preferences",
44310
- icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TuneIcon, {}),
44498
+ icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(TuneIcon, {}),
44311
44499
  requiresFeature: "limitedAdminDashboard",
44312
44500
  requiresAdmin: false
44313
44501
  },
44314
44502
  {
44315
44503
  label: "Provider",
44316
- icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(CloudIcon, {}),
44504
+ icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(CloudIcon, {}),
44317
44505
  requiresFeature: "advancedSearch",
44318
44506
  requiresAdmin: true
44319
44507
  },
44320
44508
  {
44321
44509
  label: "Tools",
44322
- icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(BuildIcon, {}),
44510
+ icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(BuildIcon, {}),
44323
44511
  requiresFeature: "advancedSearch",
44324
44512
  requiresAdmin: true
44325
44513
  }
@@ -44347,7 +44535,7 @@ var Management = () => {
44347
44535
  });
44348
44536
  const preferredDefaultTabIndex = navTabs.findIndex((tab) => tab.label === "Preferences");
44349
44537
  const defaultTabIndex = preferredDefaultTabIndex >= 0 ? preferredDefaultTabIndex : 0;
44350
- (0, import_react61.useEffect)(() => {
44538
+ (0, import_react62.useEffect)(() => {
44351
44539
  setTabIndex((current) => {
44352
44540
  if (current < 0 || current >= navTabs.length) {
44353
44541
  return defaultTabIndex;
@@ -44357,8 +44545,8 @@ var Management = () => {
44357
44545
  }, [navTabs.length, defaultTabIndex]);
44358
44546
  const mobileQuickTabs = navTabs.slice(0, 5);
44359
44547
  const hasMobileOverflowTabs = navTabs.length > mobileQuickTabs.length;
44360
- const navigationContent = /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
44361
- import_material52.Box,
44548
+ const navigationContent = /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
44549
+ import_material53.Box,
44362
44550
  {
44363
44551
  sx: {
44364
44552
  display: "flex",
@@ -44368,8 +44556,8 @@ var Management = () => {
44368
44556
  bgcolor: "inherit"
44369
44557
  },
44370
44558
  children: [
44371
- isMobile && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
44372
- import_material52.Box,
44559
+ isMobile && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
44560
+ import_material53.Box,
44373
44561
  {
44374
44562
  sx: {
44375
44563
  height: 6,
@@ -44382,15 +44570,15 @@ var Management = () => {
44382
44570
  }
44383
44571
  }
44384
44572
  ),
44385
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.Box, { sx: { p: isMobile ? 2.5 : 3, pb: isMobile ? 1.5 : 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
44386
- import_material52.Button,
44573
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_material53.Box, { sx: { p: isMobile ? 2.5 : 3, pb: isMobile ? 1.5 : 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
44574
+ import_material53.Button,
44387
44575
  {
44388
44576
  onClick: () => {
44389
44577
  if (isMobile) setSidebarOpen(false);
44390
44578
  navigate("/chat");
44391
44579
  },
44392
44580
  onMouseEnter: preloadChatPage,
44393
- startIcon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ChevronLeftIcon, { sx: { fontSize: 20 } }),
44581
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ChevronLeftIcon, { sx: { fontSize: 20 } }),
44394
44582
  fullWidth: true,
44395
44583
  variant: "outlined",
44396
44584
  sx: {
@@ -44417,9 +44605,9 @@ var Management = () => {
44417
44605
  children: "Back to Chat"
44418
44606
  }
44419
44607
  ) }),
44420
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.Divider, { sx: { mx: isMobile ? 2 : 3, mb: 2, opacity: 0.6 } }),
44421
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.Box, { sx: { flex: 1, px: isMobile ? 1.5 : 2, pb: 3, overflowY: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.List, { sx: { px: 0, py: 0 }, children: navTabs.map((tab, idx) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
44422
- import_material52.ListItemButton,
44608
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_material53.Divider, { sx: { mx: isMobile ? 2 : 3, mb: 2, opacity: 0.6 } }),
44609
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_material53.Box, { sx: { flex: 1, px: isMobile ? 1.5 : 2, pb: 3, overflowY: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_material53.List, { sx: { px: 0, py: 0 }, children: navTabs.map((tab, idx) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
44610
+ import_material53.ListItemButton,
44423
44611
  {
44424
44612
  selected: tabIndex === idx,
44425
44613
  onClick: () => {
@@ -44459,9 +44647,9 @@ var Management = () => {
44459
44647
  "& .MuiListItemIcon-root svg": { width: 17, height: 17 }
44460
44648
  },
44461
44649
  children: [
44462
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.ListItemIcon, { children: tab.icon }),
44463
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
44464
- import_material52.ListItemText,
44650
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_material53.ListItemIcon, { children: tab.icon }),
44651
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
44652
+ import_material53.ListItemText,
44465
44653
  {
44466
44654
  primary: tab.label,
44467
44655
  primaryTypographyProps: {
@@ -44478,10 +44666,10 @@ var Management = () => {
44478
44666
  }
44479
44667
  );
44480
44668
  if (!brandingLoaded) return null;
44481
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_material52.ThemeProvider, { theme: currentTheme, children: [
44482
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.CssBaseline, {}),
44483
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
44484
- import_material52.Box,
44669
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_material53.ThemeProvider, { theme: currentTheme, children: [
44670
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_material53.CssBaseline, {}),
44671
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
44672
+ import_material53.Box,
44485
44673
  {
44486
44674
  display: "flex",
44487
44675
  height: "100vh",
@@ -44493,8 +44681,8 @@ var Management = () => {
44493
44681
  position: "relative"
44494
44682
  },
44495
44683
  children: [
44496
- isMobile && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
44497
- import_material52.Box,
44684
+ isMobile && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
44685
+ import_material53.Box,
44498
44686
  {
44499
44687
  sx: {
44500
44688
  width: "100%",
@@ -44513,8 +44701,8 @@ var Management = () => {
44513
44701
  boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
44514
44702
  },
44515
44703
  children: [
44516
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
44517
- import_material52.Button,
44704
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
44705
+ import_material53.Button,
44518
44706
  {
44519
44707
  onClick: () => setSidebarOpen((o) => !o),
44520
44708
  sx: {
@@ -44535,7 +44723,7 @@ var Management = () => {
44535
44723
  transform: sidebarOpen ? "rotate(90deg) scale(0.95)" : "scale(0.95)"
44536
44724
  }
44537
44725
  },
44538
- children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
44726
+ children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
44539
44727
  "path",
44540
44728
  {
44541
44729
  d: sidebarOpen ? "M18 6L6 18M6 6L18 18" : "M3 12H21M3 6H21M3 18H21",
@@ -44547,8 +44735,8 @@ var Management = () => {
44547
44735
  ) })
44548
44736
  }
44549
44737
  ),
44550
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
44551
- import_material52.Typography,
44738
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
44739
+ import_material53.Typography,
44552
44740
  {
44553
44741
  variant: "h6",
44554
44742
  sx: {
@@ -44560,14 +44748,14 @@ var Management = () => {
44560
44748
  children: "Management"
44561
44749
  }
44562
44750
  ),
44563
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.Box, { sx: {
44751
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_material53.Box, { sx: {
44564
44752
  px: 2,
44565
44753
  py: 0.5,
44566
44754
  borderRadius: 2,
44567
44755
  bgcolor: (theme2) => theme2.palette.mode === "dark" ? "rgba(25,118,210,0.12)" : "rgba(25,118,210,0.08)",
44568
44756
  border: (theme2) => `1px solid ${theme2.palette.primary.main}20`
44569
- }, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
44570
- import_material52.Typography,
44757
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
44758
+ import_material53.Typography,
44571
44759
  {
44572
44760
  variant: "caption",
44573
44761
  sx: {
@@ -44581,8 +44769,8 @@ var Management = () => {
44581
44769
  ]
44582
44770
  }
44583
44771
  ),
44584
- isMobile && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
44585
- import_material52.Box,
44772
+ isMobile && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
44773
+ import_material53.Box,
44586
44774
  {
44587
44775
  sx: {
44588
44776
  width: "100%",
@@ -44599,8 +44787,8 @@ var Management = () => {
44599
44787
  mobileQuickTabs.map((tab) => {
44600
44788
  const quickTabIndex = navTabs.findIndex((navTab) => navTab.label === tab.label);
44601
44789
  const selected = tabIndex === quickTabIndex;
44602
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
44603
- import_material52.Button,
44790
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
44791
+ import_material53.Button,
44604
44792
  {
44605
44793
  size: "small",
44606
44794
  onClick: () => setTabIndex(quickTabIndex),
@@ -44625,8 +44813,8 @@ var Management = () => {
44625
44813
  tab.label
44626
44814
  );
44627
44815
  }),
44628
- hasMobileOverflowTabs && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
44629
- import_material52.Button,
44816
+ hasMobileOverflowTabs && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
44817
+ import_material53.Button,
44630
44818
  {
44631
44819
  size: "small",
44632
44820
  onClick: () => setSidebarOpen(true),
@@ -44648,8 +44836,8 @@ var Management = () => {
44648
44836
  ]
44649
44837
  }
44650
44838
  ),
44651
- isMobile ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
44652
- import_material52.SwipeableDrawer,
44839
+ isMobile ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
44840
+ import_material53.SwipeableDrawer,
44653
44841
  {
44654
44842
  anchor: "bottom",
44655
44843
  open: sidebarOpen,
@@ -44669,8 +44857,8 @@ var Management = () => {
44669
44857
  },
44670
44858
  children: navigationContent
44671
44859
  }
44672
- ) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
44673
- import_material52.Box,
44860
+ ) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
44861
+ import_material53.Box,
44674
44862
  {
44675
44863
  sx: {
44676
44864
  width: 240,
@@ -44693,8 +44881,8 @@ var Management = () => {
44693
44881
  children: navigationContent
44694
44882
  }
44695
44883
  ),
44696
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
44697
- import_material52.Box,
44884
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
44885
+ import_material53.Box,
44698
44886
  {
44699
44887
  sx: {
44700
44888
  flex: 1,
@@ -44713,7 +44901,7 @@ var Management = () => {
44713
44901
  transition: "margin-left 0.2s"
44714
44902
  },
44715
44903
  children: [
44716
- navTabs[tabIndex]?.label === "Personalities" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
44904
+ navTabs[tabIndex]?.label === "Personalities" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
44717
44905
  PersonalitiesTab_default,
44718
44906
  {
44719
44907
  availableModels,
@@ -44732,7 +44920,7 @@ var Management = () => {
44732
44920
  showSnackbar: showSnackbarMessage
44733
44921
  }
44734
44922
  ),
44735
- navTabs[tabIndex]?.label === "Branding" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
44923
+ navTabs[tabIndex]?.label === "Branding" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
44736
44924
  BrandingTab_default,
44737
44925
  {
44738
44926
  logoFile,
@@ -44751,7 +44939,7 @@ var Management = () => {
44751
44939
  setLogoBase64
44752
44940
  }
44753
44941
  ),
44754
- navTabs[tabIndex]?.label === "Knowledge" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
44942
+ navTabs[tabIndex]?.label === "Knowledge" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
44755
44943
  KnowledgeHubTab_default,
44756
44944
  {
44757
44945
  documents,
@@ -44764,8 +44952,8 @@ var Management = () => {
44764
44952
  seedPacksEnabled
44765
44953
  }
44766
44954
  ),
44767
- navTabs[tabIndex]?.label === "Storage" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(StorageTab_default, { currentTheme }),
44768
- navTabs[tabIndex]?.label === "Preferences" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
44955
+ navTabs[tabIndex]?.label === "Storage" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(StorageTab_default, { currentTheme }),
44956
+ navTabs[tabIndex]?.label === "Preferences" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
44769
44957
  PreferencesTab_default,
44770
44958
  {
44771
44959
  preferences,
@@ -44775,13 +44963,13 @@ var Management = () => {
44775
44963
  showSnackbar: showSnackbarMessage
44776
44964
  }
44777
44965
  ),
44778
- navTabs[tabIndex]?.label === "Provider" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ProviderTab, {}),
44779
- navTabs[tabIndex]?.label === "Tools" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(MCPToolsTabV2_default, {})
44966
+ navTabs[tabIndex]?.label === "Provider" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ProviderTab, {}),
44967
+ navTabs[tabIndex]?.label === "Tools" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(MCPToolsTabV2_default, {})
44780
44968
  ]
44781
44969
  }
44782
44970
  ),
44783
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
44784
- import_material52.Fab,
44971
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
44972
+ import_material53.Fab,
44785
44973
  {
44786
44974
  "aria-label": "AI",
44787
44975
  onClick: handleOpenModal,
@@ -44802,7 +44990,7 @@ var Management = () => {
44802
44990
  boxShadow: theme2.shadows[6],
44803
44991
  zIndex: 2e3
44804
44992
  }),
44805
- children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
44993
+ children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
44806
44994
  "img",
44807
44995
  {
44808
44996
  src: fabLogo,
@@ -44816,7 +45004,7 @@ var Management = () => {
44816
45004
  )
44817
45005
  }
44818
45006
  ),
44819
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(chat_modal_default, { open: modalOpen, onClose: handleCloseModal })
45007
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(chat_modal_default, { open: modalOpen, onClose: handleCloseModal })
44820
45008
  ]
44821
45009
  }
44822
45010
  )