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CAAA;AACvC;AAGO,SAAS,UAAU,IAAA,EAAiC;AACzD,EAAA,OAAO,QAAA,CAAS,IAAA,CAAK,UAAA,CAAW,MAAM,CAAA;AACxC","file":"chunk-CFXHO56Y.cjs","sourcesContent":["/**\n * Type-safe attribute accessors for well-known TNode attributes.\n *\n * Each accessor validates the runtime value with `typeof` checks instead\n * of blindly casting with `as`. If the attribute is missing or has the\n * wrong type, the accessor returns the documented fallback (typically\n * `undefined` or a sensible default like `''` / `0`).\n */\nimport type { TNode } from '../../core/ast-types';\n\n// ─── Primitive guards ───────────────────────────────────────────────────────\n\n/** Narrow `unknown` to `string` at runtime. Returns `undefined` if the value is not a string. */\nexport function asString(value: unknown): string | undefined {\n  return typeof value === 'string' ? value : undefined;\n}\n\n/** Narrow `unknown` to `number` at runtime. Returns `undefined` if the value is not a number. */\nexport function asNumber(value: unknown): number | undefined {\n  return typeof value === 'number' ? value : undefined;\n}\n\n// ─── Block-level attributes ─────────────────────────────────────────────────\n\n/** Get the header level (1–6) from a header node. Returns `0` if missing/invalid. */\nexport function getHeaderLevel(node: TNode): number {\n  return asNumber(node.attributes.header) ?? 0;\n}\n\n/** Get the list type string (`'ordered'`, `'bullet'`, `'checked'`, `'unchecked'`). Returns `''` if missing. */\nexport function getListType(node: TNode): string {\n  return asString(node.attributes.list) ?? '';\n}\n\n/** Get the table row identifier, if present. */\nexport function getTableRow(node: TNode): string | undefined {\n  return asString(node.attributes.table);\n}\n\n/** Get the text direction (`'rtl'`), if set. */\nexport function getDirection(node: TNode): string | undefined {\n  return asString(node.attributes.direction);\n}\n\n/** Get the text alignment (`'center'`, `'right'`, `'justify'`), if set. */\nexport function getAlign(node: TNode): string | undefined {\n  return asString(node.attributes.align);\n}\n\n/** Get the indent level, if set. */\nexport function getIndent(node: TNode): number | undefined {\n  return asNumber(node.attributes.indent);\n}\n\n// ─── Inline / embed attributes ──────────────────────────────────────────────\n\n/** Get the alt text from an image node. Returns `''` if missing. */\nexport function getAlt(node: TNode): string {\n  return asString(node.attributes.alt) ?? '';\n}\n\n/** Get the link URL from a node's `link` attribute. */\nexport function getLinkHref(node: TNode): string | undefined {\n  return asString(node.attributes.link);\n}\n\n/** Get the width attribute. */\nexport function getWidth(node: TNode): string | undefined {\n  return asString(node.attributes.width);\n}\n\n/** Get the height attribute. */\nexport function getHeight(node: TNode): string | undefined {\n  return asString(node.attributes.height);\n}\n"]}