{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "markdown",
  "type": "registry:ui",
  "dependencies": [
    "@streamdown/code",
    "clsx",
    "streamdown",
    "tailwind-merge"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/agent-elements/components/markdown.tsx",
      "content": "\"use client\";\n\nimport { Streamdown, type Components } from \"streamdown\";\nimport { createCodePlugin } from \"@streamdown/code\";\nimport { cn } from \"./utils/cn\";\n\nfunction fixNumberedListBreaks(text: string): string {\n  return text.replace(/^(\\d+)\\.\\s*\\n+\\s*\\n*/gm, \"$1. \");\n}\n\nconst CODE_FENCE_LANGS = new Set([\n  \"bash\",\n  \"diff\",\n  \"html\",\n  \"js\",\n  \"json\",\n  \"jsx\",\n  \"md\",\n  \"markdown\",\n  \"sh\",\n  \"shell\",\n  \"text\",\n  \"ts\",\n  \"tsx\",\n  \"yml\",\n  \"yaml\",\n]);\n\nfunction normalizeCodeFenceLanguages(text: string): string {\n  return text.replace(/```([^\\n]*)/g, (_match, langRaw) => {\n    const lang = String(langRaw || \"\")\n      .trim()\n      .toLowerCase();\n    if (!lang) return \"```\";\n    const normalized = lang.split(/\\s+/)[0];\n    return CODE_FENCE_LANGS.has(normalized) ? `\\`\\`\\`${normalized}` : \"```text\";\n  });\n}\n\nexport type MarkdownProps = {\n  content: string;\n  className?: string;\n  textContrast?: \"normal\" | \"high\";\n};\n\nconst code = createCodePlugin({\n  themes: [\"github-light\", \"github-dark\"],\n});\n\nexport function Markdown({ content, className }: MarkdownProps) {\n  const safeContent = normalizeCodeFenceLanguages(\n    fixNumberedListBreaks(content),\n  );\n  const components: Components = {\n    h1: ({ children, ...props }) => (\n      <h1 className=\"an-md-h1 text-base font-semibold mt-3 mb-1.5\" {...props}>\n        {children}\n      </h1>\n    ),\n    h2: ({ children, ...props }) => (\n      <h2 className=\"an-md-h2 text-base font-semibold mt-3 mb-1.5\" {...props}>\n        {children}\n      </h2>\n    ),\n    h3: ({ children, ...props }) => (\n      <h3 className=\"an-md-h3 text-sm font-semibold mt-2 mb-1\" {...props}>\n        {children}\n      </h3>\n    ),\n    h4: ({ children, ...props }) => (\n      <h4 className=\"an-md-h4 text-sm font-medium mt-2 mb-1\" {...props}>\n        {children}\n      </h4>\n    ),\n    p: ({ children, ...props }) => (\n      <p\n        className=\"an-md-p text-sm leading-relaxed text-an-foreground/80\"\n        {...props}\n      >\n        {children}\n      </p>\n    ),\n    ul: ({ children, ...props }) => (\n      <ul\n        className=\"an-md-ul list-disc list-outside space-y-0.5 text-sm mb-2 pl-4 text-an-foreground/80\"\n        {...props}\n      >\n        {children}\n      </ul>\n    ),\n    ol: ({ children, ...props }) => (\n      <ol\n        className=\"an-md-ol list-decimal list-outside space-y-0.5 text-sm mb-2 pl-5 text-an-foreground/80\"\n        {...props}\n      >\n        {children}\n      </ol>\n    ),\n    li: ({ children, ...props }) => (\n      <li className=\"an-md-li text-sm pl-0.5 text-an-foreground/80\" {...props}>\n        {children}\n      </li>\n    ),\n    strong: ({ children, ...props }) => (\n      <strong className=\"font-medium text-an-foreground\" {...props}>\n        {children}\n      </strong>\n    ),\n    a: ({ href, children, ...props }) => {\n      if (!href) return <span>{children}</span>;\n      const isExternal = href.startsWith(\"http\") || href.startsWith(\"mailto:\");\n      return (\n        <a\n          {...props}\n          href={href}\n          target={isExternal ? \"_blank\" : undefined}\n          rel={isExternal ? \"noopener noreferrer\" : undefined}\n          className=\"an-md-link hover:underline underline-offset-2 text-an-primary-color\"\n        >\n          {children}\n        </a>\n      );\n    },\n    blockquote: ({ children, ...props }) => (\n      <blockquote\n        className=\"an-md-blockquote pl-3 italic mb-2 text-sm border-l-2 border-an-border-color text-an-foreground/70\"\n        {...props}\n      >\n        {children}\n      </blockquote>\n    ),\n    hr: ({ ...props }) => (\n      <hr className=\"an-md-hr my-4 border-an-border-color\" {...props} />\n    ),\n    table: ({ children, ...props }) => (\n      <div className=\"overflow-x-auto my-3 border border-an-border-color rounded-an-tool-border-radius\">\n        <table\n          className=\"an-md-table w-full text-sm [&>thead]:bg-an-tool-background [&>thead>tr>th]:bg-an-tool-background\"\n          {...props}\n        >\n          {children}\n        </table>\n      </div>\n    ),\n    th: ({ children, ...props }) => (\n      <th\n        className=\"text-left font-medium px-3 py-2 bg-an-background-secondary\"\n        {...props}\n      >\n        {children}\n      </th>\n    ),\n    td: ({ children, ...props }) => (\n      <td\n        className=\"px-3 py-2 border-t border-an-border-color text-an-foreground/80\"\n        {...props}\n      >\n        {children}\n      </td>\n    ),\n  };\n\n  return (\n    <div\n      className={cn(\n        \"an-markdown\",\n        \"overflow-hidden wrap-break-word\",\n        \"[&_li>p]:inline [&_li>p]:mb-0\",\n        className,\n      )}\n    >\n      <Streamdown components={components} plugins={{ code }}>\n        {safeContent}\n      </Streamdown>\n    </div>\n  );\n}\n",
      "type": "registry:ui",
      "target": "components/agent-elements/markdown.tsx"
    },
    {
      "path": "registry/agent-elements/utils/cn.ts",
      "content": "import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n",
      "type": "registry:lib",
      "target": "components/agent-elements/utils/cn.ts"
    },
    {
      "path": "registry/agent-elements/agent-ui.css",
      "content": "/* Agent Elements tokens + utilities */\n\n/*\n * AN Agent Chat - CSS Custom Properties\n * These are the default values. Override by redefining these vars in your app CSS.\n */\n:root {\n  /* Geometry — all radii derive from --an-border-radius */\n  --an-border-radius: 16px;\n  --an-message-border-radius: var(--an-border-radius);\n  --an-input-border-radius: var(--an-border-radius);\n  --an-tool-border-radius: 10px;\n  --an-message-radius-inner-offset: 4px;\n  --an-max-width: 420px;\n\n  /* Colors - Light mode defaults */\n  --an-background: #ffffff;\n  --an-background-secondary: #f0f0f0;\n  --an-background-tertiary: #f8f8f8;\n  --an-foreground: #1a1a1a;\n  --an-foreground-muted: #737373;\n  --an-foreground-subtle: #a3a3a3;\n  --an-border-color: #e4e4e7;\n  --an-primary-color: #3b82f6;\n\n  /* User Messages */\n  --an-user-message-bg: #f5f5f5;\n  --an-user-message-text: #1a1a1a;\n\n  /* Input */\n  --an-input-background: #ffffff;\n  --an-input-border-color: #e4e4e7;\n  --an-input-color: #1a1a1a;\n  --an-input-placeholder-color: #a3a3a3;\n  --an-input-focus-outline: transparent;\n  --an-context-padding: 10px;\n\n  /* Send/Stop Buttons */\n  --an-send-button-bg: #3b82f6;\n  --an-send-button-color: #ffffff;\n\n  /* Tools */\n  --an-tool-background: #f5f5f5;\n  --an-tool-border-color: #e4e4e7;\n  --an-tool-color: #1a1a1a;\n  --an-tool-color-muted: #737373;\n\n  /* Code */\n  --an-code-background: #1e1e1e;\n  --an-code-color: #d4d4d4;\n\n  /* Diff colors */\n  --an-diff-added-bg: rgba(34, 197, 94, 0.1);\n  --an-diff-added-border: rgba(34, 197, 94, 0.5);\n  --an-diff-added-text: #15803d;\n  --an-diff-removed-bg: rgba(239, 68, 68, 0.1);\n  --an-diff-removed-border: rgba(239, 68, 68, 0.5);\n  --an-diff-removed-text: #dc2626;\n}\n\n/* Dark mode defaults */\n.dark {\n  --an-background: #0a0a0a;\n  --an-background-secondary: #242424;\n  --an-background-tertiary: #141414;\n  --an-foreground: #fafafa;\n  --an-foreground-muted: #8c8c8c;\n  --an-foreground-subtle: #71717a;\n  --an-border-color: #2a2a2a;\n  --an-primary-color: #60a5fa;\n\n  --an-user-message-bg: #1a1a1a;\n  --an-user-message-text: #fafafa;\n\n  --an-input-background: #0a0a0a;\n  --an-input-border-color: #2a2a2a;\n  --an-input-color: #fafafa;\n  --an-input-placeholder-color: #71717a;\n  --an-input-focus-outline: transparent;\n  --an-context-padding: 12px;\n\n  --an-send-button-bg: #60a5fa;\n  /* Dark mode uses a lighter primary (#60a5fa) — pair it with black text so\n     labels like \"Approve\" / send-arrow have proper contrast instead of\n     low-contrast white-on-light-blue. */\n  --an-send-button-color: #0a0a0a;\n\n  --an-tool-background: #141414;\n  --an-tool-border-color: #2a2a2a;\n  --an-tool-color: #fafafa;\n  --an-tool-color-muted: #8c8c8c;\n\n  --an-code-background: #0a0a0a;\n  --an-code-color: #d4d4d4;\n\n  --an-diff-added-bg: rgba(34, 197, 94, 0.15);\n  --an-diff-added-border: rgba(34, 197, 94, 0.4);\n  --an-diff-added-text: #4ade80;\n  --an-diff-removed-bg: rgba(239, 68, 68, 0.15);\n  --an-diff-removed-border: rgba(239, 68, 68, 0.4);\n  --an-diff-removed-text: #f87171;\n}\n\n@theme inline {\n  --color-an-background: var(--an-background);\n  --color-an-background-secondary: var(--an-background-secondary);\n  --color-an-background-tertiary: var(--an-background-tertiary);\n  --color-an-foreground: var(--an-foreground);\n  --color-an-foreground-muted: var(--an-foreground-muted);\n  --color-an-foreground-subtle: var(--an-foreground-subtle);\n  --color-an-border-color: var(--an-border-color);\n  --color-an-primary-color: var(--an-primary-color);\n  --color-an-user-message-bg: var(--an-user-message-bg);\n  --color-an-user-message-text: var(--an-user-message-text);\n  --color-an-input-background: var(--an-input-background);\n  --color-an-input-border-color: var(--an-input-border-color);\n  --color-an-input-color: var(--an-input-color);\n  --color-an-input-placeholder-color: var(--an-input-placeholder-color);\n  --color-an-input-focus-outline: var(--an-input-focus-outline);\n  --color-an-send-button-bg: var(--an-send-button-bg);\n  --color-an-send-button-color: var(--an-send-button-color);\n  --color-an-tool-background: var(--an-tool-background);\n  --color-an-tool-border-color: var(--an-tool-border-color);\n  --color-an-tool-color: var(--an-tool-color);\n  --color-an-tool-color-muted: var(--an-tool-color-muted);\n  --color-an-code-background: var(--an-code-background);\n  --color-an-code-color: var(--an-code-color);\n  --color-an-diff-added-bg: var(--an-diff-added-bg);\n  --color-an-diff-added-border: var(--an-diff-added-border);\n  --color-an-diff-added-text: var(--an-diff-added-text);\n  --color-an-diff-removed-bg: var(--an-diff-removed-bg);\n  --color-an-diff-removed-border: var(--an-diff-removed-border);\n  --color-an-diff-removed-text: var(--an-diff-removed-text);\n  --radius-an-message: var(--an-message-border-radius);\n  --radius-an-message-inner: calc(\n    var(--an-message-border-radius) - var(--an-message-radius-inner-offset)\n  );\n  --radius-an-input-border-radius: var(--an-input-border-radius);\n  --radius-an-tool-border-radius: var(--an-tool-border-radius);\n  --spacing-an-context-padding: var(--an-context-padding);\n  --max-width-an: var(--an-max-width);\n  --spacing-an-user-message-x: 14px;\n  --spacing-an-user-message-y: 10px;\n}\n\n/* TextShimmer animation */\n@keyframes an-shimmer {\n  from {\n    background-position: 100% center;\n  }\n  to {\n    background-position: 0% center;\n  }\n}\n\n@keyframes an-blink {\n  50% {\n    opacity: 0;\n  }\n}\n\n@keyframes loading-dots {\n  0%,\n  100% {\n    opacity: 0;\n  }\n  50% {\n    opacity: 1;\n  }\n}\n\n@keyframes an-ellipsis {\n  0% {\n    width: 0;\n  }\n  33% {\n    width: 0.33em;\n  }\n  66% {\n    width: 0.66em;\n  }\n  100% {\n    width: 1em;\n  }\n}\n\n.an-text-shimmer {\n  display: inline-block;\n  background-size: 250% 100%;\n  background-clip: text;\n  -webkit-background-clip: text;\n  color: transparent;\n  background-image: linear-gradient(\n    90deg,\n    var(--an-foreground-subtle, #a3a3a3) 0%,\n    var(--an-foreground-subtle, #a3a3a3) 40%,\n    var(--an-foreground-muted, #737373) 50%,\n    var(--an-foreground-subtle, #a3a3a3) 60%,\n    var(--an-foreground-subtle, #a3a3a3) 100%\n  );\n  background-repeat: no-repeat;\n}\n\n.an-text-shimmer--active {\n  animation: an-shimmer var(--an-shimmer-duration, 2s) linear infinite;\n}\n\n.an-ellipsis {\n  display: inline-block;\n  overflow: hidden;\n  width: 0;\n  vertical-align: bottom;\n  animation: an-ellipsis 1.2s steps(1, end) infinite;\n}\n\n.an-markdown pre code {\n  counter-reset: none !important;\n}\n\n.an-markdown pre code > span::before {\n  content: none !important;\n  display: none !important;\n}\n\n.an-markdown pre code > span {\n  padding-left: 0 !important;\n}\n\n/* Diff */\n.an-edit-diff,\n.an-edit-diff pre,\n.an-edit-diff code {\n  font-size: 12px;\n}\n\n.dark .an-edit-tool-card {\n  background-color: #000;\n}\n\n[data-theme=\"dark\"] .an-edit-tool-card {\n  background-color: #000;\n}\n\n.dark .an-edit-tool-card .an-edit-diff,\n.dark .an-edit-tool-card .an-edit-diff pre,\n.dark .an-edit-tool-card .an-edit-diff code {\n  background-color: #000 !important;\n}\n\n[data-theme=\"dark\"] .an-edit-tool-card .an-edit-diff,\n[data-theme=\"dark\"] .an-edit-tool-card .an-edit-diff pre,\n[data-theme=\"dark\"] .an-edit-tool-card .an-edit-diff code {\n  background-color: #000 !important;\n}\n\n/* Markdown Code Block */\n.an-markdown [data-streamdown=\"code-block\"] {\n  padding: 0;\n  border: 1px solid var(--an-border-color);\n  border-radius: var(--an-tool-border-radius);\n  background: transparent;\n  gap: 0;\n}\n\n.an-markdown [data-streamdown=\"code-block-header\"] {\n  padding: 0px 10px 0px 8px;\n  height: auto;\n  font-size: 12px;\n  height: 28px;\n  background: transparent;\n  border-bottom: 1px solid var(--color-an-tool-border-color);\n  background-color: var(--an-tool-background);\n  position: relative;\n}\n\n.an-markdown div:has(> [data-streamdown=\"code-block-actions\"]) {\n  position: absolute;\n  height: auto;\n  margin: 0;\n  top: 0;\n  right: 0;\n  height: 28px;\n  padding-right: 8px;\n}\n\n.an-markdown [data-streamdown=\"code-block-actions\"] {\n  background: transparent;\n  border: none;\n  backdrop-filter: none;\n  padding: 0;\n}\n\n.an-markdown [data-streamdown=\"code-block-actions\"] button > svg {\n  width: 14px;\n  height: 14px;\n}\n\n.an-markdown [data-streamdown=\"code-block-body\"] {\n  margin: 0;\n  padding-top: 8px;\n  padding-bottom: 8px;\n  background: transparent;\n  border: transparent;\n  overflow-x: auto;\n}\n\n.an-markdown [data-streamdown=\"code-block\"] pre,\n.an-markdown [data-streamdown=\"code-block\"] code {\n  font-size: 12px;\n  background: transparent;\n}\n",
      "type": "registry:style",
      "target": "components/agent-elements/agent-ui.css"
    }
  ],
  "css": {
    "@import \"../components/agent-elements/agent-ui.css\"": ""
  }
}