@geoffai/elements 0.1.0

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.
@@ -0,0 +1,382 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as React$1 from 'react';
3
+ import { ReactNode, HTMLAttributes, ComponentProps } from 'react';
4
+ import { VariantProps } from 'class-variance-authority';
5
+ import * as SelectPrimitive from '@radix-ui/react-select';
6
+ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
7
+ import * as AvatarPrimitive from '@radix-ui/react-avatar';
8
+ import * as react_jsx_runtime from 'react/jsx-runtime';
9
+ import { ChatStatus, MessageRole, ChainOfThoughtStepStatus, GeneratedImage, ToolState } from '../types/index.js';
10
+
11
+ declare const buttonVariants: (props?: ({
12
+ variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
13
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
14
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
15
+ interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
16
+ asChild?: boolean;
17
+ }
18
+ declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
19
+
20
+ declare const Textarea: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & React$1.RefAttributes<HTMLTextAreaElement>>;
21
+
22
+ declare const Select: React$1.FC<SelectPrimitive.SelectProps>;
23
+ declare const SelectGroup: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React$1.RefAttributes<HTMLDivElement>>;
24
+ declare const SelectValue: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React$1.RefAttributes<HTMLSpanElement>>;
25
+ declare const SelectTrigger: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
26
+ declare const SelectScrollUpButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
27
+ declare const SelectScrollDownButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
28
+ declare const SelectContent: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
29
+ declare const SelectLabel: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
30
+ declare const SelectItem: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
31
+ declare const SelectSeparator: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
32
+
33
+ declare const Collapsible: React$1.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & React$1.RefAttributes<HTMLDivElement>>;
34
+ declare const CollapsibleTrigger: React$1.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
35
+ declare const CollapsibleContent: React$1.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleContentProps & React$1.RefAttributes<HTMLDivElement>>;
36
+
37
+ declare const Avatar: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
38
+ declare const AvatarImage: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React$1.RefAttributes<HTMLImageElement>, "ref"> & React$1.RefAttributes<HTMLImageElement>>;
39
+ declare const AvatarFallback: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
40
+
41
+ declare const badgeVariants: (props?: ({
42
+ variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
43
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
44
+ interface BadgeProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
45
+ }
46
+ declare function Badge({ className, variant, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
47
+
48
+ interface ChatContainerProps {
49
+ /** Child elements (messages, input, etc.) */
50
+ children: ReactNode;
51
+ /** Additional CSS classes */
52
+ className?: string;
53
+ }
54
+ /**
55
+ * Main chat container with flex layout
56
+ */
57
+ declare const ChatContainer: React$1.MemoExoticComponent<({ children, className, }: ChatContainerProps) => react_jsx_runtime.JSX.Element>;
58
+ interface ChatMessagesProps {
59
+ /** Message elements to render */
60
+ children: ReactNode;
61
+ /** Current chat status */
62
+ status?: ChatStatus;
63
+ /** Additional CSS classes */
64
+ className?: string;
65
+ /** Maximum width for content */
66
+ maxWidth?: string;
67
+ /** Called when scroll position changes */
68
+ onScrollChange?: (isAtBottom: boolean) => void;
69
+ }
70
+ /**
71
+ * Scrollable messages container with auto-scroll behavior
72
+ */
73
+ declare const ChatMessages: React$1.MemoExoticComponent<({ children, status, className, maxWidth, onScrollChange, }: ChatMessagesProps) => react_jsx_runtime.JSX.Element>;
74
+ interface ChatScrollButtonProps {
75
+ /** Whether the button should be visible */
76
+ visible: boolean;
77
+ /** Click handler */
78
+ onClick: () => void;
79
+ /** Additional CSS classes */
80
+ className?: string;
81
+ }
82
+ /**
83
+ * Floating scroll-to-bottom button
84
+ */
85
+ declare const ChatScrollButton: React$1.MemoExoticComponent<({ visible, onClick, className, }: ChatScrollButtonProps) => react_jsx_runtime.JSX.Element | null>;
86
+ interface ChatInputAreaProps {
87
+ /** Input component */
88
+ children: ReactNode;
89
+ /** Additional CSS classes */
90
+ className?: string;
91
+ }
92
+ /**
93
+ * Container for the chat input area
94
+ */
95
+ declare const ChatInputArea: React$1.MemoExoticComponent<({ children, className, }: ChatInputAreaProps) => react_jsx_runtime.JSX.Element>;
96
+ interface ChatEmptyStateProps {
97
+ /** Content to show when chat is empty */
98
+ children: ReactNode;
99
+ /** Additional CSS classes */
100
+ className?: string;
101
+ }
102
+ /**
103
+ * Empty state component for when there are no messages
104
+ */
105
+ declare const ChatEmptyState: React$1.MemoExoticComponent<({ children, className, }: ChatEmptyStateProps) => react_jsx_runtime.JSX.Element>;
106
+
107
+ type MessageContainerProps = HTMLAttributes<HTMLDivElement> & {
108
+ role?: MessageRole;
109
+ };
110
+ /**
111
+ * Container for a message, handles role-based alignment
112
+ */
113
+ declare const MessageContainer: React$1.MemoExoticComponent<({ className, role, children, ...props }: MessageContainerProps) => react_jsx_runtime.JSX.Element>;
114
+ type MessageContentProps = HTMLAttributes<HTMLDivElement> & {
115
+ role?: MessageRole;
116
+ };
117
+ /**
118
+ * Content wrapper for a message with role-based styling
119
+ */
120
+ declare const MessageContent: React$1.MemoExoticComponent<({ className, role, children, ...props }: MessageContentProps) => react_jsx_runtime.JSX.Element>;
121
+ type MessageAvatarProps = {
122
+ role?: MessageRole;
123
+ src?: string;
124
+ fallback?: ReactNode;
125
+ className?: string;
126
+ };
127
+ /**
128
+ * Avatar for a message, supports role-based defaults
129
+ */
130
+ declare const MessageAvatar: React$1.MemoExoticComponent<({ role, src, fallback, className }: MessageAvatarProps) => react_jsx_runtime.JSX.Element>;
131
+ type MessageTextProps = HTMLAttributes<HTMLDivElement>;
132
+ /**
133
+ * Text content wrapper with prose styling
134
+ */
135
+ declare const MessageText: React$1.MemoExoticComponent<({ className, children, ...props }: MessageTextProps) => react_jsx_runtime.JSX.Element>;
136
+ type MessageGroupProps = HTMLAttributes<HTMLDivElement>;
137
+ /**
138
+ * Groups multiple messages together
139
+ */
140
+ declare const MessageGroup: React$1.MemoExoticComponent<({ className, children, ...props }: MessageGroupProps) => react_jsx_runtime.JSX.Element>;
141
+ type MessageTimestampProps = HTMLAttributes<HTMLSpanElement> & {
142
+ date?: Date;
143
+ };
144
+ /**
145
+ * Timestamp display for messages
146
+ */
147
+ declare const MessageTimestamp: React$1.MemoExoticComponent<({ className, date, children, ...props }: MessageTimestampProps) => react_jsx_runtime.JSX.Element>;
148
+
149
+ type PromptInputProps = HTMLAttributes<HTMLFormElement>;
150
+ declare const PromptInput: ({ className, ...props }: PromptInputProps) => react_jsx_runtime.JSX.Element;
151
+ type PromptInputTextareaProps = ComponentProps<typeof Textarea> & {
152
+ minHeight?: number;
153
+ maxHeight?: number;
154
+ disableAutoResize?: boolean;
155
+ resizeOnNewLinesOnly?: boolean;
156
+ };
157
+ declare const PromptInputTextarea: ({ onChange, onKeyDown, className, placeholder, minHeight, maxHeight, disableAutoResize, resizeOnNewLinesOnly, ...props }: PromptInputTextareaProps) => react_jsx_runtime.JSX.Element;
158
+ type PromptInputToolbarProps = HTMLAttributes<HTMLDivElement>;
159
+ declare const PromptInputToolbar: ({ className, ...props }: PromptInputToolbarProps) => react_jsx_runtime.JSX.Element;
160
+ type PromptInputToolsProps = HTMLAttributes<HTMLDivElement>;
161
+ declare const PromptInputTools: ({ className, ...props }: PromptInputToolsProps) => react_jsx_runtime.JSX.Element;
162
+ type PromptInputButtonProps = ComponentProps<typeof Button>;
163
+ declare const PromptInputButton: ({ variant, className, size, ...props }: PromptInputButtonProps) => react_jsx_runtime.JSX.Element;
164
+ type PromptInputSubmitProps = ComponentProps<typeof Button> & {
165
+ status?: ChatStatus;
166
+ };
167
+ declare const PromptInputSubmit: ({ className, variant, size, status, children, ...props }: PromptInputSubmitProps) => react_jsx_runtime.JSX.Element;
168
+ type PromptInputModelSelectProps = ComponentProps<typeof Select>;
169
+ declare const PromptInputModelSelect: (props: PromptInputModelSelectProps) => react_jsx_runtime.JSX.Element;
170
+ type PromptInputModelSelectTriggerProps = ComponentProps<typeof SelectTrigger>;
171
+ declare const PromptInputModelSelectTrigger: ({ className, ...props }: PromptInputModelSelectTriggerProps) => react_jsx_runtime.JSX.Element;
172
+ type PromptInputModelSelectContentProps = ComponentProps<typeof SelectContent>;
173
+ declare const PromptInputModelSelectContent: ({ className, ...props }: PromptInputModelSelectContentProps) => react_jsx_runtime.JSX.Element;
174
+ type PromptInputModelSelectItemProps = ComponentProps<typeof SelectItem>;
175
+ declare const PromptInputModelSelectItem: ({ className, ...props }: PromptInputModelSelectItemProps) => react_jsx_runtime.JSX.Element;
176
+ type PromptInputModelSelectValueProps = ComponentProps<typeof SelectValue>;
177
+ declare const PromptInputModelSelectValue: ({ className, ...props }: PromptInputModelSelectValueProps) => react_jsx_runtime.JSX.Element;
178
+
179
+ type ChainOfThoughtProps = ComponentProps<typeof Collapsible> & {
180
+ open?: boolean;
181
+ defaultOpen?: boolean;
182
+ onOpenChange?: (open: boolean) => void;
183
+ };
184
+ declare const ChainOfThought: React$1.MemoExoticComponent<({ className, open, defaultOpen, onOpenChange, children, ...props }: ChainOfThoughtProps) => react_jsx_runtime.JSX.Element>;
185
+ type ChainOfThoughtHeaderProps = ComponentProps<typeof CollapsibleTrigger> & {
186
+ children?: ReactNode;
187
+ };
188
+ declare const ChainOfThoughtHeader: React$1.MemoExoticComponent<({ className, children, ...props }: ChainOfThoughtHeaderProps) => react_jsx_runtime.JSX.Element>;
189
+ type ChainOfThoughtContentProps = ComponentProps<typeof CollapsibleContent>;
190
+ declare const ChainOfThoughtContent: React$1.MemoExoticComponent<({ className, children, ...props }: ChainOfThoughtContentProps) => react_jsx_runtime.JSX.Element>;
191
+ type ChainOfThoughtStepProps = {
192
+ icon?: React.ComponentType<{
193
+ className?: string;
194
+ }>;
195
+ label: ReactNode;
196
+ description?: string;
197
+ status?: ChainOfThoughtStepStatus;
198
+ children?: ReactNode;
199
+ className?: string;
200
+ };
201
+ declare const ChainOfThoughtStep: React$1.MemoExoticComponent<({ icon: CustomIcon, label, description, status, children, className, }: ChainOfThoughtStepProps) => react_jsx_runtime.JSX.Element>;
202
+ type ChainOfThoughtSearchResultsProps = {
203
+ children: ReactNode;
204
+ className?: string;
205
+ };
206
+ declare const ChainOfThoughtSearchResults: React$1.MemoExoticComponent<({ children, className }: ChainOfThoughtSearchResultsProps) => react_jsx_runtime.JSX.Element>;
207
+ type ChainOfThoughtSearchResultProps = {
208
+ children: ReactNode;
209
+ className?: string;
210
+ };
211
+ declare const ChainOfThoughtSearchResult: React$1.MemoExoticComponent<({ children, className }: ChainOfThoughtSearchResultProps) => react_jsx_runtime.JSX.Element>;
212
+
213
+ interface ShimmerProps {
214
+ children: React.ReactNode;
215
+ /** Duration of one shimmer cycle in seconds */
216
+ duration?: number;
217
+ /** Whether the shimmer is active */
218
+ active?: boolean;
219
+ className?: string;
220
+ }
221
+ /**
222
+ * Shimmer component for text that shows a gradient animation.
223
+ * Used to indicate loading or processing states.
224
+ */
225
+ declare function Shimmer({ children, duration, active, className, }: ShimmerProps): react_jsx_runtime.JSX.Element;
226
+
227
+ interface ThinkingProps {
228
+ /** Whether the animation is currently active */
229
+ isActive: boolean;
230
+ /** Additional CSS classes */
231
+ className?: string;
232
+ /** Size preset: 'xs' | 'sm' | 'lg' | 'xl' */
233
+ size?: 'xs' | 'sm' | 'lg' | 'xl';
234
+ /** Custom color for the dots (default: purple-500) */
235
+ color?: string;
236
+ }
237
+ /**
238
+ * GeoffThinking component displays an animated thinking indicator
239
+ * using a fibonacci spiral pattern of pulsing dots.
240
+ */
241
+ declare function GeoffThinking({ isActive, className, size, color, }: ThinkingProps): react_jsx_runtime.JSX.Element;
242
+
243
+ type ImageCardProps = GeneratedImage & {
244
+ className?: string;
245
+ alt?: string;
246
+ onClick?: () => void;
247
+ };
248
+ /**
249
+ * Image card component for displaying generated images
250
+ * Supports base64 and data URL sources
251
+ */
252
+ declare const ImageCard: React$1.MemoExoticComponent<({ base64, uint8Array: _uint8Array, mediaType, className, alt, onClick, }: ImageCardProps) => react_jsx_runtime.JSX.Element>;
253
+ type ImageGridProps = {
254
+ images: GeneratedImage[];
255
+ className?: string;
256
+ onImageClick?: (image: GeneratedImage, index: number) => void;
257
+ };
258
+ /**
259
+ * Grid layout for displaying multiple images
260
+ */
261
+ declare const ImageGrid: React$1.MemoExoticComponent<({ images, className, onImageClick, }: ImageGridProps) => react_jsx_runtime.JSX.Element>;
262
+
263
+ interface MusicPlayerProps {
264
+ /** Audio URL to play */
265
+ audioUrl: string;
266
+ /** Title of the track */
267
+ title?: string;
268
+ /** Cover image URL */
269
+ imageUrl?: string;
270
+ /** Video background URL (optional) */
271
+ videoUrl?: string;
272
+ /** Track duration string */
273
+ duration?: string;
274
+ /** Tags for the track */
275
+ tags?: string;
276
+ likeCount?: number;
277
+ isLiked?: boolean;
278
+ onLike?: () => void;
279
+ showWaveform?: boolean;
280
+ showTitle?: boolean;
281
+ showPlayButton?: boolean;
282
+ className?: string;
283
+ waveColor?: string;
284
+ progressColor?: string;
285
+ height?: number;
286
+ maxWidth?: string;
287
+ onPlay?: () => void;
288
+ onPause?: () => void;
289
+ onEnded?: () => void;
290
+ onTimeUpdate?: (currentTime: number, duration: number) => void;
291
+ onError?: (error: Error) => void;
292
+ autoPlay?: boolean;
293
+ }
294
+ /**
295
+ * Minimal music player component with optional waveform visualization
296
+ * Uses HTML5 audio with optional WaveSurfer.js integration
297
+ */
298
+ declare const MusicPlayer: React$1.MemoExoticComponent<({ audioUrl, title, imageUrl, videoUrl, duration: durationProp, tags, likeCount, isLiked: initialIsLiked, onLike, showWaveform, showTitle, showPlayButton, className, waveColor, progressColor, height, maxWidth, onPlay, onPause, onEnded, onTimeUpdate, onError, autoPlay, }: MusicPlayerProps) => react_jsx_runtime.JSX.Element>;
299
+
300
+ type ToolProps = ComponentProps<typeof Collapsible>;
301
+ declare const Tool: ({ className, ...props }: ToolProps) => react_jsx_runtime.JSX.Element;
302
+ type ToolHeaderProps = ComponentProps<typeof CollapsibleTrigger> & {
303
+ toolName: string;
304
+ state: ToolState;
305
+ };
306
+ declare const ToolHeader: ({ className, toolName, state, ...props }: ToolHeaderProps) => react_jsx_runtime.JSX.Element;
307
+ type ToolContentProps = ComponentProps<typeof CollapsibleContent>;
308
+ declare const ToolContent: ({ className, ...props }: ToolContentProps) => react_jsx_runtime.JSX.Element;
309
+ type ToolInputProps = ComponentProps<'div'> & {
310
+ input: Record<string, unknown>;
311
+ };
312
+ declare const ToolInput: ({ className, input, ...props }: ToolInputProps) => react_jsx_runtime.JSX.Element;
313
+ type ToolOutputProps = ComponentProps<'div'> & {
314
+ output?: ReactNode;
315
+ errorText?: string;
316
+ };
317
+ declare const ToolOutput: ({ className, output, errorText, ...props }: ToolOutputProps) => react_jsx_runtime.JSX.Element | null;
318
+
319
+ type ReasoningContextValue = {
320
+ isStreaming: boolean;
321
+ isOpen: boolean;
322
+ setIsOpen: (open: boolean) => void;
323
+ duration: number;
324
+ };
325
+ declare const useReasoning: () => ReasoningContextValue;
326
+ type ReasoningProps = ComponentProps<typeof Collapsible> & {
327
+ isStreaming?: boolean;
328
+ open?: boolean;
329
+ defaultOpen?: boolean;
330
+ onOpenChange?: (open: boolean) => void;
331
+ duration?: number;
332
+ };
333
+ declare const Reasoning: React$1.MemoExoticComponent<({ className, isStreaming, open, defaultOpen, onOpenChange, duration: durationProp, children, ...props }: ReasoningProps) => react_jsx_runtime.JSX.Element>;
334
+ type ReasoningTriggerProps = ComponentProps<typeof CollapsibleTrigger>;
335
+ declare const ReasoningTrigger: React$1.MemoExoticComponent<({ className, children, ...props }: ReasoningTriggerProps) => react_jsx_runtime.JSX.Element>;
336
+ type ReasoningContentProps = ComponentProps<typeof CollapsibleContent> & {
337
+ children: ReactNode;
338
+ };
339
+ declare const ReasoningContent: React$1.MemoExoticComponent<({ className, children, ...props }: ReasoningContentProps) => react_jsx_runtime.JSX.Element>;
340
+
341
+ type CodeBlockProps = HTMLAttributes<HTMLDivElement> & {
342
+ code: string;
343
+ language?: string;
344
+ showLineNumbers?: boolean;
345
+ children?: ReactNode;
346
+ };
347
+ /**
348
+ * A simple code block component with copy functionality.
349
+ * For syntax highlighting, wrap this component with your preferred
350
+ * syntax highlighter (e.g., react-syntax-highlighter, prism-react-renderer, shiki).
351
+ */
352
+ declare const CodeBlock: ({ code, language, showLineNumbers, className, children, ...props }: CodeBlockProps) => react_jsx_runtime.JSX.Element;
353
+ type CodeBlockCopyButtonProps = ComponentProps<typeof Button> & {
354
+ onCopy?: () => void;
355
+ onError?: (error: Error) => void;
356
+ timeout?: number;
357
+ };
358
+ declare const CodeBlockCopyButton: ({ onCopy, onError, timeout, children, className, ...props }: CodeBlockCopyButtonProps) => react_jsx_runtime.JSX.Element;
359
+ type CodeBlockHeaderProps = HTMLAttributes<HTMLDivElement>;
360
+ declare const CodeBlockHeader: ({ className, children, ...props }: CodeBlockHeaderProps) => react_jsx_runtime.JSX.Element;
361
+ type CodeBlockLanguageProps = HTMLAttributes<HTMLSpanElement>;
362
+ declare const CodeBlockLanguage: ({ className, children, ...props }: CodeBlockLanguageProps) => react_jsx_runtime.JSX.Element;
363
+
364
+ type SourcesProps = ComponentProps<typeof Collapsible>;
365
+ declare const Sources: ({ className, ...props }: SourcesProps) => react_jsx_runtime.JSX.Element;
366
+ type SourcesTriggerProps = ComponentProps<typeof CollapsibleTrigger> & {
367
+ count: number;
368
+ };
369
+ declare const SourcesTrigger: ({ className, count, children, ...props }: SourcesTriggerProps) => react_jsx_runtime.JSX.Element;
370
+ type SourcesContentProps = ComponentProps<typeof CollapsibleContent>;
371
+ declare const SourcesContent: ({ className, ...props }: SourcesContentProps) => react_jsx_runtime.JSX.Element;
372
+ type SourceProps = ComponentProps<'a'>;
373
+ declare const Source: ({ href, title, children, className, ...props }: SourceProps) => react_jsx_runtime.JSX.Element;
374
+ type SourceListProps = ComponentProps<'div'> & {
375
+ sources: Array<{
376
+ url: string;
377
+ title: string;
378
+ }>;
379
+ };
380
+ declare const SourceList: ({ sources, className, ...props }: SourceListProps) => react_jsx_runtime.JSX.Element;
381
+
382
+ export { Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Button, type ButtonProps, ChainOfThought, ChainOfThoughtContent, type ChainOfThoughtContentProps, ChainOfThoughtHeader, type ChainOfThoughtHeaderProps, type ChainOfThoughtProps, ChainOfThoughtSearchResult, type ChainOfThoughtSearchResultProps, ChainOfThoughtSearchResults, type ChainOfThoughtSearchResultsProps, ChainOfThoughtStep, type ChainOfThoughtStepProps, ChatContainer, type ChatContainerProps, ChatEmptyState, type ChatEmptyStateProps, ChatInputArea, type ChatInputAreaProps, ChatMessages, type ChatMessagesProps, ChatScrollButton, type ChatScrollButtonProps, CodeBlock, CodeBlockCopyButton, type CodeBlockCopyButtonProps, CodeBlockHeader, type CodeBlockHeaderProps, CodeBlockLanguage, type CodeBlockLanguageProps, type CodeBlockProps, Collapsible, CollapsibleContent, CollapsibleTrigger, GeoffThinking, ImageCard, type ImageCardProps, ImageGrid, type ImageGridProps, MessageAvatar, type MessageAvatarProps, MessageContainer, type MessageContainerProps, MessageContent, type MessageContentProps, MessageGroup, type MessageGroupProps, MessageText, type MessageTextProps, MessageTimestamp, type MessageTimestampProps, MusicPlayer, type MusicPlayerProps, PromptInput, PromptInputButton, type PromptInputButtonProps, PromptInputModelSelect, PromptInputModelSelectContent, type PromptInputModelSelectContentProps, PromptInputModelSelectItem, type PromptInputModelSelectItemProps, type PromptInputModelSelectProps, PromptInputModelSelectTrigger, type PromptInputModelSelectTriggerProps, PromptInputModelSelectValue, type PromptInputModelSelectValueProps, type PromptInputProps, PromptInputSubmit, type PromptInputSubmitProps, PromptInputTextarea, type PromptInputTextareaProps, PromptInputToolbar, type PromptInputToolbarProps, PromptInputTools, type PromptInputToolsProps, Reasoning, ReasoningContent, type ReasoningContentProps, type ReasoningProps, ReasoningTrigger, type ReasoningTriggerProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Shimmer, type ShimmerProps, Source, SourceList, type SourceListProps, type SourceProps, Sources, SourcesContent, type SourcesContentProps, type SourcesProps, SourcesTrigger, type SourcesTriggerProps, Textarea, type ThinkingProps, Tool, ToolContent, type ToolContentProps, ToolHeader, type ToolHeaderProps, ToolInput, type ToolInputProps, ToolOutput, type ToolOutputProps, type ToolProps, badgeVariants, buttonVariants, useReasoning };
@@ -0,0 +1,2 @@
1
+ import*as E from'react';import {memo,useEffect,createContext,useState,useRef,useCallback,useContext,Children}from'react';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import*as s from'@radix-ui/react-select';import {ChevronDown,ChevronUp,Check,ArrowDownIcon,ChevronDownIcon,CheckCircleIcon,CircleDotIcon,CircleIcon,Pause,Play,Heart,SendIcon,Loader2Icon,SquareIcon,XIcon,WrenchIcon,CheckIcon,CopyIcon,BookIcon,XCircleIcon,ClockIcon}from'lucide-react';import*as _ from'@radix-ui/react-collapsible';import*as L from'@radix-ui/react-avatar';import {useControllableState}from'@radix-ui/react-use-controllable-state';function r(...e){return twMerge(clsx(e))}function ue(e){let t=Math.floor(e/60),o=Math.floor(e%60);return `${t}:${o.toString().padStart(2,"0")}`}var Ee=cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),N=E.forwardRef(({className:e,variant:t,size:o,asChild:n=false,...a},p)=>jsx(n?Slot:"button",{className:r(Ee({variant:t,size:o,className:e})),ref:p,...a}));N.displayName="Button";var te=E.forwardRef(({className:e,...t},o)=>jsx("textarea",{className:r("flex min-h-[45px] w-full rounded-md border border-input bg-background px-3 py-2 md:text-xl text-lg ring-offset-background placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...t}));te.displayName="Textarea";var fe=s.Root,Ct=s.Group,ge=s.Value,oe=E.forwardRef(({className:e,children:t,...o},n)=>jsxs(s.Trigger,{ref:n,className:r("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...o,children:[t,jsx(s.Icon,{asChild:true,children:jsx(ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));oe.displayName=s.Trigger.displayName;var he=E.forwardRef(({className:e,...t},o)=>jsx(s.ScrollUpButton,{ref:o,className:r("flex cursor-default items-center justify-center py-1",e),...t,children:jsx(ChevronUp,{className:"h-4 w-4"})}));he.displayName=s.ScrollUpButton.displayName;var xe=E.forwardRef(({className:e,...t},o)=>jsx(s.ScrollDownButton,{ref:o,className:r("flex cursor-default items-center justify-center py-1",e),...t,children:jsx(ChevronDown,{className:"h-4 w-4"})}));xe.displayName=s.ScrollDownButton.displayName;var re=E.forwardRef(({className:e,children:t,position:o="popper",...n},a)=>jsx(s.Portal,{children:jsxs(s.Content,{ref:a,className:r("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",o==="popper"&&"data-[side=left]:-translate-x-1 data-[side=top]:-translate-y-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1",e),position:o,...n,children:[jsx(he,{}),jsx(s.Viewport,{className:r("p-2",o==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:t}),jsx(xe,{})]})}));re.displayName=s.Content.displayName;var He=E.forwardRef(({className:e,...t},o)=>jsx(s.Label,{ref:o,className:r("py-1.5 pr-2 pl-8 font-semibold text-sm",e),...t}));He.displayName=s.Label.displayName;var ne=E.forwardRef(({className:e,children:t,...o},n)=>jsxs(s.Item,{ref:n,className:r("relative flex w-full cursor-default select-none items-center rounded-md py-1.5 pr-8 pl-3 text-sm outline-hidden transition-colors hover:bg-muted/50 focus:bg-muted data-disabled:pointer-events-none data-[state=checked]:bg-muted data-disabled:opacity-50",e),...o,children:[jsx("span",{className:"absolute right-3 flex h-4 w-4 items-center justify-center",children:jsx(s.ItemIndicator,{children:jsx(Check,{className:"h-4 w-4 text-foreground"})})}),jsx(s.ItemText,{children:t})]}));ne.displayName=s.Item.displayName;var De=E.forwardRef(({className:e,...t},o)=>jsx(s.Separator,{ref:o,className:r("-mx-1 my-1 h-px bg-muted",e),...t}));De.displayName=s.Separator.displayName;var M=_.Root,k=_.CollapsibleTrigger,A=_.CollapsibleContent;var se=E.forwardRef(({className:e,...t},o)=>jsx(L.Root,{ref:o,className:r("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));se.displayName=L.Root.displayName;var ie=E.forwardRef(({className:e,...t},o)=>jsx(L.Image,{ref:o,className:r("aspect-square h-full w-full",e),...t}));ie.displayName=L.Image.displayName;var J=E.forwardRef(({className:e,...t},o)=>jsx(J,{ref:o,className:r("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));J.displayName=L.Fallback.displayName;var ze=cva("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ce({className:e,variant:t,...o}){return jsx("div",{className:r(ze({variant:t}),e),...o})}function Ge(e={}){let{threshold:t=100,smooth:o=true}=e,n=useRef(null),a=useRef(null),[p,l]=useState(true),i=useCallback(()=>{if(!n.current)return;let{scrollTop:d,scrollHeight:T,clientHeight:$}=n.current;l(d+$>=T-t);},[t]);useEffect(()=>{let d=n.current;if(d)return d.addEventListener("scroll",i),i(),()=>{d.removeEventListener("scroll",i);}},[i]);let c=useCallback((d=o?"smooth":"instant")=>{n.current&&n.current.scrollTo({top:n.current.scrollHeight,behavior:d});},[o]),v=useCallback(()=>{l(true);},[]),m=useCallback(()=>{l(false);},[]);return {containerRef:n,endRef:a,isAtBottom:p,scrollToBottom:c,onViewportEnter:v,onViewportLeave:m}}var Rt=memo(({children:e,className:t})=>jsx("div",{className:r("flex h-full flex-col",t),children:e}));Rt.displayName="ChatContainer";var wt=memo(({children:e,status:t,className:o,maxWidth:n="4xl",onScrollChange:a})=>{let{containerRef:p,endRef:l,isAtBottom:i,scrollToBottom:c}=Ge();return useEffect(()=>{t==="submitted"&&requestAnimationFrame(()=>{c("smooth");});},[t,c]),useEffect(()=>{a?.(i);},[i,a]),jsx("div",{ref:p,className:r("-webkit-overflow-scrolling-touch flex-1 touch-pan-y overflow-y-scroll",o),style:{overflowAnchor:"none"},children:jsx("div",{className:r("mx-auto flex min-w-0 flex-col gap-4 md:gap-6",`max-w-${n}`),children:jsxs("div",{className:"flex flex-col gap-4 px-2 py-4 md:gap-6",children:[e,jsx("div",{ref:l,className:"min-h-[24px] min-w-[24px] shrink-0"})]})})})});wt.displayName="ChatMessages";var It=memo(({visible:e,onClick:t,className:o})=>e?jsx(N,{variant:"outline",size:"icon",className:r("-translate-x-1/2 absolute bottom-40 left-1/2 z-10 rounded-full border bg-background p-2 shadow-lg transition-colors hover:bg-muted",o),onClick:t,type:"button","aria-label":"Scroll to bottom",children:jsx(ArrowDownIcon,{className:"size-4"})}):null);It.displayName="ChatScrollButton";var Mt=memo(({children:e,className:t})=>jsx("div",{className:r("shrink-0 border-t bg-background p-4",t),children:e}));Mt.displayName="ChatInputArea";var kt=memo(({children:e,className:t})=>jsx("div",{className:r("flex flex-1 items-center justify-center",t),children:e}));kt.displayName="ChatEmptyState";var Bt=memo(({className:e,role:t="user",children:o,...n})=>jsx("div",{className:r("flex w-full gap-3",t==="user"?"flex-row-reverse":"flex-row",e),"data-role":t,...n,children:o}));Bt.displayName="MessageContainer";var Et=memo(({className:e,role:t="user",children:o,...n})=>jsx("div",{className:r("rounded-2xl px-4 py-3 max-w-[85%]",t==="user"?"bg-primary text-white":"bg-muted text-white",e),...n,children:o}));Et.displayName="MessageContent";var Lt=memo(({role:e="user",src:t,fallback:o,className:n})=>jsxs(se,{className:r("size-8 shrink-0",n),children:[t&&jsx(ie,{src:t,alt:e}),jsx(J,{children:o??(e==="user"?"U":"A")})]}));Lt.displayName="MessageAvatar";var Ot=memo(({className:e,children:t,...o})=>jsx("div",{className:r("prose prose-sm dark:prose-invert max-w-none",e),...o,children:t}));Ot.displayName="MessageText";var Ht=memo(({className:e,children:t,...o})=>jsx("div",{className:r("flex flex-col gap-4",e),...o,children:t}));Ht.displayName="MessageGroup";var Dt=memo(({className:e,date:t,children:o,...n})=>jsx("span",{className:r("text-xs text-muted-foreground",e),...n,children:o??t?.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}));Dt.displayName="MessageTimestamp";var Or=({className:e,...t})=>jsx("form",{className:r("w-full overflow-hidden rounded-2xl border bg-background shadow-xs",e),...t}),Hr=({onChange:e,onKeyDown:t,className:o,placeholder:n="What would you like to know?",minHeight:a=48,maxHeight:p=164,disableAutoResize:l=false,resizeOnNewLinesOnly:i=false,...c})=>{let v=m=>{if(t?.(m),!m.defaultPrevented&&m.key==="Enter"){if(m.nativeEvent.isComposing||m.shiftKey)return;m.preventDefault();let d=m.currentTarget.form;d&&d.requestSubmit();}};return jsx(te,{className:r("w-full resize-none rounded-none border-none p-3 shadow-none outline-hidden ring-0",l||i?"field-sizing-fixed":"field-sizing-content max-h-[6lh]","bg-transparent dark:bg-transparent","focus-visible:ring-0",o),name:"message",onChange:m=>{e?.(m);},onKeyDown:v,placeholder:n,...c})},Dr=({className:e,...t})=>jsx("div",{className:r("flex items-center justify-between p-1",e),...t}),zr=({className:e,...t})=>jsx("div",{className:r("flex items-center gap-1","[&_button:first-child]:rounded-bl-xl",e),...t}),Vr=({variant:e="ghost",className:t,size:o,...n})=>{let a=o??Children.count(n.children)>1?"default":"icon";return jsx(N,{className:r("shrink-0 gap-1.5 rounded-lg",e==="ghost"&&"text-muted-foreground",a==="default"&&"px-3",t),size:a,type:"button",variant:e,...n})},Gr=({className:e,variant:t="default",size:o="icon",status:n,children:a,...p})=>{let l=jsx(SendIcon,{className:"size-4"});return n==="submitted"?l=jsx(Loader2Icon,{className:"size-4 animate-spin"}):n==="streaming"?l=jsx(SquareIcon,{className:"size-4"}):n==="error"&&(l=jsx(XIcon,{className:"size-4"})),jsx(N,{className:r("gap-1.5 rounded-lg",e),size:o,type:"submit",variant:t,...p,children:a??l})},$r=e=>jsx(fe,{...e}),Ur=({className:e,...t})=>jsx(oe,{className:r("border-none bg-transparent font-medium text-muted-foreground shadow-none transition-colors","hover:bg-accent hover:text-foreground aria-expanded:bg-accent aria-expanded:text-foreground","h-auto px-2 py-1.5",e),...t}),Wr=({className:e,...t})=>jsx(re,{className:r(e),...t}),_r=({className:e,...t})=>jsx(ne,{className:r(e),...t}),Fr=({className:e,...t})=>jsx(ge,{className:r(e),...t});var Ue=createContext(null),Jt=()=>{let e=useContext(Ue);if(!e)throw new Error("ChainOfThought components must be used within ChainOfThought");return e},Yt=memo(({className:e,open:t,defaultOpen:o=true,onOpenChange:n,children:a,...p})=>{let[l,i]=useControllableState({prop:t,defaultProp:o,onChange:n});return jsx(Ue.Provider,{value:{isOpen:l??true,setIsOpen:i},children:jsx(M,{className:r("not-prose border rounded-lg p-4",e),onOpenChange:i,open:l,...p,children:a})})}),Qt=memo(({className:e,children:t,...o})=>{let{isOpen:n}=Jt();return jsxs(k,{className:r("flex w-full items-center justify-between text-sm font-medium transition-colors hover:text-foreground",e),...o,children:[t??"Chain of Thought",jsx(ChevronDownIcon,{className:r("size-4 text-muted-foreground transition-transform",n?"rotate-180":"rotate-0")})]})}),eo=memo(({className:e,children:t,...o})=>jsx(A,{className:r("mt-4 space-y-3","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in",e),...o,children:t})),to=memo(({icon:e,label:t,description:o,status:n="complete",children:a,className:p})=>{let l=n==="complete"?CheckCircleIcon:n==="active"?CircleDotIcon:CircleIcon,i=n==="complete"?"text-green-500":n==="active"?"text-blue-500":"text-muted-foreground",c=e??l;return jsxs("div",{className:r("flex gap-3",p),children:[jsx("div",{className:"flex-shrink-0 mt-0.5",children:jsx(c,{className:r("size-4",i)})}),jsxs("div",{className:"flex-1 space-y-1",children:[jsx("div",{className:"text-sm font-medium",children:t}),o&&jsx("div",{className:"text-xs text-muted-foreground",children:o}),a&&jsx("div",{className:"mt-2",children:a})]})]})}),oo=memo(({children:e,className:t})=>jsx("div",{className:r("space-y-2 mt-2",t),children:e})),ro=memo(({children:e,className:t})=>jsx("div",{className:r("text-xs bg-muted/50 rounded p-2 border",t),children:e}));Yt.displayName="ChainOfThought";Qt.displayName="ChainOfThoughtHeader";eo.displayName="ChainOfThoughtContent";to.displayName="ChainOfThoughtStep";oo.displayName="ChainOfThoughtSearchResults";ro.displayName="ChainOfThoughtSearchResult";function no({children:e,duration:t=1,active:o=true,className:n}){return o?jsx("span",{className:r("inline-block bg-clip-text text-transparent","bg-gradient-to-r from-zinc-400 via-white to-zinc-400","bg-[length:200%_100%]","animate-shimmer",n),style:{animationDuration:`${t}s`},children:e}):jsx("span",{className:n,children:e})}var z={xs:{size:30,dotRadius:2,numDots:15},sm:{size:30,dotRadius:1.5,numDots:15},lg:{size:30,dotRadius:1.5,numDots:15},xl:{size:200,dotRadius:3,numDots:100}};function ao({isActive:e,className:t="",size:o="sm",color:n="#a855f7"}){let a=useRef(null),p=useRef(null);return useEffect(()=>{if(!a.current)return;let l=z[o].numDots,i=z[o].size,c=z[o].dotRadius,v=2,m=1.5,d=Math.PI*(3-Math.sqrt(5)),T=i/2,$=T-v-c,w="http://www.w3.org/2000/svg";a.current.innerHTML="";let h=document.createElementNS(w,"svg");h.setAttribute("width",i.toString()),h.setAttribute("height",i.toString()),h.setAttribute("viewBox",`0 0 ${i} ${i}`),h.style.width="100%",h.style.height="100%",h.style.maxWidth=`${z[o].size}px`,h.style.maxHeight=`${z[o].size}px`,a.current.appendChild(h),p.current=h;for(let H=0;H<l;H++){let I=H+.5,U=I/l,X=Math.sqrt(U)*$,Z=I*d,Q=T+X*Math.cos(Z),ee=T+X*Math.sin(Z),y=document.createElementNS(w,"circle");y.setAttribute("cx",Q.toString()),y.setAttribute("cy",ee.toString()),y.setAttribute("r",c.toString()),y.style.fill=n,y.style.opacity="0.6",h.appendChild(y);let P=document.createElementNS(w,"animate");P.setAttribute("attributeName","r"),P.setAttribute("values",`${c*.5};${c*1.5};${c*.5}`),P.setAttribute("dur",`${m}s`),P.setAttribute("begin",`${U*m}s`),P.setAttribute("repeatCount","indefinite"),P.setAttribute("calcMode","spline"),P.setAttribute("keySplines","0.4 0 0.6 1;0.4 0 0.6 1"),y.appendChild(P);let b=document.createElementNS(w,"animate");b.setAttribute("attributeName","opacity"),b.setAttribute("values","0.3;1;0.3"),b.setAttribute("dur",`${m}s`),b.setAttribute("begin",`${U*m}s`),b.setAttribute("repeatCount","indefinite"),b.setAttribute("calcMode","spline"),b.setAttribute("keySplines","0.4 0 0.6 1;0.4 0 0.6 1"),y.appendChild(b);}},[o,n]),useEffect(()=>{if(!p.current)return;p.current.querySelectorAll("animate").forEach(i=>{e?i.beginElement():i.endElement();});},[e]),jsx("div",{ref:a,className:`flex items-center justify-center ${t}`,style:{width:`${z[o].size}px`,height:`${z[o].size}px`,background:"transparent"}})}var Ne=memo(({base64:e,uint8Array:t,mediaType:o,className:n,alt:a="Generated image",onClick:p})=>{let l=`data:${o};base64,${e}`;return jsx("img",{src:l,alt:a,onClick:p,className:r("h-auto max-w-full overflow-hidden rounded-md",p&&"cursor-pointer hover:opacity-90 transition-opacity",n)})});Ne.displayName="ImageCard";var Ke=memo(({images:e,className:t,onImageClick:o})=>jsx("div",{className:r("grid grid-cols-2 gap-2 md:grid-cols-3",t),children:e.map((n,a)=>jsx(Ne,{...n,onClick:()=>o?.(n,a)},a))}));Ke.displayName="ImageGrid";var Ze=memo(({audioUrl:e,title:t="Untitled",imageUrl:o,videoUrl:n,duration:a,tags:p,likeCount:l=0,isLiked:i=false,onLike:c,showWaveform:v=false,showTitle:m=true,showPlayButton:d=true,className:T="",waveColor:$="#666666",progressColor:w="#ffffff",height:h=60,maxWidth:H="100%",onPlay:I,onPause:U,onEnded:X,onTimeUpdate:Z,onError:Q,autoPlay:ee=false})=>{let[y,P]=useState(false),[b,rt]=useState(i),[Ie,Me]=useState(0),[j,nt]=useState(0),[at,ke]=useState(true),[st,it]=useState(null),W=useRef(null),ce=useRef(null);useEffect(()=>{let u=new Audio(e);return W.current=u,u.addEventListener("loadedmetadata",()=>{nt(u.duration),ke(false);}),u.addEventListener("timeupdate",()=>{Me(u.currentTime),Z?.(u.currentTime,u.duration);}),u.addEventListener("ended",()=>{P(false),X?.();}),u.addEventListener("error",me=>{let de=new Error("Failed to load audio");it(de.message),ke(false),Q?.(de);}),ee&&u.play().catch(()=>{}),()=>{u.pause(),u.src="";}},[e,ee,X,Q,Z]);let lt=useCallback(()=>{W.current&&(y?(W.current.pause(),P(false),U?.()):W.current.play().then(()=>{P(true),I?.();}).catch(u=>{console.error("Failed to play:",u);}));},[y,U,I]),pt=useCallback(u=>{if(!ce.current||!W.current)return;let me=ce.current.getBoundingClientRect(),Ae=(u.clientX-me.left)/me.width*j;W.current.currentTime=Ae,Me(Ae);},[j]),ct=useCallback(()=>{rt(!b),c?.();},[b,c]),mt=j>0?Ie/j*100:0;return st?jsx("div",{className:r("rounded-lg bg-muted p-4 text-sm text-muted-foreground",T),children:"Failed to load audio"}):jsxs("div",{className:r("relative overflow-hidden rounded-xl bg-black/90",T),style:{maxWidth:H,height:h},children:[n?jsx("video",{src:n,className:"absolute inset-0 h-full w-full object-cover opacity-30",autoPlay:true,muted:true,loop:true,playsInline:true}):o?jsx("img",{src:o,alt:"",className:"absolute inset-0 h-full w-full object-cover opacity-30"}):null,jsxs("div",{className:"relative flex h-full items-center gap-3 px-3",children:[d&&jsx(N,{variant:"ghost",size:"icon",onClick:lt,disabled:at,className:"shrink-0 text-white hover:bg-white/20",children:y?jsx(Pause,{className:"size-5"}):jsx(Play,{className:"size-5"})}),jsxs("div",{className:"flex flex-1 flex-col gap-1 min-w-0",children:[m&&jsx("div",{className:"truncate text-sm font-medium text-white",children:t}),jsx("div",{ref:ce,onClick:pt,className:"h-1 w-full cursor-pointer rounded-full bg-white/20",children:jsx("div",{className:"h-full rounded-full bg-white transition-all",style:{width:`${mt}%`}})}),jsxs("div",{className:"flex justify-between text-xs text-white/60",children:[jsx("span",{children:ue(Ie)}),jsx("span",{children:ue(j)})]})]}),c&&jsx(N,{variant:"ghost",size:"icon",onClick:ct,className:r("shrink-0 hover:bg-white/20",b?"text-red-500":"text-white"),children:jsx(Heart,{className:r("size-4",b&&"fill-current")})})]})]})});Ze.displayName="MusicPlayer";var Mn=({className:e,...t})=>jsx(M,{className:r("not-prose mb-4 w-full rounded-md border",e),...t}),bo=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return jsxs(Ce,{className:"flex items-center gap-1 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":jsx(CircleIcon,{className:"size-4"}),"input-available":jsx(ClockIcon,{className:"size-4 animate-pulse"}),"output-available":jsx(CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":jsx(XCircleIcon,{className:"size-4 text-red-600"})}[e],jsx("span",{children:t[e]})]})},kn=({className:e,toolName:t,state:o,...n})=>jsxs(k,{className:r("group flex w-full min-w-0 items-center justify-between gap-2 p-3",e),...n,children:[jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[jsx(WrenchIcon,{className:"size-4 shrink-0 text-muted-foreground"}),jsx("span",{className:"truncate font-medium text-sm",children:t})]}),jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[bo(o),jsx(ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})]}),An=({className:e,...t})=>jsx(A,{className:r("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),Bn=({className:e,input:t,...o})=>jsxs("div",{className:r("space-y-2 overflow-hidden p-4",e),...o,children:[jsx("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),jsx("div",{className:"rounded-md bg-muted/50",children:jsx("pre",{className:"overflow-x-auto p-3 font-mono text-xs",children:JSON.stringify(t,null,2)})})]}),En=({className:e,output:t,errorText:o,...n})=>t||o?jsxs("div",{className:r("space-y-2 p-4",e),...n,children:[jsx("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:o?"Error":"Result"}),jsxs("div",{className:r("overflow-x-auto rounded-md text-xs [&_table]:w-full",o?"bg-destructive/10 p-3 text-destructive":"bg-muted/50 text-foreground"),children:[o&&jsx("div",{children:o}),t&&jsx("div",{children:t})]})]}):null;var et=createContext(null),No=()=>{let e=useContext(et);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},So=500,To=1e3,Ro=memo(({className:e,isStreaming:t=false,open:o,defaultOpen:n=true,onOpenChange:a,duration:p,children:l,...i})=>{let[c,v]=useControllableState({prop:o,defaultProp:n,onChange:a}),[m,d]=useControllableState({prop:p,defaultProp:0}),[T,$]=useState(false),[w,h]=useState(null);useEffect(()=>{t?w===null&&h(Date.now()):w!==null&&(d(Math.round((Date.now()-w)/To)),h(null));},[t,w,d]),useEffect(()=>{if(n&&!t&&c&&!T){let I=setTimeout(()=>{v(false),$(true);},So);return ()=>clearTimeout(I)}},[t,c,n,v,T]);let H=I=>{v(I);};return jsx(et.Provider,{value:{isStreaming:t,isOpen:c??false,setIsOpen:v,duration:m??0},children:jsx(M,{className:r("not-prose",e),onOpenChange:H,open:c,...i,children:l})})}),wo=memo(({className:e,children:t,...o})=>{let{isStreaming:n,isOpen:a,duration:p}=No();return jsx(k,{className:r("flex items-center gap-1.5 text-muted-foreground text-lg transition-colors hover:text-foreground",e),...o,children:t??jsxs(Fragment,{children:[n||p===0?jsx("p",{children:"Thinking..."}):jsxs("p",{children:["Thought for ",p,"s"]}),jsx(ChevronDownIcon,{className:r("size-3 text-muted-foreground transition-transform",a?"rotate-180":"rotate-0")})]})})}),Io=memo(({className:e,children:t,...o})=>jsx(A,{className:r("mt-2 text-muted-foreground text-xs","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in",e),...o,children:jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:t})}));Ro.displayName="Reasoning";wo.displayName="ReasoningTrigger";Io.displayName="ReasoningContent";var tt=createContext({code:""}),Kn=({code:e,language:t,showLineNumbers:o=false,className:n,children:a,...p})=>{let l=e.split(`
2
+ `);return jsx(tt.Provider,{value:{code:e},children:jsxs("div",{className:r("relative w-full overflow-hidden rounded-md border bg-muted/50",n),...p,children:[t&&jsx("div",{className:"flex items-center justify-between border-b bg-muted/30 px-4 py-2",children:jsx("span",{className:"font-mono text-muted-foreground text-xs",children:t})}),jsxs("div",{className:"relative",children:[jsx("pre",{className:"overflow-x-auto p-4",children:jsx("code",{className:"font-mono text-sm",children:o?l.map((i,c)=>jsxs("div",{className:"flex",children:[jsx("span",{className:"mr-4 inline-block w-8 select-none text-right text-muted-foreground",children:c+1}),jsx("span",{children:i})]},c)):e})}),a&&jsx("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:a})]})]})})},Xn=({onCopy:e,onError:t,timeout:o=2e3,children:n,className:a,...p})=>{let[l,i]=useState(false),{code:c}=useContext(tt),v=async()=>{if(typeof window>"u"||!navigator.clipboard?.writeText){t?.(new Error("Clipboard API not available"));return}try{await navigator.clipboard.writeText(c),i(!0),e?.(),setTimeout(()=>i(!1),o);}catch(d){t?.(d);}},m=l?CheckIcon:CopyIcon;return jsx(N,{className:r("shrink-0",a),onClick:v,size:"icon",type:"button",variant:"ghost",...p,children:n??jsx(m,{size:14})})},Zn=({className:e,children:t,...o})=>jsx("div",{className:r("flex items-center justify-between border-b bg-muted/30 px-4 py-2",e),...o,children:t}),jn=({className:e,children:t,...o})=>jsx("span",{className:r("font-mono text-muted-foreground text-xs",e),...o,children:t});var oa=({className:e,...t})=>jsx(M,{className:r("not-prose mb-4 text-primary text-xs",e),...t}),ra=({className:e,count:t,children:o,...n})=>jsx(k,{className:r("flex items-center gap-2",e),...n,children:o??jsxs(Fragment,{children:[jsxs("p",{className:"font-medium",children:["Used ",t," sources"]}),jsx(ChevronDownIcon,{className:"size-4"})]})}),na=({className:e,...t})=>jsx(A,{className:r("mt-3 flex w-fit flex-col gap-2","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),Do=({href:e,title:t,children:o,className:n,...a})=>jsx("a",{className:r("flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",n),href:e,rel:"noreferrer",target:"_blank",...a,children:o??jsxs(Fragment,{children:[jsx(BookIcon,{className:"size-4 shrink-0"}),jsx("span",{className:"block font-medium truncate",children:t})]})}),aa=({sources:e,className:t,...o})=>jsx("div",{className:r("space-y-2",t),...o,children:e.map((n,a)=>jsx(Do,{href:n.url,title:n.title},a))});export{se as Avatar,J as AvatarFallback,ie as AvatarImage,Ce as Badge,N as Button,Yt as ChainOfThought,eo as ChainOfThoughtContent,Qt as ChainOfThoughtHeader,ro as ChainOfThoughtSearchResult,oo as ChainOfThoughtSearchResults,to as ChainOfThoughtStep,Rt as ChatContainer,kt as ChatEmptyState,Mt as ChatInputArea,wt as ChatMessages,It as ChatScrollButton,Kn as CodeBlock,Xn as CodeBlockCopyButton,Zn as CodeBlockHeader,jn as CodeBlockLanguage,M as Collapsible,A as CollapsibleContent,k as CollapsibleTrigger,ao as GeoffThinking,Ne as ImageCard,Ke as ImageGrid,Lt as MessageAvatar,Bt as MessageContainer,Et as MessageContent,Ht as MessageGroup,Ot as MessageText,Dt as MessageTimestamp,Ze as MusicPlayer,Or as PromptInput,Vr as PromptInputButton,$r as PromptInputModelSelect,Wr as PromptInputModelSelectContent,_r as PromptInputModelSelectItem,Ur as PromptInputModelSelectTrigger,Fr as PromptInputModelSelectValue,Gr as PromptInputSubmit,Hr as PromptInputTextarea,Dr as PromptInputToolbar,zr as PromptInputTools,Ro as Reasoning,Io as ReasoningContent,wo as ReasoningTrigger,fe as Select,re as SelectContent,Ct as SelectGroup,ne as SelectItem,He as SelectLabel,xe as SelectScrollDownButton,he as SelectScrollUpButton,De as SelectSeparator,oe as SelectTrigger,ge as SelectValue,no as Shimmer,Do as Source,aa as SourceList,oa as Sources,na as SourcesContent,ra as SourcesTrigger,te as Textarea,Mn as Tool,An as ToolContent,kn as ToolHeader,Bn as ToolInput,En as ToolOutput,ze as badgeVariants,Ee as buttonVariants,No as useReasoning};
@@ -0,0 +1 @@
1
+ 'use strict';var react=require('react');function R(i={}){let{threshold:l=100,smooth:c=true}=i,o=react.useRef(null),u=react.useRef(null),[m,n]=react.useState(true),e=react.useCallback(()=>{if(!o.current)return;let{scrollTop:t,scrollHeight:T,clientHeight:v}=o.current;n(t+v>=T-l);},[l]);react.useEffect(()=>{let t=o.current;if(t)return t.addEventListener("scroll",e),e(),()=>{t.removeEventListener("scroll",e);}},[e]);let a=react.useCallback((t=c?"smooth":"instant")=>{o.current&&o.current.scrollTo({top:o.current.scrollHeight,behavior:t});},[c]),f=react.useCallback(()=>{n(true);},[]),p=react.useCallback(()=>{n(false);},[]);return {containerRef:o,endRef:u,isAtBottom:m,scrollToBottom:a,onViewportEnter:f,onViewportLeave:p}}exports.useScrollToBottom=R;
@@ -0,0 +1,26 @@
1
+ interface UseScrollToBottomOptions {
2
+ /** Distance from bottom (in pixels) to consider "at bottom" */
3
+ threshold?: number;
4
+ /** Whether to smooth scroll by default */
5
+ smooth?: boolean;
6
+ }
7
+ interface UseScrollToBottomReturn {
8
+ /** Ref to attach to the scrollable container */
9
+ containerRef: React.RefObject<HTMLDivElement | null>;
10
+ /** Ref to attach to a sentinel element at the bottom */
11
+ endRef: React.RefObject<HTMLDivElement | null>;
12
+ /** Whether the user is currently at the bottom */
13
+ isAtBottom: boolean;
14
+ /** Scroll to the bottom of the container */
15
+ scrollToBottom: (behavior?: ScrollBehavior) => void;
16
+ /** Callback for IntersectionObserver when end element enters viewport */
17
+ onViewportEnter: () => void;
18
+ /** Callback for IntersectionObserver when end element leaves viewport */
19
+ onViewportLeave: () => void;
20
+ }
21
+ /**
22
+ * Hook for managing scroll-to-bottom behavior in chat interfaces
23
+ */
24
+ declare function useScrollToBottom(options?: UseScrollToBottomOptions): UseScrollToBottomReturn;
25
+
26
+ export { type UseScrollToBottomOptions, type UseScrollToBottomReturn, useScrollToBottom };
@@ -0,0 +1,26 @@
1
+ interface UseScrollToBottomOptions {
2
+ /** Distance from bottom (in pixels) to consider "at bottom" */
3
+ threshold?: number;
4
+ /** Whether to smooth scroll by default */
5
+ smooth?: boolean;
6
+ }
7
+ interface UseScrollToBottomReturn {
8
+ /** Ref to attach to the scrollable container */
9
+ containerRef: React.RefObject<HTMLDivElement | null>;
10
+ /** Ref to attach to a sentinel element at the bottom */
11
+ endRef: React.RefObject<HTMLDivElement | null>;
12
+ /** Whether the user is currently at the bottom */
13
+ isAtBottom: boolean;
14
+ /** Scroll to the bottom of the container */
15
+ scrollToBottom: (behavior?: ScrollBehavior) => void;
16
+ /** Callback for IntersectionObserver when end element enters viewport */
17
+ onViewportEnter: () => void;
18
+ /** Callback for IntersectionObserver when end element leaves viewport */
19
+ onViewportLeave: () => void;
20
+ }
21
+ /**
22
+ * Hook for managing scroll-to-bottom behavior in chat interfaces
23
+ */
24
+ declare function useScrollToBottom(options?: UseScrollToBottomOptions): UseScrollToBottomReturn;
25
+
26
+ export { type UseScrollToBottomOptions, type UseScrollToBottomReturn, useScrollToBottom };
@@ -0,0 +1 @@
1
+ import {useRef,useState,useCallback,useEffect}from'react';function R(i={}){let{threshold:l=100,smooth:c=true}=i,o=useRef(null),u=useRef(null),[m,n]=useState(true),e=useCallback(()=>{if(!o.current)return;let{scrollTop:t,scrollHeight:T,clientHeight:v}=o.current;n(t+v>=T-l);},[l]);useEffect(()=>{let t=o.current;if(t)return t.addEventListener("scroll",e),e(),()=>{t.removeEventListener("scroll",e);}},[e]);let a=useCallback((t=c?"smooth":"instant")=>{o.current&&o.current.scrollTo({top:o.current.scrollHeight,behavior:t});},[c]),f=useCallback(()=>{n(true);},[]),p=useCallback(()=>{n(false);},[]);return {containerRef:o,endRef:u,isAtBottom:m,scrollToBottom:a,onViewportEnter:f,onViewportLeave:p}}export{R as useScrollToBottom};
package/dist/index.cjs ADDED
@@ -0,0 +1,2 @@
1
+ 'use strict';var clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),E=require('react'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),jsxRuntime=require('react/jsx-runtime'),s=require('@radix-ui/react-select'),lucideReact=require('lucide-react'),_=require('@radix-ui/react-collapsible'),L=require('@radix-ui/react-avatar'),reactUseControllableState=require('@radix-ui/react-use-controllable-state');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var E__namespace=/*#__PURE__*/_interopNamespace(E);var s__namespace=/*#__PURE__*/_interopNamespace(s);var ___namespace=/*#__PURE__*/_interopNamespace(_);var L__namespace=/*#__PURE__*/_interopNamespace(L);function r(...e){return tailwindMerge.twMerge(clsx.clsx(e))}function ue(e){let t=Math.floor(e/60),o=Math.floor(e%60);return `${t}:${o.toString().padStart(2,"0")}`}function $o(e){if(e===0)return "0 Bytes";let t=1024,o=["Bytes","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(t));return `${parseFloat((e/Math.pow(t,n)).toFixed(1))} ${o[n]}`}function Uo(e,t){return e.length<=t?e:`${e.slice(0,t-3)}...`}function fe(e={}){let{threshold:t=100,smooth:o=true}=e,n=E.useRef(null),a=E.useRef(null),[p,l]=E.useState(true),i=E.useCallback(()=>{if(!n.current)return;let{scrollTop:d,scrollHeight:T,clientHeight:$}=n.current;l(d+$>=T-t);},[t]);E.useEffect(()=>{let d=n.current;if(d)return d.addEventListener("scroll",i),i(),()=>{d.removeEventListener("scroll",i);}},[i]);let c=E.useCallback((d=o?"smooth":"instant")=>{n.current&&n.current.scrollTo({top:n.current.scrollHeight,behavior:d});},[o]),v=E.useCallback(()=>{l(true);},[]),m=E.useCallback(()=>{l(false);},[]);return {containerRef:n,endRef:a,isAtBottom:p,scrollToBottom:c,onViewportEnter:v,onViewportLeave:m}}var Oe=classVarianceAuthority.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),N=E__namespace.forwardRef(({className:e,variant:t,size:o,asChild:n=false,...a},p)=>jsxRuntime.jsx(n?reactSlot.Slot:"button",{className:r(Oe({variant:t,size:o,className:e})),ref:p,...a}));N.displayName="Button";var oe=E__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx("textarea",{className:r("flex min-h-[45px] w-full rounded-md border border-input bg-background px-3 py-2 md:text-xl text-lg ring-offset-background placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...t}));oe.displayName="Textarea";var ge=s__namespace.Root,Pt=s__namespace.Group,he=s__namespace.Value,re=E__namespace.forwardRef(({className:e,children:t,...o},n)=>jsxRuntime.jsxs(s__namespace.Trigger,{ref:n,className:r("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...o,children:[t,jsxRuntime.jsx(s__namespace.Icon,{asChild:true,children:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));re.displayName=s__namespace.Trigger.displayName;var xe=E__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(s__namespace.ScrollUpButton,{ref:o,className:r("flex cursor-default items-center justify-center py-1",e),...t,children:jsxRuntime.jsx(lucideReact.ChevronUp,{className:"h-4 w-4"})}));xe.displayName=s__namespace.ScrollUpButton.displayName;var ve=E__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(s__namespace.ScrollDownButton,{ref:o,className:r("flex cursor-default items-center justify-center py-1",e),...t,children:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"h-4 w-4"})}));ve.displayName=s__namespace.ScrollDownButton.displayName;var ne=E__namespace.forwardRef(({className:e,children:t,position:o="popper",...n},a)=>jsxRuntime.jsx(s__namespace.Portal,{children:jsxRuntime.jsxs(s__namespace.Content,{ref:a,className:r("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",o==="popper"&&"data-[side=left]:-translate-x-1 data-[side=top]:-translate-y-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1",e),position:o,...n,children:[jsxRuntime.jsx(xe,{}),jsxRuntime.jsx(s__namespace.Viewport,{className:r("p-2",o==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:t}),jsxRuntime.jsx(ve,{})]})}));ne.displayName=s__namespace.Content.displayName;var ze=E__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(s__namespace.Label,{ref:o,className:r("py-1.5 pr-2 pl-8 font-semibold text-sm",e),...t}));ze.displayName=s__namespace.Label.displayName;var ae=E__namespace.forwardRef(({className:e,children:t,...o},n)=>jsxRuntime.jsxs(s__namespace.Item,{ref:n,className:r("relative flex w-full cursor-default select-none items-center rounded-md py-1.5 pr-8 pl-3 text-sm outline-hidden transition-colors hover:bg-muted/50 focus:bg-muted data-disabled:pointer-events-none data-[state=checked]:bg-muted data-disabled:opacity-50",e),...o,children:[jsxRuntime.jsx("span",{className:"absolute right-3 flex h-4 w-4 items-center justify-center",children:jsxRuntime.jsx(s__namespace.ItemIndicator,{children:jsxRuntime.jsx(lucideReact.Check,{className:"h-4 w-4 text-foreground"})})}),jsxRuntime.jsx(s__namespace.ItemText,{children:t})]}));ae.displayName=s__namespace.Item.displayName;var Ve=E__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(s__namespace.Separator,{ref:o,className:r("-mx-1 my-1 h-px bg-muted",e),...t}));Ve.displayName=s__namespace.Separator.displayName;var M=___namespace.Root,k=___namespace.CollapsibleTrigger,B=___namespace.CollapsibleContent;var ie=E__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(L__namespace.Root,{ref:o,className:r("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));ie.displayName=L__namespace.Root.displayName;var le=E__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(L__namespace.Image,{ref:o,className:r("aspect-square h-full w-full",e),...t}));le.displayName=L__namespace.Image.displayName;var J=E__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(J,{ref:o,className:r("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));J.displayName=L__namespace.Fallback.displayName;var Ge=classVarianceAuthority.cva("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function ye({className:e,variant:t,...o}){return jsxRuntime.jsx("div",{className:r(Ge({variant:t}),e),...o})}var Rt=E.memo(({children:e,className:t})=>jsxRuntime.jsx("div",{className:r("flex h-full flex-col",t),children:e}));Rt.displayName="ChatContainer";var wt=E.memo(({children:e,status:t,className:o,maxWidth:n="4xl",onScrollChange:a})=>{let{containerRef:p,endRef:l,isAtBottom:i,scrollToBottom:c}=fe();return E.useEffect(()=>{t==="submitted"&&requestAnimationFrame(()=>{c("smooth");});},[t,c]),E.useEffect(()=>{a?.(i);},[i,a]),jsxRuntime.jsx("div",{ref:p,className:r("-webkit-overflow-scrolling-touch flex-1 touch-pan-y overflow-y-scroll",o),style:{overflowAnchor:"none"},children:jsxRuntime.jsx("div",{className:r("mx-auto flex min-w-0 flex-col gap-4 md:gap-6",`max-w-${n}`),children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-4 px-2 py-4 md:gap-6",children:[e,jsxRuntime.jsx("div",{ref:l,className:"min-h-[24px] min-w-[24px] shrink-0"})]})})})});wt.displayName="ChatMessages";var It=E.memo(({visible:e,onClick:t,className:o})=>e?jsxRuntime.jsx(N,{variant:"outline",size:"icon",className:r("-translate-x-1/2 absolute bottom-40 left-1/2 z-10 rounded-full border bg-background p-2 shadow-lg transition-colors hover:bg-muted",o),onClick:t,type:"button","aria-label":"Scroll to bottom",children:jsxRuntime.jsx(lucideReact.ArrowDownIcon,{className:"size-4"})}):null);It.displayName="ChatScrollButton";var Mt=E.memo(({children:e,className:t})=>jsxRuntime.jsx("div",{className:r("shrink-0 border-t bg-background p-4",t),children:e}));Mt.displayName="ChatInputArea";var kt=E.memo(({children:e,className:t})=>jsxRuntime.jsx("div",{className:r("flex flex-1 items-center justify-center",t),children:e}));kt.displayName="ChatEmptyState";var At=E.memo(({className:e,role:t="user",children:o,...n})=>jsxRuntime.jsx("div",{className:r("flex w-full gap-3",t==="user"?"flex-row-reverse":"flex-row",e),"data-role":t,...n,children:o}));At.displayName="MessageContainer";var Et=E.memo(({className:e,role:t="user",children:o,...n})=>jsxRuntime.jsx("div",{className:r("rounded-2xl px-4 py-3 max-w-[85%]",t==="user"?"bg-primary text-white":"bg-muted text-white",e),...n,children:o}));Et.displayName="MessageContent";var Lt=E.memo(({role:e="user",src:t,fallback:o,className:n})=>jsxRuntime.jsxs(ie,{className:r("size-8 shrink-0",n),children:[t&&jsxRuntime.jsx(le,{src:t,alt:e}),jsxRuntime.jsx(J,{children:o??(e==="user"?"U":"A")})]}));Lt.displayName="MessageAvatar";var Ot=E.memo(({className:e,children:t,...o})=>jsxRuntime.jsx("div",{className:r("prose prose-sm dark:prose-invert max-w-none",e),...o,children:t}));Ot.displayName="MessageText";var Ht=E.memo(({className:e,children:t,...o})=>jsxRuntime.jsx("div",{className:r("flex flex-col gap-4",e),...o,children:t}));Ht.displayName="MessageGroup";var Dt=E.memo(({className:e,date:t,children:o,...n})=>jsxRuntime.jsx("span",{className:r("text-xs text-muted-foreground",e),...n,children:o??t?.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}));Dt.displayName="MessageTimestamp";var Vr=({className:e,...t})=>jsxRuntime.jsx("form",{className:r("w-full overflow-hidden rounded-2xl border bg-background shadow-xs",e),...t}),Gr=({onChange:e,onKeyDown:t,className:o,placeholder:n="What would you like to know?",minHeight:a=48,maxHeight:p=164,disableAutoResize:l=false,resizeOnNewLinesOnly:i=false,...c})=>{let v=m=>{if(t?.(m),!m.defaultPrevented&&m.key==="Enter"){if(m.nativeEvent.isComposing||m.shiftKey)return;m.preventDefault();let d=m.currentTarget.form;d&&d.requestSubmit();}};return jsxRuntime.jsx(oe,{className:r("w-full resize-none rounded-none border-none p-3 shadow-none outline-hidden ring-0",l||i?"field-sizing-fixed":"field-sizing-content max-h-[6lh]","bg-transparent dark:bg-transparent","focus-visible:ring-0",o),name:"message",onChange:m=>{e?.(m);},onKeyDown:v,placeholder:n,...c})},$r=({className:e,...t})=>jsxRuntime.jsx("div",{className:r("flex items-center justify-between p-1",e),...t}),Ur=({className:e,...t})=>jsxRuntime.jsx("div",{className:r("flex items-center gap-1","[&_button:first-child]:rounded-bl-xl",e),...t}),Wr=({variant:e="ghost",className:t,size:o,...n})=>{let a=o??E.Children.count(n.children)>1?"default":"icon";return jsxRuntime.jsx(N,{className:r("shrink-0 gap-1.5 rounded-lg",e==="ghost"&&"text-muted-foreground",a==="default"&&"px-3",t),size:a,type:"button",variant:e,...n})},_r=({className:e,variant:t="default",size:o="icon",status:n,children:a,...p})=>{let l=jsxRuntime.jsx(lucideReact.SendIcon,{className:"size-4"});return n==="submitted"?l=jsxRuntime.jsx(lucideReact.Loader2Icon,{className:"size-4 animate-spin"}):n==="streaming"?l=jsxRuntime.jsx(lucideReact.SquareIcon,{className:"size-4"}):n==="error"&&(l=jsxRuntime.jsx(lucideReact.XIcon,{className:"size-4"})),jsxRuntime.jsx(N,{className:r("gap-1.5 rounded-lg",e),size:o,type:"submit",variant:t,...p,children:a??l})},Fr=e=>jsxRuntime.jsx(ge,{...e}),qr=({className:e,...t})=>jsxRuntime.jsx(re,{className:r("border-none bg-transparent font-medium text-muted-foreground shadow-none transition-colors","hover:bg-accent hover:text-foreground aria-expanded:bg-accent aria-expanded:text-foreground","h-auto px-2 py-1.5",e),...t}),Kr=({className:e,...t})=>jsxRuntime.jsx(ne,{className:r(e),...t}),Xr=({className:e,...t})=>jsxRuntime.jsx(ae,{className:r(e),...t}),Zr=({className:e,...t})=>jsxRuntime.jsx(he,{className:r(e),...t});var Ue=E.createContext(null),Jt=()=>{let e=E.useContext(Ue);if(!e)throw new Error("ChainOfThought components must be used within ChainOfThought");return e},Yt=E.memo(({className:e,open:t,defaultOpen:o=true,onOpenChange:n,children:a,...p})=>{let[l,i]=reactUseControllableState.useControllableState({prop:t,defaultProp:o,onChange:n});return jsxRuntime.jsx(Ue.Provider,{value:{isOpen:l??true,setIsOpen:i},children:jsxRuntime.jsx(M,{className:r("not-prose border rounded-lg p-4",e),onOpenChange:i,open:l,...p,children:a})})}),Qt=E.memo(({className:e,children:t,...o})=>{let{isOpen:n}=Jt();return jsxRuntime.jsxs(k,{className:r("flex w-full items-center justify-between text-sm font-medium transition-colors hover:text-foreground",e),...o,children:[t??"Chain of Thought",jsxRuntime.jsx(lucideReact.ChevronDownIcon,{className:r("size-4 text-muted-foreground transition-transform",n?"rotate-180":"rotate-0")})]})}),eo=E.memo(({className:e,children:t,...o})=>jsxRuntime.jsx(B,{className:r("mt-4 space-y-3","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in",e),...o,children:t})),to=E.memo(({icon:e,label:t,description:o,status:n="complete",children:a,className:p})=>{let l=n==="complete"?lucideReact.CheckCircleIcon:n==="active"?lucideReact.CircleDotIcon:lucideReact.CircleIcon,i=n==="complete"?"text-green-500":n==="active"?"text-blue-500":"text-muted-foreground",c=e??l;return jsxRuntime.jsxs("div",{className:r("flex gap-3",p),children:[jsxRuntime.jsx("div",{className:"flex-shrink-0 mt-0.5",children:jsxRuntime.jsx(c,{className:r("size-4",i)})}),jsxRuntime.jsxs("div",{className:"flex-1 space-y-1",children:[jsxRuntime.jsx("div",{className:"text-sm font-medium",children:t}),o&&jsxRuntime.jsx("div",{className:"text-xs text-muted-foreground",children:o}),a&&jsxRuntime.jsx("div",{className:"mt-2",children:a})]})]})}),oo=E.memo(({children:e,className:t})=>jsxRuntime.jsx("div",{className:r("space-y-2 mt-2",t),children:e})),ro=E.memo(({children:e,className:t})=>jsxRuntime.jsx("div",{className:r("text-xs bg-muted/50 rounded p-2 border",t),children:e}));Yt.displayName="ChainOfThought";Qt.displayName="ChainOfThoughtHeader";eo.displayName="ChainOfThoughtContent";to.displayName="ChainOfThoughtStep";oo.displayName="ChainOfThoughtSearchResults";ro.displayName="ChainOfThoughtSearchResult";function no({children:e,duration:t=1,active:o=true,className:n}){return o?jsxRuntime.jsx("span",{className:r("inline-block bg-clip-text text-transparent","bg-gradient-to-r from-zinc-400 via-white to-zinc-400","bg-[length:200%_100%]","animate-shimmer",n),style:{animationDuration:`${t}s`},children:e}):jsxRuntime.jsx("span",{className:n,children:e})}var z={xs:{size:30,dotRadius:2,numDots:15},sm:{size:30,dotRadius:1.5,numDots:15},lg:{size:30,dotRadius:1.5,numDots:15},xl:{size:200,dotRadius:3,numDots:100}};function ao({isActive:e,className:t="",size:o="sm",color:n="#a855f7"}){let a=E.useRef(null),p=E.useRef(null);return E.useEffect(()=>{if(!a.current)return;let l=z[o].numDots,i=z[o].size,c=z[o].dotRadius,v=2,m=1.5,d=Math.PI*(3-Math.sqrt(5)),T=i/2,$=T-v-c,w="http://www.w3.org/2000/svg";a.current.innerHTML="";let h=document.createElementNS(w,"svg");h.setAttribute("width",i.toString()),h.setAttribute("height",i.toString()),h.setAttribute("viewBox",`0 0 ${i} ${i}`),h.style.width="100%",h.style.height="100%",h.style.maxWidth=`${z[o].size}px`,h.style.maxHeight=`${z[o].size}px`,a.current.appendChild(h),p.current=h;for(let H=0;H<l;H++){let I=H+.5,U=I/l,X=Math.sqrt(U)*$,Z=I*d,Q=T+X*Math.cos(Z),ee=T+X*Math.sin(Z),y=document.createElementNS(w,"circle");y.setAttribute("cx",Q.toString()),y.setAttribute("cy",ee.toString()),y.setAttribute("r",c.toString()),y.style.fill=n,y.style.opacity="0.6",h.appendChild(y);let P=document.createElementNS(w,"animate");P.setAttribute("attributeName","r"),P.setAttribute("values",`${c*.5};${c*1.5};${c*.5}`),P.setAttribute("dur",`${m}s`),P.setAttribute("begin",`${U*m}s`),P.setAttribute("repeatCount","indefinite"),P.setAttribute("calcMode","spline"),P.setAttribute("keySplines","0.4 0 0.6 1;0.4 0 0.6 1"),y.appendChild(P);let b=document.createElementNS(w,"animate");b.setAttribute("attributeName","opacity"),b.setAttribute("values","0.3;1;0.3"),b.setAttribute("dur",`${m}s`),b.setAttribute("begin",`${U*m}s`),b.setAttribute("repeatCount","indefinite"),b.setAttribute("calcMode","spline"),b.setAttribute("keySplines","0.4 0 0.6 1;0.4 0 0.6 1"),y.appendChild(b);}},[o,n]),E.useEffect(()=>{if(!p.current)return;p.current.querySelectorAll("animate").forEach(i=>{e?i.beginElement():i.endElement();});},[e]),jsxRuntime.jsx("div",{ref:a,className:`flex items-center justify-center ${t}`,style:{width:`${z[o].size}px`,height:`${z[o].size}px`,background:"transparent"}})}var Se=E.memo(({base64:e,uint8Array:t,mediaType:o,className:n,alt:a="Generated image",onClick:p})=>{let l=`data:${o};base64,${e}`;return jsxRuntime.jsx("img",{src:l,alt:a,onClick:p,className:r("h-auto max-w-full overflow-hidden rounded-md",p&&"cursor-pointer hover:opacity-90 transition-opacity",n)})});Se.displayName="ImageCard";var Ke=E.memo(({images:e,className:t,onImageClick:o})=>jsxRuntime.jsx("div",{className:r("grid grid-cols-2 gap-2 md:grid-cols-3",t),children:e.map((n,a)=>jsxRuntime.jsx(Se,{...n,onClick:()=>o?.(n,a)},a))}));Ke.displayName="ImageGrid";var Ze=E.memo(({audioUrl:e,title:t="Untitled",imageUrl:o,videoUrl:n,duration:a,tags:p,likeCount:l=0,isLiked:i=false,onLike:c,showWaveform:v=false,showTitle:m=true,showPlayButton:d=true,className:T="",waveColor:$="#666666",progressColor:w="#ffffff",height:h=60,maxWidth:H="100%",onPlay:I,onPause:U,onEnded:X,onTimeUpdate:Z,onError:Q,autoPlay:ee=false})=>{let[y,P]=E.useState(false),[b,rt]=E.useState(i),[Me,ke]=E.useState(0),[j,nt]=E.useState(0),[at,Be]=E.useState(true),[st,it]=E.useState(null),W=E.useRef(null),ce=E.useRef(null);E.useEffect(()=>{let u=new Audio(e);return W.current=u,u.addEventListener("loadedmetadata",()=>{nt(u.duration),Be(false);}),u.addEventListener("timeupdate",()=>{ke(u.currentTime),Z?.(u.currentTime,u.duration);}),u.addEventListener("ended",()=>{P(false),X?.();}),u.addEventListener("error",me=>{let de=new Error("Failed to load audio");it(de.message),Be(false),Q?.(de);}),ee&&u.play().catch(()=>{}),()=>{u.pause(),u.src="";}},[e,ee,X,Q,Z]);let lt=E.useCallback(()=>{W.current&&(y?(W.current.pause(),P(false),U?.()):W.current.play().then(()=>{P(true),I?.();}).catch(u=>{console.error("Failed to play:",u);}));},[y,U,I]),pt=E.useCallback(u=>{if(!ce.current||!W.current)return;let me=ce.current.getBoundingClientRect(),Ae=(u.clientX-me.left)/me.width*j;W.current.currentTime=Ae,ke(Ae);},[j]),ct=E.useCallback(()=>{rt(!b),c?.();},[b,c]),mt=j>0?Me/j*100:0;return st?jsxRuntime.jsx("div",{className:r("rounded-lg bg-muted p-4 text-sm text-muted-foreground",T),children:"Failed to load audio"}):jsxRuntime.jsxs("div",{className:r("relative overflow-hidden rounded-xl bg-black/90",T),style:{maxWidth:H,height:h},children:[n?jsxRuntime.jsx("video",{src:n,className:"absolute inset-0 h-full w-full object-cover opacity-30",autoPlay:true,muted:true,loop:true,playsInline:true}):o?jsxRuntime.jsx("img",{src:o,alt:"",className:"absolute inset-0 h-full w-full object-cover opacity-30"}):null,jsxRuntime.jsxs("div",{className:"relative flex h-full items-center gap-3 px-3",children:[d&&jsxRuntime.jsx(N,{variant:"ghost",size:"icon",onClick:lt,disabled:at,className:"shrink-0 text-white hover:bg-white/20",children:y?jsxRuntime.jsx(lucideReact.Pause,{className:"size-5"}):jsxRuntime.jsx(lucideReact.Play,{className:"size-5"})}),jsxRuntime.jsxs("div",{className:"flex flex-1 flex-col gap-1 min-w-0",children:[m&&jsxRuntime.jsx("div",{className:"truncate text-sm font-medium text-white",children:t}),jsxRuntime.jsx("div",{ref:ce,onClick:pt,className:"h-1 w-full cursor-pointer rounded-full bg-white/20",children:jsxRuntime.jsx("div",{className:"h-full rounded-full bg-white transition-all",style:{width:`${mt}%`}})}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs text-white/60",children:[jsxRuntime.jsx("span",{children:ue(Me)}),jsxRuntime.jsx("span",{children:ue(j)})]})]}),c&&jsxRuntime.jsx(N,{variant:"ghost",size:"icon",onClick:ct,className:r("shrink-0 hover:bg-white/20",b?"text-red-500":"text-white"),children:jsxRuntime.jsx(lucideReact.Heart,{className:r("size-4",b&&"fill-current")})})]})]})});Ze.displayName="MusicPlayer";var En=({className:e,...t})=>jsxRuntime.jsx(M,{className:r("not-prose mb-4 w-full rounded-md border",e),...t}),bo=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return jsxRuntime.jsxs(ye,{className:"flex items-center gap-1 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":jsxRuntime.jsx(lucideReact.CircleIcon,{className:"size-4"}),"input-available":jsxRuntime.jsx(lucideReact.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":jsxRuntime.jsx(lucideReact.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":jsxRuntime.jsx(lucideReact.XCircleIcon,{className:"size-4 text-red-600"})}[e],jsxRuntime.jsx("span",{children:t[e]})]})},Ln=({className:e,toolName:t,state:o,...n})=>jsxRuntime.jsxs(k,{className:r("group flex w-full min-w-0 items-center justify-between gap-2 p-3",e),...n,children:[jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[jsxRuntime.jsx(lucideReact.WrenchIcon,{className:"size-4 shrink-0 text-muted-foreground"}),jsxRuntime.jsx("span",{className:"truncate font-medium text-sm",children:t})]}),jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[bo(o),jsxRuntime.jsx(lucideReact.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]})]}),On=({className:e,...t})=>jsxRuntime.jsx(B,{className:r("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),Hn=({className:e,input:t,...o})=>jsxRuntime.jsxs("div",{className:r("space-y-2 overflow-hidden p-4",e),...o,children:[jsxRuntime.jsx("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),jsxRuntime.jsx("div",{className:"rounded-md bg-muted/50",children:jsxRuntime.jsx("pre",{className:"overflow-x-auto p-3 font-mono text-xs",children:JSON.stringify(t,null,2)})})]}),Dn=({className:e,output:t,errorText:o,...n})=>t||o?jsxRuntime.jsxs("div",{className:r("space-y-2 p-4",e),...n,children:[jsxRuntime.jsx("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:o?"Error":"Result"}),jsxRuntime.jsxs("div",{className:r("overflow-x-auto rounded-md text-xs [&_table]:w-full",o?"bg-destructive/10 p-3 text-destructive":"bg-muted/50 text-foreground"),children:[o&&jsxRuntime.jsx("div",{children:o}),t&&jsxRuntime.jsx("div",{children:t})]})]}):null;var et=E.createContext(null),No=()=>{let e=E.useContext(et);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},So=500,To=1e3,Ro=E.memo(({className:e,isStreaming:t=false,open:o,defaultOpen:n=true,onOpenChange:a,duration:p,children:l,...i})=>{let[c,v]=reactUseControllableState.useControllableState({prop:o,defaultProp:n,onChange:a}),[m,d]=reactUseControllableState.useControllableState({prop:p,defaultProp:0}),[T,$]=E.useState(false),[w,h]=E.useState(null);E.useEffect(()=>{t?w===null&&h(Date.now()):w!==null&&(d(Math.round((Date.now()-w)/To)),h(null));},[t,w,d]),E.useEffect(()=>{if(n&&!t&&c&&!T){let I=setTimeout(()=>{v(false),$(true);},So);return ()=>clearTimeout(I)}},[t,c,n,v,T]);let H=I=>{v(I);};return jsxRuntime.jsx(et.Provider,{value:{isStreaming:t,isOpen:c??false,setIsOpen:v,duration:m??0},children:jsxRuntime.jsx(M,{className:r("not-prose",e),onOpenChange:H,open:c,...i,children:l})})}),wo=E.memo(({className:e,children:t,...o})=>{let{isStreaming:n,isOpen:a,duration:p}=No();return jsxRuntime.jsx(k,{className:r("flex items-center gap-1.5 text-muted-foreground text-lg transition-colors hover:text-foreground",e),...o,children:t??jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[n||p===0?jsxRuntime.jsx("p",{children:"Thinking..."}):jsxRuntime.jsxs("p",{children:["Thought for ",p,"s"]}),jsxRuntime.jsx(lucideReact.ChevronDownIcon,{className:r("size-3 text-muted-foreground transition-transform",a?"rotate-180":"rotate-0")})]})})}),Io=E.memo(({className:e,children:t,...o})=>jsxRuntime.jsx(B,{className:r("mt-2 text-muted-foreground text-xs","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in",e),...o,children:jsxRuntime.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:t})}));Ro.displayName="Reasoning";wo.displayName="ReasoningTrigger";Io.displayName="ReasoningContent";var tt=E.createContext({code:""}),Jn=({code:e,language:t,showLineNumbers:o=false,className:n,children:a,...p})=>{let l=e.split(`
2
+ `);return jsxRuntime.jsx(tt.Provider,{value:{code:e},children:jsxRuntime.jsxs("div",{className:r("relative w-full overflow-hidden rounded-md border bg-muted/50",n),...p,children:[t&&jsxRuntime.jsx("div",{className:"flex items-center justify-between border-b bg-muted/30 px-4 py-2",children:jsxRuntime.jsx("span",{className:"font-mono text-muted-foreground text-xs",children:t})}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("pre",{className:"overflow-x-auto p-4",children:jsxRuntime.jsx("code",{className:"font-mono text-sm",children:o?l.map((i,c)=>jsxRuntime.jsxs("div",{className:"flex",children:[jsxRuntime.jsx("span",{className:"mr-4 inline-block w-8 select-none text-right text-muted-foreground",children:c+1}),jsxRuntime.jsx("span",{children:i})]},c)):e})}),a&&jsxRuntime.jsx("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:a})]})]})})},Yn=({onCopy:e,onError:t,timeout:o=2e3,children:n,className:a,...p})=>{let[l,i]=E.useState(false),{code:c}=E.useContext(tt),v=async()=>{if(typeof window>"u"||!navigator.clipboard?.writeText){t?.(new Error("Clipboard API not available"));return}try{await navigator.clipboard.writeText(c),i(!0),e?.(),setTimeout(()=>i(!1),o);}catch(d){t?.(d);}},m=l?lucideReact.CheckIcon:lucideReact.CopyIcon;return jsxRuntime.jsx(N,{className:r("shrink-0",a),onClick:v,size:"icon",type:"button",variant:"ghost",...p,children:n??jsxRuntime.jsx(m,{size:14})})},Qn=({className:e,children:t,...o})=>jsxRuntime.jsx("div",{className:r("flex items-center justify-between border-b bg-muted/30 px-4 py-2",e),...o,children:t}),ea=({className:e,children:t,...o})=>jsxRuntime.jsx("span",{className:r("font-mono text-muted-foreground text-xs",e),...o,children:t});var sa=({className:e,...t})=>jsxRuntime.jsx(M,{className:r("not-prose mb-4 text-primary text-xs",e),...t}),ia=({className:e,count:t,children:o,...n})=>jsxRuntime.jsx(k,{className:r("flex items-center gap-2",e),...n,children:o??jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("p",{className:"font-medium",children:["Used ",t," sources"]}),jsxRuntime.jsx(lucideReact.ChevronDownIcon,{className:"size-4"})]})}),la=({className:e,...t})=>jsxRuntime.jsx(B,{className:r("mt-3 flex w-fit flex-col gap-2","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),Do=({href:e,title:t,children:o,className:n,...a})=>jsxRuntime.jsx("a",{className:r("flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",n),href:e,rel:"noreferrer",target:"_blank",...a,children:o??jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.BookIcon,{className:"size-4 shrink-0"}),jsxRuntime.jsx("span",{className:"block font-medium truncate",children:t})]})}),pa=({sources:e,className:t,...o})=>jsxRuntime.jsx("div",{className:r("space-y-2",t),...o,children:e.map((n,a)=>jsxRuntime.jsx(Do,{href:n.url,title:n.title},a))});exports.Avatar=ie;exports.AvatarFallback=J;exports.AvatarImage=le;exports.Badge=ye;exports.Button=N;exports.ChainOfThought=Yt;exports.ChainOfThoughtContent=eo;exports.ChainOfThoughtHeader=Qt;exports.ChainOfThoughtSearchResult=ro;exports.ChainOfThoughtSearchResults=oo;exports.ChainOfThoughtStep=to;exports.ChatContainer=Rt;exports.ChatEmptyState=kt;exports.ChatInputArea=Mt;exports.ChatMessages=wt;exports.ChatScrollButton=It;exports.CodeBlock=Jn;exports.CodeBlockCopyButton=Yn;exports.CodeBlockHeader=Qn;exports.CodeBlockLanguage=ea;exports.Collapsible=M;exports.CollapsibleContent=B;exports.CollapsibleTrigger=k;exports.GeoffThinking=ao;exports.ImageCard=Se;exports.ImageGrid=Ke;exports.MessageAvatar=Lt;exports.MessageContainer=At;exports.MessageContent=Et;exports.MessageGroup=Ht;exports.MessageText=Ot;exports.MessageTimestamp=Dt;exports.MusicPlayer=Ze;exports.PromptInput=Vr;exports.PromptInputButton=Wr;exports.PromptInputModelSelect=Fr;exports.PromptInputModelSelectContent=Kr;exports.PromptInputModelSelectItem=Xr;exports.PromptInputModelSelectTrigger=qr;exports.PromptInputModelSelectValue=Zr;exports.PromptInputSubmit=_r;exports.PromptInputTextarea=Gr;exports.PromptInputToolbar=$r;exports.PromptInputTools=Ur;exports.Reasoning=Ro;exports.ReasoningContent=Io;exports.ReasoningTrigger=wo;exports.Select=ge;exports.SelectContent=ne;exports.SelectGroup=Pt;exports.SelectItem=ae;exports.SelectLabel=ze;exports.SelectScrollDownButton=ve;exports.SelectScrollUpButton=xe;exports.SelectSeparator=Ve;exports.SelectTrigger=re;exports.SelectValue=he;exports.Shimmer=no;exports.Source=Do;exports.SourceList=pa;exports.Sources=sa;exports.SourcesContent=la;exports.SourcesTrigger=ia;exports.Textarea=oe;exports.Tool=En;exports.ToolContent=On;exports.ToolHeader=Ln;exports.ToolInput=Hn;exports.ToolOutput=Dn;exports.badgeVariants=Ge;exports.buttonVariants=Oe;exports.cn=r;exports.formatBytes=$o;exports.formatDuration=ue;exports.truncate=Uo;exports.useReasoning=No;exports.useScrollToBottom=fe;
@@ -0,0 +1,12 @@
1
+ export { AnyMessagePart, Attachment, ChainOfThoughtStepStatus, ChatHelpers, ChatStatus, FilePart, GeneratedImage, LanguageModelUsage, Message, MessagePart, MessageRole, ReasoningPart, SourceReference, TextPart, ToolInvocation, ToolPart, ToolState, ToolUIPart, Vote } from './types/index.cjs';
2
+ export { cn, formatBytes, formatDuration, truncate } from './utils/index.cjs';
3
+ export { UseScrollToBottomOptions, UseScrollToBottomReturn, useScrollToBottom } from './hooks/index.cjs';
4
+ export { Avatar, AvatarFallback, AvatarImage, Badge, BadgeProps, Button, ButtonProps, ChainOfThought, ChainOfThoughtContent, ChainOfThoughtContentProps, ChainOfThoughtHeader, ChainOfThoughtHeaderProps, ChainOfThoughtProps, ChainOfThoughtSearchResult, ChainOfThoughtSearchResultProps, ChainOfThoughtSearchResults, ChainOfThoughtSearchResultsProps, ChainOfThoughtStep, ChainOfThoughtStepProps, ChatContainer, ChatContainerProps, ChatEmptyState, ChatEmptyStateProps, ChatInputArea, ChatInputAreaProps, ChatMessages, ChatMessagesProps, ChatScrollButton, ChatScrollButtonProps, CodeBlock, CodeBlockCopyButton, CodeBlockCopyButtonProps, CodeBlockHeader, CodeBlockHeaderProps, CodeBlockLanguage, CodeBlockLanguageProps, CodeBlockProps, Collapsible, CollapsibleContent, CollapsibleTrigger, GeoffThinking, ImageCard, ImageCardProps, ImageGrid, ImageGridProps, MessageAvatar, MessageAvatarProps, MessageContainer, MessageContainerProps, MessageContent, MessageContentProps, MessageGroup, MessageGroupProps, MessageText, MessageTextProps, MessageTimestamp, MessageTimestampProps, MusicPlayer, MusicPlayerProps, PromptInput, PromptInputButton, PromptInputButtonProps, PromptInputModelSelect, PromptInputModelSelectContent, PromptInputModelSelectContentProps, PromptInputModelSelectItem, PromptInputModelSelectItemProps, PromptInputModelSelectProps, PromptInputModelSelectTrigger, PromptInputModelSelectTriggerProps, PromptInputModelSelectValue, PromptInputModelSelectValueProps, PromptInputProps, PromptInputSubmit, PromptInputSubmitProps, PromptInputTextarea, PromptInputTextareaProps, PromptInputToolbar, PromptInputToolbarProps, PromptInputTools, PromptInputToolsProps, Reasoning, ReasoningContent, ReasoningContentProps, ReasoningProps, ReasoningTrigger, ReasoningTriggerProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Shimmer, ShimmerProps, Source, SourceList, SourceListProps, SourceProps, Sources, SourcesContent, SourcesContentProps, SourcesProps, SourcesTrigger, SourcesTriggerProps, Textarea, ThinkingProps, Tool, ToolContent, ToolContentProps, ToolHeader, ToolHeaderProps, ToolInput, ToolInputProps, ToolOutput, ToolOutputProps, ToolProps, badgeVariants, buttonVariants, useReasoning } from './components/index.cjs';
5
+ import 'clsx';
6
+ import 'class-variance-authority/types';
7
+ import 'react';
8
+ import 'class-variance-authority';
9
+ import '@radix-ui/react-select';
10
+ import '@radix-ui/react-collapsible';
11
+ import '@radix-ui/react-avatar';
12
+ import 'react/jsx-runtime';