{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "markdown",
  "title": "Markdown",
  "description": "Markdown drawn with Kino’s own parts, that reads well while a reply is still being written: a cut fence is code still arriving, a half table shows its rows, a half link its text. Only the block being written renders again. Marks put a citation at the end of the text it cites, and raw HTML shows as text.",
  "dependencies": [],
  "registryDependencies": [
    "https://kinoui.com/r/checkbox.json",
    "https://kinoui.com/r/code-block.json",
    "https://kinoui.com/r/separator.json",
    "https://kinoui.com/r/table.json",
    "https://kinoui.com/r/markdown-parse.json",
    "https://kinoui.com/r/mark-lights.json",
    "https://kinoui.com/r/syntax.json",
    "https://kinoui.com/r/theme.json"
  ],
  "files": [
    {
      "path": "registry/components/kino/markdown.tsx",
      "content": "'use client'\n\nimport { Checkbox } from '@/registry/components/kino/checkbox'\nimport { CodeBlock } from '@/registry/components/kino/code-block'\nimport { Separator } from '@/registry/components/kino/separator'\nimport {\n  Table,\n  TableBody,\n  TableCell,\n  TableHead,\n  TableHeader,\n  TableRow,\n} from '@/registry/components/kino/table'\nimport {\n  type LightVia,\n  lightMark,\n  litMark,\n  type MarkLights,\n  NO_LIGHTS,\n} from '@/registry/lib/mark-lights'\nimport {\n  type MarkdownAlign,\n  type MarkdownBlock,\n  type MarkdownDocument,\n  type MarkdownInline,\n  type MarkdownRange,\n  parseMarkdown,\n  plain,\n} from '@/registry/lib/markdown-parse'\nimport { languageName } from '@/registry/lib/syntax'\nimport {\n  type ComponentProps,\n  createContext,\n  Fragment,\n  isValidElement,\n  memo,\n  type ReactNode,\n  use,\n  useMemo,\n  useState,\n} from 'react'\n\nimport { cn } from '@/lib/utils'\n\n/*\n * Markdown, drawn with Kino's own parts, that reads well while it is still\n * being written. New text shows the moment it arrives. Only the block being\n * written renders again; the blocks above it keep their elements. Raw HTML\n * shows as text.\n */\n\n/** Something to put at the end of a range of the source, such as a citation. */\nexport interface MarkdownMark {\n  /** Where its range starts in the source; the range lights while the mark has the pointer or focus. */\n  from: number\n  /** Where its range ends in the source, and where the mark goes. */\n  to: number\n  content: ReactNode\n}\n\n/** Draws the code of one fenced language, in place of the Code block: a diagram, a chart. */\nexport type MarkdownCodeRenderer = (\n  code: string,\n  state: { streaming: boolean },\n) => ReactNode\n\nconst headingClassName = {\n  1: 'mt-2 text-xl leading-7 font-medium tracking-tight text-balance first:mt-0',\n  2: 'mt-2 text-lg leading-7 font-medium tracking-tight text-balance first:mt-0',\n  3: 'mt-1 text-base font-medium text-balance first:mt-0',\n  4: 'font-medium',\n  5: 'font-medium',\n  6: 'text-muted-foreground font-medium',\n} as const\n\n// The ring's corner and the code's box are in `em`, so they follow the text's size in a heading as in a paragraph.\nconst linkClassName =\n  'text-foreground font-medium underline decoration-foreground/30 underline-offset-4 transition-[text-decoration-color] duration-(--motion-press-duration) ease-(--motion-press-fade-easing) hover:decoration-foreground focus-visible:rounded-[min(var(--control-radius-xs),0.2em)] focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-hidden data-pending:no-underline'\n\nconst inlineCodeClassName =\n  'bg-muted rounded-[min(var(--control-radius-xs),0.375em)] px-[0.35em] py-[0.1em] font-mono text-[0.875em] [overflow-wrap:anywhere]'\n\n/* Rendering */\n\n/** What every block reads: it changes only with `headingLevel`, so a new chunk renders only the blocks it changed. */\ninterface Render {\n  headingLevel: number\n  onLight: (via: LightVia, index: number | null) => void\n}\n\nconst RenderContext = createContext<Render | null>(null)\n\n/** Read by code blocks alone, so new renderers render only them. */\nconst RenderersContext = createContext<Record<string, MarkdownCodeRenderer> | undefined>(\n  undefined,\n)\n\n/** Whether more text is coming, read by code blocks alone: a stopped reply's open fence is finished code. */\nconst ArrivingContext = createContext(false)\n\n/** A mark a block holds, with its index for lighting its range. */\ninterface PlacedMark {\n  index: number\n  mark: MarkdownMark\n}\n\n/** The marks a block holds or lights. */\ninterface BlockMarks {\n  /** Marks whose content goes in this block. */\n  placed: readonly PlacedMark[]\n  /** The lit mark, when its range reaches into this block. */\n  lit: MarkdownMark | null\n}\n\nconst NO_MARKS: BlockMarks = { placed: [], lit: null }\nconst NO_MARK_LIST: readonly MarkdownMark[] = []\n\n/** A leaf's place for each mark it ends: the source offset its content follows. */\ntype Placements = Map<number, PlacedMark[]>\n\nfunction MarkdownBlockView({\n  block,\n  marks,\n}: {\n  block: MarkdownBlock\n  marks: BlockMarks\n}) {\n  const render = use(RenderContext)!\n  const placements = useMemo(() => placeMarks(block, marks.placed), [block, marks.placed])\n  return blockElement(block, { render, marks, placements })\n}\n\nconst MemoBlock = memo(\n  MarkdownBlockView,\n  (a, b) => a.block === b.block && sameBlockMarks(a.marks, b.marks),\n)\n\ninterface Scope {\n  render: Render\n  marks: BlockMarks\n  placements: Placements\n}\n\nconst HEADINGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const\n\nfunction blockElement(block: MarkdownBlock, scope: Scope, tight = false): ReactNode {\n  switch (block.type) {\n    case 'paragraph':\n      return tight ? (\n        inlines(block.children, scope)\n      ) : (\n        // A div with the paragraph's role, since what its words hold can open in place, such\n        // as a citation's card, whose blocks a <p> can't hold.\n        <div role='paragraph' data-slot='markdown-paragraph' dir='auto'>\n          {inlines(block.children, scope)}\n        </div>\n      )\n    case 'heading': {\n      const Heading =\n        HEADINGS[Math.min(6, block.depth + scope.render.headingLevel - 1) - 1]\n      return (\n        <Heading\n          data-slot='markdown-heading'\n          dir='auto'\n          className={headingClassName[block.depth]}\n        >\n          {inlines(block.children, scope)}\n        </Heading>\n      )\n    }\n    case 'code':\n      return <CodeView block={block} />\n    case 'quote':\n      return (\n        <blockquote\n          data-slot='markdown-quote'\n          dir='auto'\n          className='text-muted-foreground flex flex-col gap-3 border-s-2 ps-3'\n        >\n          {block.children.map((child) => (\n            <BlockFragment key={child.from} block={child} scope={scope} />\n          ))}\n        </blockquote>\n      )\n    case 'list': {\n      const List = block.ordered ? 'ol' : 'ul'\n      return (\n        <List\n          data-slot='markdown-list'\n          start={block.ordered && block.start !== 1 ? block.start : undefined}\n          className={cn(\n            'marker:text-muted-foreground flex list-disc flex-col gap-1',\n            block.ordered && 'list-decimal marker:tabular-nums',\n            !block.tight && 'gap-3',\n          )}\n        >\n          {block.items.map((item) => (\n            <li\n              key={item.from}\n              data-slot='markdown-item'\n              dir='auto'\n              data-task={item.checked === null ? undefined : ''}\n              data-loose={block.tight ? undefined : ''}\n              className={cn(\n                // The marker's room is the item's own margin, so it sits on the item's start side in either direction.\n                'ms-5 ps-0.5 [&>ol]:mt-1 [&>ul]:mt-1 data-loose:[&>*+*]:mt-3',\n                item.checked !== null && 'ms-0 flex list-none gap-2',\n              )}\n            >\n              {item.checked !== null ? (\n                <>\n                  <TaskCheck checked={item.checked} />\n                  <div\n                    className={cn(\n                      'flex min-w-0 flex-1 flex-col',\n                      block.tight ? 'gap-1' : 'gap-3',\n                    )}\n                  >\n                    {/* Its own `dir`, so the item's direction comes from the task's text. */}\n                    <span dir='ltr' className='sr-only'>\n                      {item.checked ? 'Done: ' : 'To do: '}\n                    </span>\n                    {item.children.map((child) => (\n                      <BlockFragment\n                        key={child.from}\n                        block={child}\n                        scope={scope}\n                        tight={block.tight}\n                      />\n                    ))}\n                  </div>\n                </>\n              ) : (\n                item.children.map((child) => (\n                  <BlockFragment\n                    key={child.from}\n                    block={child}\n                    scope={scope}\n                    tight={block.tight}\n                  />\n                ))\n              )}\n            </li>\n          ))}\n        </List>\n      )\n    }\n    case 'table': {\n      const wraps = block.head.map((_, column) => columnWraps(block.rows, column))\n      return (\n        <Table\n          data-slot='markdown-table'\n          aria-label={`Table: ${block.head.map(plain).join(', ')}`}\n          containerClassName='rounded-(--surface-radius) border'\n        >\n          <TableHeader>\n            <TableRow>\n              {block.head.map((cell, index) => (\n                <TableHead\n                  key={index}\n                  dir='auto'\n                  numeric={block.align[index] === 'right'}\n                  className={alignClassName(block.align[index])}\n                >\n                  {inlines(cell, scope)}\n                </TableHead>\n              ))}\n            </TableRow>\n          </TableHeader>\n          <TableBody>\n            {block.rows.map((row, rowIndex) => (\n              <TableRow key={rowIndex}>\n                {row.map((cell, index) => (\n                  <TableCell\n                    key={index}\n                    dir='auto'\n                    numeric={block.align[index] === 'right'}\n                    className={cn(\n                      // A wrapped cell keeps the row's room above and below it; one line stays the row's height.\n                      wraps[index] && 'py-2 whitespace-normal',\n                      alignClassName(block.align[index]),\n                    )}\n                  >\n                    {inlines(cell, scope)}\n                  </TableCell>\n                ))}\n              </TableRow>\n            ))}\n          </TableBody>\n        </Table>\n      )\n    }\n    case 'rule':\n      return <Separator data-markdown-rule='' className='my-1' />\n    case 'html':\n      return (\n        <p data-slot='markdown-paragraph' dir='auto' className='whitespace-pre-wrap'>\n          {block.value}\n        </p>\n      )\n  }\n}\n\nfunction BlockFragment({\n  block,\n  scope,\n  tight,\n}: {\n  block: MarkdownBlock\n  scope: Scope\n  tight?: boolean\n}) {\n  return blockElement(block, scope, tight)\n}\n\n// A column set to the right holds numbers, as the Table's `numeric` does.\nconst alignClassName = (align: MarkdownAlign) =>\n  align === 'center' ? 'text-center' : undefined\n\n/** A task's box: a mark, not a control, since a reply can't be ticked. The item's text says which. */\nfunction TaskCheck({ checked }: { checked: boolean }) {\n  return (\n    <span inert data-agent-hidden className='contents'>\n      <Checkbox checked={checked} readOnly className='mt-[calc((1lh-1rem)/2)]' />\n    </span>\n  )\n}\n\nfunction CodeView({ block }: { block: Extract<MarkdownBlock, { type: 'code' }> }) {\n  const renderers = use(RenderersContext)\n  const streaming = block.open && use(ArrivingContext)\n  const custom = block.language ? renderers?.[block.language] : undefined\n  if (custom) return custom(block.value, { streaming })\n  return (\n    <CodeBlock\n      streaming={streaming}\n      files={[\n        {\n          // Two blocks of one language are told apart by their first line.\n          label: `${languageName(block.language ?? 'text')} code: ${block.value.split('\\n', 1)[0].trim().slice(0, 48)}`,\n          language: block.language ?? 'text',\n          code: block.value,\n        },\n      ]}\n    />\n  )\n}\n\n/* Inlines */\n\nfunction inlines(list: MarkdownInline[], scope: Scope): ReactNode[] {\n  return list.map((inline) => inlineElement(inline, scope))\n}\n\nfunction inlineElement(inline: MarkdownInline, scope: Scope): ReactNode {\n  const key = `${inline.type}-${inline.from}`\n  switch (inline.type) {\n    case 'text':\n      return <TextRun key={key} inline={inline} scope={scope} />\n    case 'code':\n      return (\n        <Leaf key={key} inline={inline} scope={scope}>\n          <code data-slot='markdown-code' className={inlineCodeClassName}>\n            {inline.value}\n          </code>\n        </Leaf>\n      )\n    case 'break':\n      return (\n        <Leaf key={key} inline={inline} scope={scope}>\n          <br />\n        </Leaf>\n      )\n    case 'image':\n      return (\n        <Leaf key={key} inline={inline} scope={scope}>\n          {safeHref(inline.src) ? (\n            // oxlint-disable-next-line nextjs/no-img-element -- a registry item can't use next/image\n            <img\n              src={inline.src}\n              alt={inline.alt}\n              loading='lazy'\n              className='max-w-full rounded-(--surface-radius) border'\n            />\n          ) : (\n            inline.alt\n          )}\n        </Leaf>\n      )\n    case 'emphasis':\n      return <em key={key}>{inlines(inline.children, scope)}</em>\n    case 'strong':\n      return (\n        <strong key={key} className='font-semibold'>\n          {inlines(inline.children, scope)}\n        </strong>\n      )\n    case 'delete':\n      return <del key={key}>{inlines(inline.children, scope)}</del>\n    case 'link': {\n      const href = inline.href === null ? null : safeHref(inline.href)\n      // An address no reply may open shows its text alone.\n      if (inline.href !== null && href === null)\n        return <Fragment key={key}>{inlines(inline.children, scope)}</Fragment>\n      return href === null ? (\n        <span\n          key={key}\n          data-slot='markdown-link'\n          data-pending=''\n          className={linkClassName}\n        >\n          {inlines(inline.children, scope)}\n        </span>\n      ) : (\n        <a\n          key={key}\n          data-slot='markdown-link'\n          href={href}\n          {...(/^https?:/i.test(href)\n            ? { target: '_blank', rel: 'noopener noreferrer' }\n            : {})}\n          className={linkClassName}\n        >\n          {inlines(inline.children, scope)}\n        </a>\n      )\n    }\n  }\n}\n\n/** A leaf that can't be split: a mark that ends inside it goes after it. */\nfunction Leaf({\n  inline,\n  scope,\n  children,\n}: {\n  inline: MarkdownRange\n  scope: Scope\n  children: ReactNode\n}) {\n  const placed = scope.placements.get(inline.to)\n  return (\n    <>\n      {children}\n      {placed?.map((item) => (\n        <MarkSlot key={item.index} placed={item} scope={scope} />\n      ))}\n    </>\n  )\n}\n\n/** Text, cut where a mark's range starts or ends and where a mark goes. */\nfunction TextRun({\n  inline,\n  scope,\n}: {\n  inline: Extract<MarkdownInline, { type: 'text' }>\n  scope: Scope\n}) {\n  const { marks, placements } = scope\n  const splittable = inline.value.length === inline.to - inline.from\n  if (!splittable)\n    return (\n      <Leaf inline={inline} scope={scope}>\n        {inline.value}\n      </Leaf>\n    )\n  const lit = marks.lit\n  const points = textCuts(inline, lit, placements.keys())\n  const pieces: ReactNode[] = []\n  for (let i = 0; i < points.length - 1; i++) {\n    const from = points[i]\n    const to = points[i + 1]\n    const text = inline.value.slice(from - inline.from, to - inline.from)\n    pieces.push(\n      lit && from >= lit.from && to <= lit.to ? (\n        <span\n          key={from}\n          data-slot='markdown-lit'\n          className='bg-primary/15 dark:bg-primary/25 rounded-[min(var(--control-radius-xs),0.2em)] [box-decoration-break:clone] forced-colors:bg-[Highlight]! forced-colors:text-[HighlightText]'\n        >\n          {text}\n        </span>\n      ) : (\n        <span key={from} className='contents'>\n          {text}\n        </span>\n      ),\n    )\n    for (const placed of placements.get(to) ?? []) {\n      pieces.push(<MarkSlot key={`mark-${placed.index}`} placed={placed} scope={scope} />)\n    }\n  }\n  return pieces\n}\n\nfunction MarkSlot({ placed, scope }: { placed: PlacedMark; scope: Scope }) {\n  const { onLight } = scope.render\n  return (\n    <span\n      data-slot='markdown-mark'\n      onPointerEnter={() => onLight('pointer', placed.index)}\n      onPointerLeave={() => onLight('pointer', null)}\n      onFocus={() => onLight('focus', placed.index)}\n      onBlur={() => onLight('focus', null)}\n    >\n      {placed.mark.content}\n    </span>\n  )\n}\n\n/* The component */\n\ninterface Parsed {\n  text: string\n  cut: boolean\n  doc: MarkdownDocument\n}\n\nfunction Markdown({\n  children,\n  streaming = false,\n  stopped = false,\n  marks = NO_MARK_LIST,\n  renderers,\n  headingLevel = 1,\n  className,\n  ...props\n}: Omit<ComponentProps<'div'>, 'children'> & {\n  /** The Markdown source. */\n  children: string\n  /** The text is still being written: what is cut at its end is closed. */\n  streaming?: boolean\n  /** The text was stopped before its end: what is cut there stays closed, as while it streamed. */\n  stopped?: boolean\n  /** Keep each mark's `content` the same node, or an element with the same props, so a new chunk renders only the block being written. */\n  marks?: readonly MarkdownMark[]\n  /** Draws fenced code by its language, in place of the Code block: `{ mermaid: (code) => <Diagram source={code} /> }`. Made once, outside the component or in `useMemo`, since a new object renders every code block again. */\n  renderers?: Record<string, MarkdownCodeRenderer>\n  /** The level a `#` heading takes on the page, so a reply's headings sit under the page's own; deeper ones follow, up to `h6`. */\n  headingLevel?: 1 | 2 | 3 | 4 | 5 | 6\n}) {\n  // Parsed while rendering, from the last parse, so only the block being written is parsed again.\n  const cut = streaming || stopped\n  const [parsed, setParsed] = useState<Parsed>(() => ({\n    text: children,\n    cut,\n    doc: parseMarkdown(children, { streaming: cut }),\n  }))\n  let doc = parsed.doc\n  if (parsed.text !== children || parsed.cut !== cut) {\n    doc = parseMarkdown(children, { streaming: cut, previous: parsed.doc })\n    setParsed({ text: children, cut, doc })\n  }\n\n  const [lights, setLights] = useState<MarkLights<number>>(NO_LIGHTS)\n  const lit = litMark(lights)\n  const render = useMemo<Render>(\n    () => ({\n      headingLevel,\n      onLight: (via, index) => setLights((now) => lightMark(now, via, index)),\n    }),\n    [headingLevel],\n  )\n  const perBlock = useMemo(\n    () => blockMarks(doc.blocks, marks, lit),\n    [doc.blocks, marks, lit],\n  )\n\n  return (\n    <RenderContext value={render}>\n      <RenderersContext value={renderers}>\n        <ArrivingContext value={streaming}>\n          <div\n            data-slot='markdown'\n            data-streaming={streaming ? '' : undefined}\n            className={cn(\n              'flex min-w-0 flex-col gap-3 text-sm leading-6 text-pretty wrap-break-word',\n              className,\n            )}\n            {...props}\n          >\n            {doc.blocks.map((block, index) => (\n              <MemoBlock key={block.from} block={block} marks={perBlock[index]} />\n            ))}\n          </div>\n        </ArrivingContext>\n      </RenderersContext>\n    </RenderContext>\n  )\n}\n\nexport { Markdown }\n\n/** A link's address, when it is one a reply may open: never `javascript:` or `data:`. */\nexport function safeHref(href: string): string | null {\n  const scheme = /^([a-z][a-z0-9+.-]*):/i.exec(href)?.[1]?.toLowerCase()\n  if (!scheme) return href\n  return ['http', 'https', 'mailto', 'tel'].includes(scheme) ? href : null\n}\n\n/** Text longer than this wraps its column; shorter values, such as a name or an amount, stay on one line and the table scrolls. */\nconst WRAP_AFTER = 24\n\n/** Whether a table's column holds prose that wraps, rather than values kept whole. */\nexport function columnWraps(\n  rows: readonly MarkdownInline[][][],\n  column: number,\n): boolean {\n  return rows.some((row) => plain(row[column] ?? []).length > WRAP_AFTER)\n}\n\n/** Where a text run is cut: its ends, the lit range's ends and each mark's place inside it. */\nexport function textCuts(\n  inline: MarkdownRange,\n  lit: MarkdownRange | null,\n  places: Iterable<number>,\n): number[] {\n  const cuts = new Set<number>([inline.from, inline.to])\n  const inside = (at: number) => at > inline.from && at < inline.to\n  if (lit && inside(lit.from)) cuts.add(lit.from)\n  if (lit && inside(lit.to)) cuts.add(lit.to)\n  for (const at of places) if (inside(at)) cuts.add(at)\n  return [...cuts].sort((a, b) => a - b)\n}\n\n/** The leaves of a block, in order: what a mark can follow. */\nfunction leavesOf(block: MarkdownBlock): MarkdownInline[] {\n  const out: MarkdownInline[] = []\n  const walk = (list: MarkdownInline[]) => {\n    for (const inline of list) {\n      if ('children' in inline) walk(inline.children)\n      else out.push(inline)\n    }\n  }\n  const visit = (block: MarkdownBlock) => {\n    switch (block.type) {\n      case 'paragraph':\n      case 'heading':\n        return walk(block.children)\n      case 'quote':\n        return block.children.forEach(visit)\n      case 'list':\n        return block.items.forEach((item) => item.children.forEach(visit))\n      case 'table':\n        block.head.forEach(walk)\n        return block.rows.forEach((row) => row.forEach(walk))\n    }\n  }\n  visit(block)\n  return out\n}\n\n/**\n * Where each mark of a block goes: the end of its range, inside the text\n * that holds it, or after the last leaf before it when it ends on markup.\n */\nexport function placeMarks(\n  block: MarkdownBlock,\n  placed: readonly PlacedMark[],\n): Placements {\n  const placements: Placements = new Map()\n  if (!placed.length) return placements\n  const leaves = leavesOf(block)\n  for (const item of placed) {\n    const to = item.mark.to\n    let at: number | null = null\n    for (const leaf of leaves) {\n      if (leaf.from >= to) break\n      const splittable = leaf.type === 'text' && leaf.value.length === leaf.to - leaf.from\n      at = to <= leaf.to && splittable ? to : leaf.to\n      if (to <= leaf.to) break\n    }\n    if (at === null) continue\n    placements.set(at, [...(placements.get(at) ?? []), item])\n  }\n  return placements\n}\n\n/** Which block each mark goes in, the last that starts before the mark's end, and which blocks the lit mark reaches. */\nexport function blockMarks(\n  blocks: readonly MarkdownRange[],\n  marks: readonly MarkdownMark[],\n  lit: number | null,\n): BlockMarks[] {\n  const placed: PlacedMark[][] = blocks.map(() => [])\n  marks.forEach((mark, index) => {\n    let target = -1\n    for (let i = 0; i < blocks.length && blocks[i].from < mark.to; i++) target = i\n    if (target >= 0) placed[target].push({ index, mark })\n  })\n  const litMark = lit === null ? null : (marks[lit] ?? null)\n  return blocks.map((block, i) => {\n    const reaches = litMark !== null && litMark.from < block.to && litMark.to > block.from\n    return placed[i].length || reaches\n      ? { placed: placed[i], lit: reaches ? litMark : null }\n      : NO_MARKS\n  })\n}\n\n/** Whether a block's marks would draw the same: the same lit range, and the same marks with the same ranges and content. */\nexport function sameBlockMarks(a: BlockMarks, b: BlockMarks): boolean {\n  return (\n    a.lit?.from === b.lit?.from &&\n    a.lit?.to === b.lit?.to &&\n    a.placed.length === b.placed.length &&\n    a.placed.every(\n      (item, i) =>\n        item.index === b.placed[i].index &&\n        item.mark.from === b.placed[i].mark.from &&\n        item.mark.to === b.placed[i].mark.to &&\n        sameContent(item.mark.content, b.placed[i].mark.content),\n    )\n  )\n}\n\n/** Whether two marks' content draws the same: the same node, or elements of one type and key with equal props. */\nexport function sameContent(a: ReactNode, b: ReactNode): boolean {\n  if (Object.is(a, b)) return true\n  if (!isValidElement(a) || !isValidElement(b)) return false\n  if (a.type !== b.type || a.key !== b.key) return false\n  const aProps = a.props as Record<string, unknown>\n  const bProps = b.props as Record<string, unknown>\n  const keys = Object.keys(aProps)\n  return (\n    keys.length === Object.keys(bProps).length &&\n    keys.every((key) => Object.hasOwn(bProps, key) && Object.is(aProps[key], bProps[key]))\n  )\n}\n",
      "type": "registry:component",
      "target": "@components/kino/markdown.tsx"
    }
  ],
  "type": "registry:component"
}