{"version":3,"file":"CopilotShell-IhFHZq6I.cjs","names":["ShellStoreProvider","LayoutContextProvider","Lightbulb","Fragment","ArrowUp","isChatEmpty","Carousel","CarouselContent","useTheme","DropdownMenu","IconButton","EllipsisVerticalIcon","Button","Trash2Icon","MenuIcon","IconButton","SquarePen","useShellStore","useComposerState","IconButton","Square","ArrowUp","ArtifactOverlay","useShellStore","MarkDownRenderer","ToolCallComponent","ToolResult","MessageLoadingComponent","MessageProvider","isChatEmpty"],"sources":["../src/components/CopilotShell/Container.tsx","../src/components/CopilotShell/ConversationStarter.tsx","../src/components/CopilotShell/ThreadListContainer.tsx","../src/components/CopilotShell/Header.tsx","../src/components/CopilotShell/components/Composer.tsx","../src/components/CopilotShell/Thread.tsx","../src/components/CopilotShell/WelcomeScreen.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { LayoutContextProvider } from \"../../context/LayoutContext\";\nimport { ShellStoreProvider } from \"../_shared/store\";\n\ninterface ContainerProps {\n  children?: React.ReactNode;\n  logoUrl: string;\n  agentName: string;\n  className?: string;\n  showAssistantLogo?: boolean;\n}\n\nexport const Container = ({\n  children,\n  logoUrl,\n  agentName,\n  className,\n  showAssistantLogo = false,\n}: ContainerProps) => {\n  return (\n    <ShellStoreProvider\n      logoUrl={logoUrl}\n      agentName={agentName}\n      showAssistantLogo={showAssistantLogo}\n    >\n      <LayoutContextProvider layout=\"tray\">\n        <div className={clsx(\"openui-copilot-shell-container\", className)}>{children}</div>\n      </LayoutContextProvider>\n    </ShellStoreProvider>\n  );\n};\n","import { useThread } from \"@openuidev/react-headless\";\nimport clsx from \"clsx\";\nimport { ArrowUp, Lightbulb } from \"lucide-react\";\nimport { Fragment, ReactNode, isValidElement } from \"react\";\nimport { ConversationStarterIcon, ConversationStarterProps } from \"../../types/ConversationStarter\";\nimport { Carousel, CarouselContent } from \"../Carousel\";\nimport { isChatEmpty } from \"../_shared/utils\";\n\nexport type ConversationStarterVariant = \"short\" | \"long\";\n\ninterface ConversationStarterItemProps extends ConversationStarterProps {\n  onClick: (prompt: string) => void;\n  variant: ConversationStarterVariant;\n}\n\n/**\n * Renders the appropriate icon based on the icon prop value\n * - undefined: Show default lightbulb icon\n * - ReactNode: Show the provided icon (use <></> or React.Fragment for no icon)\n */\nconst renderIcon = (icon: ConversationStarterIcon | undefined): ReactNode => {\n  if (icon === undefined) {\n    return <Lightbulb size={16} />;\n  }\n  return icon;\n};\n\nconst hasRenderableIcon = (icon: ReactNode): boolean => {\n  if (icon === null || icon === undefined || icon === false) {\n    return false;\n  }\n\n  if (isValidElement<{ children?: ReactNode }>(icon) && icon.type === Fragment) {\n    return Boolean(icon.props.children);\n  }\n\n  return true;\n};\n\nconst ConversationStarterItem = ({\n  displayText,\n  prompt,\n  onClick,\n  variant,\n  icon,\n}: ConversationStarterItemProps) => {\n  const renderedIcon = renderIcon(icon);\n  const shouldRenderIcon = hasRenderableIcon(renderedIcon);\n\n  if (variant === \"short\") {\n    return (\n      <button\n        type=\"button\"\n        className=\"openui-copilot-shell-conversation-starter-item-short\"\n        onClick={() => onClick(prompt)}\n      >\n        {shouldRenderIcon && (\n          <span className=\"openui-copilot-shell-conversation-starter-item-short__icon\">\n            {renderedIcon}\n          </span>\n        )}\n        <span className=\"openui-copilot-shell-conversation-starter-item-short__text\">\n          {displayText}\n        </span>\n      </button>\n    );\n  }\n\n  // Long variant (detailed list style)\n  return (\n    <button\n      type=\"button\"\n      className=\"openui-copilot-shell-conversation-starter-item-long\"\n      onClick={() => onClick(prompt)}\n    >\n      <div className=\"openui-copilot-shell-conversation-starter-item-long__content\">\n        {shouldRenderIcon && (\n          <span className=\"openui-copilot-shell-conversation-starter-item-long__icon\">\n            {renderedIcon}\n          </span>\n        )}\n        <span className=\"openui-copilot-shell-conversation-starter-item-long__text\">\n          {displayText}\n        </span>\n      </div>\n      <span className=\"openui-copilot-shell-conversation-starter-item-long__arrow\">\n        <ArrowUp size={16} />\n      </span>\n    </button>\n  );\n};\n\nexport interface ConversationStarterContainerProps {\n  starters: ConversationStarterProps[];\n  className?: string;\n  /**\n   * Variant of the conversation starter\n   * - \"short\": Pill-style horizontal buttons (default)\n   * - \"long\": List items with icons and hover arrow\n   */\n  variant?: ConversationStarterVariant;\n}\n\nexport const ConversationStarter = ({\n  starters,\n  className,\n  variant = \"short\",\n}: ConversationStarterContainerProps) => {\n  const processMessage = useThread((s) => s.processMessage);\n  const isRunning = useThread((s) => s.isRunning);\n  const messages = useThread((s) => s.messages);\n  const isLoadingMessages = useThread((s) => s.isLoadingMessages);\n\n  const handleClick = (prompt: string) => {\n    if (isRunning) return;\n    processMessage({\n      role: \"user\",\n      content: prompt,\n    });\n  };\n\n  // Only show when there are no messages\n  if (!isChatEmpty({ isLoadingMessages, messages })) {\n    return null;\n  }\n\n  if (starters.length === 0) {\n    return null;\n  }\n\n  if (variant === \"short\") {\n    return (\n      <Carousel\n        showButtons={false}\n        className={clsx(\n          \"openui-copilot-shell-conversation-starter\",\n          \"openui-copilot-shell-conversation-starter--short\",\n          className,\n        )}\n      >\n        <CarouselContent className=\"openui-copilot-shell-conversation-starter__carousel-content\">\n          {starters.map((item, index) => (\n            <ConversationStarterItem\n              key={`${item.displayText}-${index}`}\n              displayText={item.displayText}\n              prompt={item.prompt}\n              icon={item.icon}\n              onClick={handleClick}\n              variant={variant}\n            />\n          ))}\n        </CarouselContent>\n      </Carousel>\n    );\n  }\n\n  return (\n    <div\n      className={clsx(\n        \"openui-copilot-shell-conversation-starter\",\n        `openui-copilot-shell-conversation-starter--${variant}`,\n        className,\n      )}\n    >\n      {starters.map((item, index) => (\n        <Fragment key={`${item.displayText}-${index}`}>\n          <ConversationStarterItem\n            displayText={item.displayText}\n            prompt={item.prompt}\n            icon={item.icon}\n            onClick={handleClick}\n            variant={variant}\n          />\n        </Fragment>\n      ))}\n    </div>\n  );\n};\n\nexport default ConversationStarter;\n","import { useThreadList } from \"@openuidev/react-headless\";\nimport * as DropdownMenu from \"@radix-ui/react-dropdown-menu\";\nimport clsx from \"clsx\";\nimport { EllipsisVerticalIcon, MenuIcon, Trash2Icon } from \"lucide-react\";\nimport { useEffect } from \"react\";\nimport { Button } from \"../Button\";\nimport { IconButton } from \"../IconButton\";\nimport { useTheme } from \"../ThemeProvider\";\n\nconst ThreadItem = ({\n  title,\n  isSelected,\n  onSelect,\n  onDelete,\n}: {\n  title: string;\n  isSelected: boolean;\n  onSelect: () => void;\n  onDelete: () => void;\n}) => {\n  const { portalThemeClassName } = useTheme();\n  return (\n    <div\n      className={clsx(\"openui-copilot-shell-thread-item\", {\n        \"openui-copilot-shell-thread-item--selected\": isSelected,\n      })}\n    >\n      <button className=\"openui-copilot-shell-thread-item-title\" onClick={onSelect}>\n        {title}\n      </button>\n      <DropdownMenu.Root>\n        <DropdownMenu.Trigger asChild>\n          <IconButton\n            icon={<EllipsisVerticalIcon size=\"1em\" />}\n            aria-label={`More actions for ${title}`}\n            variant=\"tertiary\"\n            size=\"extra-small\"\n            className=\"openui-copilot-shell-thread-item-menu-trigger\"\n          />\n        </DropdownMenu.Trigger>\n        <DropdownMenu.Portal>\n          <DropdownMenu.Content\n            className={clsx(\"openui-copilot-shell-thread-item-menu\", portalThemeClassName)}\n            side=\"right\"\n            align=\"start\"\n            sideOffset={4}\n          >\n            <DropdownMenu.Item\n              asChild\n              onSelect={(e) => {\n                e.stopPropagation();\n                onDelete();\n              }}\n            >\n              <Button\n                type=\"button\"\n                variant=\"tertiary\"\n                buttonType=\"destructive\"\n                size=\"small\"\n                iconLeft={<Trash2Icon size={14} />}\n                className=\"openui-copilot-shell-thread-item-menu-action\"\n              >\n                Delete\n              </Button>\n            </DropdownMenu.Item>\n          </DropdownMenu.Content>\n        </DropdownMenu.Portal>\n      </DropdownMenu.Root>\n    </div>\n  );\n};\n\nexport const ThreadListContainer = () => {\n  const threads = useThreadList((s) => s.threads);\n  const selectedThreadId = useThreadList((s) => s.selectedThreadId);\n  const loadThreads = useThreadList((s) => s.loadThreads);\n  const selectThread = useThreadList((s) => s.selectThread);\n  const deleteThread = useThreadList((s) => s.deleteThread);\n  const { portalThemeClassName } = useTheme();\n\n  useEffect(() => {\n    loadThreads();\n  }, [loadThreads]);\n\n  return (\n    <DropdownMenu.Root>\n      <DropdownMenu.Trigger asChild>\n        <IconButton\n          icon={<MenuIcon size=\"1em\" />}\n          variant=\"tertiary\"\n          aria-label=\"Thread list\"\n          className=\"openui-copilot-shell-thread-list-trigger\"\n        />\n      </DropdownMenu.Trigger>\n      <DropdownMenu.Portal>\n        <DropdownMenu.Content\n          className={clsx(\"openui-copilot-shell-thread-list-dropdown\", portalThemeClassName)}\n          side=\"bottom\"\n          align=\"end\"\n          sideOffset={8}\n        >\n          <div className=\"openui-copilot-shell-thread-list-header\">All threads</div>\n          <div className=\"openui-copilot-shell-thread-list-items\">\n            {threads.map((thread) => (\n              <ThreadItem\n                key={thread.id}\n                title={thread.title}\n                isSelected={selectedThreadId === thread.id}\n                onSelect={() => selectThread(thread.id)}\n                onDelete={() => deleteThread(thread.id)}\n              />\n            ))}\n            {threads.length === 0 && (\n              <div className=\"openui-copilot-shell-thread-list-empty\">No threads yet</div>\n            )}\n          </div>\n        </DropdownMenu.Content>\n      </DropdownMenu.Portal>\n    </DropdownMenu.Root>\n  );\n};\n","import { useThreadList } from \"@openuidev/react-headless\";\nimport clsx from \"clsx\";\nimport { SquarePen } from \"lucide-react\";\nimport { ReactNode } from \"react\";\nimport { IconButton } from \"../IconButton\";\nimport { useShellStore } from \"../_shared/store\";\nimport { ThreadListContainer } from \"./ThreadListContainer\";\n\nexport const CopilotNewChatButton = () => {\n  const switchToNewThread = useThreadList((s) => s.switchToNewThread);\n\n  return (\n    <IconButton\n      icon={<SquarePen size=\"1em\" />}\n      onClick={switchToNewThread}\n      variant=\"tertiary\"\n      aria-label=\"New chat\"\n      className=\"openui-copilot-shell-header-new-chat-button\"\n    />\n  );\n};\n\ninterface HeaderProps {\n  className?: string;\n  /** Custom content to render on the rightmost side of the logo container */\n  rightChildren?: ReactNode;\n  /** Hide the new chat button */\n  hideNewChatButton?: boolean;\n  /** Hide the thread list container */\n  hideThreadListContainer?: boolean;\n}\n\nexport const Header = ({\n  className,\n  rightChildren,\n  hideNewChatButton = false,\n  hideThreadListContainer = false,\n}: HeaderProps) => {\n  const { logoUrl, agentName } = useShellStore((state) => ({\n    logoUrl: state.logoUrl,\n    agentName: state.agentName,\n  }));\n\n  const shouldRenderActions = rightChildren || !hideThreadListContainer || !hideNewChatButton;\n\n  return (\n    <div className={clsx(\"openui-copilot-shell-header\", className)}>\n      <div className=\"openui-copilot-shell-header-logo-container\">\n        <img className=\"openui-copilot-shell-header-logo\" src={logoUrl} alt=\"Logo\" />\n        <span className=\"openui-copilot-shell-header-agent-name\">{agentName}</span>\n      </div>\n      {shouldRenderActions && (\n        <div className=\"openui-copilot-shell-header-actions\">\n          {rightChildren}\n          {!hideThreadListContainer && <ThreadListContainer />}\n          {!hideNewChatButton && <CopilotNewChatButton />}\n        </div>\n      )}\n    </div>\n  );\n};\n","import { useThread } from \"@openuidev/react-headless\";\nimport clsx from \"clsx\";\nimport { ArrowUp, Square } from \"lucide-react\";\nimport { useLayoutEffect, useRef } from \"react\";\nimport { useComposerState } from \"../../../hooks/useComposerState\";\nimport { IconButton } from \"../../IconButton\";\n\nexport interface ComposerProps {\n  className?: string;\n  placeholder?: string;\n}\n\nexport const Composer = ({ className, placeholder = \"Type your message...\" }: ComposerProps) => {\n  const { textContent, setTextContent } = useComposerState();\n  const processMessage = useThread((s) => s.processMessage);\n  const cancelMessage = useThread((s) => s.cancelMessage);\n  const isRunning = useThread((s) => s.isRunning);\n  const isLoadingMessages = useThread((s) => s.isLoadingMessages);\n  const inputRef = useRef<HTMLTextAreaElement>(null);\n\n  const handleSubmit = () => {\n    if (!textContent.trim() || isRunning || isLoadingMessages) {\n      return;\n    }\n\n    processMessage({\n      role: \"user\",\n      content: textContent,\n    });\n\n    setTextContent(\"\");\n  };\n\n  useLayoutEffect(() => {\n    const input = inputRef.current;\n    if (!input) return;\n\n    // Reset to 0 (not \"auto\") so scrollHeight reflects content, not container\n    input.style.height = \"0px\";\n    input.style.height = `${Math.max(input.scrollHeight, 24)}px`;\n  }, [textContent]);\n\n  return (\n    <div\n      className={clsx(\"openui-copilot-shell-thread-composer\", className)}\n      data-drafting={textContent.length > 0 || undefined}\n      onClick={(e) => {\n        if (!(e.target as HTMLElement).closest(\"button, a, [role='button']\")) {\n          inputRef.current?.focus();\n        }\n      }}\n    >\n      <div className=\"openui-copilot-shell-thread-composer__input-wrapper\">\n        <textarea\n          ref={inputRef}\n          value={textContent}\n          onChange={(e) => setTextContent(e.target.value)}\n          className=\"openui-copilot-shell-thread-composer__input\"\n          placeholder={placeholder}\n          rows={1}\n          onKeyDown={(e) => {\n            if (e.key === \"Enter\" && !e.shiftKey) {\n              e.preventDefault();\n              handleSubmit();\n            }\n          }}\n        />\n        <div className=\"openui-copilot-shell-thread-composer__action-bar\">\n          <IconButton\n            onClick={isRunning ? cancelMessage : handleSubmit}\n            icon={isRunning ? <Square size=\"1em\" fill=\"currentColor\" /> : <ArrowUp size=\"1em\" />}\n            size=\"extra-small\"\n            variant=\"primary\"\n            aria-label={isRunning ? \"Cancel message\" : \"Send message\"}\n            className=\"openui-copilot-shell-thread-composer__submit-button\"\n          />\n        </div>\n      </div>\n    </div>\n  );\n};\n\nexport default Composer;\n","import type { AssistantMessage, Message, ToolMessage } from \"@openuidev/react-headless\";\nimport { MessageProvider, useThread } from \"@openuidev/react-headless\";\nimport clsx from \"clsx\";\nimport React, { memo, useRef } from \"react\";\nimport { ScrollVariant, useScrollToBottom } from \"../../hooks/useScrollToBottom\";\nimport { ArtifactOverlay } from \"../_shared/artifact\";\nimport { useShellStore } from \"../_shared/store\";\nimport type { AssistantMessageComponent, UserMessageComponent } from \"../_shared/types\";\nimport { MarkDownRenderer } from \"../MarkDownRenderer\";\nimport { MessageLoading as MessageLoadingComponent } from \"../MessageLoading\";\nimport { ToolCallComponent } from \"../ToolCall\";\nimport { ToolResult } from \"../ToolResult\";\n\nexport const ThreadContainer = ({\n  children,\n  className,\n}: {\n  children?: React.ReactNode;\n  className?: string;\n}) => {\n  const isLoadingMessages = useThread((s) => s.isLoadingMessages);\n\n  return (\n    <div\n      className={clsx(\"openui-copilot-shell-thread-container\", className)}\n      style={{\n        visibility: isLoadingMessages ? \"hidden\" : undefined,\n      }}\n    >\n      {children}\n      <ArtifactOverlay />\n    </div>\n  );\n};\n\nexport const ScrollArea = ({\n  children,\n  className,\n  scrollVariant = \"user-message-anchor\",\n  userMessageSelector = \".openui-copilot-shell-thread-message-user\",\n}: {\n  children?: React.ReactNode;\n  className?: string;\n  /**\n   * Scroll to bottom once the last message is added\n   */\n  scrollVariant?: ScrollVariant;\n  /**\n   * Selector for the user message\n   */\n  userMessageSelector?: string;\n}) => {\n  const ref = useRef<HTMLDivElement>(null);\n\n  const messages = useThread((s) => s.messages);\n  const isRunning = useThread((s) => s.isRunning);\n  const isLoadingMessages = useThread((s) => s.isLoadingMessages);\n\n  useScrollToBottom({\n    ref,\n    lastMessage: messages[messages.length - 1] || { id: \"\" },\n    scrollVariant,\n    userMessageSelector,\n    isRunning,\n    isLoadingMessages,\n  });\n\n  return (\n    <div className=\"openui-copilot-shell-thread-scroll-container\">\n      <div\n        ref={ref}\n        className={clsx(\n          \"openui-copilot-shell-thread-scroll-area\",\n          {\n            \"openui-copilot-shell-thread-scroll-area--user-message-anchor\":\n              scrollVariant === \"user-message-anchor\",\n          },\n          className,\n        )}\n      >\n        {children}\n      </div>\n    </div>\n  );\n};\n\nexport const AssistantMessageContainer = ({\n  children,\n  className,\n}: {\n  children?: React.ReactNode;\n  className?: string;\n}) => {\n  const { logoUrl, showAssistantLogo } = useShellStore((store) => ({\n    logoUrl: store.logoUrl,\n    showAssistantLogo: store.showAssistantLogo,\n  }));\n\n  return (\n    <div className={clsx(\"openui-copilot-shell-thread-message-assistant\", className)}>\n      {showAssistantLogo && (\n        <img\n          src={logoUrl}\n          alt=\"Assistant\"\n          className=\"openui-copilot-shell-thread-message-assistant__logo\"\n        />\n      )}\n      <div className=\"openui-copilot-shell-thread-message-assistant__content\">{children}</div>\n    </div>\n  );\n};\n\nexport const UserMessageContainer = ({\n  children,\n  className,\n}: {\n  children?: React.ReactNode;\n  className?: string;\n}) => {\n  return (\n    <div className={clsx(\"openui-copilot-shell-thread-message-user\", className)}>\n      <div className=\"openui-copilot-shell-thread-message-user__content\">{children}</div>\n    </div>\n  );\n};\n\nconst AssistantMessageContent = ({\n  message,\n  allMessages,\n}: {\n  message: AssistantMessage;\n  allMessages: Message[];\n}) => {\n  const getToolName = (toolCallId: string) => {\n    const toolCall = message.toolCalls?.find((tc) => tc.id === toolCallId);\n    return toolCall?.function.name;\n  };\n\n  const toolMessages: ToolMessage[] = [];\n  const msgIndex = allMessages.findIndex((m) => m.id === message.id);\n  if (msgIndex !== -1) {\n    for (let i = msgIndex + 1; i < allMessages.length; i++) {\n      const m = allMessages[i];\n      if (m && m.role === \"tool\") {\n        toolMessages.push(m as ToolMessage);\n      } else {\n        break;\n      }\n    }\n  }\n\n  return (\n    <>\n      {message.content && (\n        <MarkDownRenderer\n          textMarkdown={message.content}\n          className=\"openui-copilot-shell-thread-message-assistant__text\"\n        />\n      )}\n      {message.toolCalls?.map((toolCall) => (\n        <ToolCallComponent key={toolCall.id} toolCall={toolCall} />\n      ))}\n      {toolMessages.map((tm) => (\n        <ToolResult key={tm.id} message={tm} toolName={getToolName(tm.toolCallId)} />\n      ))}\n    </>\n  );\n};\n\nconst UserMessageContent = ({ message }: { message: Message }) => {\n  if (message.role !== \"user\") return null;\n  const content = message.content;\n  if (typeof content === \"string\") {\n    return <>{content}</>;\n  }\n  return (\n    <>\n      {content?.map((part, i) => {\n        if (part.type === \"text\") {\n          return <span key={i}>{part.text}</span>;\n        }\n        if (part.type === \"binary\" && part.url) {\n          return (\n            <img\n              key={i}\n              src={part.url}\n              alt=\"\"\n              className=\"openui-copilot-shell-thread-message-user__image\"\n            />\n          );\n        }\n        return null;\n      })}\n    </>\n  );\n};\n\nexport const RenderMessage = memo(\n  ({\n    message,\n    className,\n    allMessages,\n    assistantMessage: CustomAssistantMessage,\n    userMessage: CustomUserMessage,\n    isStreaming,\n  }: {\n    message: Message;\n    className?: string;\n    allMessages: Message[];\n    assistantMessage?: AssistantMessageComponent;\n    userMessage?: UserMessageComponent;\n    isStreaming: boolean;\n  }) => {\n    if (message.role === \"tool\") {\n      return null;\n    }\n\n    if (message.role === \"assistant\") {\n      if (CustomAssistantMessage) {\n        return <CustomAssistantMessage message={message} isStreaming={isStreaming} />;\n      }\n      return (\n        <AssistantMessageContainer className={className}>\n          <AssistantMessageContent message={message} allMessages={allMessages} />\n        </AssistantMessageContainer>\n      );\n    }\n\n    if (message.role === \"user\") {\n      if (CustomUserMessage) {\n        return <CustomUserMessage message={message} />;\n      }\n      return (\n        <UserMessageContainer className={className}>\n          <UserMessageContent message={message} />\n        </UserMessageContainer>\n      );\n    }\n\n    return null;\n  },\n);\n\nexport const MessageLoading = () => {\n  return (\n    <div className=\"openui-copilot-shell-thread-message-loading\">\n      <MessageLoadingComponent />\n    </div>\n  );\n};\n\nexport const Messages = ({\n  className,\n  loader,\n  assistantMessage,\n  userMessage,\n}: {\n  className?: string;\n  loader?: React.ReactNode;\n  assistantMessage?: AssistantMessageComponent;\n  userMessage?: UserMessageComponent;\n}) => {\n  const messages = useThread((s) => s.messages);\n  const isRunning = useThread((s) => s.isRunning);\n\n  return (\n    <div className={clsx(\"openui-copilot-shell-thread-messages\", className)}>\n      {messages.map((message, i) => {\n        return (\n          <MessageProvider key={message.id} message={message}>\n            <RenderMessage\n              message={message}\n              allMessages={messages}\n              assistantMessage={assistantMessage}\n              userMessage={userMessage}\n              isStreaming={isRunning && i === messages.length - 1}\n            />\n          </MessageProvider>\n        );\n      })}\n      {isRunning && <div>{loader}</div>}\n    </div>\n  );\n};\n\n// Re-export Composer from components\nexport { Composer } from \"./components\";\n","import { useThread } from \"@openuidev/react-headless\";\nimport clsx from \"clsx\";\nimport { ReactNode } from \"react\";\nimport { isChatEmpty } from \"../_shared/utils\";\n\ninterface WelcomeScreenBaseProps {\n  /**\n   * Additional CSS class name\n   */\n  className?: string;\n}\n\ninterface WelcomeScreenWithContentProps extends WelcomeScreenBaseProps {\n  /**\n   * The greeting/title text to display\n   */\n  title?: string;\n  /**\n   * Optional description text to add more context\n   */\n  description?: string;\n  /**\n   * Image to display - can be a URL object or a ReactNode\n   * - { url: string }: Renders an <img> tag with default styling (64x64, object-fit: cover, rounded)\n   * - ReactNode: Renders the provided element directly (for custom icons, styled images, etc.)\n   */\n  image?: { url: string } | ReactNode;\n  /**\n   * Children are not allowed when using props-based content\n   */\n  children?: never;\n}\n\ninterface WelcomeScreenWithChildrenProps extends WelcomeScreenBaseProps {\n  /**\n   * Custom content to render inside the welcome screen\n   * When children are provided, title, description, and image are ignored\n   */\n  children: ReactNode;\n  title?: never;\n  description?: never;\n  image?: never;\n}\n\nexport type WelcomeScreenProps = WelcomeScreenWithContentProps | WelcomeScreenWithChildrenProps;\n\n/**\n * Type guard to check if image is a URL object\n */\nconst isImageUrl = (image: { url: string } | ReactNode): image is { url: string } => {\n  return typeof image === \"object\" && image !== null && \"url\" in image;\n};\n\nexport const WelcomeScreen = (props: WelcomeScreenProps) => {\n  const { className } = props;\n\n  const messages = useThread((s) => s.messages);\n  const isLoadingMessages = useThread((s) => s.isLoadingMessages);\n\n  // Only show when there are no messages\n  if (!isChatEmpty({ isLoadingMessages, messages })) {\n    return null;\n  }\n\n  // Check if children are provided\n  if (\"children\" in props && props.children) {\n    return (\n      <div className={clsx(\"openui-copilot-shell-welcome-screen\", className)}>{props.children}</div>\n    );\n  }\n\n  // Props-based content\n  const { title, description, image } = props as WelcomeScreenWithContentProps;\n\n  const renderImage = () => {\n    if (!image) return null;\n\n    if (isImageUrl(image)) {\n      return (\n        <img\n          src={image.url}\n          alt={title || \"\"}\n          className=\"openui-copilot-shell-welcome-screen__image\"\n        />\n      );\n    }\n\n    return image;\n  };\n\n  return (\n    <div className={clsx(\"openui-copilot-shell-welcome-screen\", className)}>\n      {image && (\n        <div className=\"openui-copilot-shell-welcome-screen__image-container\">{renderImage()}</div>\n      )}\n      {(title || description) && (\n        <div className=\"openui-copilot-shell-welcome-screen__content\">\n          {title && <h2 className=\"openui-copilot-shell-welcome-screen__title\">{title}</h2>}\n          {description && (\n            <p className=\"openui-copilot-shell-welcome-screen__description\">{description}</p>\n          )}\n        </div>\n      )}\n    </div>\n  );\n};\n\nexport default WelcomeScreen;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAYA,MAAa,aAAa,EACxB,UACA,SACA,WACA,WACA,oBAAoB,YACA;AACpB,QACE,iBAAA,GAAA,kBAAA,KAACA,wBAAAA,oBAAD;EACW;EACE;EACQ;YAEnB,iBAAA,GAAA,kBAAA,KAACC,sBAAAA,uBAAD;GAAuB,QAAO;aAC5B,iBAAA,GAAA,kBAAA,KAAC,OAAD;IAAK,YAAA,GAAA,KAAA,SAAgB,kCAAkC,UAAU;IAAG;IAAe,CAAA;GAC7D,CAAA;EACL,CAAA;;;;;;;;;ACRzB,MAAM,cAAc,SAAyD;AAC3E,KAAI,SAAS,KAAA,EACX,QAAO,iBAAA,GAAA,kBAAA,KAACC,aAAAA,WAAD,EAAW,MAAM,IAAM,CAAA;AAEhC,QAAO;;AAGT,MAAM,qBAAqB,SAA6B;AACtD,KAAI,SAAS,QAAQ,SAAS,KAAA,KAAa,SAAS,MAClD,QAAO;AAGT,MAAA,GAAA,MAAA,gBAA6C,KAAK,IAAI,KAAK,SAASC,MAAAA,SAClE,QAAO,QAAQ,KAAK,MAAM,SAAS;AAGrC,QAAO;;AAGT,MAAM,2BAA2B,EAC/B,aACA,QACA,SACA,SACA,WACkC;CAClC,MAAM,eAAe,WAAW,KAAK;CACrC,MAAM,mBAAmB,kBAAkB,aAAa;AAExD,KAAI,YAAY,QACd,QACE,iBAAA,GAAA,kBAAA,MAAC,UAAD;EACE,MAAK;EACL,WAAU;EACV,eAAe,QAAQ,OAAO;YAHhC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