/**
 * AUTO-GENERATED FILE - DO NOT EDIT.
 * Generated from custom-elements manifest.
 */

import React from 'react';
import { AiActivityHalo as AiActivityHaloWC } from './esm/components/activity-halo/activity-halo.js';
import { AgentPicker as AgentPickerWC } from './esm/components/agent-picker/agent-picker.js';
import { AiChatBubble as AiChatBubbleWC } from './esm/components/chat-bubble/chat-bubble.js';
import { AiChatInteractionWrapper as AiChatInteractionWrapperWC } from './esm/components/chat-interaction-wrapper/chat-interaction-wrapper.js';
import { AiChatMarkdown as AiChatMarkdownWC } from './esm/components/chat-markdown/chat-markdown.js';
import { AiFlowingWavesIndicator as AiFlowingWavesIndicatorWC } from './esm/components/flowing-waves-indicator.js';
import { AiHaloOverlay as AiHaloOverlayWC } from './esm/components/halo-overlay.js';
import { AiPlasmaOrbIndicator as AiPlasmaOrbIndicatorWC } from './esm/components/plasma-orb-indicator.js';
import { FoundationAiPopoutManager as FoundationAiPopoutManagerWC } from './esm/components/popout-manager/popout-manager.js';
import { AiWavesIndicator as AiWavesIndicatorWC } from './esm/components/waves-indicator.js';
import { FoundationAiAssistant as FoundationAiAssistantWC } from './esm/main/main.js';
import { ChatSuggestions as ChatSuggestionsWC } from './esm/suggestions/chat-suggestions.js';

function _mergeRefs(...refs) {
  return (value) => {
    for (const ref of refs) {
      if (typeof ref === 'function') ref(value);
      else if (ref != null) ref.current = value;
    }
  };
}

export const AiFlowingWavesIndicator = React.forwardRef(function AiFlowingWavesIndicator(props, ref) {
  const { children, ...rest } = props;
  return React.createElement(customElements.getName(AiFlowingWavesIndicatorWC) ?? 'ai-flowing-waves-indicator', { ...rest, ref }, children);
});

export const AiHaloOverlay = React.forwardRef(function AiHaloOverlay(props, ref) {
  const { children, ...rest } = props;
  return React.createElement(customElements.getName(AiHaloOverlayWC) ?? 'ai-halo-overlay', { ...rest, ref }, children);
});

export const AiPlasmaOrbIndicator = React.forwardRef(function AiPlasmaOrbIndicator(props, ref) {
  const { children, ...rest } = props;
  return React.createElement(customElements.getName(AiPlasmaOrbIndicatorWC) ?? 'ai-plasma-orb-indicator', { ...rest, ref }, children);
});

export const AiWavesIndicator = React.forwardRef(function AiWavesIndicator(props, ref) {
  const { children, ...rest } = props;
  return React.createElement(customElements.getName(AiWavesIndicatorWC) ?? 'ai-waves-indicator', { ...rest, ref }, children);
});

export const FoundationAiAssistant = React.forwardRef(function FoundationAiAssistant(props, ref) {
  const { onChatHeaderMousedown, onSessionCleared, children, ...rest } = props;
  const _innerRef = React.useRef(null);
  const _onChatHeaderMousedownRef = React.useRef(onChatHeaderMousedown);
  _onChatHeaderMousedownRef.current = onChatHeaderMousedown;
  const _onSessionClearedRef = React.useRef(onSessionCleared);
  _onSessionClearedRef.current = onSessionCleared;
  React.useLayoutEffect(() => {
    const el = _innerRef.current;
    if (!el) return;
    const _onChatHeaderMousedownFn = (e) => _onChatHeaderMousedownRef.current?.(e);
    el.addEventListener('chat-header-mousedown', _onChatHeaderMousedownFn);
    const _onSessionClearedFn = (e) => _onSessionClearedRef.current?.(e);
    el.addEventListener('session-cleared', _onSessionClearedFn);
    return () => {
      el.removeEventListener('chat-header-mousedown', _onChatHeaderMousedownFn);
      el.removeEventListener('session-cleared', _onSessionClearedFn);
    };
  }, []);
  return React.createElement(customElements.getName(FoundationAiAssistantWC) ?? 'foundation-ai-assistant', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
});

export const ChatSuggestions = React.forwardRef(function ChatSuggestions(props, ref) {
  const { children, ...rest } = props;
  return React.createElement(customElements.getName(ChatSuggestionsWC) ?? 'chat-suggestions', { ...rest, ref }, children);
});

export const AiActivityHalo = React.forwardRef(function AiActivityHalo(props, ref) {
  const { children, ...rest } = props;
  return React.createElement(customElements.getName(AiActivityHaloWC) ?? 'ai-activity-halo', { ...rest, ref }, children);
});

export const AgentPicker = React.forwardRef(function AgentPicker(props, ref) {
  const { onAgentPinned, children, ...rest } = props;
  const _innerRef = React.useRef(null);
  const _onAgentPinnedRef = React.useRef(onAgentPinned);
  _onAgentPinnedRef.current = onAgentPinned;
  React.useLayoutEffect(() => {
    const el = _innerRef.current;
    if (!el) return;
    const _onAgentPinnedFn = (e) => _onAgentPinnedRef.current?.(e);
    el.addEventListener('agent-pinned', _onAgentPinnedFn);
    return () => {
      el.removeEventListener('agent-pinned', _onAgentPinnedFn);
    };
  }, []);
  return React.createElement(customElements.getName(AgentPickerWC) ?? 'foundation-ai-agent-picker', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
});

export const AiChatBubble = React.forwardRef(function AiChatBubble(props, ref) {
  const { children, ...rest } = props;
  return React.createElement(customElements.getName(AiChatBubbleWC) ?? 'foundation-ai-chat-bubble', { ...rest, ref }, children);
});

export const AiChatInteractionWrapper = React.forwardRef(function AiChatInteractionWrapper(props, ref) {
  const { onRequestScrollToBottom, onInteractionCompleted, children, ...rest } = props;
  const _innerRef = React.useRef(null);
  const _onRequestScrollToBottomRef = React.useRef(onRequestScrollToBottom);
  _onRequestScrollToBottomRef.current = onRequestScrollToBottom;
  const _onInteractionCompletedRef = React.useRef(onInteractionCompleted);
  _onInteractionCompletedRef.current = onInteractionCompleted;
  React.useLayoutEffect(() => {
    const el = _innerRef.current;
    if (!el) return;
    const _onRequestScrollToBottomFn = (e) => _onRequestScrollToBottomRef.current?.(e);
    el.addEventListener('request-scroll-to-bottom', _onRequestScrollToBottomFn);
    const _onInteractionCompletedFn = (e) => _onInteractionCompletedRef.current?.(e);
    el.addEventListener('interaction-completed', _onInteractionCompletedFn);
    return () => {
      el.removeEventListener('request-scroll-to-bottom', _onRequestScrollToBottomFn);
      el.removeEventListener('interaction-completed', _onInteractionCompletedFn);
    };
  }, []);
  return React.createElement(customElements.getName(AiChatInteractionWrapperWC) ?? 'ai-chat-interaction-wrapper', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
});

export const FoundationAiPopoutManager = React.forwardRef(function FoundationAiPopoutManager(props, ref) {
  const { children, ...rest } = props;
  return React.createElement(customElements.getName(FoundationAiPopoutManagerWC) ?? 'foundation-ai-popout-manager', { ...rest, ref }, children);
});

export const AiChatMarkdown = React.forwardRef(function AiChatMarkdown(props, ref) {
  const { children, ...rest } = props;
  return React.createElement(customElements.getName(AiChatMarkdownWC) ?? 'ai-chat-markdown', { ...rest, ref }, children);
});
