@promptbook/components 0.112.0-97 → 0.112.0-98

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.
@@ -1,5 +1,6 @@
1
1
  import { type MouseEvent, type MutableRefObject, type ReactNode } from 'react';
2
2
  import type { Promisable } from 'type-fest';
3
+ import type { ChatSaveFormatHandlerMap } from '../save/_common/ChatSaveFormatHandler';
3
4
  import type { string_chat_format_name } from '../save/_common/string_chat_format_name';
4
5
  import type { ChatMessage } from '../types/ChatMessage';
5
6
  import type { ChatParticipant } from '../types/ChatParticipant';
@@ -27,6 +28,7 @@ export type ChatActionsBarProps = {
27
28
  onUseTemplate?: () => void;
28
29
  extraActions?: ReactNode;
29
30
  saveFormats?: Array<string_chat_format_name>;
31
+ saveFormatHandlers?: ChatSaveFormatHandlerMap;
30
32
  isSaveButtonEnabled: boolean;
31
33
  shouldFadeActions: boolean;
32
34
  /**
@@ -8,6 +8,7 @@ import type { AgentChipData } from '../AgentChip/AgentChip';
8
8
  import type { string_chat_format_name } from '../save/_common/string_chat_format_name';
9
9
  import type { ChatMessage } from '../types/ChatMessage';
10
10
  import type { ChatParticipant } from '../types/ChatParticipant';
11
+ import type { ChatSaveFormatHandlerMap } from '../save/_common/ChatSaveFormatHandler';
11
12
  /**
12
13
  * Response data returned by the optional `onFeedback` handler.
13
14
  *
@@ -629,6 +630,11 @@ export type ChatProps = {
629
630
  * @default * All supported formats (see `string_chat_format_name` type)
630
631
  */
631
632
  readonly saveFormats?: Array<string_chat_format_name>;
633
+ /**
634
+ * Optional host-provided handlers that replace the default browser download flow
635
+ * for selected save formats.
636
+ */
637
+ readonly saveFormatHandlers?: ChatSaveFormatHandlerMap;
632
638
  /**
633
639
  * Is the writing textarea automatically focused?
634
640
  *
@@ -0,0 +1,35 @@
1
+ import type { Promisable } from 'type-fest';
2
+ import type { ChatMessage } from '../../types/ChatMessage';
3
+ import type { ChatParticipant } from '../../types/ChatParticipant';
4
+ import type { string_chat_format_name } from './string_chat_format_name';
5
+ /**
6
+ * Serializable chat payload exposed to custom save-format handlers.
7
+ *
8
+ * @private Internal helper for chat save integrations.
9
+ */
10
+ export type ChatSaveFormatHandlerOptions = {
11
+ /**
12
+ * Exported chat title used by downstream filename or document generation.
13
+ */
14
+ readonly title: string;
15
+ /**
16
+ * Messages included in the export.
17
+ */
18
+ readonly messages: ReadonlyArray<ChatMessage>;
19
+ /**
20
+ * Participant metadata included in the export.
21
+ */
22
+ readonly participants: ReadonlyArray<ChatParticipant>;
23
+ };
24
+ /**
25
+ * Custom handler used to override one chat save format.
26
+ *
27
+ * @private Internal helper for chat save integrations.
28
+ */
29
+ export type ChatSaveFormatHandler = (options: ChatSaveFormatHandlerOptions) => Promisable<void>;
30
+ /**
31
+ * Optional map of chat save formats handled by the host application.
32
+ *
33
+ * @private Internal helper for chat save integrations.
34
+ */
35
+ export type ChatSaveFormatHandlerMap = Partial<Record<string_chat_format_name, ChatSaveFormatHandler>>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Builds one normalized filename for a chat export download.
3
+ *
4
+ * @param title - Human-readable chat title.
5
+ * @param fileExtension - Output file extension without a leading dot.
6
+ * @param date - Export date used in the filename.
7
+ * @returns Stable filename suitable for browser downloads and HTTP headers.
8
+ *
9
+ * @private Internal helper shared by chat export flows.
10
+ */
11
+ export declare function createChatExportFilename(title: string, fileExtension: string, date?: Date): string;
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
15
15
  export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
16
16
  /**
17
17
  * Represents the version string of the Promptbook engine.
18
- * It follows semantic versioning (e.g., `0.112.0-96`).
18
+ * It follows semantic versioning (e.g., `0.112.0-97`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/components",
3
- "version": "0.112.0-97",
3
+ "version": "0.112.0-98",
4
4
  "description": "Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action",
5
5
  "private": false,
6
6
  "sideEffects": false,
package/umd/index.umd.js CHANGED
@@ -31,7 +31,7 @@
31
31
  * @generated
32
32
  * @see https://github.com/webgptorg/promptbook
33
33
  */
34
- const PROMPTBOOK_ENGINE_VERSION = '0.112.0-97';
34
+ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-98';
35
35
  /**
36
36
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
37
37
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -26133,6 +26133,24 @@
26133
26133
  */
26134
26134
  const TemplateIcon = ({ size }) => (jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "currentColor", children: jsxRuntime.jsx("path", { d: "M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z" }) }));
26135
26135
 
26136
+ /**
26137
+ * Builds one normalized filename for a chat export download.
26138
+ *
26139
+ * @param title - Human-readable chat title.
26140
+ * @param fileExtension - Output file extension without a leading dot.
26141
+ * @param date - Export date used in the filename.
26142
+ * @returns Stable filename suitable for browser downloads and HTTP headers.
26143
+ *
26144
+ * @private Internal helper shared by chat export flows.
26145
+ */
26146
+ function createChatExportFilename(title, fileExtension, date = new Date()) {
26147
+ const dateName = `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date
26148
+ .getDate()
26149
+ .toString()
26150
+ .padStart(2, '0')}`;
26151
+ return `${normalizeToKebabCase(title)}-${dateName}.${fileExtension}`;
26152
+ }
26153
+
26136
26154
  /**
26137
26155
  * Maximum number of characters shown for a simplified knowledge label.
26138
26156
  *
@@ -28172,7 +28190,7 @@
28172
28190
  */
28173
28191
  function ChatActionsBar(props) {
28174
28192
  var _a;
28175
- const { actionsRef, actionsContainer, messages, participants, title, onReset, resetRequiresConfirmation = true, newChatButtonHref, onUseTemplate, extraActions, saveFormats, isSaveButtonEnabled, shouldFadeActions, shouldDisableActions, chatUiTranslations, onButtonClick, } = props;
28193
+ const { actionsRef, actionsContainer, messages, participants, title, onReset, resetRequiresConfirmation = true, newChatButtonHref, onUseTemplate, extraActions, saveFormats, saveFormatHandlers, isSaveButtonEnabled, shouldFadeActions, shouldDisableActions, chatUiTranslations, onButtonClick, } = props;
28176
28194
  const [showSaveMenu, setShowSaveMenu] = react.useState(false);
28177
28195
  react.useEffect(() => {
28178
28196
  const handleKeyDown = (event) => {
@@ -28188,21 +28206,26 @@
28188
28206
  };
28189
28207
  }, []);
28190
28208
  const handleDownload = react.useCallback(async (format) => {
28209
+ const customSaveFormatHandler = saveFormatHandlers === null || saveFormatHandlers === void 0 ? void 0 : saveFormatHandlers[format];
28210
+ if (customSaveFormatHandler) {
28211
+ await customSaveFormatHandler({
28212
+ title,
28213
+ messages,
28214
+ participants,
28215
+ });
28216
+ setShowSaveMenu(false);
28217
+ return;
28218
+ }
28191
28219
  const formatDefinition = getChatSaveFormatDefinitions([format])[0];
28192
28220
  if (!formatDefinition) {
28193
28221
  return;
28194
28222
  }
28195
- const date = new Date();
28196
- const dateName = `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date
28197
- .getDate()
28198
- .toString()
28199
- .padStart(2, '0')}`;
28200
28223
  const content = await formatDefinition.getContent({ title, messages, participants });
28201
28224
  const blob = new Blob([content], { type: formatDefinition.mimeType });
28202
28225
  const url = URL.createObjectURL(blob);
28203
28226
  const link = document.createElement('a');
28204
28227
  link.href = url;
28205
- link.download = `${normalizeToKebabCase(title)}-${dateName}.${formatDefinition.fileExtension}`;
28228
+ link.download = createChatExportFilename(title, formatDefinition.fileExtension);
28206
28229
  document.body.appendChild(link);
28207
28230
  link.click();
28208
28231
  setTimeout(() => {
@@ -28210,7 +28233,7 @@
28210
28233
  URL.revokeObjectURL(url);
28211
28234
  }, 100);
28212
28235
  setShowSaveMenu(false);
28213
- }, [messages, participants, title]);
28236
+ }, [messages, participants, saveFormatHandlers, title]);
28214
28237
  const firstMessageFromUser = ((_a = messages[0]) === null || _a === void 0 ? void 0 : _a.sender) === 'USER';
28215
28238
  const actionsAlignmentClass = classNames(styles$5.actions, firstMessageFromUser ? styles$5.left : styles$5.right);
28216
28239
  const newChatButtonLabel = (chatUiTranslations === null || chatUiTranslations === void 0 ? void 0 : chatUiTranslations.newChatButtonLabel) || 'New chat';
@@ -40003,7 +40026,7 @@
40003
40026
  * @public exported from `@promptbook/components`
40004
40027
  */
40005
40028
  function Chat(props) {
40006
- const { title = 'Chat', messages, onChange, onMessage, onActionButton, onQuickMessageButton, onReplyToMessage, onCancelReply, onReset, resetRequiresConfirmation = true, newChatButtonHref, onFeedback, feedbackMode = 'stars', feedbackTranslations, timingTranslations, onFileUpload, chatLocale, speechRecognition, placeholderMessageContent, defaultMessage, enterBehavior, resolveEnterBehavior, children, className, style, isAiTextHumanizedAndPromptbookified = true, isVoiceCalling = false, isFocusedOnLoad, participants = [], canReplyToMessage, replyingToMessage, extraActions, actionsContainer, saveFormats, isSaveButtonEnabled = true, isCopyButtonEnabled = true, buttonColor: buttonColorRaw, onUseTemplate, onCreateAgent, toolTitles, teammates, teamAgentProfiles, layout, visualMode = 'ARTICLE_MODE', theme = 'LIGHT', effectConfigs, soundSystem, speechRecognitionLanguage, isSpeechPlaybackEnabled = true, elevenLabsVoiceId, chatUiTranslations, } = props;
40029
+ const { title = 'Chat', messages, onChange, onMessage, onActionButton, onQuickMessageButton, onReplyToMessage, onCancelReply, onReset, resetRequiresConfirmation = true, newChatButtonHref, onFeedback, feedbackMode = 'stars', feedbackTranslations, timingTranslations, onFileUpload, chatLocale, speechRecognition, placeholderMessageContent, defaultMessage, enterBehavior, resolveEnterBehavior, children, className, style, isAiTextHumanizedAndPromptbookified = true, isVoiceCalling = false, isFocusedOnLoad, participants = [], canReplyToMessage, replyingToMessage, extraActions, actionsContainer, saveFormats, saveFormatHandlers, isSaveButtonEnabled = true, isCopyButtonEnabled = true, buttonColor: buttonColorRaw, onUseTemplate, onCreateAgent, toolTitles, teammates, teamAgentProfiles, layout, visualMode = 'ARTICLE_MODE', theme = 'LIGHT', effectConfigs, soundSystem, speechRecognitionLanguage, isSpeechPlaybackEnabled = true, elevenLabsVoiceId, chatUiTranslations, } = props;
40007
40030
  const buttonColor = react.useMemo(() => Color.from(buttonColorRaw || '#0066cc'), [buttonColorRaw]);
40008
40031
  const agentParticipant = react.useMemo(() => participants.find((participant) => participant.name === 'AGENT'), [participants]);
40009
40032
  const postprocessedMessages = useChatPostprocessedMessages({
@@ -40048,7 +40071,7 @@
40048
40071
  useChatCompleteNotification(messages, soundSystem);
40049
40072
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [feedbackStatus && (jsxRuntime.jsx("div", { className: classNames(styles$5.feedbackStatus, feedbackStatus.variant === 'success'
40050
40073
  ? styles$5.feedbackStatusSuccess
40051
- : styles$5.feedbackStatusError), "aria-live": "polite", role: "status", children: feedbackStatus.message })), effectConfigs && effectConfigs.length > 0 && (jsxRuntime.jsx(ChatEffectsSystem, { messages: postprocessedMessages, effectConfigs: effectConfigs, soundSystem: soundSystem })), jsxRuntime.jsx("div", { className: classNames(className, styles$5.Chat, layout === 'STANDALONE' && styles$5.standaloneVisual, layout === 'FULL_PAGE' && styles$5.fullPageVisual, isConstrainedArticleMode && styles$5.constrainedArticleVisual, getChatCssClassName('Chat'), chatCssClassNames.chat), "data-chat-theme": mode.toLowerCase(), style, children: jsxRuntime.jsxs("div", { className: classNames(className, styles$5.chatMainFlow, getChatCssClassName('chatMainFlow'), chatCssClassNames.chatMainFlow), children: [children && jsxRuntime.jsx("div", { className: classNames(styles$5.chatChildren), children: children }), shouldShowScrollToBottom && (jsxRuntime.jsx("div", { className: styles$5.scrollToBottomContainer, children: jsxRuntime.jsxs("div", { className: styles$5.scrollToBottomWrapper, children: [jsxRuntime.jsx(SolidArrowButton, { "data-button-type": "custom", direction: "down", iconSize: 33, className: classNames(styles$5.scrollToBottom, scrollToBottomCssClassName), onClick: handleButtonClick(() => scrollToBottom()), "aria-label": ariaLabel, title: ariaLabel }), badgeLabel && (jsxRuntime.jsx("span", { className: styles$5.scrollToBottomBadge, "aria-live": "polite", role: "status", children: badgeLabel }))] }) })), isVoiceCalling && (jsxRuntime.jsx("div", { className: styles$5.voiceCallIndicatorBar, children: jsxRuntime.jsxs("div", { className: styles$5.voiceCallIndicator, children: [jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: jsxRuntime.jsx("path", { d: "M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z" }) }), jsxRuntime.jsx("span", { children: "Voice call active" }), jsxRuntime.jsx("div", { className: styles$5.voiceCallPulse })] }) })), jsxRuntime.jsx(ChatActionsBar, { actionsRef: actionsRef, actionsContainer: actionsContainer, messages: postprocessedMessages, participants: participants, title: title, onReset: onReset, resetRequiresConfirmation: resetRequiresConfirmation, newChatButtonHref: newChatButtonHref, onUseTemplate: onUseTemplate, extraActions: extraActions, saveFormats: saveFormats, isSaveButtonEnabled: isSaveButtonEnabled, shouldFadeActions: shouldFadeActions, shouldDisableActions: shouldDisableActions, chatUiTranslations: chatUiTranslations, onButtonClick: handleButtonClick }), jsxRuntime.jsx(ChatMessageList, { messages: postprocessedMessages, participants: participants, expandedMessageId: expandedMessageId, messageRatings: messageRatings, setExpandedMessageId: setExpandedMessageId, handleRating: handleRating, mode: mode, isCopyButtonEnabled: isCopyButtonEnabled, isFeedbackEnabled: isFeedbackEnabled, feedbackMode: feedbackMode, feedbackTranslations: feedbackTranslations, timingTranslations: timingTranslations, chatLocale: chatLocale, onCopy: handleCopy, onMessage: onMessage, onActionButton: onActionButton, onQuickMessageButton: onQuickMessageButton, onReplyToMessage: onReplyToMessage, canReplyToMessage: canReplyToMessage, onCreateAgent: onCreateAgent, toolTitles: toolTitles, teammates: teammates, teamAgentProfiles: teamAgentProfiles, visualMode: visualMode, soundSystem: soundSystem, onToolCallClick: openToolCall, onCitationClick: openCitation, setChatMessagesElement: setChatMessagesElement, onScroll: handleChatScroll, isSpeechPlaybackEnabled: isSpeechPlaybackEnabled, elevenLabsVoiceId: elevenLabsVoiceId, chatUiTranslations: chatUiTranslations, chatMessagesClassName: classNames(isConstrainedArticleMode && styles$5.articleModeChatMessages, getChatCssClassName('chatMessages'), chatCssClassNames.chatMessages), hasActions: hasActions }), onMessage && (jsxRuntime.jsx(ChatInputArea, { onMessage: onMessage, onChange: onChange, onFileUpload: onFileUpload, speechRecognition: speechRecognition, speechRecognitionLanguage: speechRecognitionLanguage, replyingToMessage: replyingToMessage, onCancelReply: onCancelReply, defaultMessage: defaultMessage, enterBehavior: enterBehavior, resolveEnterBehavior: resolveEnterBehavior, placeholderMessageContent: placeholderMessageContent || (chatUiTranslations === null || chatUiTranslations === void 0 ? void 0 : chatUiTranslations.inputPlaceholder), isFocusedOnLoad: isFocusedOnLoad, isMobile: isMobile, isVoiceCalling: isVoiceCalling, participants: participants, buttonColor: buttonColor, soundSystem: soundSystem, onButtonClick: handleButtonClick, chatUiTranslations: chatUiTranslations, chatInputClassName: classNames(isConstrainedArticleMode && styles$5.articleModeChatInput, getChatCssClassName('chatInput'), chatCssClassNames.chatInput) }))] }) }), jsxRuntime.jsx(ChatToolCallModal, { isOpen: toolCallModalOpen, toolCall: selectedToolCall, toolCallIdentity: selectedToolCallIdentity, onClose: closeToolCallModal, toolTitles: toolTitles, agentParticipant: agentParticipant, buttonColor: buttonColor, teamAgentProfiles: teamAgentProfiles, chatUiTranslations: chatUiTranslations, locale: chatLocale, availableTools: selectedMessageAvailableTools, mode: mode }), jsxRuntime.jsx(ChatCitationModal, { isOpen: citationModalOpen, citation: selectedCitation, participants: participants, soundSystem: soundSystem, onClose: closeCitationModal }), jsxRuntime.jsx(ChatRatingModal, { isOpen: ratingModalOpen, selectedMessage: selectedMessage, postprocessedMessages: postprocessedMessages, messages: messages, hoveredRating: hoveredRating, messageRatings: messageRatings, textRating: textRating, feedbackMode: feedbackMode, feedbackTranslations: feedbackTranslations, mode: mode, isMobile: isMobile, onClose: () => setRatingModalOpen(false), setHoveredRating: setHoveredRating, setMessageRatings: setMessageRatings, setSelectedMessage: setSelectedMessage, setTextRating: setTextRating, submitRating: submitRating })] }));
40074
+ : styles$5.feedbackStatusError), "aria-live": "polite", role: "status", children: feedbackStatus.message })), effectConfigs && effectConfigs.length > 0 && (jsxRuntime.jsx(ChatEffectsSystem, { messages: postprocessedMessages, effectConfigs: effectConfigs, soundSystem: soundSystem })), jsxRuntime.jsx("div", { className: classNames(className, styles$5.Chat, layout === 'STANDALONE' && styles$5.standaloneVisual, layout === 'FULL_PAGE' && styles$5.fullPageVisual, isConstrainedArticleMode && styles$5.constrainedArticleVisual, getChatCssClassName('Chat'), chatCssClassNames.chat), "data-chat-theme": mode.toLowerCase(), style, children: jsxRuntime.jsxs("div", { className: classNames(className, styles$5.chatMainFlow, getChatCssClassName('chatMainFlow'), chatCssClassNames.chatMainFlow), children: [children && jsxRuntime.jsx("div", { className: classNames(styles$5.chatChildren), children: children }), shouldShowScrollToBottom && (jsxRuntime.jsx("div", { className: styles$5.scrollToBottomContainer, children: jsxRuntime.jsxs("div", { className: styles$5.scrollToBottomWrapper, children: [jsxRuntime.jsx(SolidArrowButton, { "data-button-type": "custom", direction: "down", iconSize: 33, className: classNames(styles$5.scrollToBottom, scrollToBottomCssClassName), onClick: handleButtonClick(() => scrollToBottom()), "aria-label": ariaLabel, title: ariaLabel }), badgeLabel && (jsxRuntime.jsx("span", { className: styles$5.scrollToBottomBadge, "aria-live": "polite", role: "status", children: badgeLabel }))] }) })), isVoiceCalling && (jsxRuntime.jsx("div", { className: styles$5.voiceCallIndicatorBar, children: jsxRuntime.jsxs("div", { className: styles$5.voiceCallIndicator, children: [jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: jsxRuntime.jsx("path", { d: "M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z" }) }), jsxRuntime.jsx("span", { children: "Voice call active" }), jsxRuntime.jsx("div", { className: styles$5.voiceCallPulse })] }) })), jsxRuntime.jsx(ChatActionsBar, { actionsRef: actionsRef, actionsContainer: actionsContainer, messages: postprocessedMessages, participants: participants, title: title, onReset: onReset, resetRequiresConfirmation: resetRequiresConfirmation, newChatButtonHref: newChatButtonHref, onUseTemplate: onUseTemplate, extraActions: extraActions, saveFormats: saveFormats, saveFormatHandlers: saveFormatHandlers, isSaveButtonEnabled: isSaveButtonEnabled, shouldFadeActions: shouldFadeActions, shouldDisableActions: shouldDisableActions, chatUiTranslations: chatUiTranslations, onButtonClick: handleButtonClick }), jsxRuntime.jsx(ChatMessageList, { messages: postprocessedMessages, participants: participants, expandedMessageId: expandedMessageId, messageRatings: messageRatings, setExpandedMessageId: setExpandedMessageId, handleRating: handleRating, mode: mode, isCopyButtonEnabled: isCopyButtonEnabled, isFeedbackEnabled: isFeedbackEnabled, feedbackMode: feedbackMode, feedbackTranslations: feedbackTranslations, timingTranslations: timingTranslations, chatLocale: chatLocale, onCopy: handleCopy, onMessage: onMessage, onActionButton: onActionButton, onQuickMessageButton: onQuickMessageButton, onReplyToMessage: onReplyToMessage, canReplyToMessage: canReplyToMessage, onCreateAgent: onCreateAgent, toolTitles: toolTitles, teammates: teammates, teamAgentProfiles: teamAgentProfiles, visualMode: visualMode, soundSystem: soundSystem, onToolCallClick: openToolCall, onCitationClick: openCitation, setChatMessagesElement: setChatMessagesElement, onScroll: handleChatScroll, isSpeechPlaybackEnabled: isSpeechPlaybackEnabled, elevenLabsVoiceId: elevenLabsVoiceId, chatUiTranslations: chatUiTranslations, chatMessagesClassName: classNames(isConstrainedArticleMode && styles$5.articleModeChatMessages, getChatCssClassName('chatMessages'), chatCssClassNames.chatMessages), hasActions: hasActions }), onMessage && (jsxRuntime.jsx(ChatInputArea, { onMessage: onMessage, onChange: onChange, onFileUpload: onFileUpload, speechRecognition: speechRecognition, speechRecognitionLanguage: speechRecognitionLanguage, replyingToMessage: replyingToMessage, onCancelReply: onCancelReply, defaultMessage: defaultMessage, enterBehavior: enterBehavior, resolveEnterBehavior: resolveEnterBehavior, placeholderMessageContent: placeholderMessageContent || (chatUiTranslations === null || chatUiTranslations === void 0 ? void 0 : chatUiTranslations.inputPlaceholder), isFocusedOnLoad: isFocusedOnLoad, isMobile: isMobile, isVoiceCalling: isVoiceCalling, participants: participants, buttonColor: buttonColor, soundSystem: soundSystem, onButtonClick: handleButtonClick, chatUiTranslations: chatUiTranslations, chatInputClassName: classNames(isConstrainedArticleMode && styles$5.articleModeChatInput, getChatCssClassName('chatInput'), chatCssClassNames.chatInput) }))] }) }), jsxRuntime.jsx(ChatToolCallModal, { isOpen: toolCallModalOpen, toolCall: selectedToolCall, toolCallIdentity: selectedToolCallIdentity, onClose: closeToolCallModal, toolTitles: toolTitles, agentParticipant: agentParticipant, buttonColor: buttonColor, teamAgentProfiles: teamAgentProfiles, chatUiTranslations: chatUiTranslations, locale: chatLocale, availableTools: selectedMessageAvailableTools, mode: mode }), jsxRuntime.jsx(ChatCitationModal, { isOpen: citationModalOpen, citation: selectedCitation, participants: participants, soundSystem: soundSystem, onClose: closeCitationModal }), jsxRuntime.jsx(ChatRatingModal, { isOpen: ratingModalOpen, selectedMessage: selectedMessage, postprocessedMessages: postprocessedMessages, messages: messages, hoveredRating: hoveredRating, messageRatings: messageRatings, textRating: textRating, feedbackMode: feedbackMode, feedbackTranslations: feedbackTranslations, mode: mode, isMobile: isMobile, onClose: () => setRatingModalOpen(false), setHoveredRating: setHoveredRating, setMessageRatings: setMessageRatings, setSelectedMessage: setSelectedMessage, setTextRating: setTextRating, submitRating: submitRating })] }));
40052
40075
  }
40053
40076
 
40054
40077
  /**