'use client';

/**
 * @djangocfg/ui-tools — Chat
 *
 * Root barrel: the shared light surface (`./public`) + the heavy,
 * synchronously-loaded UI surface (components + launcher).
 *
 * Decomposed, transport-agnostic chat. See @dev/@refactoring7-chat/ for design.
 */

// Light surface — types, constants, core, transport, hooks, notifier,
// payload-dispatch, logger, utils, styles, context.
export * from './public';

// Heavy sync surface — message rendering + composer + shell (presentation).
export * from './messages';
export * from './composer';
export * from './shell';

// Bridge — AI-driven `point` directives (spotlight + focus overlay).
export {
  HighlightOverlay,
  SpotlightCanvas,
  useHighlightTargets,
  resolveRefs,
  useChatDirectives,
  pushDirectives,
  clearDirectives,
  parseDirectives,
  installChatBridge,
  registerBridgeCommand,
  getBridgeCommand,
  setBridgeResolver,
  setBridgeSender,
  type BridgeCommand,
  type BridgeSender,
  type ChatBridge,
  type HighlightOverlayProps,
  type SpotlightCanvasProps,
  type RefResolver,
  type PointDirective,
  type HighlightTarget,
  type SpotlightRect,
  type CSTRefId,
} from '../../lib/browser-bridge';

// Page-context snapshot — capture engine + React surface. The host
// wires `getChatMetadata` into `getDynamicMetadata` so the assistant
// receives a snapshot of the page the user is looking at.
export {
  PageSnapshotProvider,
  usePageSnapshot,
  usePageSnapshotToggle,
  PageSnapshotChip,
  PageSnapshotPreview,
  PageSnapshotEngine,
  type PageSnapshotProviderProps,
  type PageSnapshotContextValue,
  type PageSnapshotToggle,
  type PageSnapshotChipProps,
  type PageSnapshotPreviewProps,
  type CaptureEngineOptions,
  type CaptureResult,
  type PageContextPayload,
} from '../../lib/page-snapshot';

// Launcher — FAB + Dock + Header + Greeting composition (heavy, sync).
export {
  ChatFAB,
  ChatDock,
  ChatHeader,
  ChatHeaderActionButton,
  ChatHeaderModeToggle,
  ChatHeaderAudioToggle,
  ChatHeaderResetButton,
  ChatHeaderLanguageButton,
  ChatLauncher,
  ChatGreeting,
  ChatUnreadPreview,
  useChatPresence,
  type ChatFABProps,
  type ChatFABPosition,
  type ChatFABVariant,
  type ChatFABSize,
  type ChatDockProps,
  type ChatDockMode,
  type ChatDockSide,
  type ChatHeaderProps,
  type ChatHeaderActionButtonProps,
  type ChatHeaderModeToggleProps,
  type ChatHeaderAudioToggleProps,
  type ChatHeaderResetButtonProps,
  type ChatHeaderLanguageButtonProps,
  type ChatLauncherProps,
  type ChatLauncherHotkey,
  type ChatLauncherGreeting,
  type ChatHeaderSlots,
  type ChatHeaderResetSlot,
  type ChatHeaderLanguageSlot,
  type ChatHeaderModeToggleSlot,
  type ChatGreetingProps,
  type ChatUnreadPreviewProps,
  type ChatPresencePhase,
} from './launcher';

// Lazy preset
export { LazyChat } from './lazy';

// Markdown renderer (used internally by MessageBubble; re-exported so
// hosts can render chat-style markdown outside a bubble — e.g. previews,
// receipts, support emails).
export {
  MarkdownMessage,
  extractTextFromChildren,
  type MarkdownMessageProps,
  type LinkRule,
} from '../dev/code/MarkdownMessage';
