{"version":3,"sources":["../src/renderers/common/simple-marks.ts","../src/renderers/html/common/get-layout-classes.ts","../src/renderers/common/resolve-block-meta.ts","../src/renderers/common/resolve-mention-data.ts"],"names":["getDirection","getAlign","getIndent","getListType","asString"],"mappings":";;;;;AAUO,IAAM,QAAA,GAA0B,EAAE,GAAA,EAAK,QAAA;AAEvC,IAAM,UAAA,GAA4B,EAAE,GAAA,EAAK,IAAA;AAEzC,IAAM,aAAA,GAA+B,EAAE,GAAA,EAAK,GAAA;AAE5C,IAAM,UAAA,GAA4B,EAAE,GAAA,EAAK,GAAA;AAEzC,IAAM,QAAA,GAA0B,EAAE,GAAA,EAAK,MAAA;AAEvC,IAAM,UAAA,GAA4B;AAAA,EACvC,GAAA,EAAK,CAAC,KAAA,KAAW,KAAA,KAAU,UAAU,KAAA,GAAQ;AAC/C;;;ACZO,SAAS,gBAAA,CAAiB,MAAa,MAAA,EAA0B;AACtE,EAAA,MAAM,UAAoB,EAAC;AAI3B,EAAA,MAAM,SAAA,GAAYA,+BAAa,IAAI,CAAA;AACnC,EAAA,IAAI,SAAA,EAAW;AACb,IAAA,OAAA,CAAQ,IAAA,CAAK,CAAA,EAAG,MAAM,CAAA,WAAA,EAAc,SAAS,CAAA,CAAE,CAAA;AAAA,EACjD;AAEA,EAAA,MAAM,KAAA,GAAQC,2BAAS,IAAI,CAAA;AAC3B,EAAA,IAAI,KAAA,EAAO;AACT,IAAA,OAAA,CAAQ,IAAA,CAAK,CAAA,EAAG,MAAM,CAAA,OAAA,EAAU,KAAK,CAAA,CAAE,CAAA;AAAA,EACzC;AAEA,EAAA,MAAM,MAAA,GAASC,4BAAU,IAAI,CAAA;AAC7B,EAAA,IAAI,MAAA,IAAU,IAAA,IAAQ,MAAA,GAAS,CAAA,EAAG;AAChC,IAAA,OAAA,CAAQ,IAAA,CAAK,CAAA,EAAG,MAAM,CAAA,QAAA,EAAW,MAAM,CAAA,CAAE,CAAA;AAAA,EAC3C;AAEA,EAAA,OAAO,OAAA;AACT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AA,IAAO;AAAA,GACd;AACF;;;ACpEA,SAAS,SAAS,KAAA,EAAyC;AACzD,EAAA,OAAO,KAAA,IAAS,IAAA,IAAQ,OAAO,KAAA,KAAU,QAAA,IAAY,CAAC,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,GACpE,KAAA,GACD,EAAC;AACP;AAQO,SAAS,mBAAmB,IAAA,EAA0B;AAC3D,EAAA,MAAM,GAAA,GAAM,SAAS,IAAA,CAAK,IAAI,KAAK,QAAA,CAAS,IAAA,CAAK,WAAW,OAAO,CAAA;AACnE,EAAA,MAAM,IAAA,GAAOC,0BAAA,CAAS,GAAA,CAAI,IAAI,CAAA;AAC9B,EAAA,MAAM,QAAA,GAAWA,0BAAA,CAAS,GAAA,CAAI,WAAW,CAAC,CAAA;AAE1C,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,MAAA,CAAO,GAAA,CAAI,IAAA,IAAQ,EAAE,CAAA;AAAA,IAC3B,MAAM,QAAA,IAAY,IAAA,GAAO,GAAG,QAAQ,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA,GAAK,aAAA;AAAA,IACjD,SAAA,EAAWA,0BAAA,CAAS,GAAA,CAAI,KAAK,CAAA;AAAA,IAC7B,MAAA,EAAQA,0BAAA,CAAS,GAAA,CAAI,MAAM;AAAA,GAC7B;AACF","file":"chunk-75GUPZC4.cjs","sourcesContent":["import type { SimpleTagMark } from '../../core/ast-types';\n\n/**\n * Standard HTML mark descriptors shared across all renderers\n * (Quill HTML, Semantic HTML, React).\n *\n * These are declarative — the renderer auto-handles tag rendering\n * and injection of collected attributor attrs.\n */\n\nexport const boldMark: SimpleTagMark = { tag: 'strong' };\n\nexport const italicMark: SimpleTagMark = { tag: 'em' };\n\nexport const underlineMark: SimpleTagMark = { tag: 'u' };\n\nexport const strikeMark: SimpleTagMark = { tag: 's' };\n\nexport const codeMark: SimpleTagMark = { tag: 'code' };\n\nexport const scriptMark: SimpleTagMark = {\n  tag: (value) => (value === 'super' ? 'sup' : 'sub'),\n};\n","import type { TNode } from '../../../core/ast-types';\nimport { getAlign, getDirection, getIndent } from '../../common/node-attributes';\n\n/**\n * Get CSS classes for block-level layout attributes (indent, align, direction)\n * using the given class prefix.\n *\n * This is the shared core logic used by both QuillHtmlRenderer (with `'ql'` prefix)\n * and SemanticHtmlRenderer (with a configurable prefix).\n */\nexport function getLayoutClasses(node: TNode, prefix: string): string[] {\n  const classes: string[] = [];\n\n  // Order matches Quill's Parchment attributor application order:\n  // direction → align → indent\n  const direction = getDirection(node);\n  if (direction) {\n    classes.push(`${prefix}-direction-${direction}`);\n  }\n\n  const align = getAlign(node);\n  if (align) {\n    classes.push(`${prefix}-align-${align}`);\n  }\n\n  const indent = getIndent(node);\n  if (indent != null && indent > 0) {\n    classes.push(`${prefix}-indent-${indent}`);\n  }\n\n  return classes;\n}\n","import type { TNode } from '../../core/ast-types';\nimport { getListType } from './node-attributes';\n\n// ─── Code Block ─────────────────────────────────────────────────────────────\n\nexport interface CodeBlockMeta {\n  /** Full class name, e.g. `'ql-syntax language-javascript'` or `'ql-syntax'`. */\n  className: string;\n  /** The language string if present and meaningful, or `undefined`. */\n  language?: string;\n}\n\n/**\n * Resolve the CSS class name and language from a code-block node's attributes.\n *\n * For individual `code-block` nodes (reads `node.attributes['code-block']`).\n * For containers, prefer `resolveCodeBlockLines` instead.\n *\n * @param node - The code-block AST node\n * @param classPrefix - The configured class prefix (e.g. `'ql'`)\n */\nexport function resolveCodeBlockMeta(node: TNode, classPrefix: string): CodeBlockMeta {\n  const lang = node.attributes['code-block'];\n  const syntaxClass = `${classPrefix}-syntax`;\n\n  if (typeof lang === 'string' && lang !== 'true') {\n    return {\n      className: `${syntaxClass} language-${lang}`,\n      language: lang,\n    };\n  }\n\n  return { className: syntaxClass };\n}\n\n/**\n * Build the CSS class name for a `code-block-container` from its resolved language.\n *\n * @param language - The resolved language (from `resolveCodeBlockLines`)\n * @param classPrefix - The configured class prefix (e.g. `'ql'`)\n */\nexport function buildCodeBlockClassName(language: string | undefined, classPrefix: string): string {\n  const syntaxClass = `${classPrefix}-syntax`;\n  return language ? `${syntaxClass} language-${language}` : syntaxClass;\n}\n\n// ─── List Item ──────────────────────────────────────────────────────────────\n\n/**\n * Resolve the `data-checked` value for a list-item node.\n * Returns `'true'` for checked, `'false'` for unchecked, or `undefined`\n * for non-checklist items.\n */\nexport function resolveCheckedState(node: TNode): 'true' | 'false' | undefined {\n  const listType = getListType(node);\n  if (listType === 'checked') return 'true';\n  if (listType === 'unchecked') return 'false';\n  return undefined;\n}\n\n// ─── Link ───────────────────────────────────────────────────────────────────\n\nexport interface LinkMeta {\n  target?: string;\n  rel?: string;\n}\n\n/**\n * Resolve link `target` and `rel` attributes from a node, with fallback\n * to the renderer's global config values.\n *\n * Per-op attributes on the node override the global config.\n */\nexport function resolveLinkMeta(node: TNode, defaultTarget: string, defaultRel?: string): LinkMeta {\n  const target =\n    typeof node.attributes.target === 'string' ? node.attributes.target : defaultTarget;\n  const rel = typeof node.attributes.rel === 'string' ? node.attributes.rel : defaultRel;\n\n  return {\n    target: target || undefined,\n    rel: rel || undefined,\n  };\n}\n","import type { TNode } from '../../core/ast-types';\nimport { asString } from './node-attributes';\n\nexport interface MentionData {\n  name: string;\n  href: string;\n  className?: string;\n  target?: string;\n}\n\n/**\n * Safely narrow a value to a `Record<string, unknown>`.\n * Returns an empty object if the value is not an object.\n */\nfunction asRecord(value: unknown): Record<string, unknown> {\n  return value != null && typeof value === 'object' && !Array.isArray(value)\n    ? (value as Record<string, unknown>)\n    : {};\n}\n\n/**\n * Extract mention properties from a mention embed node.\n *\n * Resolves the `href` from the `end-point` and `slug` fields,\n * falling back to `'about:blank'` if neither is present.\n */\nexport function resolveMentionData(node: TNode): MentionData {\n  const raw = asRecord(node.data) ?? asRecord(node.attributes.mention);\n  const slug = asString(raw.slug);\n  const endpoint = asString(raw['end-point']);\n\n  return {\n    name: String(raw.name ?? ''),\n    href: endpoint && slug ? `${endpoint}/${slug}` : 'about:blank',\n    className: asString(raw.class),\n    target: asString(raw.target),\n  };\n}\n"]}