@iota-uz/sdk 0.4.33 → 0.4.34

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.
@@ -1807,6 +1807,7 @@ interface ActivityTraceProps {
1807
1807
  declare function ActivityTraceInner({ thinkingContent, activeSteps, toolLabelPrefix, className, }: ActivityTraceProps): react_jsx_runtime.JSX.Element | null;
1808
1808
  declare const ActivityTrace: react.MemoExoticComponent<typeof ActivityTraceInner>;
1809
1809
 
1810
+ type ActiveTab = 'my-chats' | 'all-chats';
1810
1811
  interface SidebarProps {
1811
1812
  dataSource: ChatDataSource;
1812
1813
  onSessionSelect: (sessionId: string) => void;
@@ -1820,8 +1821,12 @@ interface SidebarProps {
1820
1821
  headerSlot?: react__default.ReactNode;
1821
1822
  footerSlot?: react__default.ReactNode;
1822
1823
  className?: string;
1824
+ /** Controlled active tab. When provided, overrides internal state. */
1825
+ activeTab?: ActiveTab;
1826
+ /** Called when tab changes. Use with activeTab for controlled mode. */
1827
+ onTabChange?: (tab: ActiveTab) => void;
1823
1828
  }
1824
- declare function Sidebar({ dataSource, onSessionSelect, onNewChat, onArchivedView, activeSessionId, creating, showAllChatsTab, isOpen: _isOpen, onClose, headerSlot, footerSlot, className, }: SidebarProps): react_jsx_runtime.JSX.Element;
1829
+ declare function Sidebar({ dataSource, onSessionSelect, onNewChat, onArchivedView, activeSessionId, creating, showAllChatsTab, isOpen: _isOpen, onClose, headerSlot, footerSlot, className, activeTab: controlledActiveTab, onTabChange, }: SidebarProps): react_jsx_runtime.JSX.Element;
1825
1830
 
1826
1831
  /**
1827
1832
  * SessionItem Component
@@ -3277,6 +3282,12 @@ interface UseBichatRouterReturn {
3277
3282
  onArchivedView: () => void;
3278
3283
  /** Navigate back (e.g. to home) */
3279
3284
  onBack: () => void;
3285
+ /** Navigate to all-chats view */
3286
+ onAllChatsView: () => void;
3287
+ /** Current sidebar tab derived from URL */
3288
+ sidebarTab: 'my-chats' | 'all-chats';
3289
+ /** Handler to change sidebar tab (navigates to appropriate URL) */
3290
+ onSidebarTabChange: (tab: 'my-chats' | 'all-chats') => void;
3280
3291
  }
3281
3292
  /**
3282
3293
  * Derives BiChat navigation callbacks and activeSessionId from router state.
@@ -4248,4 +4259,4 @@ declare function isPermissionDeniedError(error: unknown): boolean;
4248
4259
  */
4249
4260
  declare function toErrorDisplay(error: unknown, fallbackTitle: string): RPCErrorDisplay;
4250
4261
 
4251
- export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, type ActionButtonIconProps, type ActionButtonLabelProps, type ActionButtonRootProps, type ActionButtonTooltipProps, type ActivityStep, ActivityTrace, type ActivityTraceProps, type AdminStore, _default$1 as Alert, AllChatsList, type AppConfig, _default as ArchiveBanner, ArchivedChatList, type Artifact$1 as Artifact, type ArtifactStore, type AsChildProps, AssistantMessage, type AssistantMessageActionsSlotProps, type AssistantMessageArtifactsSlotProps, type AssistantMessageAvatarSlotProps, type AssistantMessageChartsSlotProps, type AssistantMessageClassNames, type AssistantMessageCodeOutputsSlotProps, type AssistantMessageContentSlotProps, type AssistantMessageExplanationSlotProps, type AssistantMessageProps, type AssistantMessageSlots, type AssistantMessageSourcesSlotProps, type AssistantMessageTablesSlotProps, type AssistantTurn$1 as AssistantTurn, AssistantTurnView, type AssistantTurnViewProps, type Attachment$1 as Attachment, MemoizedAttachmentGrid as AttachmentGrid, AttachmentPreview, AttachmentUpload, Avatar, type AvatarFallbackProps, type AvatarImageProps, type AvatarRootProps, AvatarStack, type AvatarStackProps, type BiChatConfig, BiChatLayout, type BiChatLayoutProps, type BichatRPC, Bubble, type BubbleContentProps, type BubbleFooterProps, type BubbleHeaderProps, type BubbleMetadataProps, type BubbleRootProps, type BubbleVariant, CHART_VISUAL, ChartCard, type ChartCardHost, type ChartData, type ChartSeries, type ChatDataSource, ChatHeader, type ChatInputStateValue, ChatMachine, type ChatMachineConfig, type ChatMessagingStateValue, ChatSession, type ChatSessionContextValue, type ChatSessionProps, ChatSessionProvider, type ChatSessionProviderProps, type ChatSessionStateValue, type Citation$1 as Citation, MemoizedCodeBlock as CodeBlock, type CodeOutput$1 as CodeOutput, CodeOutputsPanel, type ColumnMeta, type ColumnStats, type ColumnType, CompactionDoodle, ConfigProvider, ConfirmModal, type ConfirmModalProps, ConfirmationStep, type ConversationTurn$1 as ConversationTurn, type DataTableOptions, DateGroupHeader, DebugPanel, type DebugPanelProps, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, type EditableTextProps, type EditableTextRef, MemoizedEmptyState as EmptyState, type EmptyStateProps, ErrorBoundary, type FileValidationError, type FileVisual, type FormattedCell, HttpDataSource, type HttpDataSourceConfig, type ImageAttachment, type ImageLoadingStatus, ImageModal, InlineQuestionForm, InteractiveTableCard, type IotaContext, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, type LocaleContext, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, type MessageInputProps, type MessageInputRef, MessageList, MessageRole, type MessageTransport, ModelSelector, type PendingQuestion$1 as PendingQuestion, PermissionGuard, type PermissionGuardProps, type Question, type QuestionAnswerData, type QuestionAnswers, QuestionForm, type QuestionOption, QuestionStep, type QueuedMessage, type RPCErrorDisplay, RateLimiter, type RateLimiterConfig, type RenderTableData, type RenderTableExport, RetryActionArea, ScreenReaderAnnouncer, ScrollToBottomButton, MemoizedSearchInput as SearchInput, type SearchInputProps, type Session$1 as Session, type SessionAccess$1 as SessionAccess, type SessionArtifact, SessionArtifactList, SessionArtifactPreview, SessionArtifactsPanel, type SessionGroup, SessionItem, type SessionListResult$1 as SessionListResult, type SessionMember$1 as SessionMember, SessionMembersModal, type SessionMembersModalProps, SessionSkeleton, type SessionStore, type SessionUser$1 as SessionUser, type ShortcutConfig, Sidebar, type SidebarDrawerProps, type SidebarProps, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, SkeletonText, SkipLink, Slot, type SlotProps, type SortState, SourcesPanel, type StreamChunk, StreamError, type StreamEvent, StreamingCursor, SystemMessage, TabbedChartGroup, type TabbedChartGroupProps, TabbedTableGroup, type TabbedTableGroupProps, type TableCardHost, TableExportButton, TableWithExport, type TenantContext, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeSpacing, Toast, type ToastAction, ToastContainer, type ToastItem, type ToastProps, type ToastType, type ToolCall$1 as ToolCall, TouchContextMenu, Turn, type TurnActionsProps, type TurnAssistantProps, TurnBubble, type TurnBubbleClassNames, type TurnBubbleProps, type TurnRootProps, type TurnTimestampProps, type TurnUserProps, MemoizedTypingIndicator as TypingIndicator, type TypingIndicatorProps, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseAutoScrollOptions, type UseAutoScrollReturn, type UseBichatRouterParams, type UseBichatRouterReturn, type UseDataTableReturn, type UseImageGalleryOptions, type UseImageGalleryReturn, type UseMarkdownCopyOptions, type UseMarkdownCopyReturn, type UseMessageActionsOptions, type UseMessageActionsReturn, type UseSidebarStateReturn, type UseToastReturn, MemoizedUserAvatar as UserAvatar, type UserAvatarProps, type UserContext, MemoizedUserFilter as UserFilter, UserMessage, type UserMessageActionsSlotProps, type UserMessageAttachmentsSlotProps, type UserMessageAvatarSlotProps, type UserMessageClassNames, type UserMessageContentSlotProps, type UserMessageProps, type UserMessageSlots, type UserTurn$1 as UserTurn, UserTurnView, type UserTurnViewProps, WelcomeContent, addCSRFHeader, backdropVariants, buttonVariants, convertToBase64, createDataUrl, createHeadersWithCSRF, createHttpDataSource, darkTheme, dropdownVariants, errorMessageVariants, fadeInUpVariants, fadeInVariants, floatingButtonVariants, formatFileSize, getCSRFToken, getFileVisual, getToolLabel, getValidChildren, groupSessionsByDate, groupSteps, hasPermission, isImageMimeType, isPermissionDeniedError, lightTheme, listItemVariants, messageContainerVariants, messageVariants, parseBichatStream, parseBichatStreamEvents, parseSSEStream, scaleFadeVariants, sessionItemVariants, staggerContainerVariants, toErrorDisplay, typingDotVariants, useActionButtonContext, useAttachments, useAutoScroll, useAvatarContext, useBichatRouter, useBubbleContext, useChatInput, useChatMessaging, useChatSession, useConfig, useDataTable, useFocusTrap, useHttpDataSourceConfigFromApplet, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useSidebarState, useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };
4262
+ export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, type ActionButtonIconProps, type ActionButtonLabelProps, type ActionButtonRootProps, type ActionButtonTooltipProps, type ActiveTab, type ActivityStep, ActivityTrace, type ActivityTraceProps, type AdminStore, _default$1 as Alert, AllChatsList, type AppConfig, _default as ArchiveBanner, ArchivedChatList, type Artifact$1 as Artifact, type ArtifactStore, type AsChildProps, AssistantMessage, type AssistantMessageActionsSlotProps, type AssistantMessageArtifactsSlotProps, type AssistantMessageAvatarSlotProps, type AssistantMessageChartsSlotProps, type AssistantMessageClassNames, type AssistantMessageCodeOutputsSlotProps, type AssistantMessageContentSlotProps, type AssistantMessageExplanationSlotProps, type AssistantMessageProps, type AssistantMessageSlots, type AssistantMessageSourcesSlotProps, type AssistantMessageTablesSlotProps, type AssistantTurn$1 as AssistantTurn, AssistantTurnView, type AssistantTurnViewProps, type Attachment$1 as Attachment, MemoizedAttachmentGrid as AttachmentGrid, AttachmentPreview, AttachmentUpload, Avatar, type AvatarFallbackProps, type AvatarImageProps, type AvatarRootProps, AvatarStack, type AvatarStackProps, type BiChatConfig, BiChatLayout, type BiChatLayoutProps, type BichatRPC, Bubble, type BubbleContentProps, type BubbleFooterProps, type BubbleHeaderProps, type BubbleMetadataProps, type BubbleRootProps, type BubbleVariant, CHART_VISUAL, ChartCard, type ChartCardHost, type ChartData, type ChartSeries, type ChatDataSource, ChatHeader, type ChatInputStateValue, ChatMachine, type ChatMachineConfig, type ChatMessagingStateValue, ChatSession, type ChatSessionContextValue, type ChatSessionProps, ChatSessionProvider, type ChatSessionProviderProps, type ChatSessionStateValue, type Citation$1 as Citation, MemoizedCodeBlock as CodeBlock, type CodeOutput$1 as CodeOutput, CodeOutputsPanel, type ColumnMeta, type ColumnStats, type ColumnType, CompactionDoodle, ConfigProvider, ConfirmModal, type ConfirmModalProps, ConfirmationStep, type ConversationTurn$1 as ConversationTurn, type DataTableOptions, DateGroupHeader, DebugPanel, type DebugPanelProps, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, type EditableTextProps, type EditableTextRef, MemoizedEmptyState as EmptyState, type EmptyStateProps, ErrorBoundary, type FileValidationError, type FileVisual, type FormattedCell, HttpDataSource, type HttpDataSourceConfig, type ImageAttachment, type ImageLoadingStatus, ImageModal, InlineQuestionForm, InteractiveTableCard, type IotaContext, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, type LocaleContext, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, type MessageInputProps, type MessageInputRef, MessageList, MessageRole, type MessageTransport, ModelSelector, type PendingQuestion$1 as PendingQuestion, PermissionGuard, type PermissionGuardProps, type Question, type QuestionAnswerData, type QuestionAnswers, QuestionForm, type QuestionOption, QuestionStep, type QueuedMessage, type RPCErrorDisplay, RateLimiter, type RateLimiterConfig, type RenderTableData, type RenderTableExport, RetryActionArea, ScreenReaderAnnouncer, ScrollToBottomButton, MemoizedSearchInput as SearchInput, type SearchInputProps, type Session$1 as Session, type SessionAccess$1 as SessionAccess, type SessionArtifact, SessionArtifactList, SessionArtifactPreview, SessionArtifactsPanel, type SessionGroup, SessionItem, type SessionListResult$1 as SessionListResult, type SessionMember$1 as SessionMember, SessionMembersModal, type SessionMembersModalProps, SessionSkeleton, type SessionStore, type SessionUser$1 as SessionUser, type ShortcutConfig, Sidebar, type SidebarDrawerProps, type SidebarProps, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, SkeletonText, SkipLink, Slot, type SlotProps, type SortState, SourcesPanel, type StreamChunk, StreamError, type StreamEvent, StreamingCursor, SystemMessage, TabbedChartGroup, type TabbedChartGroupProps, TabbedTableGroup, type TabbedTableGroupProps, type TableCardHost, TableExportButton, TableWithExport, type TenantContext, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeSpacing, Toast, type ToastAction, ToastContainer, type ToastItem, type ToastProps, type ToastType, type ToolCall$1 as ToolCall, TouchContextMenu, Turn, type TurnActionsProps, type TurnAssistantProps, TurnBubble, type TurnBubbleClassNames, type TurnBubbleProps, type TurnRootProps, type TurnTimestampProps, type TurnUserProps, MemoizedTypingIndicator as TypingIndicator, type TypingIndicatorProps, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseAutoScrollOptions, type UseAutoScrollReturn, type UseBichatRouterParams, type UseBichatRouterReturn, type UseDataTableReturn, type UseImageGalleryOptions, type UseImageGalleryReturn, type UseMarkdownCopyOptions, type UseMarkdownCopyReturn, type UseMessageActionsOptions, type UseMessageActionsReturn, type UseSidebarStateReturn, type UseToastReturn, MemoizedUserAvatar as UserAvatar, type UserAvatarProps, type UserContext, MemoizedUserFilter as UserFilter, UserMessage, type UserMessageActionsSlotProps, type UserMessageAttachmentsSlotProps, type UserMessageAvatarSlotProps, type UserMessageClassNames, type UserMessageContentSlotProps, type UserMessageProps, type UserMessageSlots, type UserTurn$1 as UserTurn, UserTurnView, type UserTurnViewProps, WelcomeContent, addCSRFHeader, backdropVariants, buttonVariants, convertToBase64, createDataUrl, createHeadersWithCSRF, createHttpDataSource, darkTheme, dropdownVariants, errorMessageVariants, fadeInUpVariants, fadeInVariants, floatingButtonVariants, formatFileSize, getCSRFToken, getFileVisual, getToolLabel, getValidChildren, groupSessionsByDate, groupSteps, hasPermission, isImageMimeType, isPermissionDeniedError, lightTheme, listItemVariants, messageContainerVariants, messageVariants, parseBichatStream, parseBichatStreamEvents, parseSSEStream, scaleFadeVariants, sessionItemVariants, staggerContainerVariants, toErrorDisplay, typingDotVariants, useActionButtonContext, useAttachments, useAutoScroll, useAvatarContext, useBichatRouter, useBubbleContext, useChatInput, useChatMessaging, useChatSession, useConfig, useDataTable, useFocusTrap, useHttpDataSourceConfigFromApplet, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useSidebarState, useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };
@@ -1807,6 +1807,7 @@ interface ActivityTraceProps {
1807
1807
  declare function ActivityTraceInner({ thinkingContent, activeSteps, toolLabelPrefix, className, }: ActivityTraceProps): react_jsx_runtime.JSX.Element | null;
1808
1808
  declare const ActivityTrace: react.MemoExoticComponent<typeof ActivityTraceInner>;
1809
1809
 
1810
+ type ActiveTab = 'my-chats' | 'all-chats';
1810
1811
  interface SidebarProps {
1811
1812
  dataSource: ChatDataSource;
1812
1813
  onSessionSelect: (sessionId: string) => void;
@@ -1820,8 +1821,12 @@ interface SidebarProps {
1820
1821
  headerSlot?: react__default.ReactNode;
1821
1822
  footerSlot?: react__default.ReactNode;
1822
1823
  className?: string;
1824
+ /** Controlled active tab. When provided, overrides internal state. */
1825
+ activeTab?: ActiveTab;
1826
+ /** Called when tab changes. Use with activeTab for controlled mode. */
1827
+ onTabChange?: (tab: ActiveTab) => void;
1823
1828
  }
1824
- declare function Sidebar({ dataSource, onSessionSelect, onNewChat, onArchivedView, activeSessionId, creating, showAllChatsTab, isOpen: _isOpen, onClose, headerSlot, footerSlot, className, }: SidebarProps): react_jsx_runtime.JSX.Element;
1829
+ declare function Sidebar({ dataSource, onSessionSelect, onNewChat, onArchivedView, activeSessionId, creating, showAllChatsTab, isOpen: _isOpen, onClose, headerSlot, footerSlot, className, activeTab: controlledActiveTab, onTabChange, }: SidebarProps): react_jsx_runtime.JSX.Element;
1825
1830
 
1826
1831
  /**
1827
1832
  * SessionItem Component
@@ -3277,6 +3282,12 @@ interface UseBichatRouterReturn {
3277
3282
  onArchivedView: () => void;
3278
3283
  /** Navigate back (e.g. to home) */
3279
3284
  onBack: () => void;
3285
+ /** Navigate to all-chats view */
3286
+ onAllChatsView: () => void;
3287
+ /** Current sidebar tab derived from URL */
3288
+ sidebarTab: 'my-chats' | 'all-chats';
3289
+ /** Handler to change sidebar tab (navigates to appropriate URL) */
3290
+ onSidebarTabChange: (tab: 'my-chats' | 'all-chats') => void;
3280
3291
  }
3281
3292
  /**
3282
3293
  * Derives BiChat navigation callbacks and activeSessionId from router state.
@@ -4248,4 +4259,4 @@ declare function isPermissionDeniedError(error: unknown): boolean;
4248
4259
  */
4249
4260
  declare function toErrorDisplay(error: unknown, fallbackTitle: string): RPCErrorDisplay;
4250
4261
 
4251
- export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, type ActionButtonIconProps, type ActionButtonLabelProps, type ActionButtonRootProps, type ActionButtonTooltipProps, type ActivityStep, ActivityTrace, type ActivityTraceProps, type AdminStore, _default$1 as Alert, AllChatsList, type AppConfig, _default as ArchiveBanner, ArchivedChatList, type Artifact$1 as Artifact, type ArtifactStore, type AsChildProps, AssistantMessage, type AssistantMessageActionsSlotProps, type AssistantMessageArtifactsSlotProps, type AssistantMessageAvatarSlotProps, type AssistantMessageChartsSlotProps, type AssistantMessageClassNames, type AssistantMessageCodeOutputsSlotProps, type AssistantMessageContentSlotProps, type AssistantMessageExplanationSlotProps, type AssistantMessageProps, type AssistantMessageSlots, type AssistantMessageSourcesSlotProps, type AssistantMessageTablesSlotProps, type AssistantTurn$1 as AssistantTurn, AssistantTurnView, type AssistantTurnViewProps, type Attachment$1 as Attachment, MemoizedAttachmentGrid as AttachmentGrid, AttachmentPreview, AttachmentUpload, Avatar, type AvatarFallbackProps, type AvatarImageProps, type AvatarRootProps, AvatarStack, type AvatarStackProps, type BiChatConfig, BiChatLayout, type BiChatLayoutProps, type BichatRPC, Bubble, type BubbleContentProps, type BubbleFooterProps, type BubbleHeaderProps, type BubbleMetadataProps, type BubbleRootProps, type BubbleVariant, CHART_VISUAL, ChartCard, type ChartCardHost, type ChartData, type ChartSeries, type ChatDataSource, ChatHeader, type ChatInputStateValue, ChatMachine, type ChatMachineConfig, type ChatMessagingStateValue, ChatSession, type ChatSessionContextValue, type ChatSessionProps, ChatSessionProvider, type ChatSessionProviderProps, type ChatSessionStateValue, type Citation$1 as Citation, MemoizedCodeBlock as CodeBlock, type CodeOutput$1 as CodeOutput, CodeOutputsPanel, type ColumnMeta, type ColumnStats, type ColumnType, CompactionDoodle, ConfigProvider, ConfirmModal, type ConfirmModalProps, ConfirmationStep, type ConversationTurn$1 as ConversationTurn, type DataTableOptions, DateGroupHeader, DebugPanel, type DebugPanelProps, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, type EditableTextProps, type EditableTextRef, MemoizedEmptyState as EmptyState, type EmptyStateProps, ErrorBoundary, type FileValidationError, type FileVisual, type FormattedCell, HttpDataSource, type HttpDataSourceConfig, type ImageAttachment, type ImageLoadingStatus, ImageModal, InlineQuestionForm, InteractiveTableCard, type IotaContext, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, type LocaleContext, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, type MessageInputProps, type MessageInputRef, MessageList, MessageRole, type MessageTransport, ModelSelector, type PendingQuestion$1 as PendingQuestion, PermissionGuard, type PermissionGuardProps, type Question, type QuestionAnswerData, type QuestionAnswers, QuestionForm, type QuestionOption, QuestionStep, type QueuedMessage, type RPCErrorDisplay, RateLimiter, type RateLimiterConfig, type RenderTableData, type RenderTableExport, RetryActionArea, ScreenReaderAnnouncer, ScrollToBottomButton, MemoizedSearchInput as SearchInput, type SearchInputProps, type Session$1 as Session, type SessionAccess$1 as SessionAccess, type SessionArtifact, SessionArtifactList, SessionArtifactPreview, SessionArtifactsPanel, type SessionGroup, SessionItem, type SessionListResult$1 as SessionListResult, type SessionMember$1 as SessionMember, SessionMembersModal, type SessionMembersModalProps, SessionSkeleton, type SessionStore, type SessionUser$1 as SessionUser, type ShortcutConfig, Sidebar, type SidebarDrawerProps, type SidebarProps, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, SkeletonText, SkipLink, Slot, type SlotProps, type SortState, SourcesPanel, type StreamChunk, StreamError, type StreamEvent, StreamingCursor, SystemMessage, TabbedChartGroup, type TabbedChartGroupProps, TabbedTableGroup, type TabbedTableGroupProps, type TableCardHost, TableExportButton, TableWithExport, type TenantContext, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeSpacing, Toast, type ToastAction, ToastContainer, type ToastItem, type ToastProps, type ToastType, type ToolCall$1 as ToolCall, TouchContextMenu, Turn, type TurnActionsProps, type TurnAssistantProps, TurnBubble, type TurnBubbleClassNames, type TurnBubbleProps, type TurnRootProps, type TurnTimestampProps, type TurnUserProps, MemoizedTypingIndicator as TypingIndicator, type TypingIndicatorProps, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseAutoScrollOptions, type UseAutoScrollReturn, type UseBichatRouterParams, type UseBichatRouterReturn, type UseDataTableReturn, type UseImageGalleryOptions, type UseImageGalleryReturn, type UseMarkdownCopyOptions, type UseMarkdownCopyReturn, type UseMessageActionsOptions, type UseMessageActionsReturn, type UseSidebarStateReturn, type UseToastReturn, MemoizedUserAvatar as UserAvatar, type UserAvatarProps, type UserContext, MemoizedUserFilter as UserFilter, UserMessage, type UserMessageActionsSlotProps, type UserMessageAttachmentsSlotProps, type UserMessageAvatarSlotProps, type UserMessageClassNames, type UserMessageContentSlotProps, type UserMessageProps, type UserMessageSlots, type UserTurn$1 as UserTurn, UserTurnView, type UserTurnViewProps, WelcomeContent, addCSRFHeader, backdropVariants, buttonVariants, convertToBase64, createDataUrl, createHeadersWithCSRF, createHttpDataSource, darkTheme, dropdownVariants, errorMessageVariants, fadeInUpVariants, fadeInVariants, floatingButtonVariants, formatFileSize, getCSRFToken, getFileVisual, getToolLabel, getValidChildren, groupSessionsByDate, groupSteps, hasPermission, isImageMimeType, isPermissionDeniedError, lightTheme, listItemVariants, messageContainerVariants, messageVariants, parseBichatStream, parseBichatStreamEvents, parseSSEStream, scaleFadeVariants, sessionItemVariants, staggerContainerVariants, toErrorDisplay, typingDotVariants, useActionButtonContext, useAttachments, useAutoScroll, useAvatarContext, useBichatRouter, useBubbleContext, useChatInput, useChatMessaging, useChatSession, useConfig, useDataTable, useFocusTrap, useHttpDataSourceConfigFromApplet, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useSidebarState, useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };
4262
+ export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, type ActionButtonIconProps, type ActionButtonLabelProps, type ActionButtonRootProps, type ActionButtonTooltipProps, type ActiveTab, type ActivityStep, ActivityTrace, type ActivityTraceProps, type AdminStore, _default$1 as Alert, AllChatsList, type AppConfig, _default as ArchiveBanner, ArchivedChatList, type Artifact$1 as Artifact, type ArtifactStore, type AsChildProps, AssistantMessage, type AssistantMessageActionsSlotProps, type AssistantMessageArtifactsSlotProps, type AssistantMessageAvatarSlotProps, type AssistantMessageChartsSlotProps, type AssistantMessageClassNames, type AssistantMessageCodeOutputsSlotProps, type AssistantMessageContentSlotProps, type AssistantMessageExplanationSlotProps, type AssistantMessageProps, type AssistantMessageSlots, type AssistantMessageSourcesSlotProps, type AssistantMessageTablesSlotProps, type AssistantTurn$1 as AssistantTurn, AssistantTurnView, type AssistantTurnViewProps, type Attachment$1 as Attachment, MemoizedAttachmentGrid as AttachmentGrid, AttachmentPreview, AttachmentUpload, Avatar, type AvatarFallbackProps, type AvatarImageProps, type AvatarRootProps, AvatarStack, type AvatarStackProps, type BiChatConfig, BiChatLayout, type BiChatLayoutProps, type BichatRPC, Bubble, type BubbleContentProps, type BubbleFooterProps, type BubbleHeaderProps, type BubbleMetadataProps, type BubbleRootProps, type BubbleVariant, CHART_VISUAL, ChartCard, type ChartCardHost, type ChartData, type ChartSeries, type ChatDataSource, ChatHeader, type ChatInputStateValue, ChatMachine, type ChatMachineConfig, type ChatMessagingStateValue, ChatSession, type ChatSessionContextValue, type ChatSessionProps, ChatSessionProvider, type ChatSessionProviderProps, type ChatSessionStateValue, type Citation$1 as Citation, MemoizedCodeBlock as CodeBlock, type CodeOutput$1 as CodeOutput, CodeOutputsPanel, type ColumnMeta, type ColumnStats, type ColumnType, CompactionDoodle, ConfigProvider, ConfirmModal, type ConfirmModalProps, ConfirmationStep, type ConversationTurn$1 as ConversationTurn, type DataTableOptions, DateGroupHeader, DebugPanel, type DebugPanelProps, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, type EditableTextProps, type EditableTextRef, MemoizedEmptyState as EmptyState, type EmptyStateProps, ErrorBoundary, type FileValidationError, type FileVisual, type FormattedCell, HttpDataSource, type HttpDataSourceConfig, type ImageAttachment, type ImageLoadingStatus, ImageModal, InlineQuestionForm, InteractiveTableCard, type IotaContext, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, type LocaleContext, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, type MessageInputProps, type MessageInputRef, MessageList, MessageRole, type MessageTransport, ModelSelector, type PendingQuestion$1 as PendingQuestion, PermissionGuard, type PermissionGuardProps, type Question, type QuestionAnswerData, type QuestionAnswers, QuestionForm, type QuestionOption, QuestionStep, type QueuedMessage, type RPCErrorDisplay, RateLimiter, type RateLimiterConfig, type RenderTableData, type RenderTableExport, RetryActionArea, ScreenReaderAnnouncer, ScrollToBottomButton, MemoizedSearchInput as SearchInput, type SearchInputProps, type Session$1 as Session, type SessionAccess$1 as SessionAccess, type SessionArtifact, SessionArtifactList, SessionArtifactPreview, SessionArtifactsPanel, type SessionGroup, SessionItem, type SessionListResult$1 as SessionListResult, type SessionMember$1 as SessionMember, SessionMembersModal, type SessionMembersModalProps, SessionSkeleton, type SessionStore, type SessionUser$1 as SessionUser, type ShortcutConfig, Sidebar, type SidebarDrawerProps, type SidebarProps, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, SkeletonText, SkipLink, Slot, type SlotProps, type SortState, SourcesPanel, type StreamChunk, StreamError, type StreamEvent, StreamingCursor, SystemMessage, TabbedChartGroup, type TabbedChartGroupProps, TabbedTableGroup, type TabbedTableGroupProps, type TableCardHost, TableExportButton, TableWithExport, type TenantContext, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeSpacing, Toast, type ToastAction, ToastContainer, type ToastItem, type ToastProps, type ToastType, type ToolCall$1 as ToolCall, TouchContextMenu, Turn, type TurnActionsProps, type TurnAssistantProps, TurnBubble, type TurnBubbleClassNames, type TurnBubbleProps, type TurnRootProps, type TurnTimestampProps, type TurnUserProps, MemoizedTypingIndicator as TypingIndicator, type TypingIndicatorProps, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseAutoScrollOptions, type UseAutoScrollReturn, type UseBichatRouterParams, type UseBichatRouterReturn, type UseDataTableReturn, type UseImageGalleryOptions, type UseImageGalleryReturn, type UseMarkdownCopyOptions, type UseMarkdownCopyReturn, type UseMessageActionsOptions, type UseMessageActionsReturn, type UseSidebarStateReturn, type UseToastReturn, MemoizedUserAvatar as UserAvatar, type UserAvatarProps, type UserContext, MemoizedUserFilter as UserFilter, UserMessage, type UserMessageActionsSlotProps, type UserMessageAttachmentsSlotProps, type UserMessageAvatarSlotProps, type UserMessageClassNames, type UserMessageContentSlotProps, type UserMessageProps, type UserMessageSlots, type UserTurn$1 as UserTurn, UserTurnView, type UserTurnViewProps, WelcomeContent, addCSRFHeader, backdropVariants, buttonVariants, convertToBase64, createDataUrl, createHeadersWithCSRF, createHttpDataSource, darkTheme, dropdownVariants, errorMessageVariants, fadeInUpVariants, fadeInVariants, floatingButtonVariants, formatFileSize, getCSRFToken, getFileVisual, getToolLabel, getValidChildren, groupSessionsByDate, groupSteps, hasPermission, isImageMimeType, isPermissionDeniedError, lightTheme, listItemVariants, messageContainerVariants, messageVariants, parseBichatStream, parseBichatStreamEvents, parseSSEStream, scaleFadeVariants, sessionItemVariants, staggerContainerVariants, toErrorDisplay, typingDotVariants, useActionButtonContext, useAttachments, useAutoScroll, useAvatarContext, useBichatRouter, useBubbleContext, useChatInput, useChatMessaging, useChatSession, useConfig, useDataTable, useFocusTrap, useHttpDataSourceConfigFromApplet, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useSidebarState, useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };
@@ -3647,16 +3647,26 @@ function hashString(str) {
3647
3647
  return Math.abs(hash);
3648
3648
  }
3649
3649
  var colorPalette = [
3650
- { bg: "bg-blue-500", text: "text-white" },
3651
- { bg: "bg-green-500", text: "text-white" },
3652
- { bg: "bg-purple-500", text: "text-white" },
3653
- { bg: "bg-pink-500", text: "text-white" },
3654
- { bg: "bg-indigo-500", text: "text-white" },
3655
- { bg: "bg-teal-500", text: "text-white" },
3656
- { bg: "bg-orange-500", text: "text-white" },
3657
- { bg: "bg-cyan-500", text: "text-white" },
3658
- { bg: "bg-amber-500", text: "text-white" },
3659
- { bg: "bg-lime-500", text: "text-white" }
3650
+ { bg: "#3b82f6", text: "#ffffff" },
3651
+ // blue-500
3652
+ { bg: "#22c55e", text: "#111827" },
3653
+ // green-500 (light bg)
3654
+ { bg: "#a855f7", text: "#ffffff" },
3655
+ // purple-500
3656
+ { bg: "#ec4899", text: "#ffffff" },
3657
+ // pink-500
3658
+ { bg: "#6366f1", text: "#ffffff" },
3659
+ // indigo-500
3660
+ { bg: "#14b8a6", text: "#111827" },
3661
+ // teal-500 (light bg)
3662
+ { bg: "#f97316", text: "#ffffff" },
3663
+ // orange-500
3664
+ { bg: "#06b6d4", text: "#111827" },
3665
+ // cyan-500 (light bg)
3666
+ { bg: "#f59e0b", text: "#111827" },
3667
+ // amber-500 (light bg)
3668
+ { bg: "#84cc16", text: "#111827" }
3669
+ // lime-500 (light bg)
3660
3670
  ];
3661
3671
  var sizeClasses = {
3662
3672
  xs: "w-6 h-6 text-[10px]",
@@ -3686,8 +3696,6 @@ function UserAvatar({
3686
3696
  {
3687
3697
  className: `
3688
3698
  ${sizeClasses[size]}
3689
- ${colors.bg}
3690
- ${colors.text}
3691
3699
  ${className}
3692
3700
  rounded-full
3693
3701
  flex
@@ -3697,6 +3705,7 @@ function UserAvatar({
3697
3705
  flex-shrink-0
3698
3706
  select-none
3699
3707
  `,
3708
+ style: { backgroundColor: colors.bg, color: colors.text },
3700
3709
  "aria-label": `${firstName} ${lastName}`,
3701
3710
  title: `${firstName} ${lastName}`,
3702
3711
  children: initials
@@ -14373,6 +14382,62 @@ function AllChatsList({ dataSource, onSessionSelect, activeSessionId }) {
14373
14382
  });
14374
14383
  return Array.from(userMap.values());
14375
14384
  }, [chats, users, dataSource.listUsers]);
14385
+ const [expandedGroups, setExpandedGroups] = useState(/* @__PURE__ */ new Set());
14386
+ const toggleGroup = useCallback((ownerId) => {
14387
+ setExpandedGroups((prev) => {
14388
+ const next = new Set(prev);
14389
+ if (next.has(ownerId)) {
14390
+ next.delete(ownerId);
14391
+ } else {
14392
+ next.add(ownerId);
14393
+ }
14394
+ return next;
14395
+ });
14396
+ }, []);
14397
+ useEffect(() => {
14398
+ if (!activeSessionId || selectedUser) {
14399
+ return;
14400
+ }
14401
+ const chat = chats.find((c) => c.id === activeSessionId);
14402
+ if (chat?.owner?.id) {
14403
+ setExpandedGroups((prev) => {
14404
+ if (prev.has(chat.owner.id)) {
14405
+ return prev;
14406
+ }
14407
+ return /* @__PURE__ */ new Set([...prev, chat.owner.id]);
14408
+ });
14409
+ }
14410
+ }, [activeSessionId, chats, selectedUser]);
14411
+ const groupedChats = useMemo(() => {
14412
+ if (selectedUser) {
14413
+ return null;
14414
+ }
14415
+ const groupMap = /* @__PURE__ */ new Map();
14416
+ chats.forEach((chat) => {
14417
+ const owner = chat.owner ?? {
14418
+ id: "__unknown__",
14419
+ firstName: t("BiChat.Common.Untitled"),
14420
+ lastName: "",
14421
+ initials: "?"
14422
+ };
14423
+ const ownerId = owner.id;
14424
+ if (!groupMap.has(ownerId)) {
14425
+ groupMap.set(ownerId, {
14426
+ owner,
14427
+ chats: [],
14428
+ latestUpdatedAt: chat.updatedAt
14429
+ });
14430
+ }
14431
+ const group = groupMap.get(ownerId);
14432
+ group.chats.push(chat);
14433
+ if (chat.updatedAt > group.latestUpdatedAt) {
14434
+ group.latestUpdatedAt = chat.updatedAt;
14435
+ }
14436
+ });
14437
+ return Array.from(groupMap.values()).sort(
14438
+ (a, b) => b.latestUpdatedAt.localeCompare(a.latestUpdatedAt)
14439
+ );
14440
+ }, [chats, selectedUser, t]);
14376
14441
  return /* @__PURE__ */ jsxs(
14377
14442
  "div",
14378
14443
  {
@@ -14418,61 +14483,159 @@ function AllChatsList({ dataSource, onSessionSelect, activeSessionId }) {
14418
14483
  role: "list",
14419
14484
  "aria-label": t("BiChat.AllChats.OrganizationChatSessions"),
14420
14485
  children: [
14421
- chats.map((chat) => {
14422
- const owner = chat.owner ?? {
14423
- firstName: "",
14424
- lastName: "",
14425
- initials: "U"
14426
- };
14427
- const ownerName = [owner.firstName, owner.lastName].filter(Boolean).join(" ");
14428
- return /* @__PURE__ */ jsx(
14429
- motion.div,
14430
- {
14431
- initial: { opacity: 0, y: -10 },
14432
- animate: { opacity: 1, y: 0 },
14433
- exit: { opacity: 0, y: -10 },
14434
- children: /* @__PURE__ */ jsx(
14486
+ groupedChats ? (
14487
+ /* ── Grouped view (no user selected) ── */
14488
+ groupedChats.map((group) => {
14489
+ const ownerId = group.owner.id;
14490
+ const ownerName = [group.owner.firstName, group.owner.lastName].filter(Boolean).join(" ");
14491
+ const isCollapsed = !expandedGroups.has(ownerId);
14492
+ return /* @__PURE__ */ jsxs("div", { className: "mb-1", children: [
14493
+ /* @__PURE__ */ jsxs(
14435
14494
  "div",
14436
14495
  {
14437
- role: "link",
14496
+ role: "button",
14438
14497
  tabIndex: 0,
14439
- onClick: () => onSessionSelect(chat.id),
14498
+ onClick: () => toggleGroup(ownerId),
14440
14499
  onKeyDown: (e) => {
14441
14500
  if (e.key === "Enter" || e.key === " ") {
14442
14501
  e.preventDefault();
14443
- onSessionSelect(chat.id);
14502
+ toggleGroup(ownerId);
14444
14503
  }
14445
14504
  },
14446
- className: `
14447
- block px-3 py-2 rounded-lg transition-smooth group cursor-pointer
14448
- ${chat.id === activeSessionId ? "bg-primary-50/50 dark:bg-primary-900/30 text-primary-700 dark:text-primary-400 border-l-4 border-primary-400 dark:border-primary-600" : "text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 border-l-4 border-transparent"}
14449
- `,
14450
- "aria-current": chat.id === activeSessionId ? "page" : void 0,
14451
- children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2", children: [
14505
+ className: "flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-lg transition-smooth select-none",
14506
+ "aria-expanded": !isCollapsed,
14507
+ children: [
14508
+ /* @__PURE__ */ jsx(
14509
+ CaretRight,
14510
+ {
14511
+ size: 14,
14512
+ weight: "bold",
14513
+ className: `shrink-0 text-gray-500 dark:text-gray-400 transition-transform duration-150 ${isCollapsed ? "" : "rotate-90"}`
14514
+ }
14515
+ ),
14452
14516
  /* @__PURE__ */ jsx(
14453
14517
  MemoizedUserAvatar,
14454
14518
  {
14455
- firstName: owner.firstName,
14456
- lastName: owner.lastName,
14457
- initials: owner.initials,
14519
+ firstName: group.owner.firstName,
14520
+ lastName: group.owner.lastName,
14521
+ initials: group.owner.initials,
14458
14522
  size: "sm"
14459
14523
  }
14460
14524
  ),
14461
- /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
14462
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium truncate", children: chat.title || t("BiChat.Common.Untitled") }),
14463
- ownerName && /* @__PURE__ */ jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400 truncate", children: ownerName }),
14464
- chat.status === "archived" && /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 mt-1 px-2 py-0.5 bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 rounded-full text-xs", children: [
14465
- /* @__PURE__ */ jsx(Archive, { size: 12, className: "w-3 h-3" }),
14466
- t("BiChat.Chat.Archived")
14525
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 truncate flex-1 min-w-0", children: ownerName || t("BiChat.Common.Untitled") }),
14526
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400 bg-gray-100 dark:bg-gray-800 px-2 py-0.5 rounded-full flex-shrink-0", children: group.chats.length })
14527
+ ]
14528
+ }
14529
+ ),
14530
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: !isCollapsed && /* @__PURE__ */ jsx(
14531
+ motion.div,
14532
+ {
14533
+ initial: { height: 0, opacity: 0 },
14534
+ animate: { height: "auto", opacity: 1 },
14535
+ exit: { height: 0, opacity: 0 },
14536
+ transition: { duration: 0.2, ease: [0.4, 0, 0.2, 1] },
14537
+ className: "overflow-hidden",
14538
+ children: /* @__PURE__ */ jsx("div", { className: "space-y-0.5 pl-6", children: group.chats.map((chat) => /* @__PURE__ */ jsx(
14539
+ motion.div,
14540
+ {
14541
+ initial: { opacity: 0, y: -10 },
14542
+ animate: { opacity: 1, y: 0 },
14543
+ exit: { opacity: 0, y: -10 },
14544
+ children: /* @__PURE__ */ jsx(
14545
+ "div",
14546
+ {
14547
+ role: "link",
14548
+ tabIndex: 0,
14549
+ onClick: () => onSessionSelect(chat.id),
14550
+ onKeyDown: (e) => {
14551
+ if (e.key === "Enter" || e.key === " ") {
14552
+ e.preventDefault();
14553
+ onSessionSelect(chat.id);
14554
+ }
14555
+ },
14556
+ className: `
14557
+ block px-3 py-2 rounded-lg transition-smooth group cursor-pointer
14558
+ ${chat.id === activeSessionId ? "bg-primary-50/50 dark:bg-primary-900/30 text-primary-700 dark:text-primary-400 border-l-4 border-primary-400 dark:border-primary-600" : "text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 border-l-4 border-transparent"}
14559
+ `,
14560
+ "aria-current": chat.id === activeSessionId ? "page" : void 0,
14561
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
14562
+ /* @__PURE__ */ jsx("p", { className: "text-sm truncate flex-1 min-w-0", children: chat.title || t("BiChat.Common.Untitled") }),
14563
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 flex-shrink-0", children: [
14564
+ chat.isGroup && chat.memberCount && chat.memberCount > 1 && /* @__PURE__ */ jsx("span", { className: "text-xs text-gray-400 dark:text-gray-500", children: chat.memberCount }),
14565
+ chat.status === "archived" && /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 rounded-full text-xs", children: [
14566
+ /* @__PURE__ */ jsx(Archive, { size: 12, className: "w-3 h-3" }),
14567
+ t("BiChat.Chat.Archived")
14568
+ ] })
14569
+ ] })
14570
+ ] })
14571
+ }
14572
+ )
14573
+ },
14574
+ chat.id
14575
+ )) })
14576
+ },
14577
+ `group-${ownerId}`
14578
+ ) })
14579
+ ] }, ownerId);
14580
+ })
14581
+ ) : (
14582
+ /* ── Flat view (user selected) ── */
14583
+ chats.map((chat) => {
14584
+ const owner = chat.owner ?? {
14585
+ firstName: "",
14586
+ lastName: "",
14587
+ initials: "U"
14588
+ };
14589
+ const ownerName = [owner.firstName, owner.lastName].filter(Boolean).join(" ");
14590
+ return /* @__PURE__ */ jsx(
14591
+ motion.div,
14592
+ {
14593
+ initial: { opacity: 0, y: -10 },
14594
+ animate: { opacity: 1, y: 0 },
14595
+ exit: { opacity: 0, y: -10 },
14596
+ children: /* @__PURE__ */ jsx(
14597
+ "div",
14598
+ {
14599
+ role: "link",
14600
+ tabIndex: 0,
14601
+ onClick: () => onSessionSelect(chat.id),
14602
+ onKeyDown: (e) => {
14603
+ if (e.key === "Enter" || e.key === " ") {
14604
+ e.preventDefault();
14605
+ onSessionSelect(chat.id);
14606
+ }
14607
+ },
14608
+ className: `
14609
+ block px-3 py-2 rounded-lg transition-smooth group cursor-pointer
14610
+ ${chat.id === activeSessionId ? "bg-primary-50/50 dark:bg-primary-900/30 text-primary-700 dark:text-primary-400 border-l-4 border-primary-400 dark:border-primary-600" : "text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 border-l-4 border-transparent"}
14611
+ `,
14612
+ "aria-current": chat.id === activeSessionId ? "page" : void 0,
14613
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2", children: [
14614
+ /* @__PURE__ */ jsx(
14615
+ MemoizedUserAvatar,
14616
+ {
14617
+ firstName: owner.firstName,
14618
+ lastName: owner.lastName,
14619
+ initials: owner.initials,
14620
+ size: "sm"
14621
+ }
14622
+ ),
14623
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
14624
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium truncate", children: chat.title || t("BiChat.Common.Untitled") }),
14625
+ ownerName && /* @__PURE__ */ jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400 truncate", children: ownerName }),
14626
+ chat.status === "archived" && /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 mt-1 px-2 py-0.5 bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 rounded-full text-xs", children: [
14627
+ /* @__PURE__ */ jsx(Archive, { size: 12, className: "w-3 h-3" }),
14628
+ t("BiChat.Chat.Archived")
14629
+ ] })
14467
14630
  ] })
14468
14631
  ] })
14469
- ] })
14470
- }
14471
- )
14472
- },
14473
- chat.id
14474
- );
14475
- }),
14632
+ }
14633
+ )
14634
+ },
14635
+ chat.id
14636
+ );
14637
+ })
14638
+ ),
14476
14639
  hasMore && /* @__PURE__ */ jsx("div", { ref: loadMoreRef, className: "py-4 text-center", children: fetching ? /* @__PURE__ */ jsx(SessionSkeleton, { count: 2 }) : /* @__PURE__ */ jsx(
14477
14640
  "button",
14478
14641
  {
@@ -14695,7 +14858,9 @@ function Sidebar2({
14695
14858
  onClose,
14696
14859
  headerSlot,
14697
14860
  footerSlot,
14698
- className = ""
14861
+ className = "",
14862
+ activeTab: controlledActiveTab,
14863
+ onTabChange
14699
14864
  }) {
14700
14865
  const { t } = useTranslation();
14701
14866
  const toast = useToast();
@@ -14755,7 +14920,14 @@ function Sidebar2({
14755
14920
  const timer = setTimeout(() => setCollapsedOverflowVisible(true), 300);
14756
14921
  return () => clearTimeout(timer);
14757
14922
  }, [showCollapsed]);
14758
- const [activeTab, setActiveTab] = useState("my-chats");
14923
+ const [internalActiveTab, setInternalActiveTab] = useState("my-chats");
14924
+ const activeTab = controlledActiveTab ?? internalActiveTab;
14925
+ const handleTabChange = useCallback((tab) => {
14926
+ if (controlledActiveTab === void 0) {
14927
+ setInternalActiveTab(tab);
14928
+ }
14929
+ onTabChange?.(tab);
14930
+ }, [controlledActiveTab, onTabChange]);
14759
14931
  const [searchQuery, setSearchQuery] = useState("");
14760
14932
  const [sessions, setSessions] = useState([]);
14761
14933
  const [loading, setLoading] = useState(true);
@@ -15369,7 +15541,7 @@ function Sidebar2({
15369
15541
  onClick: (e) => {
15370
15542
  e.preventDefault();
15371
15543
  e.stopPropagation();
15372
- setActiveTab("all-chats");
15544
+ handleTabChange("all-chats");
15373
15545
  close();
15374
15546
  },
15375
15547
  className: `cursor-pointer flex w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-[13px] text-gray-600 dark:text-gray-300 transition-colors ${focus ? "bg-gray-100 dark:bg-gray-800/70" : ""}`,
@@ -15386,7 +15558,7 @@ function Sidebar2({
15386
15558
  onClick: (e) => {
15387
15559
  e.preventDefault();
15388
15560
  e.stopPropagation();
15389
- setActiveTab("my-chats");
15561
+ handleTabChange("my-chats");
15390
15562
  close();
15391
15563
  },
15392
15564
  className: `cursor-pointer flex w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-[13px] text-gray-600 dark:text-gray-300 transition-colors ${focus ? "bg-gray-100 dark:bg-gray-800/70" : ""}`,
@@ -17493,42 +17665,66 @@ function useBichatRouter({
17493
17665
  pathname,
17494
17666
  onNavigate
17495
17667
  }) {
17668
+ const isAllChats = pathname.startsWith("/all-chats");
17496
17669
  const activeSessionId = useMemo(
17497
17670
  () => pathname.match(SESSION_PATH_REGEX)?.[1],
17498
17671
  [pathname]
17499
17672
  );
17673
+ const sidebarTab = useMemo(
17674
+ () => isAllChats ? "all-chats" : "my-chats",
17675
+ [isAllChats]
17676
+ );
17500
17677
  const maybeClose = useCallback(() => {
17501
17678
  onNavigate?.();
17502
17679
  }, [onNavigate]);
17503
17680
  const onSessionSelect = useCallback(
17504
17681
  (sessionId) => {
17505
17682
  if (sessionId) {
17506
- navigate(`/session/${sessionId}`);
17683
+ const prefix = isAllChats ? "/all-chats" : "";
17684
+ navigate(`${prefix}/session/${sessionId}`);
17507
17685
  } else {
17508
- navigate("/");
17686
+ navigate(isAllChats ? "/all-chats" : "/");
17509
17687
  }
17510
17688
  maybeClose();
17511
17689
  },
17512
- [navigate, maybeClose]
17690
+ [navigate, maybeClose, isAllChats]
17513
17691
  );
17514
17692
  const onNewChat = useCallback(() => {
17515
- navigate("/");
17693
+ navigate(isAllChats ? "/all-chats" : "/");
17516
17694
  maybeClose();
17517
- }, [navigate, maybeClose]);
17695
+ }, [navigate, maybeClose, isAllChats]);
17518
17696
  const onArchivedView = useCallback(() => {
17519
17697
  navigate("/archived");
17520
17698
  maybeClose();
17521
17699
  }, [navigate, maybeClose]);
17700
+ const onAllChatsView = useCallback(() => {
17701
+ navigate("/all-chats");
17702
+ maybeClose();
17703
+ }, [navigate, maybeClose]);
17522
17704
  const onBack = useCallback(() => {
17523
17705
  navigate("/");
17524
17706
  maybeClose();
17525
17707
  }, [navigate, maybeClose]);
17708
+ const onSidebarTabChange = useCallback(
17709
+ (tab) => {
17710
+ if (tab === "all-chats") {
17711
+ navigate("/all-chats");
17712
+ } else {
17713
+ navigate("/");
17714
+ }
17715
+ maybeClose();
17716
+ },
17717
+ [navigate, maybeClose]
17718
+ );
17526
17719
  return {
17527
17720
  activeSessionId,
17528
17721
  onSessionSelect,
17529
17722
  onNewChat,
17530
17723
  onArchivedView,
17531
- onBack
17724
+ onBack,
17725
+ onAllChatsView,
17726
+ sidebarTab,
17727
+ onSidebarTabChange
17532
17728
  };
17533
17729
  }
17534
17730