@burtson-labs/bandit-engine 2.0.162 → 2.0.164
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -22
- package/dist/aiProviderStore-PEGSX4PK.mjs +9 -0
- package/dist/chat-OSAVW6L2.mjs +16 -0
- package/dist/chat-provider.js.map +1 -1
- package/dist/chat-provider.mjs +7 -7
- package/dist/{chunk-ZNK3ELTZ.mjs → chunk-5KBTOCQZ.mjs} +4 -4
- package/dist/chunk-5KBTOCQZ.mjs.map +1 -0
- package/dist/{chunk-Q6LXVYTC.mjs → chunk-CQJGUYRW.mjs} +2 -2
- package/dist/chunk-CQJGUYRW.mjs.map +1 -0
- package/dist/{chunk-47MOBOP3.mjs → chunk-IZX2J65Q.mjs} +2 -2
- package/dist/chunk-IZX2J65Q.mjs.map +1 -0
- package/dist/{chunk-ODGVCSKV.mjs → chunk-J6SWNO7Z.mjs} +6 -27
- package/dist/chunk-J6SWNO7Z.mjs.map +1 -0
- package/dist/{chunk-3ACT5BTW.mjs → chunk-JYBQAKSZ.mjs} +125 -232
- package/dist/chunk-JYBQAKSZ.mjs.map +1 -0
- package/dist/{chunk-G5POQT2R.mjs → chunk-O6P37PFR.mjs} +4 -4
- package/dist/chunk-O6P37PFR.mjs.map +1 -0
- package/dist/{chunk-KCI46M23.mjs → chunk-OCVZVBQQ.mjs} +1 -1
- package/dist/chunk-OCVZVBQQ.mjs.map +1 -0
- package/dist/{chunk-IXIM7BNO.mjs → chunk-P4C5IRM5.mjs} +1 -1
- package/dist/chunk-P4C5IRM5.mjs.map +1 -0
- package/dist/{chunk-RUXYVMW2.mjs → chunk-PNQRS5EN.mjs} +11 -11
- package/dist/chunk-PNQRS5EN.mjs.map +1 -0
- package/dist/{chunk-WQEBTH2R.mjs → chunk-TY5VL3SG.mjs} +3 -3
- package/dist/chunk-TY5VL3SG.mjs.map +1 -0
- package/dist/{chunk-YHSYHU5P.mjs → chunk-URZSIL7X.mjs} +7 -7
- package/dist/chunk-URZSIL7X.mjs.map +1 -0
- package/dist/{chunk-OGMXL7BF.mjs → chunk-VBHI4TJC.mjs} +6 -6
- package/dist/chunk-VBHI4TJC.mjs.map +1 -0
- package/dist/{chunk-R6HMLYKQ.mjs → chunk-WLNZL6SP.mjs} +5 -16
- package/dist/chunk-WLNZL6SP.mjs.map +1 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +577 -728
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -31
- package/dist/index.mjs.map +1 -1
- package/dist/management/management.js +217 -352
- package/dist/management/management.js.map +1 -1
- package/dist/management/management.mjs +10 -10
- package/dist/{memoryUtils-33TZKHSQ.mjs → memoryUtils-2FVXDSS6.mjs} +1 -1
- package/dist/memoryUtils-2FVXDSS6.mjs.map +1 -0
- package/dist/modals/chat-modal/chat-modal.js.map +1 -1
- package/dist/modals/chat-modal/chat-modal.mjs +6 -6
- package/dist/modelStore-7XYYDCNC.mjs +9 -0
- package/dist/shared/custom-element.js.map +1 -1
- package/dist/shared/custom-element.mjs +1 -1
- package/docs/05_contributing.md +1 -1
- package/docs/api_reference/assets/navigation.js +1 -1
- package/docs/api_reference/assets/search.js +1 -1
- package/docs/api_reference/classes/DebugLogger.html +11 -11
- package/docs/api_reference/classes/FeatureFlagService.html +13 -13
- package/docs/api_reference/classes/NotificationService.html +10 -10
- package/docs/api_reference/classes/StreamingTTSClient.html +9 -9
- package/docs/api_reference/classes/VectorDatabaseService.html +24 -24
- package/docs/api_reference/classes/VectorMigrationService.html +8 -8
- package/docs/api_reference/classes/VoiceService.html +2 -2
- package/docs/api_reference/enums/TTSState.html +2 -2
- package/docs/api_reference/functions/Chat.html +1 -1
- package/docs/api_reference/functions/ChatModal.html +1 -1
- package/docs/api_reference/functions/ChatProvider.html +1 -1
- package/docs/api_reference/functions/FeatureFlagProvider.html +1 -1
- package/docs/api_reference/functions/FeedbackButton.html +1 -1
- package/docs/api_reference/functions/FeedbackModal.html +1 -1
- package/docs/api_reference/functions/InterestsEditor.html +5 -0
- package/docs/api_reference/functions/Management.html +1 -1
- package/docs/api_reference/functions/NotificationProvider.html +1 -1
- package/docs/api_reference/functions/SubscriptionExpiredGuard.html +1 -1
- package/docs/api_reference/functions/SubscriptionExpiredModal.html +1 -1
- package/docs/api_reference/functions/defineCustomElement.html +1 -1
- package/docs/api_reference/functions/getCriticalConfig.html +2 -1
- package/docs/api_reference/functions/getFeatureMatrix.html +1 -1
- package/docs/api_reference/functions/getStreamingTTSClient.html +1 -1
- package/docs/api_reference/functions/getSystemConstants.html +2 -1
- package/docs/api_reference/functions/getTTSState.html +1 -1
- package/docs/api_reference/functions/handleHttpError.html +1 -1
- package/docs/api_reference/functions/handleSubscriptionUpgrade.html +1 -1
- package/docs/api_reference/functions/handleValidationError.html +1 -1
- package/docs/api_reference/functions/initializeCoreSystem.html +2 -1
- package/docs/api_reference/functions/isWorkspaceAdminRole.html +6 -0
- package/docs/api_reference/functions/pauseTTS.html +1 -1
- package/docs/api_reference/functions/previewTierUpgrade.html +1 -1
- package/docs/api_reference/functions/resolveManagementSections.html +2 -0
- package/docs/api_reference/functions/resumeTTS.html +1 -1
- package/docs/api_reference/functions/showInfoNotification.html +1 -1
- package/docs/api_reference/functions/showSuccessNotification.html +1 -1
- package/docs/api_reference/functions/speakWithStreaming.html +1 -1
- package/docs/api_reference/functions/stopTTS.html +1 -1
- package/docs/api_reference/functions/syncSubscriptionWithAPI.html +1 -1
- package/docs/api_reference/functions/updateSubscriptionTier.html +1 -1
- package/docs/api_reference/functions/useFeatureFlag.html +1 -1
- package/docs/api_reference/functions/useFeatureVisibility.html +1 -1
- package/docs/api_reference/functions/useFeatures.html +1 -1
- package/docs/api_reference/functions/useGatewayHealth.html +1 -1
- package/docs/api_reference/functions/useGatewayMemory.html +1 -1
- package/docs/api_reference/functions/useGatewayModels.html +1 -1
- package/docs/api_reference/functions/useGlobalTTS.html +1 -1
- package/docs/api_reference/functions/useManagementAccess.html +2 -0
- package/docs/api_reference/functions/useNotification.html +1 -1
- package/docs/api_reference/functions/useNotificationService.html +1 -1
- package/docs/api_reference/functions/useTTS.html +1 -1
- package/docs/api_reference/functions/useVectorStore.html +1 -1
- package/docs/api_reference/functions/useVoiceStore.html +2 -2
- package/docs/api_reference/functions/useVoices.html +1 -1
- package/docs/api_reference/functions/validateEnvironment.html +2 -1
- package/docs/api_reference/functions/validateSystemIntegrity.html +2 -1
- package/docs/api_reference/index.html +219 -155
- package/docs/api_reference/interfaces/AIChatRequest.html +2 -2
- package/docs/api_reference/interfaces/AIChatResponse.html +2 -2
- package/docs/api_reference/interfaces/AIGenerateRequest.html +2 -2
- package/docs/api_reference/interfaces/AIGenerateResponse.html +2 -2
- package/docs/api_reference/interfaces/AIMessage.html +2 -2
- package/docs/api_reference/interfaces/AIModel.html +2 -2
- package/docs/api_reference/interfaces/AIProviderConfig.html +5 -2
- package/docs/api_reference/interfaces/ChatConfig.html +3 -3
- package/docs/api_reference/interfaces/ChatModalProps.html +3 -3
- package/docs/api_reference/interfaces/CreateMemoryOptions.html +2 -2
- package/docs/api_reference/interfaces/FeatureEvaluation.html +7 -7
- package/docs/api_reference/interfaces/FeatureFlagConfig.html +9 -9
- package/docs/api_reference/interfaces/FeatureFlagContextValue.html +8 -8
- package/docs/api_reference/interfaces/FeatureFlagProviderProps.html +2 -2
- package/docs/api_reference/interfaces/FeedbackButtonProps.html +10 -10
- package/docs/api_reference/interfaces/FeedbackCategories.html +2 -2
- package/docs/api_reference/interfaces/FeedbackModalProps.html +2 -2
- package/docs/api_reference/interfaces/FeedbackPriorities.html +2 -2
- package/docs/api_reference/interfaces/FeedbackRequest.html +2 -2
- package/docs/api_reference/interfaces/FeedbackResponse.html +2 -2
- package/docs/api_reference/interfaces/FileUploadResult.html +2 -2
- package/docs/api_reference/interfaces/GatewayChatRequest.html +3 -2
- package/docs/api_reference/interfaces/GatewayChatResponse.html +2 -2
- package/docs/api_reference/interfaces/GatewayContract.html +2 -2
- package/docs/api_reference/interfaces/GatewayGenerateRequest.html +2 -2
- package/docs/api_reference/interfaces/GatewayGenerateResponse.html +2 -2
- package/docs/api_reference/interfaces/GatewayHealthResponse.html +2 -2
- package/docs/api_reference/interfaces/GatewayMemoryRecord.html +2 -2
- package/docs/api_reference/interfaces/GatewayMemoryResponse.html +2 -2
- package/docs/api_reference/interfaces/GatewayMessage.html +2 -2
- package/docs/api_reference/interfaces/GatewayMessageContent.html +2 -2
- package/docs/api_reference/interfaces/GatewayModel.html +2 -2
- package/docs/api_reference/interfaces/GatewayModelsResponse.html +2 -2
- package/docs/api_reference/interfaces/ManagementAccess.html +5 -0
- package/docs/api_reference/interfaces/ManagementAccessInput.html +5 -0
- package/docs/api_reference/interfaces/ManagementLink.html +7 -0
- package/docs/api_reference/interfaces/ManagementProps.html +22 -0
- package/docs/api_reference/interfaces/ManagementSectionDef.html +10 -0
- package/docs/api_reference/interfaces/MemorySearchFilters.html +2 -2
- package/docs/api_reference/interfaces/MigrationProgress.html +2 -2
- package/docs/api_reference/interfaces/MigrationStatus.html +2 -2
- package/docs/api_reference/interfaces/NotificationConfig.html +2 -2
- package/docs/api_reference/interfaces/NotificationContextType.html +2 -2
- package/docs/api_reference/interfaces/NotificationProviderProps.html +2 -2
- package/docs/api_reference/interfaces/PackageSettings.html +11 -2
- package/docs/api_reference/interfaces/SearchOptions.html +2 -2
- package/docs/api_reference/interfaces/SearchResult.html +2 -2
- package/docs/api_reference/interfaces/SubscriptionExpiredGuardProps.html +2 -2
- package/docs/api_reference/interfaces/SubscriptionExpiredModalProps.html +2 -2
- package/docs/api_reference/interfaces/TTSOptions.html +2 -2
- package/docs/api_reference/interfaces/TTSProgress.html +2 -2
- package/docs/api_reference/interfaces/TrialUsage.html +2 -2
- package/docs/api_reference/interfaces/UploadRequest.html +3 -3
- package/docs/api_reference/interfaces/UseTTSReturn.html +2 -2
- package/docs/api_reference/interfaces/VectorDocument.html +2 -2
- package/docs/api_reference/interfaces/VectorMemory.html +2 -2
- package/docs/api_reference/interfaces/VectorMemoryMetadata.html +2 -2
- package/docs/api_reference/interfaces/VectorStoreStatus.html +2 -2
- package/docs/api_reference/interfaces/VoiceModelsResponse.html +2 -2
- package/docs/api_reference/interfaces/VoiceState.html +2 -2
- package/docs/api_reference/media/PROTECTION-NOTICE.md +6 -55
- package/docs/api_reference/media/README.md +20 -1
- package/docs/api_reference/modules.html +18 -6
- package/docs/api_reference/types/FeatureKey.html +1 -1
- package/docs/api_reference/types/FeatureMatrix.html +1 -1
- package/docs/api_reference/types/GatewayQueryOptions.html +1 -1
- package/docs/api_reference/types/LogContext.html +1 -1
- package/docs/api_reference/types/ManagementRequest.html +1 -0
- package/docs/api_reference/types/ManagementSectionId.html +2 -0
- package/docs/api_reference/types/SubscriptionTier.html +1 -1
- package/docs/api_reference/variables/DEFAULT_TIER_FEATURES.html +1 -1
- package/docs/api_reference/variables/FeatureFlagContext.html +1 -1
- package/docs/api_reference/variables/MANAGEMENT_SECTIONS.html +1 -0
- package/docs/api_reference/variables/OSS_DEFAULT_FEATURES.html +1 -1
- package/docs/api_reference/variables/SYSTEM_FLAGS.html +2 -1
- package/docs/api_reference/variables/authenticationService.html +1 -1
- package/docs/api_reference/variables/debugLogger-1.html +1 -1
- package/docs/api_reference/variables/featureFlagService-1.html +1 -1
- package/docs/api_reference/variables/notificationService-1.html +1 -1
- package/docs/api_reference/variables/vectorDatabaseService-1.html +1 -1
- package/docs/api_reference/variables/vectorMigrationService-1.html +1 -1
- package/docs/api_reference/variables/voiceService-1.html +1 -1
- package/package.json +1 -1
- package/dist/aiProviderStore-JOB2H4LP.mjs +0 -9
- package/dist/chat-LB6UEEEW.mjs +0 -16
- package/dist/chunk-3ACT5BTW.mjs.map +0 -1
- package/dist/chunk-47MOBOP3.mjs.map +0 -1
- package/dist/chunk-G5POQT2R.mjs.map +0 -1
- package/dist/chunk-IXIM7BNO.mjs.map +0 -1
- package/dist/chunk-KCI46M23.mjs.map +0 -1
- package/dist/chunk-ODGVCSKV.mjs.map +0 -1
- package/dist/chunk-OGMXL7BF.mjs.map +0 -1
- package/dist/chunk-Q6LXVYTC.mjs.map +0 -1
- package/dist/chunk-R6HMLYKQ.mjs.map +0 -1
- package/dist/chunk-RUXYVMW2.mjs.map +0 -1
- package/dist/chunk-WQEBTH2R.mjs.map +0 -1
- package/dist/chunk-YHSYHU5P.mjs.map +0 -1
- package/dist/chunk-ZNK3ELTZ.mjs.map +0 -1
- package/dist/memoryUtils-33TZKHSQ.mjs.map +0 -1
- package/dist/modelStore-FGUGOWTL.mjs +0 -9
- package/docs/api_reference/media/PROTECTION-README.md +0 -39
- /package/dist/{aiProviderStore-JOB2H4LP.mjs.map → aiProviderStore-PEGSX4PK.mjs.map} +0 -0
- /package/dist/{chat-LB6UEEEW.mjs.map → chat-OSAVW6L2.mjs.map} +0 -0
- /package/dist/{modelStore-FGUGOWTL.mjs.map → modelStore-7XYYDCNC.mjs.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -6905,13 +6905,12 @@ var init_aiProviderStore = __esm({
|
|
|
6905
6905
|
});
|
|
6906
6906
|
|
|
6907
6907
|
// src/util.ts
|
|
6908
|
-
var toTitleCase,
|
|
6908
|
+
var toTitleCase, generateSeed, fetchAndConvertToBase64, detectTransparency, banditHead, modelAvatars, resolveAvatar;
|
|
6909
6909
|
var init_util = __esm({
|
|
6910
6910
|
"src/util.ts"() {
|
|
6911
6911
|
"use strict";
|
|
6912
6912
|
init_debugLogger();
|
|
6913
6913
|
toTitleCase = (str) => str.toLowerCase().split(" ").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
|
|
6914
|
-
randomRange = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
|
|
6915
6914
|
generateSeed = () => Math.floor(Math.random() * 1e4);
|
|
6916
6915
|
fetchAndConvertToBase64 = async (src) => {
|
|
6917
6916
|
const response = await fetch(src);
|
|
@@ -6971,30 +6970,12 @@ var init_util = __esm({
|
|
|
6971
6970
|
});
|
|
6972
6971
|
|
|
6973
6972
|
// src/prompts/getStableQuestionPrompt.ts
|
|
6974
|
-
var TOPICS,
|
|
6973
|
+
var TOPICS, getStableQuestionPrompt;
|
|
6975
6974
|
var init_getStableQuestionPrompt = __esm({
|
|
6976
6975
|
"src/prompts/getStableQuestionPrompt.ts"() {
|
|
6977
6976
|
"use strict";
|
|
6978
6977
|
init_util();
|
|
6979
6978
|
TOPICS = ["everyday life", "finance", "sports", "travel", "technology", "politics", "health", "food", "entertainment", "education", "science", "history", "art", "music", "literature", "philosophy", "psychology", "sociology", "environmental issues", "current events"];
|
|
6980
|
-
getRandomTopicOfInterest = () => {
|
|
6981
|
-
const minIndex = 0;
|
|
6982
|
-
const maxIndex = TOPICS.length - 1;
|
|
6983
|
-
const randomIndex = randomRange(minIndex, maxIndex);
|
|
6984
|
-
const randomTopic = TOPICS[randomIndex];
|
|
6985
|
-
return randomTopic;
|
|
6986
|
-
};
|
|
6987
|
-
pickDistinctRandomTopics = (count) => {
|
|
6988
|
-
const pool = [...TOPICS];
|
|
6989
|
-
const picked = [];
|
|
6990
|
-
const n = Math.min(Math.max(count, 0), pool.length);
|
|
6991
|
-
for (let i = 0; i < n; i++) {
|
|
6992
|
-
const idx = randomRange(0, pool.length - 1);
|
|
6993
|
-
picked.push(pool[idx]);
|
|
6994
|
-
pool.splice(idx, 1);
|
|
6995
|
-
}
|
|
6996
|
-
return picked;
|
|
6997
|
-
};
|
|
6998
6979
|
getStableQuestionPrompt = (args) => {
|
|
6999
6980
|
const { limit, topicOfInterest, modelSystemPrompt, interests, knowledgeTopics, webSearchAvailable } = args;
|
|
7000
6981
|
if (limit < 1 || limit > 10) {
|
|
@@ -11477,16 +11458,6 @@ function appBarTokens(theme) {
|
|
|
11477
11458
|
menuText: s.control.foreground
|
|
11478
11459
|
};
|
|
11479
11460
|
}
|
|
11480
|
-
function suggestionTokens(theme) {
|
|
11481
|
-
const s = chatTokens(theme);
|
|
11482
|
-
return {
|
|
11483
|
-
background: s.surface.subtle,
|
|
11484
|
-
text: s.conversation.assistant.foreground,
|
|
11485
|
-
border: s.conversation.border,
|
|
11486
|
-
hoverBackground: s.surface.interactive,
|
|
11487
|
-
hoverBorder: theme.palette.divider
|
|
11488
|
-
};
|
|
11489
|
-
}
|
|
11490
11461
|
function responseTokens(theme) {
|
|
11491
11462
|
const s = chatTokens(theme);
|
|
11492
11463
|
return {
|
|
@@ -19673,6 +19644,9 @@ function resolveTelemetryConfig(opts) {
|
|
|
19673
19644
|
if (!hasAuth && opts.banditApiKey) {
|
|
19674
19645
|
headers["Authorization"] = `Bearer ${opts.banditApiKey}`;
|
|
19675
19646
|
}
|
|
19647
|
+
if (!hasAuth && !opts.banditApiKey && /^https:\/\/otlp\.burtson\.ai$/i.test(endpoint)) {
|
|
19648
|
+
return null;
|
|
19649
|
+
}
|
|
19676
19650
|
const mode = opts.telemetry.mode ?? "metrics+traces";
|
|
19677
19651
|
return { endpoint, headers, mode, serviceName: opts.telemetry.serviceName ?? "bandit-web" };
|
|
19678
19652
|
}
|
|
@@ -27957,203 +27931,84 @@ Respond with just the title and nothing else.
|
|
|
27957
27931
|
});
|
|
27958
27932
|
|
|
27959
27933
|
// src/chat/query-suggestion-picker.tsx
|
|
27960
|
-
|
|
27934
|
+
function QuerySuggestionPicker({ onSend, onSelect }) {
|
|
27935
|
+
const [ideas, setIdeas] = (0, import_react50.useState)([]);
|
|
27936
|
+
const [generating, setGenerating] = (0, import_react50.useState)(false);
|
|
27937
|
+
const [message, setMessage] = (0, import_react50.useState)("");
|
|
27938
|
+
const mounted = (0, import_react50.useRef)(false);
|
|
27939
|
+
const generatingRef = (0, import_react50.useRef)(false);
|
|
27940
|
+
(0, import_react50.useEffect)(() => {
|
|
27941
|
+
mounted.current = true;
|
|
27942
|
+
return () => {
|
|
27943
|
+
mounted.current = false;
|
|
27944
|
+
};
|
|
27945
|
+
}, []);
|
|
27946
|
+
const select = (prompt) => {
|
|
27947
|
+
if (onSelect) onSelect(prompt);
|
|
27948
|
+
else void Promise.resolve(onSend(prompt, [])).catch(() => {
|
|
27949
|
+
});
|
|
27950
|
+
};
|
|
27951
|
+
const generateIdeas = async () => {
|
|
27952
|
+
if (generatingRef.current) return;
|
|
27953
|
+
generatingRef.current = true;
|
|
27954
|
+
setGenerating(true);
|
|
27955
|
+
setMessage("");
|
|
27956
|
+
try {
|
|
27957
|
+
const prefs = usePreferencesStore.getState().preferences;
|
|
27958
|
+
const interests = (prefs.interests ?? []).filter((value) => value?.trim());
|
|
27959
|
+
const prompts = await generateConversationStarters({
|
|
27960
|
+
limit: 3,
|
|
27961
|
+
topicOfInterest: interests.join(", ") || "practical writing, learning, and decisions",
|
|
27962
|
+
interests,
|
|
27963
|
+
modelSystemPrompt: useModelStore.getState().getCurrentModel()?.systemPrompt,
|
|
27964
|
+
knowledgeTopics: prefs.useKnowledgeForStarters ? useKnowledgeStore.getState().docs.map((doc) => doc.name).filter(Boolean).slice(0, 12) : void 0,
|
|
27965
|
+
webSearchAvailable: useMCPToolsStore.getState().getEnabledTools().some((tool) => tool.name === "web_search")
|
|
27966
|
+
});
|
|
27967
|
+
if (!mounted.current) return;
|
|
27968
|
+
const next = prompts.filter((prompt) => typeof prompt === "string" && prompt.trim()).slice(0, 3);
|
|
27969
|
+
setIdeas(next);
|
|
27970
|
+
setMessage(next.length ? "New ideas are ready. Choose one to get started." : "Ideas are unavailable right now. You can still use a starter or write your own.");
|
|
27971
|
+
} catch {
|
|
27972
|
+
if (mounted.current) setMessage("Ideas are unavailable right now. You can still use a starter or write your own.");
|
|
27973
|
+
} finally {
|
|
27974
|
+
generatingRef.current = false;
|
|
27975
|
+
if (mounted.current) setGenerating(false);
|
|
27976
|
+
}
|
|
27977
|
+
};
|
|
27978
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material31.Box, { component: "section", "aria-label": "Start with a task", sx: { width: "100%", px: { xs: 2, sm: 3 } }, children: [
|
|
27979
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material31.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 1, mb: 1.5 }, children: [
|
|
27980
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Typography, { variant: "body2", sx: { fontWeight: 600 }, children: "What would move your work forward?" }),
|
|
27981
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Button, { size: "small", startIcon: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react51.Refresh, { size: 14 }), disabled: generating, onClick: () => void generateIdeas(), sx: { flexShrink: 0 }, children: generating ? "Finding ideas\u2026" : "Suggest ideas" })
|
|
27982
|
+
] }),
|
|
27983
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Box, { sx: { display: "grid", gridTemplateColumns: { xs: "1fr", sm: "repeat(3, minmax(0, 1fr))" }, gap: 1 }, children: (ideas.length ? ideas.map((prompt) => ({ title: prompt, detail: "", icon: import_react51.ArrowRight, prompt })) : STARTERS).map(({ title, detail, icon: Icon, prompt }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material31.Button, { variant: "outlined", onClick: () => select(prompt), sx: { display: "flex", alignItems: "flex-start", justifyContent: "flex-start", gap: 1.2, textAlign: "left", textTransform: "none", p: { xs: 1.5, sm: 2 }, height: "100%", color: "text.primary", borderColor: "divider" }, children: [
|
|
27984
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Box, { component: "span", sx: { display: "flex", color: "primary.main", mt: 0.25 }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon, { size: 18 }) }),
|
|
27985
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material31.Box, { component: "span", children: [
|
|
27986
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Typography, { component: "span", variant: "body2", sx: { display: "block", fontWeight: 550, lineHeight: 1.45 }, children: title }),
|
|
27987
|
+
detail && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Typography, { component: "span", variant: "caption", sx: { display: "block", color: "text.secondary", mt: 0.5, lineHeight: 1.5 }, children: detail })
|
|
27988
|
+
] })
|
|
27989
|
+
] }, title)) }),
|
|
27990
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Typography, { variant: "caption", sx: { display: "block", color: "text.secondary", mt: 1.25 }, children: onSelect ? "Choose a starting point, then make it your own before sending." : "Choose a starting point or write your own message." }),
|
|
27991
|
+
message && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Typography, { role: "status", variant: "caption", sx: { display: "block", color: "text.secondary", mt: 1 }, children: message })
|
|
27992
|
+
] });
|
|
27993
|
+
}
|
|
27994
|
+
var import_react50, import_material31, import_react51, import_jsx_runtime32, STARTERS;
|
|
27961
27995
|
var init_query_suggestion_picker = __esm({
|
|
27962
27996
|
"src/chat/query-suggestion-picker.tsx"() {
|
|
27963
27997
|
"use strict";
|
|
27964
27998
|
import_react50 = require("react");
|
|
27965
27999
|
import_material31 = require("@mui/material");
|
|
27966
|
-
|
|
27967
|
-
import_react_markdown3 = __toESM(require("react-markdown"));
|
|
27968
|
-
import_remark_gfm3 = __toESM(require("remark-gfm"));
|
|
27969
|
-
import_rehype_raw3 = __toESM(require("rehype-raw"));
|
|
28000
|
+
import_react51 = require("@burtson-labs/icons/react");
|
|
27970
28001
|
init_prompts();
|
|
27971
|
-
init_getStableQuestionPrompt();
|
|
27972
28002
|
init_modelStore();
|
|
27973
28003
|
init_preferencesStore();
|
|
27974
28004
|
init_knowledgeStore();
|
|
27975
28005
|
init_mcpToolsStore();
|
|
27976
|
-
init_chat_tokens();
|
|
27977
28006
|
import_jsx_runtime32 = require("react/jsx-runtime");
|
|
27978
|
-
|
|
27979
|
-
|
|
27980
|
-
|
|
27981
|
-
|
|
27982
|
-
|
|
27983
|
-
return inline ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("code", { ...rest, children }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("code", { ...rest, children });
|
|
27984
|
-
}
|
|
27985
|
-
};
|
|
27986
|
-
QuerySuggestionPicker = ({
|
|
27987
|
-
onSend,
|
|
27988
|
-
inputHeight
|
|
27989
|
-
}) => {
|
|
27990
|
-
const hasGenerated = (0, import_react50.useRef)(false);
|
|
27991
|
-
const [hasSentPrompt, setHasSentPrompt] = (0, import_react50.useState)(false);
|
|
27992
|
-
const [examplePrompts, setExamplePrompts] = (0, import_react50.useState)([]);
|
|
27993
|
-
const [visiblePrompts, setVisiblePrompts] = (0, import_react50.useState)([]);
|
|
27994
|
-
const scrollRef = (0, import_react50.useRef)(null);
|
|
27995
|
-
const theme = (0, import_styles21.useTheme)();
|
|
27996
|
-
const isMobile = (0, import_material31.useMediaQuery)((theme2) => theme2.breakpoints.down("sm"));
|
|
27997
|
-
const { background, text, border, hoverBackground, hoverBorder } = suggestionTokens(theme);
|
|
27998
|
-
const { getCurrentModel, isLoading } = useModelStore();
|
|
27999
|
-
(0, import_react50.useEffect)(() => {
|
|
28000
|
-
if (hasGenerated.current || isLoading) return;
|
|
28001
|
-
hasGenerated.current = true;
|
|
28002
|
-
const currentModel = getCurrentModel();
|
|
28003
|
-
const prefs = usePreferencesStore.getState().preferences;
|
|
28004
|
-
const interests = (prefs.interests ?? []).filter((i) => i && i.trim());
|
|
28005
|
-
const randomTopics = pickDistinctRandomTopics(interests.length ? 3 : 5);
|
|
28006
|
-
const topicOfInterest = Array.from(/* @__PURE__ */ new Set([...interests, ...randomTopics])).join(", ") || getRandomTopicOfInterest();
|
|
28007
|
-
const webSearchAvailable = useMCPToolsStore.getState().getEnabledTools().some((t) => t.name === "web_search");
|
|
28008
|
-
const knowledgeTopics = prefs.useKnowledgeForStarters ? useKnowledgeStore.getState().docs.map((d) => d.name).filter((n) => n && n.trim()).slice(0, 12) : void 0;
|
|
28009
|
-
const args = {
|
|
28010
|
-
limit: 9,
|
|
28011
|
-
topicOfInterest,
|
|
28012
|
-
modelSystemPrompt: currentModel?.systemPrompt,
|
|
28013
|
-
interests,
|
|
28014
|
-
knowledgeTopics,
|
|
28015
|
-
webSearchAvailable
|
|
28016
|
-
};
|
|
28017
|
-
generateConversationStarters(args).then((prompts) => {
|
|
28018
|
-
if (prompts.length > 0) {
|
|
28019
|
-
setExamplePrompts(prompts);
|
|
28020
|
-
setVisiblePrompts(prompts.slice(0, 3));
|
|
28021
|
-
} else {
|
|
28022
|
-
setExamplePrompts([]);
|
|
28023
|
-
setVisiblePrompts([]);
|
|
28024
|
-
hasGenerated.current = false;
|
|
28025
|
-
}
|
|
28026
|
-
}).catch((error) => {
|
|
28027
|
-
setExamplePrompts([]);
|
|
28028
|
-
setVisiblePrompts([]);
|
|
28029
|
-
hasGenerated.current = false;
|
|
28030
|
-
});
|
|
28031
|
-
}, [getCurrentModel, isLoading]);
|
|
28032
|
-
(0, import_react50.useEffect)(() => {
|
|
28033
|
-
if (!isLoading) {
|
|
28034
|
-
hasGenerated.current = false;
|
|
28035
|
-
}
|
|
28036
|
-
}, [isLoading]);
|
|
28037
|
-
(0, import_react50.useEffect)(() => {
|
|
28038
|
-
if (hasSentPrompt || examplePrompts.length === 0) return;
|
|
28039
|
-
const interval = setInterval(() => {
|
|
28040
|
-
setExamplePrompts((prev) => {
|
|
28041
|
-
if (prev.length < 3) return prev;
|
|
28042
|
-
const shuffled = [...prev].sort(() => 0.5 - Math.random());
|
|
28043
|
-
setVisiblePrompts((current) => [shuffled[0], current[1], current[2]]);
|
|
28044
|
-
setTimeout(() => {
|
|
28045
|
-
setVisiblePrompts((current) => [shuffled[0], shuffled[1], current[2]]);
|
|
28046
|
-
}, 400);
|
|
28047
|
-
setTimeout(() => {
|
|
28048
|
-
setVisiblePrompts(shuffled.slice(0, 3));
|
|
28049
|
-
}, 800);
|
|
28050
|
-
return shuffled;
|
|
28051
|
-
});
|
|
28052
|
-
}, 12e3);
|
|
28053
|
-
return () => clearInterval(interval);
|
|
28054
|
-
}, [hasSentPrompt, examplePrompts.length]);
|
|
28055
|
-
const displayPrompts = isMobile ? visiblePrompts.slice(0, Math.min(visiblePrompts.length, 6)) : visiblePrompts;
|
|
28056
|
-
return displayPrompts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
28057
|
-
import_material31.Box,
|
|
28058
|
-
{
|
|
28059
|
-
ref: scrollRef,
|
|
28060
|
-
sx: {
|
|
28061
|
-
zIndex: 1200,
|
|
28062
|
-
width: "100%",
|
|
28063
|
-
display: "flex",
|
|
28064
|
-
flexDirection: "row",
|
|
28065
|
-
gap: isMobile ? 0.8 : 1,
|
|
28066
|
-
px: isMobile ? 1.5 : 2,
|
|
28067
|
-
overflowX: isMobile ? "auto" : "visible",
|
|
28068
|
-
scrollSnapType: isMobile ? "x mandatory" : "none",
|
|
28069
|
-
WebkitOverflowScrolling: "touch",
|
|
28070
|
-
pb: isMobile ? 0.4 : 0,
|
|
28071
|
-
"&::-webkit-scrollbar": { display: "none" }
|
|
28072
|
-
},
|
|
28073
|
-
children: displayPrompts.map((prompt, i) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
28074
|
-
import_material31.Box,
|
|
28075
|
-
{
|
|
28076
|
-
component: "button",
|
|
28077
|
-
type: "button",
|
|
28078
|
-
sx: {
|
|
28079
|
-
appearance: "none",
|
|
28080
|
-
font: "inherit",
|
|
28081
|
-
textAlign: "inherit",
|
|
28082
|
-
"&:focus-visible": { outline: `2px solid ${theme.palette.primary.main}`, outlineOffset: 2 },
|
|
28083
|
-
px: isMobile ? 1.4 : 2,
|
|
28084
|
-
py: isMobile ? 1.2 : 2,
|
|
28085
|
-
flex: isMobile ? "0 0 85%" : 1,
|
|
28086
|
-
minWidth: isMobile ? "85%" : "auto",
|
|
28087
|
-
display: "flex",
|
|
28088
|
-
alignItems: "flex-start",
|
|
28089
|
-
gap: isMobile ? 0.9 : 1,
|
|
28090
|
-
backgroundColor: background,
|
|
28091
|
-
borderRadius: 2,
|
|
28092
|
-
fontSize: isMobile ? "0.875rem" : "0.9rem",
|
|
28093
|
-
color: text,
|
|
28094
|
-
userSelect: "none",
|
|
28095
|
-
cursor: "pointer",
|
|
28096
|
-
border: `1px solid ${border || (0, import_styles21.alpha)(text, 0.12)}`,
|
|
28097
|
-
boxShadow: theme.palette.mode === "dark" ? "0 4px 18px rgba(0,0,0,0.25)" : "0 6px 20px rgba(15,23,42,0.12)",
|
|
28098
|
-
scrollSnapAlign: isMobile ? "start" : "none",
|
|
28099
|
-
transition: "transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease",
|
|
28100
|
-
"&:hover": {
|
|
28101
|
-
backgroundColor: hoverBackground,
|
|
28102
|
-
borderColor: hoverBorder,
|
|
28103
|
-
transform: "translateY(-2px)",
|
|
28104
|
-
boxShadow: theme.palette.mode === "dark" ? "0 6px 22px rgba(0,0,0,0.28)" : "0 8px 24px rgba(15,23,42,0.14)"
|
|
28105
|
-
},
|
|
28106
|
-
"&:active": {
|
|
28107
|
-
transform: "translateY(0) scale(0.98)"
|
|
28108
|
-
}
|
|
28109
|
-
},
|
|
28110
|
-
onClick: () => {
|
|
28111
|
-
void Promise.resolve(onSend(prompt, [])).catch(() => {
|
|
28112
|
-
});
|
|
28113
|
-
setHasSentPrompt(true);
|
|
28114
|
-
},
|
|
28115
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
28116
|
-
import_material31.Box,
|
|
28117
|
-
{
|
|
28118
|
-
sx: {
|
|
28119
|
-
flex: 1,
|
|
28120
|
-
lineHeight: 1.4,
|
|
28121
|
-
fontWeight: isMobile ? 500 : 400,
|
|
28122
|
-
textAlign: isMobile ? "left" : "center",
|
|
28123
|
-
...isMobile && { hyphens: "auto", wordBreak: "break-word" },
|
|
28124
|
-
"& code": {
|
|
28125
|
-
borderRadius: 4,
|
|
28126
|
-
fontSize: "0.92em",
|
|
28127
|
-
fontFamily: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",
|
|
28128
|
-
backgroundColor: theme.palette.mode === "dark" ? (0, import_styles21.alpha)(theme.palette.common.white, 0.06) : (0, import_styles21.alpha)(theme.palette.text.primary, 0.06),
|
|
28129
|
-
border: `1px solid ${(0, import_styles21.alpha)(theme.palette.text.primary, 0.15)}`,
|
|
28130
|
-
padding: "0.15em 0.35em"
|
|
28131
|
-
},
|
|
28132
|
-
"& mark": {
|
|
28133
|
-
display: "inline-block",
|
|
28134
|
-
backgroundColor: theme.palette.mode === "dark" ? (0, import_styles21.alpha)(theme.palette.common.white, 0.06) : (0, import_styles21.alpha)(theme.palette.text.primary, 0.12),
|
|
28135
|
-
color: theme.palette.mode === "dark" ? theme.palette.common.white : theme.palette.text.primary,
|
|
28136
|
-
borderRadius: 4,
|
|
28137
|
-
padding: "0.1em 0.25em"
|
|
28138
|
-
}
|
|
28139
|
-
},
|
|
28140
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
28141
|
-
import_react_markdown3.default,
|
|
28142
|
-
{
|
|
28143
|
-
remarkPlugins: [import_remark_gfm3.default],
|
|
28144
|
-
rehypePlugins: [import_rehype_raw3.default],
|
|
28145
|
-
components: markdownComponents,
|
|
28146
|
-
children: prompt
|
|
28147
|
-
}
|
|
28148
|
-
)
|
|
28149
|
-
}
|
|
28150
|
-
)
|
|
28151
|
-
},
|
|
28152
|
-
`${i}-${prompt}`
|
|
28153
|
-
))
|
|
28154
|
-
}
|
|
28155
|
-
) });
|
|
28156
|
-
};
|
|
28007
|
+
STARTERS = [
|
|
28008
|
+
{ title: "Make sense of something", detail: "Find the important parts and the open questions.", icon: import_react51.FileText, prompt: "Help me understand the material I share next. Summarize the key points, distinguish facts from assumptions, and call out what is missing." },
|
|
28009
|
+
{ title: "Think through a decision", detail: "Compare options against what matters to you.", icon: import_react51.ListChecks, prompt: "Help me work through a decision. Ask me for the options, constraints, and what matters most, then compare the tradeoffs." },
|
|
28010
|
+
{ title: "Create a useful first draft", detail: "Turn a rough idea into something you can use.", icon: import_react51.PenLine, prompt: "Help me turn an idea into a useful first draft. Ask me what I am making, who it is for, and what a good result looks like." }
|
|
28011
|
+
];
|
|
28157
28012
|
}
|
|
28158
28013
|
});
|
|
28159
28014
|
|
|
@@ -28425,12 +28280,12 @@ function burtsonThemeOptions(modeOrConfig = "dark") {
|
|
|
28425
28280
|
}
|
|
28426
28281
|
};
|
|
28427
28282
|
}
|
|
28428
|
-
var
|
|
28283
|
+
var import_styles21, px;
|
|
28429
28284
|
var init_mui = __esm({
|
|
28430
28285
|
"../../node_modules/@burtson-labs/ui/dist/mui/index.js"() {
|
|
28431
28286
|
"use strict";
|
|
28432
28287
|
init_tokens();
|
|
28433
|
-
|
|
28288
|
+
import_styles21 = require("@mui/material/styles");
|
|
28434
28289
|
px = (rem) => Math.round(parseFloat(rem) * 16);
|
|
28435
28290
|
}
|
|
28436
28291
|
});
|
|
@@ -28698,7 +28553,7 @@ function createBanditTheme(config = {}, ...overrides) {
|
|
|
28698
28553
|
semantics,
|
|
28699
28554
|
cssVars
|
|
28700
28555
|
};
|
|
28701
|
-
return (0,
|
|
28556
|
+
return (0, import_styles22.createTheme)(
|
|
28702
28557
|
base,
|
|
28703
28558
|
{
|
|
28704
28559
|
palette: {
|
|
@@ -28736,11 +28591,11 @@ function createBanditTheme(config = {}, ...overrides) {
|
|
|
28736
28591
|
...overrides
|
|
28737
28592
|
);
|
|
28738
28593
|
}
|
|
28739
|
-
var
|
|
28594
|
+
var import_styles22;
|
|
28740
28595
|
var init_createBanditTheme = __esm({
|
|
28741
28596
|
"../bandit-themes/src/createBanditTheme.ts"() {
|
|
28742
28597
|
"use strict";
|
|
28743
|
-
|
|
28598
|
+
import_styles22 = require("@mui/material/styles");
|
|
28744
28599
|
init_mui();
|
|
28745
28600
|
init_tokens();
|
|
28746
28601
|
init_semantic();
|
|
@@ -28757,9 +28612,9 @@ function BanditThemeProvider({
|
|
|
28757
28612
|
style,
|
|
28758
28613
|
children
|
|
28759
28614
|
}) {
|
|
28760
|
-
const resolved =
|
|
28615
|
+
const resolved = React25.useMemo(() => theme ?? createBanditTheme(config), [theme, config]);
|
|
28761
28616
|
const { cssVars, mode } = resolved.bandit;
|
|
28762
|
-
|
|
28617
|
+
React25.useLayoutEffect(() => {
|
|
28763
28618
|
if (scope !== "document" || typeof document === "undefined") return;
|
|
28764
28619
|
const root = document.documentElement;
|
|
28765
28620
|
const previous = /* @__PURE__ */ new Map();
|
|
@@ -28784,7 +28639,7 @@ function BanditThemeProvider({
|
|
|
28784
28639
|
};
|
|
28785
28640
|
}, [scope, cssVars, mode]);
|
|
28786
28641
|
if (scope === "element") {
|
|
28787
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
28642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_styles23.ThemeProvider, { theme: resolved, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
28788
28643
|
"div",
|
|
28789
28644
|
{
|
|
28790
28645
|
className: [mode === "dark" ? "dark" : "light", className].filter(Boolean).join(" "),
|
|
@@ -28794,14 +28649,14 @@ function BanditThemeProvider({
|
|
|
28794
28649
|
}
|
|
28795
28650
|
) });
|
|
28796
28651
|
}
|
|
28797
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
28652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_styles23.ThemeProvider, { theme: resolved, children });
|
|
28798
28653
|
}
|
|
28799
|
-
var
|
|
28654
|
+
var import_styles23, React25, import_jsx_runtime33;
|
|
28800
28655
|
var init_provider = __esm({
|
|
28801
28656
|
"../bandit-themes/src/provider.tsx"() {
|
|
28802
28657
|
"use strict";
|
|
28803
|
-
|
|
28804
|
-
|
|
28658
|
+
import_styles23 = require("@mui/material/styles");
|
|
28659
|
+
React25 = __toESM(require("react"));
|
|
28805
28660
|
init_createBanditTheme();
|
|
28806
28661
|
import_jsx_runtime33 = require("react/jsx-runtime");
|
|
28807
28662
|
}
|
|
@@ -28938,7 +28793,7 @@ function TenantPreview({
|
|
|
28938
28793
|
title = "Preview",
|
|
28939
28794
|
renderBody
|
|
28940
28795
|
}) {
|
|
28941
|
-
const pageMode = (0,
|
|
28796
|
+
const pageMode = (0, import_styles24.useTheme)().palette.mode;
|
|
28942
28797
|
const shown = modes ?? (pageMode === "light" ? ["light", "dark"] : ["dark", "light"]);
|
|
28943
28798
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_Stack.default, { spacing: 1.5, role: "group", "aria-label": "Branding preview", children: [
|
|
28944
28799
|
title !== null && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_Typography.default, { component: "h3", variant: "subtitle2", sx: { fontWeight: 600 }, children: title }),
|
|
@@ -28978,7 +28833,7 @@ function PreviewPane({
|
|
|
28978
28833
|
density,
|
|
28979
28834
|
renderBody
|
|
28980
28835
|
}) {
|
|
28981
|
-
const theme =
|
|
28836
|
+
const theme = React26.useMemo(
|
|
28982
28837
|
() => createBanditTheme({
|
|
28983
28838
|
mode,
|
|
28984
28839
|
skin,
|
|
@@ -29029,7 +28884,7 @@ function PreviewPane({
|
|
|
29029
28884
|
}
|
|
29030
28885
|
) });
|
|
29031
28886
|
}
|
|
29032
|
-
var import_Avatar, import_Box, import_Button, import_Paper, import_Stack, import_Typography,
|
|
28887
|
+
var import_Avatar, import_Box, import_Button, import_Paper, import_Stack, import_Typography, import_styles24, React26, import_jsx_runtime34;
|
|
29033
28888
|
var init_TenantPreview = __esm({
|
|
29034
28889
|
"../bandit-themes/src/TenantPreview.tsx"() {
|
|
29035
28890
|
"use strict";
|
|
@@ -29039,8 +28894,8 @@ var init_TenantPreview = __esm({
|
|
|
29039
28894
|
import_Paper = __toESM(require("@mui/material/Paper"));
|
|
29040
28895
|
import_Stack = __toESM(require("@mui/material/Stack"));
|
|
29041
28896
|
import_Typography = __toESM(require("@mui/material/Typography"));
|
|
29042
|
-
|
|
29043
|
-
|
|
28897
|
+
import_styles24 = require("@mui/material/styles");
|
|
28898
|
+
React26 = __toESM(require("react"));
|
|
29044
28899
|
init_createBanditTheme();
|
|
29045
28900
|
init_provider();
|
|
29046
28901
|
import_jsx_runtime34 = require("react/jsx-runtime");
|
|
@@ -29153,14 +29008,14 @@ var init_UnderReview = __esm({
|
|
|
29153
29008
|
});
|
|
29154
29009
|
|
|
29155
29010
|
// src/components/feedback/FeedbackPulse.tsx
|
|
29156
|
-
var
|
|
29011
|
+
var import_react52, import_material33, import_styles25, import_react53, import_jsx_runtime36, STORAGE_KEY3, COOLDOWN_DAYS, MIN_SESSION_MS, MIN_MESSAGES_SENT, CHECK_INTERVAL_MS, readLastInteraction, recordInteraction, FeedbackPulse, FeedbackPulse_default;
|
|
29157
29012
|
var init_FeedbackPulse = __esm({
|
|
29158
29013
|
"src/components/feedback/FeedbackPulse.tsx"() {
|
|
29159
29014
|
"use strict";
|
|
29160
|
-
|
|
29015
|
+
import_react52 = require("react");
|
|
29161
29016
|
import_material33 = require("@mui/material");
|
|
29162
|
-
|
|
29163
|
-
|
|
29017
|
+
import_styles25 = require("@mui/material/styles");
|
|
29018
|
+
import_react53 = require("@burtson-labs/icons/react");
|
|
29164
29019
|
init_conversationStore();
|
|
29165
29020
|
init_FeedbackModal();
|
|
29166
29021
|
init_debugLogger();
|
|
@@ -29185,22 +29040,22 @@ var init_FeedbackPulse = __esm({
|
|
|
29185
29040
|
debugLogger.info("FeedbackPulse: interaction recorded", { outcome });
|
|
29186
29041
|
};
|
|
29187
29042
|
FeedbackPulse = ({ isMobile, feedbackEmail }) => {
|
|
29188
|
-
const theme = (0,
|
|
29189
|
-
const [visible, setVisible] = (0,
|
|
29190
|
-
const [thanked, setThanked] = (0,
|
|
29191
|
-
const [modalOpen, setModalOpen] = (0,
|
|
29192
|
-
const mountedAtRef = (0,
|
|
29193
|
-
const baselineMessagesRef = (0,
|
|
29043
|
+
const theme = (0, import_styles25.useTheme)();
|
|
29044
|
+
const [visible, setVisible] = (0, import_react52.useState)(false);
|
|
29045
|
+
const [thanked, setThanked] = (0, import_react52.useState)(false);
|
|
29046
|
+
const [modalOpen, setModalOpen] = (0, import_react52.useState)(false);
|
|
29047
|
+
const mountedAtRef = (0, import_react52.useRef)(Date.now());
|
|
29048
|
+
const baselineMessagesRef = (0, import_react52.useRef)(null);
|
|
29194
29049
|
const totalMessages = useConversationStore(
|
|
29195
29050
|
(s) => s.conversations.reduce((n, c) => n + c.history.length, 0)
|
|
29196
29051
|
);
|
|
29197
29052
|
const hydrated = useConversationStore((s) => s._hasHydrated);
|
|
29198
|
-
(0,
|
|
29053
|
+
(0, import_react52.useEffect)(() => {
|
|
29199
29054
|
if (hydrated && baselineMessagesRef.current === null) {
|
|
29200
29055
|
baselineMessagesRef.current = totalMessages;
|
|
29201
29056
|
}
|
|
29202
29057
|
}, [hydrated, totalMessages]);
|
|
29203
|
-
(0,
|
|
29058
|
+
(0, import_react52.useEffect)(() => {
|
|
29204
29059
|
const cooldownMs = COOLDOWN_DAYS * 24 * 60 * 60 * 1e3;
|
|
29205
29060
|
const forced = typeof window !== "undefined" && new URLSearchParams(window.location.search).has("feedbackPulse");
|
|
29206
29061
|
const check = () => {
|
|
@@ -29259,7 +29114,7 @@ var init_FeedbackPulse = __esm({
|
|
|
29259
29114
|
color: theme.palette.text.secondary,
|
|
29260
29115
|
transition: "background-color 0.15s ease, transform 0.1s ease",
|
|
29261
29116
|
"&:hover": {
|
|
29262
|
-
bgcolor: (0,
|
|
29117
|
+
bgcolor: (0, import_styles25.alpha)(theme.palette.text.primary, 0.06),
|
|
29263
29118
|
color: theme.palette.text.primary
|
|
29264
29119
|
},
|
|
29265
29120
|
"&:active": { transform: "scale(0.96)" }
|
|
@@ -29288,17 +29143,17 @@ var init_FeedbackPulse = __esm({
|
|
|
29288
29143
|
borderRadius: 3,
|
|
29289
29144
|
border: `1px solid ${theme.palette.divider}`,
|
|
29290
29145
|
bgcolor: theme.palette.background.paper,
|
|
29291
|
-
boxShadow: `0 12px 40px ${(0,
|
|
29146
|
+
boxShadow: `0 12px 40px ${(0, import_styles25.alpha)(theme.palette.common.black, theme.palette.mode === "dark" ? 0.5 : 0.18)}`
|
|
29292
29147
|
},
|
|
29293
29148
|
children: thanked ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_material33.Typography, { sx: { textAlign: "center", py: 1.5, fontWeight: 600 }, children: "Thanks for the feedback!" }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
29294
29149
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_material33.Box, { sx: { display: "flex", alignItems: "center", mb: 0.5 }, children: [
|
|
29295
29150
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_material33.Typography, { variant: "body2", sx: { fontWeight: 600, flex: 1 }, children: "How's Bandit doing?" }),
|
|
29296
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_material33.IconButton, { size: "small", onClick: dismiss, "aria-label": "Dismiss feedback prompt", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
29151
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_material33.IconButton, { size: "small", onClick: dismiss, "aria-label": "Dismiss feedback prompt", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react53.X, { size: 16 }) })
|
|
29297
29152
|
] }),
|
|
29298
29153
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_material33.Box, { sx: { display: "flex", justifyContent: "space-evenly" }, children: [
|
|
29299
|
-
choice(/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
29300
|
-
choice(/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
29301
|
-
choice(/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
29154
|
+
choice(/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react53.Smile, { size: 22, color: theme.palette.success.main }), "Good", "good"),
|
|
29155
|
+
choice(/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react53.Meh, { size: 22, color: theme.palette.warning.main }), "Fine", "fine"),
|
|
29156
|
+
choice(/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react53.Frown, { size: 22, color: theme.palette.error.main }), "Bad", "bad")
|
|
29302
29157
|
] })
|
|
29303
29158
|
] })
|
|
29304
29159
|
}
|
|
@@ -29318,16 +29173,16 @@ var init_FeedbackPulse = __esm({
|
|
|
29318
29173
|
});
|
|
29319
29174
|
|
|
29320
29175
|
// src/hooks/useNotificationService.ts
|
|
29321
|
-
var
|
|
29176
|
+
var import_react54, useNotificationService;
|
|
29322
29177
|
var init_useNotificationService = __esm({
|
|
29323
29178
|
"src/hooks/useNotificationService.ts"() {
|
|
29324
29179
|
"use strict";
|
|
29325
|
-
|
|
29180
|
+
import_react54 = require("react");
|
|
29326
29181
|
init_NotificationProvider();
|
|
29327
29182
|
init_notificationService();
|
|
29328
29183
|
useNotificationService = () => {
|
|
29329
29184
|
const notificationContext = useNotification();
|
|
29330
|
-
(0,
|
|
29185
|
+
(0, import_react54.useEffect)(() => {
|
|
29331
29186
|
notificationService.setContext(notificationContext);
|
|
29332
29187
|
}, [notificationContext]);
|
|
29333
29188
|
return {
|
|
@@ -29434,11 +29289,11 @@ var init_ConnectionStatus = __esm({
|
|
|
29434
29289
|
});
|
|
29435
29290
|
|
|
29436
29291
|
// src/hooks/useVoiceMode.ts
|
|
29437
|
-
var
|
|
29292
|
+
var import_react55, RMS_BASELINE, RMS_NORMALIZER, computeRms, pickSupportedMimeType, useVoiceMode;
|
|
29438
29293
|
var init_useVoiceMode = __esm({
|
|
29439
29294
|
"src/hooks/useVoiceMode.ts"() {
|
|
29440
29295
|
"use strict";
|
|
29441
|
-
|
|
29296
|
+
import_react55 = require("react");
|
|
29442
29297
|
init_stt_client();
|
|
29443
29298
|
init_debugLogger();
|
|
29444
29299
|
init_voiceModeStore();
|
|
@@ -29471,11 +29326,11 @@ var init_useVoiceMode = __esm({
|
|
|
29471
29326
|
const setError = useVoiceModeStore((state) => state.setError);
|
|
29472
29327
|
const resetTransientState = useVoiceModeStore((state) => state.resetTransientState);
|
|
29473
29328
|
const setLastTranscript = useVoiceModeStore((state) => state.setLastTranscript);
|
|
29474
|
-
const configRef = (0,
|
|
29475
|
-
(0,
|
|
29329
|
+
const configRef = (0, import_react55.useRef)(config);
|
|
29330
|
+
(0, import_react55.useEffect)(() => {
|
|
29476
29331
|
configRef.current = config;
|
|
29477
29332
|
}, [config]);
|
|
29478
|
-
(0,
|
|
29333
|
+
(0, import_react55.useEffect)(() => {
|
|
29479
29334
|
if (!enabled) {
|
|
29480
29335
|
return () => void 0;
|
|
29481
29336
|
}
|
|
@@ -29736,15 +29591,15 @@ var chat_exports = {};
|
|
|
29736
29591
|
__export(chat_exports, {
|
|
29737
29592
|
default: () => chat_default
|
|
29738
29593
|
});
|
|
29739
|
-
var
|
|
29594
|
+
var import_react56, import_material35, import_styles26, import_react_router_dom5, import_react57, import_jsx_runtime38, ChatContent, Chat, chat_default;
|
|
29740
29595
|
var init_chat2 = __esm({
|
|
29741
29596
|
"src/chat/chat.tsx"() {
|
|
29742
29597
|
"use strict";
|
|
29743
|
-
|
|
29598
|
+
import_react56 = require("react");
|
|
29744
29599
|
init_custom_logo();
|
|
29745
29600
|
init_indexedDBService();
|
|
29746
29601
|
import_material35 = require("@mui/material");
|
|
29747
|
-
|
|
29602
|
+
import_styles26 = require("@mui/material/styles");
|
|
29748
29603
|
init_chat_tokens();
|
|
29749
29604
|
init_chat_skeleton();
|
|
29750
29605
|
init_aiQueryStore();
|
|
@@ -29786,7 +29641,7 @@ var init_chat2 = __esm({
|
|
|
29786
29641
|
init_FeatureFlagContext();
|
|
29787
29642
|
init_knowledgeStore();
|
|
29788
29643
|
init_icons();
|
|
29789
|
-
|
|
29644
|
+
import_react57 = require("@burtson-labs/icons/react");
|
|
29790
29645
|
import_jsx_runtime38 = require("react/jsx-runtime");
|
|
29791
29646
|
ChatContent = () => {
|
|
29792
29647
|
const packageSettings = usePackageSettingsStore((state) => state.settings);
|
|
@@ -29796,8 +29651,8 @@ var init_chat2 = __esm({
|
|
|
29796
29651
|
const ossMode = isOSSMode() || !packageSettings?.featureFlags?.subscriptionType;
|
|
29797
29652
|
const playgroundBypassAccess = packageSettings?.playgroundBypassAuth || typeof window !== "undefined" && window.location.pathname.includes("/playground");
|
|
29798
29653
|
const notificationService2 = useNotificationService();
|
|
29799
|
-
const [selectedTheme, setSelectedTheme] = (0,
|
|
29800
|
-
const [themeLoading, setThemeLoading] = (0,
|
|
29654
|
+
const [selectedTheme, setSelectedTheme] = (0, import_react56.useState)(null);
|
|
29655
|
+
const [themeLoading, setThemeLoading] = (0, import_react56.useState)(true);
|
|
29801
29656
|
const token = authenticationService.getToken();
|
|
29802
29657
|
const claims = token ? authenticationService.parseJwtClaims(token) : null;
|
|
29803
29658
|
const baseTheme = registry_default[selectedTheme ?? "bandit-dark"] || banditDarkTheme;
|
|
@@ -29824,12 +29679,12 @@ var init_chat2 = __esm({
|
|
|
29824
29679
|
} = useVoiceStore();
|
|
29825
29680
|
const isVoiceModeEnabled = useVoiceModeStore((state) => state.enabled);
|
|
29826
29681
|
const canvasOpen = useCanvasStore((state) => state.open);
|
|
29827
|
-
const previousVoiceModeEnabledRef = (0,
|
|
29828
|
-
const historyRef = (0,
|
|
29829
|
-
(0,
|
|
29682
|
+
const previousVoiceModeEnabledRef = (0, import_react56.useRef)(isVoiceModeEnabled);
|
|
29683
|
+
const historyRef = (0, import_react56.useRef)(history);
|
|
29684
|
+
(0, import_react56.useEffect)(() => {
|
|
29830
29685
|
historyRef.current = history;
|
|
29831
29686
|
}, [history]);
|
|
29832
|
-
(0,
|
|
29687
|
+
(0, import_react56.useEffect)(() => {
|
|
29833
29688
|
if (!hydrated) return;
|
|
29834
29689
|
const params = new URLSearchParams(window.location.search);
|
|
29835
29690
|
const title = params.get("title") || "";
|
|
@@ -29845,7 +29700,7 @@ var init_chat2 = __esm({
|
|
|
29845
29700
|
stop: ttsStop,
|
|
29846
29701
|
isAvailable: isTTSAvailable
|
|
29847
29702
|
} = useTTS();
|
|
29848
|
-
(0,
|
|
29703
|
+
(0, import_react56.useEffect)(() => {
|
|
29849
29704
|
const timer = setTimeout(() => {
|
|
29850
29705
|
const isAuthenticated = authenticationService.isAuthenticated();
|
|
29851
29706
|
if (!initialized || availableVoices.length === 0) {
|
|
@@ -29859,7 +29714,7 @@ var init_chat2 = __esm({
|
|
|
29859
29714
|
}, 500);
|
|
29860
29715
|
return () => clearTimeout(timer);
|
|
29861
29716
|
}, [initialized, availableVoices.length, loadVoicesFromAPI, token]);
|
|
29862
|
-
(0,
|
|
29717
|
+
(0, import_react56.useEffect)(() => {
|
|
29863
29718
|
const isAuthenticated = authenticationService.isAuthenticated();
|
|
29864
29719
|
if (packageSettings?.gatewayApiUrl && availableVoices.length === 0 && !initialized) {
|
|
29865
29720
|
if (token && isAuthenticated) {
|
|
@@ -29871,22 +29726,22 @@ var init_chat2 = __esm({
|
|
|
29871
29726
|
}
|
|
29872
29727
|
}, [packageSettings?.gatewayApiUrl, availableVoices.length, initialized, loadVoicesFromAPI, token]);
|
|
29873
29728
|
const provider = useAIProviderStore((state) => state.provider);
|
|
29874
|
-
const inputRef = (0,
|
|
29875
|
-
const [pastedImages, setPastedImages] = (0,
|
|
29876
|
-
const inputContainerRef = (0,
|
|
29877
|
-
const [inputHeight, setInputHeight] = (0,
|
|
29878
|
-
const [isSubmitting, setIsSubmitting] = (0,
|
|
29879
|
-
const [pendingMessage, setPendingMessage] = (0,
|
|
29729
|
+
const inputRef = (0, import_react56.useRef)(null);
|
|
29730
|
+
const [pastedImages, setPastedImages] = (0, import_react56.useState)([]);
|
|
29731
|
+
const inputContainerRef = (0, import_react56.useRef)(null);
|
|
29732
|
+
const [inputHeight, setInputHeight] = (0, import_react56.useState)(80);
|
|
29733
|
+
const [isSubmitting, setIsSubmitting] = (0, import_react56.useState)(false);
|
|
29734
|
+
const [pendingMessage, setPendingMessage] = (0, import_react56.useState)(null);
|
|
29880
29735
|
const { conversations, currentId, _hasHydrated, hydrate, toggleIncognito } = useConversationStore();
|
|
29881
29736
|
const isTemporaryChat = Boolean(conversations.find((c) => c.id === currentId)?.incognito);
|
|
29882
|
-
const [isMobile, setIsMobile] = (0,
|
|
29883
|
-
const [drawerOpen, setDrawerOpen] = (0,
|
|
29884
|
-
const [mobileConversationsOpen, setMobileConversationsOpen] = (0,
|
|
29885
|
-
const cardSwipeStartXRef = (0,
|
|
29886
|
-
const dragStartRef = (0,
|
|
29887
|
-
const [drawerDragX, setDrawerDragX] = (0,
|
|
29888
|
-
const [drawerSettling, setDrawerSettling] = (0,
|
|
29889
|
-
const [drawerSwap, setDrawerSwap] = (0,
|
|
29737
|
+
const [isMobile, setIsMobile] = (0, import_react56.useState)(false);
|
|
29738
|
+
const [drawerOpen, setDrawerOpen] = (0, import_react56.useState)(false);
|
|
29739
|
+
const [mobileConversationsOpen, setMobileConversationsOpen] = (0, import_react56.useState)(false);
|
|
29740
|
+
const cardSwipeStartXRef = (0, import_react56.useRef)(null);
|
|
29741
|
+
const dragStartRef = (0, import_react56.useRef)(null);
|
|
29742
|
+
const [drawerDragX, setDrawerDragX] = (0, import_react56.useState)(null);
|
|
29743
|
+
const [drawerSettling, setDrawerSettling] = (0, import_react56.useState)(false);
|
|
29744
|
+
const [drawerSwap, setDrawerSwap] = (0, import_react56.useState)(false);
|
|
29890
29745
|
const drawerOpenOffset = () => (typeof window === "undefined" ? 360 : Math.min(window.innerWidth - 56, 360)) - 12;
|
|
29891
29746
|
const drawerDragStart = (e) => {
|
|
29892
29747
|
const t = e.touches[0];
|
|
@@ -29946,7 +29801,7 @@ var init_chat2 = __esm({
|
|
|
29946
29801
|
translate: `${drawerDragX}px 0`,
|
|
29947
29802
|
transition: drawerSettling ? "translate 0.22s cubic-bezier(0.2, 0.8, 0.2, 1)" : "none"
|
|
29948
29803
|
} : void 0;
|
|
29949
|
-
(0,
|
|
29804
|
+
(0, import_react56.useEffect)(() => {
|
|
29950
29805
|
if (typeof document === "undefined") return;
|
|
29951
29806
|
const meta = document.querySelector('meta[name="theme-color"]');
|
|
29952
29807
|
if (!meta) return;
|
|
@@ -29964,36 +29819,36 @@ var init_chat2 = __esm({
|
|
|
29964
29819
|
const chatContainerEl = chatContainerRef.current;
|
|
29965
29820
|
const scrollTargetEl = scrollTargetRef.current;
|
|
29966
29821
|
const { isSlowConnection, connectionQuality, trackRequestStart, trackRequestEnd } = useNetworkStatus();
|
|
29967
|
-
const [showScrollToBottom, setShowScrollToBottom] = (0,
|
|
29968
|
-
const [streamBuffer, setStreamBuffer] = (0,
|
|
29969
|
-
const [responseStarted, setResponseStarted] = (0,
|
|
29970
|
-
const [isStreaming, setIsStreaming] = (0,
|
|
29971
|
-
const [isThinking, setIsThinking] = (0,
|
|
29822
|
+
const [showScrollToBottom, setShowScrollToBottom] = (0, import_react56.useState)(false);
|
|
29823
|
+
const [streamBuffer, setStreamBuffer] = (0, import_react56.useState)("");
|
|
29824
|
+
const [responseStarted, setResponseStarted] = (0, import_react56.useState)(false);
|
|
29825
|
+
const [isStreaming, setIsStreaming] = (0, import_react56.useState)(false);
|
|
29826
|
+
const [isThinking, setIsThinking] = (0, import_react56.useState)(false);
|
|
29972
29827
|
const initialLogoState = history.length === 0;
|
|
29973
|
-
const [logoVisible, setLogoVisible] = (0,
|
|
29974
|
-
const [logoShouldRender, setLogoShouldRender] = (0,
|
|
29975
|
-
const streamingGraceUntilRef = (0,
|
|
29828
|
+
const [logoVisible, setLogoVisible] = (0, import_react56.useState)(initialLogoState);
|
|
29829
|
+
const [logoShouldRender, setLogoShouldRender] = (0, import_react56.useState)(initialLogoState);
|
|
29830
|
+
const streamingGraceUntilRef = (0, import_react56.useRef)(0);
|
|
29976
29831
|
const GRACE_MS = 450;
|
|
29977
29832
|
const GRACE_OFFSET_DESKTOP = 28;
|
|
29978
29833
|
const GRACE_OFFSET_MOBILE = 20;
|
|
29979
|
-
const followStreamRef = (0,
|
|
29980
|
-
const lastSpokenResponseRef = (0,
|
|
29981
|
-
const previousConversationIdRef = (0,
|
|
29982
|
-
const logoFadeTimeoutRef = (0,
|
|
29983
|
-
const [branding, setBranding] = (0,
|
|
29984
|
-
const [brandingLoading, setBrandingLoading] = (0,
|
|
29985
|
-
const isBrandingLoadInProgressRef = (0,
|
|
29834
|
+
const followStreamRef = (0, import_react56.useRef)(true);
|
|
29835
|
+
const lastSpokenResponseRef = (0, import_react56.useRef)(null);
|
|
29836
|
+
const previousConversationIdRef = (0, import_react56.useRef)(null);
|
|
29837
|
+
const logoFadeTimeoutRef = (0, import_react56.useRef)(null);
|
|
29838
|
+
const [branding, setBranding] = (0, import_react56.useState)(null);
|
|
29839
|
+
const [brandingLoading, setBrandingLoading] = (0, import_react56.useState)(true);
|
|
29840
|
+
const isBrandingLoadInProgressRef = (0, import_react56.useRef)(false);
|
|
29986
29841
|
const logoOnly = history.length === 0 && !brandingLoading;
|
|
29987
29842
|
const knowledgeDocs = useKnowledgeStore((s) => s.docs);
|
|
29988
29843
|
const knowledgeLoaded = useKnowledgeStore((s) => s.isLoaded);
|
|
29989
|
-
const [knowledgeNudgeDismissed, setKnowledgeNudgeDismissed] = (0,
|
|
29844
|
+
const [knowledgeNudgeDismissed, setKnowledgeNudgeDismissed] = (0, import_react56.useState)(() => {
|
|
29990
29845
|
try {
|
|
29991
29846
|
return localStorage.getItem("bandit.knowledgeNudge.dismissed") === "true";
|
|
29992
29847
|
} catch {
|
|
29993
29848
|
return false;
|
|
29994
29849
|
}
|
|
29995
29850
|
});
|
|
29996
|
-
const dismissKnowledgeNudge = (0,
|
|
29851
|
+
const dismissKnowledgeNudge = (0, import_react56.useCallback)(() => {
|
|
29997
29852
|
setKnowledgeNudgeDismissed(true);
|
|
29998
29853
|
try {
|
|
29999
29854
|
localStorage.setItem("bandit.knowledgeNudge.dismissed", "true");
|
|
@@ -30007,7 +29862,7 @@ var init_chat2 = __esm({
|
|
|
30007
29862
|
window.location.assign(to);
|
|
30008
29863
|
}
|
|
30009
29864
|
};
|
|
30010
|
-
(0,
|
|
29865
|
+
(0, import_react56.useEffect)(() => {
|
|
30011
29866
|
const isEmptyConversation = (history?.length ?? 0) === 0;
|
|
30012
29867
|
const isSending = Boolean(pendingMessage);
|
|
30013
29868
|
const shouldShowLogo = isEmptyConversation && !isSending;
|
|
@@ -30037,7 +29892,7 @@ var init_chat2 = __esm({
|
|
|
30037
29892
|
}, 500);
|
|
30038
29893
|
}
|
|
30039
29894
|
}, [history, pendingMessage]);
|
|
30040
|
-
(0,
|
|
29895
|
+
(0, import_react56.useEffect)(() => {
|
|
30041
29896
|
if (!brandingLoading && !themeLoading) {
|
|
30042
29897
|
return;
|
|
30043
29898
|
}
|
|
@@ -30053,18 +29908,18 @@ var init_chat2 = __esm({
|
|
|
30053
29908
|
}, 2500);
|
|
30054
29909
|
return () => window.clearTimeout(timeoutId);
|
|
30055
29910
|
}, [brandingLoading, themeLoading, selectedTheme]);
|
|
30056
|
-
(0,
|
|
29911
|
+
(0, import_react56.useEffect)(() => () => {
|
|
30057
29912
|
if (logoFadeTimeoutRef.current) {
|
|
30058
29913
|
window.clearTimeout(logoFadeTimeoutRef.current);
|
|
30059
29914
|
logoFadeTimeoutRef.current = null;
|
|
30060
29915
|
}
|
|
30061
29916
|
}, []);
|
|
30062
|
-
(0,
|
|
29917
|
+
(0, import_react56.useEffect)(() => {
|
|
30063
29918
|
if (isStreaming && streamBuffer.trim() === "") {
|
|
30064
29919
|
streamingGraceUntilRef.current = Date.now() + GRACE_MS;
|
|
30065
29920
|
}
|
|
30066
29921
|
}, [isStreaming, streamBuffer]);
|
|
30067
|
-
(0,
|
|
29922
|
+
(0, import_react56.useEffect)(() => {
|
|
30068
29923
|
if (!isStreaming) return;
|
|
30069
29924
|
const container = chatContainerRef.current;
|
|
30070
29925
|
if (!container) return;
|
|
@@ -30075,13 +29930,13 @@ var init_chat2 = __esm({
|
|
|
30075
29930
|
container.scrollTo({ top: targetTop, behavior: "smooth" });
|
|
30076
29931
|
}
|
|
30077
29932
|
}, [streamBuffer, isStreaming, isMobile, chatContainerRef]);
|
|
30078
|
-
(0,
|
|
29933
|
+
(0, import_react56.useEffect)(() => {
|
|
30079
29934
|
if (!_hasHydrated) {
|
|
30080
29935
|
debugLogger.info("Chat component triggering conversation store hydration");
|
|
30081
29936
|
hydrate();
|
|
30082
29937
|
}
|
|
30083
29938
|
}, [_hasHydrated, hydrate]);
|
|
30084
|
-
(0,
|
|
29939
|
+
(0, import_react56.useEffect)(() => {
|
|
30085
29940
|
const loadBrandingAndTheme = async () => {
|
|
30086
29941
|
if (isBrandingLoadInProgressRef.current) {
|
|
30087
29942
|
debugLogger.warn("Branding loading already in progress, skipping");
|
|
@@ -30270,7 +30125,7 @@ var init_chat2 = __esm({
|
|
|
30270
30125
|
window.removeEventListener("bandit-theme-changed", handleThemeChange);
|
|
30271
30126
|
};
|
|
30272
30127
|
}, []);
|
|
30273
|
-
(0,
|
|
30128
|
+
(0, import_react56.useEffect)(() => {
|
|
30274
30129
|
if (!chatContainerEl) return;
|
|
30275
30130
|
const blurInputOnTouchScroll = () => {
|
|
30276
30131
|
if (document.activeElement === inputRef.current) inputRef.current?.blur();
|
|
@@ -30278,13 +30133,13 @@ var init_chat2 = __esm({
|
|
|
30278
30133
|
chatContainerEl.addEventListener("touchmove", blurInputOnTouchScroll, { passive: true });
|
|
30279
30134
|
return () => chatContainerEl.removeEventListener("touchmove", blurInputOnTouchScroll);
|
|
30280
30135
|
}, [chatContainerEl]);
|
|
30281
|
-
(0,
|
|
30136
|
+
(0, import_react56.useEffect)(() => {
|
|
30282
30137
|
const handleResize = () => setIsMobile(window.innerWidth <= 768);
|
|
30283
30138
|
handleResize();
|
|
30284
30139
|
window.addEventListener("resize", handleResize);
|
|
30285
30140
|
return () => window.removeEventListener("resize", handleResize);
|
|
30286
30141
|
}, []);
|
|
30287
|
-
(0,
|
|
30142
|
+
(0, import_react56.useEffect)(() => {
|
|
30288
30143
|
const setViewportHeight = () => {
|
|
30289
30144
|
document.documentElement.style.setProperty(
|
|
30290
30145
|
"--vh",
|
|
@@ -30295,7 +30150,7 @@ var init_chat2 = __esm({
|
|
|
30295
30150
|
window.addEventListener("resize", setViewportHeight);
|
|
30296
30151
|
return () => window.removeEventListener("resize", setViewportHeight);
|
|
30297
30152
|
}, []);
|
|
30298
|
-
(0,
|
|
30153
|
+
(0, import_react56.useEffect)(() => {
|
|
30299
30154
|
if (!chatContainerEl) return;
|
|
30300
30155
|
let rafId = null;
|
|
30301
30156
|
const update = () => {
|
|
@@ -30314,7 +30169,7 @@ var init_chat2 = __esm({
|
|
|
30314
30169
|
chatContainerEl.removeEventListener(SCROLL_STATE_CHANGED_EVENT, update);
|
|
30315
30170
|
};
|
|
30316
30171
|
}, [chatContainerEl, getScrollState]);
|
|
30317
|
-
(0,
|
|
30172
|
+
(0, import_react56.useEffect)(() => {
|
|
30318
30173
|
if (!chatContainerEl) return;
|
|
30319
30174
|
let observer = null;
|
|
30320
30175
|
let rafId = null;
|
|
@@ -30349,7 +30204,7 @@ var init_chat2 = __esm({
|
|
|
30349
30204
|
if (observer) observer.disconnect();
|
|
30350
30205
|
};
|
|
30351
30206
|
}, [chatContainerEl, scrollTargetEl, scrollTargetRef, getScrollState, inputHeight, history.length]);
|
|
30352
|
-
(0,
|
|
30207
|
+
(0, import_react56.useEffect)(() => {
|
|
30353
30208
|
const isTransitioning = isStreaming || streamBuffer.trim() === "";
|
|
30354
30209
|
const delay = isTransitioning ? 400 : 100;
|
|
30355
30210
|
const timer = setTimeout(() => {
|
|
@@ -30358,7 +30213,7 @@ var init_chat2 = __esm({
|
|
|
30358
30213
|
}, delay);
|
|
30359
30214
|
return () => clearTimeout(timer);
|
|
30360
30215
|
}, [history, streamBuffer, getScrollState, isStreaming]);
|
|
30361
|
-
(0,
|
|
30216
|
+
(0, import_react56.useLayoutEffect)(() => {
|
|
30362
30217
|
const scrollState = getScrollState();
|
|
30363
30218
|
const now = Date.now();
|
|
30364
30219
|
if (isStreaming && scrollState.shouldAutoScroll && followStreamRef.current) {
|
|
@@ -30392,7 +30247,7 @@ var init_chat2 = __esm({
|
|
|
30392
30247
|
return () => clearTimeout(scrollTimer);
|
|
30393
30248
|
}
|
|
30394
30249
|
}, [history, isStreaming, scrollToBottom, getScrollState, isMobile, chatContainerRef]);
|
|
30395
|
-
(0,
|
|
30250
|
+
(0, import_react56.useEffect)(() => {
|
|
30396
30251
|
const observer = new ResizeObserver(() => {
|
|
30397
30252
|
if (inputContainerRef.current)
|
|
30398
30253
|
setInputHeight(inputContainerRef.current.offsetHeight);
|
|
@@ -30403,7 +30258,7 @@ var init_chat2 = __esm({
|
|
|
30403
30258
|
}
|
|
30404
30259
|
return () => observer.disconnect();
|
|
30405
30260
|
}, []);
|
|
30406
|
-
(0,
|
|
30261
|
+
(0, import_react56.useEffect)(() => {
|
|
30407
30262
|
if (!hydrated || !_hasHydrated) return;
|
|
30408
30263
|
if (currentId === null) {
|
|
30409
30264
|
useAIQueryStore.setState({ history: [] });
|
|
@@ -30452,7 +30307,7 @@ var init_chat2 = __esm({
|
|
|
30452
30307
|
setResponse,
|
|
30453
30308
|
setComponentStatus
|
|
30454
30309
|
]);
|
|
30455
|
-
(0,
|
|
30310
|
+
(0, import_react56.useEffect)(() => {
|
|
30456
30311
|
debugLogger.info("Chat component conversation state", {
|
|
30457
30312
|
hasHydrated: _hasHydrated,
|
|
30458
30313
|
conversationCount: conversations.length,
|
|
@@ -30461,7 +30316,7 @@ var init_chat2 = __esm({
|
|
|
30461
30316
|
storeState: "main-chat"
|
|
30462
30317
|
});
|
|
30463
30318
|
}, [_hasHydrated, conversations, currentId]);
|
|
30464
|
-
(0,
|
|
30319
|
+
(0, import_react56.useEffect)(() => {
|
|
30465
30320
|
if (!_hasHydrated || !chatContainerEl) return;
|
|
30466
30321
|
let rafId = null;
|
|
30467
30322
|
const sync = () => {
|
|
@@ -30475,8 +30330,8 @@ var init_chat2 = __esm({
|
|
|
30475
30330
|
if (rafId) cancelAnimationFrame(rafId);
|
|
30476
30331
|
};
|
|
30477
30332
|
}, [_hasHydrated, chatContainerEl, getScrollState, history.length]);
|
|
30478
|
-
const sendAckRef = (0,
|
|
30479
|
-
const settleSendAck = (0,
|
|
30333
|
+
const sendAckRef = (0, import_react56.useRef)(null);
|
|
30334
|
+
const settleSendAck = (0, import_react56.useCallback)((outcome) => {
|
|
30480
30335
|
const ack = sendAckRef.current;
|
|
30481
30336
|
if (!ack) return;
|
|
30482
30337
|
sendAckRef.current = null;
|
|
@@ -30505,7 +30360,7 @@ var init_chat2 = __esm({
|
|
|
30505
30360
|
notificationService2?.handleHttpError(error);
|
|
30506
30361
|
}
|
|
30507
30362
|
});
|
|
30508
|
-
const handleStop = (0,
|
|
30363
|
+
const handleStop = (0, import_react56.useCallback)(() => {
|
|
30509
30364
|
try {
|
|
30510
30365
|
aiProvider.cancel();
|
|
30511
30366
|
} catch (error) {
|
|
@@ -30514,7 +30369,7 @@ var init_chat2 = __esm({
|
|
|
30514
30369
|
});
|
|
30515
30370
|
}
|
|
30516
30371
|
}, [aiProvider]);
|
|
30517
|
-
const handleVoiceInterrupt = (0,
|
|
30372
|
+
const handleVoiceInterrupt = (0, import_react56.useCallback)(() => {
|
|
30518
30373
|
try {
|
|
30519
30374
|
ttsStop();
|
|
30520
30375
|
} catch (error) {
|
|
@@ -30533,7 +30388,7 @@ var init_chat2 = __esm({
|
|
|
30533
30388
|
handleStop();
|
|
30534
30389
|
}
|
|
30535
30390
|
}, [ttsStop, isStreaming, handleStop]);
|
|
30536
|
-
const handleSend = (0,
|
|
30391
|
+
const handleSend = (0, import_react56.useCallback)(
|
|
30537
30392
|
(question, images, displayQuestion) => {
|
|
30538
30393
|
sendAckRef.current?.resolve();
|
|
30539
30394
|
const acknowledged = new Promise((resolve, reject) => {
|
|
@@ -30670,7 +30525,7 @@ var init_chat2 = __esm({
|
|
|
30670
30525
|
trackRequestStart
|
|
30671
30526
|
]
|
|
30672
30527
|
);
|
|
30673
|
-
const handleVoiceTranscription = (0,
|
|
30528
|
+
const handleVoiceTranscription = (0, import_react56.useCallback)(
|
|
30674
30529
|
(text) => {
|
|
30675
30530
|
const cleaned = text.trim();
|
|
30676
30531
|
if (!cleaned) {
|
|
@@ -30688,7 +30543,7 @@ var init_chat2 = __esm({
|
|
|
30688
30543
|
onInterrupt: handleVoiceInterrupt,
|
|
30689
30544
|
onError: (message) => notificationService2?.showError?.(message)
|
|
30690
30545
|
});
|
|
30691
|
-
(0,
|
|
30546
|
+
(0, import_react56.useEffect)(() => {
|
|
30692
30547
|
const previouslyEnabled = previousVoiceModeEnabledRef.current;
|
|
30693
30548
|
previousVoiceModeEnabledRef.current = isVoiceModeEnabled;
|
|
30694
30549
|
if (!previouslyEnabled && isVoiceModeEnabled) {
|
|
@@ -30713,7 +30568,7 @@ var init_chat2 = __esm({
|
|
|
30713
30568
|
}
|
|
30714
30569
|
}
|
|
30715
30570
|
}, [isVoiceModeEnabled, ttsStop]);
|
|
30716
|
-
(0,
|
|
30571
|
+
(0, import_react56.useEffect)(() => {
|
|
30717
30572
|
if (!isVoiceModeEnabled || !isStreaming) {
|
|
30718
30573
|
return;
|
|
30719
30574
|
}
|
|
@@ -30733,7 +30588,7 @@ var init_chat2 = __esm({
|
|
|
30733
30588
|
}
|
|
30734
30589
|
lastSpokenResponseRef.current = null;
|
|
30735
30590
|
}, [isStreaming, isVoiceModeEnabled, ttsStop]);
|
|
30736
|
-
(0,
|
|
30591
|
+
(0, import_react56.useEffect)(() => {
|
|
30737
30592
|
if (!isVoiceModeEnabled) {
|
|
30738
30593
|
lastSpokenResponseRef.current = null;
|
|
30739
30594
|
return;
|
|
@@ -30774,13 +30629,13 @@ var init_chat2 = __esm({
|
|
|
30774
30629
|
cancelled = true;
|
|
30775
30630
|
};
|
|
30776
30631
|
}, [history, isStreaming, isVoiceModeEnabled, isTTSAvailable, ttsSpeak]);
|
|
30777
|
-
const handleModelChange = (0,
|
|
30632
|
+
const handleModelChange = (0, import_react56.useCallback)(
|
|
30778
30633
|
(modelId) => {
|
|
30779
30634
|
setSelectedModel(modelId);
|
|
30780
30635
|
},
|
|
30781
30636
|
[setSelectedModel]
|
|
30782
30637
|
);
|
|
30783
|
-
const handleVoiceChange = (0,
|
|
30638
|
+
const handleVoiceChange = (0, import_react56.useCallback)(async (voiceId) => {
|
|
30784
30639
|
ttsStop();
|
|
30785
30640
|
stopTTS();
|
|
30786
30641
|
setSelectedVoice(voiceId);
|
|
@@ -30954,7 +30809,7 @@ var init_chat2 = __esm({
|
|
|
30954
30809
|
whiteSpace: "nowrap"
|
|
30955
30810
|
}),
|
|
30956
30811
|
children: [
|
|
30957
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
30812
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react57.Ghost, { size: 14, "aria-hidden": true }),
|
|
30958
30813
|
"Temporary chat",
|
|
30959
30814
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
30960
30815
|
import_material35.Box,
|
|
@@ -30984,7 +30839,7 @@ var init_chat2 = __esm({
|
|
|
30984
30839
|
"@media (pointer: coarse)": { "&::after": { content: '""', position: "absolute", inset: -11 } },
|
|
30985
30840
|
"&:hover": {
|
|
30986
30841
|
opacity: 1,
|
|
30987
|
-
bgcolor: (0,
|
|
30842
|
+
bgcolor: (0, import_styles26.alpha)(theme.palette.getContrastText(theme.palette.text.primary), 0.16)
|
|
30988
30843
|
}
|
|
30989
30844
|
}),
|
|
30990
30845
|
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_x.X, { fontSize: "inherit", "aria-hidden": true })
|
|
@@ -31170,7 +31025,17 @@ var init_chat2 = __esm({
|
|
|
31170
31025
|
},
|
|
31171
31026
|
children: [
|
|
31172
31027
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_material35.Box, { sx: { flex: "1 1 auto" } }),
|
|
31173
|
-
history.length === 0 && componentStatus !== "Loading" && !pendingMessage && preferences.chatSuggestionsEnabled && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_material35.Box, { sx: { marginBottom: "20px" }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
31028
|
+
history.length === 0 && componentStatus !== "Loading" && !pendingMessage && preferences.chatSuggestionsEnabled && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_material35.Box, { sx: { marginBottom: "20px", width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
31029
|
+
QuerySuggestionPicker,
|
|
31030
|
+
{
|
|
31031
|
+
onSend: handleSend,
|
|
31032
|
+
onSelect: (prompt) => {
|
|
31033
|
+
setInputValue(prompt);
|
|
31034
|
+
inputRef.current?.focus();
|
|
31035
|
+
},
|
|
31036
|
+
inputHeight
|
|
31037
|
+
}
|
|
31038
|
+
) }),
|
|
31174
31039
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(rate_limit_prompt_default, {}),
|
|
31175
31040
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ask_user_card_default, {}),
|
|
31176
31041
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
@@ -31766,7 +31631,7 @@ var chat_provider_default = ChatProvider;
|
|
|
31766
31631
|
init_chat2();
|
|
31767
31632
|
|
|
31768
31633
|
// src/management/management.tsx
|
|
31769
|
-
var
|
|
31634
|
+
var import_react85 = require("react");
|
|
31770
31635
|
var import_useMediaQuery2 = __toESM(require("@mui/material/useMediaQuery"));
|
|
31771
31636
|
init_useKnowledgeStore();
|
|
31772
31637
|
init_indexedDBService();
|
|
@@ -31774,22 +31639,22 @@ var import_material60 = require("@mui/material");
|
|
|
31774
31639
|
var import_react_router_dom7 = require("react-router-dom");
|
|
31775
31640
|
|
|
31776
31641
|
// src/modals/chat-modal/chat-modal.tsx
|
|
31777
|
-
var
|
|
31642
|
+
var import_react66 = require("react");
|
|
31778
31643
|
var import_material43 = require("@mui/material");
|
|
31779
31644
|
var import_react_router_dom6 = require("react-router-dom");
|
|
31780
31645
|
|
|
31781
31646
|
// src/modals/chat-modal/draggable-box.tsx
|
|
31782
|
-
var
|
|
31647
|
+
var import_react58 = __toESM(require("react"));
|
|
31783
31648
|
var import_material36 = require("@mui/material");
|
|
31784
31649
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
31785
31650
|
var SCROLLABLE_THRESHOLD = 200;
|
|
31786
|
-
var DraggableBox =
|
|
31651
|
+
var DraggableBox = import_react58.default.forwardRef(
|
|
31787
31652
|
({ children, fullScreen, position, setPosition, onDrag, onScrollThresholdExceeded }, ref) => {
|
|
31788
31653
|
const theme = (0, import_material36.useTheme)();
|
|
31789
|
-
const [transitionProps, setTransitionProps] = (0,
|
|
31790
|
-
const [isDragging, setIsDragging] = (0,
|
|
31791
|
-
const [isHovering, setIsHovering] = (0,
|
|
31792
|
-
(0,
|
|
31654
|
+
const [transitionProps, setTransitionProps] = (0, import_react58.useState)("all");
|
|
31655
|
+
const [isDragging, setIsDragging] = (0, import_react58.useState)(false);
|
|
31656
|
+
const [isHovering, setIsHovering] = (0, import_react58.useState)(false);
|
|
31657
|
+
(0, import_react58.useEffect)(() => {
|
|
31793
31658
|
if (ref && typeof ref !== "function" && ref.current && !fullScreen) {
|
|
31794
31659
|
const modal = ref.current;
|
|
31795
31660
|
const contentHeight = modal.scrollHeight;
|
|
@@ -31865,7 +31730,7 @@ var DraggableBox = import_react57.default.forwardRef(
|
|
|
31865
31730
|
var draggable_box_default = DraggableBox;
|
|
31866
31731
|
|
|
31867
31732
|
// src/modals/chat-modal/modal-header.tsx
|
|
31868
|
-
var
|
|
31733
|
+
var import_react59 = require("react");
|
|
31869
31734
|
var import_material37 = require("@mui/material");
|
|
31870
31735
|
init_icons();
|
|
31871
31736
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
@@ -31885,7 +31750,7 @@ var ModalHeader = ({
|
|
|
31885
31750
|
const theme = (0, import_material37.useTheme)();
|
|
31886
31751
|
const isMobile = (0, import_material37.useMediaQuery)((theme2) => theme2.breakpoints.down("sm"));
|
|
31887
31752
|
const displayLogo = logo && logo !== banditaiLogo ? logo : banditHead3;
|
|
31888
|
-
const [isHovering, setIsHovering] = (0,
|
|
31753
|
+
const [isHovering, setIsHovering] = (0, import_react59.useState)(false);
|
|
31889
31754
|
const buttonStyles = {
|
|
31890
31755
|
transition: "all 0.15s ease-out",
|
|
31891
31756
|
borderRadius: "8px",
|
|
@@ -32083,7 +31948,7 @@ var ModalHeader = ({
|
|
|
32083
31948
|
var modal_header_default = ModalHeader;
|
|
32084
31949
|
|
|
32085
31950
|
// src/modals/chat-modal/query-input.tsx
|
|
32086
|
-
var
|
|
31951
|
+
var import_react60 = require("react");
|
|
32087
31952
|
var import_material38 = require("@mui/material");
|
|
32088
31953
|
init_icons();
|
|
32089
31954
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
@@ -32101,7 +31966,7 @@ var QueryInput = ({
|
|
|
32101
31966
|
// Destructure endAdornment
|
|
32102
31967
|
}) => {
|
|
32103
31968
|
const theme = (0, import_material38.useTheme)();
|
|
32104
|
-
const inputRef = (0,
|
|
31969
|
+
const inputRef = (0, import_react60.useRef)(null);
|
|
32105
31970
|
const handleSend = (e, payload) => {
|
|
32106
31971
|
onSend(e, payload);
|
|
32107
31972
|
};
|
|
@@ -32168,7 +32033,7 @@ init_ai_response_text_field();
|
|
|
32168
32033
|
init_indexedDBService();
|
|
32169
32034
|
|
|
32170
32035
|
// src/modals/chat-modal/chat-drawer.tsx
|
|
32171
|
-
var
|
|
32036
|
+
var import_react61 = __toESM(require("react"));
|
|
32172
32037
|
var import_material39 = require("@mui/material");
|
|
32173
32038
|
init_aiQueryStore();
|
|
32174
32039
|
init_conversationStore();
|
|
@@ -32204,23 +32069,23 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
|
|
|
32204
32069
|
const { settings: packageSettings } = usePackageSettingsStore();
|
|
32205
32070
|
const provider = useAIProviderStore((state) => state.provider);
|
|
32206
32071
|
const { selectedModel, availableModels } = useModelStore();
|
|
32207
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
32208
|
-
const [expandedItems, setExpandedItems] = (0,
|
|
32209
|
-
const [expandedConversations, setExpandedConversations] = (0,
|
|
32210
|
-
const [confirmClearOpen, setConfirmClearOpen] = (0,
|
|
32211
|
-
const [infoDialogOpen, setInfoDialogOpen] = (0,
|
|
32212
|
-
const [memoryModalOpen, setMemoryModalOpen] = (0,
|
|
32213
|
-
const [contextMode, setContextMode] = (0,
|
|
32214
|
-
const [expandedSections, setExpandedSections] = (0,
|
|
32215
|
-
const [audioSub, setAudioSub] = (0,
|
|
32216
|
-
const [isContextSwitching, setIsContextSwitching] = (0,
|
|
32217
|
-
const [isDrawerLoading, setIsDrawerLoading] = (0,
|
|
32218
|
-
(0,
|
|
32072
|
+
const [searchTerm, setSearchTerm] = (0, import_react61.useState)("");
|
|
32073
|
+
const [expandedItems, setExpandedItems] = (0, import_react61.useState)(/* @__PURE__ */ new Set());
|
|
32074
|
+
const [expandedConversations, setExpandedConversations] = (0, import_react61.useState)(/* @__PURE__ */ new Set());
|
|
32075
|
+
const [confirmClearOpen, setConfirmClearOpen] = (0, import_react61.useState)(false);
|
|
32076
|
+
const [infoDialogOpen, setInfoDialogOpen] = (0, import_react61.useState)(false);
|
|
32077
|
+
const [memoryModalOpen, setMemoryModalOpen] = (0, import_react61.useState)(false);
|
|
32078
|
+
const [contextMode, setContextMode] = (0, import_react61.useState)("local");
|
|
32079
|
+
const [expandedSections, setExpandedSections] = (0, import_react61.useState)(/* @__PURE__ */ new Set(["history", "voice"]));
|
|
32080
|
+
const [audioSub, setAudioSub] = (0, import_react61.useState)(new import_rxjs22.Subscription());
|
|
32081
|
+
const [isContextSwitching, setIsContextSwitching] = (0, import_react61.useState)(false);
|
|
32082
|
+
const [isDrawerLoading, setIsDrawerLoading] = (0, import_react61.useState)(false);
|
|
32083
|
+
(0, import_react61.useEffect)(() => {
|
|
32219
32084
|
if (drawerOpen && !_hasHydrated) {
|
|
32220
32085
|
hydrate();
|
|
32221
32086
|
}
|
|
32222
32087
|
}, [drawerOpen, _hasHydrated, hydrate]);
|
|
32223
|
-
(0,
|
|
32088
|
+
(0, import_react61.useEffect)(() => {
|
|
32224
32089
|
if (!drawerOpen) {
|
|
32225
32090
|
setIsDrawerLoading(false);
|
|
32226
32091
|
const cleanupTimer = setTimeout(() => {
|
|
@@ -32231,7 +32096,7 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
|
|
|
32231
32096
|
return () => clearTimeout(cleanupTimer);
|
|
32232
32097
|
}
|
|
32233
32098
|
}, [drawerOpen]);
|
|
32234
|
-
(0,
|
|
32099
|
+
(0, import_react61.useEffect)(() => {
|
|
32235
32100
|
return () => {
|
|
32236
32101
|
audioSub.unsubscribe();
|
|
32237
32102
|
};
|
|
@@ -32278,7 +32143,7 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
|
|
|
32278
32143
|
const currentConversation = conversations.find((c) => c.id === currentId);
|
|
32279
32144
|
const isInitialLoading = !_hasHydrated && contextMode === "main";
|
|
32280
32145
|
const isContentLoading = isContextSwitching || isInitialLoading;
|
|
32281
|
-
(0,
|
|
32146
|
+
(0, import_react61.useEffect)(() => {
|
|
32282
32147
|
if (drawerOpen) {
|
|
32283
32148
|
const debugTimer = setTimeout(() => {
|
|
32284
32149
|
debugLogger.debug("Chat drawer loading states", {
|
|
@@ -32293,7 +32158,7 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
|
|
|
32293
32158
|
return () => clearTimeout(debugTimer);
|
|
32294
32159
|
}
|
|
32295
32160
|
}, [drawerOpen, _hasHydrated, isDrawerLoading, isContentLoading, contextMode]);
|
|
32296
|
-
(0,
|
|
32161
|
+
(0, import_react61.useEffect)(() => {
|
|
32297
32162
|
debugLogger.debug("Chat drawer voice availability check", {
|
|
32298
32163
|
isServiceAvailable,
|
|
32299
32164
|
ttsEnabled: preferences.ttsEnabled,
|
|
@@ -32304,14 +32169,14 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
|
|
|
32304
32169
|
storeState: "modal-chat-drawer-voice"
|
|
32305
32170
|
});
|
|
32306
32171
|
}, [isServiceAvailable, preferences.ttsEnabled, packageSettings?.gatewayApiUrl, isVoiceAvailable, availableVoices.length, selectedVoice]);
|
|
32307
|
-
const activeHistory = (0,
|
|
32172
|
+
const activeHistory = (0, import_react61.useMemo)(() => {
|
|
32308
32173
|
if (contextMode === "local") {
|
|
32309
32174
|
return history;
|
|
32310
32175
|
}
|
|
32311
32176
|
return currentConversation?.history ?? [];
|
|
32312
32177
|
}, [contextMode, history, currentConversation]);
|
|
32313
32178
|
const effectiveContextMode = contextMode === "main" && (!currentConversation || currentConversation.history.length === 0) ? "local" : contextMode;
|
|
32314
|
-
(0,
|
|
32179
|
+
(0, import_react61.useEffect)(() => {
|
|
32315
32180
|
debugLogger.debug("Chat drawer context state", {
|
|
32316
32181
|
contextMode,
|
|
32317
32182
|
effectiveContextMode,
|
|
@@ -32324,13 +32189,13 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
|
|
|
32324
32189
|
storeState: "modal-chat-drawer"
|
|
32325
32190
|
});
|
|
32326
32191
|
}, [contextMode, effectiveContextMode, conversations.length, currentId, currentConversation, history.length, _hasHydrated]);
|
|
32327
|
-
const filteredHistory = (0,
|
|
32192
|
+
const filteredHistory = (0, import_react61.useMemo)(() => {
|
|
32328
32193
|
const filtered = activeHistory.filter(
|
|
32329
32194
|
(entry) => entry.question.toLowerCase().includes(searchTerm.toLowerCase()) || entry.answer.toLowerCase().includes(searchTerm.toLowerCase())
|
|
32330
32195
|
);
|
|
32331
32196
|
return filtered.slice(-20);
|
|
32332
32197
|
}, [activeHistory, searchTerm]);
|
|
32333
|
-
const filteredConversations = (0,
|
|
32198
|
+
const filteredConversations = (0, import_react61.useMemo)(() => {
|
|
32334
32199
|
const filtered = conversations.filter(
|
|
32335
32200
|
(conversation) => conversation.name.toLowerCase().includes(searchTerm.toLowerCase()) || conversation.history.some(
|
|
32336
32201
|
(entry) => entry.question.toLowerCase().includes(searchTerm.toLowerCase()) || entry.answer.toLowerCase().includes(searchTerm.toLowerCase())
|
|
@@ -33216,7 +33081,7 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
|
|
|
33216
33081
|
}
|
|
33217
33082
|
) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material39.List, { sx: { p: 0 }, children: [...filteredHistory].reverse().map((entry, index) => {
|
|
33218
33083
|
const isExpanded = expandedItems.has(index);
|
|
33219
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
33084
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react61.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
33220
33085
|
import_material39.ListItem,
|
|
33221
33086
|
{
|
|
33222
33087
|
sx: {
|
|
@@ -33693,9 +33558,9 @@ var GenericLoader = ({
|
|
|
33693
33558
|
var generic_loader_default = GenericLoader;
|
|
33694
33559
|
|
|
33695
33560
|
// src/components/feedback/FeedbackButton.tsx
|
|
33696
|
-
var
|
|
33561
|
+
var import_react62 = require("react");
|
|
33697
33562
|
var import_material41 = require("@mui/material");
|
|
33698
|
-
var
|
|
33563
|
+
var import_react63 = require("@burtson-labs/icons/react");
|
|
33699
33564
|
|
|
33700
33565
|
// src/components/feedback/index.tsx
|
|
33701
33566
|
init_FeedbackModal();
|
|
@@ -33714,7 +33579,7 @@ var FeedbackButton = ({
|
|
|
33714
33579
|
absolute = false
|
|
33715
33580
|
}) => {
|
|
33716
33581
|
const theme = (0, import_material41.useTheme)();
|
|
33717
|
-
const [open, setOpen] = (0,
|
|
33582
|
+
const [open, setOpen] = (0, import_react62.useState)(false);
|
|
33718
33583
|
const handleOpen = () => setOpen(true);
|
|
33719
33584
|
const handleClose = () => setOpen(false);
|
|
33720
33585
|
if (inline) {
|
|
@@ -33723,7 +33588,7 @@ var FeedbackButton = ({
|
|
|
33723
33588
|
import_material41.Button,
|
|
33724
33589
|
{
|
|
33725
33590
|
variant: "outlined",
|
|
33726
|
-
startIcon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
33591
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react63.MessageCircle, {}),
|
|
33727
33592
|
onClick: handleOpen,
|
|
33728
33593
|
className,
|
|
33729
33594
|
size,
|
|
@@ -33752,7 +33617,7 @@ var FeedbackButton = ({
|
|
|
33752
33617
|
transform: "translateY(-1px)"
|
|
33753
33618
|
}
|
|
33754
33619
|
},
|
|
33755
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
33620
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react63.MessageCircle, {})
|
|
33756
33621
|
}
|
|
33757
33622
|
) }),
|
|
33758
33623
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
@@ -33811,7 +33676,7 @@ var FeedbackButton = ({
|
|
|
33811
33676
|
}
|
|
33812
33677
|
}
|
|
33813
33678
|
},
|
|
33814
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
33679
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react63.MessageCircle, {})
|
|
33815
33680
|
}
|
|
33816
33681
|
)
|
|
33817
33682
|
}
|
|
@@ -33828,7 +33693,7 @@ var FeedbackButton = ({
|
|
|
33828
33693
|
};
|
|
33829
33694
|
|
|
33830
33695
|
// src/hooks/useAiChat.ts
|
|
33831
|
-
var
|
|
33696
|
+
var import_react64 = require("react");
|
|
33832
33697
|
var import_material42 = require("@mui/material");
|
|
33833
33698
|
init_aiQueryStore();
|
|
33834
33699
|
init_aiProviderStore();
|
|
@@ -33840,10 +33705,10 @@ var useAIChat = () => {
|
|
|
33840
33705
|
const provider = useAIProviderStore((state) => state.provider);
|
|
33841
33706
|
const SYSTEM_PROMPT = useModelStore((state) => state.systemPrompt);
|
|
33842
33707
|
const OLLAMA_MODEL = usePackageSettingsStore((state) => state.settings?.defaultModel || "");
|
|
33843
|
-
const [fullScreen, setFullScreen] = (0,
|
|
33844
|
-
const [drawerOpen, setDrawerOpen] = (0,
|
|
33845
|
-
const [showSettings, setShowSettings] = (0,
|
|
33846
|
-
const [, setAutoFullscreenTriggered] = (0,
|
|
33708
|
+
const [fullScreen, setFullScreen] = (0, import_react64.useState)(isMobile);
|
|
33709
|
+
const [drawerOpen, setDrawerOpen] = (0, import_react64.useState)(false);
|
|
33710
|
+
const [showSettings, setShowSettings] = (0, import_react64.useState)(false);
|
|
33711
|
+
const [, setAutoFullscreenTriggered] = (0, import_react64.useState)(false);
|
|
33847
33712
|
const {
|
|
33848
33713
|
apiKey,
|
|
33849
33714
|
inputValue,
|
|
@@ -33931,7 +33796,7 @@ var useAIChat = () => {
|
|
|
33931
33796
|
}
|
|
33932
33797
|
sendWithAIProvider();
|
|
33933
33798
|
};
|
|
33934
|
-
(0,
|
|
33799
|
+
(0, import_react64.useEffect)(() => {
|
|
33935
33800
|
setFullScreen(isMobile);
|
|
33936
33801
|
}, [isMobile]);
|
|
33937
33802
|
return {
|
|
@@ -33947,12 +33812,12 @@ var useAIChat = () => {
|
|
|
33947
33812
|
var useAiChat_default = useAIChat;
|
|
33948
33813
|
|
|
33949
33814
|
// src/hooks/useDraggable.ts
|
|
33950
|
-
var
|
|
33815
|
+
var import_react65 = require("react");
|
|
33951
33816
|
var useDraggable = () => {
|
|
33952
|
-
const modalRef = (0,
|
|
33953
|
-
const [dragging, setDragging] = (0,
|
|
33954
|
-
const [offset, setOffset] = (0,
|
|
33955
|
-
const [position, setPosition] = (0,
|
|
33817
|
+
const modalRef = (0, import_react65.useRef)(null);
|
|
33818
|
+
const [dragging, setDragging] = (0, import_react65.useState)(false);
|
|
33819
|
+
const [offset, setOffset] = (0, import_react65.useState)({ x: 0, y: 0 });
|
|
33820
|
+
const [position, setPosition] = (0, import_react65.useState)({ x: 0, y: 0 });
|
|
33956
33821
|
const handleHeaderMouseDown = (e) => {
|
|
33957
33822
|
const rect = modalRef.current?.getBoundingClientRect();
|
|
33958
33823
|
if (rect) {
|
|
@@ -33960,7 +33825,7 @@ var useDraggable = () => {
|
|
|
33960
33825
|
setDragging(true);
|
|
33961
33826
|
}
|
|
33962
33827
|
};
|
|
33963
|
-
const handleHeaderMouseMove = (0,
|
|
33828
|
+
const handleHeaderMouseMove = (0, import_react65.useCallback)(
|
|
33964
33829
|
(e) => {
|
|
33965
33830
|
if (dragging) {
|
|
33966
33831
|
setPosition({ x: e.clientX - offset.x, y: e.clientY - offset.y });
|
|
@@ -33971,7 +33836,7 @@ var useDraggable = () => {
|
|
|
33971
33836
|
const handleHeaderMouseUp = () => {
|
|
33972
33837
|
setDragging(false);
|
|
33973
33838
|
};
|
|
33974
|
-
(0,
|
|
33839
|
+
(0, import_react65.useEffect)(() => {
|
|
33975
33840
|
if (dragging) {
|
|
33976
33841
|
document.addEventListener("mousemove", handleHeaderMouseMove);
|
|
33977
33842
|
document.addEventListener("mouseup", handleHeaderMouseUp);
|
|
@@ -34021,7 +33886,7 @@ var modelAvatars3 = {
|
|
|
34021
33886
|
"Bandit-Exec": `${CDN_BASE2}/avatars/exec-avatar.png`
|
|
34022
33887
|
};
|
|
34023
33888
|
var useOptionalNavigate = () => {
|
|
34024
|
-
const hasLoggedRef = (0,
|
|
33889
|
+
const hasLoggedRef = (0, import_react66.useRef)(false);
|
|
34025
33890
|
try {
|
|
34026
33891
|
return (0, import_react_router_dom6.useNavigate)();
|
|
34027
33892
|
} catch (error) {
|
|
@@ -34070,17 +33935,17 @@ var ChatModal = ({
|
|
|
34070
33935
|
handleSend
|
|
34071
33936
|
} = useAiChat_default();
|
|
34072
33937
|
const { modalRef, position, setPosition, handleDrag, handleHeaderMouseDown } = useDraggable_default();
|
|
34073
|
-
const [pastedImages, setPastedImages] = (0,
|
|
34074
|
-
const [responseStarted, setResponseStarted] = (0,
|
|
34075
|
-
const [modalLogo, setModalLogo] = (0,
|
|
34076
|
-
const [modelAnchorEl, setModelAnchorEl] = (0,
|
|
34077
|
-
const [voiceAnchorEl, setVoiceAnchorEl] = (0,
|
|
34078
|
-
const [audioSub, setAudioSub] = (0,
|
|
34079
|
-
const [selectedTheme, setSelectedTheme] = (0,
|
|
34080
|
-
const [themeLoading, setThemeLoading] = (0,
|
|
34081
|
-
const [autoFullscreenTriggered, setAutoFullscreenTriggered] = (0,
|
|
34082
|
-
const [userHasDragged, setUserHasDragged] = (0,
|
|
34083
|
-
const [manualFullscreenToggleTime, setManualFullscreenToggleTime] = (0,
|
|
33938
|
+
const [pastedImages, setPastedImages] = (0, import_react66.useState)([]);
|
|
33939
|
+
const [responseStarted, setResponseStarted] = (0, import_react66.useState)(false);
|
|
33940
|
+
const [modalLogo, setModalLogo] = (0, import_react66.useState)("https://cdn.burtson.ai/logos/bandit-ai-logo.png");
|
|
33941
|
+
const [modelAnchorEl, setModelAnchorEl] = (0, import_react66.useState)(null);
|
|
33942
|
+
const [voiceAnchorEl, setVoiceAnchorEl] = (0, import_react66.useState)(null);
|
|
33943
|
+
const [audioSub, setAudioSub] = (0, import_react66.useState)(new import_rxjs23.Subscription());
|
|
33944
|
+
const [selectedTheme, setSelectedTheme] = (0, import_react66.useState)(null);
|
|
33945
|
+
const [themeLoading, setThemeLoading] = (0, import_react66.useState)(true);
|
|
33946
|
+
const [autoFullscreenTriggered, setAutoFullscreenTriggered] = (0, import_react66.useState)(false);
|
|
33947
|
+
const [userHasDragged, setUserHasDragged] = (0, import_react66.useState)(false);
|
|
33948
|
+
const [manualFullscreenToggleTime, setManualFullscreenToggleTime] = (0, import_react66.useState)(0);
|
|
34084
33949
|
const handleExitFullscreen = () => {
|
|
34085
33950
|
setPosition({
|
|
34086
33951
|
x: Math.max(0, window.innerWidth / 2 - 300),
|
|
@@ -34126,7 +33991,7 @@ var ChatModal = ({
|
|
|
34126
33991
|
const toTitleCase2 = (str) => {
|
|
34127
33992
|
return str.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());
|
|
34128
33993
|
};
|
|
34129
|
-
(0,
|
|
33994
|
+
(0, import_react66.useEffect)(() => {
|
|
34130
33995
|
if (!SYSTEM_PROMPT) {
|
|
34131
33996
|
const defaultModel = availableModels.length > 0 ? availableModels[0] : null;
|
|
34132
33997
|
if (defaultModel) {
|
|
@@ -34134,12 +33999,12 @@ var ChatModal = ({
|
|
|
34134
33999
|
}
|
|
34135
34000
|
}
|
|
34136
34001
|
}, [SYSTEM_PROMPT, availableModels, setSelectedModel]);
|
|
34137
|
-
(0,
|
|
34002
|
+
(0, import_react66.useEffect)(() => {
|
|
34138
34003
|
return () => {
|
|
34139
34004
|
audioSub.unsubscribe();
|
|
34140
34005
|
};
|
|
34141
34006
|
}, [audioSub]);
|
|
34142
|
-
(0,
|
|
34007
|
+
(0, import_react66.useEffect)(() => {
|
|
34143
34008
|
if (open) {
|
|
34144
34009
|
setPosition({
|
|
34145
34010
|
x: Math.max(0, window.innerWidth / 2 - 300),
|
|
@@ -34151,7 +34016,7 @@ var ChatModal = ({
|
|
|
34151
34016
|
getOptimalLogo().then(setModalLogo);
|
|
34152
34017
|
}
|
|
34153
34018
|
}, [open, setPosition]);
|
|
34154
|
-
(0,
|
|
34019
|
+
(0, import_react66.useEffect)(() => {
|
|
34155
34020
|
if (!open) return;
|
|
34156
34021
|
const fetchTheme = async () => {
|
|
34157
34022
|
try {
|
|
@@ -34185,7 +34050,7 @@ var ChatModal = ({
|
|
|
34185
34050
|
window.removeEventListener("bandit-theme-changed", handleThemeChange);
|
|
34186
34051
|
};
|
|
34187
34052
|
}, [open]);
|
|
34188
|
-
(0,
|
|
34053
|
+
(0, import_react66.useLayoutEffect)(() => {
|
|
34189
34054
|
const timeSinceManualToggle = Date.now() - manualFullscreenToggleTime;
|
|
34190
34055
|
const manualToggleRecentlyUsed = timeSinceManualToggle < 5e3;
|
|
34191
34056
|
if (modalRef.current && response && !fullScreen && !autoFullscreenTriggered && !manualToggleRecentlyUsed) {
|
|
@@ -34210,7 +34075,7 @@ var ChatModal = ({
|
|
|
34210
34075
|
setFullScreen,
|
|
34211
34076
|
setAutoFullscreenTriggered
|
|
34212
34077
|
]);
|
|
34213
|
-
(0,
|
|
34078
|
+
(0, import_react66.useEffect)(() => {
|
|
34214
34079
|
const handlePaste = (e) => {
|
|
34215
34080
|
const items = e.clipboardData?.items;
|
|
34216
34081
|
if (items) {
|
|
@@ -34235,7 +34100,7 @@ var ChatModal = ({
|
|
|
34235
34100
|
document.removeEventListener("paste", handlePaste);
|
|
34236
34101
|
};
|
|
34237
34102
|
}, []);
|
|
34238
|
-
(0,
|
|
34103
|
+
(0, import_react66.useEffect)(() => {
|
|
34239
34104
|
if (response && !responseStarted) {
|
|
34240
34105
|
setResponseStarted(true);
|
|
34241
34106
|
}
|
|
@@ -34655,13 +34520,13 @@ var ChatModal = ({
|
|
|
34655
34520
|
var chat_modal_default = ChatModal;
|
|
34656
34521
|
|
|
34657
34522
|
// src/management/components/PersonalitiesTab.tsx
|
|
34658
|
-
var
|
|
34523
|
+
var import_react68 = require("react");
|
|
34659
34524
|
var import_material46 = require("@mui/material");
|
|
34660
34525
|
var import_useMediaQuery = __toESM(require("@mui/material/useMediaQuery"));
|
|
34661
|
-
var
|
|
34526
|
+
var import_styles28 = require("@mui/material/styles");
|
|
34662
34527
|
|
|
34663
34528
|
// src/components/AvatarCropper.tsx
|
|
34664
|
-
var
|
|
34529
|
+
var import_react67 = require("react");
|
|
34665
34530
|
var import_material44 = require("@mui/material");
|
|
34666
34531
|
init_icons();
|
|
34667
34532
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
@@ -34671,22 +34536,22 @@ var AvatarCropper = ({
|
|
|
34671
34536
|
onCrop,
|
|
34672
34537
|
imageFile
|
|
34673
34538
|
}) => {
|
|
34674
|
-
const canvasRef = (0,
|
|
34675
|
-
const imageRef = (0,
|
|
34676
|
-
const [imageSrc, setImageSrc] = (0,
|
|
34677
|
-
const [cropSettings, setCropSettings] = (0,
|
|
34539
|
+
const canvasRef = (0, import_react67.useRef)(null);
|
|
34540
|
+
const imageRef = (0, import_react67.useRef)(null);
|
|
34541
|
+
const [imageSrc, setImageSrc] = (0, import_react67.useState)("");
|
|
34542
|
+
const [cropSettings, setCropSettings] = (0, import_react67.useState)({
|
|
34678
34543
|
x: 0,
|
|
34679
34544
|
y: 0,
|
|
34680
34545
|
scale: 1,
|
|
34681
34546
|
rotation: 0
|
|
34682
34547
|
});
|
|
34683
|
-
const [isDragging, setIsDragging] = (0,
|
|
34684
|
-
const [dragStart, setDragStart] = (0,
|
|
34685
|
-
const [imageLoaded, setImageLoaded] = (0,
|
|
34686
|
-
const [imageNaturalSize, setImageNaturalSize] = (0,
|
|
34548
|
+
const [isDragging, setIsDragging] = (0, import_react67.useState)(false);
|
|
34549
|
+
const [dragStart, setDragStart] = (0, import_react67.useState)({ x: 0, y: 0 });
|
|
34550
|
+
const [imageLoaded, setImageLoaded] = (0, import_react67.useState)(false);
|
|
34551
|
+
const [imageNaturalSize, setImageNaturalSize] = (0, import_react67.useState)({ width: 0, height: 0 });
|
|
34687
34552
|
const CROP_SIZE = 400;
|
|
34688
34553
|
const OUTPUT_SIZE = 512;
|
|
34689
|
-
(0,
|
|
34554
|
+
(0, import_react67.useEffect)(() => {
|
|
34690
34555
|
if (imageFile && open) {
|
|
34691
34556
|
const reader = new FileReader();
|
|
34692
34557
|
reader.onload = (e) => {
|
|
@@ -34698,7 +34563,7 @@ var AvatarCropper = ({
|
|
|
34698
34563
|
reader.readAsDataURL(imageFile);
|
|
34699
34564
|
}
|
|
34700
34565
|
}, [imageFile, open]);
|
|
34701
|
-
const handleImageLoad = (0,
|
|
34566
|
+
const handleImageLoad = (0, import_react67.useCallback)(() => {
|
|
34702
34567
|
if (imageRef.current) {
|
|
34703
34568
|
const { naturalWidth, naturalHeight } = imageRef.current;
|
|
34704
34569
|
setImageNaturalSize({ width: naturalWidth, height: naturalHeight });
|
|
@@ -34715,7 +34580,7 @@ var AvatarCropper = ({
|
|
|
34715
34580
|
setImageLoaded(true);
|
|
34716
34581
|
}
|
|
34717
34582
|
}, []);
|
|
34718
|
-
const drawCropPreview = (0,
|
|
34583
|
+
const drawCropPreview = (0, import_react67.useCallback)(() => {
|
|
34719
34584
|
const canvas = canvasRef.current;
|
|
34720
34585
|
const image = imageRef.current;
|
|
34721
34586
|
if (!canvas || !image || !imageLoaded) return;
|
|
@@ -34738,14 +34603,14 @@ var AvatarCropper = ({
|
|
|
34738
34603
|
ctx.fill();
|
|
34739
34604
|
ctx.restore();
|
|
34740
34605
|
}, [cropSettings, imageLoaded]);
|
|
34741
|
-
(0,
|
|
34606
|
+
(0, import_react67.useEffect)(() => {
|
|
34742
34607
|
drawCropPreview();
|
|
34743
34608
|
}, [drawCropPreview]);
|
|
34744
|
-
const handleMouseDown = (0,
|
|
34609
|
+
const handleMouseDown = (0, import_react67.useCallback)((e) => {
|
|
34745
34610
|
setIsDragging(true);
|
|
34746
34611
|
setDragStart({ x: e.clientX, y: e.clientY });
|
|
34747
34612
|
}, []);
|
|
34748
|
-
const handleMouseMove = (0,
|
|
34613
|
+
const handleMouseMove = (0, import_react67.useCallback)((e) => {
|
|
34749
34614
|
if (!isDragging) return;
|
|
34750
34615
|
const deltaX = e.clientX - dragStart.x;
|
|
34751
34616
|
const deltaY = e.clientY - dragStart.y;
|
|
@@ -34756,16 +34621,16 @@ var AvatarCropper = ({
|
|
|
34756
34621
|
}));
|
|
34757
34622
|
setDragStart({ x: e.clientX, y: e.clientY });
|
|
34758
34623
|
}, [isDragging, dragStart]);
|
|
34759
|
-
const handleMouseUp = (0,
|
|
34624
|
+
const handleMouseUp = (0, import_react67.useCallback)(() => {
|
|
34760
34625
|
setIsDragging(false);
|
|
34761
34626
|
}, []);
|
|
34762
|
-
const handleClose = (0,
|
|
34627
|
+
const handleClose = (0, import_react67.useCallback)(() => {
|
|
34763
34628
|
setImageSrc("");
|
|
34764
34629
|
setImageLoaded(false);
|
|
34765
34630
|
setCropSettings({ x: 0, y: 0, scale: 1, rotation: 0 });
|
|
34766
34631
|
onClose();
|
|
34767
34632
|
}, [onClose]);
|
|
34768
|
-
const handleCrop = (0,
|
|
34633
|
+
const handleCrop = (0, import_react67.useCallback)(() => {
|
|
34769
34634
|
const canvas = document.createElement("canvas");
|
|
34770
34635
|
const ctx = canvas.getContext("2d");
|
|
34771
34636
|
const image = imageRef.current;
|
|
@@ -34792,7 +34657,7 @@ var AvatarCropper = ({
|
|
|
34792
34657
|
onCrop(croppedDataUrl);
|
|
34793
34658
|
handleClose();
|
|
34794
34659
|
}, [cropSettings, onCrop, handleClose]);
|
|
34795
|
-
const handleScaleChange = (0,
|
|
34660
|
+
const handleScaleChange = (0, import_react67.useCallback)((value) => {
|
|
34796
34661
|
const minScale2 = Math.max(
|
|
34797
34662
|
CROP_SIZE / imageNaturalSize.width,
|
|
34798
34663
|
CROP_SIZE / imageNaturalSize.height
|
|
@@ -34802,7 +34667,7 @@ var AvatarCropper = ({
|
|
|
34802
34667
|
scale: Math.max(value, minScale2)
|
|
34803
34668
|
}));
|
|
34804
34669
|
}, [imageNaturalSize]);
|
|
34805
|
-
const handleRotation = (0,
|
|
34670
|
+
const handleRotation = (0, import_react67.useCallback)((direction) => {
|
|
34806
34671
|
setCropSettings((prev) => ({
|
|
34807
34672
|
...prev,
|
|
34808
34673
|
rotation: prev.rotation + (direction === "left" ? -90 : 90)
|
|
@@ -35023,7 +34888,7 @@ init_icons();
|
|
|
35023
34888
|
|
|
35024
34889
|
// src/management/shell/parts.tsx
|
|
35025
34890
|
var import_material45 = require("@mui/material");
|
|
35026
|
-
var
|
|
34891
|
+
var import_styles27 = require("@mui/material/styles");
|
|
35027
34892
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
35028
34893
|
function ManagementPageHeader({
|
|
35029
34894
|
title,
|
|
@@ -35217,7 +35082,7 @@ function ManagementEmptyState({
|
|
|
35217
35082
|
placeItems: "center",
|
|
35218
35083
|
borderRadius: "50%",
|
|
35219
35084
|
color: "primary.main",
|
|
35220
|
-
bgcolor: (0,
|
|
35085
|
+
bgcolor: (0, import_styles27.alpha)(theme.palette.primary.main, 0.1),
|
|
35221
35086
|
"& svg": { width: 22, height: 22 }
|
|
35222
35087
|
}),
|
|
35223
35088
|
children: icon
|
|
@@ -35260,15 +35125,15 @@ var PersonalitiesTab = ({
|
|
|
35260
35125
|
showSnackbar,
|
|
35261
35126
|
createRequest
|
|
35262
35127
|
}) => {
|
|
35263
|
-
const theme = (0,
|
|
35128
|
+
const theme = (0, import_styles28.useTheme)();
|
|
35264
35129
|
const isMobile = (0, import_useMediaQuery.default)(theme.breakpoints.down("sm"));
|
|
35265
|
-
const [personalityTabIndex, setPersonalityTabIndex] = (0,
|
|
35266
|
-
const [restoreDialogOpen, setRestoreDialogOpen] = (0,
|
|
35267
|
-
const [deleteDialogOpen, setDeleteDialogOpen] = (0,
|
|
35268
|
-
const [personalityToDelete, setPersonalityToDelete] = (0,
|
|
35269
|
-
const [clickedChips, setClickedChips] = (0,
|
|
35270
|
-
const [cropperOpen, setCropperOpen] = (0,
|
|
35271
|
-
const [selectedImageFile, setSelectedImageFile] = (0,
|
|
35130
|
+
const [personalityTabIndex, setPersonalityTabIndex] = (0, import_react68.useState)(0);
|
|
35131
|
+
const [restoreDialogOpen, setRestoreDialogOpen] = (0, import_react68.useState)(false);
|
|
35132
|
+
const [deleteDialogOpen, setDeleteDialogOpen] = (0, import_react68.useState)(false);
|
|
35133
|
+
const [personalityToDelete, setPersonalityToDelete] = (0, import_react68.useState)(null);
|
|
35134
|
+
const [clickedChips, setClickedChips] = (0, import_react68.useState)(/* @__PURE__ */ new Set());
|
|
35135
|
+
const [cropperOpen, setCropperOpen] = (0, import_react68.useState)(false);
|
|
35136
|
+
const [selectedImageFile, setSelectedImageFile] = (0, import_react68.useState)(null);
|
|
35272
35137
|
const startNewPersonality = () => {
|
|
35273
35138
|
setLocalSelectedModel({
|
|
35274
35139
|
name: "",
|
|
@@ -35280,9 +35145,9 @@ var PersonalitiesTab = ({
|
|
|
35280
35145
|
setPresetAvatar(null);
|
|
35281
35146
|
setPersonalityTabIndex(1);
|
|
35282
35147
|
};
|
|
35283
|
-
const startNewPersonalityRef = (0,
|
|
35148
|
+
const startNewPersonalityRef = (0, import_react68.useRef)(startNewPersonality);
|
|
35284
35149
|
startNewPersonalityRef.current = startNewPersonality;
|
|
35285
|
-
(0,
|
|
35150
|
+
(0, import_react68.useEffect)(() => {
|
|
35286
35151
|
if (createRequest) startNewPersonalityRef.current();
|
|
35287
35152
|
}, [createRequest]);
|
|
35288
35153
|
const promptTemplates = [
|
|
@@ -36161,7 +36026,7 @@ var PersonalitiesTab = ({
|
|
|
36161
36026
|
var PersonalitiesTab_default = PersonalitiesTab;
|
|
36162
36027
|
|
|
36163
36028
|
// src/management/components/PreferencesTab.tsx
|
|
36164
|
-
var
|
|
36029
|
+
var import_react70 = require("react");
|
|
36165
36030
|
init_memory_modal();
|
|
36166
36031
|
var import_material47 = require("@mui/material");
|
|
36167
36032
|
init_preferencesStore();
|
|
@@ -36172,7 +36037,7 @@ init_useFeatures();
|
|
|
36172
36037
|
init_conversationSyncStore();
|
|
36173
36038
|
|
|
36174
36039
|
// src/hooks/useGatewayQueries.ts
|
|
36175
|
-
var
|
|
36040
|
+
var import_react69 = require("react");
|
|
36176
36041
|
var import_rxjs24 = require("rxjs");
|
|
36177
36042
|
var import_react_query2 = require("@tanstack/react-query");
|
|
36178
36043
|
init_packageSettingsStore();
|
|
@@ -36182,7 +36047,7 @@ var useGatewayClient = () => {
|
|
|
36182
36047
|
const settings = usePackageSettingsStore((state) => state.settings);
|
|
36183
36048
|
const gatewayUrl = settings?.gatewayApiUrl;
|
|
36184
36049
|
const feedbackEmail = settings?.feedbackEmail;
|
|
36185
|
-
const service = (0,
|
|
36050
|
+
const service = (0, import_react69.useMemo)(() => {
|
|
36186
36051
|
if (!gatewayUrl) {
|
|
36187
36052
|
return null;
|
|
36188
36053
|
}
|
|
@@ -36253,16 +36118,16 @@ var PreferencesTab = ({
|
|
|
36253
36118
|
}) => {
|
|
36254
36119
|
const theme = (0, import_material47.useTheme)();
|
|
36255
36120
|
const isMobile = (0, import_material47.useMediaQuery)(theme.breakpoints.down("sm"));
|
|
36256
|
-
const [homeUrlStatus, setHomeUrlStatus] = (0,
|
|
36257
|
-
const [homeUrlError, setHomeUrlError] = (0,
|
|
36258
|
-
const [localHomeUrl, setLocalHomeUrl] = (0,
|
|
36259
|
-
const [importStatus, setImportStatus] = (0,
|
|
36260
|
-
const [syncToggleLoading, setSyncToggleLoading] = (0,
|
|
36261
|
-
const [manualSyncLoading, setManualSyncLoading] = (0,
|
|
36262
|
-
const [advancedVectorToggleLoading, setAdvancedVectorToggleLoading] = (0,
|
|
36263
|
-
const [memoryModalOpen, setMemoryModalOpen] = (0,
|
|
36264
|
-
const timeoutRef = (0,
|
|
36265
|
-
const fileInputRef = (0,
|
|
36121
|
+
const [homeUrlStatus, setHomeUrlStatus] = (0, import_react70.useState)("idle");
|
|
36122
|
+
const [homeUrlError, setHomeUrlError] = (0, import_react70.useState)("");
|
|
36123
|
+
const [localHomeUrl, setLocalHomeUrl] = (0, import_react70.useState)(preferences.homeUrl || "");
|
|
36124
|
+
const [importStatus, setImportStatus] = (0, import_react70.useState)("idle");
|
|
36125
|
+
const [syncToggleLoading, setSyncToggleLoading] = (0, import_react70.useState)(false);
|
|
36126
|
+
const [manualSyncLoading, setManualSyncLoading] = (0, import_react70.useState)(false);
|
|
36127
|
+
const [advancedVectorToggleLoading, setAdvancedVectorToggleLoading] = (0, import_react70.useState)(false);
|
|
36128
|
+
const [memoryModalOpen, setMemoryModalOpen] = (0, import_react70.useState)(false);
|
|
36129
|
+
const timeoutRef = (0, import_react70.useRef)(null);
|
|
36130
|
+
const fileInputRef = (0, import_react70.useRef)(null);
|
|
36266
36131
|
const { exportPreferences, importPreferences, resetToDefaults } = usePreferencesStore();
|
|
36267
36132
|
const {
|
|
36268
36133
|
isServiceAvailable: isTTSSTTAvailable,
|
|
@@ -36374,7 +36239,7 @@ var PreferencesTab = ({
|
|
|
36374
36239
|
if (!gatewayHealth) return "warning";
|
|
36375
36240
|
return gatewayHealth.status?.toLowerCase() === "healthy" ? "success" : "error";
|
|
36376
36241
|
})();
|
|
36377
|
-
const handleGatewayStatusRefresh = (0,
|
|
36242
|
+
const handleGatewayStatusRefresh = (0, import_react70.useCallback)(() => {
|
|
36378
36243
|
if (!gatewayConfigured) {
|
|
36379
36244
|
return;
|
|
36380
36245
|
}
|
|
@@ -36436,7 +36301,7 @@ var PreferencesTab = ({
|
|
|
36436
36301
|
}
|
|
36437
36302
|
return packageSettings?.homeUrl || "";
|
|
36438
36303
|
};
|
|
36439
|
-
(0,
|
|
36304
|
+
(0, import_react70.useEffect)(() => {
|
|
36440
36305
|
setLocalHomeUrl(preferences.homeUrl || "");
|
|
36441
36306
|
}, [preferences.homeUrl]);
|
|
36442
36307
|
const validateAndSaveHomeUrl = async (url) => {
|
|
@@ -36483,7 +36348,7 @@ var PreferencesTab = ({
|
|
|
36483
36348
|
validateAndSaveHomeUrl(value);
|
|
36484
36349
|
}, 1500);
|
|
36485
36350
|
};
|
|
36486
|
-
(0,
|
|
36351
|
+
(0, import_react70.useEffect)(() => {
|
|
36487
36352
|
return () => {
|
|
36488
36353
|
if (timeoutRef.current) {
|
|
36489
36354
|
clearTimeout(timeoutRef.current);
|
|
@@ -37094,8 +36959,8 @@ var PreferencesTab = ({
|
|
|
37094
36959
|
] }) });
|
|
37095
36960
|
};
|
|
37096
36961
|
var ViewportDiagnostics = () => {
|
|
37097
|
-
const [metrics, setMetrics] = (0,
|
|
37098
|
-
(0,
|
|
36962
|
+
const [metrics, setMetrics] = (0, import_react70.useState)({});
|
|
36963
|
+
(0, import_react70.useEffect)(() => {
|
|
37099
36964
|
const read = () => {
|
|
37100
36965
|
const probe = document.createElement("div");
|
|
37101
36966
|
probe.style.cssText = "position:fixed;top:0;bottom:0;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px);visibility:hidden;pointer-events:none;";
|
|
@@ -37129,12 +36994,12 @@ var ViewportDiagnostics = () => {
|
|
|
37129
36994
|
var PreferencesTab_default = PreferencesTab;
|
|
37130
36995
|
|
|
37131
36996
|
// src/management/components/BrandingTab.tsx
|
|
37132
|
-
var
|
|
36997
|
+
var import_react72 = require("react");
|
|
37133
36998
|
var import_material49 = require("@mui/material");
|
|
37134
36999
|
init_src();
|
|
37135
37000
|
|
|
37136
37001
|
// src/components/LogoCropper.tsx
|
|
37137
|
-
var
|
|
37002
|
+
var import_react71 = require("react");
|
|
37138
37003
|
var import_material48 = require("@mui/material");
|
|
37139
37004
|
init_icons();
|
|
37140
37005
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
@@ -37149,25 +37014,25 @@ var LogoCropper = ({
|
|
|
37149
37014
|
onCrop,
|
|
37150
37015
|
imageFile
|
|
37151
37016
|
}) => {
|
|
37152
|
-
const canvasRef = (0,
|
|
37153
|
-
const previewCanvasRef = (0,
|
|
37154
|
-
const imageRef = (0,
|
|
37155
|
-
const [imageSrc, setImageSrc] = (0,
|
|
37156
|
-
const [cropSettings, setCropSettings] = (0,
|
|
37017
|
+
const canvasRef = (0, import_react71.useRef)(null);
|
|
37018
|
+
const previewCanvasRef = (0, import_react71.useRef)(null);
|
|
37019
|
+
const imageRef = (0, import_react71.useRef)(null);
|
|
37020
|
+
const [imageSrc, setImageSrc] = (0, import_react71.useState)("");
|
|
37021
|
+
const [cropSettings, setCropSettings] = (0, import_react71.useState)({
|
|
37157
37022
|
x: 0,
|
|
37158
37023
|
y: 0,
|
|
37159
37024
|
scale: 1,
|
|
37160
37025
|
rotation: 0
|
|
37161
37026
|
});
|
|
37162
|
-
const [isDragging, setIsDragging] = (0,
|
|
37163
|
-
const [dragStart, setDragStart] = (0,
|
|
37164
|
-
const [imageLoaded, setImageLoaded] = (0,
|
|
37165
|
-
const [imageNaturalSize, setImageNaturalSize] = (0,
|
|
37166
|
-
const [aspectRatio, setAspectRatio] = (0,
|
|
37167
|
-
const [cropArea, setCropArea] = (0,
|
|
37027
|
+
const [isDragging, setIsDragging] = (0, import_react71.useState)(false);
|
|
37028
|
+
const [dragStart, setDragStart] = (0, import_react71.useState)({ x: 0, y: 0 });
|
|
37029
|
+
const [imageLoaded, setImageLoaded] = (0, import_react71.useState)(false);
|
|
37030
|
+
const [imageNaturalSize, setImageNaturalSize] = (0, import_react71.useState)({ width: 0, height: 0 });
|
|
37031
|
+
const [aspectRatio, setAspectRatio] = (0, import_react71.useState)("square");
|
|
37032
|
+
const [cropArea, setCropArea] = (0, import_react71.useState)({ width: 400, height: 400 });
|
|
37168
37033
|
const CANVAS_SIZE = 500;
|
|
37169
|
-
const [outputSize, setOutputSize] = (0,
|
|
37170
|
-
const getCropDimensions = (0,
|
|
37034
|
+
const [outputSize, setOutputSize] = (0, import_react71.useState)("large");
|
|
37035
|
+
const getCropDimensions = (0, import_react71.useCallback)(() => {
|
|
37171
37036
|
const maxSize = 380;
|
|
37172
37037
|
switch (aspectRatio) {
|
|
37173
37038
|
case "square":
|
|
@@ -37182,7 +37047,7 @@ var LogoCropper = ({
|
|
|
37182
37047
|
return cropArea;
|
|
37183
37048
|
}
|
|
37184
37049
|
}, [aspectRatio, cropArea]);
|
|
37185
|
-
(0,
|
|
37050
|
+
(0, import_react71.useEffect)(() => {
|
|
37186
37051
|
if (imageFile && open) {
|
|
37187
37052
|
const reader = new FileReader();
|
|
37188
37053
|
reader.onload = (e) => {
|
|
@@ -37194,7 +37059,7 @@ var LogoCropper = ({
|
|
|
37194
37059
|
reader.readAsDataURL(imageFile);
|
|
37195
37060
|
}
|
|
37196
37061
|
}, [imageFile, open]);
|
|
37197
|
-
const handleImageLoad = (0,
|
|
37062
|
+
const handleImageLoad = (0, import_react71.useCallback)(() => {
|
|
37198
37063
|
if (imageRef.current) {
|
|
37199
37064
|
const { naturalWidth, naturalHeight } = imageRef.current;
|
|
37200
37065
|
setImageNaturalSize({ width: naturalWidth, height: naturalHeight });
|
|
@@ -37212,7 +37077,7 @@ var LogoCropper = ({
|
|
|
37212
37077
|
setImageLoaded(true);
|
|
37213
37078
|
}
|
|
37214
37079
|
}, [getCropDimensions]);
|
|
37215
|
-
(0,
|
|
37080
|
+
(0, import_react71.useEffect)(() => {
|
|
37216
37081
|
if (imageLoaded) {
|
|
37217
37082
|
const cropDims = getCropDimensions();
|
|
37218
37083
|
setCropArea(cropDims);
|
|
@@ -37226,7 +37091,7 @@ var LogoCropper = ({
|
|
|
37226
37091
|
}));
|
|
37227
37092
|
}
|
|
37228
37093
|
}, [aspectRatio, imageLoaded, imageNaturalSize, getCropDimensions]);
|
|
37229
|
-
const updatePreview = (0,
|
|
37094
|
+
const updatePreview = (0, import_react71.useCallback)((cropX, cropY, cropDims) => {
|
|
37230
37095
|
const previewCanvas = previewCanvasRef.current;
|
|
37231
37096
|
const mainCanvas = canvasRef.current;
|
|
37232
37097
|
if (!previewCanvas || !mainCanvas) return;
|
|
@@ -37255,7 +37120,7 @@ var LogoCropper = ({
|
|
|
37255
37120
|
previewCtx.lineWidth = 2;
|
|
37256
37121
|
previewCtx.strokeRect(offsetX, offsetY, scaledWidth, scaledHeight);
|
|
37257
37122
|
}, []);
|
|
37258
|
-
const drawCropPreview = (0,
|
|
37123
|
+
const drawCropPreview = (0, import_react71.useCallback)(() => {
|
|
37259
37124
|
const canvas = canvasRef.current;
|
|
37260
37125
|
const image = imageRef.current;
|
|
37261
37126
|
if (!canvas || !image || !imageLoaded) return;
|
|
@@ -37301,14 +37166,14 @@ var LogoCropper = ({
|
|
|
37301
37166
|
ctx.fillRect(cropX + cropDims.width - 1, cropY + cropDims.height - cornerSize + 1, 3, cornerSize);
|
|
37302
37167
|
updatePreview(cropX, cropY, cropDims);
|
|
37303
37168
|
}, [cropSettings, imageLoaded, getCropDimensions, updatePreview]);
|
|
37304
|
-
(0,
|
|
37169
|
+
(0, import_react71.useEffect)(() => {
|
|
37305
37170
|
drawCropPreview();
|
|
37306
37171
|
}, [drawCropPreview]);
|
|
37307
|
-
const handleMouseDown = (0,
|
|
37172
|
+
const handleMouseDown = (0, import_react71.useCallback)((e) => {
|
|
37308
37173
|
setIsDragging(true);
|
|
37309
37174
|
setDragStart({ x: e.clientX, y: e.clientY });
|
|
37310
37175
|
}, []);
|
|
37311
|
-
const handleMouseMove = (0,
|
|
37176
|
+
const handleMouseMove = (0, import_react71.useCallback)((e) => {
|
|
37312
37177
|
if (!isDragging) return;
|
|
37313
37178
|
const deltaX = e.clientX - dragStart.x;
|
|
37314
37179
|
const deltaY = e.clientY - dragStart.y;
|
|
@@ -37319,17 +37184,17 @@ var LogoCropper = ({
|
|
|
37319
37184
|
}));
|
|
37320
37185
|
setDragStart({ x: e.clientX, y: e.clientY });
|
|
37321
37186
|
}, [isDragging, dragStart]);
|
|
37322
|
-
const handleMouseUp = (0,
|
|
37187
|
+
const handleMouseUp = (0, import_react71.useCallback)(() => {
|
|
37323
37188
|
setIsDragging(false);
|
|
37324
37189
|
}, []);
|
|
37325
|
-
const handleClose = (0,
|
|
37190
|
+
const handleClose = (0, import_react71.useCallback)(() => {
|
|
37326
37191
|
setImageSrc("");
|
|
37327
37192
|
setImageLoaded(false);
|
|
37328
37193
|
setCropSettings({ x: 0, y: 0, scale: 1, rotation: 0 });
|
|
37329
37194
|
setAspectRatio("square");
|
|
37330
37195
|
onClose();
|
|
37331
37196
|
}, [onClose]);
|
|
37332
|
-
const handleCrop = (0,
|
|
37197
|
+
const handleCrop = (0, import_react71.useCallback)(() => {
|
|
37333
37198
|
const image = imageRef.current;
|
|
37334
37199
|
if (!image) return;
|
|
37335
37200
|
const cropDims = getCropDimensions();
|
|
@@ -37382,7 +37247,7 @@ var LogoCropper = ({
|
|
|
37382
37247
|
setAspectRatio("square");
|
|
37383
37248
|
onClose();
|
|
37384
37249
|
}, [cropSettings, onCrop, getCropDimensions, outputSize, onClose]);
|
|
37385
|
-
const handleScaleChange = (0,
|
|
37250
|
+
const handleScaleChange = (0, import_react71.useCallback)((value) => {
|
|
37386
37251
|
const cropDims = getCropDimensions();
|
|
37387
37252
|
const minScale2 = Math.max(
|
|
37388
37253
|
cropDims.width / imageNaturalSize.width,
|
|
@@ -37393,7 +37258,7 @@ var LogoCropper = ({
|
|
|
37393
37258
|
scale: Math.max(value, minScale2)
|
|
37394
37259
|
}));
|
|
37395
37260
|
}, [imageNaturalSize, getCropDimensions]);
|
|
37396
|
-
const handleRotation = (0,
|
|
37261
|
+
const handleRotation = (0, import_react71.useCallback)((direction) => {
|
|
37397
37262
|
setCropSettings((prev) => ({
|
|
37398
37263
|
...prev,
|
|
37399
37264
|
rotation: prev.rotation + (direction === "left" ? -90 : 90)
|
|
@@ -37679,20 +37544,20 @@ var BrandingTab = ({
|
|
|
37679
37544
|
setLogoFile,
|
|
37680
37545
|
setLogoBase64
|
|
37681
37546
|
}) => {
|
|
37682
|
-
const [dragOver, setDragOver] = (0,
|
|
37683
|
-
const [snackbarMessage, setSnackbarMessage] = (0,
|
|
37684
|
-
const [showSnackbar, setShowSnackbar] = (0,
|
|
37685
|
-
const [snackbarSeverity, setSnackbarSeverity] = (0,
|
|
37686
|
-
const [cropperOpen, setCropperOpen] = (0,
|
|
37687
|
-
const [selectedImageFile, setSelectedImageFile] = (0,
|
|
37688
|
-
const fileInputRef = (0,
|
|
37689
|
-
const importInputRef = (0,
|
|
37547
|
+
const [dragOver, setDragOver] = (0, import_react72.useState)(false);
|
|
37548
|
+
const [snackbarMessage, setSnackbarMessage] = (0, import_react72.useState)("");
|
|
37549
|
+
const [showSnackbar, setShowSnackbar] = (0, import_react72.useState)(false);
|
|
37550
|
+
const [snackbarSeverity, setSnackbarSeverity] = (0, import_react72.useState)("success");
|
|
37551
|
+
const [cropperOpen, setCropperOpen] = (0, import_react72.useState)(false);
|
|
37552
|
+
const [selectedImageFile, setSelectedImageFile] = (0, import_react72.useState)(null);
|
|
37553
|
+
const fileInputRef = (0, import_react72.useRef)(null);
|
|
37554
|
+
const importInputRef = (0, import_react72.useRef)(null);
|
|
37690
37555
|
const pageMode = (0, import_material49.useTheme)().palette.mode;
|
|
37691
37556
|
const choice = parseBrandingTheme(theme);
|
|
37692
37557
|
const setChoice = (next) => setTheme(brandingThemeKey(next));
|
|
37693
37558
|
const currentAccent = choice.accent ?? skins[choice.skin].accent[choice.mode];
|
|
37694
|
-
const [accentDraft, setAccentDraft] = (0,
|
|
37695
|
-
(0,
|
|
37559
|
+
const [accentDraft, setAccentDraft] = (0, import_react72.useState)(currentAccent);
|
|
37560
|
+
(0, import_react72.useEffect)(() => setAccentDraft(currentAccent), [currentAccent]);
|
|
37696
37561
|
const draftValid = isTenantAccent(accentDraft);
|
|
37697
37562
|
const applyCustomAccent = (value) => {
|
|
37698
37563
|
setAccentDraft(value);
|
|
@@ -38062,14 +37927,14 @@ var WelcomePreview = ({
|
|
|
38062
37927
|
var BrandingTab_default = BrandingTab;
|
|
38063
37928
|
|
|
38064
37929
|
// src/management/components/KnowledgeHubTab.tsx
|
|
38065
|
-
var
|
|
37930
|
+
var import_react78 = require("react");
|
|
38066
37931
|
var import_material53 = require("@mui/material");
|
|
38067
37932
|
|
|
38068
37933
|
// src/management/components/KnowledgeTab.tsx
|
|
38069
|
-
var
|
|
37934
|
+
var import_react76 = require("react");
|
|
38070
37935
|
var import_uuid6 = require("uuid");
|
|
38071
37936
|
var import_material51 = require("@mui/material");
|
|
38072
|
-
var
|
|
37937
|
+
var import_styles29 = require("@mui/material/styles");
|
|
38073
37938
|
init_knowledge_file_modal();
|
|
38074
37939
|
init_DocumentCard();
|
|
38075
37940
|
init_useVectorStore();
|
|
@@ -38077,9 +37942,9 @@ init_authenticationStore();
|
|
|
38077
37942
|
init_useFeatures();
|
|
38078
37943
|
|
|
38079
37944
|
// src/components/shared/ProcessingOverlay.tsx
|
|
38080
|
-
var
|
|
37945
|
+
var import_react73 = require("react");
|
|
38081
37946
|
var import_material50 = require("@mui/material");
|
|
38082
|
-
var
|
|
37947
|
+
var import_react74 = require("@burtson-labs/icons/react");
|
|
38083
37948
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
38084
37949
|
var ninjaFloat = import_material50.keyframes`
|
|
38085
37950
|
0%, 100% { transform: translateY(0px) rotate(0deg); }
|
|
@@ -38104,28 +37969,28 @@ var defaultSteps = [
|
|
|
38104
37969
|
id: "upload",
|
|
38105
37970
|
title: "Uploading to Cloud",
|
|
38106
37971
|
description: "Our digital ninjas are securely transferring your file...",
|
|
38107
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
37972
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react74.Upload, {}),
|
|
38108
37973
|
duration: 5
|
|
38109
37974
|
},
|
|
38110
37975
|
{
|
|
38111
37976
|
id: "analyze",
|
|
38112
37977
|
title: "AI Analysis",
|
|
38113
37978
|
description: "Advanced AI robots are reading and understanding your content...",
|
|
38114
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
37979
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react74.Agent, {}),
|
|
38115
37980
|
duration: 15
|
|
38116
37981
|
},
|
|
38117
37982
|
{
|
|
38118
37983
|
id: "embed",
|
|
38119
37984
|
title: "Making It Searchable",
|
|
38120
37985
|
description: "We turn the content into a private, searchable index...",
|
|
38121
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
37986
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react74.Cpu, {}),
|
|
38122
37987
|
duration: 10
|
|
38123
37988
|
},
|
|
38124
37989
|
{
|
|
38125
37990
|
id: "optimize",
|
|
38126
37991
|
title: "Optimizing Search",
|
|
38127
37992
|
description: "Organizing everything for quick, reliable answers...",
|
|
38128
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
37993
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react74.Sparkles, {}),
|
|
38129
37994
|
duration: 8
|
|
38130
37995
|
}
|
|
38131
37996
|
];
|
|
@@ -38150,17 +38015,17 @@ var ProcessingOverlay = ({
|
|
|
38150
38015
|
customMessages
|
|
38151
38016
|
}) => {
|
|
38152
38017
|
const theme = (0, import_material50.useTheme)();
|
|
38153
|
-
const [messageIndex, setMessageIndex] = (0,
|
|
38154
|
-
const [sparkles, setSparkles] = (0,
|
|
38018
|
+
const [messageIndex, setMessageIndex] = (0, import_react73.useState)(0);
|
|
38019
|
+
const [sparkles, setSparkles] = (0, import_react73.useState)([]);
|
|
38155
38020
|
const messages = customMessages || cleverMessages;
|
|
38156
|
-
(0,
|
|
38021
|
+
(0, import_react73.useEffect)(() => {
|
|
38157
38022
|
if (!open) return;
|
|
38158
38023
|
const interval = setInterval(() => {
|
|
38159
38024
|
setMessageIndex((prev) => (prev + 1) % messages.length);
|
|
38160
38025
|
}, 3e3);
|
|
38161
38026
|
return () => clearInterval(interval);
|
|
38162
38027
|
}, [open, messages.length]);
|
|
38163
|
-
(0,
|
|
38028
|
+
(0, import_react73.useEffect)(() => {
|
|
38164
38029
|
if (!open) return;
|
|
38165
38030
|
const generateSparkles = () => {
|
|
38166
38031
|
const newSparkles = Array.from({ length: 5 }, (_, i) => ({
|
|
@@ -38271,7 +38136,7 @@ var ProcessingOverlay = ({
|
|
|
38271
38136
|
animation: `${pulse} 3s ease-in-out infinite`,
|
|
38272
38137
|
color: theme.palette.secondary.main
|
|
38273
38138
|
},
|
|
38274
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
38139
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react74.Agent, {})
|
|
38275
38140
|
}
|
|
38276
38141
|
),
|
|
38277
38142
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
@@ -38285,7 +38150,7 @@ var ProcessingOverlay = ({
|
|
|
38285
38150
|
color: theme.palette.primary.main,
|
|
38286
38151
|
animationDelay: "1s"
|
|
38287
38152
|
},
|
|
38288
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
38153
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react74.Zap, {})
|
|
38289
38154
|
}
|
|
38290
38155
|
)
|
|
38291
38156
|
] }),
|
|
@@ -38372,16 +38237,16 @@ var ProcessingOverlay = ({
|
|
|
38372
38237
|
var ProcessingOverlay_default = ProcessingOverlay;
|
|
38373
38238
|
|
|
38374
38239
|
// src/hooks/useProcessingOverlay.ts
|
|
38375
|
-
var
|
|
38240
|
+
var import_react75 = require("react");
|
|
38376
38241
|
var useProcessingOverlay = () => {
|
|
38377
|
-
const [processingState, setProcessingState] = (0,
|
|
38242
|
+
const [processingState, setProcessingState] = (0, import_react75.useState)({
|
|
38378
38243
|
isVisible: false,
|
|
38379
38244
|
step: "upload",
|
|
38380
38245
|
progress: 0,
|
|
38381
38246
|
title: "Processing...",
|
|
38382
38247
|
customMessages: void 0
|
|
38383
38248
|
});
|
|
38384
|
-
const showProcessing = (0,
|
|
38249
|
+
const showProcessing = (0, import_react75.useCallback)((title = "Processing...", messages) => {
|
|
38385
38250
|
setProcessingState({
|
|
38386
38251
|
isVisible: true,
|
|
38387
38252
|
step: "upload",
|
|
@@ -38390,13 +38255,13 @@ var useProcessingOverlay = () => {
|
|
|
38390
38255
|
customMessages: messages
|
|
38391
38256
|
});
|
|
38392
38257
|
}, []);
|
|
38393
|
-
const hideProcessing = (0,
|
|
38258
|
+
const hideProcessing = (0, import_react75.useCallback)(() => {
|
|
38394
38259
|
setProcessingState((prev) => ({
|
|
38395
38260
|
...prev,
|
|
38396
38261
|
isVisible: false
|
|
38397
38262
|
}));
|
|
38398
38263
|
}, []);
|
|
38399
|
-
const updateProgress = (0,
|
|
38264
|
+
const updateProgress = (0, import_react75.useCallback)((step, progress) => {
|
|
38400
38265
|
setProcessingState((prev) => ({
|
|
38401
38266
|
...prev,
|
|
38402
38267
|
step,
|
|
@@ -38510,27 +38375,27 @@ var KnowledgeTab = ({
|
|
|
38510
38375
|
} = useVectorStore();
|
|
38511
38376
|
const { showProcessing, hideProcessing, updateProgress, processingState } = useProcessingOverlay();
|
|
38512
38377
|
const shouldUseVector = (features.isAdmin() || features.hasAdvancedSearch() || features.hasAdvancedMemories()) && isAdvancedVectorFeaturesEnabled && isVectorEnabled;
|
|
38513
|
-
const [clearDocsDialogOpen, setClearDocsDialogOpen] = (0,
|
|
38514
|
-
const [selectedDoc, setSelectedDoc] = (0,
|
|
38515
|
-
const [vectorDocuments, setVectorDocuments] = (0,
|
|
38516
|
-
const [loadingVectorDocs, setLoadingVectorDocs] = (0,
|
|
38517
|
-
const [vectorLoadError, setVectorLoadError] = (0,
|
|
38518
|
-
const [searchQuery, setSearchQuery] = (0,
|
|
38519
|
-
const [selectedCategory, setSelectedCategory] = (0,
|
|
38520
|
-
const [contentSourceFilter, setContentSourceFilter] = (0,
|
|
38521
|
-
const [viewMode, setViewMode] = (0,
|
|
38522
|
-
const [sortBy, setSortBy] = (0,
|
|
38523
|
-
const [sortOrder, setSortOrder] = (0,
|
|
38524
|
-
const [selectedDocuments, setSelectedDocuments] = (0,
|
|
38525
|
-
const [uploadStatuses, setUploadStatuses] = (0,
|
|
38526
|
-
const [snackbarMessage, setSnackbarMessage] = (0,
|
|
38527
|
-
const [showSnackbar, setShowSnackbar] = (0,
|
|
38528
|
-
const [snackbarSeverity, setSnackbarSeverity] = (0,
|
|
38529
|
-
const [deletingDocuments, setDeletingDocuments] = (0,
|
|
38378
|
+
const [clearDocsDialogOpen, setClearDocsDialogOpen] = (0, import_react76.useState)(false);
|
|
38379
|
+
const [selectedDoc, setSelectedDoc] = (0, import_react76.useState)(null);
|
|
38380
|
+
const [vectorDocuments, setVectorDocuments] = (0, import_react76.useState)([]);
|
|
38381
|
+
const [loadingVectorDocs, setLoadingVectorDocs] = (0, import_react76.useState)(false);
|
|
38382
|
+
const [vectorLoadError, setVectorLoadError] = (0, import_react76.useState)(null);
|
|
38383
|
+
const [searchQuery, setSearchQuery] = (0, import_react76.useState)("");
|
|
38384
|
+
const [selectedCategory, setSelectedCategory] = (0, import_react76.useState)("all");
|
|
38385
|
+
const [contentSourceFilter, setContentSourceFilter] = (0, import_react76.useState)("all");
|
|
38386
|
+
const [viewMode, setViewMode] = (0, import_react76.useState)("grid");
|
|
38387
|
+
const [sortBy, setSortBy] = (0, import_react76.useState)("date");
|
|
38388
|
+
const [sortOrder, setSortOrder] = (0, import_react76.useState)("desc");
|
|
38389
|
+
const [selectedDocuments, setSelectedDocuments] = (0, import_react76.useState)([]);
|
|
38390
|
+
const [uploadStatuses, setUploadStatuses] = (0, import_react76.useState)([]);
|
|
38391
|
+
const [snackbarMessage, setSnackbarMessage] = (0, import_react76.useState)("");
|
|
38392
|
+
const [showSnackbar, setShowSnackbar] = (0, import_react76.useState)(false);
|
|
38393
|
+
const [snackbarSeverity, setSnackbarSeverity] = (0, import_react76.useState)("success");
|
|
38394
|
+
const [deletingDocuments, setDeletingDocuments] = (0, import_react76.useState)(/* @__PURE__ */ new Set());
|
|
38530
38395
|
const hasTeam = !!(authStore.user?.teamSid || authStore.user?.teamId);
|
|
38531
|
-
const [shareWithTeam, setShareWithTeam] = (0,
|
|
38532
|
-
const [dragActive, setDragActive] = (0,
|
|
38533
|
-
const mapVectorDocsToKnowledgeDocs = (0,
|
|
38396
|
+
const [shareWithTeam, setShareWithTeam] = (0, import_react76.useState)(false);
|
|
38397
|
+
const [dragActive, setDragActive] = (0, import_react76.useState)(false);
|
|
38398
|
+
const mapVectorDocsToKnowledgeDocs = (0, import_react76.useCallback)((vectorDocs) => {
|
|
38534
38399
|
return vectorDocs.map((doc) => {
|
|
38535
38400
|
const primaryId = doc.id ?? doc.fileId ?? doc._id;
|
|
38536
38401
|
const docId = typeof primaryId === "string" ? primaryId : primaryId ? JSON.stringify(primaryId) : (0, import_uuid6.v4)();
|
|
@@ -38558,7 +38423,7 @@ var KnowledgeTab = ({
|
|
|
38558
38423
|
};
|
|
38559
38424
|
});
|
|
38560
38425
|
}, []);
|
|
38561
|
-
const loadVectorDocuments = (0,
|
|
38426
|
+
const loadVectorDocuments = (0, import_react76.useCallback)(async () => {
|
|
38562
38427
|
if (!shouldUseVector) {
|
|
38563
38428
|
return;
|
|
38564
38429
|
}
|
|
@@ -38575,12 +38440,12 @@ var KnowledgeTab = ({
|
|
|
38575
38440
|
setLoadingVectorDocs(false);
|
|
38576
38441
|
}
|
|
38577
38442
|
}, [shouldUseVector, getUserDocuments, mapVectorDocsToKnowledgeDocs]);
|
|
38578
|
-
(0,
|
|
38443
|
+
(0, import_react76.useEffect)(() => {
|
|
38579
38444
|
if (shouldUseVector) {
|
|
38580
38445
|
loadVectorDocuments();
|
|
38581
38446
|
}
|
|
38582
38447
|
}, [shouldUseVector, loadVectorDocuments]);
|
|
38583
|
-
const filteredAndSortedDocuments = (0,
|
|
38448
|
+
const filteredAndSortedDocuments = (0, import_react76.useMemo)(() => {
|
|
38584
38449
|
const sourceDocuments2 = shouldUseVector ? vectorDocuments : documents;
|
|
38585
38450
|
let filtered = sourceDocuments2;
|
|
38586
38451
|
if (searchQuery) {
|
|
@@ -38630,12 +38495,12 @@ var KnowledgeTab = ({
|
|
|
38630
38495
|
});
|
|
38631
38496
|
return filtered;
|
|
38632
38497
|
}, [documents, vectorDocuments, shouldUseVector, searchQuery, selectedCategory, contentSourceFilter, sortBy, sortOrder]);
|
|
38633
|
-
const categories = (0,
|
|
38498
|
+
const categories = (0, import_react76.useMemo)(() => {
|
|
38634
38499
|
const sourceDocuments2 = shouldUseVector ? vectorDocuments : documents;
|
|
38635
38500
|
const cats = new Set(sourceDocuments2.map((doc) => getFileTypeInfo3(doc.name).category));
|
|
38636
38501
|
return Array.from(cats).sort();
|
|
38637
38502
|
}, [documents, vectorDocuments, shouldUseVector]);
|
|
38638
|
-
const statistics = (0,
|
|
38503
|
+
const statistics = (0, import_react76.useMemo)(() => {
|
|
38639
38504
|
const sourceDocuments2 = shouldUseVector ? vectorDocuments : documents;
|
|
38640
38505
|
const totalSize = sourceDocuments2.reduce((sum, doc) => {
|
|
38641
38506
|
if (shouldUseVector && doc.size) {
|
|
@@ -39138,7 +39003,7 @@ var KnowledgeTab = ({
|
|
|
39138
39003
|
borderRadius: 1,
|
|
39139
39004
|
border: "1px dashed",
|
|
39140
39005
|
borderColor: dragActive ? "primary.main" : "divider",
|
|
39141
|
-
bgcolor: dragActive ? (0,
|
|
39006
|
+
bgcolor: dragActive ? (0, import_styles29.alpha)(muiTheme.palette.primary.main, 0.06) : "transparent",
|
|
39142
39007
|
transition: "border-color 0.15s ease, background-color 0.15s ease",
|
|
39143
39008
|
"&:hover, &:focus-visible": { borderColor: "primary.main", outline: "none" }
|
|
39144
39009
|
},
|
|
@@ -39359,7 +39224,7 @@ var KnowledgeTab = ({
|
|
|
39359
39224
|
border: 1,
|
|
39360
39225
|
borderRadius: 1,
|
|
39361
39226
|
borderColor: isSelected ? "primary.main" : "divider",
|
|
39362
|
-
bgcolor: isSelected ? (0,
|
|
39227
|
+
bgcolor: isSelected ? (0, import_styles29.alpha)(muiTheme.palette.primary.main, 0.08) : muiTheme.palette.bandit?.surface.raised ?? "background.paper",
|
|
39363
39228
|
transition: "border-color 0.15s ease, opacity 0.3s ease, transform 0.3s ease",
|
|
39364
39229
|
"&:hover": { borderColor: "primary.main" },
|
|
39365
39230
|
opacity: isDeleting ? 0.3 : 1,
|
|
@@ -39516,7 +39381,7 @@ var KnowledgeTab = ({
|
|
|
39516
39381
|
var KnowledgeTab_default = KnowledgeTab;
|
|
39517
39382
|
|
|
39518
39383
|
// src/management/components/SeedPacksTab.tsx
|
|
39519
|
-
var
|
|
39384
|
+
var import_react77 = require("react");
|
|
39520
39385
|
var import_material52 = require("@mui/material");
|
|
39521
39386
|
init_packageSettingsStore();
|
|
39522
39387
|
init_authenticationStore();
|
|
@@ -40004,47 +39869,47 @@ var SeedPacksTab = () => {
|
|
|
40004
39869
|
const seedPackAdminRoles = /* @__PURE__ */ new Set(["admin", "super-user", "team_admin", "team_owner"]);
|
|
40005
39870
|
const userRoles = authStore.user?.roles ?? [];
|
|
40006
39871
|
const canManage = userRoles.some((role) => seedPackAdminRoles.has(role));
|
|
40007
|
-
const [seedPacks, setSeedPacks] = (0,
|
|
40008
|
-
const [selectedSid, setSelectedSid] = (0,
|
|
40009
|
-
const [selectedSeedPack, setSelectedSeedPack] = (0,
|
|
40010
|
-
const [draft, setDraft] = (0,
|
|
39872
|
+
const [seedPacks, setSeedPacks] = (0, import_react77.useState)([]);
|
|
39873
|
+
const [selectedSid, setSelectedSid] = (0, import_react77.useState)(null);
|
|
39874
|
+
const [selectedSeedPack, setSelectedSeedPack] = (0, import_react77.useState)(null);
|
|
39875
|
+
const [draft, setDraft] = (0, import_react77.useState)({
|
|
40011
39876
|
name: "",
|
|
40012
39877
|
description: "",
|
|
40013
39878
|
content: ""
|
|
40014
39879
|
});
|
|
40015
|
-
const [tagsInput, setTagsInput] = (0,
|
|
40016
|
-
const [importedFiles, setImportedFiles] = (0,
|
|
40017
|
-
const [createImportedFiles, setCreateImportedFiles] = (0,
|
|
40018
|
-
const [previewFile, setPreviewFile] = (0,
|
|
40019
|
-
const fileInputRef = (0,
|
|
40020
|
-
const wikiFolderInputRef = (0,
|
|
40021
|
-
const createFileInputRef = (0,
|
|
40022
|
-
const createWikiFolderInputRef = (0,
|
|
40023
|
-
const [isLoadingList, setIsLoadingList] = (0,
|
|
40024
|
-
const [hasLoadedList, setHasLoadedList] = (0,
|
|
40025
|
-
const [listError, setListError] = (0,
|
|
40026
|
-
const [isLoadingDetail, setIsLoadingDetail] = (0,
|
|
40027
|
-
const [isSaving, setIsSaving] = (0,
|
|
40028
|
-
const [isPublishing, setIsPublishing] = (0,
|
|
40029
|
-
const [isArchiving, setIsArchiving] = (0,
|
|
40030
|
-
const [isDeleting, setIsDeleting] = (0,
|
|
40031
|
-
const [isCreating, setIsCreating] = (0,
|
|
40032
|
-
const [createDialogOpen, setCreateDialogOpen] = (0,
|
|
40033
|
-
const [publishDialogOpen, setPublishDialogOpen] = (0,
|
|
40034
|
-
const [archiveDialogOpen, setArchiveDialogOpen] = (0,
|
|
40035
|
-
const [deleteDialogOpen, setDeleteDialogOpen] = (0,
|
|
40036
|
-
const [newPackName, setNewPackName] = (0,
|
|
40037
|
-
const [newPackDescription, setNewPackDescription] = (0,
|
|
40038
|
-
const [newPackTags, setNewPackTags] = (0,
|
|
40039
|
-
const [snackbarOpen, setSnackbarOpen] = (0,
|
|
40040
|
-
const [snackbarMessage, setSnackbarMessage] = (0,
|
|
40041
|
-
const [snackbarSeverity, setSnackbarSeverity] = (0,
|
|
40042
|
-
const parsedTags = (0,
|
|
40043
|
-
const normalizedSelectedTags = (0,
|
|
39880
|
+
const [tagsInput, setTagsInput] = (0, import_react77.useState)("");
|
|
39881
|
+
const [importedFiles, setImportedFiles] = (0, import_react77.useState)([]);
|
|
39882
|
+
const [createImportedFiles, setCreateImportedFiles] = (0, import_react77.useState)([]);
|
|
39883
|
+
const [previewFile, setPreviewFile] = (0, import_react77.useState)(null);
|
|
39884
|
+
const fileInputRef = (0, import_react77.useRef)(null);
|
|
39885
|
+
const wikiFolderInputRef = (0, import_react77.useRef)(null);
|
|
39886
|
+
const createFileInputRef = (0, import_react77.useRef)(null);
|
|
39887
|
+
const createWikiFolderInputRef = (0, import_react77.useRef)(null);
|
|
39888
|
+
const [isLoadingList, setIsLoadingList] = (0, import_react77.useState)(false);
|
|
39889
|
+
const [hasLoadedList, setHasLoadedList] = (0, import_react77.useState)(false);
|
|
39890
|
+
const [listError, setListError] = (0, import_react77.useState)(null);
|
|
39891
|
+
const [isLoadingDetail, setIsLoadingDetail] = (0, import_react77.useState)(false);
|
|
39892
|
+
const [isSaving, setIsSaving] = (0, import_react77.useState)(false);
|
|
39893
|
+
const [isPublishing, setIsPublishing] = (0, import_react77.useState)(false);
|
|
39894
|
+
const [isArchiving, setIsArchiving] = (0, import_react77.useState)(false);
|
|
39895
|
+
const [isDeleting, setIsDeleting] = (0, import_react77.useState)(false);
|
|
39896
|
+
const [isCreating, setIsCreating] = (0, import_react77.useState)(false);
|
|
39897
|
+
const [createDialogOpen, setCreateDialogOpen] = (0, import_react77.useState)(false);
|
|
39898
|
+
const [publishDialogOpen, setPublishDialogOpen] = (0, import_react77.useState)(false);
|
|
39899
|
+
const [archiveDialogOpen, setArchiveDialogOpen] = (0, import_react77.useState)(false);
|
|
39900
|
+
const [deleteDialogOpen, setDeleteDialogOpen] = (0, import_react77.useState)(false);
|
|
39901
|
+
const [newPackName, setNewPackName] = (0, import_react77.useState)("");
|
|
39902
|
+
const [newPackDescription, setNewPackDescription] = (0, import_react77.useState)("");
|
|
39903
|
+
const [newPackTags, setNewPackTags] = (0, import_react77.useState)("");
|
|
39904
|
+
const [snackbarOpen, setSnackbarOpen] = (0, import_react77.useState)(false);
|
|
39905
|
+
const [snackbarMessage, setSnackbarMessage] = (0, import_react77.useState)("");
|
|
39906
|
+
const [snackbarSeverity, setSnackbarSeverity] = (0, import_react77.useState)("success");
|
|
39907
|
+
const parsedTags = (0, import_react77.useMemo)(() => parseTags(tagsInput), [tagsInput]);
|
|
39908
|
+
const normalizedSelectedTags = (0, import_react77.useMemo)(
|
|
40044
39909
|
() => normalizeTags(selectedSeedPack?.tags),
|
|
40045
39910
|
[selectedSeedPack?.tags]
|
|
40046
39911
|
);
|
|
40047
|
-
const isDirty = (0,
|
|
39912
|
+
const isDirty = (0, import_react77.useMemo)(() => {
|
|
40048
39913
|
if (!selectedSeedPack) {
|
|
40049
39914
|
return false;
|
|
40050
39915
|
}
|
|
@@ -40055,17 +39920,17 @@ var SeedPacksTab = () => {
|
|
|
40055
39920
|
return nameChanged || descriptionChanged || contentChanged || tagsChanged;
|
|
40056
39921
|
}, [draft, parsedTags, normalizedSelectedTags, selectedSeedPack]);
|
|
40057
39922
|
const isReadOnly = !canManage || selectedSeedPack?.status === "archived";
|
|
40058
|
-
const sortedSeedPacks = (0,
|
|
39923
|
+
const sortedSeedPacks = (0, import_react77.useMemo)(() => {
|
|
40059
39924
|
return [...seedPacks].sort((a, b) => getSeedPackTimestamp(b) - getSeedPackTimestamp(a));
|
|
40060
39925
|
}, [seedPacks]);
|
|
40061
39926
|
const scopeLabel = isTeamScope ? "Team scope" : "Personal scope";
|
|
40062
39927
|
const scopeDescription = isTeamScope ? "Applies to all members of your team." : "Applies only to your account.";
|
|
40063
|
-
const showSnackbar = (0,
|
|
39928
|
+
const showSnackbar = (0, import_react77.useCallback)((message, severity) => {
|
|
40064
39929
|
setSnackbarMessage(message);
|
|
40065
39930
|
setSnackbarSeverity(severity);
|
|
40066
39931
|
setSnackbarOpen(true);
|
|
40067
39932
|
}, []);
|
|
40068
|
-
const hydrateDraft = (0,
|
|
39933
|
+
const hydrateDraft = (0, import_react77.useCallback)((pack) => {
|
|
40069
39934
|
setDraft({
|
|
40070
39935
|
name: pack.name ?? "",
|
|
40071
39936
|
description: pack.description ?? "",
|
|
@@ -40075,14 +39940,14 @@ var SeedPacksTab = () => {
|
|
|
40075
39940
|
setImportedFiles([]);
|
|
40076
39941
|
setPreviewFile(null);
|
|
40077
39942
|
}, []);
|
|
40078
|
-
const resetCreateDialog = (0,
|
|
39943
|
+
const resetCreateDialog = (0, import_react77.useCallback)(() => {
|
|
40079
39944
|
setCreateDialogOpen(false);
|
|
40080
39945
|
setNewPackName("");
|
|
40081
39946
|
setNewPackDescription("");
|
|
40082
39947
|
setNewPackTags("");
|
|
40083
39948
|
setCreateImportedFiles([]);
|
|
40084
39949
|
}, []);
|
|
40085
|
-
const refreshSeedPacks = (0,
|
|
39950
|
+
const refreshSeedPacks = (0, import_react77.useCallback)(
|
|
40086
39951
|
async (nextSelectedSid) => {
|
|
40087
39952
|
if (!gatewayConfigured) {
|
|
40088
39953
|
return;
|
|
@@ -40109,7 +39974,7 @@ var SeedPacksTab = () => {
|
|
|
40109
39974
|
},
|
|
40110
39975
|
[gatewayConfigured, selectedSid]
|
|
40111
39976
|
);
|
|
40112
|
-
const loadSeedPackDetail = (0,
|
|
39977
|
+
const loadSeedPackDetail = (0, import_react77.useCallback)(
|
|
40113
39978
|
async (sid) => {
|
|
40114
39979
|
if (!gatewayConfigured) {
|
|
40115
39980
|
return;
|
|
@@ -40131,15 +39996,15 @@ var SeedPacksTab = () => {
|
|
|
40131
39996
|
},
|
|
40132
39997
|
[gatewayConfigured, hydrateDraft, showSnackbar]
|
|
40133
39998
|
);
|
|
40134
|
-
(0,
|
|
39999
|
+
(0, import_react77.useEffect)(() => {
|
|
40135
40000
|
void refreshSeedPacks();
|
|
40136
40001
|
}, [refreshSeedPacks, authStore.token]);
|
|
40137
|
-
(0,
|
|
40002
|
+
(0, import_react77.useEffect)(() => {
|
|
40138
40003
|
if (selectedSid) {
|
|
40139
40004
|
void loadSeedPackDetail(selectedSid);
|
|
40140
40005
|
}
|
|
40141
40006
|
}, [selectedSid, loadSeedPackDetail]);
|
|
40142
|
-
(0,
|
|
40007
|
+
(0, import_react77.useEffect)(() => {
|
|
40143
40008
|
const setDirectoryUploadAttributes = (input) => {
|
|
40144
40009
|
if (!input) {
|
|
40145
40010
|
return;
|
|
@@ -40155,7 +40020,7 @@ var SeedPacksTab = () => {
|
|
|
40155
40020
|
setSelectedSeedPack(pack);
|
|
40156
40021
|
hydrateDraft(pack);
|
|
40157
40022
|
};
|
|
40158
|
-
const handleImportFiles = (0,
|
|
40023
|
+
const handleImportFiles = (0, import_react77.useCallback)(
|
|
40159
40024
|
async (files, source = "local") => {
|
|
40160
40025
|
if (!files || files.length === 0) {
|
|
40161
40026
|
return;
|
|
@@ -40198,24 +40063,24 @@ ${combined}` : combined;
|
|
|
40198
40063
|
},
|
|
40199
40064
|
[importedFiles, showSnackbar]
|
|
40200
40065
|
);
|
|
40201
|
-
const handleFileInputChange = (0,
|
|
40066
|
+
const handleFileInputChange = (0, import_react77.useCallback)(
|
|
40202
40067
|
async (event) => {
|
|
40203
40068
|
await handleImportFiles(event.target.files, "local");
|
|
40204
40069
|
event.target.value = "";
|
|
40205
40070
|
},
|
|
40206
40071
|
[handleImportFiles]
|
|
40207
40072
|
);
|
|
40208
|
-
const handleWikiFolderInputChange = (0,
|
|
40073
|
+
const handleWikiFolderInputChange = (0, import_react77.useCallback)(
|
|
40209
40074
|
async (event) => {
|
|
40210
40075
|
await handleImportFiles(event.target.files, "azure-wiki");
|
|
40211
40076
|
event.target.value = "";
|
|
40212
40077
|
},
|
|
40213
40078
|
[handleImportFiles]
|
|
40214
40079
|
);
|
|
40215
|
-
const handleRemoveImportedFile = (0,
|
|
40080
|
+
const handleRemoveImportedFile = (0, import_react77.useCallback)((id) => {
|
|
40216
40081
|
setImportedFiles((prev) => prev.filter((file) => file.id !== id));
|
|
40217
40082
|
}, []);
|
|
40218
|
-
const handleCreateImportFiles = (0,
|
|
40083
|
+
const handleCreateImportFiles = (0, import_react77.useCallback)(
|
|
40219
40084
|
async (files, source = "local") => {
|
|
40220
40085
|
if (!files || files.length === 0) {
|
|
40221
40086
|
return;
|
|
@@ -40236,24 +40101,24 @@ ${combined}` : combined;
|
|
|
40236
40101
|
},
|
|
40237
40102
|
[showSnackbar]
|
|
40238
40103
|
);
|
|
40239
|
-
const handleCreateFileInputChange = (0,
|
|
40104
|
+
const handleCreateFileInputChange = (0, import_react77.useCallback)(
|
|
40240
40105
|
async (event) => {
|
|
40241
40106
|
await handleCreateImportFiles(event.target.files, "local");
|
|
40242
40107
|
event.target.value = "";
|
|
40243
40108
|
},
|
|
40244
40109
|
[handleCreateImportFiles]
|
|
40245
40110
|
);
|
|
40246
|
-
const handleCreateWikiFolderInputChange = (0,
|
|
40111
|
+
const handleCreateWikiFolderInputChange = (0, import_react77.useCallback)(
|
|
40247
40112
|
async (event) => {
|
|
40248
40113
|
await handleCreateImportFiles(event.target.files, "azure-wiki");
|
|
40249
40114
|
event.target.value = "";
|
|
40250
40115
|
},
|
|
40251
40116
|
[handleCreateImportFiles]
|
|
40252
40117
|
);
|
|
40253
|
-
const handleRemoveCreateImportedFile = (0,
|
|
40118
|
+
const handleRemoveCreateImportedFile = (0, import_react77.useCallback)((id) => {
|
|
40254
40119
|
setCreateImportedFiles((prev) => prev.filter((file) => file.id !== id));
|
|
40255
40120
|
}, []);
|
|
40256
|
-
const buildDraftPayload2 = (0,
|
|
40121
|
+
const buildDraftPayload2 = (0, import_react77.useCallback)(() => {
|
|
40257
40122
|
const name = draft.name.trim();
|
|
40258
40123
|
if (!name) {
|
|
40259
40124
|
showSnackbar("Seed pack name is required.", "error");
|
|
@@ -40267,7 +40132,7 @@ ${combined}` : combined;
|
|
|
40267
40132
|
contentType: "markdown"
|
|
40268
40133
|
};
|
|
40269
40134
|
}, [draft, parsedTags, showSnackbar]);
|
|
40270
|
-
const saveDraft = (0,
|
|
40135
|
+
const saveDraft = (0, import_react77.useCallback)(async () => {
|
|
40271
40136
|
if (!selectedSeedPack) {
|
|
40272
40137
|
return null;
|
|
40273
40138
|
}
|
|
@@ -40982,9 +40847,9 @@ var KnowledgeHubTab = (props) => {
|
|
|
40982
40847
|
const theme = (0, import_material53.useTheme)();
|
|
40983
40848
|
const isMobile = (0, import_material53.useMediaQuery)(theme.breakpoints.down("sm"));
|
|
40984
40849
|
const { seedPacksEnabled = false } = props;
|
|
40985
|
-
const [tabIndex, setTabIndex] = (0,
|
|
40850
|
+
const [tabIndex, setTabIndex] = (0, import_react78.useState)(0);
|
|
40986
40851
|
const effectiveTabIndex = seedPacksEnabled ? tabIndex : 0;
|
|
40987
|
-
(0,
|
|
40852
|
+
(0, import_react78.useEffect)(() => {
|
|
40988
40853
|
if (!seedPacksEnabled && tabIndex !== 0) {
|
|
40989
40854
|
setTabIndex(0);
|
|
40990
40855
|
}
|
|
@@ -41027,7 +40892,7 @@ var KnowledgeHubTab = (props) => {
|
|
|
41027
40892
|
var KnowledgeHubTab_default = KnowledgeHubTab;
|
|
41028
40893
|
|
|
41029
40894
|
// src/management/components/StorageTab.tsx
|
|
41030
|
-
var
|
|
40895
|
+
var import_react79 = require("react");
|
|
41031
40896
|
var import_material54 = require("@mui/material");
|
|
41032
40897
|
init_debugLogger();
|
|
41033
40898
|
init_indexedDBService();
|
|
@@ -41325,21 +41190,21 @@ var clearEntireDatabase = async (dbName) => {
|
|
|
41325
41190
|
};
|
|
41326
41191
|
var StorageTab = ({ currentTheme }) => {
|
|
41327
41192
|
const theme = (0, import_material54.useTheme)();
|
|
41328
|
-
const [storageQuota, setStorageQuota] = (0,
|
|
41193
|
+
const [storageQuota, setStorageQuota] = (0, import_react79.useState)({
|
|
41329
41194
|
used: 0,
|
|
41330
41195
|
quota: 0,
|
|
41331
41196
|
available: 0,
|
|
41332
41197
|
browserQuotaEstimate: 0
|
|
41333
41198
|
});
|
|
41334
|
-
const [storageCategories, setStorageCategories] = (0,
|
|
41335
|
-
const [loading, setLoading] = (0,
|
|
41336
|
-
const [loadError, setLoadError] = (0,
|
|
41337
|
-
const [clearAllDialogOpen, setClearAllDialogOpen] = (0,
|
|
41338
|
-
const [clearCategoryDialog, setClearCategoryDialog] = (0,
|
|
41339
|
-
const [clearing, setClearing] = (0,
|
|
41340
|
-
const [snackbarMessage, setSnackbarMessage] = (0,
|
|
41341
|
-
const [showSnackbar, setShowSnackbar] = (0,
|
|
41342
|
-
const [snackbarSeverity, setSnackbarSeverity] = (0,
|
|
41199
|
+
const [storageCategories, setStorageCategories] = (0, import_react79.useState)([]);
|
|
41200
|
+
const [loading, setLoading] = (0, import_react79.useState)(true);
|
|
41201
|
+
const [loadError, setLoadError] = (0, import_react79.useState)(null);
|
|
41202
|
+
const [clearAllDialogOpen, setClearAllDialogOpen] = (0, import_react79.useState)(false);
|
|
41203
|
+
const [clearCategoryDialog, setClearCategoryDialog] = (0, import_react79.useState)(null);
|
|
41204
|
+
const [clearing, setClearing] = (0, import_react79.useState)(false);
|
|
41205
|
+
const [snackbarMessage, setSnackbarMessage] = (0, import_react79.useState)("");
|
|
41206
|
+
const [showSnackbar, setShowSnackbar] = (0, import_react79.useState)(false);
|
|
41207
|
+
const [snackbarSeverity, setSnackbarSeverity] = (0, import_react79.useState)("success");
|
|
41343
41208
|
const { syncEnabled, isAdvancedVectorFeaturesEnabled } = useConversationSyncStore((state) => ({
|
|
41344
41209
|
syncEnabled: state.syncEnabled,
|
|
41345
41210
|
isAdvancedVectorFeaturesEnabled: state.isAdvancedVectorFeaturesEnabled
|
|
@@ -41390,18 +41255,18 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
41390
41255
|
setLoading(false);
|
|
41391
41256
|
}
|
|
41392
41257
|
};
|
|
41393
|
-
(0,
|
|
41258
|
+
(0, import_react79.useEffect)(() => {
|
|
41394
41259
|
loadStorageData();
|
|
41395
41260
|
}, []);
|
|
41396
|
-
const totalUsed = (0,
|
|
41261
|
+
const totalUsed = (0, import_react79.useMemo)(() => {
|
|
41397
41262
|
return storageCategories.reduce((sum, cat) => sum + cat.size, 0);
|
|
41398
41263
|
}, [storageCategories]);
|
|
41399
|
-
const usagePercentage = (0,
|
|
41264
|
+
const usagePercentage = (0, import_react79.useMemo)(() => {
|
|
41400
41265
|
if (storageQuota.quota === 0) return 0;
|
|
41401
41266
|
const percentage = Math.min(storageQuota.used / storageQuota.quota * 100, 100);
|
|
41402
41267
|
return percentage > 0 && percentage < 0.1 ? 0.1 : percentage;
|
|
41403
41268
|
}, [storageQuota]);
|
|
41404
|
-
const clearableCategories = (0,
|
|
41269
|
+
const clearableCategories = (0, import_react79.useMemo)(() => {
|
|
41405
41270
|
return storageCategories.filter((cat) => cat.canClear);
|
|
41406
41271
|
}, [storageCategories]);
|
|
41407
41272
|
const handleClearCategory = async (category) => {
|
|
@@ -41994,7 +41859,7 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
41994
41859
|
var StorageTab_default = StorageTab;
|
|
41995
41860
|
|
|
41996
41861
|
// src/management/components/ProviderTab.tsx
|
|
41997
|
-
var
|
|
41862
|
+
var import_react80 = require("react");
|
|
41998
41863
|
var import_material55 = require("@mui/material");
|
|
41999
41864
|
init_icons();
|
|
42000
41865
|
init_aiProviderStore();
|
|
@@ -42007,7 +41872,7 @@ var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
|
42007
41872
|
var ProviderTab = () => {
|
|
42008
41873
|
const { provider: currentProvider, config: currentProviderConfig } = useAIProviderStore();
|
|
42009
41874
|
const { settings: packageSettings } = usePackageSettingsStore();
|
|
42010
|
-
const getSuggestedModel = (0,
|
|
41875
|
+
const getSuggestedModel = (0, import_react80.useCallback)((type) => {
|
|
42011
41876
|
const configuredDefault = packageSettings?.defaultModel?.trim();
|
|
42012
41877
|
if (configuredDefault) {
|
|
42013
41878
|
return configuredDefault;
|
|
@@ -42023,7 +41888,7 @@ var ProviderTab = () => {
|
|
|
42023
41888
|
return "";
|
|
42024
41889
|
}
|
|
42025
41890
|
}, [packageSettings?.defaultModel]);
|
|
42026
|
-
const applyDefaultModel = (0,
|
|
41891
|
+
const applyDefaultModel = (0, import_react80.useCallback)((config) => {
|
|
42027
41892
|
const normalized = { ...config };
|
|
42028
41893
|
const trimmed = typeof normalized.defaultModel === "string" ? normalized.defaultModel.trim() : void 0;
|
|
42029
41894
|
const requiresModel = normalized.type === "openai" /* OPENAI */ || normalized.type === "xai" /* XAI */ || normalized.type === "bandit" /* BANDIT */;
|
|
@@ -42043,7 +41908,7 @@ var ProviderTab = () => {
|
|
|
42043
41908
|
}
|
|
42044
41909
|
return normalized;
|
|
42045
41910
|
}, [getSuggestedModel]);
|
|
42046
|
-
const sanitizeConfigForSave = (0,
|
|
41911
|
+
const sanitizeConfigForSave = (0, import_react80.useCallback)((config) => {
|
|
42047
41912
|
const sanitized = { ...config };
|
|
42048
41913
|
if (typeof sanitized.defaultModel === "string") {
|
|
42049
41914
|
const trimmed = sanitized.defaultModel.trim();
|
|
@@ -42055,22 +41920,22 @@ var ProviderTab = () => {
|
|
|
42055
41920
|
}
|
|
42056
41921
|
return sanitized;
|
|
42057
41922
|
}, []);
|
|
42058
|
-
const [providerConfig, setProviderConfig] = (0,
|
|
41923
|
+
const [providerConfig, setProviderConfig] = (0, import_react80.useState)({
|
|
42059
41924
|
type: "gateway",
|
|
42060
41925
|
gatewayUrl: packageSettings?.gatewayApiUrl || "",
|
|
42061
41926
|
provider: "bandit"
|
|
42062
41927
|
});
|
|
42063
|
-
const [saveResult, setSaveResult] = (0,
|
|
42064
|
-
const [testResult, setTestResult] = (0,
|
|
42065
|
-
const providerTypeRef = (0,
|
|
42066
|
-
const formRef = (0,
|
|
41928
|
+
const [saveResult, setSaveResult] = (0, import_react80.useState)({ state: "idle" });
|
|
41929
|
+
const [testResult, setTestResult] = (0, import_react80.useState)({ state: "idle" });
|
|
41930
|
+
const providerTypeRef = (0, import_react80.useRef)(null);
|
|
41931
|
+
const formRef = (0, import_react80.useRef)(null);
|
|
42067
41932
|
const revealProviderForm = () => {
|
|
42068
41933
|
formRef.current?.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
42069
41934
|
providerTypeRef.current?.focus();
|
|
42070
41935
|
};
|
|
42071
|
-
const [snackbarMessage, setSnackbarMessage] = (0,
|
|
42072
|
-
const [showSnackbar, setShowSnackbar] = (0,
|
|
42073
|
-
const [snackbarSeverity, setSnackbarSeverity] = (0,
|
|
41936
|
+
const [snackbarMessage, setSnackbarMessage] = (0, import_react80.useState)("");
|
|
41937
|
+
const [showSnackbar, setShowSnackbar] = (0, import_react80.useState)(false);
|
|
41938
|
+
const [snackbarSeverity, setSnackbarSeverity] = (0, import_react80.useState)("success");
|
|
42074
41939
|
const saveProviderConfigToDB = async (config) => {
|
|
42075
41940
|
try {
|
|
42076
41941
|
const { tokenFactory: _tokenFactory, ...persistableConfig } = config;
|
|
@@ -42111,7 +41976,7 @@ var ProviderTab = () => {
|
|
|
42111
41976
|
}
|
|
42112
41977
|
return null;
|
|
42113
41978
|
};
|
|
42114
|
-
const convertAnthropicConfig = (0,
|
|
41979
|
+
const convertAnthropicConfig = (0, import_react80.useCallback)((config) => {
|
|
42115
41980
|
if (!config) return null;
|
|
42116
41981
|
if (config.type !== "anthropic" /* ANTHROPIC */) {
|
|
42117
41982
|
return config;
|
|
@@ -42127,7 +41992,7 @@ var ProviderTab = () => {
|
|
|
42127
41992
|
};
|
|
42128
41993
|
return converted;
|
|
42129
41994
|
}, [packageSettings?.gatewayApiUrl]);
|
|
42130
|
-
(0,
|
|
41995
|
+
(0, import_react80.useEffect)(() => {
|
|
42131
41996
|
const initializeProviderConfig = async () => {
|
|
42132
41997
|
const savedConfig = await loadProviderConfigFromDB();
|
|
42133
41998
|
if (savedConfig) {
|
|
@@ -42603,7 +42468,7 @@ var ProviderTab = () => {
|
|
|
42603
42468
|
};
|
|
42604
42469
|
|
|
42605
42470
|
// src/management/components/MCPToolsTabV2.tsx
|
|
42606
|
-
var
|
|
42471
|
+
var import_react82 = require("react");
|
|
42607
42472
|
var import_material57 = require("@mui/material");
|
|
42608
42473
|
|
|
42609
42474
|
// src/services/mcp/mcpControllerService.ts
|
|
@@ -42680,7 +42545,7 @@ async function fetchMcpHealth() {
|
|
|
42680
42545
|
}
|
|
42681
42546
|
|
|
42682
42547
|
// src/management/components/McpServersSection.tsx
|
|
42683
|
-
var
|
|
42548
|
+
var import_react81 = require("react");
|
|
42684
42549
|
var import_material56 = require("@mui/material");
|
|
42685
42550
|
init_icons();
|
|
42686
42551
|
init_mcpServersService();
|
|
@@ -42751,18 +42616,18 @@ var CATALOG = [
|
|
|
42751
42616
|
];
|
|
42752
42617
|
var errorDetail = (e) => e instanceof Error && e.message ? e.message : void 0;
|
|
42753
42618
|
var McpServersSection = () => {
|
|
42754
|
-
const [servers, setServers] = (0,
|
|
42755
|
-
const [loading, setLoading] = (0,
|
|
42756
|
-
const [error, setError] = (0,
|
|
42757
|
-
const [loadError, setLoadError] = (0,
|
|
42758
|
-
const [form, setForm] = (0,
|
|
42759
|
-
const [activeEntry, setActiveEntry] = (0,
|
|
42760
|
-
const [adding, setAdding] = (0,
|
|
42761
|
-
const [showForm, setShowForm] = (0,
|
|
42762
|
-
const [tools, setTools] = (0,
|
|
42619
|
+
const [servers, setServers] = (0, import_react81.useState)([]);
|
|
42620
|
+
const [loading, setLoading] = (0, import_react81.useState)(false);
|
|
42621
|
+
const [error, setError] = (0, import_react81.useState)(null);
|
|
42622
|
+
const [loadError, setLoadError] = (0, import_react81.useState)(null);
|
|
42623
|
+
const [form, setForm] = (0, import_react81.useState)(emptyForm);
|
|
42624
|
+
const [activeEntry, setActiveEntry] = (0, import_react81.useState)(null);
|
|
42625
|
+
const [adding, setAdding] = (0, import_react81.useState)(false);
|
|
42626
|
+
const [showForm, setShowForm] = (0, import_react81.useState)(false);
|
|
42627
|
+
const [tools, setTools] = (0, import_react81.useState)({});
|
|
42763
42628
|
const reloadChatTools = useMCPToolsStore((s) => s.loadMcpServerTools);
|
|
42764
|
-
const formRef = (0,
|
|
42765
|
-
const refresh = (0,
|
|
42629
|
+
const formRef = (0, import_react81.useRef)(null);
|
|
42630
|
+
const refresh = (0, import_react81.useCallback)(async () => {
|
|
42766
42631
|
setLoading(true);
|
|
42767
42632
|
setLoadError(null);
|
|
42768
42633
|
try {
|
|
@@ -42776,7 +42641,7 @@ var McpServersSection = () => {
|
|
|
42776
42641
|
setLoading(false);
|
|
42777
42642
|
}
|
|
42778
42643
|
}, []);
|
|
42779
|
-
(0,
|
|
42644
|
+
(0, import_react81.useEffect)(() => {
|
|
42780
42645
|
refresh();
|
|
42781
42646
|
}, [refresh]);
|
|
42782
42647
|
const connectedKeys = new Set(servers.map((s) => s.url.replace(/\/+$/, "")));
|
|
@@ -43149,10 +43014,10 @@ var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
|
43149
43014
|
var MCPToolsTabV2 = () => {
|
|
43150
43015
|
const { settings } = usePackageSettingsStore();
|
|
43151
43016
|
const { tools: localTools, loadTools, toggleTool, syncControllerTools, isLoaded, saveState, lastSavedAt, saveTools } = useMCPToolsStore();
|
|
43152
|
-
const [loading, setLoading] = (0,
|
|
43153
|
-
const [error, setError] = (0,
|
|
43154
|
-
const [tools, setTools] = (0,
|
|
43155
|
-
const [health, setHealth] = (0,
|
|
43017
|
+
const [loading, setLoading] = (0, import_react82.useState)(true);
|
|
43018
|
+
const [error, setError] = (0, import_react82.useState)(null);
|
|
43019
|
+
const [tools, setTools] = (0, import_react82.useState)([]);
|
|
43020
|
+
const [health, setHealth] = (0, import_react82.useState)(null);
|
|
43156
43021
|
const gatewayConfigured = !!settings?.gatewayApiUrl;
|
|
43157
43022
|
const refresh = async () => {
|
|
43158
43023
|
setLoading(true);
|
|
@@ -43177,7 +43042,7 @@ var MCPToolsTabV2 = () => {
|
|
|
43177
43042
|
setLoading(false);
|
|
43178
43043
|
}
|
|
43179
43044
|
};
|
|
43180
|
-
(0,
|
|
43045
|
+
(0, import_react82.useEffect)(() => {
|
|
43181
43046
|
if (isLoaded) {
|
|
43182
43047
|
refresh();
|
|
43183
43048
|
} else {
|
|
@@ -43186,7 +43051,7 @@ var MCPToolsTabV2 = () => {
|
|
|
43186
43051
|
});
|
|
43187
43052
|
}
|
|
43188
43053
|
}, [isLoaded]);
|
|
43189
|
-
const localEnabledMap = (0,
|
|
43054
|
+
const localEnabledMap = (0, import_react82.useMemo)(() => {
|
|
43190
43055
|
const map23 = /* @__PURE__ */ new Map();
|
|
43191
43056
|
const sortedTools = [...localTools].sort((a, b) => {
|
|
43192
43057
|
if (a.isBuiltIn && !b.isBuiltIn) return -1;
|
|
@@ -43341,9 +43206,9 @@ init_useNotificationService();
|
|
|
43341
43206
|
init_icons();
|
|
43342
43207
|
|
|
43343
43208
|
// src/management/shell/ManagementShell.tsx
|
|
43344
|
-
var
|
|
43209
|
+
var import_react83 = __toESM(require("react"));
|
|
43345
43210
|
var import_material58 = require("@mui/material");
|
|
43346
|
-
var
|
|
43211
|
+
var import_styles30 = require("@mui/material/styles");
|
|
43347
43212
|
init_icons();
|
|
43348
43213
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
43349
43214
|
var RAIL_WIDTH = 248;
|
|
@@ -43366,17 +43231,17 @@ var railItemSx = (theme, selected) => ({
|
|
|
43366
43231
|
py: 0.375,
|
|
43367
43232
|
mb: 0.25,
|
|
43368
43233
|
color: selected ? theme.palette.text.primary : theme.palette.text.secondary,
|
|
43369
|
-
bgcolor: selected ? (0,
|
|
43234
|
+
bgcolor: selected ? (0, import_styles30.alpha)(theme.palette.primary.main, theme.palette.mode === "dark" ? 0.16 : 0.1) : "transparent",
|
|
43370
43235
|
boxShadow: selected ? `inset 2px 0 0 ${theme.palette.primary.main}` : "none",
|
|
43371
43236
|
transition: theme.transitions.create(["background-color", "color"], {
|
|
43372
43237
|
duration: theme.transitions.duration.shortest
|
|
43373
43238
|
}),
|
|
43374
43239
|
"&:hover": {
|
|
43375
|
-
bgcolor: selected ? (0,
|
|
43240
|
+
bgcolor: selected ? (0, import_styles30.alpha)(theme.palette.primary.main, theme.palette.mode === "dark" ? 0.2 : 0.14) : theme.palette.bandit?.surface.interactiveHover ?? theme.palette.action.hover,
|
|
43376
43241
|
color: theme.palette.text.primary
|
|
43377
43242
|
},
|
|
43378
43243
|
"&.Mui-selected, &.Mui-selected:hover": {
|
|
43379
|
-
bgcolor: (0,
|
|
43244
|
+
bgcolor: (0, import_styles30.alpha)(theme.palette.primary.main, theme.palette.mode === "dark" ? 0.18 : 0.12)
|
|
43380
43245
|
},
|
|
43381
43246
|
"& .MuiListItemIcon-root": {
|
|
43382
43247
|
minWidth: 28,
|
|
@@ -43546,7 +43411,7 @@ function Navigation({
|
|
|
43546
43411
|
}
|
|
43547
43412
|
function ManagementShell(props) {
|
|
43548
43413
|
const { isMobile, children, sections, active: active2, onBackToChat, onBackHover, onOpenCommandPalette } = props;
|
|
43549
|
-
const [sheetOpen, setSheetOpen] =
|
|
43414
|
+
const [sheetOpen, setSheetOpen] = import_react83.default.useState(false);
|
|
43550
43415
|
const current = sections.find((s) => s.id === active2);
|
|
43551
43416
|
if (isMobile) {
|
|
43552
43417
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_material58.Box, { sx: { display: "flex", flexDirection: "column", height: "100dvh", bgcolor: "background.default" }, children: [
|
|
@@ -43617,7 +43482,7 @@ function ManagementShell(props) {
|
|
|
43617
43482
|
borderRadius: 2,
|
|
43618
43483
|
mx: "auto",
|
|
43619
43484
|
mt: 1,
|
|
43620
|
-
bgcolor: (0,
|
|
43485
|
+
bgcolor: (0, import_styles30.alpha)(theme.palette.text.primary, 0.2)
|
|
43621
43486
|
})
|
|
43622
43487
|
}
|
|
43623
43488
|
),
|
|
@@ -43656,7 +43521,7 @@ function ManagementShell(props) {
|
|
|
43656
43521
|
|
|
43657
43522
|
// src/management/shell/ManagementOverview.tsx
|
|
43658
43523
|
var import_material59 = require("@mui/material");
|
|
43659
|
-
var
|
|
43524
|
+
var import_styles31 = require("@mui/material/styles");
|
|
43660
43525
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
43661
43526
|
var PROVIDER_LABELS = {
|
|
43662
43527
|
ollama: "Ollama",
|
|
@@ -43692,7 +43557,7 @@ function Tile({
|
|
|
43692
43557
|
transition: theme.transitions.create(["border-color", "background-color"], {
|
|
43693
43558
|
duration: theme.transitions.duration.shortest
|
|
43694
43559
|
}),
|
|
43695
|
-
"&:hover": { borderColor: (0,
|
|
43560
|
+
"&:hover": { borderColor: (0, import_styles31.alpha)(theme.palette.primary.main, 0.5) },
|
|
43696
43561
|
"&:focus-visible": { outline: `2px solid ${theme.palette.primary.main}`, outlineOffset: 2 }
|
|
43697
43562
|
}),
|
|
43698
43563
|
children: [
|
|
@@ -43809,7 +43674,7 @@ function ManagementOverview({
|
|
|
43809
43674
|
}
|
|
43810
43675
|
|
|
43811
43676
|
// src/management/shell/sections.ts
|
|
43812
|
-
var
|
|
43677
|
+
var import_react84 = require("react");
|
|
43813
43678
|
init_useFeatures();
|
|
43814
43679
|
init_authenticationService();
|
|
43815
43680
|
var MANAGEMENT_SECTIONS = [
|
|
@@ -43900,7 +43765,7 @@ function useManagementAccess() {
|
|
|
43900
43765
|
const limited = hasLimitedAdminDashboard();
|
|
43901
43766
|
const full = hasAdminDashboard();
|
|
43902
43767
|
const advanced = hasAdvancedSearch();
|
|
43903
|
-
return (0,
|
|
43768
|
+
return (0, import_react84.useMemo)(() => {
|
|
43904
43769
|
const roles = (token ? authenticationService.parseJwtClaims(token)?.roles : void 0) ?? [];
|
|
43905
43770
|
return {
|
|
43906
43771
|
sections: resolveManagementSections({
|
|
@@ -43978,16 +43843,16 @@ var Management = ({
|
|
|
43978
43843
|
hasTransparentLogo,
|
|
43979
43844
|
setHasTransparentLogo
|
|
43980
43845
|
} = useModelStore();
|
|
43981
|
-
const [modalOpen, setModalOpen] = (0,
|
|
43846
|
+
const [modalOpen, setModalOpen] = (0, import_react85.useState)(false);
|
|
43982
43847
|
const banditHead5 = "https://cdn.burtson.ai/images/bandit-head.png";
|
|
43983
|
-
const [fabLogo, setFabLogo] = (0,
|
|
43984
|
-
const [logoFile, setLogoFile] = (0,
|
|
43985
|
-
const [logoBase64, setLogoBase64] = (0,
|
|
43986
|
-
const [brandingText, setBrandingText] = (0,
|
|
43987
|
-
const [headerMode, setHeaderMode] = (0,
|
|
43988
|
-
const [theme, setTheme] = (0,
|
|
43989
|
-
const [customAvatarBase64, setCustomAvatarBase64] = (0,
|
|
43990
|
-
const [presetAvatar, setPresetAvatar] = (0,
|
|
43848
|
+
const [fabLogo, setFabLogo] = (0, import_react85.useState)(banditHead5);
|
|
43849
|
+
const [logoFile, setLogoFile] = (0, import_react85.useState)(null);
|
|
43850
|
+
const [logoBase64, setLogoBase64] = (0, import_react85.useState)(null);
|
|
43851
|
+
const [brandingText, setBrandingText] = (0, import_react85.useState)("");
|
|
43852
|
+
const [headerMode, setHeaderMode] = (0, import_react85.useState)("logo");
|
|
43853
|
+
const [theme, setTheme] = (0, import_react85.useState)("bandit-dark");
|
|
43854
|
+
const [customAvatarBase64, setCustomAvatarBase64] = (0, import_react85.useState)(null);
|
|
43855
|
+
const [presetAvatar, setPresetAvatar] = (0, import_react85.useState)(null);
|
|
43991
43856
|
const showSnackbarMessage = (message, severity = "success") => {
|
|
43992
43857
|
if (severity === "success") {
|
|
43993
43858
|
notificationService2?.showSuccess(message);
|
|
@@ -43995,15 +43860,15 @@ var Management = ({
|
|
|
43995
43860
|
notificationService2?.showError(message);
|
|
43996
43861
|
}
|
|
43997
43862
|
};
|
|
43998
|
-
const [brandingLoaded, setBrandingLoaded] = (0,
|
|
43999
|
-
const [isLoadingBranding, setIsLoadingBranding] = (0,
|
|
43863
|
+
const [brandingLoaded, setBrandingLoaded] = (0, import_react85.useState)(false);
|
|
43864
|
+
const [isLoadingBranding, setIsLoadingBranding] = (0, import_react85.useState)(false);
|
|
44000
43865
|
const { initModels } = useModelStore();
|
|
44001
43866
|
const { settings: packageSettings } = usePackageSettingsStore();
|
|
44002
43867
|
const authToken = useAuthenticationStore((state) => state.token);
|
|
44003
43868
|
const { preferences, updatePreference } = usePreferencesStore();
|
|
44004
43869
|
const { provider: currentProvider, config: currentProviderConfig } = useAIProviderStore();
|
|
44005
|
-
const [seedPacksEnabled, setSeedPacksEnabled] = (0,
|
|
44006
|
-
const [localSelectedModel, setLocalSelectedModel] = (0,
|
|
43870
|
+
const [seedPacksEnabled, setSeedPacksEnabled] = (0, import_react85.useState)(false);
|
|
43871
|
+
const [localSelectedModel, setLocalSelectedModel] = (0, import_react85.useState)({
|
|
44007
43872
|
name: "",
|
|
44008
43873
|
tagline: "",
|
|
44009
43874
|
systemPrompt: "",
|
|
@@ -44016,7 +43881,7 @@ var Management = ({
|
|
|
44016
43881
|
loadDocuments,
|
|
44017
43882
|
clearAllDocuments
|
|
44018
43883
|
} = useKnowledgeStore2();
|
|
44019
|
-
(0,
|
|
43884
|
+
(0, import_react85.useEffect)(() => {
|
|
44020
43885
|
if (selectedModel) {
|
|
44021
43886
|
const selected = availableModels.find((m) => m.name === selectedModel);
|
|
44022
43887
|
if (selected) {
|
|
@@ -44040,7 +43905,7 @@ var Management = ({
|
|
|
44040
43905
|
}
|
|
44041
43906
|
}
|
|
44042
43907
|
}, [selectedModel, availableModels]);
|
|
44043
|
-
const loadBrandingConfig = (0,
|
|
43908
|
+
const loadBrandingConfig = (0, import_react85.useCallback)(async () => {
|
|
44044
43909
|
if (isLoadingBranding || brandingLoaded) {
|
|
44045
43910
|
debugLogger.warn("Branding loading already in progress or completed, skipping");
|
|
44046
43911
|
return;
|
|
@@ -44157,15 +44022,15 @@ var Management = ({
|
|
|
44157
44022
|
setTagline,
|
|
44158
44023
|
setTheme
|
|
44159
44024
|
]);
|
|
44160
|
-
(0,
|
|
44025
|
+
(0, import_react85.useEffect)(() => {
|
|
44161
44026
|
void loadBrandingConfig();
|
|
44162
44027
|
}, [loadBrandingConfig]);
|
|
44163
44028
|
const handleOpenModal = () => setModalOpen(true);
|
|
44164
44029
|
const handleCloseModal = () => setModalOpen(false);
|
|
44165
|
-
(0,
|
|
44030
|
+
(0, import_react85.useEffect)(() => {
|
|
44166
44031
|
getOptimalFabLogo().then(setFabLogo);
|
|
44167
44032
|
}, []);
|
|
44168
|
-
(0,
|
|
44033
|
+
(0, import_react85.useEffect)(() => {
|
|
44169
44034
|
if (logoBase64) {
|
|
44170
44035
|
setFabLogo(logoBase64);
|
|
44171
44036
|
} else {
|
|
@@ -44623,7 +44488,7 @@ var Management = ({
|
|
|
44623
44488
|
reader.readAsText(file);
|
|
44624
44489
|
}
|
|
44625
44490
|
};
|
|
44626
|
-
(0,
|
|
44491
|
+
(0, import_react85.useEffect)(() => {
|
|
44627
44492
|
if (localSelectedModel.selectedModel && !availableModels.some((m) => m.name === localSelectedModel.selectedModel)) {
|
|
44628
44493
|
setLocalSelectedModel((prev) => ({
|
|
44629
44494
|
...prev,
|
|
@@ -44631,10 +44496,10 @@ var Management = ({
|
|
|
44631
44496
|
}));
|
|
44632
44497
|
}
|
|
44633
44498
|
}, [availableModels, localSelectedModel.selectedModel]);
|
|
44634
|
-
(0,
|
|
44499
|
+
(0, import_react85.useEffect)(() => {
|
|
44635
44500
|
loadDocuments();
|
|
44636
44501
|
}, [loadDocuments]);
|
|
44637
|
-
(0,
|
|
44502
|
+
(0, import_react85.useEffect)(() => {
|
|
44638
44503
|
const gatewayApiUrl = packageSettings?.gatewayApiUrl;
|
|
44639
44504
|
if (!gatewayApiUrl || gatewayApiUrl.toLowerCase().startsWith("playground://")) {
|
|
44640
44505
|
setSeedPacksEnabled(false);
|
|
@@ -44677,20 +44542,20 @@ var Management = ({
|
|
|
44677
44542
|
isActive = false;
|
|
44678
44543
|
};
|
|
44679
44544
|
}, [packageSettings?.gatewayApiUrl, authToken]);
|
|
44680
|
-
const currentTheme = (0,
|
|
44681
|
-
(0,
|
|
44545
|
+
const currentTheme = (0, import_react85.useMemo)(() => createBrandingTheme(theme, { density: "compact" }), [theme]);
|
|
44546
|
+
(0, import_react85.useEffect)(() => {
|
|
44682
44547
|
onThemeChange?.(currentTheme);
|
|
44683
44548
|
}, [currentTheme, onThemeChange]);
|
|
44684
44549
|
const access = useManagementAccess();
|
|
44685
|
-
const sections = (0,
|
|
44550
|
+
const sections = (0, import_react85.useMemo)(
|
|
44686
44551
|
() => sectionOverride ? MANAGEMENT_SECTIONS.filter((s) => sectionOverride.includes(s.id)) : access.sections,
|
|
44687
44552
|
[sectionOverride, access.sections]
|
|
44688
44553
|
);
|
|
44689
44554
|
const defaultSection = sections.some((s) => s.id === "overview") ? "overview" : sections.some((s) => s.id === "preferences") ? "preferences" : sections[0]?.id ?? "preferences";
|
|
44690
|
-
const [ownSection, setOwnSection] = (0,
|
|
44555
|
+
const [ownSection, setOwnSection] = (0, import_react85.useState)(null);
|
|
44691
44556
|
const requested = controlledSection ?? ownSection ?? defaultSection;
|
|
44692
44557
|
const active2 = sections.some((s) => s.id === requested) ? requested : defaultSection;
|
|
44693
|
-
const selectSection = (0,
|
|
44558
|
+
const selectSection = (0, import_react85.useCallback)(
|
|
44694
44559
|
(id) => {
|
|
44695
44560
|
setOwnSection(id);
|
|
44696
44561
|
onSectionChange?.(id);
|
|
@@ -44698,9 +44563,9 @@ var Management = ({
|
|
|
44698
44563
|
[onSectionChange]
|
|
44699
44564
|
);
|
|
44700
44565
|
const activeDef = sectionById(active2);
|
|
44701
|
-
const [createPersonalityRequest, setCreatePersonalityRequest] = (0,
|
|
44702
|
-
const [pendingUpload, setPendingUpload] = (0,
|
|
44703
|
-
(0,
|
|
44566
|
+
const [createPersonalityRequest, setCreatePersonalityRequest] = (0, import_react85.useState)(0);
|
|
44567
|
+
const [pendingUpload, setPendingUpload] = (0, import_react85.useState)(0);
|
|
44568
|
+
(0, import_react85.useEffect)(() => {
|
|
44704
44569
|
if (!request) return;
|
|
44705
44570
|
if (request.action === "create-personality") {
|
|
44706
44571
|
selectSection("personalities");
|
|
@@ -44710,10 +44575,10 @@ var Management = ({
|
|
|
44710
44575
|
setPendingUpload(request.id);
|
|
44711
44576
|
}
|
|
44712
44577
|
}, [request?.id]);
|
|
44713
|
-
(0,
|
|
44578
|
+
(0, import_react85.useEffect)(() => {
|
|
44714
44579
|
if (createPersonalityRequest && active2 === "personalities" && brandingLoaded) setCreatePersonalityRequest(0);
|
|
44715
44580
|
}, [createPersonalityRequest, active2, brandingLoaded]);
|
|
44716
|
-
(0,
|
|
44581
|
+
(0, import_react85.useEffect)(() => {
|
|
44717
44582
|
if (!pendingUpload || active2 !== "knowledge" || !brandingLoaded) return;
|
|
44718
44583
|
const frame = requestAnimationFrame(() => {
|
|
44719
44584
|
document.getElementById("file-upload")?.click();
|
|
@@ -44725,9 +44590,9 @@ var Management = ({
|
|
|
44725
44590
|
const prefSavedAt = usePreferencesStore((state) => state.lastSavedAt);
|
|
44726
44591
|
const retryPreferences = usePreferencesStore((state) => state.savePreferences);
|
|
44727
44592
|
const brandingValue = JSON.stringify({ logoBase64, brandingText, headerMode, theme });
|
|
44728
|
-
const [brandingBaseline, setBrandingBaseline] = (0,
|
|
44729
|
-
const [brandingSave, setBrandingSave] = (0,
|
|
44730
|
-
(0,
|
|
44593
|
+
const [brandingBaseline, setBrandingBaseline] = (0, import_react85.useState)(null);
|
|
44594
|
+
const [brandingSave, setBrandingSave] = (0, import_react85.useState)("idle");
|
|
44595
|
+
(0, import_react85.useEffect)(() => {
|
|
44731
44596
|
if (brandingLoaded && brandingBaseline === null) setBrandingBaseline(brandingValue);
|
|
44732
44597
|
}, [brandingLoaded, brandingBaseline, brandingValue]);
|
|
44733
44598
|
const brandingDirty = brandingBaseline !== null && brandingBaseline !== brandingValue;
|
|
@@ -44752,7 +44617,7 @@ var Management = ({
|
|
|
44752
44617
|
(m) => m.name === (localSelectedModel.selectedModel || localSelectedModel.name)
|
|
44753
44618
|
);
|
|
44754
44619
|
const personalityDirty = savedPersonality ? norm(localSelectedModel.name) !== norm(savedPersonality.name) || norm(localSelectedModel.tagline) !== norm(savedPersonality.tagline) || norm(localSelectedModel.systemPrompt) !== norm(savedPersonality.systemPrompt) : Boolean(norm(localSelectedModel.name) || norm(localSelectedModel.tagline) || norm(localSelectedModel.systemPrompt));
|
|
44755
|
-
const [personalitySaving, setPersonalitySaving] = (0,
|
|
44620
|
+
const [personalitySaving, setPersonalitySaving] = (0, import_react85.useState)(false);
|
|
44756
44621
|
const savePersonalityFromBar = async () => {
|
|
44757
44622
|
setPersonalitySaving(true);
|
|
44758
44623
|
try {
|
|
@@ -44964,7 +44829,7 @@ var Management = ({
|
|
|
44964
44829
|
var management_default = Management;
|
|
44965
44830
|
|
|
44966
44831
|
// src/management/components/InterestsEditor.tsx
|
|
44967
|
-
var
|
|
44832
|
+
var import_react86 = require("react");
|
|
44968
44833
|
var import_material61 = require("@mui/material");
|
|
44969
44834
|
init_preferencesStore();
|
|
44970
44835
|
init_getStableQuestionPrompt();
|
|
@@ -44977,7 +44842,7 @@ var InterestsEditor = ({
|
|
|
44977
44842
|
const updatePreference = usePreferencesStore((s) => s.updatePreference);
|
|
44978
44843
|
const loadPreferences = usePreferencesStore((s) => s.loadPreferences);
|
|
44979
44844
|
const isLoaded = usePreferencesStore((s) => s.isLoaded);
|
|
44980
|
-
(0,
|
|
44845
|
+
(0, import_react86.useEffect)(() => {
|
|
44981
44846
|
if (!isLoaded) {
|
|
44982
44847
|
void loadPreferences();
|
|
44983
44848
|
}
|
|
@@ -45009,7 +44874,7 @@ var InterestsEditor = ({
|
|
|
45009
44874
|
var InterestsEditor_default = InterestsEditor;
|
|
45010
44875
|
|
|
45011
44876
|
// src/shared/custom-element.ts
|
|
45012
|
-
var
|
|
44877
|
+
var import_react87 = __toESM(require("react"));
|
|
45013
44878
|
var import_client = __toESM(require("react-dom/client"));
|
|
45014
44879
|
function defineCustomElement(name, Component) {
|
|
45015
44880
|
if (customElements.get(name)) return;
|
|
@@ -45037,7 +44902,7 @@ function defineCustomElement(name, Component) {
|
|
|
45037
44902
|
if (!this.root) {
|
|
45038
44903
|
this.root = import_client.default.createRoot(this.mountPoint);
|
|
45039
44904
|
}
|
|
45040
|
-
this.root.render(
|
|
44905
|
+
this.root.render(import_react87.default.createElement(Component, props));
|
|
45041
44906
|
}
|
|
45042
44907
|
}
|
|
45043
44908
|
customElements.define(name, ReactElement);
|
|
@@ -45246,7 +45111,7 @@ var getFeatureMatrix = () => featureFlagService.generateFeatureMatrix();
|
|
|
45246
45111
|
init_featureFlags();
|
|
45247
45112
|
|
|
45248
45113
|
// src/hooks/useVoices.ts
|
|
45249
|
-
var
|
|
45114
|
+
var import_react88 = require("react");
|
|
45250
45115
|
init_voiceStore();
|
|
45251
45116
|
init_packageSettingsStore();
|
|
45252
45117
|
init_authenticationStore();
|
|
@@ -45266,7 +45131,7 @@ var useVoices = () => {
|
|
|
45266
45131
|
} = useVoiceStore();
|
|
45267
45132
|
const gatewayApiUrl = usePackageSettingsStore((state) => state.settings?.gatewayApiUrl);
|
|
45268
45133
|
const { token } = useAuthenticationStore();
|
|
45269
|
-
(0,
|
|
45134
|
+
(0, import_react88.useEffect)(() => {
|
|
45270
45135
|
const isAuthenticated = authenticationService.isAuthenticated();
|
|
45271
45136
|
if (gatewayApiUrl && token && isAuthenticated && !isServiceAvailable) {
|
|
45272
45137
|
debugLogger.debug("Gateway API URL and JWT token available, loading voice models...");
|
|
@@ -45303,7 +45168,7 @@ init_streaming_tts();
|
|
|
45303
45168
|
// src/modals/SubscriptionExpiredModal.tsx
|
|
45304
45169
|
init_storeBuild();
|
|
45305
45170
|
var import_material62 = require("@mui/material");
|
|
45306
|
-
var
|
|
45171
|
+
var import_react89 = require("@burtson-labs/icons/react");
|
|
45307
45172
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
45308
45173
|
var SubscriptionExpiredModal = ({
|
|
45309
45174
|
open,
|
|
@@ -45342,7 +45207,7 @@ var SubscriptionExpiredModal = ({
|
|
|
45342
45207
|
},
|
|
45343
45208
|
children: [
|
|
45344
45209
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.DialogTitle, { sx: { textAlign: "center", pb: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "center", gap: 1, mb: 1 }, children: [
|
|
45345
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
45210
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react89.AlertTriangle, { size: 32, color: "warning" }),
|
|
45346
45211
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Typography, { variant: "h5", component: "span", fontWeight: "bold", children: "Subscription Expired" })
|
|
45347
45212
|
] }) }),
|
|
45348
45213
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.DialogContent, { sx: { pt: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Stack, { spacing: 2, children: [
|
|
@@ -45370,7 +45235,7 @@ var SubscriptionExpiredModal = ({
|
|
|
45370
45235
|
{
|
|
45371
45236
|
onClick: handleNavigateHome,
|
|
45372
45237
|
variant: "outlined",
|
|
45373
|
-
startIcon: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
45238
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react89.Home, {}),
|
|
45374
45239
|
size: "large",
|
|
45375
45240
|
sx: { minWidth: 140 },
|
|
45376
45241
|
children: "Go Home"
|
|
@@ -45381,7 +45246,7 @@ var SubscriptionExpiredModal = ({
|
|
|
45381
45246
|
{
|
|
45382
45247
|
onClick: handleManageSubscription,
|
|
45383
45248
|
variant: "contained",
|
|
45384
|
-
startIcon: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
45249
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react89.CreditCard, {}),
|
|
45385
45250
|
size: "large",
|
|
45386
45251
|
color: "primary",
|
|
45387
45252
|
sx: { minWidth: 140 },
|
|
@@ -45395,7 +45260,7 @@ var SubscriptionExpiredModal = ({
|
|
|
45395
45260
|
};
|
|
45396
45261
|
|
|
45397
45262
|
// src/guards/SubscriptionExpiredGuard.tsx
|
|
45398
|
-
var
|
|
45263
|
+
var import_react90 = require("react");
|
|
45399
45264
|
init_useFeatures();
|
|
45400
45265
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
45401
45266
|
var SubscriptionExpiredGuard = ({
|
|
@@ -45406,9 +45271,9 @@ var SubscriptionExpiredGuard = ({
|
|
|
45406
45271
|
allowContinue = false
|
|
45407
45272
|
}) => {
|
|
45408
45273
|
const { isExpiredTier, getFullEvaluation } = useFeatures();
|
|
45409
|
-
const [showModal, setShowModal] = (0,
|
|
45410
|
-
const [userDismissed, setUserDismissed] = (0,
|
|
45411
|
-
(0,
|
|
45274
|
+
const [showModal, setShowModal] = (0, import_react90.useState)(false);
|
|
45275
|
+
const [userDismissed, setUserDismissed] = (0, import_react90.useState)(false);
|
|
45276
|
+
(0, import_react90.useEffect)(() => {
|
|
45412
45277
|
if (isExpiredTier() && !userDismissed) {
|
|
45413
45278
|
setShowModal(true);
|
|
45414
45279
|
} else {
|
|
@@ -45563,26 +45428,11 @@ var showInfoNotification = (message, context) => {
|
|
|
45563
45428
|
};
|
|
45564
45429
|
|
|
45565
45430
|
// src/core/license-validator.ts
|
|
45566
|
-
var getNodeEnvironment = () => {
|
|
45567
|
-
const globalProcess = globalThis.process;
|
|
45568
|
-
return globalProcess?.env?.NODE_ENV;
|
|
45569
|
-
};
|
|
45570
45431
|
function validateSystemIntegrity() {
|
|
45571
|
-
|
|
45572
|
-
"BL-CORE-2025",
|
|
45573
|
-
"BANDIT-ENGINE-LICENSED",
|
|
45574
|
-
"BURTSON-VALIDATED-SYSTEM"
|
|
45575
|
-
];
|
|
45576
|
-
if (getNodeEnvironment() !== "production") {
|
|
45577
|
-
console.debug("System integrity check passed - Licensed to Burtson Labs");
|
|
45578
|
-
}
|
|
45579
|
-
return licenseMarkers.length > 0;
|
|
45432
|
+
return true;
|
|
45580
45433
|
}
|
|
45581
45434
|
var CORE_SYSTEM_TOKEN = "BL-SYSTEM-1751692562421";
|
|
45582
45435
|
function initializeCoreSystem() {
|
|
45583
|
-
if (!validateSystemIntegrity()) {
|
|
45584
|
-
throw new Error("System integrity check failed - Contact legal@burtson.ai");
|
|
45585
|
-
}
|
|
45586
45436
|
return CORE_SYSTEM_TOKEN;
|
|
45587
45437
|
}
|
|
45588
45438
|
|
|
@@ -45608,8 +45458,7 @@ function getSystemConstants() {
|
|
|
45608
45458
|
|
|
45609
45459
|
// src/utils/critical-helpers.ts
|
|
45610
45460
|
function validateEnvironment() {
|
|
45611
|
-
|
|
45612
|
-
return requiredKeys.every((key) => key.includes("BL") || key.includes("BURTSON"));
|
|
45461
|
+
return false;
|
|
45613
45462
|
}
|
|
45614
45463
|
function getCriticalConfig() {
|
|
45615
45464
|
return {
|