@ai-matrx/print 0.8.8 → 0.8.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/dist/document.cjs +52 -5
- package/dist/document.cjs.map +1 -1
- package/dist/document.d.cts +10 -2
- package/dist/document.d.ts +10 -2
- package/dist/document.js +52 -5
- package/dist/document.js.map +1 -1
- package/dist/markdown-html.cjs +4207 -0
- package/dist/markdown-html.cjs.map +1 -0
- package/dist/markdown-html.d.cts +87 -0
- package/dist/markdown-html.d.ts +87 -0
- package/dist/markdown-html.js +4176 -0
- package/dist/markdown-html.js.map +1 -0
- package/dist/markdown.cjs +52 -35
- package/dist/markdown.cjs.map +1 -1
- package/dist/markdown.js +52 -35
- package/dist/markdown.js.map +1 -1
- package/dist/safe-html.cjs +68 -0
- package/dist/safe-html.cjs.map +1 -1
- package/dist/safe-html.d.cts +14 -1
- package/dist/safe-html.d.ts +14 -1
- package/dist/safe-html.js +68 -0
- package/dist/safe-html.js.map +1 -1
- package/package.json +11 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/markdown-html.ts","../src/document/math.ts","../src/safe-html.ts","../src/document/settings.ts","../src/document/csl/engine.ts","../src/document/csl/bundled.ts","../src/document/html.ts","../src/directives.ts","../src/document/citations.ts","../src/document/tree.ts","../src/markdown.ts","../src/document.ts"],"sourcesContent":["/**\n * @ai-matrx/print/markdown-html — THE ONE Markdown→HTML engine (Matrx Alchemy\n * CONTRACT §1.9, ALC-16).\n *\n * ONE parse:\n * 1. The platform's one reading of our syntax (`@ai-matrx/content-ir/source`\n * `tokenizeSource`) marks every kind island — a `__kind` JSON block, an\n * inline `__kind` JSON span, and any XML element a projector is\n * registered for. Each island is replaced IN PLACE by an opaque atom\n * placeholder, so an inline island never splits a paragraph, a list item\n * or a table cell.\n * 2. mdast parses the whole text once (`prepareDocument`: the same tree PDF,\n * DOCX and EPUB render from; math is typeset, citations resolved).\n * 3. print's escape-by-construction renderer writes the HTML; each atom is\n * rendered by the `KindHtmlProjector` registered for its kind, or — when\n * none is — as escaped source with a notice.\n * 4. EVERY string this module returns ends in the allow-list\n * (`sanitizeEngineHtml`, `@ai-matrx/print/safe-html`): no raw author\n * HTML, no author style, and each drop is announced by the parse.\n *\n * Skins: `document` / `article` keep print's class vocabulary (styled by the\n * page CSS); `inline` writes every style onto the element (Google Docs and\n * Word drop `<style>` and classes on paste). The inline styles are constants\n * of this module and the allow-list admits exactly those values.\n *\n * Pure and DOM-free: runs in the browser, Node, a worker, the extension\n * service worker and Tauri alike.\n */\n\nimport { tokenizeSource } from \"@ai-matrx/content-ir/source\";\nimport { escapeHtml } from \"@ai-matrx/kit/html-escape\";\nimport { fromHtml } from \"hast-util-from-html\";\nimport { toHtml } from \"hast-util-to-html\";\nimport type { Element, Root, RootContent } from \"hast\";\nimport { prepareDocument, type PrepareDocumentOptions } from \"./document\";\nimport { documentToHtml, renderBlocksHtml, type HtmlRenderContext } from \"./document/html\";\nimport type { Block, DocTree, DocumentNotice, Inline } from \"./document/types\";\nimport { sanitizeEngineHtml } from \"./safe-html\";\n\n/** A sentence a person reads, and what they can do about it. */\nexport interface EngineNotice {\n code: string;\n sentence: string;\n remedy: string;\n}\n\n/** Private or signed images → share-safe URLs before the HTML is sealed. */\nexport interface EngineAssetResolver {\n resolve(url: string, signal: AbortSignal): Promise<{ url: string } | null>;\n}\n\n/** A kind renders into the HTML through its projector; none = escaped source + notice. */\nexport interface KindHtmlProjector {\n kindKey: string;\n toHtml(value: unknown, escape: (s: string) => string): string;\n toPlainText(value: unknown): string;\n}\n\nexport type EngineSkin = \"document\" | \"article\" | \"inline\";\nexport type EngineProfile = \"generic\" | \"google-docs\" | \"word\";\n\n/** One parse. Opaque to callers; hand it back to `fragment` / `document` / `plainText`. */\nexport interface EngineTree {\n readonly doc: DocTree;\n readonly atoms: readonly EngineAtom[];\n readonly images: ReadonlyMap<string, string | null>;\n readonly notices: readonly EngineNotice[];\n}\n\ninterface EngineAtom {\n kindKey: string;\n raw: string;\n inline: boolean;\n value: unknown;\n projector: KindHtmlProjector | null;\n}\n\nexport interface EngineParseOptions extends Omit<PrepareDocumentOptions, \"onNotice\"> {\n onNotice?(notice: EngineNotice): void;\n assets?: EngineAssetResolver;\n signal?: AbortSignal;\n}\n\nexport interface MarkdownHtmlEngine {\n parse(markdown: string, options?: EngineParseOptions): Promise<EngineTree>;\n fragment(tree: EngineTree, options?: { skin?: EngineSkin; profile?: EngineProfile }): string;\n document(tree: EngineTree, options?: { title?: string }): string;\n plainText(tree: EngineTree): string;\n}\n\n// ── atoms ───────────────────────────────────────────────────────────────────\n\nconst ATOM_OPEN = \"\";\nconst ATOM_CLOSE = \"\";\nconst ATOM_ANY = /[]/g;\nconst atom = (i: number) => `${ATOM_OPEN}${i}${ATOM_CLOSE}`;\nconst BLOCK_ATOM_HTML = /<p dir=\"auto\">(\\d+)<\\/p>/g;\nconst INLINE_ATOM = /(\\d+)/g;\n\nconst toNotice = (n: DocumentNotice): EngineNotice => ({ code: n.code, sentence: n.message, remedy: n.remedy });\n\nfunction readJson(raw: string): unknown {\n try {\n return JSON.parse(raw);\n } catch {\n return undefined;\n }\n}\n\n/** Replace every kind island with an atom placeholder (one tokenizer pass). */\nfunction atomize(\n markdown: string,\n projectors: ReadonlyMap<string, KindHtmlProjector>,\n): { text: string; atoms: EngineAtom[] } {\n // An author can never forge an atom: the placeholder characters are removed first.\n const source = markdown.replace(ATOM_ANY, \"\");\n const spans: Array<{ start: number; end: number; kindKey: string; inline: boolean }> = [];\n for (const block of tokenizeSource(source)) {\n if (block.kind === \"island\" && block.complete) {\n const key =\n block.islandType === \"json\" && typeof block.meta.kind === \"string\"\n ? block.meta.kind\n : (block.islandType === \"xml_region\" || block.islandType === \"xml_attr\" || block.islandType === \"xml_container\") &&\n typeof block.meta.tag === \"string\" &&\n projectors.has(block.meta.tag)\n ? block.meta.tag\n : null;\n if (key && !key.startsWith(\"directive_v\")) spans.push({ start: block.start, end: block.end, kindKey: key, inline: false });\n }\n for (const island of block.inlines) {\n if (island.complete && island.islandType === \"kind_json\" && typeof island.meta.kind === \"string\") {\n spans.push({ start: island.start, end: island.end, kindKey: island.meta.kind, inline: true });\n }\n }\n }\n spans.sort((a, b) => a.start - b.start);\n const atoms: EngineAtom[] = [];\n let out = \"\";\n let at = 0;\n for (const s of spans) {\n if (s.start < at) continue;\n const raw = source.slice(s.start, s.end);\n const trimmed = raw.replace(/\\s+$/, \"\");\n const value = raw.trimStart().startsWith(\"{\") ? readJson(trimmed) : trimmed;\n out += source.slice(at, s.start) + atom(atoms.length) + raw.slice(trimmed.length);\n atoms.push({ kindKey: s.kindKey, raw: trimmed, inline: s.inline, value, projector: projectors.get(s.kindKey) ?? null });\n at = s.end;\n }\n return { text: out + source.slice(at), atoms };\n}\n\n// ── images through the asset port ───────────────────────────────────────────\n\nfunction imageUrls(doc: DocTree): string[] {\n const urls = new Set<string>();\n const inl = (nodes: Inline[]) => {\n for (const n of nodes) {\n if (n.type === \"image\") urls.add(n.url);\n if (\"children\" in n) inl(n.children);\n }\n };\n const blk = (blocks: Block[]) => {\n for (const b of blocks) {\n if (b.type === \"figure\") urls.add(b.url);\n if (b.type === \"heading\" || b.type === \"paragraph\") inl(b.children);\n if (b.type === \"list\") for (const it of b.items) blk(it.children);\n if (b.type === \"blockquote\") blk(b.children);\n if (b.type === \"table\") for (const c of [...b.header, ...b.rows.flat()]) inl(c);\n }\n };\n for (const s of doc.sections) blk(s.blocks);\n for (const n of doc.notes) blk(n.children);\n return [...urls];\n}\n\n// ── the inline skin (Docs / Word paste) ─────────────────────────────────────\n\nconst FONT = \"font-family:Arial,Helvetica,sans-serif\";\nconst MONO = \"font-family:Consolas,Menlo,'Courier New',monospace\";\n/** The generic skin: explicit fonts and margins on every block (Docs needs them; Word honours them). */\nconst INLINE_STYLE: Readonly<Record<string, string>> = {\n div: `${FONT};font-size:11pt;line-height:1.5;color:#1f2937`,\n h1: `${FONT};font-size:20pt;font-weight:700;margin:0 0 12px 0`,\n h2: `${FONT};font-size:16pt;font-weight:700;margin:16px 0 8px 0`,\n h3: `${FONT};font-size:13pt;font-weight:700;margin:14px 0 6px 0`,\n h4: `${FONT};font-size:11pt;font-weight:700;margin:12px 0 6px 0`,\n h5: `${FONT};font-size:11pt;font-weight:700;margin:10px 0 4px 0`,\n h6: `${FONT};font-size:11pt;font-weight:700;margin:10px 0 4px 0`,\n p: `${FONT};margin:0 0 10px 0`,\n ul: `${FONT};margin:0 0 10px 0;padding-left:24px`,\n ol: `${FONT};margin:0 0 10px 0;padding-left:24px`,\n li: `${FONT};margin:0 0 4px 0`,\n blockquote: `${FONT};margin:0 0 10px 0;padding-left:12px;border-left:3px solid #d1d5db;color:#4b5563`,\n pre: `${MONO};font-size:10pt;background:#f3f4f6;padding:8px;margin:0 0 10px 0;white-space:pre-wrap`,\n code: `${MONO};font-size:10pt;background:#f3f4f6`,\n table: `${FONT};border-collapse:collapse;margin:0 0 10px 0`,\n th: `${FONT};border:1px solid #d1d5db;padding:4px 8px;font-weight:700;background:#f9fafb`,\n td: `${FONT};border:1px solid #d1d5db;padding:4px 8px`,\n a: \"color:#2563eb;text-decoration:underline\",\n hr: \"border:none;border-top:1px solid #d1d5db;margin:12px 0\",\n img: \"max-width:100%\",\n figure: \"margin:0 0 10px 0\",\n figcaption: `${FONT};font-size:9pt;color:#4b5563`,\n};\nconst PROFILE_STYLE: Readonly<Record<EngineProfile, Readonly<Record<string, string>>>> = {\n // A destination profile becomes its own action only once its bytes differ from\n // `generic` (CONTRACT 1.9a). Until then every profile writes the generic skin.\n generic: INLINE_STYLE,\n \"google-docs\": INLINE_STYLE,\n word: INLINE_STYLE,\n};\nconst ALIGNS = [\"left\", \"center\", \"right\"] as const;\n\nfunction inlineStyleValues(styles: Readonly<Record<string, string>>): string[] {\n const values = Object.values(styles);\n for (const cell of [\"th\", \"td\"]) for (const a of ALIGNS) values.push(`${styles[cell]};text-align:${a}`);\n return values;\n}\n\nfunction applyInlineSkin(html: string, styles: Readonly<Record<string, string>>): string {\n const tree = fromHtml(html, { fragment: true }) as Root;\n const walk = (nodes: RootContent[], inPre: boolean) => {\n for (const node of nodes) {\n if (node.type !== \"element\") continue;\n const el = node as Element;\n const props = el.properties ?? {};\n const align = typeof props.style === \"string\" ? /text-align:\\s*(left|center|right)/.exec(props.style)?.[1] : undefined;\n delete props.className;\n delete props.style;\n const base = el.tagName === \"code\" && inPre ? undefined : styles[el.tagName];\n if (base) props.style = align && (el.tagName === \"th\" || el.tagName === \"td\") ? `${base};text-align:${align}` : base;\n el.properties = props;\n walk(el.children as RootContent[], inPre || el.tagName === \"pre\");\n }\n };\n walk(tree.children, false);\n const wrapper: Element = { type: \"element\", tagName: \"div\", properties: { style: styles.div ?? \"\" }, children: tree.children as Element[\"children\"] };\n return toHtml({ type: \"root\", children: [wrapper] }, { characterReferences: { useNamedReferences: true } });\n}\n\n// ── plain text from the one parse ───────────────────────────────────────────\n\nfunction inlinePlainText(nodes: Inline[]): string {\n return nodes\n .map((n): string => {\n switch (n.type) {\n case \"text\":\n case \"code\":\n return n.value;\n case \"strong\":\n case \"emphasis\":\n case \"delete\":\n case \"link\":\n return inlinePlainText(n.children);\n case \"xref\":\n case \"cite\":\n return n.label;\n case \"image\":\n return n.alt;\n case \"math\":\n // Plain text keeps the TeX source (CONTRACT 1.9a).\n return n.display ? `$$${n.tex}$$` : `$${n.tex}$`;\n case \"break\":\n return \"\\n\";\n case \"noteRef\":\n return `[${n.n}]`;\n default:\n return \"\";\n }\n })\n .join(\"\");\n}\n\nfunction blocksPlain(blocks: Block[], t: EngineTree, depth = 0): string[] {\n const out: string[] = [];\n const inl = (nodes: Inline[]) => atomsPlain(inlinePlainText(nodes), t);\n for (const b of blocks) {\n switch (b.type) {\n case \"heading\":\n out.push(inl(b.children));\n break;\n case \"paragraph\":\n out.push(inl(b.children));\n break;\n case \"list\":\n b.items.forEach((item, i) => {\n const marker = b.ordered ? `${b.start + i}.` : \"-\";\n const box = item.checked === null ? \"\" : item.checked ? \"[x] \" : \"[ ] \";\n const inner = blocksPlain(item.children, t, depth + 1).join(\"\\n\");\n out.push(`${\" \".repeat(depth)}${marker} ${box}${inner.replace(/\\n/g, `\\n${\" \".repeat(depth + 1)}`)}`);\n });\n break;\n case \"blockquote\":\n out.push(blocksPlain(b.children, t, depth).join(\"\\n\\n\"));\n break;\n case \"code\":\n out.push(b.value);\n break;\n case \"table\":\n // A table reads as tab-separated cells, never raw pipe syntax.\n out.push([b.header, ...b.rows].map((row) => row.map((c) => inl(c)).join(\"\\t\")).join(\"\\n\"));\n break;\n case \"figure\":\n out.push(b.alt);\n break;\n case \"rule\":\n out.push(\"\");\n break;\n case \"math\":\n out.push(`$$${b.tex}$$`);\n break;\n case \"notes\":\n for (const n of t.doc.notes) out.push(`${n.n}. ${blocksPlain(n.children, t).join(\" \")}`);\n break;\n case \"bibliography\":\n for (const e of t.doc.bibliography) out.push(inl(e.children));\n break;\n default:\n break;\n }\n }\n return out;\n}\n\nfunction atomsPlain(text: string, t: EngineTree): string {\n return text.replace(INLINE_ATOM, (_m, i: string) => {\n const a = t.atoms[Number(i)];\n if (!a) return \"\";\n return a.projector ? a.projector.toPlainText(a.value) : a.raw;\n });\n}\n\n// ── rendering ───────────────────────────────────────────────────────────────\n\nfunction atomHtml(a: EngineAtom): string {\n if (a.projector) return a.projector.toHtml(a.value, escapeHtml);\n return a.inline\n ? `<code class=\"doc-kind-source\" data-label=\"${escapeHtml(a.kindKey)}\">${escapeHtml(a.raw)}</code>`\n : `<pre class=\"doc-code doc-kind-source\" data-label=\"${escapeHtml(a.kindKey)}\"><code>${escapeHtml(a.raw)}</code></pre>`;\n}\n\nfunction substituteAtoms(html: string, t: EngineTree): string {\n return html\n .replace(BLOCK_ATOM_HTML, (_m, i: string) => {\n const a = t.atoms[Number(i)];\n return a ? atomHtml(a) : \"\";\n })\n .replace(INLINE_ATOM, (_m, i: string) => {\n const a = t.atoms[Number(i)];\n return a ? atomHtml(a) : \"\";\n });\n}\n\nfunction renderContext(t: EngineTree): HtmlRenderContext {\n if (t.images.size === 0) return { tree: t.doc };\n return { tree: t.doc, srcFor: (url: string) => (t.images.has(url) ? (t.images.get(url) ?? null) : url) };\n}\n\n/** Create the engine. Projectors are keyed by kind; a second one for the same kind is refused. */\nexport function createMarkdownHtmlEngine(options: { projectors?: readonly KindHtmlProjector[] } = {}): MarkdownHtmlEngine {\n const projectors = new Map<string, KindHtmlProjector>();\n for (const p of options.projectors ?? []) {\n if (projectors.has(p.kindKey)) throw new Error(`Two HTML projectors for the kind \"${p.kindKey}\"; register one.`);\n projectors.set(p.kindKey, p);\n }\n\n return {\n async parse(markdown, opts = {}) {\n const notices: EngineNotice[] = [];\n const notify = (n: EngineNotice) => {\n notices.push(n);\n opts.onNotice?.(n);\n };\n const { text, atoms } = atomize(markdown ?? \"\", projectors);\n const { onNotice: _ignored, assets, signal, ...prepare } = opts;\n const doc = await prepareDocument(text, { ...prepare, onNotice: (n) => notify(toNotice(n)) });\n const unprojected = [...new Set(atoms.filter((a) => !a.projector).map((a) => a.kindKey))];\n for (const kindKey of unprojected) {\n notify({\n code: \"kind-unprojected\",\n sentence: `The \"${kindKey}\" content is shown as its source here, because it has no formatted version yet.`,\n remedy: \"Copy it as Markdown to keep it exactly, or open it in AI Matrx to see it rendered.\",\n });\n }\n const images = new Map<string, string | null>();\n if (assets) {\n const controller = signal ?? new AbortController().signal;\n await Promise.all(\n imageUrls(doc).map(async (url) => {\n let resolved: { url: string } | null = null;\n try {\n resolved = await assets.resolve(url, controller);\n } catch {\n resolved = null;\n }\n images.set(url, resolved?.url ?? null);\n if (!resolved) {\n notify({\n code: \"image-unavailable\",\n sentence: `An image could not be included, so its description is shown instead: ${url.length > 90 ? `${url.slice(0, 87)}…` : url}`,\n remedy: \"Use an image stored in AI Matrx or a public link, then copy again.\",\n });\n }\n }),\n );\n }\n return { doc, atoms, images, notices };\n },\n\n fragment(t, opts = {}) {\n const x = renderContext(t);\n const body = t.doc.sections.map((s) => renderBlocksHtml(s.blocks, x)).join(\"\\n\");\n const safe = sanitizeEngineHtml(substituteAtoms(body, t));\n if (opts.skin !== \"inline\") return safe;\n const styles = PROFILE_STYLE[opts.profile ?? \"generic\"];\n // The skin writes only this module's constants; the allow-list admits exactly those.\n return sanitizeEngineHtml(applyInlineSkin(safe, styles), inlineStyleValues(styles));\n },\n\n document(t, opts = {}) {\n const doc = opts.title && !t.doc.settings.title ? { ...t.doc, settings: { ...t.doc.settings, title: opts.title } } : t.doc;\n const srcFor = renderContext(t).srcFor;\n return documentToHtml(doc, {\n ...(srcFor ? { srcFor } : {}),\n transformBody: (html) => sanitizeEngineHtml(substituteAtoms(html, t)),\n });\n },\n\n plainText(t) {\n return blocksPlain(t.doc.sections.flatMap((s) => s.blocks), t)\n .join(\"\\n\\n\")\n .replace(/\\n{3,}/g, \"\\n\\n\")\n .trim();\n },\n };\n}\n","/**\n * Math in documents — ONE math dialect, typeset in every format.\n *\n * What is math is decided ONLY by the shared tokenizer (`@ai-matrx/content-ir/\n * source`): its fence-nesting rule finds code, its pairing finds `$$…$$`,\n * `$…$` (math, not currency), `\\[…\\]` and `\\(…\\)`. Math is lifted out\n * BEFORE markdown parsing, so a TeX `\\,` is never eaten as a markdown escape\n * and `_`/`*` inside a formula never become emphasis.\n *\n * Typesetting: MathJax (TeX → its internal tree) produces\n * - SVG for PDF display math (drawn as vector paths; allow-list sanitized),\n * - MathML for HTML and EPUB (rendered natively by browsers and readers),\n * - MathML that the Word writer turns into native OMML equations and the\n * PDF writer turns into inline text with real super/subscripts.\n */\n\nimport { listIslands, tokenizeSource } from \"@ai-matrx/content-ir/source\";\nimport { sanitizeMathml, sanitizeMathSvg } from \"../safe-html\";\n\nexport const MATH_OPEN = \"\\uE100\";\nexport const MATH_CLOSE = \"\\uE101\";\nexport const MATH_TOKEN_RE = /\\uE100(\\d+)\\uE101/g;\n\nexport interface MathSpan {\n tex: string;\n display: boolean;\n}\n\nconst DELIMITERS: Record<string, { open: number; close: number; display: boolean }> = {\n $$: { open: 2, close: 2, display: true },\n \"\\\\[\": { open: 2, close: 2, display: true },\n $: { open: 1, close: 1, display: false },\n \"\\\\(\": { open: 2, close: 2, display: false },\n};\n\n/**\n * Replace every math span with a private-use token; returns the spans.\n *\n * Print keeps NO fence, code-span or math detection of its own: the spans are\n * the shared tokenizer's complete `math_block` / `math_inline` islands\n * (`tokenizeSource` + `listIslands` from `@ai-matrx/content-ir/source` — the\n * one fence-nesting rule and the one math pairing), so print, the renderer and\n * the editor can never disagree about what is math. The delimiter decides the\n * form: `$$`/`\\[` display, `$`/`\\(` inline.\n */\nexport function extractMath(body: string): { text: string; spans: MathSpan[] } {\n const spans: MathSpan[] = [];\n if (!/[$\\\\]/.test(body)) return { text: body, spans };\n const islands = listIslands(tokenizeSource(body))\n .filter((isl) => isl.complete && (isl.islandType === \"math_block\" || isl.islandType === \"math_inline\"))\n .sort((a, b) => a.start - b.start);\n let out = \"\";\n let at = 0;\n for (const isl of islands) {\n const d = DELIMITERS[String(isl.meta.delimiter ?? \"\")];\n if (!d || isl.start < at) continue;\n out += body.slice(at, isl.start);\n spans.push({ tex: body.slice(isl.start + d.open, isl.end - d.close).trim(), display: d.display });\n out += `${MATH_OPEN}${spans.length - 1}${MATH_CLOSE}`;\n at = isl.end;\n }\n return { text: out + body.slice(at), spans };\n}\n\n// ── typesetting ────────────────────────────────────────────────────────────\n\nexport interface TypesetMath {\n /** MathML (<math …>…</math>) for HTML/EPUB and the Word/PDF-inline writers. */\n mathml: string;\n /** SVG for PDF display math; widths in ex (1ex ≈ 0.442em in MathJax). */\n svg?: string | undefined;\n widthEx?: number | undefined;\n heightEx?: number | undefined;\n /** Error message when the TeX could not be typeset. */\n error?: string | undefined;\n}\n\nexport const mathKey = (tex: string, display: boolean): string => `${display ? \"D\" : \"I\"}:${tex}`;\n\ntype MathJaxKit = {\n svg: (tex: string, display: boolean) => string;\n mml: (tex: string, display: boolean) => string;\n};\n\nconst MATHJAX = Symbol.for(\"ai-matrx.print.document.mathjax\");\n\nasync function loadMathJax(): Promise<MathJaxKit> {\n const g = globalThis as unknown as Record<symbol, Promise<MathJaxKit> | undefined>;\n if (g[MATHJAX]) return g[MATHJAX] as Promise<MathJaxKit>;\n g[MATHJAX] = (async () => {\n const [{ mathjax }, { TeX }, { SVG }, { liteAdaptor }, { RegisterHTMLHandler }, { AllPackages }, { SerializedMmlVisitor }, { STATE }] =\n await Promise.all([\n import(\"mathjax-full/js/mathjax.js\"),\n import(\"mathjax-full/js/input/tex.js\"),\n import(\"mathjax-full/js/output/svg.js\"),\n import(\"mathjax-full/js/adaptors/liteAdaptor.js\"),\n import(\"mathjax-full/js/handlers/html.js\"),\n import(\"mathjax-full/js/input/tex/AllPackages.js\"),\n import(\"mathjax-full/js/core/MmlTree/SerializedMmlVisitor.js\"),\n import(\"mathjax-full/js/core/MathItem.js\"),\n ]);\n const adaptor = liteAdaptor();\n RegisterHTMLHandler(adaptor);\n const doc = mathjax.document(\"\", {\n InputJax: new TeX({ packages: AllPackages }),\n OutputJax: new SVG({ fontCache: \"none\" }),\n });\n const visitor = new SerializedMmlVisitor();\n return {\n svg: (tex, display) => adaptor.innerHTML(doc.convert(tex, { display }) as never),\n mml: (tex, display) => visitor.visitTree(doc.convert(tex, { display, end: STATE.CONVERT }) as never),\n };\n })();\n return g[MATHJAX] as Promise<MathJaxKit>;\n}\n\n/** Typeset every math span once; keyed by `mathKey`. */\nexport async function typesetMathSpans(spans: MathSpan[]): Promise<Map<string, TypesetMath>> {\n const out = new Map<string, TypesetMath>();\n if (spans.length === 0) return out;\n const mj = await loadMathJax();\n for (const s of spans) {\n const key = mathKey(s.tex, s.display);\n if (out.has(key)) continue;\n try {\n const mathml = mj.mml(s.tex, s.display);\n const err = /<merror[\\s\\S]*?<mtext[^>]*>([\\s\\S]*?)<\\/mtext>/.exec(mathml);\n if (err) {\n out.set(key, { mathml: sanitizeMathml(mathml), error: decodeXml(err[1] as string) });\n continue;\n }\n // TeX is author input: `\\href`, `\\style`, `\\bbox[…]`, `\\mmlToken` reach\n // MathML attributes, so the typeset MathML goes through the allow-list.\n const entry: TypesetMath = { mathml: sanitizeMathml(mathml.replace(/\\n\\s*/g, \"\")) };\n if (s.display) {\n // The same author TeX reaches the SVG as <a href>, style, class and id\n // (LIST T26): only the drawing survives.\n const svg = sanitizeMathSvg(mj.svg(s.tex, true));\n entry.svg = svg;\n entry.widthEx = Number(/width=\"([\\d.]+)ex\"/.exec(svg)?.[1] ?? 0);\n entry.heightEx = Number(/height=\"([\\d.]+)ex\"/.exec(svg)?.[1] ?? 0);\n }\n out.set(key, entry);\n } catch (e) {\n out.set(key, { mathml: \"\", error: (e as Error).message });\n }\n }\n return out;\n}\n\n// ── a small MathML reader (MathJax's serializer output is well-formed XML) ──\n\nexport interface MNode {\n tag: string;\n attrs: Record<string, string>;\n children: MNode[];\n text: string;\n}\n\nexport function decodeXml(s: string): string {\n return s.replace(/&(#x[0-9a-f]+|#\\d+|amp|lt|gt|quot|apos);/gi, (m, e: string) => {\n if (e[0] === \"#\") return String.fromCodePoint(e[1] === \"x\" || e[1] === \"X\" ? parseInt(e.slice(2), 16) : Number(e.slice(1)));\n return ({ amp: \"&\", lt: \"<\", gt: \">\", quot: '\"', apos: \"'\" } as Record<string, string>)[e.toLowerCase()] ?? m;\n });\n}\n\nexport function parseMathML(xml: string): MNode {\n const root: MNode = { tag: \"#root\", attrs: {}, children: [], text: \"\" };\n const stack: MNode[] = [root];\n for (const m of xml.matchAll(/<(\\/?)([\\w:-]+)((?:\\s+[\\w:-]+=\"[^\"]*\")*)\\s*(\\/?)>|([^<]+)/g)) {\n const top = stack[stack.length - 1] as MNode;\n if (m[5] !== undefined) {\n const t = decodeXml(m[5]);\n if (t.trim() || top.tag === \"mtext\" || top.tag === \"mo\") top.text += t;\n continue;\n }\n if (m[1] === \"/\") {\n if (stack.length > 1) stack.pop();\n continue;\n }\n const attrs: Record<string, string> = {};\n for (const a of (m[3] ?? \"\").matchAll(/([\\w:-]+)=\"([^\"]*)\"/g)) attrs[a[1] as string] = decodeXml(a[2] as string);\n const node: MNode = { tag: (m[2] as string).replace(/^m:/, \"\"), attrs, children: [], text: \"\" };\n top.children.push(node);\n if (m[4] !== \"/\") stack.push(node);\n }\n return root.children[0] ?? root;\n}\n\n/** Flatten to plain text (the linear reading of a formula). */\nexport function mathText(n: MNode): string {\n if (n.children.length === 0) return n.text;\n return n.children.map(mathText).join(\"\");\n}\n","/**\n * @ai-matrx/print/safe-html — THE allow-list every Markdown→HTML string this\n * package hands out goes through.\n *\n * Why an allow-list: the regex converter (`markdownToHtml` /\n * `markdownToArticleHtml`) lets author raw HTML through so a document can feed\n * WordPress. Its old guard was a block-list (script, style, on… handlers,\n * javascript: URLs) and everything nobody listed — `<iframe>`, `<form>`,\n * `<meta http-equiv=refresh>`, `<object>`/`<embed>`, `<base>`, `<link>`,\n * inline `style` — reached the clipboard, the downloaded page and the preview.\n * Now a tag or attribute survives only when it is listed here.\n *\n * Sync and DOM-free (parse5 via hast), so it runs in Node, workers, the\n * extension service worker and Tauri alike.\n *\n * Two schemas:\n * • `SAFE_HTML_SCHEMA` — GitHub's rendering rules (hast-util-sanitize's\n * default schema) with no id clobber-prefixing and the \"drop the element\n * AND its text\" list for elements whose text is not prose. For any host\n * that renders plain semantic HTML (email bodies, CMS drafts).\n * • `PRINT_HTML_SCHEMA` — the same, plus exactly the vocabulary print's own\n * converters emit: `matrx-*` / `print-*` / `code-*` / `doc-*` classes,\n * table-cell alignment, the flashcard checkbox + label, figures, and the\n * page-break separator's data/aria attributes.\n */\n\nimport { fromHtml } from \"hast-util-from-html\";\nimport { defaultSchema, sanitize, type Schema } from \"hast-util-sanitize\";\nimport { toHtml } from \"hast-util-to-html\";\nimport type { Root } from \"hast\";\n\ntype Attributes = NonNullable<Schema[\"attributes\"]>;\ntype AttributeList = Attributes[string];\n\n/** Elements removed together with their content (their text is not prose). */\nconst STRIP_WITH_CONTENT = [\n \"script\",\n \"style\",\n \"noscript\",\n \"template\",\n \"iframe\",\n \"object\",\n \"embed\",\n \"textarea\",\n \"select\",\n \"head\",\n \"title\",\n];\n\n/** Never allowed, whatever a schema extension adds. */\nexport const FORBIDDEN_TAGS: readonly string[] = [\n ...STRIP_WITH_CONTENT,\n \"form\",\n \"meta\",\n \"base\",\n \"link\",\n \"frame\",\n \"frameset\",\n \"applet\",\n \"button\",\n \"svg\",\n \"math\",\n];\n\nconst baseAttributes = defaultSchema.attributes ?? {};\n\nexport const SAFE_HTML_SCHEMA: Schema = {\n ...defaultSchema,\n tagNames: (defaultSchema.tagNames ?? []).filter((t) => !FORBIDDEN_TAGS.includes(t)),\n strip: STRIP_WITH_CONTENT,\n // Authored anchors keep their names; the GitHub `user-content-` rewrite\n // would also break `<label for>` → `<input id>` pairs.\n clobberPrefix: \"\",\n clobber: [],\n};\n\n/** Class tokens print's converters emit. Author classes outside these are dropped. */\nconst PRINT_CLASS = /^(?:(?:matrx|print|code|doc|language)-[\\w-]*|inline-code|is-checked)$/;\n\n/**\n * A tag's own `className` definition wins over `'*'` (and returns an empty\n * list rather than falling through), so the print class pattern is merged into\n * every definition that names `className`, and added where none does.\n */\nfunction withPrintClasses(defs: AttributeList = []): AttributeList {\n let found = false;\n const out = defs.map((d) => {\n if (Array.isArray(d) && d[0] === \"className\") {\n found = true;\n return [...d, PRINT_CLASS] as unknown as typeof d;\n }\n return d;\n });\n return found ? out : [...out, [\"className\", PRINT_CLASS]];\n}\n\nconst printAttributes: Attributes = Object.fromEntries(\n Object.entries(baseAttributes).map(([tag, defs]) => [tag, withPrintClasses(defs)]),\n);\n\nconst cellAlign = [\"style\", /^text-align:\\s*(?:left|center|right);?$/] as const;\n\nexport const PRINT_HTML_SCHEMA: Schema = {\n ...SAFE_HTML_SCHEMA,\n tagNames: [\n ...new Set([...(SAFE_HTML_SCHEMA.tagNames ?? []), \"section\", \"figure\", \"figcaption\", \"label\"]),\n ],\n attributes: {\n ...printAttributes,\n \"*\": [\n ...(baseAttributes[\"*\"] ?? []),\n [\"className\", PRINT_CLASS],\n \"role\",\n \"ariaLabel\",\n \"ariaHidden\",\n \"dataLabel\",\n \"dataLanguage\",\n \"dataArtifactType\",\n ],\n // Table-cell alignment is the one inline style the converter writes.\n td: withPrintClasses([...(baseAttributes[\"td\"] ?? []), [...cellAlign]]),\n th: withPrintClasses([...(baseAttributes[\"th\"] ?? []), [...cellAlign]]),\n // The flashcard flip is a checkbox + label pair (GitHub forces `disabled`).\n input: withPrintClasses([[\"type\", \"checkbox\"], \"checked\"]),\n label: withPrintClasses([\"htmlFor\"]),\n },\n required: { input: { type: \"checkbox\" } },\n protocols: {\n ...defaultSchema.protocols,\n href: [...(defaultSchema.protocols?.href ?? []), \"tel\"],\n // Embedded images (`data:image/png;base64,…`) — an <img> never runs script.\n src: [...(defaultSchema.protocols?.src ?? []), \"data\"],\n },\n};\n\n/** Sanitize an HTML fragment against an allow-list (default: `SAFE_HTML_SCHEMA`). */\nexport function sanitizeHtmlFragment(html: string, schema: Schema = SAFE_HTML_SCHEMA): string {\n if (!html) return \"\";\n const tree = sanitize(fromHtml(html, { fragment: true }), schema) as Root;\n return toHtml(tree, { characterReferences: { useNamedReferences: true } });\n}\n\n/** Sanitize the output of print's own converters (keeps the `.matrx-*` vocabulary). */\nexport function sanitizePrintHtml(html: string): string {\n return sanitizeHtmlFragment(html, PRINT_HTML_SCHEMA);\n}\n\nexport type { Schema as SafeHtmlSchema };\n\n/**\n * MathML from the TeX typesetter. TeX is author input, and MathJax's `html`,\n * `bbox` and `\\mmlToken` commands turn it into attributes (`\\href{javascript:…}`\n * → `href`, `\\style{position:fixed…}` / `\\bbox[position:fixed]` → `style`).\n * Only presentation MathML elements and their layout attributes survive.\n */\nconst MATHML_TAGS = [\n \"math\", \"maction\", \"annotation\", \"menclose\", \"merror\", \"mfrac\", \"mglyph\", \"mi\",\n \"mlabeledtr\", \"mmultiscripts\", \"mn\", \"mo\", \"mover\", \"mpadded\", \"mphantom\", \"mprescripts\", \"none\",\n \"mroot\", \"mrow\", \"ms\", \"mspace\", \"msqrt\", \"mstyle\", \"msub\", \"msubsup\", \"msup\", \"mtable\", \"mtd\",\n \"mtext\", \"mtr\", \"munder\", \"munderover\", \"semantics\",\n];\n\nconst MATHML_ATTRIBUTES = [\n \"xmlns\", \"display\", \"displaystyle\", \"mathvariant\", \"mathsize\", \"mathcolor\", \"mathbackground\",\n \"scriptlevel\", \"dir\", \"fence\", \"form\", \"largeop\", \"lspace\", \"rspace\", \"movablelimits\",\n \"separator\", \"stretchy\", \"symmetric\", \"maxsize\", \"minsize\", \"accent\", \"accentunder\", \"align\",\n \"columnalign\", \"rowalign\", \"columnspacing\", \"rowspacing\", \"columnlines\", \"rowlines\", \"frame\",\n \"framespacing\", \"equalrows\", \"equalcolumns\", \"linethickness\", \"numalign\", \"denomalign\",\n \"bevelled\", \"notation\", \"width\", \"height\", \"depth\", \"voffset\", \"lquote\", \"rquote\", \"columnspan\",\n \"rowspan\", \"encoding\", \"open\", \"close\", \"separators\", \"actiontype\", \"selection\", \"mslinebreak\",\n \"linebreak\", \"indentalign\", \"data*\",\n];\n\nexport const MATHML_SCHEMA: Schema = {\n tagNames: MATHML_TAGS,\n attributes: { \"*\": MATHML_ATTRIBUTES },\n strip: [\"script\", \"style\"],\n clobberPrefix: \"\",\n clobber: [],\n protocols: {},\n};\n\n/** Sanitize a typeset MathML string (keeps layout, drops links and styles). */\nexport function sanitizeMathml(mathml: string): string {\n return sanitizeHtmlFragment(mathml, MATHML_SCHEMA);\n}\n\n/**\n * SVG from the TeX typesetter (PDF display math, LIST T26). MathJax's `\\href`,\n * `\\style`, `\\class`, `\\cssId`, `\\bbox[…]` and `\\mmlToken[…]` reach the SVG as\n * `<a href=\"javascript:…\">`, `style=\"position:fixed…\"`, `class`, `id`. The PDF\n * writer draws this SVG, and any host that shows it would too, so only the\n * drawing vocabulary survives: shapes, paths, text, transforms and paint. A\n * link wrapper is unwrapped (its glyphs stay), everything else is dropped.\n */\nconst MATH_SVG_TAGS = [\"svg\", \"g\", \"path\", \"rect\", \"line\", \"polyline\", \"polygon\", \"circle\", \"ellipse\", \"text\", \"title\", \"desc\"];\n\nconst MATH_SVG_ATTRIBUTES = [\n \"xmlns\", \"width\", \"height\", \"viewBox\", \"role\", \"focusable\", \"ariaHidden\", \"ariaLabel\",\n \"stroke\", \"fill\", \"strokeWidth\", \"strokeLinecap\", \"strokeLinejoin\", \"transform\", \"d\",\n \"x\", \"y\", \"x1\", \"y1\", \"x2\", \"y2\", \"points\", \"cx\", \"cy\", \"r\", \"rx\", \"ry\",\n \"dataMmlNode\", \"dataC\",\n];\n\nexport const MATH_SVG_SCHEMA: Schema = {\n tagNames: MATH_SVG_TAGS,\n attributes: { \"*\": MATH_SVG_ATTRIBUTES },\n strip: [\"script\", \"style\", \"foreignObject\"],\n clobberPrefix: \"\",\n clobber: [],\n protocols: {},\n};\n\n/** Sanitize a typeset math SVG (keeps the drawing, drops links, styles, classes and ids). */\nexport function sanitizeMathSvg(svg: string): string {\n return sanitizeHtmlFragment(svg, MATH_SVG_SCHEMA);\n}\n\n/**\n * THE final allow-list of the one Markdown→HTML engine (`@ai-matrx/print/\n * markdown-html`, CONTRACT §1.9): print's own vocabulary plus typeset MathML\n * (MathML elements carry only the MathML layout attributes), and — for the\n * inline clipboard skin only — `style` attributes whose value is EXACTLY one\n * the engine itself wrote (`inlineStyles`). An author can never reach a style.\n */\nexport function engineHtmlSchema(inlineStyles: readonly string[] = []): Schema {\n const exact = inlineStyles.length\n ? [new RegExp(`^(?:${[...new Set(inlineStyles)].map((s) => s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")).join(\"|\")})$`)]\n : [];\n const mathAttributes = Object.fromEntries(MATHML_TAGS.map((tag) => [tag, MATHML_ATTRIBUTES]));\n const printAttrs = PRINT_HTML_SCHEMA.attributes ?? {};\n const styled = (defs: AttributeList = []): AttributeList =>\n exact.length ? [...defs.filter((d) => !(Array.isArray(d) && d[0] === \"style\")), [\"style\", ...exact]] : defs;\n const attributes: Attributes = { ...printAttrs, ...mathAttributes };\n if (exact.length) {\n for (const tag of new Set([...(PRINT_HTML_SCHEMA.tagNames ?? []), \"div\", \"span\"])) {\n if (MATHML_TAGS.includes(tag)) continue;\n attributes[tag] = styled(printAttrs[tag] ?? []);\n }\n // Table cells keep their alignment AND the skin's cell style (the skin writes both into one value).\n }\n return {\n ...PRINT_HTML_SCHEMA,\n tagNames: [...new Set([...(PRINT_HTML_SCHEMA.tagNames ?? []), ...MATHML_TAGS])],\n attributes,\n };\n}\n\n/** Sanitize the engine's output (see `engineHtmlSchema`). */\nexport function sanitizeEngineHtml(html: string, inlineStyles: readonly string[] = []): string {\n return sanitizeHtmlFragment(html, engineHtmlSchema(inlineStyles));\n}\n","/**\n * Document settings carried in the markdown source's YAML frontmatter.\n *\n * Grammar: the source's FIRST line is exactly `---`; the block ends at the\n * next line that is exactly `---` or `...`; the lines between are YAML 1.2\n * (core schema — `2026-09-25` stays a string). A leading `---` with no closing\n * line is a thematic break, not frontmatter. This is the same rule pandoc,\n * Jekyll, Hugo and Obsidian use.\n *\n * Keys follow pandoc's names where pandoc has one (`title`, `subtitle`,\n * `author`, `date`, `lang`, `papersize`, `geometry`, `toc`, `toc-depth`,\n * `numbersections`, `csl`, `references`, `fontsize`) and accept camelCase /\n * snake_case / kebab-case spellings of every key. Unknown keys are ignored\n * silently (frontmatter is shared with other tools); a KNOWN key with a value\n * we cannot use is announced with the remedy.\n */\n\nimport { parse as parseYaml } from \"yaml\";\nimport { cslStyleId } from \"./csl/engine\";\nimport type {\n CitationStyle,\n CslItem,\n CslName,\n DocumentNotice,\n DocumentSettings,\n Margins,\n Orientation,\n PageSizeName,\n RunningTemplate,\n} from \"./types\";\n\n/** Portrait page sizes in points. */\nexport const PAGE_SIZES: Readonly<Record<PageSizeName, { width: number; height: number; label: string }>> = {\n letter: { width: 612, height: 792, label: \"Letter\" },\n legal: { width: 612, height: 1008, label: \"Legal\" },\n tabloid: { width: 792, height: 1224, label: \"Tabloid\" },\n executive: { width: 522, height: 756, label: \"Executive\" },\n a3: { width: 841.89, height: 1190.55, label: \"A3\" },\n a4: { width: 595.28, height: 841.89, label: \"A4\" },\n a5: { width: 419.53, height: 595.28, label: \"A5\" },\n b5: { width: 498.9, height: 708.66, label: \"B5\" },\n};\n\nexport const DEFAULT_FOOTER: RunningTemplate = { center: \"Page {page} of {pages}\" };\n\n/** Reference-list heading by CSL style id (a heading is not part of CSL). */\nconst BIBLIOGRAPHY_TITLES: Record<string, string> = {\n \"modern-language-association\": \"Works Cited\",\n \"chicago-notes-bibliography\": \"Bibliography\",\n};\n\nexport interface FrontmatterSplit {\n /** Parsed YAML mapping (empty when there is no frontmatter). */\n data: Record<string, unknown>;\n /** The markdown after the frontmatter block. */\n body: string;\n /** The raw YAML text, or null when the source has no frontmatter. */\n raw: string | null;\n}\n\n/** Split `---` YAML frontmatter off a markdown source. Never throws. */\nexport function splitFrontmatter(source: string, notices?: DocumentNotice[]): FrontmatterSplit {\n const text = source.replace(/^/, \"\");\n const lines = text.split(/\\r?\\n/);\n if (lines[0]?.trim() !== \"---\" || lines[0] !== lines[0].trimStart()) {\n return { data: {}, body: text, raw: null };\n }\n let close = -1;\n for (let i = 1; i < lines.length; i++) {\n const t = (lines[i] as string).trimEnd();\n if (t === \"---\" || t === \"...\") {\n close = i;\n break;\n }\n }\n if (close === -1) return { data: {}, body: text, raw: null };\n const raw = lines.slice(1, close).join(\"\\n\");\n const body = lines.slice(close + 1).join(\"\\n\");\n let data: unknown;\n try {\n data = raw.trim() ? parseYaml(raw) : {};\n } catch (err) {\n notices?.push({\n code: \"frontmatter-invalid\",\n message: `The document settings at the top could not be read: ${(err as Error).message.split(\"\\n\")[0]}`,\n remedy: \"Fix the YAML between the two --- lines (every setting is `name: value`, lists use `- item`).\",\n });\n return { data: {}, body, raw };\n }\n if (data === null || typeof data !== \"object\" || Array.isArray(data)) {\n notices?.push({\n code: \"frontmatter-invalid\",\n message: \"The document settings at the top are not a list of `name: value` settings.\",\n remedy: \"Write one setting per line between the --- lines, e.g. `title: Annual report`.\",\n });\n return { data: {}, body, raw };\n }\n return { data: data as Record<string, unknown>, body, raw };\n}\n\n/** Normalize a key: `toc-depth`, `toc_depth`, `tocDepth` → `tocdepth`. */\nconst norm = (k: string): string => k.replace(/[-_\\s]/g, \"\").toLowerCase();\n\nfunction flatten(data: Record<string, unknown>): Map<string, unknown> {\n const out = new Map<string, unknown>();\n for (const [k, v] of Object.entries(data)) out.set(norm(k), v);\n // `page:` / `print:` / `document:` nested blocks carry the same keys.\n for (const nest of [\"page\", \"print\", \"document\", \"layout\"]) {\n const v = out.get(nest);\n if (v && typeof v === \"object\" && !Array.isArray(v)) {\n for (const [k, inner] of Object.entries(v as Record<string, unknown>)) {\n const key = norm(k);\n if (!out.has(key) || nest !== \"page\") out.set(key, inner);\n if (nest === \"page\" && !out.has(`page${key}`)) out.set(`page${key}`, inner);\n }\n }\n }\n return out;\n}\n\nconst str = (v: unknown): string | undefined => {\n if (v === null || v === undefined) return undefined;\n if (typeof v === \"string\") return v.trim() || undefined;\n if (typeof v === \"number\" || typeof v === \"boolean\") return String(v);\n if (v instanceof Date) return v.toISOString().slice(0, 10);\n return undefined;\n};\n\nconst bool = (v: unknown): boolean | undefined => {\n if (typeof v === \"boolean\") return v;\n if (typeof v === \"string\") {\n const t = v.trim().toLowerCase();\n if ([\"true\", \"yes\", \"on\", \"1\"].includes(t)) return true;\n if ([\"false\", \"no\", \"off\", \"0\", \"none\"].includes(t)) return false;\n }\n if (typeof v === \"number\") return v !== 0;\n return undefined;\n};\n\n/** A length: `1in`, `2.5cm`, `25mm`, `72pt`, `96px`, or a bare number (inches). */\nexport function parseLength(v: unknown): number | undefined {\n if (typeof v === \"number\" && Number.isFinite(v)) return v * 72;\n if (typeof v !== \"string\") return undefined;\n const m = /^\\s*(-?\\d+(?:\\.\\d+)?)\\s*(in|inch|inches|cm|mm|pt|px|\")?\\s*$/i.exec(v);\n if (!m) return undefined;\n const n = Number(m[1]);\n switch ((m[2] ?? \"in\").toLowerCase()) {\n case \"cm\":\n return (n / 2.54) * 72;\n case \"mm\":\n return (n / 25.4) * 72;\n case \"pt\":\n return n;\n case \"px\":\n return n * 0.75;\n default:\n return n * 72;\n }\n}\n\nfunction parseMargins(v: unknown, base: Margins): Margins | undefined {\n if (v && typeof v === \"object\" && !Array.isArray(v)) {\n const o = v as Record<string, unknown>;\n const all = parseLength(o.all ?? o.margin);\n const pick = (k: keyof Margins): number =>\n parseLength(o[k]) ?? parseLength(k === \"left\" || k === \"right\" ? o.x : o.y) ?? all ?? base[k];\n return { top: pick(\"top\"), right: pick(\"right\"), bottom: pick(\"bottom\"), left: pick(\"left\") };\n }\n const parts = (typeof v === \"number\" ? [String(v)] : typeof v === \"string\" ? v.trim().split(/[\\s,]+/) : [])\n .map((p) => parseLength(/^\\d+(\\.\\d+)?$/.test(p) ? Number(p) : p))\n .filter((n): n is number => n !== undefined);\n if (parts.length === 0) return undefined;\n const [t, r = t, b = t, l = r] = parts as [number, number?, number?, number?];\n return { top: t, right: r as number, bottom: b as number, left: l as number };\n}\n\n/** pandoc `geometry: margin=1in` / `geometry: [top=1in, left=1.25in]`. */\nfunction parseGeometry(v: unknown, base: Margins): Margins | undefined {\n const items = Array.isArray(v) ? v.map(String) : typeof v === \"string\" ? v.split(\",\") : [];\n if (items.length === 0) return undefined;\n const m = { ...base };\n let hit = false;\n for (const item of items) {\n const [k, val] = item.split(\"=\").map((s) => s.trim().toLowerCase());\n const len = parseLength(val);\n if (!k || len === undefined) continue;\n hit = true;\n if (k === \"margin\") m.top = m.right = m.bottom = m.left = len;\n else if (k === \"top\" || k === \"tmargin\") m.top = len;\n else if (k === \"bottom\" || k === \"bmargin\") m.bottom = len;\n else if (k === \"left\" || k === \"lmargin\" || k === \"inner\") m.left = len;\n else if (k === \"right\" || k === \"rmargin\" || k === \"outer\") m.right = len;\n else if (k === \"hmargin\") m.left = m.right = len;\n else if (k === \"vmargin\") m.top = m.bottom = len;\n else hit = hit || false;\n }\n return hit ? m : undefined;\n}\n\nfunction parseRunning(v: unknown): RunningTemplate | null | undefined {\n if (v === undefined) return undefined;\n if (v === false || v === null) return null;\n if (typeof v === \"string\") {\n const t = v.trim();\n if (!t || /^(none|off|false)$/i.test(t)) return null;\n // \"left | center | right\" — the Word/Docs three-slot habit.\n if (t.includes(\"|\")) {\n const [left, center, right] = t.split(\"|\").map((s) => s.trim());\n return { left: left || undefined, center: center || undefined, right: right || undefined };\n }\n return { center: t };\n }\n if (typeof v === \"object\" && !Array.isArray(v)) {\n const o = v as Record<string, unknown>;\n return { left: str(o.left), center: str(o.center ?? o.centre ?? o.middle), right: str(o.right) };\n }\n return undefined;\n}\n\nfunction parseName(n: unknown): CslName | null {\n if (typeof n === \"string\") {\n const t = n.trim();\n if (!t) return null;\n if (t.includes(\",\")) {\n const [family, given] = t.split(\",\").map((s) => s.trim());\n return { family, given: given || undefined };\n }\n const parts = t.split(/\\s+/);\n if (parts.length === 1) return { family: parts[0] };\n return { family: parts[parts.length - 1], given: parts.slice(0, -1).join(\" \") };\n }\n if (n && typeof n === \"object\") {\n const o = n as Record<string, unknown>;\n const family = str(o.family ?? o.last ?? o.surname);\n const given = str(o.given ?? o.first);\n const literal = str(o.literal ?? o.name);\n if (!family && !given && !literal) return null;\n return { family, given, literal };\n }\n return null;\n}\n\n/** Accept CSL-JSON items plus friendly shorthands (`authors: [...]`, `year: 2020`). */\nexport function normalizeReference(raw: unknown): CslItem | null {\n if (!raw || typeof raw !== \"object\") return null;\n const o = raw as Record<string, unknown>;\n const id = str(o.id ?? o.key ?? o[\"citation-key\"]);\n if (!id) return null;\n const names = (v: unknown): CslName[] | undefined => {\n const arr = Array.isArray(v) ? v : typeof v === \"string\" ? v.split(/\\s+and\\s+|;/) : [];\n const out = arr.map(parseName).filter((x): x is CslName => x !== null);\n return out.length ? out : undefined;\n };\n let issued = o.issued && typeof o.issued === \"object\" ? (o.issued as CslItem[\"issued\"]) : undefined;\n const year = o.year ?? o.date ?? (typeof o.issued === \"object\" ? undefined : o.issued);\n if (!issued && year !== undefined) {\n const y = str(year);\n const m = y ? /^(\\d{4})(?:-(\\d{1,2}))?(?:-(\\d{1,2}))?/.exec(y) : null;\n issued = m\n ? { \"date-parts\": [[Number(m[1]), ...(m[2] ? [Number(m[2])] : []), ...(m[3] ? [Number(m[3])] : [])]] }\n : y\n ? { literal: y }\n : undefined;\n }\n return {\n id,\n type: str(o.type),\n title: str(o.title),\n author: names(o.author ?? o.authors),\n editor: names(o.editor ?? o.editors),\n issued,\n \"container-title\": str(o[\"container-title\"] ?? o.containerTitle ?? o.journal ?? o.website ?? o.booktitle),\n publisher: str(o.publisher),\n \"publisher-place\": str(o[\"publisher-place\"] ?? o.publisherPlace ?? o.place ?? o.address),\n volume: str(o.volume),\n issue: str(o.issue ?? o.number),\n page: str(o.page ?? o.pages),\n edition: str(o.edition),\n URL: str(o.URL ?? o.url),\n DOI: str(o.DOI ?? o.doi),\n };\n}\n\nexport interface ResolveSettingsOptions {\n /** Used when the frontmatter has no `title`. */\n title?: string | undefined;\n /** Extra references (e.g. from a host's source records); frontmatter wins on id clash. */\n references?: CslItem[] | undefined;\n /** \"Today\" for `date: today` — injectable so tests are deterministic. */\n now?: Date | undefined;\n}\n\n/** Turn a frontmatter mapping into complete, validated settings. */\nexport function resolveSettings(\n data: Record<string, unknown>,\n notices: DocumentNotice[],\n options: ResolveSettingsOptions = {},\n): DocumentSettings {\n const f = flatten(data);\n const get = (...keys: string[]): unknown => {\n for (const k of keys) if (f.has(k)) return f.get(k);\n return undefined;\n };\n const ignore = (key: string, value: unknown, remedy: string) =>\n notices.push({\n code: \"setting-ignored\",\n message: `The setting \"${key}: ${typeof value === \"object\" ? JSON.stringify(value) : String(value)}\" was not understood, so the default is used.`,\n remedy,\n });\n\n // Page size + orientation.\n let size: PageSizeName = \"letter\";\n let orientation: Orientation = \"portrait\";\n const sizeRaw = get(\"pagesize\", \"papersize\", \"paper\", \"size\");\n if (sizeRaw !== undefined) {\n const s = String(sizeRaw).toLowerCase().replace(/paper$/, \"\").replace(/[\\s-]/g, \"\");\n const words = s.match(/[a-z]+\\d*/g) ?? [];\n const name = words.find((w) => w in PAGE_SIZES) as PageSizeName | undefined;\n if (name) size = name;\n else ignore(\"page size\", sizeRaw, `Use one of: ${Object.keys(PAGE_SIZES).join(\", \")}.`);\n if (/landscape/.test(s)) orientation = \"landscape\";\n }\n const orientRaw = get(\"orientation\", \"pageorientation\");\n if (orientRaw !== undefined) {\n const o = String(orientRaw).toLowerCase();\n if (o === \"landscape\" || o === \"portrait\") orientation = o;\n else ignore(\"orientation\", orientRaw, \"Use `portrait` or `landscape`.\");\n }\n if (bool(get(\"landscape\")) === true) orientation = \"landscape\";\n\n // Margins: 1in all round by default (Word / Docs).\n let margins: Margins = { top: 72, right: 72, bottom: 72, left: 72 };\n const marginRaw = get(\"margins\", \"margin\", \"pagemargins\", \"pagemargin\");\n if (marginRaw !== undefined) {\n const m = parseMargins(marginRaw, margins);\n if (m) margins = m;\n else ignore(\"margins\", marginRaw, \"Write margins like `1in`, `2.5cm`, `20mm`, or `1in 0.75in` (top/bottom left/right).\");\n }\n const geometry = get(\"geometry\");\n if (geometry !== undefined) {\n const m = parseGeometry(geometry, margins);\n if (m) margins = m;\n else ignore(\"geometry\", geometry, \"Write it like pandoc: `geometry: margin=1in`.\");\n }\n for (const side of [\"top\", \"right\", \"bottom\", \"left\"] as const) {\n const v = get(`margin${side}`, `${side}margin`);\n const len = parseLength(v);\n if (len !== undefined) margins[side] = len;\n }\n\n // Cover page.\n const title = str(get(\"title\")) ?? options.title;\n const subtitle = str(get(\"subtitle\"));\n const authorRaw = get(\"author\", \"authors\");\n const author = Array.isArray(authorRaw)\n ? authorRaw\n .map((a) => (typeof a === \"string\" ? a : str((a as Record<string, unknown>)?.name)))\n .filter(Boolean)\n .join(\", \")\n : str(authorRaw);\n let date = str(get(\"date\"));\n if (date && /^today$/i.test(date)) {\n const now = options.now ?? new Date();\n date = now.toLocaleDateString(\"en-US\", { year: \"numeric\", month: \"long\", day: \"numeric\" });\n }\n const logo = str(get(\"logo\", \"coverlogo\"));\n const coverRaw = get(\"cover\", \"coverpage\", \"titlepage\");\n let cover = false;\n if (coverRaw !== undefined) {\n const b = bool(coverRaw);\n if (b === undefined && coverRaw && typeof coverRaw === \"object\") cover = true;\n else if (b === undefined) ignore(\"cover\", coverRaw, \"Use `cover: true` or `cover: false`.\");\n else cover = b;\n }\n if (cover && !title) {\n notices.push({\n code: \"setting-ignored\",\n message: \"A cover page was asked for, but the document has no title.\",\n remedy: \"Add `title: …` to the settings at the top (subtitle, author, date and logo are optional).\",\n });\n }\n\n // Table of contents.\n const tocRaw = get(\"toc\", \"tableofcontents\", \"contents\");\n let tocEnabled = false;\n let tocDepth = 3;\n let tocTitle = \"Contents\";\n if (tocRaw !== undefined) {\n if (tocRaw && typeof tocRaw === \"object\" && !Array.isArray(tocRaw)) {\n const o = tocRaw as Record<string, unknown>;\n tocEnabled = bool(o.enabled ?? true) ?? true;\n const d = Number(o.depth);\n if (Number.isFinite(d)) tocDepth = d;\n tocTitle = str(o.title) ?? tocTitle;\n } else {\n const b = bool(tocRaw);\n if (b === undefined) ignore(\"toc\", tocRaw, \"Use `toc: true`, or `toc: { depth: 2, title: Contents }`.\");\n else tocEnabled = b;\n }\n }\n const depthRaw = get(\"tocdepth\");\n if (depthRaw !== undefined && Number.isFinite(Number(depthRaw))) tocDepth = Number(depthRaw);\n tocDepth = Math.min(6, Math.max(1, Math.round(tocDepth)));\n tocTitle = str(get(\"toctitle\")) ?? tocTitle;\n\n // Running header / footer.\n const headerRaw = get(\"header\", \"pageheader\", \"runningheader\");\n const footerRaw = get(\"footer\", \"pagefooter\", \"runningfooter\");\n let header = parseRunning(headerRaw);\n if (header === undefined) {\n if (headerRaw !== undefined) ignore(\"header\", headerRaw, 'Use text like `header: \"{title} | | {date}\"`, or `header: false`.');\n header = null;\n }\n let footer = parseRunning(footerRaw);\n if (footer === undefined) {\n if (footerRaw !== undefined) ignore(\"footer\", footerRaw, 'Use text like `footer: \"Page {page} of {pages}\"`, or `footer: false`.');\n footer = DEFAULT_FOOTER;\n }\n if (bool(get(\"pagenumbers\")) === false && footerRaw === undefined) footer = null;\n\n const firstRaw = get(\"firstpage\", \"differentfirstpage\", \"titlepageheader\");\n let differentFirstPage = cover;\n if (firstRaw !== undefined) {\n const b = bool(firstRaw);\n if (b !== undefined) differentFirstPage = b || cover;\n else if (/different/i.test(String(firstRaw))) differentFirstPage = true;\n else if (/same/i.test(String(firstRaw))) differentFirstPage = cover;\n else ignore(\"firstPage\", firstRaw, \"Use `firstPage: different` or `firstPage: same`.\");\n }\n\n // Columns.\n let columns: 1 | 2 | 3 = 1;\n const colRaw = get(\"columns\", \"cols\", \"columncount\");\n if (colRaw !== undefined) {\n const n = Number(colRaw);\n if (Number.isInteger(n) && n >= 1 && n <= 3) columns = n as 1 | 2 | 3;\n else ignore(\"columns\", colRaw, \"Use 1, 2 or 3.\");\n }\n\n // Citations.\n let citationStyle: CitationStyle = \"apa\";\n const cslRaw = get(\"citationstyle\", \"csl\", \"citestyle\", \"referencestyle\");\n if (cslRaw !== undefined) {\n const v = str(cslRaw);\n if (v) citationStyle = cslStyleId(v);\n else ignore(\"citation style\", cslRaw, \"Use a CSL style name such as `apa`, `mla`, `chicago`, `ieee`, `harvard`, `nature` — or a .csl URL.\");\n }\n const refs = new Map<string, CslItem>();\n for (const r of options.references ?? []) refs.set(r.id, r);\n const refsRaw = get(\"references\", \"bibliography\", \"sources\");\n if (refsRaw !== undefined) {\n if (Array.isArray(refsRaw)) {\n for (const r of refsRaw) {\n const item = normalizeReference(r);\n if (item) refs.set(item.id, item);\n else ignore(\"references\", r, \"Every reference needs an `id:` (the key you cite as [@id]) and usually `title`, `author`, `issued`/`year`.\");\n }\n } else if (refsRaw && typeof refsRaw === \"object\") {\n for (const [id, r] of Object.entries(refsRaw as Record<string, unknown>)) {\n const item = normalizeReference({ id, ...(r as object) });\n if (item) refs.set(item.id, item);\n }\n } else if (typeof refsRaw !== \"string\") {\n ignore(\"references\", refsRaw, \"List references as CSL-JSON items: `- id: smith2020` with `title`, `author`, `issued`.\");\n }\n }\n\n let fontSize = 11;\n const fsRaw = get(\"fontsize\", \"basefontsize\");\n if (fsRaw !== undefined) {\n const n = parseLength(typeof fsRaw === \"number\" ? `${fsRaw}pt` : fsRaw);\n if (n && n >= 6 && n <= 24) fontSize = n;\n else ignore(\"fontSize\", fsRaw, \"Use a size in points between 6 and 24, e.g. `fontSize: 11`.\");\n }\n\n return {\n title,\n subtitle,\n author,\n date,\n logo,\n lang: str(get(\"lang\", \"language\")) ?? \"en\",\n page: { size, ...PAGE_SIZES[size], orientation, margins },\n cover: cover && Boolean(title),\n toc: { enabled: tocEnabled, depth: tocDepth, title: tocTitle },\n header,\n footer,\n differentFirstPage,\n columns,\n numberSections: bool(get(\"numbersections\", \"sectionnumbers\", \"numberedheadings\", \"numberheadings\")) ?? false,\n citationStyle,\n bibliographyTitle:\n str(get(\"bibliographytitle\", \"referencestitle\", \"referencesectiontitle\")) ?? BIBLIOGRAPHY_TITLES[citationStyle] ?? \"References\",\n references: [...refs.values()],\n hyphenate: bool(get(\"hyphenate\", \"hyphenation\")) ?? true,\n fontSize,\n };\n}\n\n/** Fill a running template for one page. */\nexport function fillTemplate(\n template: string,\n s: DocumentSettings,\n page: number | string,\n pages: number | string,\n): string {\n return template.replace(/\\{(page|pages|title|subtitle|author|date)\\}/gi, (_m, k: string) => {\n switch (k.toLowerCase()) {\n case \"page\":\n return String(page);\n case \"pages\":\n return String(pages);\n case \"title\":\n return s.title ?? \"\";\n case \"subtitle\":\n return s.subtitle ?? \"\";\n case \"author\":\n return s.author ?? \"\";\n default:\n return s.date ?? \"\";\n }\n });\n}\n\n/** Split a template into literal text and `{page}` / `{pages}` field tokens. */\nexport function templateParts(\n template: string,\n s: DocumentSettings,\n): Array<{ text: string } | { field: \"page\" | \"pages\" }> {\n const filled = template.replace(/\\{(title|subtitle|author|date)\\}/gi, (m) => fillTemplate(m, s, \"\", \"\"));\n const out: Array<{ text: string } | { field: \"page\" | \"pages\" }> = [];\n let last = 0;\n for (const m of filled.matchAll(/\\{(page|pages)\\}/gi)) {\n if (m.index! > last) out.push({ text: filled.slice(last, m.index) });\n out.push({ field: (m[1] as string).toLowerCase() as \"page\" | \"pages\" });\n last = m.index! + m[0].length;\n }\n if (last < filled.length) out.push({ text: filled.slice(last) });\n return out;\n}\n","/**\n * Citations through a real CSL processor — citeproc-js (the engine Zotero and\n * Mendeley use) over styles from the official Citation Style Language\n * repository. Any of its ~10,000 styles works by name:\n *\n * csl: apa | mla | chicago | chicago-notes | ieee | harvard (bundled, offline)\n * csl: nature | vancouver | american-medical-association | … (fetched by name)\n * csl: https://…/my-style.csl (fetched by URL)\n *\n * A dependent style (e.g. `nature` → its parent) is resolved to its\n * independent parent. Note styles (Chicago notes and bibliography, …) turn\n * each citation into a numbered note; in-text styles print it inline.\n */\n\nimport CSL from \"citeproc\";\nimport type { BibliographyEntry, CslItem, Inline } from \"../types\";\nimport type { CiteRef } from \"../citations\";\nimport { BUNDLED_CSL_LOCALE_EN_US, BUNDLED_CSL_STYLES } from \"./bundled\";\n\n/** Friendly names → CSL repository ids. */\nexport const CSL_STYLE_ALIASES: Readonly<Record<string, string>> = {\n apa: \"apa\",\n \"apa-7\": \"apa\",\n mla: \"modern-language-association\",\n \"mla-9\": \"modern-language-association\",\n chicago: \"chicago-author-date\",\n \"chicago-author-date\": \"chicago-author-date\",\n \"chicago-notes\": \"chicago-notes-bibliography\",\n \"chicago-note\": \"chicago-notes-bibliography\",\n turabian: \"chicago-notes-bibliography\",\n ieee: \"ieee\",\n harvard: \"harvard-cite-them-right\",\n};\n\nexport const CSL_STYLE_REPOSITORY = \"https://raw.githubusercontent.com/citation-style-language/styles/master\";\nexport const CSL_LOCALE_REPOSITORY = \"https://raw.githubusercontent.com/citation-style-language/locales/master\";\n\n/** Normalize a `csl:` value to a repository id (or keep a URL). */\nexport function cslStyleId(name: string): string {\n const t = name.trim();\n if (/^https?:\\/\\//i.test(t)) return t;\n const id = t\n .toLowerCase()\n .replace(/\\.csl$/, \"\")\n .replace(/\\s+/g, \"-\");\n return CSL_STYLE_ALIASES[id] ?? id;\n}\n\n/** The styles that ship inside the package (offline, no fetch). */\nexport const BUNDLED_STYLE_IDS: readonly string[] = Object.keys(BUNDLED_CSL_STYLES);\n\nexport function bundledCslStyle(id: string): string | undefined {\n return BUNDLED_CSL_STYLES[id];\n}\n\n/** Fetches a URL's text; the host may override (proxy, cache, offline store). */\nexport type CslFetcher = (url: string) => Promise<string | null>;\n\nexport const defaultCslFetcher: CslFetcher = async (url) => {\n if (typeof fetch !== \"function\") return null;\n const res = await fetch(url);\n return res.ok ? res.text() : null;\n};\n\n/** Load a style by id or URL, following a dependent style to its parent. */\nexport async function loadCslStyle(name: string, fetcher: CslFetcher = defaultCslFetcher): Promise<string | null> {\n const id = cslStyleId(name);\n const bundled = bundledCslStyle(id);\n if (bundled) return bundled;\n const xml = await fetcher(/^https?:/.test(id) ? id : `${CSL_STYLE_REPOSITORY}/${id}.csl`);\n if (!xml) return null;\n const parent = /<link[^>]*href=\"([^\"]+)\"[^>]*rel=\"independent-parent\"|<link[^>]*rel=\"independent-parent\"[^>]*href=\"([^\"]+)\"/.exec(xml);\n if (!parent || /<citation\\b/.test(xml)) return xml;\n const parentId = (parent[1] ?? parent[2] ?? \"\").split(\"/\").pop() ?? \"\";\n return loadCslStyle(parentId, fetcher);\n}\n\n/** Load a CSL locale (en-US is bundled). */\nexport async function loadCslLocale(lang: string, fetcher: CslFetcher = defaultCslFetcher): Promise<string | null> {\n const tag = cslLocaleTag(lang);\n if (tag === \"en-US\") return BUNDLED_CSL_LOCALE_EN_US;\n return fetcher(`${CSL_LOCALE_REPOSITORY}/locales-${tag}.xml`);\n}\n\nconst PRIMARY: Record<string, string> = {\n en: \"en-US\",\n de: \"de-DE\",\n fr: \"fr-FR\",\n es: \"es-ES\",\n it: \"it-IT\",\n pt: \"pt-PT\",\n nl: \"nl-NL\",\n sv: \"sv-SE\",\n da: \"da-DK\",\n nb: \"nb-NO\",\n no: \"nb-NO\",\n fi: \"fi-FI\",\n pl: \"pl-PL\",\n ru: \"ru-RU\",\n ja: \"ja-JP\",\n zh: \"zh-CN\",\n ko: \"ko-KR\",\n};\nexport function cslLocaleTag(lang: string): string {\n const [a, b] = lang.replace(/_/g, \"-\").split(\"-\");\n const base = (a ?? \"en\").toLowerCase();\n if (b) return `${base}-${b.toUpperCase()}`;\n return PRIMARY[base] ?? \"en-US\";\n}\n\n// ── HTML from citeproc → our inline model ──────────────────────────────────\n\nconst ENTITIES: Record<string, string> = { amp: \"&\", lt: \"<\", gt: \">\", quot: '\"', apos: \"'\", nbsp: \"\\u00A0\" };\nfunction decode(s: string): string {\n return s.replace(/&(#x[0-9a-f]+|#\\d+|\\w+);/gi, (m, e: string) => {\n if (e[0] === \"#\") return String.fromCodePoint(e[1] === \"x\" || e[1] === \"X\" ? parseInt(e.slice(2), 16) : Number(e.slice(1)));\n return ENTITIES[e.toLowerCase()] ?? m;\n });\n}\n\nexport function cslHtmlToText(html: string): string {\n return decode(html.replace(/<[^>]+>/g, \"\")).replace(/\\s+/g, \" \").trim();\n}\n\n/** citeproc's small HTML vocabulary (i, b, span styles, a, sup, sub) → inlines. */\nexport function cslHtmlToInlines(html: string): Inline[] {\n const root: Inline[] = [];\n const stack: Array<{ kids: Inline[]; wrap: (k: Inline[]) => Inline | Inline[] }> = [{ kids: root, wrap: (k) => k }];\n const top = () => stack[stack.length - 1] as { kids: Inline[] };\n const text = (s: string) => {\n if (!s) return;\n const kids = top().kids;\n const last = kids[kids.length - 1];\n if (last?.type === \"text\") last.value += s;\n else kids.push({ type: \"text\", value: s });\n };\n for (const m of html.matchAll(/<(\\/?)([a-z]+)([^>]*)>|([^<]+)/gi)) {\n if (m[4] !== undefined) {\n text(decode(m[4]));\n continue;\n }\n const closing = m[1] === \"/\";\n const tag = (m[2] as string).toLowerCase();\n const attrs = m[3] ?? \"\";\n if (tag === \"br\") {\n top().kids.push({ type: \"break\" });\n continue;\n }\n if (!closing) {\n let wrap: (k: Inline[]) => Inline | Inline[] = (k) => k;\n if (tag === \"i\" || tag === \"em\" || /font-style:\\s*italic/.test(attrs)) wrap = (k) => ({ type: \"emphasis\", children: k });\n else if (tag === \"b\" || tag === \"strong\" || /font-weight:\\s*bold/.test(attrs)) wrap = (k) => ({ type: \"strong\", children: k });\n else if (tag === \"a\") {\n const href = /href=\"([^\"]*)\"/.exec(attrs)?.[1];\n if (href) wrap = (k) => ({ type: \"link\", url: decode(href), children: k });\n }\n stack.push({ kids: [], wrap });\n } else if (stack.length > 1) {\n const done = stack.pop() as { kids: Inline[]; wrap: (k: Inline[]) => Inline | Inline[] };\n const w = done.wrap(done.kids);\n const kids = top().kids;\n if (Array.isArray(w)) for (const x of w) kids.push(x);\n else kids.push(w);\n }\n }\n while (stack.length > 1) {\n const done = stack.pop() as { kids: Inline[]; wrap: (k: Inline[]) => Inline | Inline[] };\n const w = done.wrap(done.kids);\n if (Array.isArray(w)) top().kids.push(...w);\n else top().kids.push(w);\n }\n // Bare URLs / DOIs in the entry become links.\n const linkify = (nodes: Inline[]): Inline[] =>\n nodes.flatMap((n): Inline[] => {\n if (n.type !== \"text\") return \"children\" in n && n.type !== \"link\" ? [{ ...n, children: linkify(n.children) } as Inline] : [n];\n const out: Inline[] = [];\n let last = 0;\n for (const u of n.value.matchAll(/https?:\\/\\/[^\\s<>\"]+[^\\s<>\".,;:)]/g)) {\n if (u.index! > last) out.push({ type: \"text\", value: n.value.slice(last, u.index) });\n out.push({ type: \"link\", url: u[0], children: [{ type: \"text\", value: u[0] }] });\n last = u.index! + u[0].length;\n }\n if (last < n.value.length) out.push({ type: \"text\", value: n.value.slice(last) });\n return out;\n });\n // citeproc pretty-prints its HTML: collapse layout whitespace, trim the ends.\n const tidy = (nodes: Inline[]): Inline[] =>\n nodes.map((n) => (n.type === \"text\" ? { ...n, value: n.value.replace(/\\s+/g, \" \") } : \"children\" in n ? ({ ...n, children: tidy(n.children) } as Inline) : n));\n const out = tidy(linkify(root));\n const first = out[0];\n if (first?.type === \"text\") first.value = first.value.trimStart();\n const last = out[out.length - 1];\n if (last?.type === \"text\") last.value = last.value.trimEnd();\n return out.filter((n) => n.type !== \"text\" || n.value !== \"\");\n}\n\n// ── the engine ─────────────────────────────────────────────────────────────\n\n/** CSL-JSON the processor accepts: numeric date parts, a type on every item. */\nfunction toCslJson(i: CslItem): Record<string, unknown> {\n const type =\n i.type ??\n (i[\"container-title\"] && (i.volume || i.issue || i.page) ? \"article-journal\" : i.publisher ? \"book\" : i.URL ? \"webpage\" : \"document\");\n const parts = i.issued?.[\"date-parts\"]?.[0]?.map((p) => Number(p)).filter((n) => Number.isFinite(n));\n const out: Record<string, unknown> = { ...i, type };\n if (parts?.length) out.issued = { \"date-parts\": [parts] };\n else if (i.issued?.literal) out.issued = { literal: i.issued.literal };\n for (const k of Object.keys(out)) if (out[k] === undefined) delete out[k];\n return out;\n}\n\n/** Locator text (\"p. 4\", \"chap. 3\", \"§ 2\", \"12\") → CSL label + locator. */\nexport function parseLocator(raw: string | undefined): { label?: string | undefined; locator?: string | undefined; suffix?: string | undefined } {\n if (!raw) return {};\n const t = raw.trim();\n const LABELS: Array<[RegExp, string]> = [\n [/^(?:pp?\\.?|pages?)\\s*/i, \"page\"],\n [/^(?:chaps?\\.?|chapters?|ch\\.)\\s*/i, \"chapter\"],\n [/^(?:§§?|secs?\\.?|sections?)\\s*/i, \"section\"],\n [/^(?:figs?\\.?|figures?)\\s*/i, \"figure\"],\n [/^(?:paras?\\.?|paragraphs?|¶)\\s*/i, \"paragraph\"],\n [/^(?:vols?\\.?|volumes?)\\s*/i, \"volume\"],\n [/^(?:ll?\\.|lines?)\\s*/i, \"line\"],\n [/^(?:nn?\\.|notes?)\\s*/i, \"note\"],\n ];\n for (const [re, label] of LABELS) {\n if (re.test(t)) {\n const rest = t.replace(re, \"\");\n const m = /^([\\divxlcdm]+(?:\\s*[-–,]\\s*[\\divxlcdm]+)*)(.*)$/i.exec(rest);\n return m ? { label, locator: m[1], suffix: m[2]?.trim() || undefined } : { label, locator: rest };\n }\n }\n const num = /^(\\d+(?:\\s*[-–,]\\s*\\d+)*)(.*)$/.exec(t);\n if (num) return { label: \"page\", locator: num[1], suffix: num[2]?.trim() || undefined };\n return { suffix: t };\n}\n\nexport interface CitationResult {\n /** Plain in-text label, e.g. \"(Kim & Alvarez, 2021, p. 58)\" or \"[1]\". */\n label: string;\n /** Called when a LATER citation changes this one (disambiguation, ibid.). */\n onUpdate: (fn: (label: string) => void) => void;\n}\n\ninterface Cluster {\n id: string;\n noteIndex: number;\n listeners: Array<(label: string) => void>;\n label: string;\n}\n\ntype CslEngine = {\n processCitationCluster: (\n c: { citationID: string; citationItems: unknown[]; properties: { noteIndex: number } },\n pre: Array<[string, number]>,\n post: Array<[string, number]>,\n ) => [unknown, Array<[number, string, string]>];\n makeBibliography: () => false | [{ entry_ids: string[][] }, string[]];\n setOutputFormat: (f: string) => void;\n updateItems: (ids: string[]) => void;\n opt: { xclass?: string };\n};\n\nexport class CitationEngine {\n private readonly engine: CslEngine;\n private readonly clusters: Cluster[] = [];\n /** A note style: every citation becomes a numbered note. */\n readonly isNote: boolean;\n private readonly numeric: boolean;\n /** APA 7 §8.11: narrative citations join authors with \"and\", not \"&\". */\n private readonly apaNarrativeAnd: boolean;\n\n constructor(styleXml: string, localeXml: string, items: CslItem[], lang: string) {\n const byId = new Map(items.map((i) => [i.id, toCslJson(i)]));\n const sys = {\n retrieveLocale: (l: string) => (cslLocaleTag(l) === cslLocaleTag(lang) ? localeXml : BUNDLED_CSL_LOCALE_EN_US),\n retrieveItem: (id: string) => byId.get(id),\n };\n const Engine = (CSL as unknown as { Engine: new (s: unknown, x: string, l: string, f: boolean) => CslEngine }).Engine;\n this.engine = new Engine(sys, styleXml, cslLocaleTag(lang), true);\n this.engine.setOutputFormat(\"html\");\n // Items register as they are cited, so the bibliography lists only cited works.\n this.isNote = this.engine.opt.xclass === \"note\";\n // A numeric style (IEEE, Vancouver, Nature…) has no author-in-text form.\n // APA and every style derived from it (its self/template links name \"apa\").\n this.apaNarrativeAnd =\n /<title>[^<]*(?:\\bAPA\\b|American Psychological Association)/i.test(styleXml) ||\n /<link[^>]*href=\"[^\"]*\\/styles\\/apa(?:-[\\w-]*)?\"[^>]*rel=\"(?:self|template|independent-parent)\"/i.test(styleXml);\n this.numeric = /citation-number/.test(styleXml.slice(styleXml.indexOf(\"<citation\"), styleXml.indexOf(\"</citation>\")));\n }\n\n /** Cite a group; `noteIndex` is the note number for note styles (0 = in text). */\n cite(refs: CiteRef[], opts: { narrative?: boolean; noteIndex?: number } = {}): CitationResult {\n const items = refs.map((r) => {\n const loc = parseLocator(r.locator);\n const item: Record<string, unknown> = { id: r.key };\n if (loc.locator) {\n item.locator = loc.locator;\n item.label = loc.label ?? \"page\";\n }\n if (loc.suffix) item.suffix = ` ${loc.suffix}`;\n if (r.suppressAuthor) item[\"suppress-author\"] = true;\n if (opts.narrative) item[\"author-only\"] = true;\n return item;\n });\n const make = (citationItems: unknown[]): Cluster => {\n const cluster: Cluster = { id: `c${this.clusters.length + 1}`, noteIndex: opts.noteIndex ?? 0, listeners: [], label: \"\" };\n const pre = this.clusters.map((c): [string, number] => [c.id, c.noteIndex]);\n // author-only items would vanish from a narrative pair otherwise.\n const [, updates] = this.engine.processCitationCluster(\n { citationID: cluster.id, citationItems, properties: { noteIndex: cluster.noteIndex } },\n pre,\n [],\n );\n this.clusters.push(cluster);\n for (const [index, html] of updates) {\n const c = this.clusters[index];\n if (!c) continue;\n c.label = cslHtmlToText(html);\n for (const l of c.listeners) l(c.label);\n }\n return cluster;\n };\n if (opts.narrative && refs.length === 1 && !this.isNote && !this.numeric) {\n // \"Kim and Alvarez (2021)\": the author part, then the rest in parentheses.\n const author = make(items);\n const rest = make(refs.map((r, i) => ({ ...(items[i] as object), \"author-only\": undefined, \"suppress-author\": true, id: r.key })));\n const who = () => (this.apaNarrativeAnd ? author.label.replace(/,? & /g, (m) => (m.startsWith(\",\") ? \", and \" : \" and \")) : author.label);\n const join = () => `${who()}${rest.label ? ` ${/^\\(/.test(rest.label) ? rest.label : `(${rest.label})`}` : \"\"}`;\n const listeners: Array<(l: string) => void> = [];\n author.listeners.push(() => listeners.forEach((l) => l(join())));\n rest.listeners.push(() => listeners.forEach((l) => l(join())));\n return { label: join(), onUpdate: (fn) => listeners.push(fn) };\n }\n const c = make(items);\n return { label: c.label, onUpdate: (fn) => c.listeners.push(fn) };\n }\n\n /** The formatted reference list, in the style's order. */\n bibliography(): BibliographyEntry[] {\n const out = this.engine.makeBibliography();\n if (!out) return [];\n const [meta, entries] = out;\n return entries.map((html, i) => ({\n id: meta.entry_ids[i]?.[0] ?? `ref-${i}`,\n children: cslHtmlToInlines(html.replace(/^\\s*<div class=\"csl-entry\">|<\\/div>\\s*$/g, \"\").replace(/<div class=\"csl-(?:left-margin|right-inline)\">([\\s\\S]*?)<\\/div>/g, \"$1 \")),\n }));\n }\n}\n","// GENERATED by scripts/fetch-csl.mjs — do not edit by hand.\n// CSL styles and locale © the Citation Style Language project, CC BY-SA 3.0\n// (https://github.com/citation-style-language/styles). Regenerate to update.\nexport const BUNDLED_CSL_STYLES: Readonly<Record<string, string>> = {\"apa\":\"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n<style xmlns=\\\"http://purl.org/net/xbiblio/csl\\\" class=\\\"in-text\\\" demote-non-dropping-particle=\\\"never\\\" initialize-with=\\\". \\\" names-delimiter=\\\", \\\" page-range-format=\\\"expanded\\\" version=\\\"1.0\\\">\\n <!-- This file was generated by the Style Variant Builder <https://github.com/citation-style-language/style-variant-builder>. To contribute changes, modify the template and regenerate variants. -->\\n <info>\\n <title>APA Style 7th edition</title>\\n <title-short>Publication Manual of the American Psychological Association, with Bluebook</title-short>\\n <id>http://www.zotero.org/styles/apa</id>\\n <link href=\\\"http://www.zotero.org/styles/apa\\\" rel=\\\"self\\\"/>\\n <link href=\\\"http://www.zotero.org/styles/apa-6th-edition\\\" rel=\\\"template\\\"/>\\n <link href=\\\"https://apastyle.apa.org/style-grammar-guidelines/references\\\" rel=\\\"documentation\\\"/>\\n <link href=\\\"https://zotero.org/groups/2205533/collections/MR2N872S\\\" rel=\\\"documentation\\\"/>\\n <author>\\n <name>Brenton M. Wiernik</name>\\n <email>zotero@wiernik.org</email>\\n <uri>https://orcid.org/0000-0001-9560-6336</uri>\\n </author>\\n <author>\\n <name>Andrew Dunning</name>\\n <uri>https://orcid.org/0000-0003-0464-5036</uri>\\n </author>\\n <category citation-format=\\\"author-date\\\"/>\\n <category field=\\\"anthropology\\\"/>\\n <category field=\\\"communications\\\"/>\\n <category field=\\\"generic-base\\\"/>\\n <category field=\\\"law\\\"/>\\n <category field=\\\"medicine\\\"/>\\n <category field=\\\"psychology\\\"/>\\n <category field=\\\"social_science\\\"/>\\n <category field=\\\"sociology\\\"/>\\n <summary>Author-date system of the Publication Manual of the American Psychological Association (2020)</summary>\\n <updated>2026-02-07T00:00:00+00:00</updated>\\n <rights license=\\\"http://creativecommons.org/licenses/by-sa/3.0/\\\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\\n </info>\\n <locale xml:lang=\\\"en\\\">\\n <terms>\\n <term name=\\\"ad\\\"> C.E.</term>\\n <term name=\\\"bc\\\"> B.C.E.</term>\\n <term form=\\\"short\\\" name=\\\"circa\\\">ca.</term>\\n <term name=\\\"guest\\\">\\n <single>guest expert</single>\\n <multiple>guest experts</multiple>\\n </term>\\n <term form=\\\"short\\\" name=\\\"illustrator\\\">illus.</term>\\n <term form=\\\"short\\\" name=\\\"interviewer\\\">\\n <single>interviewer</single>\\n <multiple>interviewers</multiple>\\n </term>\\n <term form=\\\"short\\\" name=\\\"legislation\\\">Pub. L.</term>\\n <term name=\\\"manuscript\\\">unpublished manuscript</term>\\n <term form=\\\"verb\\\" name=\\\"performer\\\">recorded by</term>\\n <term name=\\\"post\\\">online post</term>\\n <term name=\\\"review-of\\\">review of the</term>\\n <term form=\\\"short\\\" name=\\\"review-of\\\">review of</term>\\n <term name=\\\"software\\\">computer software</term>\\n <term form=\\\"short\\\" name=\\\"supplement\\\">\\n <single>suppl.</single>\\n <multiple>suppls.</multiple>\\n </term>\\n </terms>\\n </locale>\\n <locale xml:lang=\\\"da\\\">\\n <terms>\\n <term name=\\\"et-al\\\">et al.</term>\\n </terms>\\n </locale>\\n <locale xml:lang=\\\"de\\\">\\n <terms>\\n <term name=\\\"et-al\\\">et al.</term>\\n </terms>\\n </locale>\\n <locale xml:lang=\\\"es\\\">\\n <terms>\\n <term name=\\\"from\\\">de</term>\\n </terms>\\n </locale>\\n <locale xml:lang=\\\"fr\\\">\\n <terms>\\n <term form=\\\"short\\\" name=\\\"editor\\\">\\n <single>éd.</single>\\n <multiple>éds.</multiple>\\n </term>\\n </terms>\\n </locale>\\n <locale xml:lang=\\\"nb\\\">\\n <terms>\\n <term name=\\\"et-al\\\">et al.</term>\\n </terms>\\n </locale>\\n <locale xml:lang=\\\"nl\\\">\\n <terms>\\n <term name=\\\"et-al\\\">et al.</term>\\n </terms>\\n </locale>\\n <locale xml:lang=\\\"nn\\\">\\n <terms>\\n <term name=\\\"et-al\\\">et al.</term>\\n </terms>\\n </locale>\\n <locale xml:lang=\\\"pl\\\">\\n <terms>\\n <term name=\\\"et-al\\\">i in.</term>\\n </terms>\\n </locale>\\n <locale xml:lang=\\\"ro\\\">\\n <terms>\\n <term name=\\\"et-al\\\">et al.</term>\\n </terms>\\n </locale>\\n <!-- Contents:\\n\\n APA uses four main reference elements:\\n\\n 1. Author (APA 9.7-12)\\n 2. Date (APA 9.13-17)\\n 3. Title and descriptions (APA 9.18-22)\\n 3.1. Title (APA 9.18)\\n 3.2. Identifier (in parentheses) (APA 9.19)\\n 3.3. Description [in square brackets] (APA 9.21-22)\\n 4. Source (APA 9.23-37)\\n 4.1. Serial sources (APA 9.25-27)\\n 4.2. Monographic sources (APA 9.28)\\n 4.3. Publisher sources (APA 9.29)\\n 4.4. Database and archive sources (APA 9.30)\\n 4.5. Works with specific locations (APA 9.31)\\n 4.6. Social media and website sources (APA 9.32-33)\\n 4.7. DOI or URL (APA 9.34-36)\\n\\n A note on the source may follow the main reference elements:\\n\\n 5. Publication history (APA 9.39-41)\\n\\n APA also provides parallel rules for legal references following The Bluebook: A Uniform System of Citation (chap. 11):\\n\\n 6. Legal references\\n -->\\n <!-- APA categorizes all sources as serial (APA 9.25-27) or monographic (APA 9.28).\\n\\n Serial\\n : article-journal article-magazine article-newspaper periodical post-weblog review review-book\\n\\n Serial or Monographic\\n : interview paper-conference\\n\\n Monographic with any of `collection-editor compiler editor editorial-director`.\\n A serial `paper-conference` is unpublished if it lacks any of `issue page supplement-number volume`.\\n\\n Monographic\\n : article book broadcast chapter classic collection dataset document entry entry-dictionary entry-encyclopedia event figure graphic manuscript map motion_picture musical_score pamphlet patent performance personal_communication post report software song speech standard thesis webpage\\n\\n Legal\\n : bill hearing legal_case legislation regulation treaty\\n -->\\n <!-- Equivalencies:\\n\\n `classic` == `book`\\n `document` == `report` (but give full date)\\n `standard` == `report`\\n `performance` == `speech`\\n `event` == `speech`\\n -->\\n <!-- Role equivalencies:\\n\\n `compiler` == `editor`\\n `organizer`, `curator` == `chair`\\n `script-writer` == `director`\\n `producer` == `director` (but don't print both)\\n `guest`, `host` == `director`\\n `series-creator`, `executive-producer` == `editor`\\n -->\\n <!-- Reviews are detected if an item has type `review` or `review-book` or if it has any of the variables `reviewed-title`, `reviewed-author`, or `reviewed-genre`. For the latter case, reviews are commonly stored as types `article-journal`, `article-magazine`, `article-newspaper`, `post-weblog`, or `webpage`. -->\\n <!-- Indigeneous knowledge: Assume the item is stored as `document` or `speech` and that Nation/Community, treaty territory, where the Elder lives, and topic are all stored in `title`. Cf. <https://libguides.norquest.ca/c.php?g=314831&p=5188823>. If the item is stored as `interview`, assume that Nation/Community, treaty territory, and topic are stored in `title`. 'Oral teaching' or similar is stored in `archive`, and where the Elder lives is stored in `archive-place`. -->\\n <!-- Variable labels -->\\n <macro name=\\\"label-chapter-number\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"chapter-number\\\" type=\\\"song\\\">\\n <text text-case=\\\"capitalize-first\\\" value=\\\"track\\\"/>\\n </if>\\n <else-if is-numeric=\\\"chapter-number\\\">\\n <label text-case=\\\"capitalize-first\\\" variable=\\\"chapter-number\\\"/>\\n </else-if>\\n </choose>\\n <text variable=\\\"chapter-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-edition\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"edition\\\">\\n <number form=\\\"ordinal\\\" variable=\\\"edition\\\"/>\\n <label form=\\\"short\\\" variable=\\\"edition\\\"/>\\n </if>\\n <else>\\n <text variable=\\\"edition\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"label-issue\\\">\\n <group delimiter=\\\" \\\">\\n <label text-case=\\\"capitalize-first\\\" variable=\\\"issue\\\"/>\\n <text variable=\\\"issue\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-locator\\\">\\n <!-- Abbreviate page and paragraph; leave other locator labels in long form (APA 8.13) -->\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if locator=\\\"page\\\">\\n <label form=\\\"short\\\" variable=\\\"locator\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"bill hearing legal_case legislation regulation treaty\\\">\\n <!-- Bluebook-style labels for legal types -->\\n <choose>\\n <if locator=\\\"chapter paragraph section\\\" match=\\\"any\\\">\\n <label form=\\\"symbol\\\" variable=\\\"locator\\\"/>\\n </if>\\n <else>\\n <label text-case=\\\"capitalize-first\\\" variable=\\\"locator\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else-if locator=\\\"paragraph\\\">\\n <label form=\\\"short\\\" variable=\\\"locator\\\"/>\\n </else-if>\\n <else-if is-numeric=\\\"locator\\\">\\n <label text-case=\\\"capitalize-first\\\" variable=\\\"locator\\\"/>\\n </else-if>\\n <!-- a non-numeric canonical reference is identified by its formatting and does not need a label, similar to a timestamp -->\\n <else-if locator=\\\"chapter line verse\\\" match=\\\"any\\\"/>\\n <else>\\n <label text-case=\\\"capitalize-first\\\" variable=\\\"locator\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"locator\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-number\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"standard\\\"/>\\n <else-if is-numeric=\\\"number\\\" match=\\\"any\\\" type=\\\"legislation patent regulation\\\">\\n <label form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"number\\\"/>\\n </else-if>\\n </choose>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-number-capitalized\\\">\\n <!-- alias for cross-compatibility of Bluebook macros -->\\n <text macro=\\\"label-number\\\"/>\\n </macro>\\n <macro name=\\\"label-number-article\\\">\\n <!-- APA example 6: Journal article with article number or eLocator -->\\n <group delimiter=\\\" \\\">\\n <text term=\\\"article-locator\\\" text-case=\\\"capitalize-first\\\"/>\\n <text variable=\\\"number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-number-of-volumes\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"number-of-volumes\\\">\\n <label form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"number-of-volumes\\\"/>\\n <group>\\n <text prefix=\\\"1\\\" term=\\\"page-range-delimiter\\\"/>\\n <number variable=\\\"number-of-volumes\\\"/>\\n </group>\\n </if>\\n <else>\\n <text variable=\\\"number-of-volumes\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"label-page\\\">\\n <group delimiter=\\\" \\\">\\n <label form=\\\"short\\\" variable=\\\"page\\\"/>\\n <text variable=\\\"page\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-part-number\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"part-number\\\">\\n <!-- TODO: Replace with `part-number` label when CSL provides one -->\\n <text form=\\\"short\\\" term=\\\"part\\\" text-case=\\\"capitalize-first\\\"/>\\n </if>\\n </choose>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"part-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-section-symbol\\\">\\n <group delimiter=\\\" \\\">\\n <label form=\\\"symbol\\\" variable=\\\"section\\\"/>\\n <text variable=\\\"section\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-supplement-number\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"supplement-number\\\">\\n <!-- TODO: Replace with `supplement-number` label when CSL provides one -->\\n <text form=\\\"short\\\" term=\\\"supplement\\\" text-case=\\\"capitalize-first\\\"/>\\n </if>\\n </choose>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"supplement-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-version\\\">\\n <group delimiter=\\\" \\\">\\n <label text-case=\\\"capitalize-first\\\" variable=\\\"version\\\"/>\\n <text variable=\\\"version\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-volume\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"volume\\\">\\n <label form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"volume\\\"/>\\n </if>\\n </choose>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"volume\\\"/>\\n </group>\\n </macro>\\n <!-- 1. Author (APA 9.7-12) -->\\n <macro name=\\\"author\\\">\\n <!-- Substitutes for missing authors: order prioritizes primary creators (e.g., composer, author) over secondary roles (e.g., editor, curator), with title as the final fallback. -->\\n <names variable=\\\"composer\\\">\\n <name and=\\\"symbol\\\" delimiter-precedes-last=\\\"always\\\" name-as-sort-order=\\\"all\\\"/>\\n <label form=\\\"short\\\" prefix=\\\" (\\\" suffix=\\\")\\\" text-case=\\\"title\\\"/>\\n <substitute>\\n <names variable=\\\"author\\\"/>\\n <!-- `narrator` only cited in `identifier-contributors` -->\\n <names variable=\\\"illustrator\\\"/>\\n <choose>\\n <if type=\\\"broadcast\\\">\\n <names variable=\\\"script-writer director\\\">\\n <!-- Actors/performers and producers [not executive] not cited in APA style. -->\\n <name and=\\\"symbol\\\" delimiter-precedes-last=\\\"always\\\" name-as-sort-order=\\\"all\\\"/>\\n <label prefix=\\\" (\\\" suffix=\\\")\\\" text-case=\\\"title\\\"/>\\n </names>\\n </if>\\n </choose>\\n <names variable=\\\"director\\\">\\n <!-- For non-broadcast items, APA only cites directors and not writers. -->\\n <name and=\\\"symbol\\\" delimiter-precedes-last=\\\"always\\\" name-as-sort-order=\\\"all\\\"/>\\n <label prefix=\\\" (\\\" suffix=\\\")\\\" text-case=\\\"title\\\"/>\\n </names>\\n <names variable=\\\"guest host\\\">\\n <!-- TODO: Collapse variables when that becomes available. -->\\n <name and=\\\"symbol\\\" delimiter-precedes-last=\\\"always\\\" name-as-sort-order=\\\"all\\\"/>\\n <label prefix=\\\" (\\\" suffix=\\\")\\\" text-case=\\\"title\\\"/>\\n </names>\\n <names variable=\\\"producer\\\">\\n <!-- Producers not cited if there is a writer/director, but use if they are the principal creator. -->\\n <name and=\\\"symbol\\\" delimiter-precedes-last=\\\"always\\\" name-as-sort-order=\\\"all\\\"/>\\n <label prefix=\\\" (\\\" suffix=\\\")\\\" text-case=\\\"title\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"entry-dictionary entry-encyclopedia\\\">\\n <text variable=\\\"publisher\\\"/>\\n </if>\\n </choose>\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"container-title\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"book classic entry entry-dictionary entry-encyclopedia\\\">\\n <!-- Items with a monographic `container-title` substitute their title and identifier, but leave description after `container-title`. This mimics the `source-monographic` macro. -->\\n <text macro=\\\"author-title-substitute\\\"/>\\n </else-if>\\n </choose>\\n <names variable=\\\"executive-producer\\\">\\n <name and=\\\"symbol\\\" delimiter-precedes-last=\\\"always\\\" name-as-sort-order=\\\"all\\\"/>\\n <label prefix=\\\" (\\\" suffix=\\\")\\\" text-case=\\\"title\\\"/>\\n </names>\\n <names variable=\\\"series-creator\\\">\\n <name and=\\\"symbol\\\" delimiter-precedes-last=\\\"always\\\" name-as-sort-order=\\\"all\\\"/>\\n <label prefix=\\\" (\\\" suffix=\\\")\\\" text-case=\\\"title\\\"/>\\n </names>\\n <names variable=\\\"editor-translator\\\"/>\\n <!-- `translator` is not cited as a primary creator (only as Ed. & Trans.). -->\\n <names variable=\\\"editor\\\"/>\\n <names variable=\\\"editorial-director\\\"/>\\n <names variable=\\\"compiler\\\">\\n <name and=\\\"symbol\\\" delimiter-precedes-last=\\\"always\\\" name-as-sort-order=\\\"all\\\"/>\\n <label prefix=\\\" (\\\" suffix=\\\")\\\" text-case=\\\"title\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"event performance speech\\\">\\n <names variable=\\\"chair\\\">\\n <name and=\\\"symbol\\\" delimiter-precedes-last=\\\"always\\\" name-as-sort-order=\\\"all\\\"/>\\n <label prefix=\\\" (\\\" suffix=\\\")\\\" text-case=\\\"title\\\"/>\\n </names>\\n <names variable=\\\"organizer\\\">\\n <name and=\\\"symbol\\\" delimiter-precedes-last=\\\"always\\\" name-as-sort-order=\\\"all\\\"/>\\n <label prefix=\\\" (\\\" suffix=\\\")\\\" text-case=\\\"title\\\"/>\\n </names>\\n </if>\\n </choose>\\n <names variable=\\\"curator\\\">\\n <name and=\\\"symbol\\\" delimiter-precedes-last=\\\"always\\\" name-as-sort-order=\\\"all\\\"/>\\n <label prefix=\\\" (\\\" suffix=\\\")\\\" text-case=\\\"title\\\"/>\\n </names>\\n <names variable=\\\"collection-editor\\\"/>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"software webpage\\\">\\n <!-- `software` (APA 10.10) and `webpage` (APA 10.16) can be cited under \\\"name of group\\\": likely in `publisher` if no `author` -->\\n <text variable=\\\"publisher\\\"/>\\n </if>\\n <else-if type=\\\"standard\\\">\\n <text variable=\\\"authority\\\"/>\\n </else-if>\\n </choose>\\n <text macro=\\\"author-title-substitute\\\"/>\\n </substitute>\\n </names>\\n </macro>\\n <macro name=\\\"author-and-contributors\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"author\\\"/>\\n <choose>\\n <!-- add nonprimary authors equivalent to those appearing \\\"on a book cover\\\"; do not modify the in-text citation (APA 9.8) -->\\n <if match=\\\"none\\\" variable=\\\"author compiler composer editor editor-translator illustrator\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"book musical_score pamphlet report standard\\\">\\n <names prefix=\\\"(\\\" suffix=\\\")\\\" variable=\\\"contributor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"symbol\\\" delimiter-precedes-last=\\\"always\\\" name-as-sort-order=\\\"all\\\"/>\\n </names>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"author-short\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"bill hearing legal_case legislation regulation treaty\\\">\\n <text macro=\\\"title-and-descriptions-short\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"interview personal_communication\\\">\\n <choose>\\n <!-- These variables indicate that the letter is retrievable by the reader. If not, use the APA in-text-only personal communication format. -->\\n <if match=\\\"any\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\">\\n <names variable=\\\"author\\\">\\n <name and=\\\"symbol\\\" form=\\\"short\\\"/>\\n <substitute>\\n <text macro=\\\"title-and-descriptions-short\\\"/>\\n </substitute>\\n </names>\\n </if>\\n <else>\\n <group delimiter=\\\", \\\">\\n <names variable=\\\"author\\\">\\n <name and=\\\"symbol\\\"/>\\n <substitute>\\n <text macro=\\\"title-and-descriptions-short\\\"/>\\n </substitute>\\n </names>\\n <text term=\\\"personal-communication\\\"/>\\n </group>\\n </else>\\n </choose>\\n </else-if>\\n <else>\\n <names variable=\\\"composer\\\">\\n <name and=\\\"symbol\\\" form=\\\"short\\\"/>\\n <substitute>\\n <names variable=\\\"author\\\"/>\\n <names variable=\\\"illustrator\\\"/>\\n <choose>\\n <if type=\\\"broadcast\\\">\\n <!-- TODO: Collapse variables when that becomes available. -->\\n <!-- Ideally combine as `script-writer director` -->\\n <names variable=\\\"script-writer\\\"/>\\n </if>\\n </choose>\\n <names variable=\\\"director\\\"/>\\n <!-- TODO: Collapse variables when that becomes available. -->\\n <names variable=\\\"guest host\\\"/>\\n <names variable=\\\"producer\\\"/>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"entry-dictionary entry-encyclopedia\\\">\\n <text variable=\\\"publisher\\\"/>\\n </if>\\n </choose>\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"container-title\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"book classic entry entry-dictionary entry-encyclopedia\\\">\\n <text macro=\\\"title-and-descriptions-short\\\"/>\\n </else-if>\\n </choose>\\n <names variable=\\\"executive-producer\\\"/>\\n <names variable=\\\"series-creator\\\"/>\\n <names variable=\\\"editor\\\"/>\\n <names variable=\\\"editorial-director\\\"/>\\n <names variable=\\\"compiler\\\"/>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"event performance speech\\\">\\n <names variable=\\\"chair\\\"/>\\n <names variable=\\\"organizer\\\"/>\\n </if>\\n </choose>\\n <names variable=\\\"curator\\\"/>\\n <names variable=\\\"collection-editor\\\"/>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"software webpage\\\">\\n <!-- `software` (APA 10.10) and `webpage` (APA 10.16) can be cited under \\\"name of group\\\": likely in `publisher` if no `author` -->\\n <text form=\\\"short\\\" variable=\\\"publisher\\\"/>\\n </if>\\n <else-if type=\\\"standard\\\">\\n <text form=\\\"short\\\" variable=\\\"authority\\\"/>\\n </else-if>\\n </choose>\\n <text macro=\\\"title-and-descriptions-short\\\"/>\\n </substitute>\\n </names>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"author-sort\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"bill hearing legal_case legislation regulation treaty\\\">\\n <text macro=\\\"legal-title\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"author\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- Author elements -->\\n <macro name=\\\"author-title-substitute\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- `title` is only the review title if there is a separate `reviewed-genre` or `reviewed-title`; otherwise, it is the title of the reviewed work, printed in the description -->\\n <choose>\\n <if variable=\\\"reviewed-genre title\\\">\\n <text macro=\\\"title\\\"/>\\n </if>\\n <else-if variable=\\\"reviewed-title title\\\">\\n <text macro=\\\"title\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"title-and-descriptions\\\"/>\\n </else>\\n </choose>\\n </if>\\n <else-if variable=\\\"title\\\">\\n <!-- If an item has a `title`, substitute missing author with title and identifier, but leave description after the date (in the title position). -->\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"title\\\"/>\\n <text macro=\\\"identifier\\\"/>\\n </group>\\n </else-if>\\n <else>\\n <!-- If an item has no `title`, substitute with descriptions. -->\\n <text macro=\\\"title-and-descriptions\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- 2. Date (APA 9.13-17) -->\\n <macro name=\\\"date\\\">\\n <!-- Full dates included for ephemeral sources (e.g. broadcasts, interviews) to provide maximum specificity, while books use year only. -->\\n <group delimiter=\\\"-\\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <choose>\\n <if variable=\\\"issued\\\">\\n <group delimiter=\\\", \\\">\\n <group>\\n <text macro=\\\"date-issued-year\\\"/>\\n <text variable=\\\"year-suffix\\\"/>\\n </group>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-magazine article-newspaper broadcast collection document event motion_picture pamphlet performance personal_communication post post-weblog song speech webpage\\\">\\n <!-- Many video and audio examples in manual give full dates. Err on the side of too much information. -->\\n <text macro=\\\"date-issued-month-day\\\"/>\\n </if>\\n <!-- Only show the month and day for an unpublished `interview` or `paper-conference` -->\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director issue page supplement-number volume\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <text macro=\\\"date-issued-month-day\\\"/>\\n </else-if>\\n <!-- Only year: article article-journal book chapter classic entry entry-dictionary entry-encyclopedia dataset figure graphic manuscript map musical_score paper-conference[published] patent periodical report review review-book software standard thesis -->\\n </choose>\\n </group>\\n </if>\\n <else-if variable=\\\"status\\\">\\n <!-- Print the status variable rather than use generic CSL terms (`in press`, etc.) -->\\n <text text-case=\\\"lowercase\\\" variable=\\\"status\\\"/>\\n <text variable=\\\"year-suffix\\\"/>\\n </else-if>\\n <else>\\n <text form=\\\"short\\\" term=\\\"no date\\\"/>\\n <text variable=\\\"year-suffix\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"date-short\\\">\\n <group delimiter=\\\"-\\\">\\n <choose>\\n <if variable=\\\"issued\\\">\\n <group delimiter=\\\"/\\\">\\n <text macro=\\\"date-original-year\\\"/>\\n <group>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\">\\n <text macro=\\\"date-issued-year\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"interview personal_communication\\\">\\n <!-- use the in-text-only format for inaccessible personal communications -->\\n <text macro=\\\"date-issued-full\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"date-issued-year\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"year-suffix\\\"/>\\n </group>\\n </group>\\n </if>\\n <else-if variable=\\\"status\\\">\\n <!-- Print the status variable rather than use generic CSL terms (`in press`, etc.) -->\\n <text text-case=\\\"lowercase\\\" variable=\\\"status\\\"/>\\n <text variable=\\\"year-suffix\\\"/>\\n </else-if>\\n <else>\\n <text form=\\\"short\\\" term=\\\"no date\\\"/>\\n <text variable=\\\"year-suffix\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"date-sort\\\">\\n <!-- Sort items by issue date as printed -->\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article article-journal book chapter entry entry-dictionary entry-encyclopedia dataset figure graphic manuscript map musical_score patent report review review-book thesis\\\">\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" variable=\\\"issued\\\"/>\\n </if>\\n <else-if type=\\\"paper-conference\\\">\\n <!-- Determine whether published and serial or monographic -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director issue page supplement-number volume\\\">\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" variable=\\\"issued\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"date-issued-leading-zeros\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else>\\n <text macro=\\\"date-issued-leading-zeros\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"date-sort-group\\\">\\n <!-- Sorts items with and without dates:\\n\\n 1. `no date` items (= 0)\\n 2. items with dates (= 1)\\n 3. items with `status` (forthcoming, in press, etc.) (= 2) -->\\n <choose>\\n <if variable=\\\"issued\\\">\\n <text value=\\\"1\\\"/>\\n </if>\\n <else-if variable=\\\"status\\\">\\n <text value=\\\"2\\\"/>\\n </else-if>\\n <else>\\n <text value=\\\"0\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- Date elements -->\\n <macro name=\\\"date-event-full\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-uncertain-date=\\\"event-date\\\">\\n <text form=\\\"short\\\" term=\\\"circa\\\"/>\\n </if>\\n </choose>\\n <date form=\\\"text\\\" variable=\\\"event-date\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"date-issued-full\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-uncertain-date=\\\"issued\\\">\\n <text form=\\\"short\\\" term=\\\"circa\\\"/>\\n </if>\\n </choose>\\n <date form=\\\"text\\\" variable=\\\"issued\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"date-issued-leading-zeros\\\">\\n <date delimiter=\\\"-\\\" variable=\\\"issued\\\">\\n <date-part name=\\\"year\\\"/>\\n <date-part form=\\\"numeric-leading-zeros\\\" name=\\\"month\\\"/>\\n <date-part form=\\\"numeric-leading-zeros\\\" name=\\\"day\\\"/>\\n </date>\\n </macro>\\n <macro name=\\\"date-issued-month-day\\\">\\n <date variable=\\\"issued\\\">\\n <date-part name=\\\"month\\\"/>\\n <date-part name=\\\"day\\\" prefix=\\\" \\\"/>\\n </date>\\n </macro>\\n <macro name=\\\"date-issued-year\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-uncertain-date=\\\"issued\\\">\\n <text form=\\\"short\\\" term=\\\"circa\\\"/>\\n </if>\\n </choose>\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" variable=\\\"issued\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"date-original-year\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-uncertain-date=\\\"original-date\\\">\\n <text form=\\\"short\\\" term=\\\"circa\\\"/>\\n </if>\\n </choose>\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" variable=\\\"original-date\\\"/>\\n </group>\\n </macro>\\n <!-- 3. Title and descriptions (APA 9.18-22) -->\\n <macro name=\\\"title-and-descriptions\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if variable=\\\"title\\\">\\n <text macro=\\\"title\\\"/>\\n <text macro=\\\"identifier\\\"/>\\n <text macro=\\\"description\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"bill report\\\">\\n <!-- Bills, resolutions, and congressional reports substitute bill number if no title. -->\\n <!-- Congressional reports are indistinguishable from other reports -->\\n <text macro=\\\"identifier-number\\\"/>\\n <text macro=\\\"description\\\"/>\\n <text macro=\\\"identifier\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"description\\\"/>\\n <text macro=\\\"identifier\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"title-and-descriptions-short\\\">\\n <choose>\\n <if variable=\\\"title\\\">\\n <text macro=\\\"title-short\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"bill report\\\">\\n <!-- Bills, resolutions, and congressional reports substitute bill number if no title. -->\\n <text macro=\\\"legal-identifier-bill-report\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"description-short\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- 3.1. Title (APA 9.18) -->\\n <macro name=\\\"title\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"post webpage\\\">\\n <!-- part number/title always at the analytic level -->\\n <text font-style=\\\"italic\\\" macro=\\\"title-and-part-filter-review\\\"/>\\n </if>\\n <!-- Other types are italicized based on presence of `container-title`. Assume that `review` and `review-book` are published either in a serial or on a webpage (APA example 69) -->\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <text macro=\\\"title-serial\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <text macro=\\\"title-monographic\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <text macro=\\\"title-serial\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"title-monographic\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-short\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- `title` is only the review title if there is a separate `reviewed-genre` or `reviewed-title`; otherwise, it is the title of the reviewed work, printed in the description -->\\n <choose>\\n <if variable=\\\"reviewed-genre title\\\">\\n <!-- Quotes, title case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </if>\\n <else-if variable=\\\"reviewed-title title\\\">\\n <!-- Quotes, title case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"description-short\\\"/>\\n </else>\\n </choose>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"bill legislation regulation report treaty\\\">\\n <!-- No italics or quotes, title case -->\\n <text form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"legal_case post\\\">\\n <!-- Italicized, sentence case -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"hearing webpage\\\">\\n <!-- Italicized, title case (regardless of `container-title`) -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <!-- Other types are formatted based on presence of `container-title`, as in title macro -->\\n <else-if variable=\\\"container-title\\\">\\n <!-- Quotes, title case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else>\\n <!-- Italicized, title case (default) -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- Title elements -->\\n <macro name=\\\"title-and-part-filter-review\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- If a review has no `reviewed-genre` or `reviewed-title`, assume that `title` contains the title of the reviewed work; the description provides it. -->\\n <choose>\\n <if variable=\\\"reviewed-genre title\\\">\\n <text macro=\\\"title-and-part-title\\\"/>\\n </if>\\n <else-if variable=\\\"reviewed-title title\\\">\\n <text macro=\\\"title-and-part-title\\\"/>\\n </else-if>\\n </choose>\\n </if>\\n <else>\\n <text macro=\\\"title-and-part-title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-and-part-title\\\">\\n <group delimiter=\\\": \\\">\\n <text variable=\\\"title\\\"/>\\n <text macro=\\\"title-part\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"title-and-volume-title\\\">\\n <group delimiter=\\\": \\\">\\n <text variable=\\\"title\\\"/>\\n <text macro=\\\"title-volume\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"title-monographic\\\">\\n <!-- For monographic items, assume `part-number` and `part-title` refer to the book/volume. -->\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <text variable=\\\"title\\\"/>\\n </if>\\n <else>\\n <!-- For monographic items without `container-title` and with `volume-title`, append `volume-title` to `title` (APA example 30) -->\\n <text font-style=\\\"italic\\\" macro=\\\"title-and-volume-title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-part\\\">\\n <choose>\\n <if variable=\\\"part-title\\\">\\n <group delimiter=\\\". \\\">\\n <text macro=\\\"label-part-number\\\"/>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"part-title\\\"/>\\n </group>\\n </if>\\n <else-if is-numeric=\\\"part-number\\\"/>\\n <else>\\n <text macro=\\\"label-part-number\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-serial\\\">\\n <!-- For serials, assume that `part-number` and `part-title` refer to the article and append to `title` -->\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <text macro=\\\"title-and-part-filter-review\\\"/>\\n </if>\\n <else>\\n <!-- for serial items without `container-title`, don't append `volume-title` to `title` -->\\n <text font-style=\\\"italic\\\" macro=\\\"title-and-part-filter-review\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-volume\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <!-- Assume that `part-number` and `part-title` of monographic items refer to the source book/volume -->\\n <if variable=\\\"volume-title\\\">\\n <group delimiter=\\\": \\\">\\n <group delimiter=\\\". \\\">\\n <text macro=\\\"label-volume\\\"/>\\n <text variable=\\\"volume-title\\\"/>\\n </group>\\n <text macro=\\\"title-part\\\"/>\\n </group>\\n </if>\\n <else-if variable=\\\"part-title\\\">\\n <text macro=\\\"label-volume\\\"/>\\n <text macro=\\\"title-part\\\"/>\\n </else-if>\\n <!-- if there is no `part-title` or `volume title`, `part-number` and `volume` appear in `identifier` if numeric -->\\n <else-if is-numeric=\\\"part-number volume\\\"/>\\n <else-if is-numeric=\\\"part-number\\\" variable=\\\"volume\\\">\\n <text macro=\\\"label-volume\\\"/>\\n </else-if>\\n <else-if is-numeric=\\\"volume\\\" variable=\\\"part-number\\\">\\n <text macro=\\\"label-part-number\\\"/>\\n </else-if>\\n <else-if is-numeric=\\\"part-number\\\"/>\\n <else-if is-numeric=\\\"volume\\\"/>\\n <else>\\n <text macro=\\\"label-volume\\\"/>\\n <text macro=\\\"label-part-number\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- 3.2. Identifier (in parentheses) (APA 9.19) -->\\n <macro name=\\\"identifier\\\">\\n <!-- (Secondary contributors; Database location; Genre no. 123; Report Series 123, Version, Edition, Volume, Page) -->\\n <group delimiter=\\\"; \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <choose>\\n <if type=\\\"patent\\\">\\n <text macro=\\\"identifier-patent\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"post webpage\\\">\\n <!-- print `container-title` on `post` or `webpage` in the same way as `publisher` -->\\n <text macro=\\\"identifier-contributors\\\"/>\\n <text macro=\\\"identifier-number\\\"/>\\n <text macro=\\\"identifier-monographic\\\"/>\\n </else-if>\\n <else-if type=\\\"report\\\" variable=\\\"container-title\\\">\\n <!-- If the report is a chapter in a larger report, then most identifying information is printed in the source. -->\\n <text macro=\\\"identifier-contributors\\\"/>\\n </else-if>\\n <else-if type=\\\"report\\\" variable=\\\"title\\\">\\n <text macro=\\\"identifier-contributors\\\"/>\\n <text macro=\\\"identifier-number\\\"/>\\n <text macro=\\\"identifier-monographic\\\"/>\\n </else-if>\\n <else-if type=\\\"report\\\">\\n <!-- If there is no `title`, then `genre` and `number` are already printed as the title. -->\\n <text macro=\\\"identifier-contributors\\\"/>\\n <text macro=\\\"identifier-monographic\\\"/>\\n </else-if>\\n <else-if variable=\\\"container-title\\\">\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"genre title\\\">\\n <text macro=\\\"label-chapter-number\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"identifier-contributors\\\"/>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"broadcast graphic map motion_picture\\\">\\n <!-- For some audiovisual media, `number` information comes after title, not `container-title` (APA example 94); but an album track number is `chapter-number` -->\\n <text macro=\\\"identifier-number\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"identifier-serial\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"identifier-contributors\\\"/>\\n <text macro=\\\"identifier-number\\\"/>\\n <text macro=\\\"identifier-monographic\\\"/>\\n <text macro=\\\"identifier-serial\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- Identifier elements -->\\n <macro name=\\\"identifier-contributors\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <text macro=\\\"identifier-contributors-serial\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <text macro=\\\"identifier-contributors-monographic\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <text macro=\\\"identifier-contributors-serial\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"identifier-contributors-monographic\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"identifier-contributors-monographic\\\">\\n <group delimiter=\\\"; \\\">\\n <choose>\\n <if variable=\\\"title\\\">\\n <names variable=\\\"interviewer\\\">\\n <name and=\\\"symbol\\\"/>\\n <label form=\\\"short\\\" prefix=\\\", \\\" text-case=\\\"title\\\"/>\\n </names>\\n </if>\\n </choose>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"post webpage\\\">\\n <!-- print `container-title` on `post` or `webpage` in the same way as `publisher` -->\\n <names variable=\\\"container-author\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\" text-case=\\\"title\\\"/>\\n <name and=\\\"symbol\\\"/>\\n </names>\\n <names delimiter=\\\"; \\\" variable=\\\"editor translator\\\">\\n <name and=\\\"symbol\\\"/>\\n <label form=\\\"short\\\" prefix=\\\", \\\" text-case=\\\"title\\\"/>\\n </names>\\n <names delimiter=\\\"; \\\" variable=\\\"illustrator narrator\\\">\\n <name and=\\\"symbol\\\"/>\\n <label form=\\\"short\\\" prefix=\\\", \\\" text-case=\\\"title\\\"/>\\n </names>\\n <names delimiter=\\\"; \\\" variable=\\\"compiler chair organizer curator series-creator executive-producer\\\">\\n <name and=\\\"symbol\\\"/>\\n <label prefix=\\\", \\\" text-case=\\\"title\\\"/>\\n </names>\\n </if>\\n <else>\\n <names delimiter=\\\"; \\\" variable=\\\"illustrator narrator\\\">\\n <name and=\\\"symbol\\\"/>\\n <label form=\\\"short\\\" prefix=\\\", \\\" text-case=\\\"title\\\"/>\\n </names>\\n <choose>\\n <if variable=\\\"container-title editor-translator\\\"/>\\n <else-if variable=\\\"container-title\\\">\\n <!-- TODO: Check logic once processors start to automatically populate `editor-translator` -->\\n <names delimiter=\\\"; \\\" variable=\\\"translator\\\">\\n <name and=\\\"symbol\\\"/>\\n <label form=\\\"short\\\" prefix=\\\", \\\" text-case=\\\"title\\\"/>\\n </names>\\n </else-if>\\n <else>\\n <names variable=\\\"container-author\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\" text-case=\\\"title\\\"/>\\n <name and=\\\"symbol\\\"/>\\n </names>\\n <names delimiter=\\\"; \\\" variable=\\\"editor translator\\\">\\n <name and=\\\"symbol\\\"/>\\n <label form=\\\"short\\\" prefix=\\\", \\\" text-case=\\\"title\\\"/>\\n </names>\\n <names delimiter=\\\"; \\\" variable=\\\"compiler chair organizer curator series-creator executive-producer\\\">\\n <name and=\\\"symbol\\\"/>\\n <label prefix=\\\", \\\" text-case=\\\"title\\\"/>\\n </names>\\n </else>\\n </choose>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-contributors-serial\\\">\\n <group delimiter=\\\"; \\\">\\n <choose>\\n <if variable=\\\"title\\\">\\n <names delimiter=\\\"; \\\" variable=\\\"interviewer\\\">\\n <name and=\\\"symbol\\\"/>\\n <label form=\\\"short\\\" prefix=\\\", \\\" text-case=\\\"title\\\"/>\\n </names>\\n </if>\\n </choose>\\n <names delimiter=\\\"; \\\" variable=\\\"translator narrator\\\">\\n <name and=\\\"symbol\\\"/>\\n <label form=\\\"short\\\" prefix=\\\", \\\" text-case=\\\"title\\\"/>\\n </names>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-locators\\\">\\n <choose>\\n <if variable=\\\"page\\\">\\n <text macro=\\\"label-page\\\"/>\\n </if>\\n <else-if variable=\\\"chapter-number genre\\\">\\n <text macro=\\\"label-chapter-number\\\"/>\\n </else-if>\\n <else-if variable=\\\"chapter-number title\\\">\\n <text macro=\\\"label-chapter-number\\\"/>\\n </else-if>\\n <!-- `chapter-number` appears earlier in `identifier` if there is no `title` or `genre` -->\\n </choose>\\n </macro>\\n <macro name=\\\"identifier-monographic\\\">\\n <choose>\\n <!-- omit serial types -->\\n <if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper broadcast event patent performance periodical post post-weblog review review-book speech webpage\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"identifier-monographic-item\\\"/>\\n </else-if>\\n <!-- omit serial types -->\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\"/>\\n <else>\\n <!-- monographic types -->\\n <text macro=\\\"identifier-monographic-item\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"identifier-monographic-item\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"label-version\\\"/>\\n <text macro=\\\"label-edition\\\"/>\\n <text macro=\\\"identifier-series\\\"/>\\n <text macro=\\\"label-supplement-number\\\"/>\\n <text macro=\\\"identifier-number-volume\\\"/>\\n <text macro=\\\"identifier-number-part\\\"/>\\n <text macro=\\\"label-issue\\\"/>\\n <text macro=\\\"identifier-locators\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-number\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"thesis\\\" variable=\\\"genre\\\">\\n <!-- `genre` provided with thesis description (APA example 65) -->\\n <text text-case=\\\"capitalize-first\\\" value=\\\"publication\\\"/>\\n </if>\\n <else-if variable=\\\"number\\\">\\n <text text-case=\\\"title\\\" variable=\\\"genre\\\"/>\\n </else-if>\\n </choose>\\n <text macro=\\\"label-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-number-part\\\">\\n <choose>\\n <!-- Part number printed with part title -->\\n <if variable=\\\"part-title\\\"/>\\n <!-- Non-numeric part numbers printed as part of the title -->\\n <else-if is-numeric=\\\"part-number\\\">\\n <text macro=\\\"label-part-number\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"identifier-number-volume\\\">\\n <choose>\\n <!-- Volume number printed with volume/part title -->\\n <if variable=\\\"volume volume-title\\\"/>\\n <else-if variable=\\\"part-title volume\\\"/>\\n <!-- Non-numeric volumes printed as part of the book title -->\\n <else-if is-numeric=\\\"volume\\\">\\n <text macro=\\\"label-volume\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"label-number-of-volumes\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"identifier-patent\\\">\\n <!-- `authority`: U.S. ; `genre`: patent ; `number`: 123,445 -->\\n <group delimiter=\\\" \\\">\\n <text form=\\\"short\\\" variable=\\\"authority\\\"/>\\n <choose>\\n <if variable=\\\"genre\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n </if>\\n <else>\\n <text term=\\\"patent\\\" text-case=\\\"capitalize-first\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"label-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-serial\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <text macro=\\\"identifier-number-part\\\"/>\\n </if>\\n <!-- omit monographic types -->\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <text macro=\\\"identifier-number-part\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"identifier-series\\\">\\n <!-- Series given only for report-like types (APA example 52) -->\\n <choose>\\n <if match=\\\"any\\\" type=\\\"document report standard\\\">\\n <group delimiter=\\\" \\\">\\n <text text-case=\\\"title\\\" variable=\\\"collection-title\\\"/>\\n <text variable=\\\"collection-number\\\"/>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <!-- 3.3. Description [in square brackets] (APA 9.21) -->\\n <macro name=\\\"description\\\">\\n <group prefix=\\\"[\\\" suffix=\\\"]\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"interview\\\" variable=\\\"interviewer\\\">\\n <text macro=\\\"description-interview\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <text macro=\\\"description-review\\\"/>\\n </else-if>\\n <else-if type=\\\"personal_communication\\\">\\n <text macro=\\\"description-letter\\\"/>\\n </else-if>\\n <else-if type=\\\"song\\\" variable=\\\"composer\\\">\\n <text macro=\\\"description-song\\\"/>\\n </else-if>\\n <else-if type=\\\"thesis\\\">\\n <text macro=\\\"description-thesis\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <text macro=\\\"description-serial\\\"/>\\n </else-if>\\n <else-if match=\\\"none\\\" variable=\\\"container-title\\\">\\n <!-- Other description -->\\n <text macro=\\\"description-format\\\"/>\\n </else-if>\\n <!-- For unpublished conference presentations/performances/events, chapters in reports/standards/generic documents, software, place description within the source element -->\\n <else-if match=\\\"any\\\" type=\\\"document report software standard\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"event paper-conference performance speech\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director issue page supplement-number volume\\\">\\n <text macro=\\\"description-format\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else>\\n <text macro=\\\"description-format\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"description-short\\\">\\n <group prefix=\\\"[\\\" suffix=\\\"]\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"interview\\\" variable=\\\"interviewer\\\">\\n <text macro=\\\"description-interview-short\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <text macro=\\\"description-review-short\\\"/>\\n </else-if>\\n <else-if type=\\\"personal_communication\\\">\\n <text macro=\\\"description-letter-short\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <text macro=\\\"description-serial-short\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"description-format-short\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <text macro=\\\"description-serial-short\\\"/>\\n </else-if>\\n <else>\\n <!-- monographic types -->\\n <text macro=\\\"description-format-short\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- Description elements -->\\n <macro name=\\\"description-format\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"genre medium\\\">\\n <group delimiter=\\\"; \\\">\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"number\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n </if>\\n </choose>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"medium\\\"/>\\n </group>\\n </if>\\n <else>\\n <text macro=\\\"description-format-term-generic\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-format-short\\\">\\n <choose>\\n <if variable=\\\"genre\\\">\\n <text form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n </if>\\n <else-if variable=\\\"medium\\\">\\n <text form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"medium\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"description-format-term-generic\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-format-term-generic\\\">\\n <!-- Generic labels for specific types -->\\n <choose>\\n <if type=\\\"broadcast\\\">\\n <text term=\\\"broadcast\\\" text-case=\\\"capitalize-first\\\"/>\\n </if>\\n <else-if type=\\\"collection\\\">\\n <text term=\\\"collection\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if type=\\\"dataset\\\">\\n <text term=\\\"dataset\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if type=\\\"figure\\\">\\n <text term=\\\"figure\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if type=\\\"graphic\\\">\\n <text term=\\\"graphic\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview personal_communication\\\">\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\">\\n <text term=\\\"personal-communication\\\" text-case=\\\"capitalize-first\\\"/>\\n </if>\\n <else-if type=\\\"interview\\\">\\n <text term=\\\"interview\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if type=\\\"personal_communication\\\">\\n <text term=\\\"letter\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n </choose>\\n </else-if>\\n <else-if type=\\\"manuscript\\\">\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\">\\n <text term=\\\"manuscript\\\" text-case=\\\"capitalize-first\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else-if type=\\\"map\\\">\\n <text term=\\\"map\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if type=\\\"motion_picture\\\">\\n <text term=\\\"motion_picture\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if type=\\\"periodical\\\" variable=\\\"container-title supplement-number\\\">\\n <text term=\\\"supplement\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if type=\\\"periodical\\\" variable=\\\"container-title title\\\">\\n <text term=\\\"special-issue\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if type=\\\"song\\\">\\n <text term=\\\"song\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if type=\\\"software\\\">\\n <text term=\\\"software\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if type=\\\"post\\\">\\n <text term=\\\"post\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if type=\\\"review\\\">\\n <text term=\\\"review\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if type=\\\"review-book\\\">\\n <text term=\\\"review-book\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"description-interview\\\">\\n <group delimiter=\\\"; \\\">\\n <choose>\\n <if variable=\\\"interviewer title\\\">\\n <!-- Avoid repeating 'interview' -->\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"number\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n </if>\\n </choose>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"medium\\\"/>\\n </if>\\n <else-if variable=\\\"title\\\">\\n <text macro=\\\"description-format\\\"/>\\n </else-if>\\n <else-if variable=\\\"genre\\\">\\n <group delimiter=\\\" \\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n <choose>\\n <if variable=\\\"interviewer\\\">\\n <text form=\\\"verb\\\" term=\\\"container-author\\\"/>\\n <names variable=\\\"interviewer\\\">\\n <name and=\\\"symbol\\\"/>\\n </names>\\n </if>\\n </choose>\\n </group>\\n </else-if>\\n <else-if variable=\\\"interviewer\\\">\\n <names variable=\\\"interviewer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"symbol\\\"/>\\n </names>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"medium\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"description-format\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"description-interview-short\\\">\\n <names variable=\\\"interviewer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"symbol\\\" form=\\\"short\\\"/>\\n <substitute>\\n <text macro=\\\"description-format-short\\\"/>\\n </substitute>\\n </names>\\n </macro>\\n <macro name=\\\"description-letter\\\">\\n <choose>\\n <if variable=\\\"recipient\\\">\\n <group delimiter=\\\"; \\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"description-format\\\"/>\\n <names variable=\\\"recipient\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"symbol\\\" initialize=\\\"false\\\"/>\\n </names>\\n </group>\\n <text macro=\\\"description-medium\\\"/>\\n </group>\\n </if>\\n <else>\\n <text macro=\\\"description-format\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-letter-short\\\">\\n <choose>\\n <if variable=\\\"recipient\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"description-format-short\\\"/>\\n <names variable=\\\"recipient\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"symbol\\\" form=\\\"short\\\"/>\\n </names>\\n </group>\\n </if>\\n <else>\\n <text macro=\\\"description-format-short\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-medium\\\">\\n <choose>\\n <if variable=\\\"number\\\"/>\\n <else-if variable=\\\"genre\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"medium\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"description-review\\\">\\n <group delimiter=\\\"; \\\">\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if variable=\\\"reviewed-genre\\\">\\n <text term=\\\"review-of\\\" text-case=\\\"capitalize-first\\\"/>\\n <text variable=\\\"reviewed-genre\\\"/>\\n </if>\\n <else-if variable=\\\"number\\\">\\n <!-- Genre printed with `number` -->\\n <text form=\\\"short\\\" term=\\\"review-of\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <!-- If no `reviewed-genre`, assume that `genre` or `medium` is entered as 'Review of the book' or similar -->\\n <else-if variable=\\\"genre\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n </else-if>\\n <else-if variable=\\\"medium\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"medium\\\"/>\\n </else-if>\\n <else-if type=\\\"review-book\\\">\\n <text term=\\\"review-of\\\" text-case=\\\"capitalize-first\\\"/>\\n <text term=\\\"book\\\" text-case=\\\"lowercase\\\"/>\\n </else-if>\\n <else>\\n <text form=\\\"short\\\" term=\\\"review-of\\\" text-case=\\\"capitalize-first\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"description-review-title\\\"/>\\n </group>\\n <names variable=\\\"reviewed-author\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\"/>\\n <name and=\\\"symbol\\\"/>\\n </names>\\n </group>\\n <text macro=\\\"description-medium\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"description-review-short\\\">\\n <group delimiter=\\\" \\\">\\n <text form=\\\"short\\\" term=\\\"review-of\\\" text-case=\\\"capitalize-first\\\"/>\\n <text macro=\\\"description-review-title-short\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"description-review-title\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"reviewed-genre reviewed-title\\\">\\n <!-- Not possible to distinguish TV series episode from other reviewed works without a reviewed source title (APA example 69) -->\\n <!-- TODO: Adapt for `reviewed-container-title` or similar if it becomes available -->\\n <text font-style=\\\"italic\\\" variable=\\\"reviewed-title\\\"/>\\n </if>\\n <else>\\n <!-- Assume `title` is the title of the reviewed work -->\\n <text font-style=\\\"italic\\\" variable=\\\"title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-review-title-short\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"reviewed-genre reviewed-title\\\">\\n <!-- Not possible to distinguish TV series episode from other reviewed works without a reviewed source title (APA example 69) -->\\n <!-- TODO: Adapt for `reviewed-container-title` or similar if it becomes available -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"reviewed-title\\\"/>\\n </if>\\n <else>\\n <!-- Assume `title` is the title of the reviewed work -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-serial\\\">\\n <group delimiter=\\\"; \\\">\\n <text macro=\\\"description-format\\\"/>\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"title\\\">\\n <text variable=\\\"section\\\"/>\\n </if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"description-serial-short\\\">\\n <choose>\\n <if variable=\\\"title\\\"/>\\n <else-if variable=\\\"section\\\">\\n <text form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"section\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"description-format-short\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-song\\\">\\n <!-- Performer of classical music works -->\\n <group delimiter=\\\"; \\\">\\n <group delimiter=\\\" \\\">\\n <!-- Based on `description-format` macro -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"genre medium\\\">\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"number\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n </if>\\n </choose>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"medium\\\"/>\\n <text form=\\\"verb\\\" term=\\\"performer\\\"/>\\n </if>\\n <else>\\n <text form=\\\"verb\\\" term=\\\"performer\\\" text-case=\\\"capitalize-first\\\"/>\\n </else>\\n </choose>\\n <names variable=\\\"author\\\">\\n <name and=\\\"symbol\\\"/>\\n <substitute>\\n <names variable=\\\"performer\\\"/>\\n </substitute>\\n </names>\\n </group>\\n <text macro=\\\"description-medium\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"description-thesis\\\">\\n <group delimiter=\\\"; \\\">\\n <group delimiter=\\\", \\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"archive DOI URL\\\">\\n <!-- Include the university in description if thesis is published -->\\n <text variable=\\\"publisher\\\"/>\\n </if>\\n </choose>\\n </group>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"medium\\\"/>\\n </group>\\n </macro>\\n <!-- 4. Source (APA 9.23-37) -->\\n <macro name=\\\"source\\\">\\n <group delimiter=\\\". \\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"post webpage\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <text macro=\\\"source-serial\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <text macro=\\\"source-monographic\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <text macro=\\\"source-serial\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"source-monographic\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"source-publisher\\\"/>\\n <text macro=\\\"source-archive\\\"/>\\n <text macro=\\\"source-location\\\"/>\\n <text macro=\\\"source-website\\\"/>\\n </group>\\n </macro>\\n <!-- 4.1. Serial sources (APA 9.25-27) -->\\n <macro name=\\\"source-serial\\\">\\n <group delimiter=\\\". \\\">\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\", \\\" font-style=\\\"italic\\\">\\n <text text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n <!-- `collection-title` is for any serial with multiple series (e.g. 'second series') -->\\n <text text-case=\\\"title\\\" variable=\\\"collection-title\\\"/>\\n </group>\\n <group>\\n <text font-style=\\\"italic\\\" variable=\\\"volume\\\"/>\\n <group delimiter=\\\", \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <text variable=\\\"issue\\\"/>\\n <text macro=\\\"label-supplement-number\\\"/>\\n </group>\\n </group>\\n <choose>\\n <if variable=\\\"number\\\">\\n <text macro=\\\"label-number-article\\\"/>\\n </if>\\n <else>\\n <text variable=\\\"page\\\"/>\\n </else>\\n </choose>\\n </group>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"collection-title issue number page supplement-number volume\\\"/>\\n <else-if variable=\\\"issued status\\\">\\n <!-- Print the status variable rather than use generic CSL terms (`in press`, etc.) -->\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"status\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <!-- 4.2. Monographic sources (APA 9.28) -->\\n <macro name=\\\"source-monographic\\\">\\n <!-- Monographic sources repeat main reference elements -->\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"song\\\">\\n <text term=\\\"on\\\" text-case=\\\"capitalize-first\\\"/>\\n </if>\\n <else>\\n <text term=\\\"in\\\" text-case=\\\"capitalize-first\\\"/>\\n </else>\\n </choose>\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-monographic-author\\\"/>\\n <text macro=\\\"source-monographic-title\\\"/>\\n </group>\\n <text macro=\\\"source-monographic-identifier\\\"/>\\n <text macro=\\\"source-monographic-description\\\"/>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <!-- Monographic source author -->\\n <macro name=\\\"source-monographic-author\\\">\\n <names variable=\\\"container-author\\\">\\n <name and=\\\"symbol\\\"/>\\n <label prefix=\\\" (\\\" suffix=\\\")\\\" text-case=\\\"title\\\"/>\\n <substitute>\\n <names variable=\\\"executive-producer\\\"/>\\n <names variable=\\\"series-creator\\\"/>\\n <names variable=\\\"editor-translator\\\">\\n <name and=\\\"symbol\\\"/>\\n <label form=\\\"short\\\" prefix=\\\" (\\\" suffix=\\\")\\\" text-case=\\\"title\\\"/>\\n </names>\\n <!-- TODO: Translator omitted on the assumption that editor-translators are uncommon for chapter citations. If needed, direct entry or automatic population of `editor-translator` can produce combined labels. -->\\n <names delimiter=\\\"; \\\" variable=\\\"editor\\\">\\n <name and=\\\"symbol\\\"/>\\n <label form=\\\"short\\\" prefix=\\\" (\\\" suffix=\\\")\\\" text-case=\\\"title\\\"/>\\n </names>\\n <names variable=\\\"editorial-director\\\">\\n <name and=\\\"symbol\\\"/>\\n <label form=\\\"short\\\" prefix=\\\" (\\\" suffix=\\\")\\\" text-case=\\\"title\\\"/>\\n </names>\\n <names variable=\\\"compiler\\\"/>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"event performance speech\\\">\\n <names variable=\\\"chair\\\"/>\\n <names variable=\\\"organizer\\\"/>\\n </if>\\n </choose>\\n <names variable=\\\"curator\\\"/>\\n <names variable=\\\"collection-editor\\\">\\n <name and=\\\"symbol\\\"/>\\n <label form=\\\"short\\\" prefix=\\\" (\\\" suffix=\\\")\\\" text-case=\\\"title\\\"/>\\n </names>\\n </substitute>\\n </names>\\n </macro>\\n <!-- Monographic source title -->\\n <macro name=\\\"source-monographic-title\\\">\\n <group delimiter=\\\": \\\" font-style=\\\"italic\\\">\\n <text variable=\\\"container-title\\\"/>\\n <text macro=\\\"title-volume\\\"/>\\n </group>\\n </macro>\\n <!-- Monographic source identifier -->\\n <macro name=\\\"source-monographic-identifier\\\">\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <group delimiter=\\\"; \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <choose>\\n <if match=\\\"none\\\" type=\\\"broadcast graphic map motion_picture\\\">\\n <!-- For some audiovisual media, number information comes after `title`, not `container-title` (APA example 94); but an album track number is `chapter-number` -->\\n <text macro=\\\"identifier-number\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"identifier-monographic\\\"/>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <!-- Monographic source description -->\\n <macro name=\\\"source-monographic-description\\\">\\n <group prefix=\\\"[\\\" suffix=\\\"]\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"document report software standard\\\">\\n <!-- place description after `container-title` -->\\n <text macro=\\\"description-format\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director issue page supplement-number volume\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"event paper-conference performance speech\\\">\\n <!-- unpublished conference presentations should describe the session -->\\n <text macro=\\\"description-format\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <!-- 4.3. Publisher sources (APA 9.29) -->\\n <macro name=\\\"source-publisher\\\">\\n <choose>\\n <if type=\\\"thesis\\\">\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"archive DOI URL\\\">\\n <!-- Provide university in `publisher` if unpublished -->\\n <text variable=\\\"publisher\\\"/>\\n </if>\\n </choose>\\n </if>\\n <!-- omit serial types -->\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text variable=\\\"publisher\\\"/>\\n </else-if>\\n <else-if type=\\\"interview\\\">\\n <!-- give publisher for a broadcast `interview` handled as a serial type -->\\n <text variable=\\\"publisher\\\"/>\\n </else-if>\\n <!-- omit serial `paper-conference` -->\\n <else-if type=\\\"paper-conference\\\"/>\\n <else>\\n <text variable=\\\"publisher\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- 4.4. Database and archive sources (APA 9.30) -->\\n <macro name=\\\"source-archive\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"archive_collection\\\">\\n <!-- With collection: `archive_collection` (`archive_location`), `archive`, `archive-place` -->\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"archive_collection\\\"/>\\n <text prefix=\\\"(\\\" suffix=\\\")\\\" variable=\\\"archive_location\\\"/>\\n </group>\\n <text variable=\\\"archive\\\"/>\\n <text variable=\\\"archive-place\\\"/>\\n </if>\\n <else>\\n <!-- No collection: `archive` (`archive_location`), `archive-place` -->\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"archive\\\"/>\\n <text prefix=\\\"(\\\" suffix=\\\")\\\" variable=\\\"archive_location\\\"/>\\n </group>\\n <text variable=\\\"archive-place\\\"/>\\n </else>\\n </choose>\\n <!-- a database identifier/number is stored in `number` and appears in `identifier-number` -->\\n </group>\\n </macro>\\n <!-- 4.5. Works with specific locations (APA 9.31) -->\\n <macro name=\\\"source-location\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"event event-title\\\">\\n <!-- TODO: To prevent Zotero from printing `event-place`, due to its double-mapping of `publisher-place` and `event-place`. Remove this when that is changed. -->\\n <choose>\\n <if type=\\\"paper-conference\\\">\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"collection-editor compiler editor editorial-director issue page supplement-number volume\\\">\\n <!-- Don't print event info for conference papers published in a proceedings -->\\n <text macro=\\\"source-location-title-place-date\\\"/>\\n </if>\\n </choose>\\n </if>\\n <else>\\n <!-- For other item types, print event info even if published (e.g. collection catalogs, performance programs). These items aren't given explicit examples in the APA manual, so err on the side of providing too much information. -->\\n <text macro=\\\"source-location-title-place-date\\\"/>\\n </else>\\n </choose>\\n </if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-location-title-place-date\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <!-- TODO: We expect `event-title` to be used, but processors and applications may not be updated yet. This macro ensures that either `event` or `event-title` can be accepted. Remove if processor logic and application adoption can handle this. -->\\n <if variable=\\\"event-title\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"event-title\\\"/>\\n </if>\\n <else>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"event\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"event-place\\\"/>\\n <text macro=\\\"date-event-full\\\"/>\\n </group>\\n </macro>\\n <!-- 4.6. Social media and website sources (APA 9.32-33) -->\\n <macro name=\\\"source-website\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"post webpage\\\">\\n <text text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </if>\\n </choose>\\n </macro>\\n <!-- 4.7. DOI or URL (APA 9.34-36) -->\\n <macro name=\\\"source-DOI-URL\\\">\\n <choose>\\n <if variable=\\\"DOI\\\">\\n <text prefix=\\\"https://doi.org/\\\" variable=\\\"DOI\\\"/>\\n </if>\\n <else-if variable=\\\"URL\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"issued status\\\">\\n <text term=\\\"retrieved\\\" text-case=\\\"capitalize-first\\\"/>\\n <group delimiter=\\\", \\\">\\n <date form=\\\"text\\\" variable=\\\"accessed\\\"/>\\n <text term=\\\"from\\\"/>\\n </group>\\n </if>\\n </choose>\\n <text variable=\\\"URL\\\"/>\\n </group>\\n </else-if>\\n </choose>\\n </macro>\\n <!-- 5. Publication history (APA 9.39-41) -->\\n <macro name=\\\"publication-history\\\">\\n <!-- Notes on source element: original publication, reprint info, retraction info -->\\n <group delimiter=\\\"; \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <choose>\\n <if type=\\\"patent\\\">\\n <text variable=\\\"references\\\"/>\\n </if>\\n <else>\\n <!-- Print `status` here for \\\"retracted\\\" etc. if it's not printed elsewhere. -->\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"issued\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"collection-title issue number page supplement-number volume\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"status\\\"/>\\n </else-if>\\n </choose>\\n <choose>\\n <if variable=\\\"references\\\">\\n <!-- Provide the option for more elaborate description of publication history, such as full \\\"reprinted\\\" references (APA examples 11, 43, 44) -->\\n <text variable=\\\"references\\\"/>\\n </if>\\n <else>\\n <!-- Format publication history using CSL variables -->\\n <group delimiter=\\\" \\\">\\n <text term=\\\"original-work-published\\\" text-case=\\\"capitalize-first\\\"/>\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <text value=\\\"as\\\"/>\\n <text font-style=\\\"italic\\\" variable=\\\"original-title\\\"/>\\n </group>\\n <text macro=\\\"date-original-year\\\"/>\\n <text variable=\\\"original-publisher\\\"/>\\n </group>\\n </group>\\n </else>\\n </choose>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- 6. Legal references: Bluebook style (shared with Chicago) -->\\n <!-- Where APA or Chicago diverge from Bluebook, the official manual is followed -->\\n <macro name=\\\"legal-reference\\\">\\n <!-- Type usage:\\n\\n `bill`\\n : bills, resolutions, federal reports\\n\\n `legal_case`\\n : all legal and court cases\\n\\n `hearing`\\n : hearings and testimony\\n\\n `legislation`\\n : statutes, constitutional items, and charters\\n\\n `regulation`\\n : codified regulations, uncodified regulations, executive orders\\n\\n `treaty`\\n : treaties\\n -->\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if type=\\\"treaty\\\">\\n <text macro=\\\"legal-title\\\"/>\\n <names variable=\\\"author\\\">\\n <!-- Treaty parties should be included at least for bilateral treaties (Bluebook 21.4.2) -->\\n <name delimiter=\\\"-\\\" et-al-min=\\\"100\\\" et-al-use-first=\\\"99\\\" form=\\\"short\\\" initialize=\\\"false\\\"/>\\n </names>\\n <text macro=\\\"legal-date\\\"/>\\n <!-- treaty source/report in addition to URL (Bluebook 21.4.5) -->\\n <text macro=\\\"legal-source\\\"/>\\n </if>\\n <else>\\n <group delimiter=\\\" \\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"legal-title\\\"/>\\n <text macro=\\\"legal-source\\\"/>\\n </group>\\n <text macro=\\\"legal-date\\\"/>\\n <text macro=\\\"legal-identifier\\\"/>\\n </group>\\n </else>\\n </choose>\\n <group delimiter=\\\" \\\">\\n <!-- locator for use in notes -->\\n <choose>\\n <if locator=\\\"page\\\" variable=\\\"page\\\">\\n <text term=\\\"at\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"label-locator\\\"/>\\n </group>\\n </group>\\n </macro>\\n <!-- 6.1. Legal date -->\\n <macro name=\\\"legal-date\\\">\\n <choose>\\n <if type=\\\"treaty\\\">\\n <text macro=\\\"date-issued-full\\\"/>\\n </if>\\n <else-if type=\\\"legal_case\\\">\\n <text macro=\\\"legal-date-case\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"bill hearing legislation regulation\\\">\\n <group delimiter=\\\" \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"date-original-year\\\"/>\\n <text form=\\\"symbol\\\" term=\\\"and\\\"/>\\n </group>\\n <choose>\\n <if variable=\\\"issued\\\">\\n <text macro=\\\"date-issued-year\\\"/>\\n </if>\\n <else>\\n <!-- Show proposal date for uncodified regulations. Assume date is entered literally ala \\\"proposed May 23, 2016\\\". -->\\n <!-- TODO: Add `proposed` date here if that becomes available -->\\n <date form=\\\"text\\\" variable=\\\"submitted\\\"/>\\n </else>\\n </choose>\\n </group>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"legal-date-case\\\">\\n <group delimiter=\\\" \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <text variable=\\\"authority\\\"/>\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <!-- Print only year for cases published in reporters-->\\n <text macro=\\\"date-issued-year\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"date-issued-full\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- 6.2.1. Legal title -->\\n <macro name=\\\"legal-title\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"bill legal_case legislation regulation treaty\\\">\\n <text text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </if>\\n <else-if type=\\\"hearing\\\">\\n <!-- use standard format (Bluebook 13.3) -->\\n <group delimiter=\\\": \\\" font-style=\\\"italic\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"title\\\"/>\\n <group delimiter=\\\" \\\">\\n <text term=\\\"hearing\\\" text-case=\\\"capitalize-first\\\"/>\\n <group delimiter=\\\" \\\">\\n <text term=\\\"on\\\"/>\\n <text variable=\\\"number\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <text value=\\\"before the\\\"/>\\n <text variable=\\\"section\\\"/>\\n </group>\\n </group>\\n </group>\\n </else-if>\\n </choose>\\n </macro>\\n <!-- 6.2.2. Legal identifier -->\\n <macro name=\\\"legal-identifier\\\">\\n <group delimiter=\\\" \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <choose>\\n <if type=\\\"hearing\\\">\\n <!-- Use the 'verb' form of the hearing term to hold 'testimony of' -->\\n <text form=\\\"verb\\\" term=\\\"hearing\\\"/>\\n <names variable=\\\"author\\\">\\n <name and=\\\"symbol\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"bill legislation regulation\\\">\\n <!-- For uncodified regulations, assume future code section is in `status`. -->\\n <text variable=\\\"status\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"legal-identifier-bill-report\\\">\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"genre\\\"/>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"authority chapter-number container-title\\\">\\n <text variable=\\\"number\\\"/>\\n </if>\\n <else>\\n <!-- If there is no legislative body, session number, or code/record title, assume the item is a congressional report and include 'No.' label. -->\\n <text macro=\\\"label-number-capitalized\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- 6.3. Legal source -->\\n <macro name=\\\"legal-source\\\">\\n <!-- Expect legal item `container-title` to be stored in short form -->\\n <choose>\\n <if type=\\\"bill\\\">\\n <text macro=\\\"legal-source-bill\\\"/>\\n </if>\\n <else-if type=\\\"hearing\\\">\\n <text macro=\\\"legal-source-hearing\\\"/>\\n </else-if>\\n <else-if type=\\\"legal_case\\\">\\n <text macro=\\\"legal-source-case\\\"/>\\n </else-if>\\n <else-if type=\\\"legislation\\\">\\n <text macro=\\\"legal-source-legislation\\\"/>\\n </else-if>\\n <else-if type=\\\"regulation\\\">\\n <text macro=\\\"legal-source-regulation\\\"/>\\n </else-if>\\n <else-if type=\\\"treaty\\\">\\n <text macro=\\\"legal-source-treaty\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <!-- Legal source types -->\\n <macro name=\\\"legal-source-bill\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"legal-identifier-bill-report\\\"/>\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"authority\\\"/>\\n <!-- `chapter-number` is a session number -->\\n <text variable=\\\"chapter-number\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"volume\\\"/>\\n <text variable=\\\"container-title\\\"/>\\n <text variable=\\\"page-first\\\"/>\\n </group>\\n </group>\\n </macro>\\n <macro name=\\\"legal-source-case\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <text variable=\\\"volume\\\"/>\\n <text variable=\\\"container-title\\\"/>\\n <text macro=\\\"label-section-symbol\\\"/>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"page page-first\\\">\\n <text variable=\\\"page-first\\\"/>\\n </if>\\n <else>\\n <text value=\\\"___\\\"/>\\n </else>\\n </choose>\\n </if>\\n <else>\\n <text macro=\\\"label-number-capitalized\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"legal-source-hearing\\\">\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"authority\\\"/>\\n <!-- `chapter-number` is a session number -->\\n <text variable=\\\"chapter-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"legal-source-legislation\\\">\\n <choose>\\n <if variable=\\\"number\\\">\\n <!-- `number` is a public law number -->\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if variable=\\\"genre\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n </if>\\n <else>\\n <text form=\\\"short\\\" term=\\\"legislation\\\" text-case=\\\"capitalize-first\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"label-number-capitalized\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"volume\\\"/>\\n <text variable=\\\"container-title\\\"/>\\n <text variable=\\\"page-first\\\"/>\\n </group>\\n </group>\\n </if>\\n <else>\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"volume\\\"/>\\n <text variable=\\\"container-title\\\"/>\\n <choose>\\n <if variable=\\\"section\\\">\\n <text macro=\\\"label-section-symbol\\\"/>\\n </if>\\n <else>\\n <text variable=\\\"page-first\\\"/>\\n </else>\\n </choose>\\n </group>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"legal-source-regulation\\\">\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"genre\\\"/>\\n <text macro=\\\"label-number-capitalized\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"volume\\\"/>\\n <text variable=\\\"container-title\\\"/>\\n <choose>\\n <if variable=\\\"section\\\">\\n <text macro=\\\"label-section-symbol\\\"/>\\n </if>\\n <else>\\n <text variable=\\\"page-first\\\"/>\\n </else>\\n </choose>\\n </group>\\n </group>\\n </macro>\\n <macro name=\\\"legal-source-treaty\\\">\\n <group delimiter=\\\" \\\">\\n <number variable=\\\"volume\\\"/>\\n <text variable=\\\"container-title\\\"/>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"page page-first\\\">\\n <text variable=\\\"page-first\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"label-number-capitalized\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- Citation -->\\n <citation collapse=\\\"year\\\" disambiguate-add-givenname=\\\"true\\\" disambiguate-add-names=\\\"true\\\" disambiguate-add-year-suffix=\\\"true\\\" et-al-min=\\\"3\\\" et-al-use-first=\\\"1\\\" givenname-disambiguation-rule=\\\"primary-name-with-initials\\\">\\n <sort>\\n <key macro=\\\"author-sort\\\" names-min=\\\"3\\\" names-use-first=\\\"1\\\"/>\\n <key macro=\\\"date-sort-group\\\"/>\\n <key macro=\\\"date-sort\\\"/>\\n <key variable=\\\"status\\\"/>\\n </sort>\\n <layout delimiter=\\\"; \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"author-short\\\"/>\\n <text macro=\\\"date-short\\\"/>\\n <text macro=\\\"label-locator\\\"/>\\n </group>\\n </layout>\\n </citation>\\n <!-- Bibliography -->\\n <macro name=\\\"bibliography\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"bill hearing legal_case legislation regulation treaty\\\">\\n <!-- Legal items have different orders and delimiters -->\\n <text macro=\\\"legal-reference\\\" suffix=\\\".\\\"/>\\n <text macro=\\\"source-DOI-URL\\\"/>\\n <text variable=\\\"references\\\"/>\\n </if>\\n <else>\\n <group delimiter=\\\". \\\" suffix=\\\".\\\">\\n <text macro=\\\"author-and-contributors\\\"/>\\n <text macro=\\\"date\\\"/>\\n <text macro=\\\"title-and-descriptions\\\"/>\\n <text macro=\\\"source\\\"/>\\n </group>\\n <text macro=\\\"source-DOI-URL\\\"/>\\n <text macro=\\\"publication-history\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <bibliography entry-spacing=\\\"0\\\" et-al-min=\\\"21\\\" et-al-use-first=\\\"19\\\" et-al-use-last=\\\"true\\\" hanging-indent=\\\"true\\\" line-spacing=\\\"2\\\">\\n <sort>\\n <key macro=\\\"author-sort\\\"/>\\n <key macro=\\\"date-sort-group\\\"/>\\n <key macro=\\\"date-sort\\\"/>\\n <key variable=\\\"status\\\"/>\\n <key macro=\\\"title\\\"/>\\n <key variable=\\\"volume\\\"/>\\n <key variable=\\\"part-number\\\"/>\\n <key variable=\\\"event-date\\\"/>\\n <key variable=\\\"original-date\\\"/>\\n <key macro=\\\"source-archive\\\"/>\\n </sort>\\n <layout>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\">\\n <text macro=\\\"bibliography\\\"/>\\n </if>\\n <!-- an inaccessible `interview` or `personal_communication` is cited in-text only (APA 8.9) -->\\n <else-if match=\\\"any\\\" type=\\\"interview personal_communication\\\"/>\\n <else>\\n <text macro=\\\"bibliography\\\"/>\\n </else>\\n </choose>\\n </layout>\\n </bibliography>\\n</style>\\n\",\"modern-language-association\":\"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n<style xmlns=\\\"http://purl.org/net/xbiblio/csl\\\" and=\\\"text\\\" class=\\\"in-text\\\" demote-non-dropping-particle=\\\"never\\\" initialize-with=\\\". \\\" page-range-format=\\\"minimal-two\\\" version=\\\"1.0\\\">\\n <!-- This file was generated by the Style Variant Builder <https://github.com/citation-style-language/style-variant-builder>. To contribute changes, modify the template and regenerate variants. -->\\n <info>\\n <title>MLA Handbook 9th edition (in-text citations)</title>\\n <title-short>Modern Language Association (in-text citations)</title-short>\\n <id>http://www.zotero.org/styles/modern-language-association</id>\\n <link href=\\\"http://www.zotero.org/styles/modern-language-association\\\" rel=\\\"self\\\"/>\\n <link href=\\\"https://style.mla.org/\\\" rel=\\\"documentation\\\"/>\\n <link href=\\\"https://zotero.org/groups/2205533/collections/L96HMJXY\\\" rel=\\\"documentation\\\"/>\\n <author>\\n <name>Sebastian Karcher</name>\\n <uri>https://orcid.org/0000-0001-8249-7388</uri>\\n </author>\\n <author>\\n <name>Andrew Dunning</name>\\n <uri>https://orcid.org/0000-0003-0464-5036</uri>\\n </author>\\n <contributor>\\n <name>Patrick O'Brien</name>\\n </contributor>\\n <category citation-format=\\\"author\\\"/>\\n <category field=\\\"generic-base\\\"/>\\n <category field=\\\"humanities\\\"/>\\n <category field=\\\"literature\\\"/>\\n <summary>MLA source citations, in-text citations system (chapter 6)</summary>\\n <updated>2026-02-03T00:00:00+00:00</updated>\\n <rights license=\\\"http://creativecommons.org/licenses/by-sa/3.0/\\\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\\n </info>\\n <locale xml:lang=\\\"en\\\">\\n <date form=\\\"text\\\">\\n <date-part name=\\\"day\\\" suffix=\\\" \\\"/>\\n <date-part form=\\\"short\\\" name=\\\"month\\\" suffix=\\\" \\\"/>\\n <date-part name=\\\"year\\\"/>\\n </date>\\n <terms>\\n <!-- MLA Appendix 1 -->\\n <term form=\\\"short\\\" name=\\\"chapter\\\">\\n <single>ch.</single>\\n <multiple>chs.</multiple>\\n </term>\\n <term name=\\\"collection-editor\\\">\\n <single>general editor</single>\\n <multiple>general editors</multiple>\\n </term>\\n <term name=\\\"editor-translator\\\">\\n <single>editor and translator</single>\\n <multiple>editors and translators</multiple>\\n </term>\\n <term name=\\\"editortranslator\\\">\\n <single>editor and translator</single>\\n <multiple>editors and translators</multiple>\\n </term>\\n <term form=\\\"verb\\\" name=\\\"editor-translator\\\">edited and translated by</term>\\n <term form=\\\"verb\\\" name=\\\"editortranslator\\\">edited and translated by</term>\\n <term name=\\\"original-work-published\\\">originally published</term>\\n <term form=\\\"short\\\" name=\\\"paragraph\\\">\\n <single>par.</single>\\n <multiple>pars.</multiple>\\n </term>\\n <term form=\\\"short\\\" name=\\\"version\\\">vers.</term>\\n </terms>\\n </locale>\\n <!-- Contents:\\n\\n MLA provides the following series of elements for citations:\\n\\n 1. Author (MLA 5.3-22)\\n 2. Title of Source (MLA 5.23-30)\\n 3. Supplemental Element after Title of Source (MLA 5.106-109)\\n 3.1. Contributor (MLA 5.107)\\n 3.2. Original publication date (MLA 5.108)\\n 3.3. Section of a work labeled generically (MLA 5.109)\\n 4. Container 1\\n 4.1. Title of Container (MLA 5.31-37)\\n 4.2. Contributor (MLA 5.38-47)\\n 4.3. Version (MLA 5.48-50)\\n 4.4. Number (MLA 5.51-53)\\n 4.5. Publisher (MLA 5.54-67)\\n 4.6. Publication Date (MLA 5.68-83)\\n 4.7. Location (MLA 5.84-99)\\n 5. Supplemental Element Between Containers (MLA 5.119)\\n 6. Container 2 (MLA 5.102)\\n 7. Supplemental Element at End of Entry (MLA 5.110-118)\\n 7.1. Date of access (MLA 5.111)\\n 7.2. Medium of publication (MLA 5.112)\\n 7.3. Dissertations and theses (MLA 5.113)\\n 7.4. Publication history (MLA 5.114)\\n 7.5. Book series (MLA 5.115)\\n 7.6. Columns, sections, and other recurring titled features (MLA 5.116)\\n 7.7. Multivolume works (MLA 5.117)\\n -->\\n <!-- Categories of CSL item types:\\n\\n Serial\\n : article-journal article-magazine article-newspaper periodical post-weblog review review-book\\n\\n Serial or Monographic\\n : interview paper-conference\\n\\n Monographic with any of `collection-editor compiler editor editorial-director`.\\n A serial `paper-conference` is unpublished if it lacks any of `issue page supplement-number volume`.\\n\\n Monographic\\n : article book broadcast chapter classic collection dataset document\\n entry entry-dictionary entry-encyclopedia event figure\\n graphic manuscript map motion_picture musical_score\\n pamphlet patent performance personal_communication post report\\n software song speech standard thesis webpage\\n\\n Legal\\n : bill hearing legal_case legislation regulation treaty\\n -->\\n <!-- Variable labels -->\\n <macro name=\\\"label-edition-capitalized\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"edition\\\">\\n <number form=\\\"ordinal\\\" variable=\\\"edition\\\"/>\\n <label form=\\\"short\\\" variable=\\\"edition\\\"/>\\n </if>\\n <else>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"edition\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"label-issue\\\">\\n <group delimiter=\\\" \\\">\\n <label form=\\\"short\\\" variable=\\\"issue\\\"/>\\n <text variable=\\\"issue\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-locator\\\">\\n <group delimiter=\\\" \\\">\\n <label form=\\\"short\\\" variable=\\\"locator\\\"/>\\n <text variable=\\\"locator\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-number\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"standard\\\"/>\\n <else-if is-numeric=\\\"number\\\">\\n <label form=\\\"short\\\" variable=\\\"number\\\"/>\\n </else-if>\\n </choose>\\n <text variable=\\\"number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-number-of-volumes\\\">\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"number-of-volumes\\\"/>\\n <choose>\\n <if is-numeric=\\\"number-of-volumes\\\">\\n <label form=\\\"short\\\" variable=\\\"number-of-volumes\\\"/>\\n </if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"label-page\\\">\\n <group delimiter=\\\" \\\">\\n <label form=\\\"short\\\" variable=\\\"page\\\"/>\\n <text variable=\\\"page\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-part-number\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"part-number\\\">\\n <!-- TODO: Replace with `part-number` label when CSL provides one -->\\n <text form=\\\"short\\\" term=\\\"part\\\"/>\\n </if>\\n </choose>\\n <text variable=\\\"part-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-part-number-capitalized\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"part-number\\\">\\n <!-- TODO: Replace with `part-number` label when CSL provides one -->\\n <text form=\\\"short\\\" term=\\\"part\\\" text-case=\\\"capitalize-first\\\"/>\\n </if>\\n </choose>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"part-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-supplement-number\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <!-- TODO: Replace with `supplement-number` label when CSL provides one -->\\n <if is-numeric=\\\"supplement-number\\\">\\n <text form=\\\"short\\\" term=\\\"supplement\\\"/>\\n </if>\\n </choose>\\n <text variable=\\\"supplement-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-version\\\">\\n <group delimiter=\\\" \\\">\\n <label variable=\\\"version\\\"/>\\n <text variable=\\\"version\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-version-capitalized\\\">\\n <group delimiter=\\\" \\\">\\n <label text-case=\\\"capitalize-first\\\" variable=\\\"version\\\"/>\\n <text variable=\\\"version\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-volume\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"volume\\\">\\n <label form=\\\"short\\\" variable=\\\"volume\\\"/>\\n </if>\\n </choose>\\n <text variable=\\\"volume\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-volume-capitalized\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"volume\\\">\\n <label form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"volume\\\"/>\\n </if>\\n </choose>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"volume\\\"/>\\n </group>\\n </macro>\\n <!-- 1. Author (MLA 5.3-22) -->\\n <macro name=\\\"author\\\">\\n <names variable=\\\"composer\\\">\\n <name delimiter-precedes-et-al=\\\"always\\\" delimiter-precedes-last=\\\"always\\\" initialize=\\\"false\\\" name-as-sort-order=\\\"first\\\"/>\\n <label prefix=\\\", \\\"/>\\n <substitute>\\n <names variable=\\\"author\\\"/>\\n <names variable=\\\"guest\\\">\\n <name delimiter-precedes-et-al=\\\"always\\\" delimiter-precedes-last=\\\"always\\\" initialize=\\\"false\\\" name-as-sort-order=\\\"first\\\"/>\\n <!-- `guest` has no label (see MLA 'Interview by podcast host') -->\\n </names>\\n <names variable=\\\"editor-translator\\\"/>\\n <names variable=\\\"editor\\\"/>\\n <names variable=\\\"translator\\\"/>\\n <choose>\\n <if type=\\\"standard\\\">\\n <text variable=\\\"authority\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"title\\\"/>\\n </substitute>\\n </names>\\n </macro>\\n <macro name=\\\"author-short\\\">\\n <group delimiter=\\\", \\\">\\n <names variable=\\\"composer\\\">\\n <name form=\\\"short\\\" initialize=\\\"true\\\"/>\\n <substitute>\\n <names variable=\\\"author\\\"/>\\n <names variable=\\\"guest\\\"/>\\n <names variable=\\\"editor-translator\\\"/>\\n <names variable=\\\"editor\\\"/>\\n <names variable=\\\"translator\\\"/>\\n <choose>\\n <if type=\\\"standard\\\">\\n <text variable=\\\"authority\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"title-short\\\"/>\\n </substitute>\\n </names>\\n <choose>\\n <if disambiguate=\\\"true\\\">\\n <text macro=\\\"title-short\\\"/>\\n </if>\\n </choose>\\n </group>\\n </macro>\\n <!-- 2. Title of Source (MLA 5.23-30) -->\\n <macro name=\\\"title\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"post webpage\\\">\\n <!-- print `container-title` on `post` or `webpage` in the same way as `publisher` -->\\n <text macro=\\\"title-and-part-filter-review\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <text macro=\\\"title-and-part-filter-review\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <text macro=\\\"title-monographic\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <text macro=\\\"title-and-part-filter-review\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"title-monographic\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-short\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- If a review has no `reviewed-title`, assume that `title` contains the title of the reviewed work; the description provides it. -->\\n <choose>\\n <if variable=\\\"reviewed-genre title\\\">\\n <!-- Quotes, title case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </if>\\n <else-if variable=\\\"reviewed-genre reviewed-title title\\\">\\n <!-- Quotes, title case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"supplemental-generic-label-short\\\"/>\\n </else>\\n </choose>\\n </if>\\n <else-if variable=\\\"title\\\">\\n <text macro=\\\"title-primary-short\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"supplemental-generic-label-short\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- Title elements -->\\n <macro name=\\\"title-and-part-filter-review\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- `title` is only the review title if there is a separate `reviewed-genre` or `reviewed-title`; otherwise, it is the title of the reviewed work, printed in the description -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"reviewed-genre reviewed-title\\\">\\n <text macro=\\\"title-and-part-title\\\"/>\\n </if>\\n </choose>\\n </if>\\n <else>\\n <text macro=\\\"title-and-part-title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-and-part-title\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"title-primary\\\"/>\\n <text macro=\\\"label-part-number\\\"/>\\n <text macro=\\\"title-part\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"title-monographic\\\">\\n <!-- For monographic items, assume `part-number` and `part-title` refer to the book/volume. -->\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <text macro=\\\"title-primary\\\"/>\\n </if>\\n <!-- For monographic items without `container-title`, bibliography entries list `part-title` or `volume-title` first if available -->\\n <else-if variable=\\\"part-title\\\">\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else-if variable=\\\"volume-title\\\">\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"volume-title\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"title-primary\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-part\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else>\\n <!-- monographic types -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-primary\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"bill collection legislation regulation treaty\\\">\\n <!-- No italics or quotes, title case -->\\n <text text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </if>\\n <else-if type=\\\"legal_case\\\">\\n <!-- Italicized, sentence case -->\\n <text font-style=\\\"italic\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"book classic graphic hearing map periodical\\\">\\n <!-- Italicized, title case (regardless of `container-title`) -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"post\\\">\\n <!-- Quotes, sentence case -->\\n <text quotes=\\\"true\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <!-- Other types are formatted based on presence of `container-title` -->\\n <else-if variable=\\\"container-title\\\">\\n <!-- Quotes, title case -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"article dataset document interview manuscript paper-conference personal_communication speech\\\">\\n <!-- Container-like but not necessarily with `container-title` -->\\n <!-- Quotes, title case -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else>\\n <!-- Italicized, title case (default) -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-primary-short\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"bill collection legislation regulation treaty\\\">\\n <!-- No italics or quotes, title case -->\\n <text form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </if>\\n <else-if type=\\\"legal_case\\\">\\n <!-- Italicized, sentence case -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"book classic graphic hearing map periodical\\\">\\n <!-- Italicized, title case (regardless of `container-title`) -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"post\\\">\\n <!-- Quotes, sentence case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <!-- Other types are formatted based on presence of `container-title` -->\\n <else-if variable=\\\"container-title\\\">\\n <!-- Quotes, title case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"article dataset document interview manuscript paper-conference personal_communication speech\\\">\\n <!-- Container-like but not necessarily with `container-title` -->\\n <!-- Quotes, title case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else>\\n <!-- Italicized, title case (default) -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- 3. Supplemental Element after Title of Source (MLA 5.106-109) -->\\n <macro name=\\\"supplemental-element-after-title\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"supplemental-contributor\\\"/>\\n <text macro=\\\"supplemental-original-date\\\"/>\\n <text macro=\\\"supplemental-generic-label\\\"/>\\n </group>\\n </macro>\\n <!-- 3.1. Contributor (MLA 5.107) -->\\n <macro name=\\\"supplemental-contributor\\\">\\n <names delimiter=\\\", \\\" variable=\\\"interviewer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name initialize=\\\"false\\\"/>\\n </names>\\n </macro>\\n <!-- 3.2. Original publication date (MLA 5.108) -->\\n <macro name=\\\"supplemental-original-date\\\">\\n <choose>\\n <if type=\\\"personal_communication\\\">\\n <!-- date and place of composition for letters -->\\n <text macro=\\\"container1-location-event\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"original-publisher original-publisher-place\\\"/>\\n <else-if is-uncertain-date=\\\"original-date\\\">\\n <date form=\\\"text\\\" prefix=\\\"[\\\" suffix=\\\"?]\\\" variable=\\\"original-date\\\"/>\\n </else-if>\\n <else>\\n <date form=\\\"text\\\" variable=\\\"original-date\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- 3.3. Section of a work labeled generically (MLA 5.109) -->\\n <macro name=\\\"supplemental-generic-label\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <text macro=\\\"supplemental-generic-label-review\\\"/>\\n </if>\\n <else-if type=\\\"thesis\\\"/>\\n <else-if variable=\\\"number\\\"/>\\n <else>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"supplemental-generic-label-short\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <text macro=\\\"supplemental-generic-label-review-short\\\"/>\\n </if>\\n <else>\\n <text form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- Generic label elements -->\\n <macro name=\\\"supplemental-generic-label-review\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if variable=\\\"reviewed-genre\\\">\\n <text term=\\\"review-of\\\" text-case=\\\"capitalize-first\\\"/>\\n <text variable=\\\"reviewed-genre\\\"/>\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"reviewed-title\\\">\\n <names variable=\\\"reviewed-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n </if>\\n <else-if variable=\\\"number\\\">\\n <text term=\\\"review-of\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <!-- If no `reviewed-genre`, assume that `genre` is entered as 'Review of the book' or similar -->\\n <else-if variable=\\\"genre\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n </else-if>\\n <else>\\n <text term=\\\"review-of\\\" text-case=\\\"capitalize-first\\\"/>\\n </else>\\n </choose>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"reviewed-genre reviewed-title\\\">\\n <!-- Not possible to distinguish TV series episode from other reviewed works without a reviewed source title -->\\n <!-- Adapt for `reviewed-container-title` or similar if it becomes available -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"reviewed-title\\\"/>\\n </if>\\n <else>\\n <!-- Assume title is title of reviewed work -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else>\\n </choose>\\n </group>\\n <choose>\\n <if variable=\\\"reviewed-genre reviewed-title title\\\">\\n <names variable=\\\"reviewed-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n <else-if variable=\\\"reviewed-genre\\\"/>\\n <else>\\n <names variable=\\\"reviewed-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name initialize=\\\"false\\\"/>\\n </names>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"supplemental-generic-label-review-short\\\">\\n <group delimiter=\\\" \\\">\\n <text term=\\\"review-of\\\"/>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"reviewed-genre reviewed-title\\\">\\n <!-- Not possible to distinguish TV series episode from other reviewed works without a reviewed source title -->\\n <!-- Adapt for `reviewed-container-title` or similar if it becomes available -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"reviewed-title\\\"/>\\n </if>\\n <else>\\n <!-- Assume title is title of reviewed work -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- 4. Container 1 -->\\n <macro name=\\\"container1\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"container1-title\\\"/>\\n <text macro=\\\"container1-contributor\\\"/>\\n <text macro=\\\"container1-version\\\"/>\\n <text macro=\\\"container1-number\\\"/>\\n <text macro=\\\"container1-publisher\\\"/>\\n <text macro=\\\"container1-publication-date\\\"/>\\n <text macro=\\\"container1-location\\\"/>\\n </group>\\n </macro>\\n <!-- 4.1. Title of Container (MLA 5.31-37) -->\\n <macro name=\\\"container1-title\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <text macro=\\\"container1-title-serial\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"container1-title-monographic\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <text macro=\\\"container1-title-serial\\\"/>\\n </else-if>\\n <else>\\n <!-- monographic types -->\\n <text macro=\\\"container1-title-monographic\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"container1-title-serial\\\">\\n <group delimiter=\\\", \\\">\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"volume-title\\\"/>\\n <group delimiter=\\\" \\\">\\n <choose>\\n <!-- Journal special issues and supplements (MLA 7.4) -->\\n <if match=\\\"none\\\" variable=\\\"container-title\\\"/>\\n <else-if variable=\\\"supplement-number volume-title\\\">\\n <text term=\\\"supplement\\\"/>\\n <text value=\\\"to\\\"/>\\n </else-if>\\n <else-if type=\\\"periodical\\\" variable=\\\"supplement-number title\\\">\\n <text term=\\\"supplement\\\" text-case=\\\"capitalize-first\\\"/>\\n <text value=\\\"to\\\"/>\\n </else-if>\\n <else-if type=\\\"periodical\\\" variable=\\\"volume-title\\\">\\n <text term=\\\"special-issue\\\" text-case=\\\"capitalize-first\\\"/>\\n <text value=\\\"of\\\"/>\\n </else-if>\\n <else-if type=\\\"periodical\\\" variable=\\\"title\\\">\\n <text term=\\\"special-issue\\\" text-case=\\\"capitalize-first\\\"/>\\n <text value=\\\"of\\\"/>\\n </else-if>\\n <else-if variable=\\\"volume-title\\\">\\n <text term=\\\"special-issue\\\"/>\\n <text value=\\\"of\\\"/>\\n </else-if>\\n </choose>\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n <text prefix=\\\"[\\\" suffix=\\\"]\\\" variable=\\\"publisher-place\\\"/>\\n </group>\\n </group>\\n </macro>\\n <macro name=\\\"container1-title-monographic\\\">\\n <choose>\\n <if variable=\\\"container-title part-title\\\">\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </if>\\n <else-if variable=\\\"container-title volume-title\\\">\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"volume-title\\\"/>\\n </else-if>\\n <else>\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- 4.2. Contributor (MLA 5.38-47) -->\\n <macro name=\\\"container1-contributor\\\">\\n <group delimiter=\\\", \\\">\\n <names delimiter=\\\", \\\" variable=\\\"container-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <names delimiter=\\\", \\\" variable=\\\"editor-translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"editor translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"director series-creator illustrator host narrator contributor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n <else>\\n <names delimiter=\\\", \\\" variable=\\\"editor-translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"editor translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"director series-creator illustrator host narrator contributor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name initialize=\\\"false\\\"/>\\n </names>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- 4.3. Version (MLA 5.48-50) -->\\n <macro name=\\\"container1-version\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"label-edition-capitalized\\\"/>\\n <choose>\\n <if variable=\\\"edition\\\">\\n <text macro=\\\"label-version\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"label-version-capitalized\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- 4.4. Number (MLA 5.51-53) -->\\n <macro name=\\\"container1-number\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <!-- `collection-title` is for any serial with multiple series (e.g. 'second series') -->\\n <if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <text variable=\\\"collection-title\\\"/>\\n <text macro=\\\"label-volume\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"label-volume\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <text variable=\\\"collection-title\\\"/>\\n <text macro=\\\"label-volume\\\"/>\\n </else-if>\\n <!-- in monographic types, lowercase with a preceding element -->\\n <else-if match=\\\"any\\\" variable=\\\"part-title volume-title\\\">\\n <!-- monographic types -->\\n <text macro=\\\"label-volume\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"edition container-title\\\">\\n <text macro=\\\"label-volume\\\"/>\\n </else-if>\\n <!--other contributors preceding the volume-->\\n <else-if variable=\\\"author\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"container-author contributor director editor editor-translator illustrator interviewer translator\\\">\\n <text macro=\\\"label-volume\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else>\\n <text macro=\\\"label-volume-capitalized\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"label-issue\\\"/>\\n <text macro=\\\"label-supplement-number\\\"/>\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"number\\\" type=\\\"broadcast\\\" variable=\\\"genre\\\">\\n <text variable=\\\"genre\\\"/>\\n <text variable=\\\"number\\\"/>\\n </if>\\n <else-if is-numeric=\\\"number\\\" type=\\\"broadcast\\\">\\n <text value=\\\"episode\\\"/>\\n <text variable=\\\"number\\\"/>\\n </else-if>\\n <else-if variable=\\\"number\\\">\\n <text variable=\\\"genre\\\"/>\\n <text macro=\\\"label-number\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </group>\\n </macro>\\n <!-- 4.5. Publisher (MLA 5.54-67) -->\\n <macro name=\\\"container1-publisher\\\">\\n <choose>\\n <if type=\\\"thesis\\\"/>\\n <!-- omit serial types -->\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"container1-publisher-or-place\\\"/>\\n </else-if>\\n <!-- omit serial types -->\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\"/>\\n <else>\\n <!-- monographic types -->\\n <text macro=\\\"container1-publisher-or-place\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"container1-publisher-or-place\\\">\\n <choose>\\n <if variable=\\\"publisher\\\">\\n <text variable=\\\"publisher\\\"/>\\n </if>\\n <else>\\n <!-- use place of publication as fallback (cf. MLA 5.67) -->\\n <text variable=\\\"publisher-place\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- 4.6. Publication Date (MLA 5.68-83) -->\\n <macro name=\\\"container1-publication-date\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"book chapter motion_picture paper-conference thesis\\\">\\n <choose>\\n <if is-uncertain-date=\\\"issued\\\">\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" prefix=\\\"[\\\" suffix=\\\"?]\\\" variable=\\\"issued\\\"/>\\n </if>\\n <else>\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" variable=\\\"issued\\\"/>\\n </else>\\n </choose>\\n </if>\\n <else-if type=\\\"article-journal\\\">\\n <choose>\\n <if is-uncertain-date=\\\"issued\\\">\\n <date date-parts=\\\"year-month\\\" form=\\\"text\\\" prefix=\\\"[\\\" suffix=\\\"?]\\\" variable=\\\"issued\\\"/>\\n </if>\\n <else>\\n <date date-parts=\\\"year-month\\\" form=\\\"text\\\" variable=\\\"issued\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else-if type=\\\"speech\\\"/>\\n <else>\\n <choose>\\n <if is-uncertain-date=\\\"issued\\\">\\n <group delimiter=\\\" \\\">\\n <text term=\\\"circa\\\" text-case=\\\"capitalize-first\\\"/>\\n <date form=\\\"text\\\" variable=\\\"issued\\\"/>\\n </group>\\n </if>\\n <else>\\n <date form=\\\"text\\\" variable=\\\"issued\\\"/>\\n </else>\\n </choose>\\n </else>\\n </choose>\\n </macro>\\n <!-- 4.7. Location (MLA 5.84-99) -->\\n <macro name=\\\"container1-location\\\">\\n <!-- location of a physical object or event (MLA 5.99) -->\\n <group delimiter=\\\", \\\">\\n <choose>\\n <!-- serials cannot be part of an event -->\\n <if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\"/>\\n <!-- `event-date` supplies date of composition for letters, handled in `supplemental-original-date` -->\\n <else-if type=\\\"personal_communication\\\"/>\\n <else-if type=\\\"paper-conference\\\">\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"collection-editor compiler editor editorial-director issue page supplement-number volume\\\">\\n <!-- Don't print event info for conference papers published in a proceedings volume -->\\n <text macro=\\\"container1-location-event\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else>\\n <!-- For other item types, print event info even if published (e.g. collection catalogs, performance programs). -->\\n <text macro=\\\"container1-location-event\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"archive\\\"/>\\n <text variable=\\\"archive-place\\\"/>\\n <text variable=\\\"archive_collection\\\"/>\\n <text variable=\\\"archive_location\\\"/>\\n <text macro=\\\"label-page\\\"/>\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"source\\\">\\n <text macro=\\\"container1-location-URI\\\"/>\\n </if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"container1-location-event\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"event event-date event-title\\\">\\n <!-- TODO: We expect `event-title` to be used, but processors and applications may not be updated yet. This macro ensures that either `event` or `event-title` can be accepted. Remove if processor logic and application adoption can handle this. -->\\n <choose>\\n <if variable=\\\"event-title\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"event-title\\\"/>\\n </if>\\n <else>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"event\\\"/>\\n </else>\\n </choose>\\n <choose>\\n <if is-uncertain-date=\\\"event-date\\\">\\n <date form=\\\"text\\\" prefix=\\\"[\\\" suffix=\\\"?]\\\" variable=\\\"event-date\\\"/>\\n </if>\\n <else>\\n <date form=\\\"text\\\" variable=\\\"event-date\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"event-place\\\"/>\\n </if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"container1-location-URI\\\">\\n <choose>\\n <if variable=\\\"DOI\\\">\\n <text prefix=\\\"https://doi.org/\\\" variable=\\\"DOI\\\"/>\\n </if>\\n <else>\\n <text variable=\\\"URL\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- 5. Supplemental Element Between Containers (MLA 5.119) -->\\n <macro name=\\\"supplemental-element-between\\\">\\n <choose>\\n <if variable=\\\"source\\\">\\n <text macro=\\\"supplemental-element-movable\\\"/>\\n </if>\\n </choose>\\n </macro>\\n <!-- 6. Container 2 (MLA 5.102) -->\\n <macro name=\\\"container2\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"source\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"DOI URL\\\">\\n <!-- Title of Container -->\\n <text font-style=\\\"italic\\\" variable=\\\"source\\\"/>\\n <!-- Location -->\\n <text macro=\\\"container1-location-URI\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <!-- 7. Supplemental Element at End of Entry (MLA 5.110-118) -->\\n <macro name=\\\"supplemental-element-end\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"supplemental-date-access\\\"/>\\n <text macro=\\\"supplemental-medium\\\"/>\\n <choose>\\n <if variable=\\\"source\\\"/>\\n <else>\\n <text macro=\\\"supplemental-element-movable\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"supplemental-element-movable\\\">\\n <!-- information relevant only to one container appears either in `supplemental-element-between` or `supplemental-element-end` depending on the presence of `source` -->\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <text macro=\\\"supplemental-columns-sections\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"supplemental-dissertations-theses\\\"/>\\n <text macro=\\\"supplemental-publication-history\\\"/>\\n <text macro=\\\"supplemental-book-series\\\"/>\\n <text macro=\\\"supplemental-multivolume-works\\\"/>\\n </if>\\n <else>\\n <!-- serial types -->\\n <text macro=\\\"supplemental-columns-sections\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else>\\n <!-- monographic types -->\\n <text macro=\\\"supplemental-dissertations-theses\\\"/>\\n <text macro=\\\"supplemental-publication-history\\\"/>\\n <text macro=\\\"supplemental-book-series\\\"/>\\n <text macro=\\\"supplemental-multivolume-works\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- 7.1. Date of access (MLA 5.111) -->\\n <macro name=\\\"supplemental-date-access\\\">\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"issued\\\">\\n <group delimiter=\\\" \\\">\\n <text term=\\\"accessed\\\" text-case=\\\"capitalize-first\\\"/>\\n <date form=\\\"text\\\" variable=\\\"accessed\\\"/>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <!-- 7.2. Medium of publication (MLA 5.112) -->\\n <macro name=\\\"supplemental-medium\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"medium\\\"/>\\n </macro>\\n <!-- 7.3. Dissertations and theses (MLA 5.113) -->\\n <macro name=\\\"supplemental-dissertations-theses\\\">\\n <choose>\\n <if type=\\\"thesis\\\">\\n <group delimiter=\\\", \\\">\\n <text variable=\\\"publisher\\\"/>\\n <text variable=\\\"genre\\\"/>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <!-- 7.4. Publication history (MLA 5.114) -->\\n <macro name=\\\"supplemental-publication-history\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"original-publisher original-publisher-place original-title\\\">\\n <text term=\\\"original-work-published\\\" text-case=\\\"capitalize-first\\\"/>\\n </if>\\n </choose>\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <text value=\\\"as\\\"/>\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"original-title\\\"/>\\n </group>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"original-publisher original-publisher-place\\\">\\n <choose>\\n <if variable=\\\"original-publisher\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"original-title\\\">\\n <text term=\\\"by\\\"/>\\n </if>\\n </choose>\\n <text variable=\\\"original-publisher\\\"/>\\n </group>\\n </if>\\n <else>\\n <text variable=\\\"original-publisher-place\\\"/>\\n </else>\\n </choose>\\n <choose>\\n <if is-uncertain-date=\\\"original-date\\\">\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" prefix=\\\"[\\\" suffix=\\\"?]\\\" variable=\\\"original-date\\\"/>\\n </if>\\n <else>\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" variable=\\\"original-date\\\"/>\\n </else>\\n </choose>\\n </if>\\n </choose>\\n </group>\\n </group>\\n </macro>\\n <!-- 7.5. Book series (MLA 5.115) -->\\n <macro name=\\\"supplemental-book-series\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if is-numeric=\\\"collection-number\\\" variable=\\\"collection-title\\\">\\n <group delimiter=\\\" \\\">\\n <text text-case=\\\"title\\\" variable=\\\"collection-title\\\"/>\\n <text variable=\\\"collection-number\\\"/>\\n </group>\\n </if>\\n <else-if variable=\\\"collection-title\\\">\\n <text text-case=\\\"title\\\" variable=\\\"collection-title\\\"/>\\n <text variable=\\\"collection-number\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <!-- 7.6. Columns, sections, and other recurring titled features (MLA 5.116) -->\\n <macro name=\\\"supplemental-columns-sections\\\">\\n <text text-case=\\\"title\\\" variable=\\\"section\\\"/>\\n </macro>\\n <!-- 7.7. Multivolume works (MLA 5.117) -->\\n <macro name=\\\"supplemental-multivolume-works\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"part-number part-title volume volume-title\\\">\\n <!-- part and title with individual titles -->\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"label-part-number-capitalized\\\"/>\\n <text value=\\\"of\\\"/>\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"volume-title\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"label-volume\\\"/>\\n <text value=\\\"of\\\"/>\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"title-primary\\\"/>\\n </else>\\n </choose>\\n <names variable=\\\"collection-editor\\\">\\n <name initialize=\\\"false\\\"/>\\n <label prefix=\\\", \\\"/>\\n </names>\\n </group>\\n </group>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"part-title volume-title\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if variable=\\\"part-number volume\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"label-volume-capitalized\\\"/>\\n <text macro=\\\"label-part-number\\\"/>\\n <text value=\\\"of\\\"/>\\n </group>\\n </if>\\n <else-if variable=\\\"part-number\\\">\\n <text macro=\\\"label-part-number-capitalized\\\"/>\\n <text value=\\\"of\\\"/>\\n </else-if>\\n <else-if variable=\\\"volume\\\">\\n <text macro=\\\"label-volume-capitalized\\\"/>\\n <text value=\\\"of\\\"/>\\n </else-if>\\n </choose>\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"title-primary\\\"/>\\n </else>\\n </choose>\\n <names variable=\\\"collection-editor\\\">\\n <name initialize=\\\"false\\\"/>\\n <label prefix=\\\", \\\"/>\\n </names>\\n </group>\\n </group>\\n </else-if>\\n <!-- numbers without a volume title appear in `container1-number` -->\\n </choose>\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"volume\\\">\\n <text macro=\\\"label-number-of-volumes\\\"/>\\n </if>\\n </choose>\\n <!-- TODO: provide container date here when available -->\\n </group>\\n </macro>\\n <citation disambiguate-add-givenname=\\\"true\\\" disambiguate-add-names=\\\"true\\\" et-al-min=\\\"3\\\" et-al-use-first=\\\"1\\\">\\n <layout delimiter=\\\"; \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <choose>\\n <if locator=\\\"line page timestamp\\\" match=\\\"any\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"author-short\\\"/>\\n <text variable=\\\"locator\\\"/>\\n </group>\\n </if>\\n <else>\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"author-short\\\"/>\\n <text macro=\\\"label-locator\\\"/>\\n </group>\\n </else>\\n </choose>\\n </layout>\\n </citation>\\n <bibliography entry-spacing=\\\"0\\\" et-al-min=\\\"3\\\" et-al-use-first=\\\"1\\\" hanging-indent=\\\"true\\\" line-spacing=\\\"2\\\" subsequent-author-substitute=\\\"———\\\">\\n <sort>\\n <key macro=\\\"author\\\"/>\\n <key macro=\\\"title\\\"/>\\n <key macro=\\\"supplemental-element-after-title\\\"/>\\n <key macro=\\\"container1\\\"/>\\n <key macro=\\\"supplemental-element-between\\\"/>\\n <key macro=\\\"container2\\\"/>\\n <key macro=\\\"supplemental-element-end\\\"/>\\n </sort>\\n <layout suffix=\\\".\\\">\\n <group delimiter=\\\". \\\">\\n <text macro=\\\"author\\\"/>\\n <text macro=\\\"title\\\"/>\\n <text macro=\\\"supplemental-element-after-title\\\"/>\\n <text macro=\\\"container1\\\"/>\\n <text macro=\\\"supplemental-element-between\\\"/>\\n <text macro=\\\"container2\\\"/>\\n <text macro=\\\"supplemental-element-end\\\"/>\\n </group>\\n </layout>\\n </bibliography>\\n</style>\\n\",\"chicago-author-date\":\"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n<style xmlns=\\\"http://purl.org/net/xbiblio/csl\\\" class=\\\"in-text\\\" initialize-with=\\\". \\\" page-range-format=\\\"chicago-16\\\" version=\\\"1.0\\\">\\n <!-- This file was generated by the Style Variant Builder <https://github.com/citation-style-language/style-variant-builder>. To contribute changes, modify the template and regenerate variants. -->\\n <info>\\n <title>Chicago Manual of Style 18th edition (author-date)</title>\\n <title-short>CMOS/CMS with Bluebook (author-date/AD [13.102])</title-short>\\n <id>http://www.zotero.org/styles/chicago-author-date</id>\\n <link href=\\\"http://www.zotero.org/styles/chicago-author-date\\\" rel=\\\"self\\\"/>\\n <link href=\\\"http://www.zotero.org/styles/chicago-notes-bibliography\\\" rel=\\\"template\\\"/>\\n <link href=\\\"https://www.chicagomanualofstyle.org/\\\" rel=\\\"documentation\\\"/>\\n <link href=\\\"https://zotero.org/groups/2205533/collections/5V67EPX3\\\" rel=\\\"documentation\\\"/>\\n <author>\\n <name>Andrew Dunning</name>\\n <uri>https://orcid.org/0000-0003-0464-5036</uri>\\n </author>\\n <category citation-format=\\\"author-date\\\"/>\\n <category field=\\\"anthropology\\\"/>\\n <category field=\\\"communications\\\"/>\\n <category field=\\\"generic-base\\\"/>\\n <category field=\\\"geography\\\"/>\\n <category field=\\\"history\\\"/>\\n <category field=\\\"humanities\\\"/>\\n <category field=\\\"law\\\"/>\\n <category field=\\\"linguistics\\\"/>\\n <category field=\\\"literature\\\"/>\\n <category field=\\\"philosophy\\\"/>\\n <category field=\\\"political_science\\\"/>\\n <category field=\\\"science\\\"/>\\n <category field=\\\"social_science\\\"/>\\n <category field=\\\"sociology\\\"/>\\n <category field=\\\"theology\\\"/>\\n <summary>Chicago-style source citations (with Bluebook for legal citations), author-date system</summary>\\n <updated>2025-02-09T00:00:00+00:00</updated>\\n <rights license=\\\"http://creativecommons.org/licenses/by-sa/3.0/\\\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\\n </info>\\n <locale xml:lang=\\\"en\\\">\\n <terms>\\n <!-- Chicago omits 'by' from `verb-short` forms; it abbreviates only the most common roles -->\\n <term name=\\\"advance-online-publication\\\">ahead of print</term>\\n <term name=\\\"anonymous\\\">unsigned</term>\\n <term form=\\\"verb-short\\\" name=\\\"collection-editor\\\">ed.</term>\\n <term form=\\\"short\\\" name=\\\"collection-number\\\">\\n <single>vol.</single>\\n <multiple>vols.</multiple>\\n </term>\\n <term form=\\\"verb-short\\\" name=\\\"compiler\\\">comp.</term>\\n <term form=\\\"verb-short\\\" name=\\\"editor\\\">ed.</term>\\n <term form=\\\"short\\\" name=\\\"editor-translator\\\">\\n <single>ed. and trans.</single>\\n <multiple>eds. and trans.</multiple>\\n </term>\\n <term form=\\\"short\\\" name=\\\"editortranslator\\\">\\n <single>ed. and trans.</single>\\n <multiple>eds. and trans.</multiple>\\n </term>\\n <term form=\\\"verb\\\" name=\\\"editor-translator\\\">edited and translated by</term>\\n <term form=\\\"verb\\\" name=\\\"editortranslator\\\">edited and translated by</term>\\n <term form=\\\"verb-short\\\" name=\\\"editor-translator\\\">ed. and trans.</term>\\n <term form=\\\"verb-short\\\" name=\\\"editortranslator\\\">ed. and trans.</term>\\n <term form=\\\"verb-short\\\" name=\\\"illustrator\\\">ill.</term>\\n <term form=\\\"short\\\" name=\\\"legislation\\\">Pub. L.</term>\\n <term name=\\\"manuscript\\\">unpublished manuscript</term>\\n <term name=\\\"original-work-published\\\">originally published as</term>\\n <term form=\\\"short\\\" name=\\\"paper-conference\\\">paper</term>\\n <!-- 'under' replaces 's.v.' from CMOS17 and earlier (CMOS18 14.130) -->\\n <term name=\\\"sub-verbo\\\">under</term>\\n <term form=\\\"short\\\" name=\\\"sub-verbo\\\">under</term>\\n <term name=\\\"timestamp\\\">at</term>\\n <term form=\\\"verb-short\\\" name=\\\"translator\\\">trans.</term>\\n </terms>\\n </locale>\\n <locale xml:lang=\\\"en-GB\\\">\\n <terms>\\n <!-- the Bibliography of Additional Resources recommends the New Oxford Style Manual as a British English guide, which the `en-GB` locale follows -->\\n <term form=\\\"short\\\" name=\\\"collection-number\\\">\\n <single>vol.</single>\\n <multiple>vols</multiple>\\n </term>\\n <term form=\\\"short\\\" name=\\\"editor-translator\\\">\\n <single>ed. and trans.</single>\\n <multiple>eds and trans.</multiple>\\n </term>\\n <term form=\\\"short\\\" name=\\\"editortranslator\\\">\\n <single>ed. and trans.</single>\\n <multiple>eds and trans.</multiple>\\n </term>\\n <term form=\\\"verb-short\\\" name=\\\"illustrator\\\">illus.</term>\\n </terms>\\n </locale>\\n <!-- Contents:\\n\\n This file interprets Chicago using APA's four basic reference elements\\n (cf. CMOS18 14.2, 14.64, 14.161):\\n\\n 1. Author (CMOS18 13.74-86)\\n 2. Date (author-date system only, CMOS18 13.102)\\n 3. Title and descriptions (CMOS18 13.87-101)\\n 3.1. Title\\n 3.2. Description\\n 3.3. Identifiers (edition, contributors, volume)\\n 4. Source\\n 4.1. Serial sources\\n 4.2. Monographic sources\\n 4.3. Series\\n 4.4. Event\\n 4.5. Publisher\\n 4.6. Date\\n 4.7. Locator (including page references)\\n 4.8. Medium\\n 4.9. Archival location\\n 4.10. URL or persistent identifier\\n\\n Freeform annotations to bibliography entries:\\n\\n 5. Notes\\n\\n Chicago also provides parallel rules for legal references following\\n The Bluebook: A Uniform System of Citation (code shared with APA):\\n\\n 6. Legal references\\n -->\\n <!-- In this file, macros suffixed `-bib` and `-note` are parallel versions\\n of the same features for the bibliography and notes, and all changes\\n must be applied to both. They should only contain differences of\\n punctuation (periods in bibliography, commas in notes) and capitalization,\\n except where the comments indicate structural changes. -->\\n <!-- Categories of CSL item types:\\n\\n Serial\\n : article-journal article-magazine article-newspaper periodical post-weblog review review-book\\n\\n Serial or Monographic\\n : interview paper-conference\\n\\n Monographic with any of `collection-editor compiler editor editorial-director`.\\n A serial `paper-conference` is unpublished if it lacks any of `issue page supplement-number volume`.\\n\\n Monographic\\n : article book broadcast chapter classic collection dataset document\\n entry entry-dictionary entry-encyclopedia event figure\\n graphic manuscript map motion_picture musical_score\\n pamphlet patent performance personal_communication post report\\n software song speech standard thesis webpage\\n\\n Legal\\n : bill hearing legal_case legislation regulation treaty\\n -->\\n <!-- Variable labels -->\\n <macro name=\\\"label-chapter-number\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"chapter-number\\\" type=\\\"song\\\">\\n <text value=\\\"track\\\"/>\\n </if>\\n <else-if is-numeric=\\\"chapter-number\\\">\\n <label form=\\\"short\\\" variable=\\\"chapter-number\\\"/>\\n </else-if>\\n </choose>\\n <text variable=\\\"chapter-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-chapter-number-capitalized\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"chapter-number\\\" type=\\\"song\\\">\\n <text text-case=\\\"capitalize-first\\\" value=\\\"track\\\"/>\\n </if>\\n <else-if is-numeric=\\\"chapter-number\\\">\\n <label form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"chapter-number\\\"/>\\n </else-if>\\n </choose>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"chapter-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-collection-number\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"collection-number\\\">\\n <label form=\\\"short\\\" variable=\\\"collection-number\\\"/>\\n </if>\\n </choose>\\n <text variable=\\\"collection-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-edition\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"edition\\\">\\n <number form=\\\"ordinal\\\" variable=\\\"edition\\\"/>\\n <label form=\\\"short\\\" variable=\\\"edition\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types: full label (CMOS18 14.89) -->\\n <text variable=\\\"edition\\\"/>\\n <label variable=\\\"edition\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text variable=\\\"edition\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <text variable=\\\"edition\\\"/>\\n <label variable=\\\"edition\\\"/>\\n </else-if>\\n <else>\\n <!-- monographic types -->\\n <text variable=\\\"edition\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"label-edition-capitalized\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"edition\\\">\\n <number form=\\\"ordinal\\\" variable=\\\"edition\\\"/>\\n <label form=\\\"short\\\" variable=\\\"edition\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types: full label (CMOS18 14.89) -->\\n <text text-case=\\\"title\\\" variable=\\\"edition\\\"/>\\n <label text-case=\\\"capitalize-first\\\" variable=\\\"edition\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"edition\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <text text-case=\\\"title\\\" variable=\\\"edition\\\"/>\\n <label text-case=\\\"capitalize-first\\\" variable=\\\"edition\\\"/>\\n </else-if>\\n <else>\\n <!-- monographic types -->\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"edition\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"label-issue\\\">\\n <group delimiter=\\\" \\\">\\n <label form=\\\"short\\\" variable=\\\"issue\\\"/>\\n <text variable=\\\"issue\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-locator\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if locator=\\\"page\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"bill hearing legal_case legislation regulation treaty\\\">\\n <!-- Bluebook-style labels for legal types (CMOS18 14.174) -->\\n <choose>\\n <if locator=\\\"chapter paragraph section\\\" match=\\\"any\\\">\\n <label form=\\\"symbol\\\" variable=\\\"locator\\\"/>\\n </if>\\n <else>\\n <label form=\\\"short\\\" variable=\\\"locator\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else-if is-numeric=\\\"locator\\\" locator=\\\"line\\\">\\n <label variable=\\\"locator\\\"/>\\n </else-if>\\n <else-if is-numeric=\\\"locator\\\">\\n <label form=\\\"short\\\" variable=\\\"locator\\\"/>\\n </else-if>\\n <else-if locator=\\\"chapter line verse\\\" match=\\\"any\\\"/>\\n <!-- a non-numeric canonical reference is identified by its formatting and does not need a label (CMOS18 14.143-54) -->\\n <else>\\n <label form=\\\"short\\\" variable=\\\"locator\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"locator\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-locator-all\\\">\\n <group delimiter=\\\" \\\">\\n <label form=\\\"short\\\" variable=\\\"locator\\\"/>\\n <text variable=\\\"locator\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-number-capitalized\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"standard\\\"/>\\n <else-if is-numeric=\\\"number\\\" match=\\\"any\\\" type=\\\"legislation regulation\\\">\\n <label form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"number\\\"/>\\n </else-if>\\n </choose>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-number-of-volumes\\\">\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"number-of-volumes\\\"/>\\n <choose>\\n <if is-numeric=\\\"number-of-volumes\\\">\\n <label form=\\\"short\\\" variable=\\\"number-of-volumes\\\"/>\\n </if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"label-page\\\">\\n <group delimiter=\\\" \\\">\\n <label form=\\\"short\\\" variable=\\\"page\\\"/>\\n <text variable=\\\"page\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-part-number\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"part-number\\\">\\n <!-- TODO: Replace with `part-number` label when CSL provides one -->\\n <text form=\\\"short\\\" term=\\\"part\\\"/>\\n </if>\\n </choose>\\n <text variable=\\\"part-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-part-number-capitalized\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"part-number\\\">\\n <!-- TODO: Replace with `part-number` label when CSL provides one -->\\n <text form=\\\"short\\\" term=\\\"part\\\" text-case=\\\"capitalize-first\\\"/>\\n </if>\\n </choose>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"part-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-section-capitalized\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"section\\\">\\n <label form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"section\\\"/>\\n </if>\\n </choose>\\n <text text-case=\\\"title\\\" variable=\\\"section\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-section-symbol\\\">\\n <group delimiter=\\\" \\\">\\n <label form=\\\"symbol\\\" variable=\\\"section\\\"/>\\n <text variable=\\\"section\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-supplement-number\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <!-- TODO: Replace with `supplement-number` label when CSL provides one -->\\n <if variable=\\\"issue supplement-number\\\">\\n <!-- if there is both an issue and supplement number, do not label both as 'no.' -->\\n <text form=\\\"short\\\" term=\\\"supplement\\\"/>\\n </if>\\n <else-if is-numeric=\\\"supplement-number\\\" variable=\\\"volume-title\\\">\\n <!-- if there is a volume title, it is already described as a supplement -->\\n <text form=\\\"short\\\" term=\\\"issue\\\"/>\\n </else-if>\\n <else-if is-numeric=\\\"supplement-number\\\" type=\\\"periodical\\\" variable=\\\"title\\\">\\n <text form=\\\"short\\\" term=\\\"issue\\\"/>\\n </else-if>\\n <else-if is-numeric=\\\"supplement-number\\\">\\n <text form=\\\"short\\\" term=\\\"supplement\\\"/>\\n </else-if>\\n </choose>\\n <text variable=\\\"supplement-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-version\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"software\\\">\\n <!-- short version label for software (CMOS18 14.169) -->\\n <label form=\\\"short\\\" variable=\\\"version\\\"/>\\n </if>\\n <else>\\n <label variable=\\\"version\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"version\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-version-capitalized\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"software\\\">\\n <!-- short version label for software (CMOS18 14.169) -->\\n <label form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"version\\\"/>\\n </if>\\n <else>\\n <label text-case=\\\"capitalize-first\\\" variable=\\\"version\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"version\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-volume\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"volume\\\">\\n <label form=\\\"short\\\" variable=\\\"volume\\\"/>\\n </if>\\n </choose>\\n <text variable=\\\"volume\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-volume-capitalized\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"volume\\\">\\n <label form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"volume\\\"/>\\n </if>\\n </choose>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"volume\\\"/>\\n </group>\\n </macro>\\n <!-- 1. Author (CMOS18 13.74-86) -->\\n <macro name=\\\"author-bib\\\">\\n <names variable=\\\"composer\\\">\\n <name and=\\\"text\\\" delimiter-precedes-last=\\\"always\\\" initialize=\\\"false\\\" name-as-sort-order=\\\"first\\\"/>\\n <label form=\\\"short\\\" prefix=\\\", \\\"/>\\n <substitute>\\n <names variable=\\\"author\\\"/>\\n <!-- cf. `interview` model (CMOS18 14.110); if it is desired to prioritize `host` over `guest`, the latter could be encoded as a `contributor` -->\\n <names variable=\\\"guest\\\"/>\\n <names variable=\\\"host\\\"/>\\n <choose>\\n <if type=\\\"song\\\">\\n <names variable=\\\"performer\\\"/>\\n </if>\\n </choose>\\n <choose>\\n <if type=\\\"classic\\\">\\n <!-- contributors fall after the title of `classic` (CMOS18 14.147) -->\\n <text macro=\\\"author-title-substitute-bib\\\"/>\\n </if>\\n <else-if type=\\\"entry-dictionary\\\" variable=\\\"container-title\\\">\\n <!-- contributors fall after the title of unsigned reference entries (CMOS18 14.130) -->\\n <text macro=\\\"author-title-substitute-container\\\"/>\\n </else-if>\\n <else-if type=\\\"entry-encyclopedia\\\" variable=\\\"container-title\\\">\\n <text macro=\\\"author-title-substitute-container\\\"/>\\n </else-if>\\n </choose>\\n <names variable=\\\"illustrator\\\"/>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"standard\\\">\\n <names variable=\\\"editor-translator\\\"/>\\n <names variable=\\\"editor\\\"/>\\n <names variable=\\\"translator\\\"/>\\n <names variable=\\\"collection-editor\\\"/>\\n </if>\\n </choose>\\n <names variable=\\\"director\\\"/>\\n <choose>\\n <!-- serial `broadcast` prioritizes title (CMOS18 14.165, 14.168) -->\\n <if type=\\\"broadcast\\\" variable=\\\"container-title number title\\\"/>\\n <else>\\n <names variable=\\\"producer\\\"/>\\n <names variable=\\\"executive-producer\\\"/>\\n <names variable=\\\"series-creator\\\"/>\\n <choose>\\n <if type=\\\"broadcast\\\">\\n <names variable=\\\"contributor\\\"/>\\n </if>\\n </choose>\\n </else>\\n </choose>\\n <names variable=\\\"editorial-director\\\"/>\\n <names variable=\\\"compiler\\\"/>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"event performance speech\\\">\\n <names variable=\\\"chair\\\"/>\\n <names variable=\\\"organizer\\\"/>\\n </if>\\n </choose>\\n <names variable=\\\"curator\\\"/>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"software webpage\\\">\\n <!-- `software` listed under the name of the publisher or developer (CMOS18 14.169); `webpage` listed under a site owner or sponsor (CMOS18 14.104) -->\\n <text variable=\\\"publisher\\\"/>\\n </if>\\n <else-if type=\\\"standard\\\">\\n <!-- `standard` listed in bibliography under organization, but note omits this (CMOS18 14.159) -->\\n <text variable=\\\"authority\\\"/>\\n </else-if>\\n </choose>\\n <text macro=\\\"author-title-substitute-container\\\"/>\\n <text macro=\\\"author-title-substitute-bib\\\"/>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"container-title event-date event-place event-title genre title publisher publisher-place\\\"/>\\n <else-if type=\\\"manuscript\\\">\\n <text macro=\\\"source-archive-bib\\\"/>\\n </else-if>\\n </choose>\\n </substitute>\\n </names>\\n </macro>\\n <macro name=\\\"author-inline\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"bill hearing legal_case legislation regulation treaty\\\">\\n <text macro=\\\"title-and-descriptions-short\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"interview personal_communication\\\">\\n <text macro=\\\"author-inline-and-recipient\\\"/>\\n </else-if>\\n <else>\\n <names variable=\\\"composer\\\">\\n <name and=\\\"text\\\" form=\\\"short\\\" initialize=\\\"true\\\"/>\\n <substitute>\\n <names variable=\\\"author\\\"/>\\n <names variable=\\\"guest\\\"/>\\n <names variable=\\\"host\\\"/>\\n <choose>\\n <if type=\\\"song\\\">\\n <names variable=\\\"performer\\\"/>\\n </if>\\n </choose>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"classic performance\\\">\\n <!-- contributors fall after the title of `classic` (CMOS18 14.147), `performance` (CMOS18 14.166) -->\\n <text macro=\\\"author-title-substitute-short\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <!-- contributors fall after the title of unsigned reference entries (CMOS18 14.130) -->\\n <text macro=\\\"author-title-substitute-container-short\\\"/>\\n </else-if>\\n </choose>\\n <names variable=\\\"illustrator\\\"/>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"standard\\\">\\n <names variable=\\\"editor-translator\\\"/>\\n <names variable=\\\"editor\\\"/>\\n <names variable=\\\"translator\\\"/>\\n <names variable=\\\"collection-editor\\\"/>\\n </if>\\n </choose>\\n <choose>\\n <if type=\\\"broadcast\\\" variable=\\\"container-title number title\\\"/>\\n <else>\\n <names variable=\\\"director\\\"/>\\n <names variable=\\\"producer\\\"/>\\n <names variable=\\\"executive-producer\\\"/>\\n <names variable=\\\"series-creator\\\"/>\\n <choose>\\n <if type=\\\"broadcast\\\">\\n <names variable=\\\"contributor\\\"/>\\n </if>\\n </choose>\\n </else>\\n </choose>\\n <names variable=\\\"editorial-director\\\"/>\\n <names variable=\\\"compiler\\\"/>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"event performance speech\\\">\\n <names variable=\\\"chair\\\"/>\\n <names variable=\\\"organizer\\\"/>\\n </if>\\n </choose>\\n <names variable=\\\"curator\\\"/>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"software webpage\\\">\\n <!-- `software` listed under the name of the publisher or developer (CMOS18 14.169); `webpage` listed under a site owner or sponsor (CMOS18 14.104) -->\\n <text form=\\\"short\\\" variable=\\\"publisher\\\"/>\\n </if>\\n <else-if type=\\\"standard\\\">\\n <!-- `standard` listed in bibliography under organization, but note omits this (CMOS18 14.159) -->\\n <text form=\\\"short\\\" variable=\\\"authority\\\"/>\\n </else-if>\\n </choose>\\n <text macro=\\\"author-title-substitute-container-short\\\"/>\\n <text macro=\\\"author-title-substitute-short\\\"/>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"container-title event-date event-place event-title genre title publisher publisher-place\\\"/>\\n <else-if type=\\\"manuscript\\\">\\n <text macro=\\\"source-archive-note\\\"/>\\n </else-if>\\n </choose>\\n </substitute>\\n </names>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"author-sort\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"bill hearing legal_case legislation regulation treaty\\\">\\n <text macro=\\\"legal-title\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"author-bib\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- Author elements -->\\n <macro name=\\\"author-inline-and-recipient\\\">\\n <!-- identical to `author-short-and-recipient` but with initialization -->\\n <group delimiter=\\\" \\\">\\n <choose>\\n <!-- inaccessible `interview` or `personal_commmunication`: in-text citation (CMOS18 14.111) -->\\n <if match=\\\"none\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\">\\n <choose>\\n <if position=\\\"first\\\">\\n <!-- do not shorten at first reference as there is no bibliography entry -->\\n <names variable=\\\"author\\\">\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n <!-- never initialize -->\\n <substitute>\\n <text macro=\\\"title-and-descriptions-short\\\"/>\\n </substitute>\\n </names>\\n </if>\\n <else>\\n <names variable=\\\"author\\\">\\n <name and=\\\"text\\\" form=\\\"short\\\" initialize=\\\"true\\\"/>\\n <substitute>\\n <text macro=\\\"title-and-descriptions-short\\\"/>\\n </substitute>\\n </names>\\n </else>\\n </choose>\\n <choose>\\n <if variable=\\\"genre\\\"/>\\n <!-- recipient appears in the description if there is a `genre`; otherwise after `author` -->\\n <else-if position=\\\"first\\\">\\n <names variable=\\\"recipient\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </else-if>\\n <else>\\n <names variable=\\\"recipient\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" form=\\\"short\\\" initialize=\\\"true\\\"/>\\n </names>\\n </else>\\n </choose>\\n </if>\\n <!-- accessible `interview` or `personal_communication`: standard citation -->\\n <else-if variable=\\\"author recipient\\\">\\n <names variable=\\\"author\\\">\\n <name and=\\\"text\\\" form=\\\"short\\\" initialize=\\\"true\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"genre\\\">\\n <names variable=\\\"recipient\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" form=\\\"short\\\" initialize=\\\"true\\\"/>\\n </names>\\n </if>\\n </choose>\\n </else-if>\\n <else>\\n <names variable=\\\"author\\\">\\n <name and=\\\"text\\\" form=\\\"short\\\" initialize=\\\"true\\\"/>\\n <substitute>\\n <text macro=\\\"title-and-descriptions-short\\\"/>\\n </substitute>\\n </names>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"author-title-substitute-bib\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- If a review has no `reviewed-genre` or `reviewed-title`, assume that `title` contains the title of the reviewed work; the description provides it. -->\\n <choose>\\n <if variable=\\\"reviewed-genre title\\\">\\n <text macro=\\\"title-bib\\\"/>\\n </if>\\n <else-if variable=\\\"reviewed-genre reviewed-title title\\\">\\n <text macro=\\\"title-bib\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"title-and-descriptions-bib\\\"/>\\n </else>\\n </choose>\\n </if>\\n <else-if variable=\\\"title\\\">\\n <text macro=\\\"title-bib\\\"/>\\n </else-if>\\n <else>\\n <!-- If an item has no `title`, substitute with descriptions. -->\\n <text macro=\\\"title-and-descriptions-bib\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"author-title-substitute-short\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- If a review has no `reviewed-genre` or `reviewed-title`, assume that `title` contains the title of the reviewed work; the description provides it. -->\\n <choose>\\n <if variable=\\\"reviewed-genre title\\\">\\n <text macro=\\\"title-short\\\"/>\\n </if>\\n <else-if variable=\\\"reviewed-genre reviewed-title title\\\">\\n <text macro=\\\"title-short\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"title-and-descriptions-short\\\"/>\\n </else>\\n </choose>\\n </if>\\n <else-if variable=\\\"title\\\">\\n <text macro=\\\"title-short\\\"/>\\n </else-if>\\n <else>\\n <!-- If an item has no `title`, substitute with descriptions and capitalize -->\\n <text macro=\\\"title-and-descriptions-bib\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"author-title-substitute-container\\\">\\n <choose>\\n <!-- no Chicago model for citing an anonymous article with an issue title in `volume-title` -->\\n <if variable=\\\"volume-title\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"article-magazine article-newspaper\\\">\\n <!-- Anonymous magazine and newspaper articles substitute name of publication (CMOS18 14.87, 14.97) -->\\n <text macro=\\\"source-serial-name\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- Publication name also substituted for unsigned reviews (CMOS18 14.102) -->\\n <text macro=\\\"source-serial-name\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <!-- Anonymous entries in reference works (CMOS18 14.130) -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </else-if>\\n <else-if type=\\\"broadcast\\\">\\n <!-- TV broadcasts and podcasts (CMOS18 14.165, 14.168) -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </else-if>\\n <else-if type=\\\"webpage\\\">\\n <!-- list a webpage under the website title if there is no owner or sponsor (CMOS18 14.104) -->\\n <choose>\\n <if variable=\\\"container-title-short\\\">\\n <text text-case=\\\"title\\\" variable=\\\"container-title-short\\\"/>\\n </if>\\n <else>\\n <text text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"author-title-substitute-container-short\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-magazine article-newspaper\\\">\\n <!-- Anonymous magazine/newspaper articles substitute name of publication (CMOS18 14.87, 14.97) -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- Publication name also substituted for unsigned reviews (CMOS18 14.102) -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <!-- Anonymous entries in reference works (CMOS18 14.130) -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </else-if>\\n <else-if type=\\\"broadcast\\\">\\n <!-- TV broadcasts and podcasts (CMOS18 14.165, 14.168) -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </else-if>\\n <else-if type=\\\"webpage\\\">\\n <!-- list a webpage under the website title if there is no owner or sponsor (CMOS18 14.104) -->\\n <text form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <!-- 2. Date (CMOS18 13.102) -->\\n <macro name=\\\"date\\\">\\n <group delimiter=\\\"-\\\">\\n <choose>\\n <if variable=\\\"issued\\\">\\n <group delimiter=\\\" \\\">\\n <!-- reprints and earlier editions may give original year in brackets (CMOS18 14.16) -->\\n <text macro=\\\"date-original-year\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n <group>\\n <text macro=\\\"date-issued-year\\\"/>\\n <text variable=\\\"year-suffix\\\"/>\\n </group>\\n </group>\\n </if>\\n <else-if variable=\\\"event-date\\\">\\n <text macro=\\\"date-event-year\\\"/>\\n </else-if>\\n <else-if variable=\\\"available-date\\\">\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" variable=\\\"available-date\\\"/>\\n </else-if>\\n <else-if variable=\\\"status\\\">\\n <!-- Print the status variable rather than use generic CSL terms (`in press`, etc.) -->\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"status\\\"/>\\n <text variable=\\\"year-suffix\\\"/>\\n </else-if>\\n <else-if type=\\\"collection\\\">\\n <!-- do not give n.d. for archival collections (CMOS18 14.128) -->\\n <text variable=\\\"year-suffix\\\"/>\\n </else-if>\\n <else-if type=\\\"manuscript\\\">\\n <!-- do not give n.d. with a bare shelfmark -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"container-title event-date event-place event-title genre title publisher publisher-place\\\">\\n <text form=\\\"short\\\" term=\\\"no date\\\"/>\\n <text variable=\\\"year-suffix\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else>\\n <text form=\\\"short\\\" term=\\\"no date\\\"/>\\n <text variable=\\\"year-suffix\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"date-short\\\">\\n <group delimiter=\\\"-\\\">\\n <choose>\\n <if variable=\\\"issued\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-uncertain-date=\\\"original-date\\\">\\n <!-- Uncertain date already has square brackets -->\\n <text macro=\\\"date-original-year\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"date-original-year\\\" prefix=\\\"[\\\" suffix=\\\"]\\\"/>\\n </else>\\n </choose>\\n <group>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"interview personal_communication\\\">\\n <text macro=\\\"date-issued-year\\\"/>\\n </if>\\n <!-- accessible `interview` or `personal_communication` items appear in the bibliography; inaccessible items are in-text only -->\\n <else-if match=\\\"any\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\">\\n <text macro=\\\"date-issued-year\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"date-issued-full\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"year-suffix\\\"/>\\n </group>\\n </group>\\n </if>\\n <else-if variable=\\\"event-date\\\">\\n <text macro=\\\"date-event-year\\\"/>\\n </else-if>\\n <else-if variable=\\\"available-date\\\">\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" variable=\\\"available-date\\\"/>\\n </else-if>\\n <else-if variable=\\\"status\\\">\\n <!-- Print the status variable rather than use generic CSL terms (`in press`, etc.) -->\\n <text text-case=\\\"lowercase\\\" variable=\\\"status\\\"/>\\n <text variable=\\\"year-suffix\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview personal_communication\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\">\\n <!-- only give n.d. for accessible personal communication (CMOS18 14.111)-->\\n <text form=\\\"short\\\" term=\\\"no date\\\"/>\\n <text variable=\\\"year-suffix\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"classic collection entry entry-dictionary entry-encyclopedia\\\">\\n <!-- do not give n.d. for archival collections (CMOS18 14.128), `classic` (CMOS18 14.143), or reference entries (CMOS18 14.131) -->\\n <text variable=\\\"year-suffix\\\"/>\\n </else-if>\\n <else-if type=\\\"manuscript\\\">\\n <!-- do not give n.d. with a bare shelfmark -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"container-title event-date event-place event-title genre title publisher publisher-place\\\">\\n <text form=\\\"short\\\" term=\\\"no date\\\"/>\\n <text variable=\\\"year-suffix\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else>\\n <text form=\\\"short\\\" term=\\\"no date\\\"/>\\n <text variable=\\\"year-suffix\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"date-sort-group\\\">\\n <!-- Sort items with and without dates (CMOS18 14.44):\\n\\n 1. items with dates (= 0)\\n 2. `no date` items (= 1)\\n 3. items with `status` (forthcoming, in press, etc.) (= 2) -->\\n <choose>\\n <if variable=\\\"issued\\\">\\n <text value=\\\"0\\\"/>\\n </if>\\n <else-if variable=\\\"status\\\">\\n <text value=\\\"2\\\"/>\\n </else-if>\\n <else>\\n <!-- n.d. -->\\n <text value=\\\"1\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"date-sort-year\\\">\\n <!-- while reference lists are to be sorted chronologically (CMOS18 13.112), it appears that only the year is to be taken into account (CMOS18 13.114) -->\\n <choose>\\n <if type=\\\"personal_communication\\\" variable=\\\"event-date issued\\\">\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" variable=\\\"event-date\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"date-issued-year\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- Date elements -->\\n <macro name=\\\"date-event-full\\\">\\n <choose>\\n <if is-uncertain-date=\\\"issued\\\">\\n <!-- guessed-at date (CMOS18 14.44) -->\\n <date form=\\\"text\\\" prefix=\\\"[\\\" suffix=\\\"?]\\\" variable=\\\"event-date\\\"/>\\n </if>\\n <else>\\n <date form=\\\"text\\\" variable=\\\"event-date\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"date-event-year\\\">\\n <choose>\\n <if is-uncertain-date=\\\"issued\\\">\\n <!-- guessed-at date (CMOS18 14.44) -->\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" prefix=\\\"[\\\" suffix=\\\"?]\\\" variable=\\\"event-date\\\"/>\\n </if>\\n <else>\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" variable=\\\"event-date\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"date-issued-full\\\">\\n <choose>\\n <if is-uncertain-date=\\\"issued\\\">\\n <!-- guessed-at date (CMOS18 14.44) -->\\n <date form=\\\"text\\\" prefix=\\\"[\\\" suffix=\\\"?]\\\" variable=\\\"issued\\\"/>\\n </if>\\n <else>\\n <date form=\\\"text\\\" variable=\\\"issued\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"date-issued-month\\\">\\n <date variable=\\\"issued\\\">\\n <date-part name=\\\"month\\\"/>\\n </date>\\n </macro>\\n <macro name=\\\"date-issued-month-day\\\">\\n <date variable=\\\"issued\\\">\\n <date-part name=\\\"month\\\"/>\\n <date-part name=\\\"day\\\" prefix=\\\" \\\"/>\\n </date>\\n </macro>\\n <macro name=\\\"date-issued-year\\\">\\n <choose>\\n <if is-uncertain-date=\\\"issued\\\">\\n <!-- guessed-at date (CMOS18 14.44) -->\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" prefix=\\\"[\\\" suffix=\\\"?]\\\" variable=\\\"issued\\\"/>\\n </if>\\n <else>\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" variable=\\\"issued\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"date-original-month\\\">\\n <date variable=\\\"original-date\\\">\\n <date-part name=\\\"month\\\"/>\\n </date>\\n </macro>\\n <macro name=\\\"date-original-month-day\\\">\\n <date variable=\\\"original-date\\\">\\n <date-part name=\\\"month\\\"/>\\n <date-part name=\\\"day\\\" prefix=\\\" \\\"/>\\n </date>\\n </macro>\\n <macro name=\\\"date-original-year\\\">\\n <choose>\\n <if is-uncertain-date=\\\"original-date\\\">\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" prefix=\\\"[\\\" suffix=\\\"?]\\\" variable=\\\"original-date\\\"/>\\n </if>\\n <else>\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" variable=\\\"original-date\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- 3. Title and descriptions (CMOS18 13.87-101) -->\\n <macro name=\\\"title-and-descriptions-bib\\\">\\n <group delimiter=\\\". \\\">\\n <choose>\\n <if variable=\\\"title\\\">\\n <text macro=\\\"title-bib\\\"/>\\n <text macro=\\\"description-bib\\\"/>\\n <text macro=\\\"identifier-bib\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"bill report\\\">\\n <!-- Bills, resolutions, and congressional reports substitute bill number if no title -->\\n <!-- Congressional reports are indistinguishable from other reports -->\\n <text macro=\\\"identifier-number-bib\\\"/>\\n <text macro=\\\"identifier-bib\\\"/>\\n <text macro=\\\"description-bib\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"description-bib\\\"/>\\n <text macro=\\\"identifier-bib\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"title-and-descriptions-short\\\">\\n <choose>\\n <if variable=\\\"title\\\">\\n <text macro=\\\"title-short\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"bill report\\\">\\n <!-- Bills, resolutions, and congressional reports substitute bill number if no title -->\\n <text macro=\\\"legal-identifier-bill-report\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"description-short\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-and-source-bib\\\">\\n <group delimiter=\\\". \\\">\\n <choose>\\n <if type=\\\"broadcast\\\" variable=\\\"container-title number title\\\">\\n <!-- Bespoke `broadcast` format (CMOS18 14.165, 14.168) -->\\n <text macro=\\\"source-monographic-title-specific-title-first\\\"/>\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"identifier-number-bib\\\"/>\\n <text macro=\\\"title-bib\\\"/>\\n <text macro=\\\"description-bib\\\"/>\\n <text macro=\\\"source-monographic-identifier-contributors-bib\\\"/>\\n </group>\\n <text macro=\\\"source-monographic-identifier-contributors-bib-container-author\\\"/>\\n <text macro=\\\"source-series-bib\\\"/>\\n <choose>\\n <!-- show event information here only if not collapsed with `issued` (CMOS18 14.167) -->\\n <if match=\\\"any\\\" variable=\\\"event-date original-date original-publisher original-publisher-place publisher status\\\">\\n <text macro=\\\"source-event-bib\\\"/>\\n </if>\\n </choose>\\n </if>\\n <else-if type=\\\"chapter\\\" variable=\\\"container-title genre\\\">\\n <!-- 'introduction to', 'online appendix to' (CMOS18 14.12, 14.14) -->\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"title-and-descriptions-bib\\\"/>\\n <text macro=\\\"source-bib\\\"/>\\n </group>\\n </else-if>\\n <else-if type=\\\"article-journal\\\" variable=\\\"container-title genre volume-title\\\">\\n <!-- introduction to a special issue or supplement -->\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"title-and-descriptions-bib\\\"/>\\n <text macro=\\\"source-bib\\\"/>\\n </group>\\n </else-if>\\n <else>\\n <text macro=\\\"title-and-descriptions-bib\\\"/>\\n <text macro=\\\"source-bib\\\"/>\\n </else>\\n </choose>\\n <group delimiter=\\\", \\\">\\n <choose>\\n <!-- show event information here only if collapsed with `issued` (CMOS18 14.167) -->\\n <if match=\\\"any\\\" variable=\\\"event-date original-date original-publisher original-publisher-place publisher status\\\"/>\\n <!-- omit serial types -->\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"source-event-bib\\\"/>\\n </else-if>\\n <!-- omit serial types -->\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\"/>\\n <else>\\n <!-- monographic types -->\\n <text macro=\\\"source-event-bib\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"source-monographic-publication-bib\\\"/>\\n </group>\\n <text macro=\\\"source-medium-bib\\\"/>\\n <text macro=\\\"source-archive-bib\\\"/>\\n <text macro=\\\"source-date-accessed-DOI-URL-bib\\\"/>\\n </group>\\n </macro>\\n <!-- 3.1. Title -->\\n <macro name=\\\"title-bib\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"post webpage\\\">\\n <!-- part number/title always at the analytic level -->\\n <text macro=\\\"title-and-part-filter-review-bib\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <text macro=\\\"title-and-part-filter-review-bib\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"title-monographic-bib-specific-title-first\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <text macro=\\\"title-and-part-filter-review-bib\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"title-monographic-bib-specific-title-first\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-short\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- If a review has no `reviewed-title`, assume that `title` contains the title of the reviewed work; the description provides it. -->\\n <choose>\\n <if variable=\\\"reviewed-genre title\\\">\\n <!-- Quotes, title case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </if>\\n <else-if variable=\\\"reviewed-genre reviewed-title title\\\">\\n <!-- Quotes, title case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"description-short\\\"/>\\n </else>\\n </choose>\\n </if>\\n <else>\\n <text macro=\\\"title-primary-short\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- Title elements -->\\n <macro name=\\\"title-and-part-filter-review-bib\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- `title` is only the review title if there is a separate `reviewed-genre` or `reviewed-title`; otherwise, it is the title of the reviewed work, printed in the description -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"reviewed-genre reviewed-title\\\">\\n <text macro=\\\"title-and-part-title-bib\\\"/>\\n </if>\\n </choose>\\n </if>\\n <else>\\n <text macro=\\\"title-and-part-title-bib\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-and-part-title-bib\\\">\\n <group delimiter=\\\". \\\">\\n <text macro=\\\"title-primary\\\"/>\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"label-part-number-capitalized\\\"/>\\n <text macro=\\\"title-part\\\"/>\\n </group>\\n </group>\\n </macro>\\n <macro name=\\\"title-monographic-bib-specific-title-first\\\">\\n <!-- Use with author-date or notes and bibliography leading with volume title (CMOS18 14.21). -->\\n <!-- For monographic items, assume `part-number` and `part-title` refer to the book/volume. -->\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <text macro=\\\"title-primary\\\"/>\\n </if>\\n <!-- For monographic items without `container-title`, bibliography entries list `part-title` or `volume-title` first if available -->\\n <else-if variable=\\\"part-title\\\">\\n <text macro=\\\"title-part\\\"/>\\n </else-if>\\n <else-if variable=\\\"volume-title\\\">\\n <text macro=\\\"title-volume\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"title-primary\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-part\\\">\\n <choose>\\n <if type=\\\"patent\\\">\\n <!-- No italics or quotes, sentence case -->\\n <text form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"part-title\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"bill collection legislation regulation treaty\\\">\\n <!-- No italics or quotes, title case -->\\n <text text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else-if type=\\\"legal_case\\\">\\n <!-- Italicized, sentence case -->\\n <text font-style=\\\"italic\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"book classic graphic hearing map\\\">\\n <!-- Italicized, title case (regardless of `container-title`) -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else-if type=\\\"entry-encyclopedia\\\" variable=\\\"author container-title\\\">\\n <!-- Signed encyclopedia entry in quotes, title case (CMOS18 14.132) -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else-if type=\\\"entry-dictionary\\\" variable=\\\"container-title\\\">\\n <!-- Quotes, sentence case -->\\n <text quotes=\\\"true\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else-if type=\\\"entry-encyclopedia\\\" variable=\\\"container-title\\\">\\n <!-- Quotes, sentence case -->\\n <text quotes=\\\"true\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else-if type=\\\"post\\\">\\n <!-- Quotes, sentence case -->\\n <text quotes=\\\"true\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else-if type=\\\"webpage\\\">\\n <!-- Quotes, title case -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <!-- Other types are formatted based on presence of `container-title` -->\\n <else-if variable=\\\"container-title\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <!-- Quotes, title case -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <!-- Italics, title case -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <!-- Quotes, title case -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else>\\n <!-- monographic types -->\\n <!-- Italics, title case -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"article dataset document interview manuscript paper-conference personal_communication speech thesis webpage\\\">\\n <!-- Container-like but not necessarily with `container-title` -->\\n <!-- Quotes, title case -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else>\\n <!-- Italicized, title case (default) -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-primary\\\">\\n <choose>\\n <if type=\\\"patent\\\">\\n <!-- No italics or quotes, sentence case -->\\n <text form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"title\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"bill collection legislation regulation treaty\\\">\\n <!-- No italics or quotes, title case -->\\n <text text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"legal_case\\\">\\n <!-- Italicized, sentence case -->\\n <text font-style=\\\"italic\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"book classic graphic hearing map\\\">\\n <!-- Italicized, title case (regardless of `container-title`) -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"entry-encyclopedia\\\" variable=\\\"author container-title\\\">\\n <!-- Signed encyclopedia entry in quotes, title case (CMOS18 14.132) -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"entry-dictionary\\\" variable=\\\"container-title\\\">\\n <!-- Quotes, sentence case -->\\n <text quotes=\\\"true\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"entry-encyclopedia\\\" variable=\\\"container-title\\\">\\n <!-- Quotes, sentence case -->\\n <text quotes=\\\"true\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"post\\\">\\n <!-- Quotes, sentence case -->\\n <text quotes=\\\"true\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <!-- Other types are formatted based on presence of `container-title` -->\\n <else-if variable=\\\"container-title\\\">\\n <!-- Quotes, title case -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"article dataset document interview manuscript paper-conference personal_communication speech thesis webpage\\\">\\n <!-- Container-like but not necessarily with `container-title` -->\\n <!-- Quotes, title case -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else>\\n <!-- Italicized, title case (default) -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-primary-short\\\">\\n <choose>\\n <if type=\\\"patent\\\">\\n <!-- No italics or quotes, sentence case -->\\n <text form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"title\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"bill collection legislation regulation treaty\\\">\\n <!-- No italics or quotes, title case -->\\n <text form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"legal_case\\\">\\n <!-- Italicized, sentence case -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"book classic graphic hearing map\\\">\\n <!-- Italicized, title case (regardless of `container-title`) -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"entry-encyclopedia\\\" variable=\\\"author container-title\\\">\\n <!-- Signed encyclopedia entry in quotes, title case (CMOS18 14.132) -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"entry-dictionary\\\" variable=\\\"container-title\\\">\\n <!-- Quotes, sentence case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"entry-encyclopedia\\\" variable=\\\"container-title\\\">\\n <!-- Quotes, sentence case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"post\\\">\\n <!-- Quotes, sentence case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <!-- Other types are formatted based on presence of `container-title` -->\\n <else-if variable=\\\"container-title\\\">\\n <!-- Quotes, title case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"article dataset document interview manuscript paper-conference personal_communication speech thesis webpage\\\">\\n <!-- Container-like but not necessarily with `container-title` -->\\n <!-- Quotes, title case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else>\\n <!-- Italicized, title case (default) -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-volume\\\">\\n <choose>\\n <if type=\\\"manuscript\\\">\\n <!-- Quotes, title case -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"volume-title\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <!-- Quotes, title case -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"volume-title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <!-- Italics, title case -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"volume-title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <!-- Quotes, title case -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"volume-title\\\"/>\\n </else-if>\\n <else>\\n <!-- monographic types -->\\n <!-- Italics, title case -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"volume-title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- 3.2. Description -->\\n <macro name=\\\"description-bib\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"interview\\\" variable=\\\"interviewer\\\">\\n <text macro=\\\"description-interview-bib\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <text macro=\\\"description-review-bib\\\"/>\\n </else-if>\\n <else-if type=\\\"personal_communication\\\">\\n <text macro=\\\"description-letter-bib\\\"/>\\n </else-if>\\n <else-if type=\\\"song\\\" variable=\\\"composer\\\">\\n <text macro=\\\"description-song-bib\\\"/>\\n </else-if>\\n <!-- thesis type appears with university name (CMOS18 14.113) -->\\n <else-if type=\\\"thesis\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <text macro=\\\"description-serial-bib\\\"/>\\n </else-if>\\n <else-if type=\\\"paper-conference\\\">\\n <text macro=\\\"description-paper-conference-bib\\\"/>\\n </else-if>\\n <else-if match=\\\"none\\\" variable=\\\"container-title\\\">\\n <text macro=\\\"description-format-bib\\\"/>\\n </else-if>\\n <!-- For conference presentations/performances/events, chapters in reports/standards/generic documents, software, place description within the source element -->\\n <else-if match=\\\"any\\\" type=\\\"document report software standard\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"event paper-conference performance speech\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director issue page supplement-number volume\\\">\\n <text macro=\\\"description-format-bib\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else>\\n <text macro=\\\"description-format-bib\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-short\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"interview\\\" variable=\\\"interviewer\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\">\\n <text macro=\\\"description-interview-short\\\"/>\\n </if>\\n <else>\\n <!-- for an inaccessible `interview`, give a full in-text description at the first citation -->\\n <choose>\\n <if position=\\\"first\\\">\\n <text macro=\\\"description-interview-note\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"description-interview-short\\\"/>\\n </else>\\n </choose>\\n </else>\\n </choose>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <text macro=\\\"description-review-short\\\"/>\\n </else-if>\\n <else-if type=\\\"personal_communication\\\">\\n <text macro=\\\"description-letter-short\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <text macro=\\\"description-serial-short\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"description-format-short\\\"/>\\n </else-if>\\n <else-if type=\\\"paper-conference\\\">\\n <!-- serial `paper-conference` -->\\n <text macro=\\\"description-serial-short\\\"/>\\n </else-if>\\n <else>\\n <!-- monographic types -->\\n <text macro=\\\"description-format-short\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- Description elements -->\\n <macro name=\\\"description-format-bib\\\">\\n <choose>\\n <if variable=\\\"genre number\\\"/>\\n <else-if variable=\\\"genre\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n </else-if>\\n <!-- generic labels if unpublished -->\\n <else-if match=\\\"any\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\"/>\\n <else-if type=\\\"manuscript\\\">\\n <!-- 'unpublished manuscript' if no `genre` (CMOS18 14.114) -->\\n <text term=\\\"manuscript\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if type=\\\"personal_communication\\\">\\n <!-- 'personal communication' if no `genre` (CMOS18 14.111) -->\\n <text term=\\\"personal-communication\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"description-format-note\\\">\\n <choose>\\n <if variable=\\\"genre number\\\"/>\\n <else-if variable=\\\"genre\\\">\\n <text variable=\\\"genre\\\"/>\\n </else-if>\\n <!-- generic labels if unpublished -->\\n <else-if match=\\\"any\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\"/>\\n <else-if type=\\\"manuscript\\\">\\n <!-- 'unpublished manuscript' if no `genre` (CMOS18 14.114) -->\\n <text term=\\\"manuscript\\\"/>\\n </else-if>\\n <else-if type=\\\"personal_communication\\\">\\n <!-- 'personal communication' if no `genre` (CMOS18 14.111) -->\\n <text term=\\\"personal-communication\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"description-format-short\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"chapter\\\" variable=\\\"container-title genre\\\">\\n <!-- untitled introductions: cf. review model, which includes a title (CMOS18 14.101) -->\\n <text form=\\\"short\\\" variable=\\\"genre\\\"/>\\n <choose>\\n <if match=\\\"none\\\" position=\\\"ibid ibid-with-locator\\\">\\n <!-- CMOS team suggests leaving out title in repeated references -->\\n <text macro=\\\"source-monographic-preposition-note\\\"/>\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </if>\\n </choose>\\n </if>\\n <else-if type=\\\"article-journal\\\" variable=\\\"container-title genre volume-title\\\">\\n <!-- untitled introduction to a special issue or supplement -->\\n <text form=\\\"short\\\" variable=\\\"genre\\\"/>\\n <choose>\\n <if match=\\\"none\\\" position=\\\"ibid ibid-with-locator\\\">\\n <text macro=\\\"source-monographic-preposition-note\\\"/>\\n <text form=\\\"short\\\" quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"volume-title\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else-if variable=\\\"genre\\\">\\n <text form=\\\"short\\\" variable=\\\"genre\\\"/>\\n </else-if>\\n <else-if variable=\\\"medium\\\">\\n <text form=\\\"short\\\" variable=\\\"medium\\\"/>\\n </else-if>\\n <else-if variable=\\\"chapter-number container-title\\\">\\n <text macro=\\\"source-monographic-preposition-note\\\"/>\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </else-if>\\n <else-if variable=\\\"chapter-number\\\">\\n <text macro=\\\"label-chapter-number\\\"/>\\n </else-if>\\n <!-- generic labels if unpublished -->\\n <else-if match=\\\"any\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\"/>\\n <else-if type=\\\"manuscript\\\">\\n <!-- 'unpublished manuscript' if no `genre` (CMOS18 14.114) -->\\n <text term=\\\"manuscript\\\"/>\\n </else-if>\\n <else-if type=\\\"personal_communication\\\">\\n <!-- 'pers. comm.' if no `genre` (CMOS18 14.111) -->\\n <text form=\\\"short\\\" term=\\\"personal-communication\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"description-interview-bib\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"genre number\\\">\\n <!-- `genre` printed with `number` -->\\n <names variable=\\\"interviewer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n <else-if variable=\\\"genre\\\">\\n <group delimiter=\\\" \\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n <group delimiter=\\\" \\\">\\n <text form=\\\"verb\\\" term=\\\"container-author\\\"/>\\n <names variable=\\\"interviewer\\\">\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </group>\\n </group>\\n </else-if>\\n <else-if variable=\\\"interviewer\\\">\\n <names variable=\\\"interviewer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </else-if>\\n <else>\\n <text macro=\\\"description-format-bib\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"source-event-place-first\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"description-interview-note\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"genre number\\\">\\n <!-- `genre` printed with `number` -->\\n <names variable=\\\"interviewer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n <else-if variable=\\\"genre\\\">\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"genre\\\"/>\\n <group delimiter=\\\" \\\">\\n <text form=\\\"verb\\\" term=\\\"container-author\\\"/>\\n <names variable=\\\"interviewer\\\">\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </group>\\n </group>\\n </else-if>\\n <else-if variable=\\\"interviewer\\\">\\n <names variable=\\\"interviewer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </else-if>\\n <else>\\n <text macro=\\\"description-format-note\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"source-event-place-first\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"description-interview-short\\\">\\n <choose>\\n <if disambiguate=\\\"true\\\">\\n <names variable=\\\"interviewer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" form=\\\"short\\\" initialize=\\\"true\\\"/>\\n <substitute>\\n <text macro=\\\"description-format-short\\\"/>\\n </substitute>\\n </names>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"genre medium\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\\\">\\n <text macro=\\\"description-format-short\\\"/>\\n </if>\\n <else>\\n <!-- capitalize if no author or title -->\\n <text macro=\\\"description-format-bib\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else>\\n <!-- generic description for an unpublished interview (CMOS18 14.108) -->\\n <text term=\\\"interview\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-letter-bib\\\">\\n <choose>\\n <if variable=\\\"recipient\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"genre number\\\">\\n <!-- `genre` appears with `number` -->\\n <names variable=\\\"recipient\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n <else-if variable=\\\"genre\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"description-format-bib\\\"/>\\n <names variable=\\\"recipient\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </group>\\n </else-if>\\n <else>\\n <names variable=\\\"recipient\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </else>\\n </choose>\\n <text variable=\\\"event-place\\\"/>\\n <text macro=\\\"date-event-full\\\"/>\\n </group>\\n </if>\\n <else>\\n <text macro=\\\"description-format-bib\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-letter-short\\\">\\n <!-- shortened notes ideally give author, recipient, place, and date (CMOS18 14.13) -->\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"genre recipient\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"description-format-short\\\"/>\\n <names variable=\\\"recipient\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" form=\\\"short\\\" initialize=\\\"true\\\"/>\\n </names>\\n </group>\\n </if>\\n <else>\\n <text macro=\\\"description-format-short\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"event-place\\\"/>\\n <choose>\\n <if variable=\\\"event-date\\\">\\n <text macro=\\\"date-event-full\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"date-issued-full\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"description-paper-conference-bib\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"description-format-bib\\\"/>\\n </if>\\n <else>\\n <!-- serial types -->\\n <group delimiter=\\\". \\\">\\n <text macro=\\\"description-serial-bib\\\"/>\\n <text macro=\\\"source-event-bib\\\"/>\\n </group>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-review-bib\\\">\\n <!-- Reviewed item -->\\n <group delimiter=\\\". \\\">\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"description-review-genre-bib\\\"/>\\n <text macro=\\\"description-review-title\\\"/>\\n </group>\\n <choose>\\n <if variable=\\\"reviewed-genre reviewed-title title\\\">\\n <names variable=\\\"reviewed-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n <else-if variable=\\\"reviewed-genre\\\"/>\\n <else>\\n <names variable=\\\"reviewed-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </else>\\n </choose>\\n <text macro=\\\"source-event-place-first\\\"/>\\n </group>\\n <text macro=\\\"label-section-capitalized\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"description-review-genre-bib\\\">\\n <choose>\\n <if variable=\\\"reviewed-genre\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"description-review-term-unsigned-bib\\\"/>\\n <text variable=\\\"reviewed-genre\\\"/>\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"reviewed-title\\\">\\n <names variable=\\\"reviewed-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n </group>\\n </if>\\n <else-if variable=\\\"number\\\">\\n <text macro=\\\"description-review-term-unsigned-bib\\\"/>\\n </else-if>\\n <!-- If no `reviewed-genre`, assume that `genre` is entered as 'Review of the book' or similar -->\\n <else-if variable=\\\"genre\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"description-review-term-unsigned-bib\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-review-short\\\">\\n <choose>\\n <if match=\\\"any\\\" position=\\\"ibid ibid-with-locator\\\">\\n <text term=\\\"review\\\"/>\\n </if>\\n <else>\\n <group delimiter=\\\" \\\">\\n <text term=\\\"review-of\\\"/>\\n <text macro=\\\"description-review-title-short\\\"/>\\n </group>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-review-term-unsigned-bib\\\">\\n <!-- Anonymous reviews appear as 'unsigned' (CMOS18 14.102) -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\\\">\\n <text term=\\\"review-of\\\" text-case=\\\"capitalize-first\\\"/>\\n </if>\\n <else>\\n <group delimiter=\\\" \\\">\\n <text term=\\\"anonymous\\\" text-case=\\\"capitalize-first\\\"/>\\n <text term=\\\"review-of\\\"/>\\n </group>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-review-title\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"reviewed-genre reviewed-title\\\">\\n <!-- Not possible to distinguish TV series episode from other reviewed works without a reviewed source title -->\\n <!-- Adapt for `reviewed-container-title` or similar if it becomes available -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"reviewed-title\\\"/>\\n </if>\\n <else>\\n <!-- Assume title is title of reviewed work -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-review-title-short\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"reviewed-genre reviewed-title\\\">\\n <!-- Not possible to distinguish TV series episode from other reviewed works without a reviewed source title -->\\n <!-- Adapt for `reviewed-container-title` or similar if it becomes available -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"reviewed-title\\\"/>\\n </if>\\n <else>\\n <!-- Assume title is title of reviewed work -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-serial-bib\\\">\\n <group delimiter=\\\". \\\">\\n <text macro=\\\"description-format-bib\\\"/>\\n <!-- `section` provides magazine departments (CMOS18 14.88) and newspaper column names (CMOS18 14.93) -->\\n <text macro=\\\"label-section-capitalized\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"description-serial-short\\\">\\n <choose>\\n <if variable=\\\"title\\\"/>\\n <else-if variable=\\\"genre\\\">\\n <text macro=\\\"description-format-short\\\"/>\\n </else-if>\\n <else>\\n <text form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"section\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-song-bib\\\">\\n <!-- Performer of classical music works -->\\n <!-- TODO: remove when Zotero fixes mapping of performer to `author` -->\\n <group delimiter=\\\" \\\">\\n <!-- Based on `description-format` macro -->\\n <choose>\\n <if variable=\\\"genre\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n <text form=\\\"verb\\\" term=\\\"performer\\\"/>\\n </if>\\n <!-- providing 'performed by' label for recorded readings (CMOS18 14.164), but it should be omitted for classical music (CMOS18 14.163) -->\\n <else>\\n <text form=\\\"verb\\\" term=\\\"performer\\\" text-case=\\\"capitalize-first\\\"/>\\n </else>\\n </choose>\\n <names variable=\\\"author\\\">\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n <substitute>\\n <names variable=\\\"performer\\\"/>\\n </substitute>\\n </names>\\n </group>\\n </macro>\\n <!-- 3.3. Identifier (edition, contributors, volume) -->\\n <macro name=\\\"identifier-bib\\\">\\n <group delimiter=\\\". \\\">\\n <choose>\\n <if type=\\\"patent\\\">\\n <text macro=\\\"identifier-patent\\\"/>\\n </if>\\n <else-if type=\\\"report\\\">\\n <text macro=\\\"identifier-report-bib\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"post webpage\\\">\\n <!-- print `container-title` on `post` or `webpage` in the same way as `publisher` (CMOS18 14.104-106) -->\\n <text macro=\\\"identifier-number-bib\\\"/>\\n <text macro=\\\"label-version-capitalized\\\"/>\\n <text macro=\\\"identifier-edition-bib\\\"/>\\n <text macro=\\\"identifier-contributors-bib\\\"/>\\n </else-if>\\n <else-if variable=\\\"container-title\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"broadcast graphic map motion_picture\\\">\\n <!-- For audiovisual media, number information comes after `title`, not `container-title`; `song` places album catalogue `number` with `publisher` (CMOS18 14.163-164) -->\\n <text macro=\\\"identifier-number-bib\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"identifier-contributors-bib\\\"/>\\n </else-if>\\n <else>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"song\\\">\\n <text macro=\\\"identifier-number-bib\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"label-version-capitalized\\\"/>\\n <text macro=\\\"identifier-edition-bib\\\"/>\\n <text macro=\\\"identifier-contributors-and-volume-bib\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- Identifier elements -->\\n <macro name=\\\"identifier-contributors-bib\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <text macro=\\\"identifier-contributors-serial-bib\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <text macro=\\\"identifier-contributors-monographic-bib\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <text macro=\\\"identifier-contributors-serial-bib\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"identifier-contributors-monographic-bib\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"identifier-contributors-monographic-bib\\\">\\n <group delimiter=\\\". \\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"post webpage\\\">\\n <names variable=\\\"container-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"editor-translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"editor translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"editorial-director\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"guest\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"host\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"illustrator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"narrator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"compiler chair organizer curator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"series-creator executive-producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"director\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"broadcast performance\\\">\\n <names variable=\\\"script-writer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n <names variable=\\\"performer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"thesis\\\">\\n <names variable=\\\"contributor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n </if>\\n <else>\\n <!-- print `container-title` on `post` or `webpage` in the same way as `publisher` (CMOS18 14.104-106) -->\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"container-title\\\">\\n <names variable=\\\"container-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"editor-translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"editor translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"editorial-director\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"guest\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"host\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n <names variable=\\\"illustrator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"narrator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"container-title\\\">\\n <names delimiter=\\\". \\\" variable=\\\"compiler chair organizer curator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"series-creator executive-producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"director\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"broadcast performance\\\">\\n <names variable=\\\"script-writer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n <names variable=\\\"performer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"song thesis\\\">\\n <names variable=\\\"contributor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n </if>\\n </choose>\\n <choose>\\n <if type=\\\"song\\\">\\n <!-- Song contributors attached to album (CMOS18 14.163) -->\\n <names variable=\\\"contributor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-contributors-serial-bib\\\">\\n <group delimiter=\\\". \\\">\\n <names delimiter=\\\". \\\" variable=\\\"translator narrator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"compiler chair organizer curator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"series-creator executive-producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"director\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"script-writer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"performer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-contributors-and-volume-bib\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <text macro=\\\"identifier-contributors-serial-bib\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"identifier-contributors-and-volume-monographic-bib-specific-title-first\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <text macro=\\\"identifier-contributors-serial-bib\\\"/>\\n </else-if>\\n <else>\\n <!-- monographic types -->\\n <text macro=\\\"identifier-contributors-and-volume-monographic-bib-specific-title-first\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"identifier-contributors-and-volume-monographic-bib-specific-title-first\\\">\\n <group delimiter=\\\". \\\">\\n <text macro=\\\"identifier-contributors-monographic-bib\\\"/>\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"identifier-volume-bib-specific-title-first\\\"/>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"number-of-volumes part-number part-title volume volume-title\\\">\\n <!-- cite multivolume `collection-editor`; otherwise it belongs with `collection-title` -->\\n <names variable=\\\"collection-editor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n </group>\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"part-number part-title volume volume-title\\\">\\n <text macro=\\\"label-number-of-volumes\\\"/>\\n </if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-edition-bib\\\">\\n <choose>\\n <!-- ensure `source-publication-history-bib` does not duplicate edition -->\\n <if variable=\\\"original-title\\\">\\n <text macro=\\\"label-edition-capitalized\\\"/>\\n </if>\\n <else-if variable=\\\"issued original-date\\\"/>\\n <else>\\n <text macro=\\\"label-edition-capitalized\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"identifier-edition-note\\\">\\n <choose>\\n <!-- ensure `source-publication-history-note` does not duplicate edition -->\\n <if variable=\\\"original-title\\\">\\n <text macro=\\\"label-edition\\\"/>\\n </if>\\n <else-if variable=\\\"issued original-date\\\"/>\\n <else>\\n <text macro=\\\"label-edition\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"identifier-number-bib\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"thesis\\\"/>\\n <else-if is-numeric=\\\"number\\\" type=\\\"broadcast\\\" variable=\\\"genre\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n <text variable=\\\"number\\\"/>\\n </else-if>\\n <else-if is-numeric=\\\"number\\\" type=\\\"broadcast\\\">\\n <text text-case=\\\"capitalize-first\\\" value=\\\"episode\\\"/>\\n <text variable=\\\"number\\\"/>\\n </else-if>\\n <else-if variable=\\\"number\\\">\\n <text text-case=\\\"title\\\" variable=\\\"genre\\\"/>\\n <text macro=\\\"label-number-capitalized\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-patent\\\">\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <!-- `authority`: US ; `genre`: patent ; `number`: 123,445 -->\\n <text form=\\\"short\\\" variable=\\\"authority\\\"/>\\n <!-- 'US Patent' capitalized in both bibliography and note forms -->\\n <choose>\\n <if variable=\\\"genre\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n </if>\\n <else>\\n <text term=\\\"patent\\\" text-case=\\\"capitalize-first\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"number\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <text value=\\\"filed\\\"/>\\n <date form=\\\"text\\\" variable=\\\"submitted\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if variable=\\\"issued submitted\\\">\\n <text term=\\\"and\\\"/>\\n </if>\\n </choose>\\n <text value=\\\"issued\\\"/>\\n <!-- Always give full issue date, even in author-date (CMOS18 14.158) -->\\n <text macro=\\\"date-issued-full\\\"/>\\n </group>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-report-bib\\\">\\n <group delimiter=\\\". \\\">\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <!-- If the report is a chapter in a larger report, then most identifying information is printed in the source. -->\\n <text macro=\\\"identifier-contributors-bib\\\"/>\\n </if>\\n <else-if variable=\\\"title\\\">\\n <text macro=\\\"identifier-number-bib\\\"/>\\n <text macro=\\\"label-version-capitalized\\\"/>\\n <text macro=\\\"identifier-edition-bib\\\"/>\\n <text macro=\\\"identifier-contributors-and-volume-bib\\\"/>\\n </else-if>\\n <else>\\n <!-- If there is no `title`, then `genre` and `number` are already printed as the title. -->\\n <text macro=\\\"label-version-capitalized\\\"/>\\n <text macro=\\\"identifier-edition-bib\\\"/>\\n <text macro=\\\"identifier-contributors-and-volume-bib\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-volume-bib-specific-title-first\\\">\\n <!-- In author-date, bibliography must be listed under the individual volume title rather than the general title of the multivolume set; this is also allowable in notes styles (CMOS18 14.21) -->\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"part-number part-title volume volume-title\\\">\\n <!-- part and title with individual titles -->\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"label-part-number-capitalized\\\"/>\\n <text value=\\\"of\\\"/>\\n <text macro=\\\"title-volume\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"label-volume\\\"/>\\n <text value=\\\"of\\\"/>\\n <text macro=\\\"title-primary\\\"/>\\n </group>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"part-title volume-title\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if variable=\\\"part-number volume\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"label-volume-capitalized\\\"/>\\n <text macro=\\\"label-part-number\\\"/>\\n <text value=\\\"of\\\"/>\\n </group>\\n </if>\\n <else-if variable=\\\"part-number\\\">\\n <text macro=\\\"label-part-number-capitalized\\\"/>\\n <text value=\\\"of\\\"/>\\n </else-if>\\n <else-if variable=\\\"volume\\\">\\n <text macro=\\\"label-volume-capitalized\\\"/>\\n <text value=\\\"of\\\"/>\\n </else-if>\\n </choose>\\n <text macro=\\\"title-primary\\\"/>\\n </group>\\n </else-if>\\n <else-if variable=\\\"part-number volume\\\">\\n <text macro=\\\"label-volume-capitalized\\\"/>\\n <text macro=\\\"label-part-number\\\"/>\\n </else-if>\\n <else-if variable=\\\"part-number\\\">\\n <text macro=\\\"label-part-number-capitalized\\\"/>\\n </else-if>\\n <else-if variable=\\\"volume\\\">\\n <text macro=\\\"label-volume-capitalized\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <!-- 4. Source -->\\n <macro name=\\\"source-bib\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"patent post webpage\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <text macro=\\\"source-serial-bib\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <text macro=\\\"source-monographic-bib\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <text macro=\\\"source-serial-bib\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"source-monographic-bib\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- 4.1. Serial sources -->\\n <macro name=\\\"source-serial-bib\\\">\\n <group delimiter=\\\". \\\">\\n <text macro=\\\"source-serial-title-volume-bib\\\"/>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-magazine article-newspaper\\\">\\n <!-- magazines and newspapers provide the full date in place of volume/issue numbers (CMOS18 14.87, 14.89) -->\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-serial-title-bib\\\"/>\\n <text macro=\\\"source-serial-identifier-bib\\\"/>\\n </group>\\n </if>\\n <else-if variable=\\\"collection-title volume\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-serial-title-bib\\\"/>\\n <text macro=\\\"source-serial-identifier-bib\\\"/>\\n </group>\\n </else-if>\\n <else-if variable=\\\"volume\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"source-serial-title-bib\\\"/>\\n <text macro=\\\"source-serial-identifier-bib\\\"/>\\n </group>\\n </else-if>\\n <else>\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-serial-title-bib\\\"/>\\n <text macro=\\\"source-serial-identifier-bib\\\"/>\\n </group>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- Serial source title -->\\n <macro name=\\\"source-serial-name\\\">\\n <group delimiter=\\\" \\\">\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n <choose>\\n <!-- TODO: remove conditional when Zotero stops double-mapping `event-place` and `publisher-place` -->\\n <if match=\\\"none\\\" variable=\\\"event-date event-title\\\">\\n <text prefix=\\\"(\\\" suffix=\\\")\\\" variable=\\\"publisher-place\\\"/>\\n </if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-serial-title-bib\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <!-- Journal special issues (CMOS18 14.77) and supplements (CMOS18 14.78) -->\\n <if match=\\\"none\\\" variable=\\\"container-title\\\"/>\\n <else-if match=\\\"none\\\" type=\\\"periodical\\\" variable=\\\"supplement-number volume-title\\\"/>\\n <!-- TODO: use `container-genre` here once available to allow a custom description of the journal volume -->\\n <else-if variable=\\\"supplement-number volume-title\\\">\\n <text term=\\\"supplement\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if type=\\\"periodical\\\" variable=\\\"supplement-number title\\\">\\n <text term=\\\"supplement\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if variable=\\\"volume-title\\\">\\n <text term=\\\"special-issue\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if type=\\\"periodical\\\" variable=\\\"title\\\">\\n <text term=\\\"special-issue\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n </choose>\\n <text macro=\\\"source-serial-name\\\"/>\\n <choose>\\n <!-- 'ahead of print' is placed akin to a series (CMOS18 14.75) -->\\n <if match=\\\"any\\\" variable=\\\"collection-title issue number page supplement-number volume volume-title\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"available-date status\\\"/>\\n <else-if type=\\\"article-journal\\\" variable=\\\"DOI issued\\\">\\n <text term=\\\"advance-online-publication\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-serial-title-volume-bib\\\">\\n <choose>\\n <if variable=\\\"volume-title\\\">\\n <!-- Journal special issues (CMOS18 14.77) and supplements (CMOS18 14.78) -->\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"source-monographic-preposition-bib\\\"/>\\n <text macro=\\\"title-volume\\\"/>\\n </group>\\n <text macro=\\\"source-monographic-identifier-contributors-bib\\\"/>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <!-- Serial source identifier -->\\n <macro name=\\\"source-serial-identifier-bib\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-magazine article-newspaper\\\">\\n <group delimiter=\\\". \\\">\\n <text macro=\\\"source-serial-identifier-volume-author-date\\\"/>\\n <!-- newspaper edition always capitalized (CMOS18 14.89) -->\\n <text macro=\\\"label-edition-capitalized\\\"/>\\n </group>\\n <text macro=\\\"source-serial-locator\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"issue supplement-number volume\\\">\\n <group delimiter=\\\": \\\">\\n <text macro=\\\"source-serial-identifier-volume-author-date\\\"/>\\n <text macro=\\\"source-serial-locator\\\"/>\\n </group>\\n </else-if>\\n <else>\\n <text macro=\\\"source-serial-identifier-volume-author-date\\\"/>\\n <text macro=\\\"source-serial-locator\\\"/>\\n </else>\\n <!-- TODO: If CSL adds `date-part` detection, add two further conditions to address CMOS18 14.74: delimiting with \\\":\\\" if there is a `volume` and no month or `issue` or `supplement number`; delimiting with \\\", \\\" or there is an `issue` or `supplement number` and no month -->\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-serial-identifier-volume-author-date\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-magazine article-newspaper\\\">\\n <!-- magazines and newspapers provide the full date in place of volume/issue numbers (CMOS18 14.87, 14.89) -->\\n <text variable=\\\"collection-title\\\"/>\\n <text macro=\\\"source-serial-volume-status-bib\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"issue supplement-number volume\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- date appears first if the review `container-title` has been substituted for a missing author (CMOS18 14.87, 14.102) -->\\n <choose>\\n <!-- extra date details only appear with a lone volume or issue -->\\n <if variable=\\\"issue volume\\\"/>\\n <else-if variable=\\\"supplement-number\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"issue volume\\\">\\n <text macro=\\\"source-date-specific-title-first\\\"/>\\n </else-if>\\n </choose>\\n </else-if>\\n </choose>\\n <!-- `collection-title` is for any serial with multiple series (e.g. '4th ser.') -->\\n <text variable=\\\"collection-title\\\"/>\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if variable=\\\"volume\\\">\\n <choose>\\n <if variable=\\\"collection-title\\\">\\n <text macro=\\\"label-volume\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- provide label if a review `container-title` has been substituted for a missing author (CMOS18 14.87, 14.102) -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\\\">\\n <text variable=\\\"volume\\\"/>\\n </if>\\n <!-- TODO: when CSL provides date part detection, volume should be lowercase if there is a month, but otherwise capitalized -->\\n <else>\\n <text macro=\\\"label-volume-capitalized\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else>\\n <text variable=\\\"volume\\\"/>\\n </else>\\n </choose>\\n <group delimiter=\\\", \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"issue supplement-number\\\">\\n <text variable=\\\"issue\\\"/>\\n <text macro=\\\"label-supplement-number\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- date for unsigned reviews only appears here if it did not earlier (CMOS18 14.102) -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\\\">\\n <text macro=\\\"source-date-specific-title-first\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else>\\n <text macro=\\\"source-date-specific-title-first\\\"/>\\n </else>\\n </choose>\\n </group>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"issue supplement-number\\\">\\n <group delimiter=\\\" \\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"label-issue\\\"/>\\n <text macro=\\\"label-supplement-number\\\"/>\\n </group>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\\\">\\n <text macro=\\\"source-date-specific-title-first\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n </if>\\n </choose>\\n </group>\\n </else-if>\\n </choose>\\n </group>\\n </else-if>\\n <else>\\n <text variable=\\\"collection-title\\\"/>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"interview post-weblog\\\">\\n <!-- publisher possible with broadcast `interview` (CMOS18 14.110) or `post-weblog` (CMOS18 14.105) -->\\n <text variable=\\\"publisher\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"source-serial-volume-status-bib\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-serial-volume-status-bib\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"collection-title issue number page supplement-number volume volume-title\\\"/>\\n <else-if variable=\\\"issued\\\"/>\\n <else-if variable=\\\"available-date\\\">\\n <group delimiter=\\\" \\\">\\n <!-- article accepted for publication and available on publisher website (CMOS18 14.75) -->\\n <!-- TODO: use CSL term for `available-date` when available -->\\n <text value=\\\"accepted\\\"/>\\n <date form=\\\"text\\\" variable=\\\"available-date\\\"/>\\n </group>\\n </else-if>\\n </choose>\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"source-date-status-bib\\\"/>\\n <text macro=\\\"source-date-specific-title-first\\\"/>\\n </group>\\n </group>\\n </macro>\\n <!-- Serial source locator -->\\n <macro name=\\\"source-serial-locator\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"locator number\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"label-locator\\\"/>\\n <!-- an article ID appears alongside locators in notes (CMOS18 14.71) -->\\n <choose>\\n <!-- if there is an `archive` with no other reference, `number` appears in `source-archive-database-number` -->\\n <if match=\\\"any\\\" variable=\\\"archive_collection archive_location archive-place\\\">\\n <text variable=\\\"number\\\"/>\\n </if>\\n <else-if variable=\\\"archive\\\"/>\\n <else>\\n <text variable=\\\"number\\\"/>\\n </else>\\n </choose>\\n </group>\\n </if>\\n <!-- do not give pages for magazines or newspapers (CMOS18 14.87, 14.89) -->\\n <else-if match=\\\"any\\\" type=\\\"article-magazine article-newspaper\\\"/>\\n <else>\\n <text variable=\\\"page\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- 4.2. Monographic sources -->\\n <macro name=\\\"source-monographic-bib\\\">\\n <group delimiter=\\\". \\\">\\n <!-- Monographic sources repeat main reference elements -->\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"source-monographic-preposition-bib\\\"/>\\n <text macro=\\\"source-monographic-title-specific-title-first\\\"/>\\n </group>\\n <text macro=\\\"source-monographic-description\\\"/>\\n <text macro=\\\"source-monographic-identifier-bib\\\"/>\\n <text macro=\\\"source-monographic-locator\\\"/>\\n </group>\\n </if>\\n </choose>\\n <text macro=\\\"source-monographic-identifier-contributors-bib-container-author\\\"/>\\n <text macro=\\\"source-series-bib\\\"/>\\n <choose>\\n <!-- show event information here only if not collapsed with `issued` (CMOS18 14.167) -->\\n <if match=\\\"any\\\" variable=\\\"event-date original-date original-publisher original-publisher-place publisher status\\\">\\n <text macro=\\\"source-event-bib\\\"/>\\n </if>\\n </choose>\\n </group>\\n </macro>\\n <!-- Monographic source title -->\\n <macro name=\\\"source-monographic-preposition-bib\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"broadcast motion_picture\\\"/>\\n <else-if type=\\\"chapter\\\" variable=\\\"container-title genre\\\">\\n <text value=\\\"to\\\"/>\\n </else-if>\\n <else-if type=\\\"article-journal\\\" variable=\\\"container-title genre volume-title\\\">\\n <text value=\\\"to\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"author composer\\\">\\n <!-- Give preposition only for signed entries; otherwise, title is substituted -->\\n <text term=\\\"in\\\" text-case=\\\"capitalize-first\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <!-- if printing chapter page numbers (CMOS17/classic):\\n <else-if variable=\\\"chapter-number page title\\\"><text term=\\\"in\\\" text-case=\\\"capitalize-first\\\"/></else-if>\\n -->\\n <else-if variable=\\\"chapter-number\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"label-chapter-number-capitalized\\\"/>\\n <choose>\\n <if type=\\\"song\\\">\\n <text term=\\\"on\\\"/>\\n </if>\\n <else>\\n <text term=\\\"in\\\"/>\\n </else>\\n </choose>\\n </group>\\n </else-if>\\n <else>\\n <text term=\\\"in\\\" text-case=\\\"capitalize-first\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-monographic-preposition-note\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"broadcast motion_picture\\\"/>\\n <else-if type=\\\"chapter\\\" variable=\\\"container-title genre\\\">\\n <text value=\\\"to\\\"/>\\n </else-if>\\n <else-if type=\\\"article-journal\\\" variable=\\\"container-title genre volume-title\\\">\\n <text value=\\\"to\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"author composer\\\">\\n <!-- Give preposition only for signed entries; otherwise, title is substituted -->\\n <text term=\\\"in\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <!-- if printing chapter page numbers (CMOS17/classic):\\n <else-if variable=\\\"chapter-number page title\\\"><text term=\\\"in\\\"/></else-if>\\n -->\\n <else-if variable=\\\"chapter-number\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"label-chapter-number\\\"/>\\n <choose>\\n <if type=\\\"song\\\">\\n <text term=\\\"on\\\"/>\\n </if>\\n <else>\\n <text term=\\\"in\\\"/>\\n </else>\\n </choose>\\n </group>\\n </else-if>\\n <else>\\n <text term=\\\"in\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-monographic-title-specific-title-first\\\">\\n <choose>\\n <if variable=\\\"part-title\\\">\\n <text macro=\\\"title-part\\\"/>\\n </if>\\n <else-if variable=\\\"volume-title\\\">\\n <text macro=\\\"title-volume\\\"/>\\n </else-if>\\n <else>\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- Monographic source description -->\\n <macro name=\\\"source-monographic-description\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"document report software standard\\\">\\n <!-- place description after `container-title` -->\\n <text macro=\\\"description-format-note\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director issue page supplement-number volume\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"event paper-conference performance speech\\\">\\n <!-- unpublished conference presentations should describe the session -->\\n <text macro=\\\"description-format-note\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <!-- Monographic source identifier -->\\n <macro name=\\\"source-monographic-identifier-bib\\\">\\n <!-- Based on `identifier-bib` -->\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"none\\\" type=\\\"broadcast graphic map motion_picture song\\\">\\n <!-- For audiovisual media, number information comes after `title`, not `container-title`; `song` places album catalogue `number` with `publisher` (CMOS18 14.163-164) -->\\n <text macro=\\\"identifier-number-bib\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"label-version\\\"/>\\n <!-- use note form as `edition` is not capitalized here -->\\n <text macro=\\\"identifier-edition-note\\\"/>\\n <text macro=\\\"source-monographic-identifier-contributors-and-volume-bib-specific-title-first\\\"/>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-monographic-identifier-contributors-bib\\\">\\n <choose>\\n <if variable=\\\"container-author container-title\\\">\\n <!-- set off `container-author` from other contributors in the bibliography (CMOS18 14.12; for page location, CMOS17 14.110) -->\\n <names variable=\\\"container-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <!-- other contributors shift to `source-monographic-identifier-contributors-bib-container-author` -->\\n </if>\\n <else>\\n <group delimiter=\\\", \\\">\\n <names variable=\\\"editor-translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"editor translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"guest\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"host\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"chair organizer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"illustrator narrator compiler curator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"series-creator executive-producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"editorial-director\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"broadcast performance\\\">\\n <names variable=\\\"script-writer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n <names variable=\\\"director\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"performer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"song thesis\\\">\\n <!-- Song contributors attached to album (CMOS18 14.163) -->\\n <names variable=\\\"contributor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n </group>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-monographic-identifier-contributors-bib-container-author\\\">\\n <!-- set off `container-author` from other contributors in the bibliography (CMOS18 14.12; for page location, CMOS17 14.110) -->\\n <choose>\\n <if variable=\\\"container-author container-title\\\">\\n <group delimiter=\\\". \\\">\\n <names variable=\\\"editor-translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"editor translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"guest\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"host\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"chair organizer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"illustrator narrator compiler curator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"series-creator executive-producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"editorial-director\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"broadcast performance\\\">\\n <names variable=\\\"script-writer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n <names variable=\\\"director\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"performer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"song thesis\\\">\\n <!-- Song contributors attached to album (CMOS18 14.163) -->\\n <names variable=\\\"contributor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-monographic-identifier-contributors-and-volume-bib-specific-title-first\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-monographic-identifier-contributors-bib\\\"/>\\n <text macro=\\\"source-monographic-identifier-volume-bib-specific-title-first\\\"/>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"number-of-volumes part-number part-title volume volume-title\\\">\\n <!-- cite multivolume `collection-editor`; otherwise it belongs with `collection-title` -->\\n <names variable=\\\"collection-editor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"part-number part-title volume volume-title\\\"/>\\n <else-if variable=\\\"page\\\"/>\\n <else>\\n <text macro=\\\"label-number-of-volumes\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-monographic-identifier-volume-bib-specific-title-first\\\">\\n <!-- based on `identifier-volume-bib-specific-title-first` without capitalization; giving `container-title` rather than `title-primary`; and ensuring volume number -->\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"part-number part-title volume volume-title\\\">\\n <!-- part and title with individual titles -->\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"label-part-number\\\"/>\\n <text value=\\\"of\\\"/>\\n <text macro=\\\"title-volume\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"label-volume\\\"/>\\n <text value=\\\"of\\\"/>\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </group>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"part-title volume-title\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if variable=\\\"part-number volume\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"label-volume\\\"/>\\n <text macro=\\\"label-part-number\\\"/>\\n <text value=\\\"of\\\"/>\\n </group>\\n </if>\\n <else-if variable=\\\"part-number\\\">\\n <text macro=\\\"label-part-number\\\"/>\\n <text value=\\\"of\\\"/>\\n </else-if>\\n <else-if variable=\\\"volume\\\">\\n <text macro=\\\"label-volume\\\"/>\\n <text value=\\\"of\\\"/>\\n </else-if>\\n </choose>\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </group>\\n </else-if>\\n <else-if variable=\\\"part-number\\\">\\n <text macro=\\\"label-volume\\\"/>\\n <text macro=\\\"label-part-number\\\"/>\\n </else-if>\\n <else-if is-numeric=\\\"volume\\\" match=\\\"none\\\">\\n <text macro=\\\"label-volume\\\"/>\\n </else-if>\\n <else-if variable=\\\"container-title\\\">\\n <!-- remove condition in styles that print chapter page numbers (CMOS17/classic) -->\\n <text macro=\\\"label-volume\\\"/>\\n </else-if>\\n <else-if is-numeric=\\\"volume\\\" variable=\\\"page\\\">\\n <choose>\\n <!-- check for variables that might come between the volume and page number -->\\n <if variable=\\\"collection-editor\\\">\\n <text macro=\\\"label-volume\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else>\\n <text macro=\\\"label-volume\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- Monographic source locator -->\\n <macro name=\\\"source-monographic-locator\\\">\\n <choose>\\n <!-- archival locators appear after the shelfmark (CMOS18 14.127) -->\\n <if locator=\\\"column\\\" variable=\\\"archive archive_location\\\"/>\\n <else-if locator=\\\"folio\\\" variable=\\\"archive archive_location\\\"/>\\n <else-if locator=\\\"page\\\" variable=\\\"archive archive_location\\\"/>\\n <else-if is-numeric=\\\"volume\\\" locator=\\\"page\\\">\\n <!-- separate a volume and page number with a colon (CMOS18 14.18) -->\\n <group delimiter=\\\":\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"part-number part-title volume-title\\\"/>\\n <else-if variable=\\\"collection-editor\\\"/>\\n <else>\\n <text variable=\\\"volume\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"locator\\\"/>\\n </group>\\n </else-if>\\n <else-if variable=\\\"locator\\\">\\n <text macro=\\\"label-locator\\\"/>\\n </else-if>\\n <!-- remove `container-title` condition in styles that print chapter page numbers (CMOS17/classic) -->\\n <else-if variable=\\\"container-title\\\"/>\\n <else-if is-numeric=\\\"volume\\\" variable=\\\"page\\\">\\n <!-- collapse the volume and page number if adjacent (CMOS18 14.18) -->\\n <group delimiter=\\\":\\\">\\n <choose>\\n <!-- check for variables that might come between the volume and page number -->\\n <if match=\\\"any\\\" variable=\\\"part-number part-title volume-title\\\"/>\\n <else-if variable=\\\"collection-editor\\\"/>\\n <else>\\n <text variable=\\\"volume\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"page\\\"/>\\n </group>\\n </else-if>\\n <!-- archival locators appear after the shelfmark (CMOS18 14.127) -->\\n <else-if variable=\\\"archive archive_location page\\\"/>\\n <else>\\n <text variable=\\\"page\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- 4.3. Series -->\\n <macro name=\\\"source-series-bib\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"number-of-volumes part-number part-title volume volume-title\\\">\\n <text macro=\\\"source-series-title\\\"/>\\n </if>\\n <else-if variable=\\\"collection-editor collection-title\\\">\\n <!-- `collection-editor` belongs with `collection-title` if the item is not multivolume -->\\n <text text-case=\\\"title\\\" variable=\\\"collection-title\\\"/>\\n <names variable=\\\"collection-editor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <text macro=\\\"label-collection-number\\\"/>\\n <text macro=\\\"label-issue\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"source-series-title\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-series-title\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"issue\\\">\\n <text text-case=\\\"title\\\" variable=\\\"collection-title\\\"/>\\n <text macro=\\\"label-collection-number\\\"/>\\n <text macro=\\\"label-issue\\\"/>\\n </if>\\n <else-if is-numeric=\\\"collection-number\\\" variable=\\\"collection-title\\\">\\n <group delimiter=\\\" \\\">\\n <text text-case=\\\"title\\\" variable=\\\"collection-title\\\"/>\\n <text variable=\\\"collection-number\\\"/>\\n </group>\\n </else-if>\\n <else-if variable=\\\"collection-title\\\">\\n <text text-case=\\\"title\\\" variable=\\\"collection-title\\\"/>\\n <text variable=\\\"collection-number\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <!-- 4.4. Event -->\\n <macro name=\\\"source-event-bib\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <!-- omit types that provide event information in description -->\\n <if match=\\\"any\\\" type=\\\"interview\\\" variable=\\\"interviewer\\\"/>\\n <else-if type=\\\"personal_communication\\\" variable=\\\"recipient\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"event event-date event-title\\\">\\n <!-- TODO: To prevent Zotero from printing `event-place`, due to its double-mapping of `publisher-place` and `event-place`. Remove this when that is changed. -->\\n <choose>\\n <if type=\\\"paper-conference\\\">\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"collection-editor compiler editor editorial-director issue page supplement-number volume\\\">\\n <!-- Don't print event info for conference papers published in proceedings -->\\n <text macro=\\\"source-event-status-bib\\\"/>\\n <text macro=\\\"source-event-description-bib\\\"/>\\n </if>\\n </choose>\\n </if>\\n <else>\\n <!-- For other item types, print event info even if published (e.g. collection catalogs, performance programs). -->\\n <text macro=\\\"source-event-status-bib\\\"/>\\n <text macro=\\\"source-event-description-bib\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-event-place-first\\\">\\n <!-- for descriptive elements for interviews, reviews, letters -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"event event-date event-title\\\">\\n <group delimiter=\\\", \\\">\\n <text variable=\\\"event-title\\\"/>\\n <text variable=\\\"event-place\\\"/>\\n <text macro=\\\"date-event-full\\\"/>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-event-status-bib\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"broadcast\\\" variable=\\\"status\\\">\\n <!-- 'aired', 'performed', etc. (CMOS18 14.165) -->\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"status\\\"/>\\n </if>\\n <else-if type=\\\"paper-conference\\\">\\n <choose>\\n <if variable=\\\"genre\\\">\\n <text text-case=\\\"capitalize-first\\\" value=\\\"presented\\\"/>\\n </if>\\n <else>\\n <text form=\\\"short\\\" term=\\\"paper-conference\\\" text-case=\\\"capitalize-first\\\"/>\\n <text value=\\\"presented\\\"/>\\n </else>\\n </choose>\\n <choose>\\n <if variable=\\\"event-title\\\">\\n <text term=\\\"at\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else-if type=\\\"song\\\">\\n <text text-case=\\\"capitalize-first\\\" value=\\\"recorded\\\"/>\\n <choose>\\n <if variable=\\\"event-title\\\">\\n <text term=\\\"at\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else-if variable=\\\"event-date issued\\\"/>\\n <else-if variable=\\\"issued\\\"/>\\n <else>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"status\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-event-title\\\">\\n <choose>\\n <!-- TODO: We expect `event-title` to be used, but processors and applications may not be updated yet. This macro ensures that either `event` or `event-title` can be accepted. Remove if processor logic and application adoption can handle this. -->\\n <if variable=\\\"event-title\\\">\\n <text variable=\\\"event-title\\\"/>\\n </if>\\n <else>\\n <text variable=\\\"event\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-event-title-capitalized\\\">\\n <choose>\\n <!-- TODO: We expect `event-title` to be used, but processors and applications may not be updated yet. This macro ensures that either `event` or `event-title` can be accepted. Remove if processor logic and application adoption can handle this. -->\\n <if variable=\\\"event-title\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"event-title\\\"/>\\n </if>\\n <else>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"event\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-event-description-bib\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if type=\\\"song\\\">\\n <text macro=\\\"source-event-title\\\"/>\\n </if>\\n <else-if type=\\\"paper-conference\\\" variable=\\\"genre\\\">\\n <text macro=\\\"source-event-title-capitalized\\\"/>\\n </else-if>\\n <else-if type=\\\"paper-conference\\\">\\n <text macro=\\\"source-event-title\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"source-event-title-capitalized\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"date-event-full\\\"/>\\n <text variable=\\\"event-place\\\"/>\\n </group>\\n </macro>\\n <!-- 4.5. Facts of publication -->\\n <macro name=\\\"source-monographic-publication-bib\\\">\\n <group delimiter=\\\". \\\">\\n <choose>\\n <!-- `patent` date in identification (CMOS18 14.158) -->\\n <if type=\\\"patent\\\"/>\\n <!-- omit serial types -->\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"source-publication-and-date-bib\\\"/>\\n </else-if>\\n <!-- omit serial types -->\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\"/>\\n <else>\\n <!-- monographic types -->\\n <text macro=\\\"source-publication-and-date-bib\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"source-publication-original-title-bib\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"source-publication-and-date-bib\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"post webpage\\\">\\n <!-- print `container-title` on `post` or `webpage` in the same way as `publisher` (CMOS18 14.104-106) -->\\n <!-- avoid possible repetition of `container-title` with author-date: -->\\n <choose>\\n <if variable=\\\"publisher\\\">\\n <text text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </if>\\n <else-if type=\\\"webpage\\\" variable=\\\"container-title container-title-short\\\"/>\\n <else>\\n <text text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </else>\\n </choose>\\n </if>\\n </choose>\\n <choose>\\n <if type=\\\"broadcast\\\" variable=\\\"DOI\\\">\\n <!-- a podcast publisher appears before the date, whereas the network of an aired show appears after (CMOS18 14.165); unfortunately CSL stores both in `publisher` -->\\n <!-- TODO: `DOI` or `URL` detection is the only way to distinguish radio/TV from podcasts, but it is obviously imprecise; modify if CSL provides a `podcast` type -->\\n <text macro=\\\"source-publication-history-bib\\\"/>\\n </if>\\n <else-if type=\\\"broadcast\\\" variable=\\\"URL\\\">\\n <text macro=\\\"source-publication-history-bib\\\"/>\\n </else-if>\\n <else-if type=\\\"broadcast\\\"/>\\n <else>\\n <text macro=\\\"source-publication-history-bib\\\"/>\\n </else>\\n </choose>\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"source-date-status-bib\\\"/>\\n <text macro=\\\"source-date-specific-title-first\\\"/>\\n </group>\\n <choose>\\n <if type=\\\"broadcast\\\" variable=\\\"URL\\\"/>\\n <else-if type=\\\"broadcast\\\">\\n <group delimiter=\\\" \\\">\\n <text term=\\\"on\\\"/>\\n <text macro=\\\"source-publication-history-bib\\\"/>\\n </group>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <!-- Facts of publication elements -->\\n <macro name=\\\"source-publication-description-bib\\\">\\n <choose>\\n <if type=\\\"article\\\" variable=\\\"genre\\\"/>\\n <else-if type=\\\"article\\\">\\n <!-- `preprint` term attached to repository name, but specific working paper descriptors appear in description (CMOS18 14.76, 14.116) -->\\n <text term=\\\"preprint\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if type=\\\"thesis\\\">\\n <!-- thesis type appears with university name (CMOS18 14.113) -->\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"original-publisher original-publisher-place\\\">\\n <choose>\\n <!-- `edition` provides an alternative label to `reprint` (CMOS18 14.16) -->\\n <if match=\\\"any\\\" variable=\\\"edition original-title\\\"/>\\n <else-if match=\\\"none\\\" type=\\\"book chapter classic entry entry-dictionary entry-encyclopedia interview musical_score pamphlet paper-conference report thesis\\\"/>\\n <else-if variable=\\\"issued original-date\\\">\\n <text text-case=\\\"capitalize-first\\\" value=\\\"reprint\\\"/>\\n </else-if>\\n </choose>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-publication-history-bib\\\">\\n <choose>\\n <if variable=\\\"original-title\\\">\\n <!-- `original-title` is covered in `source-publication-original-title-bib` -->\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-publication-description-bib\\\"/>\\n <text macro=\\\"source-publication-publisher-bib\\\"/>\\n </group>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"edition original-publisher original-publisher-place\\\">\\n <group delimiter=\\\". \\\">\\n <!-- full stop to separate original date if `original-publisher` (CMOS18 14.16) -->\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-publication-publisher-original-bib\\\"/>\\n <text macro=\\\"source-date-original\\\"/>\\n </group>\\n <group delimiter=\\\". \\\">\\n <choose>\\n <if variable=\\\"issued original-date\\\">\\n <text macro=\\\"label-edition-capitalized\\\"/>\\n </if>\\n </choose>\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-publication-description-bib\\\"/>\\n <text macro=\\\"source-publication-publisher-bib\\\"/>\\n </group>\\n </group>\\n </group>\\n </else-if>\\n <else>\\n <group delimiter=\\\"; \\\">\\n <!-- semicolon to separate original date if no publisher (CMOS18 14.165) -->\\n <text macro=\\\"source-date-original\\\"/>\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-publication-description-bib\\\"/>\\n <text macro=\\\"source-publication-publisher-bib\\\"/>\\n </group>\\n </group>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-publication-original-title-bib\\\">\\n <!-- Work originally published under a different title (CMOS18 13.101) -->\\n <choose>\\n <if variable=\\\"original-title\\\">\\n <group delimiter=\\\" \\\">\\n <text term=\\\"original-work-published\\\" text-case=\\\"capitalize-first\\\"/>\\n <group delimiter=\\\", \\\">\\n <names variable=\\\"original-author\\\">\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"original-title\\\"/>\\n </group>\\n <group delimiter=\\\", \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <text macro=\\\"source-publication-publisher-original-bib\\\"/>\\n <text macro=\\\"source-date-original\\\"/>\\n </group>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-publication-publisher-bib\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"thesis\\\" variable=\\\"publisher\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"publisher\\\"/>\\n </if>\\n <else-if variable=\\\"publisher\\\">\\n <group delimiter=\\\": \\\">\\n <!-- <text text-case=\\\"capitalize-first\\\" variable=\\\"publisher-place\\\"/> -->\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"publisher\\\"/>\\n </group>\\n </else-if>\\n <!-- TODO: remove conditional when Zotero fixes double-mapping of `event-place` -->\\n <else-if match=\\\"any\\\" variable=\\\"event-date event-title\\\"/>\\n <else>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"publisher-place\\\"/>\\n </else>\\n </choose>\\n <choose>\\n <if type=\\\"song\\\">\\n <!-- Album catalogue number follows label name (CMOS18 14.163-164) -->\\n <text variable=\\\"number\\\"/>\\n </if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-publication-publisher-original-bib\\\">\\n <choose>\\n <if variable=\\\"original-publisher\\\">\\n <group delimiter=\\\": \\\">\\n <!-- <text text-case=\\\"capitalize-first\\\" variable=\\\"original-publisher-place\\\"/> -->\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"original-publisher\\\"/>\\n </group>\\n </if>\\n <else>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"original-publisher-place\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- 4.6. Date -->\\n <macro name=\\\"source-date-specific-title-first\\\">\\n <!-- date for the last-mentioned title, for author-date or notes and bibliography leading with volume title (CMOS18 14.21) -->\\n <choose>\\n <if variable=\\\"available-date volume-title\\\">\\n <!-- TODO: Is there a better CSL variable for a date of a multivolume work (CMOS18 14.21)? -->\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" variable=\\\"available-date\\\"/>\\n </if>\\n <else-if variable=\\\"available-date part-title\\\">\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" variable=\\\"available-date\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <text macro=\\\"source-date-issued-month-day\\\"/>\\n <!-- for CMOS17 author-date: -->\\n <!-- <text macro=\\\"source-date-issued-full-serial\\\"/> -->\\n <!-- for notes and bibliography leading with volume title (CMOS18 14.21): -->\\n <!-- <text macro=\\\"source-date-issued-or-status\\\"/> -->\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"source-date-issued-month-day\\\"/>\\n <!-- for notes and bibliography leading with volume title (CMOS18 14.21): -->\\n <!-- <text macro=\\\"source-date-issued-or-status\\\"/> -->\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <text macro=\\\"source-date-issued-month-day\\\"/>\\n <!-- for CMOS17 author-date: -->\\n <!-- <text macro=\\\"source-date-issued-full-serial\\\"/> -->\\n <!-- for notes and bibliography leading with volume title (CMOS18 14.21): -->\\n <!-- <text macro=\\\"source-date-issued-or-status\\\"/> -->\\n </else-if>\\n <else>\\n <!-- monographic types -->\\n <text macro=\\\"source-date-issued-month-day\\\"/>\\n <!-- for notes and bibliography leading with volume title (CMOS18 14.21): -->\\n <!-- <text macro=\\\"source-date-issued-or-status\\\"/> -->\\n </else>\\n </choose>\\n </macro>\\n <!-- Date elements -->\\n <macro name=\\\"source-date-issued-month-day\\\">\\n <!-- Use with author-date -->\\n <!-- Give full date for more ephemeral types -->\\n <!-- NB: any changes must also be applied to `source-date-original-month-day` -->\\n <choose>\\n <if type=\\\"personal_communication\\\" variable=\\\"event-date issued\\\">\\n <!-- Provide issue date for letters listed under event-date -->\\n <text macro=\\\"date-issued-year\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"DOI URL\\\">\\n <!-- Online reference works use full dates (CMOS18 14.131) -->\\n <text macro=\\\"date-issued-month-day\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"article broadcast collection dataset document event graphic manuscript map patent performance personal_communication post software song speech standard webpage\\\">\\n <text macro=\\\"date-issued-month-day\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <text macro=\\\"source-date-issued-month-day-serial\\\"/>\\n </else-if>\\n <!-- omit monographic types -->\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <text macro=\\\"source-date-issued-month-day-serial\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-date-issued-month-day-serial\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-magazine article-newspaper\\\">\\n <!-- magazines and newspapers provide the full date in place of volume/issue numbers (CMOS18 14.87, 14.89) -->\\n <text macro=\\\"date-issued-month-day\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"issue supplement-number volume\\\">\\n <text macro=\\\"date-issued-month\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"date-issued-month-day\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-date-original\\\">\\n <text macro=\\\"source-date-original-month-day\\\"/>\\n </macro>\\n <macro name=\\\"source-date-original-month-day\\\">\\n <!-- Give full date for more ephemeral types -->\\n <!-- Macro derived from `source-date-issued-month-day` -->\\n <choose>\\n <if type=\\\"personal_communication\\\" variable=\\\"event-date original-date\\\">\\n <!-- Provide original date for letters listed under event-date -->\\n <text macro=\\\"date-original-year\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"DOI URL\\\">\\n <!-- Online reference works use full dates (CMOS18 14.131) -->\\n <text macro=\\\"date-original-month-day\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"article broadcast collection dataset document event graphic manuscript map patent performance personal_communication post software song speech standard webpage\\\">\\n <text macro=\\\"date-original-month-day\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"issue supplement-number volume\\\">\\n <text macro=\\\"date-original-month\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"date-original-month-day\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"issue supplement-number volume\\\">\\n <text macro=\\\"date-original-month\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"date-original-month-day\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-date-status-bib\\\">\\n <choose>\\n <if type=\\\"broadcast\\\" variable=\\\"event-title issued status\\\"/>\\n <!-- on a `broadcast`, if there is an `event-title`, `status` appears with `event-date` as part of `source-event` (CMOS18 14.165) -->\\n <else-if variable=\\\"issued status\\\">\\n <!-- `status` specifies date type, e.g. 'effective', 'last modified', 'approved' (CMOS18 14.104 for `webpage`; CMOS18 14.159 for `standard`) -->\\n <choose>\\n <if type=\\\"webpage\\\" variable=\\\"container-title\\\">\\n <text variable=\\\"status\\\"/>\\n </if>\\n <else-if type=\\\"webpage\\\" variable=\\\"author publisher\\\">\\n <text variable=\\\"status\\\"/>\\n </else-if>\\n <else-if type=\\\"webpage\\\" variable=\\\"translator publisher\\\">\\n <text variable=\\\"status\\\"/>\\n </else-if>\\n <else-if type=\\\"webpage\\\">\\n <!-- capitalize `status` if there is nothing else after the `title` (either no website title or substituted publisher) -->\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"status\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"original-date original-publisher original-publisher-place original-title publisher\\\">\\n <text variable=\\\"status\\\"/>\\n </else-if>\\n <else>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"status\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else-if type=\\\"broadcast\\\" variable=\\\"issued URL\\\"/>\\n <else-if type=\\\"broadcast\\\" variable=\\\"issued\\\">\\n <!-- `status` of a radio or TV broadcast is 'aired' if unspecified (CMOS18 14.165) -->\\n <text text-case=\\\"capitalize-first\\\" value=\\\"aired\\\"/>\\n </else-if>\\n <else-if type=\\\"software\\\" variable=\\\"issued publisher\\\">\\n <!-- `status` of software is 'released' if unspecified (CMOS18 14.169) -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"author chair collection-editor compiler composer contributor curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\\\">\\n <!-- lowercase if `publisher` is adjacent -->\\n <text value=\\\"released\\\"/>\\n </if>\\n <else>\\n <text text-case=\\\"capitalize-first\\\" value=\\\"released\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else-if type=\\\"software\\\" variable=\\\"original-date\\\">\\n <!-- lowercase if `original-date` is adjacent -->\\n <text value=\\\"released\\\"/>\\n </else-if>\\n <else-if type=\\\"software\\\" variable=\\\"issued\\\">\\n <!-- capitalize if `publisher` is not present -->\\n <text text-case=\\\"capitalize-first\\\" value=\\\"released\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <!-- 4.7. Locator (including page references) -->\\n <macro name=\\\"source-locator-author-date\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"author locator\\\">\\n <text macro=\\\"label-locator\\\"/>\\n </if>\\n <else-if variable=\\\"container-title title\\\">\\n <!-- unsigned reference entry title appears in the locator (CMOS18 13.130) -->\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"DOI URL\\\">\\n <!-- Only print reference entries use `sub-verbo` (CMOS18 14.131) -->\\n <text form=\\\"short\\\" term=\\\"sub-verbo\\\"/>\\n </if>\\n </choose>\\n <text form=\\\"short\\\" quotes=\\\"true\\\" variable=\\\"title\\\"/>\\n </group>\\n </else-if>\\n </choose>\\n </if>\\n <else>\\n <text macro=\\\"label-locator\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- 4.8. Medium -->\\n <macro name=\\\"source-medium-bib\\\">\\n <group delimiter=\\\", \\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"medium\\\"/>\\n <text variable=\\\"scale\\\"/>\\n <text variable=\\\"dimensions\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"source-medium-note\\\">\\n <group delimiter=\\\", \\\">\\n <text variable=\\\"medium\\\"/>\\n <text variable=\\\"scale\\\"/>\\n <text variable=\\\"dimensions\\\"/>\\n </group>\\n </macro>\\n <!-- 4.9. Archival location -->\\n <macro name=\\\"source-archive-bib\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"graphic\\\">\\n <text macro=\\\"source-archive-reference-institution-first\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"source-archive-reference-location-first-bib\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"source-archive-database-number\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"source-archive-note\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"graphic\\\">\\n <text macro=\\\"source-archive-reference-institution-first\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"source-archive-reference-location-first-note\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"source-archive-database-number\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n </group>\\n </macro>\\n <!-- Archival elements -->\\n <macro name=\\\"source-archive-database-number\\\">\\n <!-- database identifier, if not included elsewhere (CMOS18 14.113) -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"archive_collection archive_location archive-place\\\"/>\\n <!-- `number` never shown elsewhere with a thesis -->\\n <else-if type=\\\"thesis\\\">\\n <text variable=\\\"number\\\"/>\\n </else-if>\\n <!-- `number` shown with `genre` -->\\n <else-if match=\\\"any\\\" type=\\\"dataset entry song\\\" variable=\\\"genre\\\"/>\\n <else-if variable=\\\"archive\\\">\\n <text variable=\\\"number\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-archive-locator\\\">\\n <choose>\\n <!-- physical locators with archival references appear after the shelfmark (CMOS18 14.127) -->\\n <if locator=\\\"column\\\" variable=\\\"archive archive_location\\\">\\n <!-- archival locators must always be labelled to avoid confusion with `archive_location` (CMOS18 14.123) -->\\n <text macro=\\\"label-locator-all\\\"/>\\n </if>\\n <else-if locator=\\\"folio\\\" variable=\\\"archive archive_location\\\">\\n <text macro=\\\"label-locator-all\\\"/>\\n </else-if>\\n <else-if locator=\\\"page\\\" variable=\\\"archive archive_location\\\">\\n <text macro=\\\"label-locator-all\\\"/>\\n </else-if>\\n <else-if variable=\\\"archive archive_location page\\\">\\n <choose>\\n <if is-numeric=\\\"page\\\">\\n <!-- TODO: remove this conditional when `page` parsing is fixed for different locator types -->\\n <text macro=\\\"label-page\\\"/>\\n </if>\\n <else>\\n <text variable=\\\"page\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-archive-reference-institution-first\\\">\\n <!-- Archive (gallery) name first for art (CMOS18 14.133) -->\\n <group delimiter=\\\", \\\">\\n <text variable=\\\"archive\\\"/>\\n <text variable=\\\"archive-place\\\"/>\\n <text variable=\\\"archive_collection\\\"/>\\n <text variable=\\\"archive_location\\\"/>\\n <text macro=\\\"source-archive-locator\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"source-archive-reference-location-first-bib\\\">\\n <!-- Order of elements begins with the most specific (CMOS18 14.128) -->\\n <group delimiter=\\\". \\\">\\n <group delimiter=\\\", \\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"archive_location\\\"/>\\n <text macro=\\\"source-archive-locator\\\"/>\\n </group>\\n <text variable=\\\"archive_collection\\\"/>\\n <group delimiter=\\\", \\\">\\n <text variable=\\\"archive\\\"/>\\n <text variable=\\\"archive-place\\\"/>\\n </group>\\n </group>\\n </macro>\\n <macro name=\\\"source-archive-reference-location-first-note\\\">\\n <!-- Order of elements begins with the most specific (CMOS18 14.127) -->\\n <group delimiter=\\\", \\\">\\n <text variable=\\\"archive_location\\\"/>\\n <text macro=\\\"source-archive-locator\\\"/>\\n <text variable=\\\"archive_collection\\\"/>\\n <text variable=\\\"archive\\\"/>\\n <text variable=\\\"archive-place\\\"/>\\n </group>\\n </macro>\\n <!-- 4.10. URL or persistent identifier -->\\n <macro name=\\\"source-date-accessed-DOI-URL-bib\\\">\\n <group delimiter=\\\". \\\">\\n <choose>\\n <if variable=\\\"DOI\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"available-date event-date issued status\\\"/>\\n <else-if variable=\\\"accessed URL\\\">\\n <group delimiter=\\\" \\\">\\n <text term=\\\"accessed\\\" text-case=\\\"capitalize-first\\\"/>\\n <date form=\\\"text\\\" variable=\\\"accessed\\\"/>\\n </group>\\n </else-if>\\n </choose>\\n <text macro=\\\"source-DOI-URL\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"source-DOI-URL\\\">\\n <choose>\\n <if variable=\\\"DOI\\\">\\n <text prefix=\\\"https://doi.org/\\\" variable=\\\"DOI\\\"/>\\n </if>\\n <else-if variable=\\\"URL\\\">\\n <text variable=\\\"URL\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <!-- 5. Notes -->\\n <!-- TODO: add variables for distributor and exhibitions if available in CSL -->\\n <!-- 6. Legal references: Bluebook style (shared with APA) -->\\n <!-- Where APA or Chicago diverge from Bluebook, the official manual is followed -->\\n <macro name=\\\"legal-reference\\\">\\n <!-- Type usage:\\n\\n `bill`\\n : bills, resolutions, federal reports\\n\\n `legal_case`\\n : all legal and court cases\\n\\n `hearing`\\n : hearings and testimony\\n\\n `legislation`\\n : statutes, constitutional items, and charters\\n\\n `regulation`\\n : codified regulations, uncodified regulations, executive orders\\n\\n `treaty`\\n : treaties\\n -->\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if type=\\\"treaty\\\">\\n <text macro=\\\"legal-title\\\"/>\\n <names variable=\\\"author\\\">\\n <!-- Treaty parties should be included at least for bilateral treaties (Bluebook 21.4.2) -->\\n <name delimiter=\\\"-\\\" et-al-min=\\\"100\\\" et-al-use-first=\\\"99\\\" form=\\\"short\\\" initialize=\\\"false\\\"/>\\n </names>\\n <text macro=\\\"legal-date\\\"/>\\n <!-- treaty source/report in addition to URL (Bluebook 21.4.5) -->\\n <text macro=\\\"legal-source\\\"/>\\n </if>\\n <else>\\n <group delimiter=\\\" \\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"legal-title\\\"/>\\n <text macro=\\\"legal-source\\\"/>\\n </group>\\n <text macro=\\\"legal-date\\\"/>\\n <text macro=\\\"legal-identifier\\\"/>\\n </group>\\n </else>\\n </choose>\\n <group delimiter=\\\" \\\">\\n <!-- locator for use in notes -->\\n <choose>\\n <if locator=\\\"page\\\" variable=\\\"page\\\">\\n <text term=\\\"at\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"label-locator\\\"/>\\n </group>\\n </group>\\n </macro>\\n <!-- 6.1. Legal date -->\\n <macro name=\\\"legal-date\\\">\\n <choose>\\n <if type=\\\"treaty\\\">\\n <text macro=\\\"date-issued-full\\\"/>\\n </if>\\n <else-if type=\\\"legal_case\\\">\\n <text macro=\\\"legal-date-case\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"bill hearing legislation regulation\\\">\\n <group delimiter=\\\" \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"date-original-year\\\"/>\\n <text form=\\\"symbol\\\" term=\\\"and\\\"/>\\n </group>\\n <choose>\\n <if variable=\\\"issued\\\">\\n <text macro=\\\"date-issued-year\\\"/>\\n </if>\\n <else>\\n <!-- Show proposal date for uncodified regulations. Assume date is entered literally ala \\\"proposed May 23, 2016\\\". -->\\n <!-- TODO: Add `proposed` date here if that becomes available -->\\n <date form=\\\"text\\\" variable=\\\"submitted\\\"/>\\n </else>\\n </choose>\\n </group>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"legal-date-case\\\">\\n <group delimiter=\\\" \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <text variable=\\\"authority\\\"/>\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <!-- Print only year for cases published in reporters-->\\n <text macro=\\\"date-issued-year\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"date-issued-full\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- 6.2.1. Legal title -->\\n <macro name=\\\"legal-title\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"bill legal_case legislation regulation treaty\\\">\\n <text text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </if>\\n <else-if type=\\\"hearing\\\">\\n <!-- use standard format (Bluebook 13.3) -->\\n <group delimiter=\\\": \\\" font-style=\\\"italic\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"title\\\"/>\\n <group delimiter=\\\" \\\">\\n <text term=\\\"hearing\\\" text-case=\\\"capitalize-first\\\"/>\\n <group delimiter=\\\" \\\">\\n <text term=\\\"on\\\"/>\\n <text variable=\\\"number\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <text value=\\\"before the\\\"/>\\n <text variable=\\\"section\\\"/>\\n </group>\\n </group>\\n </group>\\n </else-if>\\n </choose>\\n </macro>\\n <!-- 6.2.2. Legal identifier -->\\n <macro name=\\\"legal-identifier\\\">\\n <group delimiter=\\\" \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <choose>\\n <if type=\\\"hearing\\\">\\n <!-- Use the 'verb' form of the hearing term to hold 'testimony of' -->\\n <text form=\\\"verb\\\" term=\\\"hearing\\\"/>\\n <names variable=\\\"author\\\">\\n <name and=\\\"symbol\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"bill legislation regulation\\\">\\n <!-- For uncodified regulations, assume future code section is in `status`. -->\\n <text variable=\\\"status\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"legal-identifier-bill-report\\\">\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"genre\\\"/>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"authority chapter-number container-title\\\">\\n <text variable=\\\"number\\\"/>\\n </if>\\n <else>\\n <!-- If there is no legislative body, session number, or code/record title, assume the item is a congressional report and include 'No.' label. -->\\n <text macro=\\\"label-number-capitalized\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- 6.3. Legal source -->\\n <macro name=\\\"legal-source\\\">\\n <!-- Expect legal item `container-title` to be stored in short form -->\\n <choose>\\n <if type=\\\"bill\\\">\\n <text macro=\\\"legal-source-bill\\\"/>\\n </if>\\n <else-if type=\\\"hearing\\\">\\n <text macro=\\\"legal-source-hearing\\\"/>\\n </else-if>\\n <else-if type=\\\"legal_case\\\">\\n <text macro=\\\"legal-source-case\\\"/>\\n </else-if>\\n <else-if type=\\\"legislation\\\">\\n <text macro=\\\"legal-source-legislation\\\"/>\\n </else-if>\\n <else-if type=\\\"regulation\\\">\\n <text macro=\\\"legal-source-regulation\\\"/>\\n </else-if>\\n <else-if type=\\\"treaty\\\">\\n <text macro=\\\"legal-source-treaty\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <!-- Legal source types -->\\n <macro name=\\\"legal-source-bill\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"legal-identifier-bill-report\\\"/>\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"authority\\\"/>\\n <!-- `chapter-number` is a session number -->\\n <text variable=\\\"chapter-number\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"volume\\\"/>\\n <text variable=\\\"container-title\\\"/>\\n <text variable=\\\"page-first\\\"/>\\n </group>\\n </group>\\n </macro>\\n <macro name=\\\"legal-source-case\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <text variable=\\\"volume\\\"/>\\n <text variable=\\\"container-title\\\"/>\\n <text macro=\\\"label-section-symbol\\\"/>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"page page-first\\\">\\n <text variable=\\\"page-first\\\"/>\\n </if>\\n <else>\\n <text value=\\\"___\\\"/>\\n </else>\\n </choose>\\n </if>\\n <else>\\n <text macro=\\\"label-number-capitalized\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"legal-source-hearing\\\">\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"authority\\\"/>\\n <!-- `chapter-number` is a session number -->\\n <text variable=\\\"chapter-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"legal-source-legislation\\\">\\n <choose>\\n <if variable=\\\"number\\\">\\n <!-- `number` is a public law number -->\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if variable=\\\"genre\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n </if>\\n <else>\\n <text form=\\\"short\\\" term=\\\"legislation\\\" text-case=\\\"capitalize-first\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"label-number-capitalized\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"volume\\\"/>\\n <text variable=\\\"container-title\\\"/>\\n <text variable=\\\"page-first\\\"/>\\n </group>\\n </group>\\n </if>\\n <else>\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"volume\\\"/>\\n <text variable=\\\"container-title\\\"/>\\n <choose>\\n <if variable=\\\"section\\\">\\n <text macro=\\\"label-section-symbol\\\"/>\\n </if>\\n <else>\\n <text variable=\\\"page-first\\\"/>\\n </else>\\n </choose>\\n </group>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"legal-source-regulation\\\">\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"genre\\\"/>\\n <text macro=\\\"label-number-capitalized\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"volume\\\"/>\\n <text variable=\\\"container-title\\\"/>\\n <choose>\\n <if variable=\\\"section\\\">\\n <text macro=\\\"label-section-symbol\\\"/>\\n </if>\\n <else>\\n <text variable=\\\"page-first\\\"/>\\n </else>\\n </choose>\\n </group>\\n </group>\\n </macro>\\n <macro name=\\\"legal-source-treaty\\\">\\n <group delimiter=\\\" \\\">\\n <number variable=\\\"volume\\\"/>\\n <text variable=\\\"container-title\\\"/>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"page page-first\\\">\\n <text variable=\\\"page-first\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"label-number-capitalized\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- Citation -->\\n <macro name=\\\"citation-author-date-item\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if type=\\\"classic\\\">\\n <text macro=\\\"author-inline\\\"/>\\n <choose>\\n <if variable=\\\"author\\\">\\n <text macro=\\\"title-and-descriptions-short\\\"/>\\n </if>\\n </choose>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"interview personal_communication\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\">\\n <!-- accessible `interview` or `personal_communication` uses standard format -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"event-date issued\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"author-inline\\\"/>\\n <text macro=\\\"date-short\\\"/>\\n </group>\\n </if>\\n <else>\\n <text macro=\\\"author-inline\\\"/>\\n <text macro=\\\"date-short\\\"/>\\n </else>\\n </choose>\\n </if>\\n <else>\\n <!-- inaccessible `interview` or `personal_communication` uses in-text format (CMOS18 14.111) -->\\n <text macro=\\\"author-inline\\\"/>\\n <text macro=\\\"title-and-descriptions-short\\\"/>\\n <choose>\\n <if position=\\\"first\\\">\\n <choose>\\n <if type=\\\"interview\\\">\\n <text macro=\\\"date-short\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"source-medium-note\\\"/>\\n </if>\\n </choose>\\n </else>\\n </choose>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"event-date issued\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"author-inline\\\"/>\\n <text macro=\\\"date-short\\\"/>\\n </group>\\n </else-if>\\n <else>\\n <!--- comma with forthcoming or n.d. -->\\n <text macro=\\\"author-inline\\\"/>\\n <text macro=\\\"date-short\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <citation collapse=\\\"year\\\" disambiguate-add-givenname=\\\"true\\\" disambiguate-add-names=\\\"true\\\" disambiguate-add-year-suffix=\\\"true\\\" et-al-min=\\\"3\\\" et-al-use-first=\\\"1\\\" givenname-disambiguation-rule=\\\"primary-name\\\">\\n <layout delimiter=\\\"; \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"none\\\" type=\\\"classic\\\">\\n <text macro=\\\"citation-author-date-item\\\"/>\\n <text macro=\\\"source-locator-author-date\\\"/>\\n </if>\\n <!-- with `classic`, a non-numeric canonical reference or identifying number is separated by a space rather than a comma (CMOS18 14.145) -->\\n <else-if is-numeric=\\\"locator\\\">\\n <text macro=\\\"citation-author-date-item\\\"/>\\n <text macro=\\\"source-locator-author-date\\\"/>\\n </else-if>\\n <else-if locator=\\\"chapter line verse\\\" match=\\\"any\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"citation-author-date-item\\\"/>\\n <text macro=\\\"source-locator-author-date\\\"/>\\n </group>\\n </else-if>\\n <else>\\n <text macro=\\\"citation-author-date-item\\\"/>\\n <text macro=\\\"source-locator-author-date\\\"/>\\n </else>\\n </choose>\\n </group>\\n </layout>\\n </citation>\\n <!-- Bibliography -->\\n <macro name=\\\"bibliography-author-date\\\">\\n <group delimiter=\\\". \\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"bill hearing legal_case legislation regulation treaty\\\">\\n <!-- Legal items have different orders and delimiters -->\\n <text macro=\\\"legal-reference\\\"/>\\n <text macro=\\\"source-date-accessed-DOI-URL-bib\\\"/>\\n <text variable=\\\"references\\\"/>\\n </if>\\n <else>\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"author-bib\\\"/>\\n <choose>\\n <!-- give key to abbreviations (CMOS18 13.127, 14.104) -->\\n <!-- TODO: add `authority` and `publisher` if it becomes possible to test for short forms -->\\n <if type=\\\"webpage\\\" variable=\\\"publisher\\\"/>\\n <else-if type=\\\"webpage\\\" variable=\\\"container-title container-title-short\\\">\\n <text prefix=\\\"(\\\" suffix=\\\")\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n <text macro=\\\"date\\\"/>\\n <text macro=\\\"title-and-source-bib\\\"/>\\n <text variable=\\\"references\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <bibliography et-al-min=\\\"7\\\" et-al-use-first=\\\"3\\\" hanging-indent=\\\"true\\\">\\n <sort>\\n <key macro=\\\"author-sort\\\"/>\\n <key macro=\\\"date-sort-group\\\"/>\\n <key macro=\\\"date-sort-year\\\"/>\\n <key macro=\\\"date\\\"/>\\n <key macro=\\\"title-and-descriptions-bib\\\"/>\\n <key macro=\\\"source-bib\\\"/>\\n <key variable=\\\"volume\\\"/>\\n <key variable=\\\"part-number\\\"/>\\n <key variable=\\\"event-date\\\"/>\\n <key variable=\\\"issued\\\"/>\\n <key macro=\\\"source-archive-bib\\\"/>\\n </sort>\\n <layout suffix=\\\".\\\">\\n <choose>\\n <if type=\\\"classic\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"archive editor translator publisher\\\">\\n <text macro=\\\"bibliography-author-date\\\"/>\\n </if>\\n </choose>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <choose>\\n <if variable=\\\"author\\\">\\n <!-- Signed reference entries appear in the bibliography (CMOS18 14.132) -->\\n <text macro=\\\"bibliography-author-date\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"DOI URL\\\">\\n <!-- Provide a bibliography if necessary identifying information is not in text -->\\n <text macro=\\\"bibliography-author-date\\\"/>\\n </else-if>\\n </choose>\\n </else-if>\\n <!-- Personal communications only appear in the bibliography if the reader can retrieve them (CMOS18 14.13, 14.111) -->\\n <else-if match=\\\"any\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\">\\n <text macro=\\\"bibliography-author-date\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview personal_communication\\\"/>\\n <else>\\n <text macro=\\\"bibliography-author-date\\\"/>\\n </else>\\n </choose>\\n </layout>\\n </bibliography>\\n</style>\\n\",\"chicago-notes-bibliography\":\"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n<style xmlns=\\\"http://purl.org/net/xbiblio/csl\\\" class=\\\"note\\\" initialize-with=\\\". \\\" page-range-format=\\\"chicago-16\\\" version=\\\"1.0\\\">\\n <!-- This file was generated by the Style Variant Builder <https://github.com/citation-style-language/style-variant-builder>. To contribute changes, modify the template and regenerate variants. -->\\n <info>\\n <title>Chicago Manual of Style 18th edition (notes and bibliography)</title>\\n <title-short>CMOS/CMS with Bluebook (full notes and bibliography/NB [13.18])</title-short>\\n <id>http://www.zotero.org/styles/chicago-notes-bibliography</id>\\n <link href=\\\"http://www.zotero.org/styles/chicago-notes-bibliography\\\" rel=\\\"self\\\"/>\\n <link href=\\\"https://www.chicagomanualofstyle.org/\\\" rel=\\\"documentation\\\"/>\\n <link href=\\\"https://zotero.org/groups/2205533/collections/5V67EPX3\\\" rel=\\\"documentation\\\"/>\\n <author>\\n <name>Andrew Dunning</name>\\n <uri>https://orcid.org/0000-0003-0464-5036</uri>\\n </author>\\n <category citation-format=\\\"note\\\"/>\\n <category field=\\\"anthropology\\\"/>\\n <category field=\\\"communications\\\"/>\\n <category field=\\\"generic-base\\\"/>\\n <category field=\\\"geography\\\"/>\\n <category field=\\\"history\\\"/>\\n <category field=\\\"humanities\\\"/>\\n <category field=\\\"law\\\"/>\\n <category field=\\\"linguistics\\\"/>\\n <category field=\\\"literature\\\"/>\\n <category field=\\\"philosophy\\\"/>\\n <category field=\\\"political_science\\\"/>\\n <category field=\\\"science\\\"/>\\n <category field=\\\"social_science\\\"/>\\n <category field=\\\"sociology\\\"/>\\n <category field=\\\"theology\\\"/>\\n <summary>Chicago-style source citations (with Bluebook for legal citations), notes and bibliography system</summary>\\n <updated>2025-02-09T00:00:00+00:00</updated>\\n <rights license=\\\"http://creativecommons.org/licenses/by-sa/3.0/\\\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\\n </info>\\n <locale xml:lang=\\\"en\\\">\\n <terms>\\n <!-- Chicago omits 'by' from `verb-short` forms; it abbreviates only the most common roles -->\\n <term name=\\\"advance-online-publication\\\">ahead of print</term>\\n <term name=\\\"anonymous\\\">unsigned</term>\\n <term form=\\\"verb-short\\\" name=\\\"collection-editor\\\">ed.</term>\\n <term form=\\\"short\\\" name=\\\"collection-number\\\">\\n <single>vol.</single>\\n <multiple>vols.</multiple>\\n </term>\\n <term form=\\\"verb-short\\\" name=\\\"compiler\\\">comp.</term>\\n <term form=\\\"verb-short\\\" name=\\\"editor\\\">ed.</term>\\n <term form=\\\"short\\\" name=\\\"editor-translator\\\">\\n <single>ed. and trans.</single>\\n <multiple>eds. and trans.</multiple>\\n </term>\\n <term form=\\\"short\\\" name=\\\"editortranslator\\\">\\n <single>ed. and trans.</single>\\n <multiple>eds. and trans.</multiple>\\n </term>\\n <term form=\\\"verb\\\" name=\\\"editor-translator\\\">edited and translated by</term>\\n <term form=\\\"verb\\\" name=\\\"editortranslator\\\">edited and translated by</term>\\n <term form=\\\"verb-short\\\" name=\\\"editor-translator\\\">ed. and trans.</term>\\n <term form=\\\"verb-short\\\" name=\\\"editortranslator\\\">ed. and trans.</term>\\n <term form=\\\"verb-short\\\" name=\\\"illustrator\\\">ill.</term>\\n <term form=\\\"short\\\" name=\\\"legislation\\\">Pub. L.</term>\\n <term name=\\\"manuscript\\\">unpublished manuscript</term>\\n <term name=\\\"original-work-published\\\">originally published as</term>\\n <term form=\\\"short\\\" name=\\\"paper-conference\\\">paper</term>\\n <!-- 'under' replaces 's.v.' from CMOS17 and earlier (CMOS18 14.130) -->\\n <term name=\\\"sub-verbo\\\">under</term>\\n <term form=\\\"short\\\" name=\\\"sub-verbo\\\">under</term>\\n <term name=\\\"timestamp\\\">at</term>\\n <term form=\\\"verb-short\\\" name=\\\"translator\\\">trans.</term>\\n </terms>\\n </locale>\\n <locale xml:lang=\\\"en-GB\\\">\\n <terms>\\n <!-- the Bibliography of Additional Resources recommends the New Oxford Style Manual as a British English guide, which the `en-GB` locale follows -->\\n <term form=\\\"short\\\" name=\\\"collection-number\\\">\\n <single>vol.</single>\\n <multiple>vols</multiple>\\n </term>\\n <term form=\\\"short\\\" name=\\\"editor-translator\\\">\\n <single>ed. and trans.</single>\\n <multiple>eds and trans.</multiple>\\n </term>\\n <term form=\\\"short\\\" name=\\\"editortranslator\\\">\\n <single>ed. and trans.</single>\\n <multiple>eds and trans.</multiple>\\n </term>\\n <term form=\\\"verb-short\\\" name=\\\"illustrator\\\">illus.</term>\\n </terms>\\n </locale>\\n <!-- Contents:\\n\\n This file interprets Chicago using APA's four basic reference elements\\n (cf. CMOS18 14.2, 14.64, 14.161):\\n\\n 1. Author (CMOS18 13.74-86)\\n 2. Date (author-date system only, CMOS18 13.102)\\n 3. Title and descriptions (CMOS18 13.87-101)\\n 3.1. Title\\n 3.2. Description\\n 3.3. Identifiers (edition, contributors, volume)\\n 4. Source\\n 4.1. Serial sources\\n 4.2. Monographic sources\\n 4.3. Series\\n 4.4. Event\\n 4.5. Publisher\\n 4.6. Date\\n 4.7. Locator (including page references)\\n 4.8. Medium\\n 4.9. Archival location\\n 4.10. URL or persistent identifier\\n\\n Freeform annotations to bibliography entries:\\n\\n 5. Notes\\n\\n Chicago also provides parallel rules for legal references following\\n The Bluebook: A Uniform System of Citation (code shared with APA):\\n\\n 6. Legal references\\n -->\\n <!-- In this file, macros suffixed `-bib` and `-note` are parallel versions\\n of the same features for the bibliography and notes, and all changes\\n must be applied to both. They should only contain differences of\\n punctuation (periods in bibliography, commas in notes) and capitalization,\\n except where the comments indicate structural changes. -->\\n <!-- Categories of CSL item types:\\n\\n Serial\\n : article-journal article-magazine article-newspaper periodical post-weblog review review-book\\n\\n Serial or Monographic\\n : interview paper-conference\\n\\n Monographic with any of `collection-editor compiler editor editorial-director`.\\n A serial `paper-conference` is unpublished if it lacks any of `issue page supplement-number volume`.\\n\\n Monographic\\n : article book broadcast chapter classic collection dataset document\\n entry entry-dictionary entry-encyclopedia event figure\\n graphic manuscript map motion_picture musical_score\\n pamphlet patent performance personal_communication post report\\n software song speech standard thesis webpage\\n\\n Legal\\n : bill hearing legal_case legislation regulation treaty\\n -->\\n <!-- Variable labels -->\\n <macro name=\\\"label-chapter-number\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"chapter-number\\\" type=\\\"song\\\">\\n <text value=\\\"track\\\"/>\\n </if>\\n <else-if is-numeric=\\\"chapter-number\\\">\\n <label form=\\\"short\\\" variable=\\\"chapter-number\\\"/>\\n </else-if>\\n </choose>\\n <text variable=\\\"chapter-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-chapter-number-capitalized\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"chapter-number\\\" type=\\\"song\\\">\\n <text text-case=\\\"capitalize-first\\\" value=\\\"track\\\"/>\\n </if>\\n <else-if is-numeric=\\\"chapter-number\\\">\\n <label form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"chapter-number\\\"/>\\n </else-if>\\n </choose>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"chapter-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-collection-number\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"collection-number\\\">\\n <label form=\\\"short\\\" variable=\\\"collection-number\\\"/>\\n </if>\\n </choose>\\n <text variable=\\\"collection-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-edition\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"edition\\\">\\n <number form=\\\"ordinal\\\" variable=\\\"edition\\\"/>\\n <label form=\\\"short\\\" variable=\\\"edition\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types: full label (CMOS18 14.89) -->\\n <text variable=\\\"edition\\\"/>\\n <label variable=\\\"edition\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text variable=\\\"edition\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <text variable=\\\"edition\\\"/>\\n <label variable=\\\"edition\\\"/>\\n </else-if>\\n <else>\\n <!-- monographic types -->\\n <text variable=\\\"edition\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"label-edition-capitalized\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"edition\\\">\\n <number form=\\\"ordinal\\\" variable=\\\"edition\\\"/>\\n <label form=\\\"short\\\" variable=\\\"edition\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types: full label (CMOS18 14.89) -->\\n <text text-case=\\\"title\\\" variable=\\\"edition\\\"/>\\n <label text-case=\\\"capitalize-first\\\" variable=\\\"edition\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"edition\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <text text-case=\\\"title\\\" variable=\\\"edition\\\"/>\\n <label text-case=\\\"capitalize-first\\\" variable=\\\"edition\\\"/>\\n </else-if>\\n <else>\\n <!-- monographic types -->\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"edition\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"label-issue\\\">\\n <group delimiter=\\\" \\\">\\n <label form=\\\"short\\\" variable=\\\"issue\\\"/>\\n <text variable=\\\"issue\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-locator\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if locator=\\\"page\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"bill hearing legal_case legislation regulation treaty\\\">\\n <!-- Bluebook-style labels for legal types (CMOS18 14.174) -->\\n <choose>\\n <if locator=\\\"chapter paragraph section\\\" match=\\\"any\\\">\\n <label form=\\\"symbol\\\" variable=\\\"locator\\\"/>\\n </if>\\n <else>\\n <label form=\\\"short\\\" variable=\\\"locator\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else-if is-numeric=\\\"locator\\\" locator=\\\"line\\\">\\n <label variable=\\\"locator\\\"/>\\n </else-if>\\n <else-if is-numeric=\\\"locator\\\">\\n <label form=\\\"short\\\" variable=\\\"locator\\\"/>\\n </else-if>\\n <else-if locator=\\\"chapter line verse\\\" match=\\\"any\\\"/>\\n <!-- a non-numeric canonical reference is identified by its formatting and does not need a label (CMOS18 14.143-54) -->\\n <else>\\n <label form=\\\"short\\\" variable=\\\"locator\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"locator\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-locator-all\\\">\\n <group delimiter=\\\" \\\">\\n <label form=\\\"short\\\" variable=\\\"locator\\\"/>\\n <text variable=\\\"locator\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-number\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"standard\\\"/>\\n <else-if is-numeric=\\\"number\\\" match=\\\"any\\\" type=\\\"legislation regulation\\\">\\n <label form=\\\"short\\\" variable=\\\"number\\\"/>\\n </else-if>\\n </choose>\\n <text variable=\\\"number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-number-capitalized\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"standard\\\"/>\\n <else-if is-numeric=\\\"number\\\" match=\\\"any\\\" type=\\\"legislation regulation\\\">\\n <label form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"number\\\"/>\\n </else-if>\\n </choose>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-number-of-volumes\\\">\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"number-of-volumes\\\"/>\\n <choose>\\n <if is-numeric=\\\"number-of-volumes\\\">\\n <label form=\\\"short\\\" variable=\\\"number-of-volumes\\\"/>\\n </if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"label-page\\\">\\n <group delimiter=\\\" \\\">\\n <label form=\\\"short\\\" variable=\\\"page\\\"/>\\n <text variable=\\\"page\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-part-number\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"part-number\\\">\\n <!-- TODO: Replace with `part-number` label when CSL provides one -->\\n <text form=\\\"short\\\" term=\\\"part\\\"/>\\n </if>\\n </choose>\\n <text variable=\\\"part-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-part-number-capitalized\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"part-number\\\">\\n <!-- TODO: Replace with `part-number` label when CSL provides one -->\\n <text form=\\\"short\\\" term=\\\"part\\\" text-case=\\\"capitalize-first\\\"/>\\n </if>\\n </choose>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"part-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-section\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"section\\\">\\n <label form=\\\"short\\\" variable=\\\"section\\\"/>\\n </if>\\n </choose>\\n <text text-case=\\\"title\\\" variable=\\\"section\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-section-capitalized\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"section\\\">\\n <label form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"section\\\"/>\\n </if>\\n </choose>\\n <text text-case=\\\"title\\\" variable=\\\"section\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-section-symbol\\\">\\n <group delimiter=\\\" \\\">\\n <label form=\\\"symbol\\\" variable=\\\"section\\\"/>\\n <text variable=\\\"section\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-supplement-number\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <!-- TODO: Replace with `supplement-number` label when CSL provides one -->\\n <if variable=\\\"issue supplement-number\\\">\\n <!-- if there is both an issue and supplement number, do not label both as 'no.' -->\\n <text form=\\\"short\\\" term=\\\"supplement\\\"/>\\n </if>\\n <else-if is-numeric=\\\"supplement-number\\\" variable=\\\"volume-title\\\">\\n <!-- if there is a volume title, it is already described as a supplement -->\\n <text form=\\\"short\\\" term=\\\"issue\\\"/>\\n </else-if>\\n <else-if is-numeric=\\\"supplement-number\\\" type=\\\"periodical\\\" variable=\\\"title\\\">\\n <text form=\\\"short\\\" term=\\\"issue\\\"/>\\n </else-if>\\n <else-if is-numeric=\\\"supplement-number\\\">\\n <text form=\\\"short\\\" term=\\\"supplement\\\"/>\\n </else-if>\\n </choose>\\n <text variable=\\\"supplement-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-version\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"software\\\">\\n <!-- short version label for software (CMOS18 14.169) -->\\n <label form=\\\"short\\\" variable=\\\"version\\\"/>\\n </if>\\n <else>\\n <label variable=\\\"version\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"version\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-version-capitalized\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"software\\\">\\n <!-- short version label for software (CMOS18 14.169) -->\\n <label form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"version\\\"/>\\n </if>\\n <else>\\n <label text-case=\\\"capitalize-first\\\" variable=\\\"version\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"version\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-volume\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"volume\\\">\\n <label form=\\\"short\\\" variable=\\\"volume\\\"/>\\n </if>\\n </choose>\\n <text variable=\\\"volume\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"label-volume-capitalized\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-numeric=\\\"volume\\\">\\n <label form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"volume\\\"/>\\n </if>\\n </choose>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"volume\\\"/>\\n </group>\\n </macro>\\n <!-- 1. Author (CMOS18 13.74-86) -->\\n <macro name=\\\"author-bib\\\">\\n <names variable=\\\"composer\\\">\\n <name and=\\\"text\\\" delimiter-precedes-last=\\\"always\\\" initialize=\\\"false\\\" name-as-sort-order=\\\"first\\\"/>\\n <label form=\\\"short\\\" prefix=\\\", \\\"/>\\n <substitute>\\n <names variable=\\\"author\\\"/>\\n <!-- cf. `interview` model (CMOS18 14.110); if it is desired to prioritize `host` over `guest`, the latter could be encoded as a `contributor` -->\\n <names variable=\\\"guest\\\"/>\\n <names variable=\\\"host\\\"/>\\n <choose>\\n <if type=\\\"song\\\">\\n <names variable=\\\"performer\\\"/>\\n </if>\\n </choose>\\n <choose>\\n <if type=\\\"classic\\\">\\n <!-- contributors fall after the title of `classic` (CMOS18 14.147) -->\\n <text macro=\\\"author-title-substitute-bib\\\"/>\\n </if>\\n <else-if type=\\\"entry-dictionary\\\" variable=\\\"container-title\\\">\\n <!-- contributors fall after the title of unsigned reference entries (CMOS18 14.130) -->\\n <text macro=\\\"author-title-substitute-container\\\"/>\\n </else-if>\\n <else-if type=\\\"entry-encyclopedia\\\" variable=\\\"container-title\\\">\\n <text macro=\\\"author-title-substitute-container\\\"/>\\n </else-if>\\n </choose>\\n <names variable=\\\"illustrator\\\"/>\\n <choose>\\n <!-- list an edited multivolume work under the name of the series editor; remove this condition for author-date or notes and bibliography leading with volume title (CMOS18 14.21) -->\\n <if variable=\\\"container-title\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"number-of-volumes part-number part-title volume volume-title\\\">\\n <names variable=\\\"collection-editor\\\"/>\\n </else-if>\\n </choose>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"standard\\\">\\n <names variable=\\\"editor-translator\\\"/>\\n <names variable=\\\"editor\\\"/>\\n <names variable=\\\"translator\\\"/>\\n <names variable=\\\"collection-editor\\\"/>\\n </if>\\n </choose>\\n <names variable=\\\"director\\\"/>\\n <choose>\\n <!-- serial `broadcast` prioritizes title (CMOS18 14.165, 14.168) -->\\n <if type=\\\"broadcast\\\" variable=\\\"container-title number title\\\"/>\\n <else>\\n <names variable=\\\"producer\\\"/>\\n <names variable=\\\"executive-producer\\\"/>\\n <names variable=\\\"series-creator\\\"/>\\n <choose>\\n <if type=\\\"broadcast\\\">\\n <names variable=\\\"contributor\\\"/>\\n </if>\\n </choose>\\n </else>\\n </choose>\\n <names variable=\\\"editorial-director\\\"/>\\n <names variable=\\\"compiler\\\"/>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"event performance speech\\\">\\n <names variable=\\\"chair\\\"/>\\n <names variable=\\\"organizer\\\"/>\\n </if>\\n </choose>\\n <names variable=\\\"curator\\\"/>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"software webpage\\\">\\n <!-- `software` listed under the name of the publisher or developer (CMOS18 14.169); `webpage` listed under a site owner or sponsor (CMOS18 14.104) -->\\n <text variable=\\\"publisher\\\"/>\\n </if>\\n <else-if type=\\\"standard\\\">\\n <!-- `standard` listed in bibliography under organization, but note omits this (CMOS18 14.159) -->\\n <text variable=\\\"authority\\\"/>\\n </else-if>\\n </choose>\\n <text macro=\\\"author-title-substitute-container\\\"/>\\n <text macro=\\\"author-title-substitute-bib\\\"/>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"container-title event-date event-place event-title genre title publisher publisher-place\\\"/>\\n <else-if type=\\\"manuscript\\\">\\n <text macro=\\\"source-archive-bib\\\"/>\\n </else-if>\\n </choose>\\n </substitute>\\n </names>\\n </macro>\\n <macro name=\\\"author-note\\\">\\n <names variable=\\\"composer\\\">\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n <label form=\\\"short\\\" prefix=\\\", \\\"/>\\n <substitute>\\n <names variable=\\\"author\\\"/>\\n <!-- cf. `interview` model (CMOS18 14.110); use `contributor` if `host` should be prioritized -->\\n <names variable=\\\"guest\\\"/>\\n <names variable=\\\"host\\\"/>\\n <choose>\\n <if type=\\\"song\\\">\\n <names variable=\\\"performer\\\"/>\\n </if>\\n </choose>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"classic performance\\\">\\n <!-- note contributors fall after the title of `classic` (CMOS18 14.147), `performance` (CMOS18 14.166) -->\\n <text macro=\\\"author-title-substitute-note\\\"/>\\n </if>\\n <else-if type=\\\"broadcast\\\" variable=\\\"container-title number title\\\">\\n <!-- note contributors fall after the title of `broadcast` (CMOS18 14.165) -->\\n <text macro=\\\"author-title-substitute-container-short\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"broadcast motion_picture song\\\">\\n <!-- note contributors fall after the title of `broadcast`, `motion_picture` (CMOS18 14.165), `song` (CMOS18 14.163) -->\\n <text macro=\\\"author-title-substitute-note\\\"/>\\n </else-if>\\n <!-- unsigned reference articles consulted in physical formats list `title` in the manner of a `sub-verbo` locator (CMOS18 14.130) -->\\n <else-if match=\\\"any\\\" variable=\\\"DOI URL\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <text macro=\\\"author-title-substitute-reference-note\\\"/>\\n </else-if>\\n </choose>\\n <names variable=\\\"illustrator\\\"/>\\n <choose>\\n <!-- list an edited multivolume work under the name of the series editor; remove this condition for notes and bibliography leading with volume title (CMOS18 14.21) -->\\n <if variable=\\\"container-title\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"number-of-volumes part-number part-title volume volume-title\\\">\\n <names variable=\\\"collection-editor\\\"/>\\n </else-if>\\n </choose>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"standard\\\">\\n <names variable=\\\"editor-translator\\\"/>\\n <names variable=\\\"editor\\\"/>\\n <names variable=\\\"translator\\\"/>\\n <names variable=\\\"collection-editor\\\"/>\\n </if>\\n </choose>\\n <names variable=\\\"director\\\"/>\\n <choose>\\n <!-- serial `broadcast` prioritizes title (CMOS18 14.165, 14.168) -->\\n <if type=\\\"broadcast\\\" variable=\\\"container-title number title\\\"/>\\n <else>\\n <names variable=\\\"producer\\\"/>\\n <names variable=\\\"executive-producer\\\"/>\\n <names variable=\\\"series-creator\\\"/>\\n <choose>\\n <if type=\\\"broadcast\\\">\\n <names variable=\\\"contributor\\\"/>\\n </if>\\n </choose>\\n </else>\\n </choose>\\n <names variable=\\\"editorial-director\\\"/>\\n <names variable=\\\"compiler\\\"/>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"event performance speech\\\">\\n <names variable=\\\"chair\\\"/>\\n <names variable=\\\"organizer\\\"/>\\n </if>\\n </choose>\\n <names variable=\\\"curator\\\"/>\\n <!-- notes omit organization name for `software` (CMOS18 14.169), `standard` (CMOS18 14.159), and `webpage` (CMOS18 14.104) -->\\n <choose>\\n <!-- in notes, substitute `container-title` only if there is no article title, moving it before `genre` or `section` (CMOS18 14.89); shortened notes use this more liberally -->\\n <if match=\\\"any\\\" variable=\\\"reviewed-genre reviewed-title title\\\"/>\\n <else-if type=\\\"webpage\\\"/>\\n <else>\\n <text macro=\\\"author-title-substitute-container\\\"/>\\n </else>\\n </choose>\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"reviewed-genre reviewed-title title\\\">\\n <!-- TODO: workaround for citeproc bug shown in substitution with an unsigned review; remove when fixed -->\\n <text macro=\\\"author-title-substitute-note\\\"/>\\n </if>\\n </choose>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"container-title event-date event-place event-title genre title publisher publisher-place\\\"/>\\n <else-if type=\\\"manuscript\\\">\\n <text macro=\\\"source-archive-note\\\"/>\\n </else-if>\\n </choose>\\n </substitute>\\n </names>\\n </macro>\\n <macro name=\\\"author-short\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"bill hearing legal_case legislation regulation treaty\\\">\\n <text macro=\\\"title-and-descriptions-short\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"interview personal_communication\\\">\\n <text macro=\\\"author-short-and-recipient\\\"/>\\n </else-if>\\n <else>\\n <names variable=\\\"composer\\\">\\n <name and=\\\"text\\\" form=\\\"short\\\" initialize=\\\"true\\\"/>\\n <substitute>\\n <names variable=\\\"author\\\"/>\\n <names variable=\\\"guest\\\"/>\\n <names variable=\\\"host\\\"/>\\n <choose>\\n <if type=\\\"song\\\">\\n <names variable=\\\"performer\\\"/>\\n </if>\\n </choose>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"classic performance\\\">\\n <!-- note contributors fall after the title of `classic` (CMOS18 14.147), `performance` (CMOS18 14.166) -->\\n <text macro=\\\"author-title-substitute-short\\\"/>\\n </if>\\n <else-if type=\\\"broadcast\\\" variable=\\\"container-title number title\\\">\\n <!-- note contributors fall after the title of `broadcast` (CMOS18 14.165) -->\\n <text macro=\\\"author-title-substitute-container-short\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"broadcast motion_picture song\\\">\\n <!-- note contributors fall after the title of `broadcast`, `motion_picture` (CMOS18 14.165), `song` (CMOS18 14.163) -->\\n <text macro=\\\"author-title-substitute-short\\\"/>\\n </else-if>\\n <!-- unsigned reference articles consulted in physical formats list `title` in the manner of a `sub-verbo` locator (CMOS18 14.130) -->\\n <else-if match=\\\"any\\\" variable=\\\"DOI URL\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <text macro=\\\"author-title-substitute-container-short\\\"/>\\n </else-if>\\n </choose>\\n <names variable=\\\"illustrator\\\"/>\\n <choose>\\n <!-- list an edited multivolume work under the name of the series editor; remove this condition for notes and bibliography leading with volume title (CMOS18 14.21) -->\\n <if variable=\\\"container-title\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"number-of-volumes part-number part-title volume volume-title\\\">\\n <names variable=\\\"collection-editor\\\"/>\\n </else-if>\\n </choose>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"standard\\\">\\n <names variable=\\\"editor-translator\\\"/>\\n <names variable=\\\"editor\\\"/>\\n <names variable=\\\"translator\\\"/>\\n <names variable=\\\"collection-editor\\\"/>\\n </if>\\n </choose>\\n <choose>\\n <if type=\\\"broadcast\\\" variable=\\\"container-title number title\\\"/>\\n <else>\\n <names variable=\\\"director\\\"/>\\n <names variable=\\\"producer\\\"/>\\n <names variable=\\\"executive-producer\\\"/>\\n <names variable=\\\"series-creator\\\"/>\\n <choose>\\n <if type=\\\"broadcast\\\">\\n <names variable=\\\"contributor\\\"/>\\n </if>\\n </choose>\\n </else>\\n </choose>\\n <names variable=\\\"editorial-director\\\"/>\\n <names variable=\\\"compiler\\\"/>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"event performance speech\\\">\\n <names variable=\\\"chair\\\"/>\\n <names variable=\\\"organizer\\\"/>\\n </if>\\n </choose>\\n <names variable=\\\"curator\\\"/>\\n <choose>\\n <!-- no Chicago definition for these shortened references; this follows the bibliography -->\\n <if match=\\\"any\\\" type=\\\"software webpage\\\">\\n <!-- `software` listed under the name of the publisher or developer (CMOS18 14.169); `webpage` listed under a site owner or sponsor (CMOS18 14.104) -->\\n <text form=\\\"short\\\" variable=\\\"publisher\\\"/>\\n </if>\\n <else-if type=\\\"standard\\\">\\n <!-- `standard` listed in bibliography under organization (CMOS18 14.159) -->\\n <text form=\\\"short\\\" variable=\\\"authority\\\"/>\\n </else-if>\\n </choose>\\n <text macro=\\\"author-title-substitute-container-short\\\"/>\\n <text macro=\\\"author-title-substitute-short\\\"/>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"container-title event-date event-place event-title genre title publisher publisher-place\\\"/>\\n <else-if type=\\\"manuscript\\\">\\n <text macro=\\\"source-archive-note\\\"/>\\n </else-if>\\n </choose>\\n </substitute>\\n </names>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"author-sort\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"bill hearing legal_case legislation regulation treaty\\\">\\n <text macro=\\\"legal-title\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"author-bib\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- Author elements -->\\n <macro name=\\\"author-short-and-recipient\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <!-- inaccessible `interview` or `personal_commmunication`: in-text citation (CMOS18 14.111) -->\\n <if match=\\\"none\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\">\\n <choose>\\n <if position=\\\"first\\\">\\n <!-- at the first citation in shortened forms, give the full name -->\\n <names variable=\\\"author\\\">\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n <!-- never initialize -->\\n <substitute>\\n <text macro=\\\"title-and-descriptions-short\\\"/>\\n </substitute>\\n </names>\\n </if>\\n <else>\\n <names variable=\\\"author\\\">\\n <name and=\\\"text\\\" form=\\\"short\\\" initialize=\\\"true\\\"/>\\n <substitute>\\n <text macro=\\\"title-and-descriptions-short\\\"/>\\n </substitute>\\n </names>\\n </else>\\n </choose>\\n <choose>\\n <if variable=\\\"genre\\\"/>\\n <!-- recipient appears in the description if there is a `genre`; otherwise after `author` -->\\n <else-if position=\\\"first\\\">\\n <names variable=\\\"recipient\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n <!-- never initialize -->\\n </names>\\n </else-if>\\n <else>\\n <names variable=\\\"recipient\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" form=\\\"short\\\" initialize=\\\"true\\\"/>\\n </names>\\n </else>\\n </choose>\\n </if>\\n <!-- accessible `interview` or `personal_communication`: standard citation -->\\n <else-if variable=\\\"author recipient\\\">\\n <names variable=\\\"author\\\">\\n <name and=\\\"text\\\" form=\\\"short\\\" initialize=\\\"true\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"genre\\\">\\n <names variable=\\\"recipient\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" form=\\\"short\\\" initialize=\\\"true\\\"/>\\n </names>\\n </if>\\n </choose>\\n </else-if>\\n <else>\\n <names variable=\\\"author\\\">\\n <name and=\\\"text\\\" form=\\\"short\\\" initialize=\\\"true\\\"/>\\n <substitute>\\n <text macro=\\\"title-and-descriptions-short\\\"/>\\n </substitute>\\n </names>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"author-title-substitute-bib\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- If a review has no `reviewed-genre` or `reviewed-title`, assume that `title` contains the title of the reviewed work; the description provides it. -->\\n <choose>\\n <if variable=\\\"reviewed-genre title\\\">\\n <text macro=\\\"title-bib\\\"/>\\n </if>\\n <else-if variable=\\\"reviewed-genre reviewed-title title\\\">\\n <text macro=\\\"title-bib\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"title-and-descriptions-bib\\\"/>\\n </else>\\n </choose>\\n </if>\\n <else-if variable=\\\"title\\\">\\n <text macro=\\\"title-bib\\\"/>\\n </else-if>\\n <else>\\n <!-- If an item has no `title`, substitute with descriptions. -->\\n <text macro=\\\"title-and-descriptions-bib\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"author-title-substitute-note\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- If a review has no `reviewed-genre` or `reviewed-title`, assume that `title` contains the title of the reviewed work; the description provides it. -->\\n <choose>\\n <if variable=\\\"reviewed-genre title\\\">\\n <text macro=\\\"title-note\\\"/>\\n </if>\\n <else-if variable=\\\"reviewed-genre reviewed-title title\\\">\\n <text macro=\\\"title-note\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"title-and-descriptions-note\\\"/>\\n </else>\\n </choose>\\n </if>\\n <else-if variable=\\\"title\\\">\\n <text macro=\\\"title-note\\\"/>\\n </else-if>\\n <else>\\n <!-- If an item has no `title`, substitute with descriptions and capitalize -->\\n <text macro=\\\"title-and-descriptions-bib\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"author-title-substitute-short\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- If a review has no `reviewed-genre` or `reviewed-title`, assume that `title` contains the title of the reviewed work; the description provides it. -->\\n <choose>\\n <if variable=\\\"reviewed-genre title\\\">\\n <text macro=\\\"title-short\\\"/>\\n </if>\\n <else-if variable=\\\"reviewed-genre reviewed-title title\\\">\\n <text macro=\\\"title-short\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"title-and-descriptions-short\\\"/>\\n </else>\\n </choose>\\n </if>\\n <else-if variable=\\\"title\\\">\\n <text macro=\\\"title-short\\\"/>\\n </else-if>\\n <else>\\n <!-- If an item has no `title`, substitute with descriptions and capitalize -->\\n <text macro=\\\"title-and-descriptions-bib\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"author-title-substitute-container\\\">\\n <choose>\\n <!-- no Chicago model for citing an anonymous article with an issue title in `volume-title` -->\\n <if variable=\\\"volume-title\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"article-magazine article-newspaper\\\">\\n <!-- Anonymous magazine and newspaper articles substitute name of publication (CMOS18 14.87, 14.97) -->\\n <text macro=\\\"source-serial-name\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- Publication name also substituted for unsigned reviews (CMOS18 14.102) -->\\n <text macro=\\\"source-serial-name\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <!-- Anonymous entries in reference works (CMOS18 14.130) -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </else-if>\\n <else-if type=\\\"broadcast\\\">\\n <!-- TV broadcasts and podcasts (CMOS18 14.165, 14.168) -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </else-if>\\n <else-if type=\\\"webpage\\\">\\n <!-- list a webpage under the website title if there is no owner or sponsor (CMOS18 14.104) -->\\n <text text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n <!-- for author-date:\\n <choose><if variable=\\\"container-title-short\\\"><text text-case=\\\"title\\\" variable=\\\"container-title-short\\\"/></if><else><text text-case=\\\"title\\\" variable=\\\"container-title\\\"/></else></choose>-->\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"author-title-substitute-container-short\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-magazine article-newspaper\\\">\\n <!-- Anonymous magazine/newspaper articles substitute name of publication (CMOS18 14.87, 14.97) -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- Publication name also substituted for unsigned reviews (CMOS18 14.102) -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <!-- Anonymous entries in reference works (CMOS18 14.130) -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </else-if>\\n <else-if type=\\\"broadcast\\\">\\n <!-- TV broadcasts and podcasts (CMOS18 14.165, 14.168) -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </else-if>\\n <else-if type=\\\"webpage\\\">\\n <!-- list a webpage under the website title if there is no owner or sponsor (CMOS18 14.104) -->\\n <text form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"author-title-substitute-reference-note\\\">\\n <!-- unsigned reference articles consulted in physical formats list `title` in the manner of a `sub-verbo` locator (CMOS18 14.130) -->\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"author-title-substitute-container\\\"/>\\n <text macro=\\\"source-note\\\"/>\\n </group>\\n <text macro=\\\"source-monographic-publication-note-bracketed\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if locator=\\\"sub-verbo\\\"/>\\n <else-if variable=\\\"container-title title\\\">\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"DOI URL\\\">\\n <!-- Only print reference entries use `sub-verbo` (CMOS18 14.131) -->\\n <text form=\\\"short\\\" term=\\\"sub-verbo\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"title-primary\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </group>\\n </macro>\\n <!-- 2. Date (CMOS18 13.102) -->\\n <macro name=\\\"date-short\\\">\\n <group delimiter=\\\"-\\\">\\n <choose>\\n <if variable=\\\"issued\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if is-uncertain-date=\\\"original-date\\\">\\n <!-- Uncertain date already has square brackets -->\\n <text macro=\\\"date-original-year\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"date-original-year\\\" prefix=\\\"[\\\" suffix=\\\"]\\\"/>\\n </else>\\n </choose>\\n <group>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"interview personal_communication\\\">\\n <text macro=\\\"date-issued-year\\\"/>\\n </if>\\n <!-- accessible `interview` or `personal_communication` items appear in the bibliography; inaccessible items are in-text only -->\\n <else-if match=\\\"any\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\">\\n <text macro=\\\"date-issued-year\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"date-issued-full\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"year-suffix\\\"/>\\n </group>\\n </group>\\n </if>\\n <else-if variable=\\\"event-date\\\">\\n <text macro=\\\"date-event-year\\\"/>\\n </else-if>\\n <else-if variable=\\\"available-date\\\">\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" variable=\\\"available-date\\\"/>\\n </else-if>\\n <else-if variable=\\\"status\\\">\\n <!-- Print the status variable rather than use generic CSL terms (`in press`, etc.) -->\\n <text text-case=\\\"lowercase\\\" variable=\\\"status\\\"/>\\n <text variable=\\\"year-suffix\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview personal_communication\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\">\\n <!-- only give n.d. for accessible personal communication (CMOS18 14.111)-->\\n <text form=\\\"short\\\" term=\\\"no date\\\"/>\\n <text variable=\\\"year-suffix\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"classic collection entry entry-dictionary entry-encyclopedia\\\">\\n <!-- do not give n.d. for archival collections (CMOS18 14.128), `classic` (CMOS18 14.143), or reference entries (CMOS18 14.131) -->\\n <text variable=\\\"year-suffix\\\"/>\\n </else-if>\\n <else-if type=\\\"manuscript\\\">\\n <!-- do not give n.d. with a bare shelfmark -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"container-title event-date event-place event-title genre title publisher publisher-place\\\">\\n <text form=\\\"short\\\" term=\\\"no date\\\"/>\\n <text variable=\\\"year-suffix\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else>\\n <text form=\\\"short\\\" term=\\\"no date\\\"/>\\n <text variable=\\\"year-suffix\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- Date elements -->\\n <macro name=\\\"date-event-full\\\">\\n <choose>\\n <if is-uncertain-date=\\\"issued\\\">\\n <!-- guessed-at date (CMOS18 14.44) -->\\n <date form=\\\"text\\\" prefix=\\\"[\\\" suffix=\\\"?]\\\" variable=\\\"event-date\\\"/>\\n </if>\\n <else>\\n <date form=\\\"text\\\" variable=\\\"event-date\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"date-event-year\\\">\\n <choose>\\n <if is-uncertain-date=\\\"issued\\\">\\n <!-- guessed-at date (CMOS18 14.44) -->\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" prefix=\\\"[\\\" suffix=\\\"?]\\\" variable=\\\"event-date\\\"/>\\n </if>\\n <else>\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" variable=\\\"event-date\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"date-issued-full\\\">\\n <choose>\\n <if is-uncertain-date=\\\"issued\\\">\\n <!-- guessed-at date (CMOS18 14.44) -->\\n <date form=\\\"text\\\" prefix=\\\"[\\\" suffix=\\\"?]\\\" variable=\\\"issued\\\"/>\\n </if>\\n <else>\\n <date form=\\\"text\\\" variable=\\\"issued\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"date-issued-year\\\">\\n <choose>\\n <if is-uncertain-date=\\\"issued\\\">\\n <!-- guessed-at date (CMOS18 14.44) -->\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" prefix=\\\"[\\\" suffix=\\\"?]\\\" variable=\\\"issued\\\"/>\\n </if>\\n <else>\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" variable=\\\"issued\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"date-issued-year-month\\\">\\n <choose>\\n <if is-uncertain-date=\\\"issued\\\">\\n <!-- guessed-at date (CMOS18 14.44) -->\\n <date date-parts=\\\"year-month\\\" form=\\\"text\\\" prefix=\\\"[\\\" suffix=\\\"?]\\\" variable=\\\"issued\\\"/>\\n </if>\\n <else>\\n <date date-parts=\\\"year-month\\\" form=\\\"text\\\" variable=\\\"issued\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"date-original-full\\\">\\n <choose>\\n <if is-uncertain-date=\\\"original-date\\\">\\n <date form=\\\"text\\\" prefix=\\\"[\\\" suffix=\\\"?]\\\" variable=\\\"original-date\\\"/>\\n </if>\\n <else>\\n <date form=\\\"text\\\" variable=\\\"original-date\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"date-original-year\\\">\\n <choose>\\n <if is-uncertain-date=\\\"original-date\\\">\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" prefix=\\\"[\\\" suffix=\\\"?]\\\" variable=\\\"original-date\\\"/>\\n </if>\\n <else>\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" variable=\\\"original-date\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"date-original-year-month\\\">\\n <choose>\\n <if is-uncertain-date=\\\"original-date\\\">\\n <date date-parts=\\\"year-month\\\" form=\\\"text\\\" prefix=\\\"[\\\" suffix=\\\"?]\\\" variable=\\\"original-date\\\"/>\\n </if>\\n <else>\\n <date date-parts=\\\"year-month\\\" form=\\\"text\\\" variable=\\\"original-date\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- 3. Title and descriptions (CMOS18 13.87-101) -->\\n <macro name=\\\"title-and-descriptions-bib\\\">\\n <group delimiter=\\\". \\\">\\n <choose>\\n <if variable=\\\"title\\\">\\n <text macro=\\\"title-bib\\\"/>\\n <text macro=\\\"description-bib\\\"/>\\n <text macro=\\\"identifier-bib\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"bill report\\\">\\n <!-- Bills, resolutions, and congressional reports substitute bill number if no title -->\\n <!-- Congressional reports are indistinguishable from other reports -->\\n <text macro=\\\"identifier-number-bib\\\"/>\\n <text macro=\\\"identifier-bib\\\"/>\\n <text macro=\\\"description-bib\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"description-bib\\\"/>\\n <text macro=\\\"identifier-bib\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"title-and-descriptions-note\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"title\\\">\\n <text macro=\\\"title-note\\\"/>\\n <text macro=\\\"description-note\\\"/>\\n <text macro=\\\"identifier-note\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"bill report\\\">\\n <!-- Bills, resolutions, and congressional reports substitute bill number if no title -->\\n <!-- Congressional reports are indistinguishable from other reports -->\\n <text macro=\\\"identifier-number-note\\\"/>\\n <text macro=\\\"identifier-note\\\"/>\\n <text macro=\\\"description-note\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"description-note\\\"/>\\n <text macro=\\\"identifier-note\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"title-and-descriptions-short\\\">\\n <choose>\\n <if variable=\\\"title\\\">\\n <text macro=\\\"title-short\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"bill report\\\">\\n <!-- Bills, resolutions, and congressional reports substitute bill number if no title -->\\n <text macro=\\\"legal-identifier-bill-report\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"description-short\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-and-source-bib\\\">\\n <group delimiter=\\\". \\\">\\n <choose>\\n <if type=\\\"broadcast\\\" variable=\\\"container-title number title\\\">\\n <!-- Bespoke `broadcast` format (CMOS18 14.165, 14.168) -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n <!-- for author-date or notes and bibliography leading with volume title (CMOS18 14.21): -->\\n <!-- <text macro=\\\"source-monographic-title-specific-title-first\\\"/> -->\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"identifier-number-bib\\\"/>\\n <text macro=\\\"title-bib\\\"/>\\n <text macro=\\\"description-bib\\\"/>\\n <text macro=\\\"source-monographic-identifier-contributors-bib\\\"/>\\n </group>\\n <text macro=\\\"source-monographic-identifier-contributors-bib-container-author\\\"/>\\n <text macro=\\\"source-series-bib\\\"/>\\n <choose>\\n <!-- show event information here only if not collapsed with `issued` (CMOS18 14.167) -->\\n <if match=\\\"any\\\" variable=\\\"event-date original-date original-publisher original-publisher-place publisher status\\\">\\n <text macro=\\\"source-event-bib\\\"/>\\n </if>\\n </choose>\\n </if>\\n <else-if type=\\\"chapter\\\" variable=\\\"container-title genre\\\">\\n <!-- 'introduction to', 'online appendix to' (CMOS18 14.12, 14.14) -->\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"title-and-descriptions-bib\\\"/>\\n <text macro=\\\"source-bib\\\"/>\\n </group>\\n </else-if>\\n <else-if type=\\\"article-journal\\\" variable=\\\"container-title genre volume-title\\\">\\n <!-- introduction to a special issue or supplement -->\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"title-and-descriptions-bib\\\"/>\\n <text macro=\\\"source-bib\\\"/>\\n </group>\\n </else-if>\\n <else>\\n <text macro=\\\"title-and-descriptions-bib\\\"/>\\n <text macro=\\\"source-bib\\\"/>\\n </else>\\n </choose>\\n <group delimiter=\\\", \\\">\\n <choose>\\n <!-- show event information here only if collapsed with `issued` (CMOS18 14.167) -->\\n <if match=\\\"any\\\" variable=\\\"event-date original-date original-publisher original-publisher-place publisher status\\\"/>\\n <!-- omit serial types -->\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"source-event-bib\\\"/>\\n </else-if>\\n <!-- omit serial types -->\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\"/>\\n <else>\\n <!-- monographic types -->\\n <text macro=\\\"source-event-bib\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"source-monographic-publication-bib\\\"/>\\n </group>\\n <text macro=\\\"source-medium-bib\\\"/>\\n <text macro=\\\"source-archive-bib\\\"/>\\n <text macro=\\\"source-date-accessed-DOI-URL-bib\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"title-and-source-note\\\">\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if type=\\\"broadcast\\\" variable=\\\"container-title number title\\\">\\n <!-- Bespoke `broadcast` format (CMOS18 14.165, 14.168) -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"identifier-number-note\\\"/>\\n <text macro=\\\"title-note\\\"/>\\n <text macro=\\\"description-note\\\"/>\\n <text macro=\\\"source-monographic-identifier-contributors-note\\\"/>\\n </group>\\n <text macro=\\\"source-series-note\\\"/>\\n <text macro=\\\"source-event-note\\\"/>\\n </if>\\n <else-if type=\\\"chapter\\\" variable=\\\"container-title genre\\\">\\n <!-- 'introduction to', 'online appendix to' (CMOS18 14.12, 14.14) -->\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"title-and-descriptions-note\\\"/>\\n <text macro=\\\"source-note\\\"/>\\n </group>\\n </else-if>\\n <else-if type=\\\"article-journal\\\" variable=\\\"container-title genre volume-title\\\">\\n <!-- introduction to a special issue or supplement -->\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"title-and-descriptions-note\\\"/>\\n <text macro=\\\"source-note\\\"/>\\n </group>\\n </else-if>\\n <else>\\n <text macro=\\\"title-and-descriptions-note\\\"/>\\n <text macro=\\\"source-note\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"source-monographic-publication-note-unbracketed\\\"/>\\n </group>\\n <text macro=\\\"source-monographic-publication-note-bracketed\\\"/>\\n </group>\\n <choose>\\n <!-- Locator for monographic types only; serial locator handled in `source-serial-locator` -->\\n <!-- omit serial types -->\\n <if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"source-monographic-locator\\\"/>\\n </else-if>\\n <!-- omit serial types -->\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\"/>\\n <else>\\n <!-- monographic types -->\\n <text macro=\\\"source-monographic-locator\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"source-medium-note\\\"/>\\n <text macro=\\\"source-archive-note\\\"/>\\n <text macro=\\\"source-date-accessed-DOI-URL-note\\\"/>\\n </group>\\n </macro>\\n <!-- 3.1. Title -->\\n <macro name=\\\"title-bib\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"post webpage\\\">\\n <!-- part number/title always at the analytic level -->\\n <text macro=\\\"title-and-part-filter-review-bib\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <text macro=\\\"title-and-part-filter-review-bib\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"title-primary\\\"/>\\n <!-- for author-date or notes and bibliography leading with volume title (CMOS18 14.21): -->\\n <!-- <text macro=\\\"title-monographic-bib-specific-title-first\\\"/> -->\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <text macro=\\\"title-and-part-filter-review-bib\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"title-primary\\\"/>\\n <!-- for author-date or notes and bibliography leading with volume title (CMOS18 14.21): -->\\n <!-- <text macro=\\\"title-monographic-bib-specific-title-first\\\"/> -->\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-note\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"post webpage\\\">\\n <!-- print `container-title` on `post` or `webpage` in the same way as `publisher` (CMOS18 14.104-106) -->\\n <text macro=\\\"title-and-part-filter-review-note\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <text macro=\\\"title-and-part-filter-review-note\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <!-- notes always open with the primary title -->\\n <text macro=\\\"title-primary\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <text macro=\\\"title-and-part-filter-review-note\\\"/>\\n </else-if>\\n <else>\\n <!-- notes always open with the primary title -->\\n <text macro=\\\"title-primary\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-short\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- If a review has no `reviewed-title`, assume that `title` contains the title of the reviewed work; the description provides it. -->\\n <choose>\\n <if variable=\\\"reviewed-genre title\\\">\\n <!-- Quotes, title case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </if>\\n <else-if variable=\\\"reviewed-genre reviewed-title title\\\">\\n <!-- Quotes, title case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"description-short\\\"/>\\n </else>\\n </choose>\\n </if>\\n <else>\\n <text macro=\\\"title-primary-short\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- Title elements -->\\n <macro name=\\\"title-and-part-filter-review-bib\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- `title` is only the review title if there is a separate `reviewed-genre` or `reviewed-title`; otherwise, it is the title of the reviewed work, printed in the description -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"reviewed-genre reviewed-title\\\">\\n <text macro=\\\"title-and-part-title-bib\\\"/>\\n </if>\\n </choose>\\n </if>\\n <else>\\n <text macro=\\\"title-and-part-title-bib\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-and-part-filter-review-note\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- `title` is only the review title if there is a separate `reviewed-genre` or `reviewed-title`; otherwise, it is the title of the reviewed work, printed in the description -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"reviewed-genre reviewed-title\\\">\\n <text macro=\\\"title-and-part-title-note\\\"/>\\n </if>\\n </choose>\\n </if>\\n <else>\\n <text macro=\\\"title-and-part-title-note\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-and-part-title-bib\\\">\\n <group delimiter=\\\". \\\">\\n <text macro=\\\"title-primary\\\"/>\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"label-part-number-capitalized\\\"/>\\n <text macro=\\\"title-part\\\"/>\\n </group>\\n </group>\\n </macro>\\n <macro name=\\\"title-and-part-title-note\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"title-primary\\\"/>\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"label-part-number\\\"/>\\n <text macro=\\\"title-part\\\"/>\\n </group>\\n </group>\\n </macro>\\n <macro name=\\\"title-part\\\">\\n <choose>\\n <if type=\\\"patent\\\">\\n <!-- No italics or quotes, sentence case -->\\n <text form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"part-title\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"bill collection legislation regulation treaty\\\">\\n <!-- No italics or quotes, title case -->\\n <text text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else-if type=\\\"legal_case\\\">\\n <!-- Italicized, sentence case -->\\n <text font-style=\\\"italic\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"book classic graphic hearing map\\\">\\n <!-- Italicized, title case (regardless of `container-title`) -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else-if type=\\\"entry-encyclopedia\\\" variable=\\\"author container-title\\\">\\n <!-- Signed encyclopedia entry in quotes, title case (CMOS18 14.132) -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else-if type=\\\"entry-dictionary\\\" variable=\\\"container-title\\\">\\n <!-- Quotes, sentence case -->\\n <text quotes=\\\"true\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else-if type=\\\"entry-encyclopedia\\\" variable=\\\"container-title\\\">\\n <!-- Quotes, sentence case -->\\n <text quotes=\\\"true\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else-if type=\\\"post\\\">\\n <!-- Quotes, sentence case -->\\n <text quotes=\\\"true\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else-if type=\\\"webpage\\\">\\n <!-- Quotes, title case -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <!-- Other types are formatted based on presence of `container-title` -->\\n <else-if variable=\\\"container-title\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <!-- Quotes, title case -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <!-- Italics, title case -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <!-- Quotes, title case -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else>\\n <!-- monographic types -->\\n <!-- Italics, title case -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"article dataset document interview manuscript paper-conference personal_communication speech thesis webpage\\\">\\n <!-- Container-like but not necessarily with `container-title` -->\\n <!-- Quotes, title case -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else-if>\\n <else>\\n <!-- Italicized, title case (default) -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"part-title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-primary\\\">\\n <choose>\\n <if type=\\\"patent\\\">\\n <!-- No italics or quotes, sentence case -->\\n <text form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"title\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"bill collection legislation regulation treaty\\\">\\n <!-- No italics or quotes, title case -->\\n <text text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"legal_case\\\">\\n <!-- Italicized, sentence case -->\\n <text font-style=\\\"italic\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"book classic graphic hearing map\\\">\\n <!-- Italicized, title case (regardless of `container-title`) -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"entry-encyclopedia\\\" variable=\\\"author container-title\\\">\\n <!-- Signed encyclopedia entry in quotes, title case (CMOS18 14.132) -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"entry-dictionary\\\" variable=\\\"container-title\\\">\\n <!-- Quotes, sentence case -->\\n <text quotes=\\\"true\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"entry-encyclopedia\\\" variable=\\\"container-title\\\">\\n <!-- Quotes, sentence case -->\\n <text quotes=\\\"true\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"post\\\">\\n <!-- Quotes, sentence case -->\\n <text quotes=\\\"true\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <!-- Other types are formatted based on presence of `container-title` -->\\n <else-if variable=\\\"container-title\\\">\\n <!-- Quotes, title case -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"article dataset document interview manuscript paper-conference personal_communication speech thesis webpage\\\">\\n <!-- Container-like but not necessarily with `container-title` -->\\n <!-- Quotes, title case -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else>\\n <!-- Italicized, title case (default) -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-primary-short\\\">\\n <choose>\\n <if type=\\\"patent\\\">\\n <!-- No italics or quotes, sentence case -->\\n <text form=\\\"short\\\" text-case=\\\"capitalize-first\\\" variable=\\\"title\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"bill collection legislation regulation treaty\\\">\\n <!-- No italics or quotes, title case -->\\n <text form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"legal_case\\\">\\n <!-- Italicized, sentence case -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"book classic graphic hearing map\\\">\\n <!-- Italicized, title case (regardless of `container-title`) -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"entry-encyclopedia\\\" variable=\\\"author container-title\\\">\\n <!-- Signed encyclopedia entry in quotes, title case (CMOS18 14.132) -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"entry-dictionary\\\" variable=\\\"container-title\\\">\\n <!-- Quotes, sentence case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"entry-encyclopedia\\\" variable=\\\"container-title\\\">\\n <!-- Quotes, sentence case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if type=\\\"post\\\">\\n <!-- Quotes, sentence case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <!-- Other types are formatted based on presence of `container-title` -->\\n <else-if variable=\\\"container-title\\\">\\n <!-- Quotes, title case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"article dataset document interview manuscript paper-conference personal_communication speech thesis webpage\\\">\\n <!-- Container-like but not necessarily with `container-title` -->\\n <!-- Quotes, title case -->\\n <text form=\\\"short\\\" quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else-if>\\n <else>\\n <!-- Italicized, title case (default) -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"title-volume\\\">\\n <choose>\\n <if type=\\\"manuscript\\\">\\n <!-- Quotes, title case -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"volume-title\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <!-- Quotes, title case -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"volume-title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <!-- Italics, title case -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"volume-title\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <!-- Quotes, title case -->\\n <text quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"volume-title\\\"/>\\n </else-if>\\n <else>\\n <!-- monographic types -->\\n <!-- Italics, title case -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"volume-title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- 3.2. Description -->\\n <macro name=\\\"description-bib\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"interview\\\" variable=\\\"interviewer\\\">\\n <text macro=\\\"description-interview-bib\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <text macro=\\\"description-review-bib\\\"/>\\n </else-if>\\n <else-if type=\\\"personal_communication\\\">\\n <text macro=\\\"description-letter-bib\\\"/>\\n </else-if>\\n <else-if type=\\\"song\\\" variable=\\\"composer\\\">\\n <text macro=\\\"description-song-bib\\\"/>\\n </else-if>\\n <!-- thesis type appears with university name (CMOS18 14.113) -->\\n <else-if type=\\\"thesis\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <text macro=\\\"description-serial-bib\\\"/>\\n </else-if>\\n <else-if type=\\\"paper-conference\\\">\\n <text macro=\\\"description-paper-conference-bib\\\"/>\\n </else-if>\\n <else-if match=\\\"none\\\" variable=\\\"container-title\\\">\\n <text macro=\\\"description-format-bib\\\"/>\\n </else-if>\\n <!-- For conference presentations/performances/events, chapters in reports/standards/generic documents, software, place description within the source element -->\\n <else-if match=\\\"any\\\" type=\\\"document report software standard\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"event paper-conference performance speech\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director issue page supplement-number volume\\\">\\n <text macro=\\\"description-format-bib\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else>\\n <text macro=\\\"description-format-bib\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-note\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"interview\\\" variable=\\\"interviewer\\\">\\n <text macro=\\\"description-interview-note\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <text macro=\\\"description-review-note\\\"/>\\n </else-if>\\n <else-if type=\\\"personal_communication\\\">\\n <text macro=\\\"description-letter-note\\\"/>\\n </else-if>\\n <else-if type=\\\"song\\\" variable=\\\"composer\\\">\\n <text macro=\\\"description-song-note\\\"/>\\n </else-if>\\n <!-- thesis type appears with university name (CMOS18 14.113) -->\\n <else-if type=\\\"thesis\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <text macro=\\\"description-serial-note\\\"/>\\n </else-if>\\n <else-if type=\\\"paper-conference\\\">\\n <text macro=\\\"description-paper-conference-note\\\"/>\\n </else-if>\\n <else-if match=\\\"none\\\" variable=\\\"container-title\\\">\\n <text macro=\\\"description-format-note\\\"/>\\n </else-if>\\n <!-- For conference presentations/performances/events, chapters in reports/standards/generic documents, software, place description within the source element -->\\n <else-if match=\\\"any\\\" type=\\\"document report software standard\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"event paper-conference performance speech\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director issue page supplement-number volume\\\">\\n <text macro=\\\"description-format-note\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else>\\n <text macro=\\\"description-format-note\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-short\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"interview\\\" variable=\\\"interviewer\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\">\\n <text macro=\\\"description-interview-short\\\"/>\\n </if>\\n <else>\\n <!-- for an inaccessible `interview`, give a full in-text description at the first citation -->\\n <choose>\\n <if position=\\\"first\\\">\\n <text macro=\\\"description-interview-note\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"description-interview-short\\\"/>\\n </else>\\n </choose>\\n </else>\\n </choose>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <text macro=\\\"description-review-short\\\"/>\\n </else-if>\\n <else-if type=\\\"personal_communication\\\">\\n <text macro=\\\"description-letter-short\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <text macro=\\\"description-serial-short\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"description-format-short\\\"/>\\n </else-if>\\n <else-if type=\\\"paper-conference\\\">\\n <!-- serial `paper-conference` -->\\n <text macro=\\\"description-serial-short\\\"/>\\n </else-if>\\n <else>\\n <!-- monographic types -->\\n <text macro=\\\"description-format-short\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- Description elements -->\\n <macro name=\\\"description-format-bib\\\">\\n <choose>\\n <if variable=\\\"genre number\\\"/>\\n <else-if variable=\\\"genre\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n </else-if>\\n <!-- generic labels if unpublished -->\\n <else-if match=\\\"any\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\"/>\\n <else-if type=\\\"manuscript\\\">\\n <!-- 'unpublished manuscript' if no `genre` (CMOS18 14.114) -->\\n <text term=\\\"manuscript\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if type=\\\"personal_communication\\\">\\n <!-- 'personal communication' if no `genre` (CMOS18 14.111) -->\\n <text term=\\\"personal-communication\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"description-format-note\\\">\\n <choose>\\n <if variable=\\\"genre number\\\"/>\\n <else-if variable=\\\"genre\\\">\\n <text variable=\\\"genre\\\"/>\\n </else-if>\\n <!-- generic labels if unpublished -->\\n <else-if match=\\\"any\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\"/>\\n <else-if type=\\\"manuscript\\\">\\n <!-- 'unpublished manuscript' if no `genre` (CMOS18 14.114) -->\\n <text term=\\\"manuscript\\\"/>\\n </else-if>\\n <else-if type=\\\"personal_communication\\\">\\n <!-- 'personal communication' if no `genre` (CMOS18 14.111) -->\\n <text term=\\\"personal-communication\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"description-format-short\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"chapter\\\" variable=\\\"container-title genre\\\">\\n <!-- untitled introductions: cf. review model, which includes a title (CMOS18 14.101) -->\\n <text form=\\\"short\\\" variable=\\\"genre\\\"/>\\n <choose>\\n <if match=\\\"none\\\" position=\\\"ibid ibid-with-locator\\\">\\n <!-- CMOS team suggests leaving out title in repeated references -->\\n <text macro=\\\"source-monographic-preposition-note\\\"/>\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </if>\\n </choose>\\n </if>\\n <else-if type=\\\"article-journal\\\" variable=\\\"container-title genre volume-title\\\">\\n <!-- untitled introduction to a special issue or supplement -->\\n <text form=\\\"short\\\" variable=\\\"genre\\\"/>\\n <choose>\\n <if match=\\\"none\\\" position=\\\"ibid ibid-with-locator\\\">\\n <text macro=\\\"source-monographic-preposition-note\\\"/>\\n <text form=\\\"short\\\" quotes=\\\"true\\\" text-case=\\\"title\\\" variable=\\\"volume-title\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else-if variable=\\\"genre\\\">\\n <text form=\\\"short\\\" variable=\\\"genre\\\"/>\\n </else-if>\\n <else-if variable=\\\"medium\\\">\\n <text form=\\\"short\\\" variable=\\\"medium\\\"/>\\n </else-if>\\n <else-if variable=\\\"chapter-number container-title\\\">\\n <text macro=\\\"source-monographic-preposition-note\\\"/>\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </else-if>\\n <else-if variable=\\\"chapter-number\\\">\\n <text macro=\\\"label-chapter-number\\\"/>\\n </else-if>\\n <!-- generic labels if unpublished -->\\n <else-if match=\\\"any\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\"/>\\n <else-if type=\\\"manuscript\\\">\\n <!-- 'unpublished manuscript' if no `genre` (CMOS18 14.114) -->\\n <text term=\\\"manuscript\\\"/>\\n </else-if>\\n <else-if type=\\\"personal_communication\\\">\\n <!-- 'pers. comm.' if no `genre` (CMOS18 14.111) -->\\n <text form=\\\"short\\\" term=\\\"personal-communication\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"description-interview-bib\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"genre number\\\">\\n <!-- `genre` printed with `number` -->\\n <names variable=\\\"interviewer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n <else-if variable=\\\"genre\\\">\\n <group delimiter=\\\" \\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n <group delimiter=\\\" \\\">\\n <text form=\\\"verb\\\" term=\\\"container-author\\\"/>\\n <names variable=\\\"interviewer\\\">\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </group>\\n </group>\\n </else-if>\\n <else-if variable=\\\"interviewer\\\">\\n <names variable=\\\"interviewer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </else-if>\\n <else>\\n <text macro=\\\"description-format-bib\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"source-event-place-first\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"description-interview-note\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"genre number\\\">\\n <!-- `genre` printed with `number` -->\\n <names variable=\\\"interviewer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n <else-if variable=\\\"genre\\\">\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"genre\\\"/>\\n <group delimiter=\\\" \\\">\\n <text form=\\\"verb\\\" term=\\\"container-author\\\"/>\\n <names variable=\\\"interviewer\\\">\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </group>\\n </group>\\n </else-if>\\n <else-if variable=\\\"interviewer\\\">\\n <names variable=\\\"interviewer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </else-if>\\n <else>\\n <text macro=\\\"description-format-note\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"source-event-place-first\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"description-interview-short\\\">\\n <choose>\\n <if disambiguate=\\\"true\\\">\\n <names variable=\\\"interviewer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" form=\\\"short\\\" initialize=\\\"true\\\"/>\\n <substitute>\\n <text macro=\\\"description-format-short\\\"/>\\n </substitute>\\n </names>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"genre medium\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\\\">\\n <text macro=\\\"description-format-short\\\"/>\\n </if>\\n <else>\\n <!-- capitalize if no author or title -->\\n <text macro=\\\"description-format-bib\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else>\\n <!-- generic description for an unpublished interview (CMOS18 14.108) -->\\n <text term=\\\"interview\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-letter-bib\\\">\\n <choose>\\n <if variable=\\\"recipient\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"genre number\\\">\\n <!-- `genre` appears with `number` -->\\n <names variable=\\\"recipient\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n <else-if variable=\\\"genre\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"description-format-bib\\\"/>\\n <names variable=\\\"recipient\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </group>\\n </else-if>\\n <else>\\n <names variable=\\\"recipient\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </else>\\n </choose>\\n <text variable=\\\"event-place\\\"/>\\n <text macro=\\\"date-event-full\\\"/>\\n </group>\\n </if>\\n <else>\\n <text macro=\\\"description-format-bib\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-letter-note\\\">\\n <choose>\\n <if variable=\\\"recipient\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"genre number\\\">\\n <!-- `genre` appears with `number` -->\\n <names variable=\\\"recipient\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n <else-if variable=\\\"genre\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"description-format-note\\\"/>\\n <names variable=\\\"recipient\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </group>\\n </else-if>\\n <else>\\n <names variable=\\\"recipient\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </else>\\n </choose>\\n <text variable=\\\"event-place\\\"/>\\n <text macro=\\\"date-event-full\\\"/>\\n </group>\\n </if>\\n <else>\\n <text macro=\\\"description-format-note\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-letter-short\\\">\\n <!-- shortened notes ideally give author, recipient, place, and date (CMOS18 14.13) -->\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"genre recipient\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"description-format-short\\\"/>\\n <names variable=\\\"recipient\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" form=\\\"short\\\" initialize=\\\"true\\\"/>\\n </names>\\n </group>\\n </if>\\n <else>\\n <text macro=\\\"description-format-short\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"event-place\\\"/>\\n <choose>\\n <if variable=\\\"event-date\\\">\\n <text macro=\\\"date-event-full\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"date-issued-full\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"description-paper-conference-bib\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"description-format-bib\\\"/>\\n </if>\\n <else>\\n <!-- serial types -->\\n <group delimiter=\\\". \\\">\\n <text macro=\\\"description-serial-bib\\\"/>\\n <text macro=\\\"source-event-bib\\\"/>\\n </group>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-paper-conference-note\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"description-format-bib\\\"/>\\n </if>\\n <else>\\n <!-- serial types -->\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"description-serial-note\\\"/>\\n <text macro=\\\"source-event-note\\\"/>\\n </group>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-review-bib\\\">\\n <!-- Reviewed item -->\\n <group delimiter=\\\". \\\">\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"description-review-genre-bib\\\"/>\\n <text macro=\\\"description-review-title\\\"/>\\n </group>\\n <choose>\\n <if variable=\\\"reviewed-genre reviewed-title title\\\">\\n <names variable=\\\"reviewed-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n <else-if variable=\\\"reviewed-genre\\\"/>\\n <else>\\n <names variable=\\\"reviewed-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </else>\\n </choose>\\n <text macro=\\\"source-event-place-first\\\"/>\\n </group>\\n <text macro=\\\"label-section-capitalized\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"description-review-note\\\">\\n <!-- Reviewed item -->\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"description-review-genre-note\\\"/>\\n <text macro=\\\"description-review-title\\\"/>\\n </group>\\n <choose>\\n <if variable=\\\"reviewed-genre reviewed-title title\\\">\\n <names variable=\\\"reviewed-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n <else-if variable=\\\"reviewed-genre\\\"/>\\n <else>\\n <names variable=\\\"reviewed-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </else>\\n </choose>\\n <text macro=\\\"source-event-place-first\\\"/>\\n </group>\\n <text macro=\\\"label-section\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"description-review-genre-bib\\\">\\n <choose>\\n <if variable=\\\"reviewed-genre\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"description-review-term-unsigned-bib\\\"/>\\n <text variable=\\\"reviewed-genre\\\"/>\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"reviewed-title\\\">\\n <names variable=\\\"reviewed-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n </group>\\n </if>\\n <else-if variable=\\\"number\\\">\\n <text macro=\\\"description-review-term-unsigned-bib\\\"/>\\n </else-if>\\n <!-- If no `reviewed-genre`, assume that `genre` is entered as 'Review of the book' or similar -->\\n <else-if variable=\\\"genre\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"description-review-term-unsigned-bib\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-review-genre-note\\\">\\n <choose>\\n <if variable=\\\"reviewed-genre\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"description-review-term-unsigned-note\\\"/>\\n <text variable=\\\"reviewed-genre\\\"/>\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"reviewed-title\\\">\\n <names variable=\\\"reviewed-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n </group>\\n </if>\\n <else-if variable=\\\"number\\\">\\n <text macro=\\\"description-review-term-unsigned-note\\\"/>\\n </else-if>\\n <!-- If no `reviewed-genre`, assume that `genre` is entered as 'Review of the book' or similar -->\\n <else-if variable=\\\"genre\\\">\\n <text variable=\\\"genre\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"description-review-term-unsigned-note\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-review-short\\\">\\n <choose>\\n <if match=\\\"any\\\" position=\\\"ibid ibid-with-locator\\\">\\n <text term=\\\"review\\\"/>\\n </if>\\n <else>\\n <group delimiter=\\\" \\\">\\n <text term=\\\"review-of\\\"/>\\n <text macro=\\\"description-review-title-short\\\"/>\\n </group>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-review-term-unsigned-bib\\\">\\n <!-- Anonymous reviews appear as 'unsigned' (CMOS18 14.102) -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\\\">\\n <text term=\\\"review-of\\\" text-case=\\\"capitalize-first\\\"/>\\n </if>\\n <else>\\n <group delimiter=\\\" \\\">\\n <text term=\\\"anonymous\\\" text-case=\\\"capitalize-first\\\"/>\\n <text term=\\\"review-of\\\"/>\\n </group>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-review-term-unsigned-note\\\">\\n <!-- Anonymous reviews appear as 'unsigned' (CMOS18 14.102) -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\\\">\\n <text term=\\\"review-of\\\"/>\\n </if>\\n <else>\\n <group delimiter=\\\" \\\">\\n <text term=\\\"anonymous\\\"/>\\n <text term=\\\"review-of\\\"/>\\n </group>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-review-title\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"reviewed-genre reviewed-title\\\">\\n <!-- Not possible to distinguish TV series episode from other reviewed works without a reviewed source title -->\\n <!-- Adapt for `reviewed-container-title` or similar if it becomes available -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"reviewed-title\\\"/>\\n </if>\\n <else>\\n <!-- Assume title is title of reviewed work -->\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-review-title-short\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"reviewed-genre reviewed-title\\\">\\n <!-- Not possible to distinguish TV series episode from other reviewed works without a reviewed source title -->\\n <!-- Adapt for `reviewed-container-title` or similar if it becomes available -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"reviewed-title\\\"/>\\n </if>\\n <else>\\n <!-- Assume title is title of reviewed work -->\\n <text font-style=\\\"italic\\\" form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-serial-bib\\\">\\n <group delimiter=\\\". \\\">\\n <text macro=\\\"description-format-bib\\\"/>\\n <!-- `section` provides magazine departments (CMOS18 14.88) and newspaper column names (CMOS18 14.93) -->\\n <text macro=\\\"label-section-capitalized\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"description-serial-note\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"description-format-note\\\"/>\\n <!-- `section` provides magazine departments (CMOS18 14.88) and newspaper column names (CMOS18 14.93) -->\\n <text macro=\\\"label-section\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"description-serial-short\\\">\\n <choose>\\n <if variable=\\\"title\\\"/>\\n <else-if variable=\\\"genre\\\">\\n <text macro=\\\"description-format-short\\\"/>\\n </else-if>\\n <else>\\n <text form=\\\"short\\\" text-case=\\\"title\\\" variable=\\\"section\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"description-song-bib\\\">\\n <!-- Performer of classical music works -->\\n <!-- TODO: remove when Zotero fixes mapping of performer to `author` -->\\n <group delimiter=\\\" \\\">\\n <!-- Based on `description-format` macro -->\\n <choose>\\n <if variable=\\\"genre\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n <text form=\\\"verb\\\" term=\\\"performer\\\"/>\\n </if>\\n <!-- providing 'performed by' label for recorded readings (CMOS18 14.164), but it should be omitted for classical music (CMOS18 14.163) -->\\n <else>\\n <text form=\\\"verb\\\" term=\\\"performer\\\" text-case=\\\"capitalize-first\\\"/>\\n </else>\\n </choose>\\n <names variable=\\\"author\\\">\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n <substitute>\\n <names variable=\\\"performer\\\"/>\\n </substitute>\\n </names>\\n </group>\\n </macro>\\n <macro name=\\\"description-song-note\\\">\\n <!-- Performer of classical music works -->\\n <!-- TODO: remove when Zotero fixes mapping of performer to `author` -->\\n <group delimiter=\\\" \\\">\\n <!-- Based on `description-format` macro -->\\n <choose>\\n <if variable=\\\"genre\\\">\\n <text variable=\\\"genre\\\"/>\\n <text form=\\\"verb\\\" term=\\\"performer\\\"/>\\n </if>\\n <!-- providing 'performed by' label for recorded readings (CMOS18 14.164), but it should be omitted for classical music (CMOS18 14.163) -->\\n <else>\\n <text form=\\\"verb\\\" term=\\\"performer\\\"/>\\n </else>\\n </choose>\\n <names variable=\\\"author\\\">\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n <substitute>\\n <names variable=\\\"performer\\\"/>\\n </substitute>\\n </names>\\n </group>\\n </macro>\\n <!-- 3.3. Identifier (edition, contributors, volume) -->\\n <macro name=\\\"identifier-bib\\\">\\n <group delimiter=\\\". \\\">\\n <choose>\\n <if type=\\\"patent\\\">\\n <text macro=\\\"identifier-patent\\\"/>\\n </if>\\n <else-if type=\\\"report\\\">\\n <text macro=\\\"identifier-report-bib\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"post webpage\\\">\\n <!-- print `container-title` on `post` or `webpage` in the same way as `publisher` (CMOS18 14.104-106) -->\\n <text macro=\\\"identifier-number-bib\\\"/>\\n <text macro=\\\"label-version-capitalized\\\"/>\\n <text macro=\\\"identifier-edition-bib\\\"/>\\n <text macro=\\\"identifier-contributors-bib\\\"/>\\n </else-if>\\n <else-if variable=\\\"container-title\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"broadcast graphic map motion_picture\\\">\\n <!-- For audiovisual media, number information comes after `title`, not `container-title`; `song` places album catalogue `number` with `publisher` (CMOS18 14.163-164) -->\\n <text macro=\\\"identifier-number-bib\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"identifier-contributors-bib\\\"/>\\n </else-if>\\n <else>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"song\\\">\\n <text macro=\\\"identifier-number-bib\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"label-version-capitalized\\\"/>\\n <text macro=\\\"identifier-edition-bib\\\"/>\\n <text macro=\\\"identifier-contributors-and-volume-bib\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-note\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if type=\\\"patent\\\">\\n <text macro=\\\"identifier-patent\\\"/>\\n </if>\\n <else-if type=\\\"report\\\">\\n <text macro=\\\"identifier-report-note\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"post webpage\\\">\\n <!-- print `container-title` on `post` or `webpage` in the same way as `publisher` (CMOS18 14.104-106) -->\\n <text macro=\\\"identifier-number-note\\\"/>\\n <text macro=\\\"label-version\\\"/>\\n <text macro=\\\"identifier-edition-note\\\"/>\\n <text macro=\\\"identifier-contributors-note\\\"/>\\n </else-if>\\n <else-if variable=\\\"container-title\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"broadcast graphic map motion_picture\\\">\\n <!-- For audiovisual media, number information comes after `title`, not `container-title`; `song` places album catalogue `number` with `publisher` (CMOS18 14.163-164) -->\\n <text macro=\\\"identifier-number-note\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"identifier-contributors-note\\\"/>\\n </else-if>\\n <else>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"song\\\">\\n <text macro=\\\"identifier-number-note\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"label-version\\\"/>\\n <text macro=\\\"identifier-edition-note\\\"/>\\n <text macro=\\\"identifier-contributors-and-volume-note\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- Identifier elements -->\\n <macro name=\\\"identifier-contributors-bib\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <text macro=\\\"identifier-contributors-serial-bib\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <text macro=\\\"identifier-contributors-monographic-bib\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <text macro=\\\"identifier-contributors-serial-bib\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"identifier-contributors-monographic-bib\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"identifier-contributors-note\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <text macro=\\\"identifier-contributors-serial-note\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <text macro=\\\"identifier-contributors-monographic-note\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <text macro=\\\"identifier-contributors-serial-note\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"identifier-contributors-monographic-note\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"identifier-contributors-monographic-bib\\\">\\n <group delimiter=\\\". \\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"post webpage\\\">\\n <names variable=\\\"container-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"editor-translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"editor translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"editorial-director\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"guest\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"host\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"illustrator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"narrator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"compiler chair organizer curator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"series-creator executive-producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"director\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"broadcast performance\\\">\\n <names variable=\\\"script-writer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n <names variable=\\\"performer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"thesis\\\">\\n <names variable=\\\"contributor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n </if>\\n <else>\\n <!-- print `container-title` on `post` or `webpage` in the same way as `publisher` (CMOS18 14.104-106) -->\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"container-title\\\">\\n <names variable=\\\"container-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"editor-translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"editor translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"editorial-director\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"guest\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"host\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n <names variable=\\\"illustrator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"narrator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"container-title\\\">\\n <names delimiter=\\\". \\\" variable=\\\"compiler chair organizer curator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"series-creator executive-producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"director\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"broadcast performance\\\">\\n <names variable=\\\"script-writer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n <names variable=\\\"performer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"song thesis\\\">\\n <names variable=\\\"contributor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n </if>\\n </choose>\\n <choose>\\n <if type=\\\"song\\\">\\n <!-- Song contributors attached to album (CMOS18 14.163) -->\\n <names variable=\\\"contributor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-contributors-monographic-bib-multivolume\\\">\\n <!-- lowercase for attachment to volume; otherwise identical to `identifier-contributors-monographic-bib` -->\\n <group delimiter=\\\", \\\">\\n <!-- print `container-title` on `post` or `webpage` in the same way as `publisher` (CMOS18 14.104-106) -->\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"container-title\\\">\\n <names variable=\\\"container-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"editor-translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"editor translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"editorial-director\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"guest\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"host\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n <names variable=\\\"illustrator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"narrator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"container-title\\\">\\n <names delimiter=\\\", \\\" variable=\\\"compiler chair organizer curator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"series-creator executive-producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"director\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"broadcast performance\\\">\\n <names variable=\\\"script-writer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n <names variable=\\\"performer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"song thesis\\\">\\n <names variable=\\\"contributor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n </if>\\n </choose>\\n <choose>\\n <if type=\\\"song\\\">\\n <!-- Song contributors attached to album (CMOS18 14.163) -->\\n <names variable=\\\"contributor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-contributors-monographic-note\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"post webpage\\\">\\n <names variable=\\\"container-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"editor-translator\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"editor translator\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"editorial-director\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"guest\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"host\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"illustrator\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"narrator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"compiler\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"chair organizer curator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"series-creator executive-producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"producer\\\">\\n <!-- not abbreviated (CMOS18 14.168) -->\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"director\\\">\\n <!-- `director` is not abbreviated (CMOS18 14.165) -->\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"broadcast performance\\\">\\n <names variable=\\\"script-writer\\\">\\n <!-- `script-writer` is not abbreviated (CMOS18 14.165) -->\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n <names variable=\\\"performer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"thesis\\\">\\n <names variable=\\\"contributor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n </if>\\n <else>\\n <!-- print `container-title` on `post` or `webpage` in the same way as `publisher` (CMOS18 14.104-106) -->\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"container-title\\\">\\n <names variable=\\\"container-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"editor-translator\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"editor translator\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"editorial-director\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"guest\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"host\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n <names delimiter=\\\", \\\" variable=\\\"illustrator\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"narrator\\\">\\n <!-- narrator is not abbreviated (CMOS18 14.58) -->\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"container-title\\\">\\n <names variable=\\\"compiler\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"chair organizer curator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"series-creator executive-producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"producer\\\">\\n <!-- not abbreviated (CMOS18 14.168) -->\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"director\\\">\\n <!-- `director` is not abbreviated (CMOS18 14.165) -->\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"broadcast performance\\\">\\n <names variable=\\\"script-writer\\\">\\n <!-- `script-writer` is not abbreviated (CMOS18 14.165) -->\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n <names variable=\\\"performer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"song thesis\\\">\\n <names variable=\\\"contributor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n </if>\\n </choose>\\n <choose>\\n <if type=\\\"song\\\">\\n <!-- Song contributors attached to album (CMOS18 14.163) -->\\n <names variable=\\\"contributor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-contributors-serial-bib\\\">\\n <group delimiter=\\\". \\\">\\n <names delimiter=\\\". \\\" variable=\\\"translator narrator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"compiler chair organizer curator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"series-creator executive-producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"director\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"script-writer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"performer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-contributors-serial-note\\\">\\n <group delimiter=\\\", \\\">\\n <names variable=\\\"translator\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"narrator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"compiler chair organizer curator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"series-creator executive-producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"producer\\\">\\n <!-- not abbreviated (CMOS18 14.168) -->\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"director\\\">\\n <!-- `director` is not abbreviated (CMOS18 14.165) -->\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"script-writer\\\">\\n <!-- `script-writer` is not abbreviated (CMOS18 14.165) -->\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"performer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-contributors-and-volume-bib\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <text macro=\\\"identifier-contributors-serial-bib\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"identifier-contributors-and-volume-monographic-bib\\\"/>\\n <!-- for author-date or notes and bibliography leading with volume title (CMOS18 14.21): -->\\n <!-- <text macro=\\\"identifier-contributors-and-volume-monographic-bib-specific-title-first\\\"/> -->\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <text macro=\\\"identifier-contributors-serial-bib\\\"/>\\n </else-if>\\n <else>\\n <!-- monographic types -->\\n <text macro=\\\"identifier-contributors-and-volume-monographic-bib\\\"/>\\n <!-- for author-date or notes and bibliography leading with volume title (CMOS18 14.21): -->\\n <!-- <text macro=\\\"identifier-contributors-and-volume-monographic-bib-specific-title-first\\\"/> -->\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"identifier-contributors-and-volume-note\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <text macro=\\\"identifier-contributors-serial-note\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"identifier-contributors-and-volume-monographic-note\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <text macro=\\\"identifier-contributors-serial-note\\\"/>\\n </else-if>\\n <else>\\n <!-- monographic types -->\\n <text macro=\\\"identifier-contributors-and-volume-monographic-note\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"identifier-contributors-and-volume-monographic-bib\\\">\\n <group delimiter=\\\". \\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"number-of-volumes part-number part-title volume volume-title\\\">\\n <!-- cite multivolume `collection-editor`; otherwise it belongs with `collection-title` -->\\n <names variable=\\\"collection-editor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"identifier-volume-bib\\\"/>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"part-number part-title volume volume-title\\\">\\n <text macro=\\\"identifier-contributors-monographic-bib-multivolume\\\"/>\\n </if>\\n </choose>\\n </group>\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"part-number part-title volume volume-title\\\">\\n <text macro=\\\"identifier-contributors-monographic-bib\\\"/>\\n <text macro=\\\"label-number-of-volumes\\\"/>\\n </if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-contributors-and-volume-monographic-note\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"number-of-volumes part-number part-title volume volume-title\\\">\\n <!-- cite multivolume `collection-editor`; otherwise it belongs with `collection-title` -->\\n <names variable=\\\"collection-editor\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n <text macro=\\\"identifier-volume-note\\\"/>\\n <text macro=\\\"identifier-contributors-note\\\"/>\\n <choose>\\n <!-- notes only show the number of volumes if there is no physical locator, which should include a volume number, e.g. 4:243 -->\\n <if match=\\\"any\\\" variable=\\\"part-number part-title volume volume-title\\\"/>\\n <else-if locator=\\\"column\\\"/>\\n <else-if locator=\\\"folio\\\"/>\\n <else-if locator=\\\"page\\\"/>\\n <else>\\n <text macro=\\\"label-number-of-volumes\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-edition-bib\\\">\\n <choose>\\n <!-- ensure `source-publication-history-bib` does not duplicate edition -->\\n <if variable=\\\"original-title\\\">\\n <text macro=\\\"label-edition-capitalized\\\"/>\\n </if>\\n <else-if variable=\\\"issued original-date\\\"/>\\n <else>\\n <text macro=\\\"label-edition-capitalized\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"identifier-edition-note\\\">\\n <choose>\\n <!-- ensure `source-publication-history-note` does not duplicate edition -->\\n <if variable=\\\"original-title\\\">\\n <text macro=\\\"label-edition\\\"/>\\n </if>\\n <else-if variable=\\\"issued original-date\\\"/>\\n <else>\\n <text macro=\\\"label-edition\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"identifier-number-bib\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"thesis\\\"/>\\n <else-if is-numeric=\\\"number\\\" type=\\\"broadcast\\\" variable=\\\"genre\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n <text variable=\\\"number\\\"/>\\n </else-if>\\n <else-if is-numeric=\\\"number\\\" type=\\\"broadcast\\\">\\n <text text-case=\\\"capitalize-first\\\" value=\\\"episode\\\"/>\\n <text variable=\\\"number\\\"/>\\n </else-if>\\n <else-if variable=\\\"number\\\">\\n <text text-case=\\\"title\\\" variable=\\\"genre\\\"/>\\n <text macro=\\\"label-number-capitalized\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-number-note\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"thesis\\\"/>\\n <else-if is-numeric=\\\"number\\\" type=\\\"broadcast\\\" variable=\\\"genre\\\">\\n <text variable=\\\"genre\\\"/>\\n <text variable=\\\"number\\\"/>\\n </else-if>\\n <else-if is-numeric=\\\"number\\\" type=\\\"broadcast\\\">\\n <text value=\\\"episode\\\"/>\\n <text variable=\\\"number\\\"/>\\n </else-if>\\n <else-if variable=\\\"number\\\">\\n <text variable=\\\"genre\\\"/>\\n <text macro=\\\"label-number\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-patent\\\">\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <!-- `authority`: US ; `genre`: patent ; `number`: 123,445 -->\\n <text form=\\\"short\\\" variable=\\\"authority\\\"/>\\n <!-- 'US Patent' capitalized in both bibliography and note forms -->\\n <choose>\\n <if variable=\\\"genre\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n </if>\\n <else>\\n <text term=\\\"patent\\\" text-case=\\\"capitalize-first\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"number\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <text value=\\\"filed\\\"/>\\n <date form=\\\"text\\\" variable=\\\"submitted\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if variable=\\\"issued submitted\\\">\\n <text term=\\\"and\\\"/>\\n </if>\\n </choose>\\n <text value=\\\"issued\\\"/>\\n <!-- Always give full issue date, even in author-date (CMOS18 14.158) -->\\n <text macro=\\\"date-issued-full\\\"/>\\n </group>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-report-bib\\\">\\n <group delimiter=\\\". \\\">\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <!-- If the report is a chapter in a larger report, then most identifying information is printed in the source. -->\\n <text macro=\\\"identifier-contributors-bib\\\"/>\\n </if>\\n <else-if variable=\\\"title\\\">\\n <text macro=\\\"identifier-number-bib\\\"/>\\n <text macro=\\\"label-version-capitalized\\\"/>\\n <text macro=\\\"identifier-edition-bib\\\"/>\\n <text macro=\\\"identifier-contributors-and-volume-bib\\\"/>\\n </else-if>\\n <else>\\n <!-- If there is no `title`, then `genre` and `number` are already printed as the title. -->\\n <text macro=\\\"label-version-capitalized\\\"/>\\n <text macro=\\\"identifier-edition-bib\\\"/>\\n <text macro=\\\"identifier-contributors-and-volume-bib\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-report-note\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <!-- If the report is a chapter in a larger report, then most identifying information is printed in the source. -->\\n <text macro=\\\"identifier-contributors-note\\\"/>\\n </if>\\n <else-if variable=\\\"title\\\">\\n <text macro=\\\"identifier-number-note\\\"/>\\n <text macro=\\\"label-version\\\"/>\\n <text macro=\\\"identifier-edition-note\\\"/>\\n <text macro=\\\"identifier-contributors-and-volume-note\\\"/>\\n </else-if>\\n <else>\\n <!-- If there is no `title`, then `genre` and `number` are already printed as the title. -->\\n <text macro=\\\"label-version\\\"/>\\n <text macro=\\\"identifier-edition-note\\\"/>\\n <text macro=\\\"identifier-contributors-and-volume-note\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-volume-bib\\\">\\n <!-- In notes styles, bibliography entries may be listed beginning with either the general title of the multivolume set or that of the individual volume; the former approach is listed first, but the latter is required in author-date (CMOS18 14.21) -->\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"volume volume-title\\\">\\n <!-- if there is a volume or volume title, the part number is not capitalized -->\\n <text macro=\\\"label-volume-capitalized\\\"/>\\n <text macro=\\\"title-volume\\\"/>\\n <text macro=\\\"label-part-number\\\"/>\\n <text macro=\\\"title-part\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"part-number part-title\\\">\\n <text macro=\\\"label-part-number-capitalized\\\"/>\\n <text macro=\\\"title-part\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"identifier-volume-note\\\">\\n <!-- List the general title first in the notes (CMOS18 14.20) -->\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"part-number part-title volume-title\\\">\\n <text macro=\\\"label-volume\\\"/>\\n <text macro=\\\"title-volume\\\"/>\\n <text macro=\\\"label-part-number\\\"/>\\n <text macro=\\\"title-part\\\"/>\\n </if>\\n <else-if is-numeric=\\\"volume\\\" locator=\\\"page\\\">\\n <!-- provide lone `volume` only if it does not appear in `source-monographic-locator-note` (CMOS18 14.20) -->\\n <choose>\\n <!-- check for variables that might come between the volume and page number -->\\n <if match=\\\"any\\\" variable=\\\"part-number part-title volume-title\\\">\\n <text macro=\\\"label-volume\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"container-author editor editor-translator translator\\\">\\n <text macro=\\\"label-volume\\\"/>\\n </else-if>\\n </choose>\\n </else-if>\\n <else-if is-numeric=\\\"volume\\\" variable=\\\"page\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"part-number part-title volume-title\\\">\\n <text macro=\\\"label-volume\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"container-author editor editor-translator translator\\\">\\n <text macro=\\\"label-volume\\\"/>\\n </else-if>\\n <else-if variable=\\\"container-title\\\">\\n <!-- remove condition in styles that print chapter page numbers (CMOS17/classic) -->\\n <text macro=\\\"label-volume\\\"/>\\n </else-if>\\n </choose>\\n </else-if>\\n <else-if variable=\\\"volume\\\">\\n <text macro=\\\"label-volume\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <!-- 4. Source -->\\n <macro name=\\\"source-bib\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"patent post webpage\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <text macro=\\\"source-serial-bib\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <text macro=\\\"source-monographic-bib\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <text macro=\\\"source-serial-bib\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"source-monographic-bib\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-note\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"patent post webpage\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <text macro=\\\"source-serial-note\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <text macro=\\\"source-monographic-note\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <text macro=\\\"source-serial-note\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"source-monographic-note\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- 4.1. Serial sources -->\\n <macro name=\\\"source-serial-bib\\\">\\n <group delimiter=\\\". \\\">\\n <text macro=\\\"source-serial-title-volume-bib\\\"/>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-magazine article-newspaper\\\">\\n <!-- magazines and newspapers provide the full date in place of volume/issue numbers (CMOS18 14.87, 14.89) -->\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-serial-title-bib\\\"/>\\n <text macro=\\\"source-serial-identifier-bib\\\"/>\\n </group>\\n </if>\\n <else-if variable=\\\"collection-title volume\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-serial-title-bib\\\"/>\\n <text macro=\\\"source-serial-identifier-bib\\\"/>\\n </group>\\n </else-if>\\n <else-if variable=\\\"volume\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"source-serial-title-bib\\\"/>\\n <text macro=\\\"source-serial-identifier-bib\\\"/>\\n </group>\\n </else-if>\\n <else>\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-serial-title-bib\\\"/>\\n <text macro=\\\"source-serial-identifier-bib\\\"/>\\n </group>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-serial-note\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-serial-title-volume-note\\\"/>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-magazine article-newspaper\\\">\\n <!-- magazines and newspapers provide the full date in place of volume/issue numbers (CMOS18 14.87, 14.89) -->\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-serial-title-note\\\"/>\\n <text macro=\\\"source-serial-identifier-note\\\"/>\\n </group>\\n </if>\\n <else-if variable=\\\"collection-title volume\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-serial-title-note\\\"/>\\n <text macro=\\\"source-serial-identifier-note\\\"/>\\n </group>\\n </else-if>\\n <else-if variable=\\\"volume\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"source-serial-title-note\\\"/>\\n <text macro=\\\"source-serial-identifier-note\\\"/>\\n </group>\\n </else-if>\\n <else>\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-serial-title-note\\\"/>\\n <text macro=\\\"source-serial-identifier-note\\\"/>\\n </group>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- Serial source title -->\\n <macro name=\\\"source-serial-name\\\">\\n <group delimiter=\\\" \\\">\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n <choose>\\n <!-- TODO: remove conditional when Zotero stops double-mapping `event-place` and `publisher-place` -->\\n <if match=\\\"none\\\" variable=\\\"event-date event-title\\\">\\n <text prefix=\\\"(\\\" suffix=\\\")\\\" variable=\\\"publisher-place\\\"/>\\n </if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-serial-title-bib\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <!-- Journal special issues (CMOS18 14.77) and supplements (CMOS18 14.78) -->\\n <if match=\\\"none\\\" variable=\\\"container-title\\\"/>\\n <else-if match=\\\"none\\\" type=\\\"periodical\\\" variable=\\\"supplement-number volume-title\\\"/>\\n <!-- TODO: use `container-genre` here once available to allow a custom description of the journal volume -->\\n <else-if variable=\\\"supplement-number volume-title\\\">\\n <text term=\\\"supplement\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if type=\\\"periodical\\\" variable=\\\"supplement-number title\\\">\\n <text term=\\\"supplement\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if variable=\\\"volume-title\\\">\\n <text term=\\\"special-issue\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if type=\\\"periodical\\\" variable=\\\"title\\\">\\n <text term=\\\"special-issue\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n </choose>\\n <text macro=\\\"source-serial-name\\\"/>\\n <choose>\\n <!-- 'ahead of print' is placed akin to a series (CMOS18 14.75) -->\\n <if match=\\\"any\\\" variable=\\\"collection-title issue number page supplement-number volume volume-title\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"available-date status\\\"/>\\n <else-if type=\\\"article-journal\\\" variable=\\\"DOI issued\\\">\\n <text term=\\\"advance-online-publication\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-serial-title-note\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <!-- Journal special issues (CMOS18 14.77) and supplements (CMOS18 14.78) -->\\n <if match=\\\"none\\\" variable=\\\"container-title\\\"/>\\n <else-if match=\\\"none\\\" type=\\\"periodical\\\" variable=\\\"supplement-number volume-title\\\"/>\\n <!-- TODO: use `container-genre` here once available to allow a custom description of the journal volume -->\\n <else-if variable=\\\"supplement-number volume-title\\\">\\n <text term=\\\"supplement\\\"/>\\n </else-if>\\n <else-if type=\\\"periodical\\\" variable=\\\"supplement-number title\\\">\\n <text term=\\\"supplement\\\"/>\\n </else-if>\\n <else-if variable=\\\"volume-title\\\">\\n <text term=\\\"special-issue\\\"/>\\n </else-if>\\n <else-if type=\\\"periodical\\\" variable=\\\"title\\\">\\n <text term=\\\"special-issue\\\"/>\\n </else-if>\\n </choose>\\n <text macro=\\\"source-serial-name\\\"/>\\n <choose>\\n <!-- 'ahead of print' is placed akin to a series (CMOS18 14.75) -->\\n <if match=\\\"any\\\" variable=\\\"collection-title issue number page supplement-number volume volume-title\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"available-date status\\\"/>\\n <else-if type=\\\"article-journal\\\" variable=\\\"DOI issued\\\">\\n <text term=\\\"advance-online-publication\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-serial-title-volume-bib\\\">\\n <choose>\\n <if variable=\\\"volume-title\\\">\\n <!-- Journal special issues (CMOS18 14.77) and supplements (CMOS18 14.78) -->\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"source-monographic-preposition-bib\\\"/>\\n <text macro=\\\"title-volume\\\"/>\\n </group>\\n <text macro=\\\"source-monographic-identifier-contributors-bib\\\"/>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-serial-title-volume-note\\\">\\n <choose>\\n <if variable=\\\"volume-title\\\">\\n <!-- Journal special issues (CMOS18 14.77) and supplements (CMOS18 14.78) -->\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"source-monographic-preposition-note\\\"/>\\n <text macro=\\\"title-volume\\\"/>\\n </group>\\n <text macro=\\\"source-monographic-identifier-contributors-note\\\"/>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <!-- Serial source identifier -->\\n <macro name=\\\"source-serial-identifier-bib\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-magazine article-newspaper\\\">\\n <group delimiter=\\\". \\\">\\n <text macro=\\\"source-serial-identifier-volume-bib\\\"/>\\n <!-- for author-date: -->\\n <!-- <text macro=\\\"source-serial-identifier-volume-author-date\\\"/> -->\\n <!-- newspaper edition always capitalized (CMOS18 14.89) -->\\n <text macro=\\\"label-edition-capitalized\\\"/>\\n </group>\\n <text macro=\\\"source-serial-locator\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"issue supplement-number volume\\\">\\n <group delimiter=\\\": \\\">\\n <text macro=\\\"source-serial-identifier-volume-bib\\\"/>\\n <!-- for author-date: -->\\n <!-- <text macro=\\\"source-serial-identifier-volume-author-date\\\"/> -->\\n <text macro=\\\"source-serial-locator\\\"/>\\n </group>\\n </else-if>\\n <else>\\n <text macro=\\\"source-serial-identifier-volume-bib\\\"/>\\n <!-- for author-date: -->\\n <!-- <text macro=\\\"source-serial-identifier-volume-author-date\\\"/> -->\\n <text macro=\\\"source-serial-locator\\\"/>\\n </else>\\n <!-- TODO: If CSL adds `date-part` detection, add two further conditions to address CMOS18 14.74: delimiting with \\\":\\\" if there is a `volume` and no month or `issue` or `supplement number`; delimiting with \\\", \\\" or there is an `issue` or `supplement number` and no month -->\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-serial-identifier-note\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-magazine article-newspaper\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-serial-identifier-volume-note\\\"/>\\n <!-- newspaper edition always capitalized (CMOS18 14.89) -->\\n <text macro=\\\"label-edition-capitalized\\\"/>\\n </group>\\n <text macro=\\\"source-serial-locator\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"issue supplement-number volume\\\">\\n <group delimiter=\\\": \\\">\\n <text macro=\\\"source-serial-identifier-volume-note\\\"/>\\n <text macro=\\\"source-serial-locator\\\"/>\\n </group>\\n </else-if>\\n <else>\\n <text macro=\\\"source-serial-identifier-volume-note\\\"/>\\n <text macro=\\\"source-serial-locator\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-serial-identifier-volume-bib\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-magazine article-newspaper\\\">\\n <!-- magazines and newspapers provide the full date in place of volume/issue numbers (CMOS18 14.87, 14.89) -->\\n <text variable=\\\"collection-title\\\"/>\\n <text macro=\\\"source-serial-volume-status-bib\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"issue supplement-number volume\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- date appears first if the review `container-title` has been substituted for a missing author (CMOS18 14.87, 14.102) -->\\n <text macro=\\\"source-date-issued-or-status\\\"/>\\n </else-if>\\n </choose>\\n <!-- `collection-title` is for any serial with multiple series (e.g. 'second series') -->\\n <text variable=\\\"collection-title\\\"/>\\n <group delimiter=\\\" \\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"collection-title volume\\\">\\n <text macro=\\\"label-volume\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- date appears first if a review `container-title` has been substituted for a missing author (CMOS18 14.87, 14.102) -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\\\">\\n <text variable=\\\"volume\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"label-volume\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else>\\n <text variable=\\\"volume\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"label-issue\\\"/>\\n <text macro=\\\"label-supplement-number\\\"/>\\n </group>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- date for unsigned reviews only appears here if it did not earlier (CMOS18 14.102) -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\\\">\\n <text macro=\\\"source-date-issued-or-status\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n </if>\\n </choose>\\n </if>\\n <else>\\n <text macro=\\\"source-date-issued-or-status\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n </else>\\n </choose>\\n </group>\\n </else-if>\\n <else>\\n <text variable=\\\"collection-title\\\"/>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"interview post-weblog\\\">\\n <!-- publisher possible with broadcast `interview` (CMOS18 14.110) or `post-weblog` (CMOS18 14.105) -->\\n <text variable=\\\"publisher\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"source-serial-volume-status-bib\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-serial-identifier-volume-note\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-magazine article-newspaper\\\">\\n <!-- magazines and newspapers provide the full date in place of volume/issue numbers (CMOS18 14.87, 14.89) -->\\n <text variable=\\\"collection-title\\\"/>\\n <text macro=\\\"source-serial-volume-status-note\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"issue supplement-number volume\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <choose>\\n <!-- date appears first if a review `container-title` has been substituted for a missing author (CMOS18 14.89) -->\\n <!-- the conditions below mirror substitution in `author-note` -->\\n <if match=\\\"any\\\" variable=\\\"author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"reviewed-genre reviewed-title title\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"genre section\\\">\\n <text macro=\\\"source-date-issued-or-status\\\"/>\\n </else-if>\\n </choose>\\n </if>\\n </choose>\\n <!-- `collection-title` is for any serial with multiple series (e.g. 'second series') -->\\n <text variable=\\\"collection-title\\\"/>\\n <group delimiter=\\\" \\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"collection-title volume\\\">\\n <text macro=\\\"label-volume\\\"/>\\n </if>\\n <else-if variable=\\\"volume\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- date appears first if a review `container-title` has been substituted for a missing author (CMOS18 14.89) -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\\\">\\n <text variable=\\\"volume\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"reviewed-genre reviewed-title title\\\">\\n <text variable=\\\"volume\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"genre section\\\">\\n <text macro=\\\"label-volume\\\"/>\\n </else-if>\\n <else>\\n <text variable=\\\"volume\\\"/>\\n </else>\\n </choose>\\n </if>\\n <else>\\n <text variable=\\\"volume\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n </choose>\\n <text macro=\\\"label-issue\\\"/>\\n <text macro=\\\"label-supplement-number\\\"/>\\n </group>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\">\\n <!-- date appears first if a review `container-title` has been substituted for a missing author (CMOS18 14.89) -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\\\">\\n <text macro=\\\"source-date-issued-or-status\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"reviewed-genre reviewed-title title\\\">\\n <text macro=\\\"source-date-issued-or-status\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"genre section\\\"/>\\n <else>\\n <text macro=\\\"source-date-issued-or-status\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n </else>\\n </choose>\\n </if>\\n <else>\\n <text macro=\\\"source-date-issued-or-status\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n </else>\\n </choose>\\n </group>\\n </else-if>\\n <else>\\n <text variable=\\\"collection-title\\\"/>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"interview post-weblog\\\">\\n <!-- publisher possible with broadcast `interview` (CMOS18 14.110) or `post-weblog` (CMOS18 14.105) -->\\n <text variable=\\\"publisher\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"source-serial-volume-status-note\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-serial-volume-status-bib\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"collection-title issue number page supplement-number volume volume-title\\\"/>\\n <else-if variable=\\\"issued\\\"/>\\n <else-if variable=\\\"available-date\\\">\\n <group delimiter=\\\" \\\">\\n <!-- article accepted for publication and available on publisher website (CMOS18 14.75) -->\\n <!-- TODO: use CSL term for `available-date` when available -->\\n <text value=\\\"accepted\\\"/>\\n <date form=\\\"text\\\" variable=\\\"available-date\\\"/>\\n </group>\\n </else-if>\\n </choose>\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"source-date-status-bib\\\"/>\\n <text macro=\\\"source-date-issued-or-status\\\"/>\\n <!-- for author-date or notes and bibliography leading with volume title (CMOS18 14.21): -->\\n <!-- <text macro=\\\"source-date-specific-title-first\\\"/> -->\\n </group>\\n </group>\\n </macro>\\n <macro name=\\\"source-serial-volume-status-note\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"collection-title issue number page supplement-number volume volume-title\\\"/>\\n <else-if variable=\\\"issued\\\"/>\\n <else-if variable=\\\"available-date\\\">\\n <group delimiter=\\\" \\\">\\n <!-- article accepted for publication and available on publisher website (CMOS18 14.75) -->\\n <!-- TODO: use CSL term for `available-date` when available -->\\n <text value=\\\"accepted\\\"/>\\n <date form=\\\"text\\\" variable=\\\"available-date\\\"/>\\n </group>\\n </else-if>\\n </choose>\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"source-date-status-note\\\"/>\\n <text macro=\\\"source-date-issued-or-status\\\"/>\\n </group>\\n </group>\\n </macro>\\n <!-- Serial source locator -->\\n <macro name=\\\"source-serial-locator\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"locator number\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"label-locator\\\"/>\\n <!-- an article ID appears alongside locators in notes (CMOS18 14.71) -->\\n <choose>\\n <!-- if there is an `archive` with no other reference, `number` appears in `source-archive-database-number` -->\\n <if match=\\\"any\\\" variable=\\\"archive_collection archive_location archive-place\\\">\\n <text variable=\\\"number\\\"/>\\n </if>\\n <else-if variable=\\\"archive\\\"/>\\n <else>\\n <text variable=\\\"number\\\"/>\\n </else>\\n </choose>\\n </group>\\n </if>\\n <!-- do not give pages for magazines or newspapers (CMOS18 14.87, 14.89) -->\\n <else-if match=\\\"any\\\" type=\\\"article-magazine article-newspaper\\\"/>\\n <else>\\n <text variable=\\\"page\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- 4.2. Monographic sources -->\\n <macro name=\\\"source-monographic-bib\\\">\\n <group delimiter=\\\". \\\">\\n <!-- Monographic sources repeat main reference elements -->\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"source-monographic-preposition-bib\\\"/>\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n <!-- for author-date or notes and bibliography leading with volume title (CMOS18 14.21): -->\\n <!-- <text macro=\\\"source-monographic-title-specific-title-first\\\"/> -->\\n </group>\\n <text macro=\\\"source-monographic-description\\\"/>\\n <text macro=\\\"source-monographic-identifier-bib\\\"/>\\n <text macro=\\\"source-monographic-locator\\\"/>\\n </group>\\n </if>\\n </choose>\\n <text macro=\\\"source-monographic-identifier-contributors-bib-container-author\\\"/>\\n <text macro=\\\"source-series-bib\\\"/>\\n <choose>\\n <!-- show event information here only if not collapsed with `issued` (CMOS18 14.167) -->\\n <if match=\\\"any\\\" variable=\\\"event-date original-date original-publisher original-publisher-place publisher status\\\">\\n <text macro=\\\"source-event-bib\\\"/>\\n </if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-monographic-note\\\">\\n <group delimiter=\\\", \\\">\\n <!-- Monographic sources repeat main reference elements -->\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"source-monographic-preposition-note\\\"/>\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </group>\\n <text macro=\\\"source-monographic-description\\\"/>\\n <text macro=\\\"source-monographic-identifier-note\\\"/>\\n <!-- no `source-monographic-locator` in note -->\\n </group>\\n </if>\\n </choose>\\n <text macro=\\\"source-series-note\\\"/>\\n <text macro=\\\"source-event-note\\\"/>\\n </group>\\n </macro>\\n <!-- Monographic source title -->\\n <macro name=\\\"source-monographic-preposition-bib\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"broadcast motion_picture\\\"/>\\n <else-if type=\\\"chapter\\\" variable=\\\"container-title genre\\\">\\n <text value=\\\"to\\\"/>\\n </else-if>\\n <else-if type=\\\"article-journal\\\" variable=\\\"container-title genre volume-title\\\">\\n <text value=\\\"to\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"author composer\\\">\\n <!-- Give preposition only for signed entries; otherwise, title is substituted -->\\n <text term=\\\"in\\\" text-case=\\\"capitalize-first\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <!-- if printing chapter page numbers (CMOS17/classic):\\n <else-if variable=\\\"chapter-number page title\\\"><text term=\\\"in\\\" text-case=\\\"capitalize-first\\\"/></else-if>\\n -->\\n <else-if variable=\\\"chapter-number\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"label-chapter-number-capitalized\\\"/>\\n <choose>\\n <if type=\\\"song\\\">\\n <text term=\\\"on\\\"/>\\n </if>\\n <else>\\n <text term=\\\"in\\\"/>\\n </else>\\n </choose>\\n </group>\\n </else-if>\\n <else>\\n <text term=\\\"in\\\" text-case=\\\"capitalize-first\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-monographic-preposition-note\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"broadcast motion_picture\\\"/>\\n <else-if type=\\\"chapter\\\" variable=\\\"container-title genre\\\">\\n <text value=\\\"to\\\"/>\\n </else-if>\\n <else-if type=\\\"article-journal\\\" variable=\\\"container-title genre volume-title\\\">\\n <text value=\\\"to\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"author composer\\\">\\n <!-- Give preposition only for signed entries; otherwise, title is substituted -->\\n <text term=\\\"in\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <!-- if printing chapter page numbers (CMOS17/classic):\\n <else-if variable=\\\"chapter-number page title\\\"><text term=\\\"in\\\"/></else-if>\\n -->\\n <else-if variable=\\\"chapter-number\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"label-chapter-number\\\"/>\\n <choose>\\n <if type=\\\"song\\\">\\n <text term=\\\"on\\\"/>\\n </if>\\n <else>\\n <text term=\\\"in\\\"/>\\n </else>\\n </choose>\\n </group>\\n </else-if>\\n <else>\\n <text term=\\\"in\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- Monographic source description -->\\n <macro name=\\\"source-monographic-description\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"document report software standard\\\">\\n <!-- place description after `container-title` -->\\n <text macro=\\\"description-format-note\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director issue page supplement-number volume\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"event paper-conference performance speech\\\">\\n <!-- unpublished conference presentations should describe the session -->\\n <text macro=\\\"description-format-note\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <!-- Monographic source identifier -->\\n <macro name=\\\"source-monographic-identifier-bib\\\">\\n <!-- Based on `identifier-bib` -->\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"none\\\" type=\\\"broadcast graphic map motion_picture song\\\">\\n <!-- For audiovisual media, number information comes after `title`, not `container-title`; `song` places album catalogue `number` with `publisher` (CMOS18 14.163-164) -->\\n <text macro=\\\"identifier-number-bib\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"label-version\\\"/>\\n <!-- use note form as `edition` is not capitalized here -->\\n <text macro=\\\"identifier-edition-note\\\"/>\\n <text macro=\\\"source-monographic-identifier-contributors-and-volume-bib\\\"/>\\n <!-- for author-date or notes and bibliography leading with volume title (CMOS18 14.21): -->\\n <!-- <text macro=\\\"source-monographic-identifier-contributors-and-volume-bib-specific-title-first\\\"/> -->\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-monographic-identifier-note\\\">\\n <!-- Based on `identifier-note` -->\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"none\\\" type=\\\"broadcast graphic map motion_picture song\\\">\\n <!-- For audiovisual media, number information comes after `title`, not `container-title`; `song` places album catalogue `number` with `publisher` (CMOS18 14.163-164) -->\\n <text macro=\\\"identifier-number-note\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"label-version\\\"/>\\n <text macro=\\\"identifier-edition-note\\\"/>\\n <text macro=\\\"source-monographic-identifier-contributors-and-volume-note\\\"/>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-monographic-identifier-contributors-bib\\\">\\n <choose>\\n <if variable=\\\"container-author container-title\\\">\\n <!-- set off `container-author` from other contributors in the bibliography (CMOS18 14.12; for page location, CMOS17 14.110) -->\\n <names variable=\\\"container-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <!-- other contributors shift to `source-monographic-identifier-contributors-bib-container-author` -->\\n </if>\\n <else>\\n <group delimiter=\\\", \\\">\\n <names variable=\\\"editor-translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"editor translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"guest\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"host\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"chair organizer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"illustrator narrator compiler curator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"series-creator executive-producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"editorial-director\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"broadcast performance\\\">\\n <names variable=\\\"script-writer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n <names variable=\\\"director\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"performer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"song thesis\\\">\\n <!-- Song contributors attached to album (CMOS18 14.163) -->\\n <names variable=\\\"contributor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n </group>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-monographic-identifier-contributors-bib-container-author\\\">\\n <!-- set off `container-author` from other contributors in the bibliography (CMOS18 14.12; for page location, CMOS17 14.110) -->\\n <choose>\\n <if variable=\\\"container-author container-title\\\">\\n <group delimiter=\\\". \\\">\\n <names variable=\\\"editor-translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"editor translator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"guest\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"host\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"chair organizer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"illustrator narrator compiler curator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\". \\\" variable=\\\"series-creator executive-producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"editorial-director\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"broadcast performance\\\">\\n <names variable=\\\"script-writer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n <names variable=\\\"director\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"performer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"song thesis\\\">\\n <!-- Song contributors attached to album (CMOS18 14.163) -->\\n <names variable=\\\"contributor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\" text-case=\\\"capitalize-first\\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-monographic-identifier-contributors-note\\\">\\n <group delimiter=\\\", \\\">\\n <names variable=\\\"container-author\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"editor-translator\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"editor translator\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"guest\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"host\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"chair organizer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"illustrator\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"narrator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"compiler\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"curator\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names delimiter=\\\", \\\" variable=\\\"series-creator executive-producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"producer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"editorial-director\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"broadcast performance\\\">\\n <names variable=\\\"script-writer\\\">\\n <!-- `script-writer` is not abbreviated (CMOS18 14.165) -->\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n <names variable=\\\"director\\\">\\n <!-- `director` is not abbreviated (CMOS18 14.165) -->\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <names variable=\\\"performer\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <choose>\\n <if match=\\\"none\\\" type=\\\"song thesis\\\">\\n <!-- Song contributors attached to album (CMOS18 14.163) -->\\n <names variable=\\\"contributor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-monographic-identifier-contributors-and-volume-bib\\\">\\n <!-- based on `identifier-contributors-and-volume-monographic-bib` -->\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"number-of-volumes part-number part-number volume volume-title\\\">\\n <!-- cite multivolume `collection-editor`; otherwise it belongs with `collection-title` -->\\n <names variable=\\\"collection-editor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n <!-- use the note form for an item with `container-title` -->\\n <text macro=\\\"identifier-volume-note\\\"/>\\n <text macro=\\\"source-monographic-identifier-contributors-bib\\\"/>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"part-number part-title volume volume-title\\\"/>\\n <else-if variable=\\\"page\\\"/>\\n <else>\\n <text macro=\\\"label-number-of-volumes\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-monographic-identifier-contributors-and-volume-note\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"number-of-volumes part-number part-title volume volume-title\\\">\\n <!-- cite multivolume `collection-editor`; otherwise it belongs with `collection-title` -->\\n <names variable=\\\"collection-editor\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n </choose>\\n <text macro=\\\"identifier-volume-note\\\"/>\\n <text macro=\\\"source-monographic-identifier-contributors-note\\\"/>\\n <choose>\\n <!-- notes only show the number of volumes if there is no physical locator, which should include a volume number, e.g. 4:243 -->\\n <if match=\\\"any\\\" variable=\\\"part-number part-title volume volume-title\\\"/>\\n <else-if locator=\\\"column\\\"/>\\n <else-if locator=\\\"folio\\\"/>\\n <else-if locator=\\\"page\\\"/>\\n <else-if variable=\\\"page\\\"/>\\n <else>\\n <text macro=\\\"label-number-of-volumes\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- Monographic source locator -->\\n <macro name=\\\"source-monographic-locator\\\">\\n <choose>\\n <!-- archival locators appear after the shelfmark (CMOS18 14.127) -->\\n <if locator=\\\"column\\\" variable=\\\"archive archive_location\\\"/>\\n <else-if locator=\\\"folio\\\" variable=\\\"archive archive_location\\\"/>\\n <else-if locator=\\\"page\\\" variable=\\\"archive archive_location\\\"/>\\n <else-if is-numeric=\\\"volume\\\" locator=\\\"page\\\">\\n <!-- separate a volume and page number with a colon (CMOS18 14.18) -->\\n <group delimiter=\\\":\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"part-number part-title volume-title\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"container-author editor editor-translator translator\\\"/>\\n <!-- for author-date or notes and bibliography leading with volume title (CMOS18 14.21), check for name variables falling after the general title: -->\\n <!-- <else-if variable=\\\"collection-editor\\\"/> -->\\n <else>\\n <text variable=\\\"volume\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"locator\\\"/>\\n </group>\\n </else-if>\\n <else-if variable=\\\"locator\\\">\\n <text macro=\\\"label-locator\\\"/>\\n </else-if>\\n <!-- remove `container-title` condition in styles that print chapter page numbers (CMOS17/classic) -->\\n <else-if variable=\\\"container-title\\\"/>\\n <else-if is-numeric=\\\"volume\\\" variable=\\\"page\\\">\\n <!-- collapse the volume and page number if adjacent (CMOS18 14.18) -->\\n <group delimiter=\\\":\\\">\\n <choose>\\n <!-- check for variables that might come between the volume and page number -->\\n <if match=\\\"any\\\" variable=\\\"part-number part-title volume-title\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"container-author editor editor-translator translator\\\"/>\\n <!-- for author-date or notes and bibliography leading with volume title (CMOS18 14.21), check for name variables falling after the general title: -->\\n <!-- <else-if variable=\\\"collection-editor\\\"/> -->\\n <else>\\n <text variable=\\\"volume\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"page\\\"/>\\n </group>\\n </else-if>\\n <!-- archival locators appear after the shelfmark (CMOS18 14.127) -->\\n <else-if variable=\\\"archive archive_location page\\\"/>\\n <else>\\n <text variable=\\\"page\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- 4.3. Series -->\\n <macro name=\\\"source-series-bib\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"number-of-volumes part-number part-title volume volume-title\\\">\\n <text macro=\\\"source-series-title\\\"/>\\n </if>\\n <else-if variable=\\\"collection-editor collection-title\\\">\\n <!-- `collection-editor` belongs with `collection-title` if the item is not multivolume -->\\n <text text-case=\\\"title\\\" variable=\\\"collection-title\\\"/>\\n <names variable=\\\"collection-editor\\\">\\n <label form=\\\"verb\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <text macro=\\\"label-collection-number\\\"/>\\n <text macro=\\\"label-issue\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"source-series-title\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-series-note\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"number-of-volumes part-number part-title volume volume-title\\\">\\n <text macro=\\\"source-series-title\\\"/>\\n </if>\\n <else-if variable=\\\"collection-editor collection-title\\\">\\n <!-- `collection-editor` belongs with `collection-title` if the item is not multivolume -->\\n <text text-case=\\\"title\\\" variable=\\\"collection-title\\\"/>\\n <names variable=\\\"collection-editor\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <text macro=\\\"label-collection-number\\\"/>\\n <text macro=\\\"label-issue\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"source-series-title\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-series-title\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"issue\\\">\\n <text text-case=\\\"title\\\" variable=\\\"collection-title\\\"/>\\n <text macro=\\\"label-collection-number\\\"/>\\n <text macro=\\\"label-issue\\\"/>\\n </if>\\n <else-if is-numeric=\\\"collection-number\\\" variable=\\\"collection-title\\\">\\n <group delimiter=\\\" \\\">\\n <text text-case=\\\"title\\\" variable=\\\"collection-title\\\"/>\\n <text variable=\\\"collection-number\\\"/>\\n </group>\\n </else-if>\\n <else-if variable=\\\"collection-title\\\">\\n <text text-case=\\\"title\\\" variable=\\\"collection-title\\\"/>\\n <text variable=\\\"collection-number\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <!-- 4.4. Event -->\\n <macro name=\\\"source-event-bib\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <!-- omit types that provide event information in description -->\\n <if match=\\\"any\\\" type=\\\"interview\\\" variable=\\\"interviewer\\\"/>\\n <else-if type=\\\"personal_communication\\\" variable=\\\"recipient\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"event event-date event-title\\\">\\n <!-- TODO: To prevent Zotero from printing `event-place`, due to its double-mapping of `publisher-place` and `event-place`. Remove this when that is changed. -->\\n <choose>\\n <if type=\\\"paper-conference\\\">\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"collection-editor compiler editor editorial-director issue page supplement-number volume\\\">\\n <!-- Don't print event info for conference papers published in proceedings -->\\n <text macro=\\\"source-event-status-bib\\\"/>\\n <text macro=\\\"source-event-description-bib\\\"/>\\n </if>\\n </choose>\\n </if>\\n <else>\\n <!-- For other item types, print event info even if published (e.g. collection catalogs, performance programs). -->\\n <text macro=\\\"source-event-status-bib\\\"/>\\n <text macro=\\\"source-event-description-bib\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-event-note\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <!-- omit types that provide event information in description -->\\n <if match=\\\"any\\\" type=\\\"interview\\\" variable=\\\"interviewer\\\"/>\\n <else-if type=\\\"personal_communication\\\" variable=\\\"recipient\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"review review-book\\\" variable=\\\"reviewed-author reviewed-genre reviewed-title\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"event event-date event-title\\\">\\n <!-- TODO: To prevent Zotero from printing `event-place`, due to its double-mapping of `publisher-place` and `event-place`. Remove this when that is changed. -->\\n <choose>\\n <if type=\\\"paper-conference\\\">\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"collection-editor compiler editor editorial-director issue page supplement-number volume\\\">\\n <!-- Don't print event info for conference papers published in proceedings -->\\n <text macro=\\\"source-event-status-note\\\"/>\\n <text macro=\\\"source-event-description-note\\\"/>\\n </if>\\n </choose>\\n </if>\\n <else>\\n <!-- For other item types, print event info even if published (e.g. collection catalogs, performance programs). -->\\n <text macro=\\\"source-event-status-note\\\"/>\\n <text macro=\\\"source-event-description-note\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-event-place-first\\\">\\n <!-- for descriptive elements for interviews, reviews, letters -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"event event-date event-title\\\">\\n <group delimiter=\\\", \\\">\\n <text variable=\\\"event-title\\\"/>\\n <text variable=\\\"event-place\\\"/>\\n <text macro=\\\"date-event-full\\\"/>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-event-status-bib\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"broadcast\\\" variable=\\\"status\\\">\\n <!-- 'aired', 'performed', etc. (CMOS18 14.165) -->\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"status\\\"/>\\n </if>\\n <else-if type=\\\"paper-conference\\\">\\n <choose>\\n <if variable=\\\"genre\\\">\\n <text text-case=\\\"capitalize-first\\\" value=\\\"presented\\\"/>\\n </if>\\n <else>\\n <text form=\\\"short\\\" term=\\\"paper-conference\\\" text-case=\\\"capitalize-first\\\"/>\\n <text value=\\\"presented\\\"/>\\n </else>\\n </choose>\\n <choose>\\n <if variable=\\\"event-title\\\">\\n <text term=\\\"at\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else-if type=\\\"song\\\">\\n <text text-case=\\\"capitalize-first\\\" value=\\\"recorded\\\"/>\\n <choose>\\n <if variable=\\\"event-title\\\">\\n <text term=\\\"at\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else-if variable=\\\"event-date issued\\\"/>\\n <else-if variable=\\\"issued\\\"/>\\n <else>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"status\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-event-status-note\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"broadcast\\\" variable=\\\"status\\\">\\n <!-- 'aired', 'performed', etc. (CMOS18 14.165) -->\\n <text variable=\\\"status\\\"/>\\n </if>\\n <else-if type=\\\"paper-conference\\\">\\n <choose>\\n <if variable=\\\"genre\\\">\\n <text value=\\\"presented\\\"/>\\n </if>\\n <else>\\n <text form=\\\"short\\\" term=\\\"paper-conference\\\"/>\\n <text value=\\\"presented\\\"/>\\n </else>\\n </choose>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"event event-title\\\">\\n <text term=\\\"at\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else-if type=\\\"song\\\">\\n <text value=\\\"recorded\\\"/>\\n <choose>\\n <if variable=\\\"event-title\\\">\\n <text term=\\\"at\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else-if variable=\\\"event-date issued\\\"/>\\n <else-if variable=\\\"issued\\\"/>\\n <else>\\n <text variable=\\\"status\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-event-title\\\">\\n <choose>\\n <!-- TODO: We expect `event-title` to be used, but processors and applications may not be updated yet. This macro ensures that either `event` or `event-title` can be accepted. Remove if processor logic and application adoption can handle this. -->\\n <if variable=\\\"event-title\\\">\\n <text variable=\\\"event-title\\\"/>\\n </if>\\n <else>\\n <text variable=\\\"event\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-event-title-capitalized\\\">\\n <choose>\\n <!-- TODO: We expect `event-title` to be used, but processors and applications may not be updated yet. This macro ensures that either `event` or `event-title` can be accepted. Remove if processor logic and application adoption can handle this. -->\\n <if variable=\\\"event-title\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"event-title\\\"/>\\n </if>\\n <else>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"event\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-event-description-bib\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if type=\\\"song\\\">\\n <text macro=\\\"source-event-title\\\"/>\\n </if>\\n <else-if type=\\\"paper-conference\\\" variable=\\\"genre\\\">\\n <text macro=\\\"source-event-title-capitalized\\\"/>\\n </else-if>\\n <else-if type=\\\"paper-conference\\\">\\n <text macro=\\\"source-event-title\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"source-event-title-capitalized\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"date-event-full\\\"/>\\n <text variable=\\\"event-place\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"source-event-description-note\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if type=\\\"song\\\">\\n <text macro=\\\"source-event-title\\\"/>\\n </if>\\n <else-if type=\\\"paper-conference\\\" variable=\\\"genre\\\">\\n <text macro=\\\"source-event-title\\\"/>\\n </else-if>\\n <else-if type=\\\"paper-conference\\\">\\n <text macro=\\\"source-event-title\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"source-event-title\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"date-event-full\\\"/>\\n <text variable=\\\"event-place\\\"/>\\n </group>\\n </macro>\\n <!-- 4.5. Facts of publication -->\\n <macro name=\\\"source-monographic-publication-bib\\\">\\n <group delimiter=\\\". \\\">\\n <choose>\\n <!-- `patent` date in identification (CMOS18 14.158) -->\\n <if type=\\\"patent\\\"/>\\n <!-- omit serial types -->\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"source-publication-and-date-bib\\\"/>\\n </else-if>\\n <!-- omit serial types -->\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\"/>\\n <else>\\n <!-- monographic types -->\\n <text macro=\\\"source-publication-and-date-bib\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"source-publication-original-title-bib\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"source-monographic-publication-note\\\">\\n <group delimiter=\\\"; \\\">\\n <choose>\\n <!-- `patent` date in identification (CMOS18 14.158) -->\\n <if type=\\\"patent\\\"/>\\n <!-- omit serial types -->\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"source-publication-and-date-note\\\"/>\\n </else-if>\\n <!-- omit serial types -->\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\"/>\\n <else>\\n <!-- monographic types -->\\n <text macro=\\\"source-publication-and-date-note\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"source-publication-original-title-note\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"source-monographic-publication-note-bracketed\\\">\\n <!-- Facts of publication with brackets for print monographic formats -->\\n <choose>\\n <if match=\\\"any\\\" type=\\\"book chapter classic interview musical_score pamphlet paper-conference report thesis\\\">\\n <text macro=\\\"source-monographic-publication-note\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n </if>\\n <else-if type=\\\"article\\\" variable=\\\"genre publisher\\\">\\n <!-- without brackets for a preprint in a repository (CMOS18 14.76), with brackets for a working paper (CMOS18 14.116) -->\\n <text macro=\\\"source-monographic-publication-note\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"publisher publisher-place\\\">\\n <text macro=\\\"source-monographic-publication-note\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n </if>\\n <!-- online reference sources without a additional publisher details are unbracketed (CMOS18 14.131) -->\\n <else-if match=\\\"any\\\" variable=\\\"DOI URL\\\"/>\\n <else>\\n <text macro=\\\"source-monographic-publication-note\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else-if type=\\\"motion_picture\\\" variable=\\\"publisher\\\">\\n <text macro=\\\"source-monographic-publication-note\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n </else-if>\\n <else-if type=\\\"personal_communication\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director issue page supplement-number volume\\\">\\n <!-- in an edited collection -->\\n <text macro=\\\"source-monographic-publication-note\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else-if is-uncertain-date=\\\"issued\\\">\\n <!-- space before bracketed uncertain date (CMOS18 14.127) -->\\n <text macro=\\\"source-monographic-publication-note\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-monographic-publication-note-unbracketed\\\">\\n <!-- Facts of publication without brackets -->\\n <choose>\\n <if match=\\\"any\\\" type=\\\"book chapter classic interview musical_score pamphlet paper-conference report thesis\\\"/>\\n <else-if type=\\\"article\\\" variable=\\\"genre publisher\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"publisher publisher-place\\\"/>\\n <!-- online reference sources without a additional publisher details are unbracketed (CMOS18 14.131) -->\\n <else-if match=\\\"any\\\" variable=\\\"DOI URL\\\">\\n <text macro=\\\"source-monographic-publication-note\\\"/>\\n </else-if>\\n </choose>\\n </else-if>\\n <else-if type=\\\"motion_picture\\\" variable=\\\"publisher\\\"/>\\n <else-if type=\\\"personal_communication\\\">\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"collection-editor compiler editor editorial-director issue page supplement-number volume\\\">\\n <!-- not in an edited collection -->\\n <text macro=\\\"source-monographic-publication-note\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else-if is-uncertain-date=\\\"issued\\\"/>\\n <else>\\n <text macro=\\\"source-monographic-publication-note\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-monographic-publication-short-bracketed\\\">\\n <!-- mirrors `source-monographic-publication-note-bracketed` -->\\n <group delimiter=\\\", \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <choose>\\n <if disambiguate=\\\"true\\\" match=\\\"none\\\"/>\\n <!-- Facts of publication with brackets for print monographic formats -->\\n <else-if match=\\\"any\\\" type=\\\"book chapter classic interview musical_score pamphlet paper-conference report thesis\\\">\\n <choose>\\n <if disambiguate=\\\"true\\\">\\n <text macro=\\\"source-publication-publisher-note\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"source-date-issued-or-status\\\"/>\\n </else-if>\\n <else-if type=\\\"article\\\" variable=\\\"genre publisher\\\">\\n <!-- without brackets for a preprint in a repository (CMOS18 14.76), with brackets for a working paper (CMOS18 14.116) -->\\n <choose>\\n <if disambiguate=\\\"true\\\">\\n <text macro=\\\"source-publication-publisher-note\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"source-date-issued-or-status\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"publisher publisher-place\\\">\\n <choose>\\n <if disambiguate=\\\"true\\\">\\n <text macro=\\\"source-publication-publisher-note\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"source-date-issued-or-status\\\"/>\\n </if>\\n <!-- online reference sources without a additional publisher details are unbracketed (CMOS18 14.131) -->\\n <else-if match=\\\"any\\\" variable=\\\"DOI URL\\\"/>\\n <else>\\n <choose>\\n <if disambiguate=\\\"true\\\">\\n <text macro=\\\"source-publication-publisher-note\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"source-date-issued-or-status\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else-if type=\\\"motion_picture\\\" variable=\\\"publisher\\\">\\n <choose>\\n <if disambiguate=\\\"true\\\">\\n <text macro=\\\"source-publication-publisher-note\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"source-date-issued-or-status\\\"/>\\n </else-if>\\n <else-if type=\\\"personal_communication\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director issue page supplement-number volume\\\">\\n <!-- in an edited collection -->\\n <text macro=\\\"source-date-issued-or-status\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else-if is-uncertain-date=\\\"issued\\\">\\n <!-- space before bracketed uncertain date (CMOS18 14.127) -->\\n <text macro=\\\"source-date-issued-or-status\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-monographic-publication-short-unbracketed\\\">\\n <!-- mirrors `source-monographic-publication-note-unbracketed` -->\\n <choose>\\n <if disambiguate=\\\"true\\\" match=\\\"none\\\"/>\\n <!-- Facts of publication without brackets -->\\n <else-if match=\\\"any\\\" type=\\\"book chapter classic interview musical_score pamphlet paper-conference report thesis\\\"/>\\n <else-if type=\\\"article\\\" variable=\\\"genre publisher\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"publisher publisher-place\\\"/>\\n <!-- online reference sources without a additional publisher details are unbracketed (CMOS18 14.131) -->\\n <else-if match=\\\"any\\\" variable=\\\"DOI URL\\\">\\n <text macro=\\\"source-date-issued-or-status\\\"/>\\n </else-if>\\n </choose>\\n </else-if>\\n <else-if type=\\\"motion_picture\\\" variable=\\\"publisher\\\"/>\\n <else-if type=\\\"personal_communication\\\">\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"collection-editor compiler editor editorial-director issue page supplement-number volume\\\">\\n <!-- not in an edited collection -->\\n <text macro=\\\"source-date-issued-or-status\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else-if is-uncertain-date=\\\"issued\\\"/>\\n <else>\\n <text macro=\\\"source-date-issued-or-status\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-publication-and-date-bib\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"post webpage\\\">\\n <!-- print `container-title` on `post` or `webpage` in the same way as `publisher` (CMOS18 14.104-106) -->\\n <text text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n <!-- avoid possible repetition of `container-title` with author-date: -->\\n <!-- <choose><if variable=\\\"publisher\\\"><text text-case=\\\"title\\\" variable=\\\"container-title\\\"/></if><else-if type=\\\"webpage\\\" variable=\\\"container-title container-title-short\\\"/><else><text text-case=\\\"title\\\" variable=\\\"container-title\\\"/></else></choose>-->\\n </if>\\n </choose>\\n <choose>\\n <if type=\\\"broadcast\\\" variable=\\\"DOI\\\">\\n <!-- a podcast publisher appears before the date, whereas the network of an aired show appears after (CMOS18 14.165); unfortunately CSL stores both in `publisher` -->\\n <!-- TODO: `DOI` or `URL` detection is the only way to distinguish radio/TV from podcasts, but it is obviously imprecise; modify if CSL provides a `podcast` type -->\\n <text macro=\\\"source-publication-history-bib\\\"/>\\n </if>\\n <else-if type=\\\"broadcast\\\" variable=\\\"URL\\\">\\n <text macro=\\\"source-publication-history-bib\\\"/>\\n </else-if>\\n <else-if type=\\\"broadcast\\\"/>\\n <else>\\n <text macro=\\\"source-publication-history-bib\\\"/>\\n </else>\\n </choose>\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"source-date-status-bib\\\"/>\\n <text macro=\\\"source-date-issued-or-status\\\"/>\\n <!-- for author-date or notes and bibliography leading with volume title (CMOS18 14.21): -->\\n <!-- <text macro=\\\"source-date-specific-title-first\\\"/> -->\\n </group>\\n <choose>\\n <if type=\\\"broadcast\\\" variable=\\\"URL\\\"/>\\n <else-if type=\\\"broadcast\\\">\\n <group delimiter=\\\" \\\">\\n <text term=\\\"on\\\"/>\\n <text macro=\\\"source-publication-history-bib\\\"/>\\n </group>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-publication-and-date-note\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"post webpage\\\">\\n <!-- print `container-title` on `post` or `webpage` in the same way as `publisher` (CMOS18 14.104-106) -->\\n <text text-case=\\\"title\\\" variable=\\\"container-title\\\"/>\\n </if>\\n </choose>\\n <choose>\\n <if type=\\\"broadcast\\\" variable=\\\"DOI\\\">\\n <!-- a podcast publisher appears before the date, whereas the network of an aired show appears after (CMOS18 14.165); unfortunately CSL stores both in `publisher` -->\\n <!-- TODO: `DOI` or `URL` detection is the only way to distinguish radio/TV from podcasts, but it is obviously imprecise; modify if CSL provides a `podcast` type -->\\n <text macro=\\\"source-publication-history-note\\\"/>\\n </if>\\n <else-if type=\\\"broadcast\\\" variable=\\\"URL\\\">\\n <text macro=\\\"source-publication-history-note\\\"/>\\n </else-if>\\n <else-if type=\\\"broadcast\\\"/>\\n <else>\\n <text macro=\\\"source-publication-history-note\\\"/>\\n </else>\\n </choose>\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"source-date-status-note\\\"/>\\n <text macro=\\\"source-date-issued-or-status\\\"/>\\n </group>\\n <choose>\\n <if type=\\\"broadcast\\\" variable=\\\"DOI\\\"/>\\n <else-if type=\\\"broadcast\\\" variable=\\\"URL\\\"/>\\n <else-if type=\\\"broadcast\\\">\\n <group delimiter=\\\" \\\">\\n <text term=\\\"on\\\"/>\\n <text macro=\\\"source-publication-history-note\\\"/>\\n </group>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <!-- Facts of publication elements -->\\n <macro name=\\\"source-publication-description-bib\\\">\\n <choose>\\n <if type=\\\"article\\\" variable=\\\"genre\\\"/>\\n <else-if type=\\\"article\\\">\\n <!-- `preprint` term attached to repository name, but specific working paper descriptors appear in description (CMOS18 14.76, 14.116) -->\\n <text term=\\\"preprint\\\" text-case=\\\"capitalize-first\\\"/>\\n </else-if>\\n <else-if type=\\\"thesis\\\">\\n <!-- thesis type appears with university name (CMOS18 14.113) -->\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"original-publisher original-publisher-place\\\">\\n <choose>\\n <!-- `edition` provides an alternative label to `reprint` (CMOS18 14.16) -->\\n <if match=\\\"any\\\" variable=\\\"edition original-title\\\"/>\\n <else-if match=\\\"none\\\" type=\\\"book chapter classic entry entry-dictionary entry-encyclopedia interview musical_score pamphlet paper-conference report thesis\\\"/>\\n <else-if variable=\\\"issued original-date\\\">\\n <text text-case=\\\"capitalize-first\\\" value=\\\"reprint\\\"/>\\n </else-if>\\n </choose>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-publication-description-note\\\">\\n <choose>\\n <if type=\\\"article\\\" variable=\\\"genre\\\"/>\\n <else-if type=\\\"article\\\">\\n <!-- `preprint` term attached to repository name, but specific working paper descriptors appear in description (CMOS18 14.76, 14.116) -->\\n <text term=\\\"preprint\\\"/>\\n </else-if>\\n <else-if type=\\\"thesis\\\">\\n <!-- thesis type appears with university name (CMOS18 14.113) -->\\n <text variable=\\\"genre\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"original-publisher original-publisher-place\\\">\\n <choose>\\n <!-- `edition` provides an alternative label to `reprint` (CMOS18 14.16) -->\\n <if match=\\\"any\\\" variable=\\\"edition original-title\\\"/>\\n <else-if match=\\\"none\\\" type=\\\"book chapter classic entry entry-dictionary entry-encyclopedia interview musical_score pamphlet paper-conference report thesis\\\"/>\\n <else-if variable=\\\"issued original-date\\\">\\n <text value=\\\"repr.\\\"/>\\n </else-if>\\n </choose>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-publication-history-bib\\\">\\n <choose>\\n <if variable=\\\"original-title\\\">\\n <!-- `original-title` is covered in `source-publication-original-title-bib` -->\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-publication-description-bib\\\"/>\\n <text macro=\\\"source-publication-publisher-bib\\\"/>\\n </group>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"edition original-publisher original-publisher-place\\\">\\n <group delimiter=\\\". \\\">\\n <!-- full stop to separate original date if `original-publisher` (CMOS18 14.16) -->\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-publication-publisher-original-bib\\\"/>\\n <text macro=\\\"source-date-original\\\"/>\\n </group>\\n <group delimiter=\\\". \\\">\\n <choose>\\n <if variable=\\\"issued original-date\\\">\\n <text macro=\\\"label-edition-capitalized\\\"/>\\n </if>\\n </choose>\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-publication-description-bib\\\"/>\\n <text macro=\\\"source-publication-publisher-bib\\\"/>\\n </group>\\n </group>\\n </group>\\n </else-if>\\n <else>\\n <group delimiter=\\\"; \\\">\\n <!-- semicolon to separate original date if no publisher (CMOS18 14.165) -->\\n <text macro=\\\"source-date-original\\\"/>\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-publication-description-bib\\\"/>\\n <text macro=\\\"source-publication-publisher-bib\\\"/>\\n </group>\\n </group>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-publication-history-note\\\">\\n <choose>\\n <if variable=\\\"original-title\\\">\\n <!-- `original-title` is covered in `source-publication-original-title-bib` -->\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-publication-description-note\\\"/>\\n <text macro=\\\"source-publication-publisher-note\\\"/>\\n </group>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"edition original-publisher original-publisher-place\\\">\\n <group delimiter=\\\"; \\\">\\n <!-- semicolon to separate original date if `original-publisher` (CMOS18 14.16) -->\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-publication-publisher-original-note\\\"/>\\n <text macro=\\\"source-date-original\\\"/>\\n </group>\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"issued original-date\\\">\\n <text macro=\\\"label-edition\\\"/>\\n </if>\\n </choose>\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-publication-description-note\\\"/>\\n <text macro=\\\"source-publication-publisher-note\\\"/>\\n </group>\\n </group>\\n </group>\\n </else-if>\\n <else>\\n <group delimiter=\\\"; \\\">\\n <!-- semicolon to separate original date if no publisher (CMOS18 14.165) -->\\n <text macro=\\\"source-date-original\\\"/>\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"source-publication-description-note\\\"/>\\n <text macro=\\\"source-publication-publisher-note\\\"/>\\n </group>\\n </group>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-publication-original-title-bib\\\">\\n <!-- Work originally published under a different title (CMOS18 13.101) -->\\n <choose>\\n <if variable=\\\"original-title\\\">\\n <group delimiter=\\\" \\\">\\n <text term=\\\"original-work-published\\\" text-case=\\\"capitalize-first\\\"/>\\n <group delimiter=\\\", \\\">\\n <names variable=\\\"original-author\\\">\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"original-title\\\"/>\\n </group>\\n <group delimiter=\\\", \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <text macro=\\\"source-publication-publisher-original-bib\\\"/>\\n <text macro=\\\"source-date-original\\\"/>\\n </group>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-publication-original-title-note\\\">\\n <!-- Work originally published under a different title (CMOS18 13.101) -->\\n <choose>\\n <if variable=\\\"original-title\\\">\\n <group delimiter=\\\" \\\">\\n <text term=\\\"original-work-published\\\"/>\\n <group delimiter=\\\", \\\">\\n <names variable=\\\"original-author\\\">\\n <name and=\\\"text\\\" initialize=\\\"false\\\"/>\\n </names>\\n <text font-style=\\\"italic\\\" text-case=\\\"title\\\" variable=\\\"original-title\\\"/>\\n </group>\\n <group delimiter=\\\", \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <text macro=\\\"source-publication-publisher-original-note\\\"/>\\n <text macro=\\\"source-date-original\\\"/>\\n </group>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-publication-publisher-bib\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"thesis\\\" variable=\\\"publisher\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"publisher\\\"/>\\n </if>\\n <else-if variable=\\\"publisher\\\">\\n <group delimiter=\\\": \\\">\\n <!-- <text text-case=\\\"capitalize-first\\\" variable=\\\"publisher-place\\\"/> -->\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"publisher\\\"/>\\n </group>\\n </else-if>\\n <!-- TODO: remove conditional when Zotero fixes double-mapping of `event-place` -->\\n <else-if match=\\\"any\\\" variable=\\\"event-date event-title\\\"/>\\n <else>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"publisher-place\\\"/>\\n </else>\\n </choose>\\n <choose>\\n <if type=\\\"song\\\">\\n <!-- Album catalogue number follows label name (CMOS18 14.163-164) -->\\n <text variable=\\\"number\\\"/>\\n </if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-publication-publisher-note\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"thesis\\\" variable=\\\"publisher\\\">\\n <text variable=\\\"publisher\\\"/>\\n </if>\\n <else-if variable=\\\"publisher\\\">\\n <group delimiter=\\\": \\\">\\n <!-- <text variable=\\\"publisher-place\\\"/> -->\\n <text variable=\\\"publisher\\\"/>\\n </group>\\n </else-if>\\n <!-- TODO: remove conditional when Zotero fixes double-mapping of `event-place` -->\\n <else-if match=\\\"any\\\" variable=\\\"event-date event-title\\\"/>\\n <else>\\n <text variable=\\\"publisher-place\\\"/>\\n </else>\\n </choose>\\n <choose>\\n <if type=\\\"song\\\">\\n <!-- Album catalogue number follows label name (CMOS18 14.163-164) -->\\n <text variable=\\\"number\\\"/>\\n </if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-publication-publisher-original-bib\\\">\\n <choose>\\n <if variable=\\\"original-publisher\\\">\\n <group delimiter=\\\": \\\">\\n <!-- <text text-case=\\\"capitalize-first\\\" variable=\\\"original-publisher-place\\\"/> -->\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"original-publisher\\\"/>\\n </group>\\n </if>\\n <else>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"original-publisher-place\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-publication-publisher-original-note\\\">\\n <choose>\\n <if variable=\\\"original-publisher\\\">\\n <group delimiter=\\\": \\\">\\n <!-- <text variable=\\\"original-publisher-place\\\"/> -->\\n <text variable=\\\"original-publisher\\\"/>\\n </group>\\n </if>\\n <else>\\n <text variable=\\\"original-publisher-place\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <!-- 4.6. Date -->\\n <!-- Date elements -->\\n <macro name=\\\"source-date-issued-full\\\">\\n <!-- Give full date for more ephemeral types -->\\n <!-- NB: any changes must also be applied to `source-date-original-full` -->\\n <choose>\\n <if type=\\\"personal_communication\\\" variable=\\\"event-date issued\\\">\\n <!-- Provide issue date for letters listed under event-date -->\\n <text macro=\\\"date-issued-year\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"DOI URL\\\">\\n <!-- Online reference works use full dates (CMOS18 14.131) -->\\n <text macro=\\\"date-issued-full\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"date-issued-year\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"article broadcast collection dataset document event graphic manuscript map patent performance personal_communication post software song speech standard webpage\\\">\\n <text macro=\\\"date-issued-full\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <text macro=\\\"source-date-issued-full-serial\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"date-issued-year\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <text macro=\\\"source-date-issued-full-serial\\\"/>\\n </else-if>\\n <!-- monographic types -->\\n <else-if variable=\\\"issued\\\">\\n <text macro=\\\"date-issued-year\\\"/>\\n </else-if>\\n <else-if variable=\\\"event-date\\\">\\n <text macro=\\\"date-event-year\\\"/>\\n </else-if>\\n <else-if variable=\\\"available-date\\\">\\n <date date-parts=\\\"year\\\" form=\\\"numeric\\\" variable=\\\"available-date\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-date-issued-full-serial\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-magazine article-newspaper\\\">\\n <!-- magazines and newspapers provide the full date in place of volume/issue numbers (CMOS18 14.87, 14.89) -->\\n <text macro=\\\"date-issued-full\\\"/>\\n </if>\\n <else-if variable=\\\"issue volume\\\">\\n <text macro=\\\"date-issued-year\\\"/>\\n <!-- for CMOS17: -->\\n <!-- <text macro=\\\"date-issued-year-month\\\"/> -->\\n </else-if>\\n <else-if variable=\\\"supplement-number\\\">\\n <text macro=\\\"date-issued-year\\\"/>\\n <!-- for CMOS17: -->\\n <!-- <text macro=\\\"date-issued-year-month\\\"/> -->\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"issue volume\\\">\\n <text macro=\\\"date-issued-year-month\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"date-issued-full\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-date-issued-or-status\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"event-date issued\\\">\\n <text macro=\\\"source-date-issued-full\\\"/>\\n </if>\\n <else-if variable=\\\"status\\\">\\n <text text-case=\\\"lowercase\\\" variable=\\\"status\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview personal_communication\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\">\\n <!-- only give n.d. for accessible personal communication (CMOS18 14.111)-->\\n <text form=\\\"short\\\" term=\\\"no date\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <!-- types with unusual reference (CMOS18 14.44, 14.127) -->\\n <else-if match=\\\"any\\\" type=\\\"classic collection entry entry-dictionary entry-encyclopedia webpage\\\"/>\\n <else-if type=\\\"manuscript\\\">\\n <!-- do not give n.d. with a bare shelfmark -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"container-title event-date event-place event-title genre title publisher publisher-place\\\">\\n <text form=\\\"short\\\" term=\\\"no date\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <else-if type=\\\"article-journal\\\">\\n <choose>\\n <if variable=\\\"available-date\\\">\\n <!-- label journal articles available but not yet formally published as 'forthcoming' (CMOS18 14.75) -->\\n <text term=\\\"forthcoming\\\"/>\\n </if>\\n <else>\\n <text form=\\\"short\\\" term=\\\"no date\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else>\\n <text form=\\\"short\\\" term=\\\"no date\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-date-original\\\">\\n <text macro=\\\"source-date-original-full\\\"/>\\n <!-- for author-date 18th edition: -->\\n <!-- <text macro=\\\"source-date-original-month-day\\\"/> -->\\n </macro>\\n <macro name=\\\"source-date-original-full\\\">\\n <!-- Give full date for more ephemeral types -->\\n <!-- Macro derived from `source-date-issued-full` -->\\n <choose>\\n <if type=\\\"personal_communication\\\" variable=\\\"event-date original-date\\\">\\n <!-- Provide original date for letters listed under event-date -->\\n <text macro=\\\"date-original-year\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"DOI URL\\\">\\n <!-- Online reference works use full dates (CMOS18 14.131) -->\\n <text macro=\\\"date-original-full\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"date-original-year\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"article broadcast collection dataset document event graphic manuscript map patent performance personal_communication post software song speech standard webpage\\\">\\n <text macro=\\\"date-original-full\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <!-- serial types -->\\n <text macro=\\\"source-date-original-full-serial\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"date-original-year\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <text macro=\\\"source-date-original-full-serial\\\"/>\\n </else-if>\\n <else>\\n <!-- monographic types -->\\n <text macro=\\\"date-original-year\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-date-original-full-serial\\\">\\n <choose>\\n <if variable=\\\"issue volume\\\">\\n <text macro=\\\"date-original-year\\\"/>\\n <!-- for CMOS17: -->\\n <!-- <text macro=\\\"date-original-year-month\\\"/> -->\\n </if>\\n <else-if variable=\\\"supplement-number\\\">\\n <text macro=\\\"date-original-year\\\"/>\\n <!-- for CMOS17: -->\\n <!-- <text macro=\\\"date-original-year-month\\\"/> -->\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"issue volume\\\">\\n <text macro=\\\"date-original-year-month\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"date-original-full\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-date-status-bib\\\">\\n <choose>\\n <if type=\\\"broadcast\\\" variable=\\\"event-title issued status\\\"/>\\n <!-- on a `broadcast`, if there is an `event-title`, `status` appears with `event-date` as part of `source-event` (CMOS18 14.165) -->\\n <else-if variable=\\\"issued status\\\">\\n <!-- `status` specifies date type, e.g. 'effective', 'last modified', 'approved' (CMOS18 14.104 for `webpage`; CMOS18 14.159 for `standard`) -->\\n <choose>\\n <if type=\\\"webpage\\\" variable=\\\"container-title\\\">\\n <text variable=\\\"status\\\"/>\\n </if>\\n <else-if type=\\\"webpage\\\" variable=\\\"author publisher\\\">\\n <text variable=\\\"status\\\"/>\\n </else-if>\\n <else-if type=\\\"webpage\\\" variable=\\\"translator publisher\\\">\\n <text variable=\\\"status\\\"/>\\n </else-if>\\n <else-if type=\\\"webpage\\\">\\n <!-- capitalize `status` if there is nothing else after the `title` (either no website title or substituted publisher) -->\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"status\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" variable=\\\"original-date original-publisher original-publisher-place original-title publisher\\\">\\n <text variable=\\\"status\\\"/>\\n </else-if>\\n <else>\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"status\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else-if type=\\\"broadcast\\\" variable=\\\"issued URL\\\"/>\\n <else-if type=\\\"broadcast\\\" variable=\\\"issued\\\">\\n <!-- `status` of a radio or TV broadcast is 'aired' if unspecified (CMOS18 14.165) -->\\n <text text-case=\\\"capitalize-first\\\" value=\\\"aired\\\"/>\\n </else-if>\\n <else-if type=\\\"software\\\" variable=\\\"issued publisher\\\">\\n <!-- `status` of software is 'released' if unspecified (CMOS18 14.169) -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"author chair collection-editor compiler composer contributor curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator\\\">\\n <!-- lowercase if `publisher` is adjacent -->\\n <text value=\\\"released\\\"/>\\n </if>\\n <else>\\n <text text-case=\\\"capitalize-first\\\" value=\\\"released\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n <else-if type=\\\"software\\\" variable=\\\"original-date\\\">\\n <!-- lowercase if `original-date` is adjacent -->\\n <text value=\\\"released\\\"/>\\n </else-if>\\n <else-if type=\\\"software\\\" variable=\\\"issued\\\">\\n <!-- capitalize if `publisher` is not present -->\\n <text text-case=\\\"capitalize-first\\\" value=\\\"released\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-date-status-note\\\">\\n <choose>\\n <if type=\\\"broadcast\\\" variable=\\\"event-title issued status\\\"/>\\n <!-- on a `broadcast`, if there is an `event-title`, `status` appears with `event-date` as part of `source-event` (CMOS18 14.165) -->\\n <else-if variable=\\\"issued status\\\">\\n <!-- `status` specifies date type, e.g. 'effective', 'last modified', 'approved' (CMOS18 14.104 for `webpage`; CMOS18 14.159 for `standard`) -->\\n <text variable=\\\"status\\\"/>\\n </else-if>\\n <else-if type=\\\"broadcast\\\" variable=\\\"issued DOI\\\"/>\\n <else-if type=\\\"broadcast\\\" variable=\\\"issued URL\\\"/>\\n <else-if type=\\\"broadcast\\\" variable=\\\"issued\\\">\\n <!-- `status` of a radio or TV broadcast is 'aired' if unspecified (CMOS18 14.165) -->\\n <text value=\\\"aired\\\"/>\\n </else-if>\\n <else-if type=\\\"software\\\" variable=\\\"issued\\\">\\n <!-- `status` of software is 'released' if unspecified (CMOS18 14.169) -->\\n <text value=\\\"released\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <!-- 4.7. Locator (including page references) -->\\n <macro name=\\\"source-locator-subsequent\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"article-journal article-magazine article-newspaper periodical post-weblog review review-book\\\">\\n <text macro=\\\"source-locator-subsequent-serial\\\"/>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"collection-editor compiler editor editorial-director\\\">\\n <!-- monographic types -->\\n <text macro=\\\"source-locator-subsequent-monographic\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"interview paper-conference\\\">\\n <!-- serial types -->\\n <text macro=\\\"source-locator-subsequent-serial\\\"/>\\n </else-if>\\n <else>\\n <text macro=\\\"source-locator-subsequent-monographic\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"source-locator-subsequent-monographic\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <!-- Do not provide `volume` or `part-number` for defined section -->\\n <text macro=\\\"label-locator\\\"/>\\n </if>\\n <else-if variable=\\\"part-number\\\">\\n <!-- label page numbers to balance a part number (CMOS18 14.50) -->\\n <text macro=\\\"label-volume\\\"/>\\n <text macro=\\\"label-part-number\\\"/>\\n <text macro=\\\"label-locator-all\\\"/>\\n </else-if>\\n <else-if is-numeric=\\\"volume\\\" locator=\\\"page\\\">\\n <!-- separate a volume and page number with a colon (CMOS18 14.18) -->\\n <group delimiter=\\\":\\\">\\n <text variable=\\\"volume\\\"/>\\n <text variable=\\\"locator\\\"/>\\n </group>\\n </else-if>\\n <else>\\n <text macro=\\\"label-volume\\\"/>\\n <text macro=\\\"label-locator\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"source-locator-subsequent-serial\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"part-number\\\">\\n <!-- label page numbers when using multiple locators (CMOS18 14.50) -->\\n <text macro=\\\"label-part-number\\\"/>\\n <text macro=\\\"label-locator-all\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"label-locator\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- 4.8. Medium -->\\n <macro name=\\\"source-medium-bib\\\">\\n <group delimiter=\\\", \\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"medium\\\"/>\\n <text variable=\\\"scale\\\"/>\\n <text variable=\\\"dimensions\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"source-medium-note\\\">\\n <group delimiter=\\\", \\\">\\n <text variable=\\\"medium\\\"/>\\n <text variable=\\\"scale\\\"/>\\n <text variable=\\\"dimensions\\\"/>\\n </group>\\n </macro>\\n <!-- 4.9. Archival location -->\\n <macro name=\\\"source-archive-bib\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"graphic\\\">\\n <text macro=\\\"source-archive-reference-institution-first\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"source-archive-reference-location-first-bib\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"source-archive-database-number\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"source-archive-note\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if type=\\\"graphic\\\">\\n <text macro=\\\"source-archive-reference-institution-first\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"source-archive-reference-location-first-note\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"source-archive-database-number\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n </group>\\n </macro>\\n <!-- Archival elements -->\\n <macro name=\\\"source-archive-database-number\\\">\\n <!-- database identifier, if not included elsewhere (CMOS18 14.113) -->\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"archive_collection archive_location archive-place\\\"/>\\n <!-- `number` never shown elsewhere with a thesis -->\\n <else-if type=\\\"thesis\\\">\\n <text variable=\\\"number\\\"/>\\n </else-if>\\n <!-- `number` shown with `genre` -->\\n <else-if match=\\\"any\\\" type=\\\"dataset entry song\\\" variable=\\\"genre\\\"/>\\n <else-if variable=\\\"archive\\\">\\n <text variable=\\\"number\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-archive-locator\\\">\\n <choose>\\n <!-- physical locators with archival references appear after the shelfmark (CMOS18 14.127) -->\\n <if locator=\\\"column\\\" variable=\\\"archive archive_location\\\">\\n <!-- archival locators must always be labelled to avoid confusion with `archive_location` (CMOS18 14.123) -->\\n <text macro=\\\"label-locator-all\\\"/>\\n </if>\\n <else-if locator=\\\"folio\\\" variable=\\\"archive archive_location\\\">\\n <text macro=\\\"label-locator-all\\\"/>\\n </else-if>\\n <else-if locator=\\\"page\\\" variable=\\\"archive archive_location\\\">\\n <text macro=\\\"label-locator-all\\\"/>\\n </else-if>\\n <else-if variable=\\\"archive archive_location page\\\">\\n <choose>\\n <if is-numeric=\\\"page\\\">\\n <!-- TODO: remove this conditional when `page` parsing is fixed for different locator types -->\\n <text macro=\\\"label-page\\\"/>\\n </if>\\n <else>\\n <text variable=\\\"page\\\"/>\\n </else>\\n </choose>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"source-archive-reference-institution-first\\\">\\n <!-- Archive (gallery) name first for art (CMOS18 14.133) -->\\n <group delimiter=\\\", \\\">\\n <text variable=\\\"archive\\\"/>\\n <text variable=\\\"archive-place\\\"/>\\n <text variable=\\\"archive_collection\\\"/>\\n <text variable=\\\"archive_location\\\"/>\\n <text macro=\\\"source-archive-locator\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"source-archive-reference-location-first-bib\\\">\\n <!-- Order of elements begins with the most specific (CMOS18 14.128) -->\\n <group delimiter=\\\". \\\">\\n <group delimiter=\\\", \\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"archive_location\\\"/>\\n <text macro=\\\"source-archive-locator\\\"/>\\n </group>\\n <text variable=\\\"archive_collection\\\"/>\\n <group delimiter=\\\", \\\">\\n <text variable=\\\"archive\\\"/>\\n <text variable=\\\"archive-place\\\"/>\\n </group>\\n </group>\\n </macro>\\n <macro name=\\\"source-archive-reference-location-first-note\\\">\\n <!-- Order of elements begins with the most specific (CMOS18 14.127) -->\\n <group delimiter=\\\", \\\">\\n <text variable=\\\"archive_location\\\"/>\\n <text macro=\\\"source-archive-locator\\\"/>\\n <text variable=\\\"archive_collection\\\"/>\\n <text variable=\\\"archive\\\"/>\\n <text variable=\\\"archive-place\\\"/>\\n </group>\\n </macro>\\n <!-- 4.10. URL or persistent identifier -->\\n <macro name=\\\"source-date-accessed-DOI-URL-bib\\\">\\n <group delimiter=\\\". \\\">\\n <choose>\\n <if variable=\\\"DOI\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"available-date event-date issued status\\\"/>\\n <else-if variable=\\\"accessed URL\\\">\\n <group delimiter=\\\" \\\">\\n <text term=\\\"accessed\\\" text-case=\\\"capitalize-first\\\"/>\\n <date form=\\\"text\\\" variable=\\\"accessed\\\"/>\\n </group>\\n </else-if>\\n </choose>\\n <text macro=\\\"source-DOI-URL\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"source-date-accessed-DOI-URL-note\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if variable=\\\"DOI\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"available-date event-date issued status\\\"/>\\n <else-if variable=\\\"accessed URL\\\">\\n <group delimiter=\\\" \\\">\\n <text term=\\\"accessed\\\"/>\\n <date form=\\\"text\\\" variable=\\\"accessed\\\"/>\\n </group>\\n </else-if>\\n </choose>\\n <text macro=\\\"source-DOI-URL\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"source-DOI-URL\\\">\\n <choose>\\n <if variable=\\\"DOI\\\">\\n <text prefix=\\\"https://doi.org/\\\" variable=\\\"DOI\\\"/>\\n </if>\\n <else-if variable=\\\"URL\\\">\\n <text variable=\\\"URL\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <!-- 5. Notes -->\\n <!-- TODO: add variables for distributor and exhibitions if available in CSL -->\\n <!-- 6. Legal references: Bluebook style (shared with APA) -->\\n <!-- Where APA or Chicago diverge from Bluebook, the official manual is followed -->\\n <macro name=\\\"legal-reference\\\">\\n <!-- Type usage:\\n\\n `bill`\\n : bills, resolutions, federal reports\\n\\n `legal_case`\\n : all legal and court cases\\n\\n `hearing`\\n : hearings and testimony\\n\\n `legislation`\\n : statutes, constitutional items, and charters\\n\\n `regulation`\\n : codified regulations, uncodified regulations, executive orders\\n\\n `treaty`\\n : treaties\\n -->\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if type=\\\"treaty\\\">\\n <text macro=\\\"legal-title\\\"/>\\n <names variable=\\\"author\\\">\\n <!-- Treaty parties should be included at least for bilateral treaties (Bluebook 21.4.2) -->\\n <name delimiter=\\\"-\\\" et-al-min=\\\"100\\\" et-al-use-first=\\\"99\\\" form=\\\"short\\\" initialize=\\\"false\\\"/>\\n </names>\\n <text macro=\\\"legal-date\\\"/>\\n <!-- treaty source/report in addition to URL (Bluebook 21.4.5) -->\\n <text macro=\\\"legal-source\\\"/>\\n </if>\\n <else>\\n <group delimiter=\\\" \\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"legal-title\\\"/>\\n <text macro=\\\"legal-source\\\"/>\\n </group>\\n <text macro=\\\"legal-date\\\"/>\\n <text macro=\\\"legal-identifier\\\"/>\\n </group>\\n </else>\\n </choose>\\n <group delimiter=\\\" \\\">\\n <!-- locator for use in notes -->\\n <choose>\\n <if locator=\\\"page\\\" variable=\\\"page\\\">\\n <text term=\\\"at\\\"/>\\n </if>\\n </choose>\\n <text macro=\\\"label-locator\\\"/>\\n </group>\\n </group>\\n </macro>\\n <!-- 6.1. Legal date -->\\n <macro name=\\\"legal-date\\\">\\n <choose>\\n <if type=\\\"treaty\\\">\\n <text macro=\\\"date-issued-full\\\"/>\\n </if>\\n <else-if type=\\\"legal_case\\\">\\n <text macro=\\\"legal-date-case\\\"/>\\n </else-if>\\n <else-if match=\\\"any\\\" type=\\\"bill hearing legislation regulation\\\">\\n <group delimiter=\\\" \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"date-original-year\\\"/>\\n <text form=\\\"symbol\\\" term=\\\"and\\\"/>\\n </group>\\n <choose>\\n <if variable=\\\"issued\\\">\\n <text macro=\\\"date-issued-year\\\"/>\\n </if>\\n <else>\\n <!-- Show proposal date for uncodified regulations. Assume date is entered literally ala \\\"proposed May 23, 2016\\\". -->\\n <!-- TODO: Add `proposed` date here if that becomes available -->\\n <date form=\\\"text\\\" variable=\\\"submitted\\\"/>\\n </else>\\n </choose>\\n </group>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"legal-date-case\\\">\\n <group delimiter=\\\" \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <text variable=\\\"authority\\\"/>\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <!-- Print only year for cases published in reporters-->\\n <text macro=\\\"date-issued-year\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"date-issued-full\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- 6.2.1. Legal title -->\\n <macro name=\\\"legal-title\\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"bill legal_case legislation regulation treaty\\\">\\n <text text-case=\\\"title\\\" variable=\\\"title\\\"/>\\n </if>\\n <else-if type=\\\"hearing\\\">\\n <!-- use standard format (Bluebook 13.3) -->\\n <group delimiter=\\\": \\\" font-style=\\\"italic\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"title\\\"/>\\n <group delimiter=\\\" \\\">\\n <text term=\\\"hearing\\\" text-case=\\\"capitalize-first\\\"/>\\n <group delimiter=\\\" \\\">\\n <text term=\\\"on\\\"/>\\n <text variable=\\\"number\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <text value=\\\"before the\\\"/>\\n <text variable=\\\"section\\\"/>\\n </group>\\n </group>\\n </group>\\n </else-if>\\n </choose>\\n </macro>\\n <!-- 6.2.2. Legal identifier -->\\n <macro name=\\\"legal-identifier\\\">\\n <group delimiter=\\\" \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <choose>\\n <if type=\\\"hearing\\\">\\n <!-- Use the 'verb' form of the hearing term to hold 'testimony of' -->\\n <text form=\\\"verb\\\" term=\\\"hearing\\\"/>\\n <names variable=\\\"author\\\">\\n <name and=\\\"symbol\\\" initialize=\\\"false\\\"/>\\n </names>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"bill legislation regulation\\\">\\n <!-- For uncodified regulations, assume future code section is in `status`. -->\\n <text variable=\\\"status\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"legal-identifier-bill-report\\\">\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"genre\\\"/>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"authority chapter-number container-title\\\">\\n <text variable=\\\"number\\\"/>\\n </if>\\n <else>\\n <!-- If there is no legislative body, session number, or code/record title, assume the item is a congressional report and include 'No.' label. -->\\n <text macro=\\\"label-number-capitalized\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- 6.3. Legal source -->\\n <macro name=\\\"legal-source\\\">\\n <!-- Expect legal item `container-title` to be stored in short form -->\\n <choose>\\n <if type=\\\"bill\\\">\\n <text macro=\\\"legal-source-bill\\\"/>\\n </if>\\n <else-if type=\\\"hearing\\\">\\n <text macro=\\\"legal-source-hearing\\\"/>\\n </else-if>\\n <else-if type=\\\"legal_case\\\">\\n <text macro=\\\"legal-source-case\\\"/>\\n </else-if>\\n <else-if type=\\\"legislation\\\">\\n <text macro=\\\"legal-source-legislation\\\"/>\\n </else-if>\\n <else-if type=\\\"regulation\\\">\\n <text macro=\\\"legal-source-regulation\\\"/>\\n </else-if>\\n <else-if type=\\\"treaty\\\">\\n <text macro=\\\"legal-source-treaty\\\"/>\\n </else-if>\\n </choose>\\n </macro>\\n <!-- Legal source types -->\\n <macro name=\\\"legal-source-bill\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"legal-identifier-bill-report\\\"/>\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"authority\\\"/>\\n <!-- `chapter-number` is a session number -->\\n <text variable=\\\"chapter-number\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"volume\\\"/>\\n <text variable=\\\"container-title\\\"/>\\n <text variable=\\\"page-first\\\"/>\\n </group>\\n </group>\\n </macro>\\n <macro name=\\\"legal-source-case\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <text variable=\\\"volume\\\"/>\\n <text variable=\\\"container-title\\\"/>\\n <text macro=\\\"label-section-symbol\\\"/>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"page page-first\\\">\\n <text variable=\\\"page-first\\\"/>\\n </if>\\n <else>\\n <text value=\\\"___\\\"/>\\n </else>\\n </choose>\\n </if>\\n <else>\\n <text macro=\\\"label-number-capitalized\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"legal-source-hearing\\\">\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"authority\\\"/>\\n <!-- `chapter-number` is a session number -->\\n <text variable=\\\"chapter-number\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"legal-source-legislation\\\">\\n <choose>\\n <if variable=\\\"number\\\">\\n <!-- `number` is a public law number -->\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if variable=\\\"genre\\\">\\n <text text-case=\\\"capitalize-first\\\" variable=\\\"genre\\\"/>\\n </if>\\n <else>\\n <text form=\\\"short\\\" term=\\\"legislation\\\" text-case=\\\"capitalize-first\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"label-number-capitalized\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"volume\\\"/>\\n <text variable=\\\"container-title\\\"/>\\n <text variable=\\\"page-first\\\"/>\\n </group>\\n </group>\\n </if>\\n <else>\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"volume\\\"/>\\n <text variable=\\\"container-title\\\"/>\\n <choose>\\n <if variable=\\\"section\\\">\\n <text macro=\\\"label-section-symbol\\\"/>\\n </if>\\n <else>\\n <text variable=\\\"page-first\\\"/>\\n </else>\\n </choose>\\n </group>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"legal-source-regulation\\\">\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"genre\\\"/>\\n <text macro=\\\"label-number-capitalized\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"volume\\\"/>\\n <text variable=\\\"container-title\\\"/>\\n <choose>\\n <if variable=\\\"section\\\">\\n <text macro=\\\"label-section-symbol\\\"/>\\n </if>\\n <else>\\n <text variable=\\\"page-first\\\"/>\\n </else>\\n </choose>\\n </group>\\n </group>\\n </macro>\\n <macro name=\\\"legal-source-treaty\\\">\\n <group delimiter=\\\" \\\">\\n <number variable=\\\"volume\\\"/>\\n <text variable=\\\"container-title\\\"/>\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"page page-first\\\">\\n <text variable=\\\"page-first\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"label-number-capitalized\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <!-- Citation -->\\n <macro name=\\\"citation-notes-full\\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"bill hearing legal_case legislation regulation treaty\\\">\\n <!-- Legal items have different orders and delimiters -->\\n <text macro=\\\"legal-reference\\\"/>\\n <text macro=\\\"source-date-accessed-DOI-URL-note\\\"/>\\n </if>\\n <else-if type=\\\"personal_communication\\\" variable=\\\"genre\\\">\\n <text macro=\\\"author-note\\\"/>\\n <text macro=\\\"title-and-source-note\\\"/>\\n </else-if>\\n <else-if type=\\\"personal_communication\\\" variable=\\\"author recipient\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"author-note\\\"/>\\n <text macro=\\\"title-and-source-note\\\"/>\\n </group>\\n </else-if>\\n <else>\\n <text macro=\\\"author-note\\\"/>\\n <text macro=\\\"title-and-source-note\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"citation-notes-shortened-author-title\\\">\\n <!-- Shortened note styles mirror the filtering approach of author-date -->\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"part-number volume\\\">\\n <!-- comma always needed with volume/part -->\\n <text macro=\\\"citation-notes-shortened-author-title-item\\\"/>\\n <text macro=\\\"source-locator-subsequent\\\"/>\\n </if>\\n <else-if match=\\\"none\\\" type=\\\"classic\\\">\\n <text macro=\\\"citation-notes-shortened-author-title-item\\\"/>\\n <text macro=\\\"source-locator-subsequent\\\"/>\\n </else-if>\\n <!-- with `classic`, a non-numeric canonical reference or identifying number is separated by a space rather than a comma (CMOS18 14.145) -->\\n <else-if is-numeric=\\\"locator\\\">\\n <text macro=\\\"citation-notes-shortened-author-title-item\\\"/>\\n <text macro=\\\"source-locator-subsequent\\\"/>\\n </else-if>\\n <else-if locator=\\\"chapter line verse\\\" match=\\\"any\\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"citation-notes-shortened-author-title-item\\\"/>\\n <text macro=\\\"source-locator-subsequent\\\"/>\\n </group>\\n </else-if>\\n <else>\\n <text macro=\\\"citation-notes-shortened-author-title-item\\\"/>\\n <text macro=\\\"source-locator-subsequent\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <macro name=\\\"citation-notes-shortened-author-title-item\\\">\\n <group delimiter=\\\" \\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"author-short\\\"/>\\n <choose>\\n <if match=\\\"any\\\" type=\\\"bill hearing legal_case legislation regulation treaty\\\"/>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if locator=\\\"sub-verbo\\\"/>\\n <!-- Only print reference entries use `sub-verbo` (CMOS18 14.131) -->\\n <else-if match=\\\"any\\\" variable=\\\"DOI URL\\\"/>\\n <else-if variable=\\\"container-title title\\\">\\n <text form=\\\"short\\\" term=\\\"sub-verbo\\\"/>\\n </else-if>\\n </choose>\\n <text macro=\\\"title-and-descriptions-short\\\"/>\\n </group>\\n </else-if>\\n <else>\\n <text macro=\\\"title-and-descriptions-short\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"citation-notes-shortened-author-title-disambiguate\\\"/>\\n <choose>\\n <!-- inaccessible `interview` or `personal_communication` uses in-text format (CMOS18 14.111): give the date at the first citation in shortened notes -->\\n <if match=\\\"any\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\"/>\\n <else-if position=\\\"first\\\" type=\\\"interview\\\">\\n <text macro=\\\"date-short\\\"/>\\n <text macro=\\\"source-medium-note\\\"/>\\n </else-if>\\n <else-if position=\\\"first\\\" type=\\\"personal_communication\\\">\\n <text macro=\\\"source-medium-note\\\"/>\\n </else-if>\\n </choose>\\n <text macro=\\\"source-monographic-publication-short-unbracketed\\\"/>\\n </group>\\n <text macro=\\\"source-monographic-publication-short-bracketed\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"citation-notes-shortened-author-title-disambiguate\\\">\\n <!-- CMOS18 gives examples of added dates (CMOS18 14.13) and editors/translators, publisher, date (CMOS18 14.146) -->\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if disambiguate=\\\"true\\\">\\n <choose>\\n <if disambiguate=\\\"true\\\">\\n <text macro=\\\"label-version\\\"/>\\n <text macro=\\\"label-edition\\\"/>\\n </if>\\n </choose>\\n <names variable=\\\"editor-translator\\\">\\n <label form=\\\"verb-short\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" form=\\\"short\\\" initialize=\\\"true\\\"/>\\n <substitute>\\n <names variable=\\\"editor\\\"/>\\n <names variable=\\\"translator\\\"/>\\n </substitute>\\n </names>\\n </if>\\n </choose>\\n </group>\\n </macro>\\n <citation disambiguate-add-givenname=\\\"true\\\" disambiguate-add-names=\\\"true\\\" et-al-min=\\\"3\\\" et-al-use-first=\\\"1\\\">\\n <layout delimiter=\\\"; \\\" suffix=\\\".\\\">\\n <choose>\\n <if position=\\\"subsequent\\\">\\n <text macro=\\\"citation-notes-shortened-author-title\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"citation-notes-full\\\"/>\\n </else>\\n </choose>\\n </layout>\\n </citation>\\n <!-- Bibliography -->\\n <macro name=\\\"bibliography-notes\\\">\\n <group delimiter=\\\". \\\">\\n <choose>\\n <if match=\\\"any\\\" type=\\\"bill hearing legal_case legislation regulation treaty\\\">\\n <!-- Legal items have different orders and delimiters -->\\n <text macro=\\\"legal-reference\\\"/>\\n <text macro=\\\"source-date-accessed-DOI-URL-bib\\\"/>\\n <text variable=\\\"references\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"author-bib\\\"/>\\n <text macro=\\\"title-and-source-bib\\\"/>\\n <text variable=\\\"references\\\"/>\\n </else>\\n </choose>\\n </group>\\n </macro>\\n <bibliography et-al-min=\\\"7\\\" et-al-use-first=\\\"3\\\" hanging-indent=\\\"true\\\">\\n <sort>\\n <key macro=\\\"author-sort\\\"/>\\n <key macro=\\\"title-and-descriptions-bib\\\"/>\\n <key macro=\\\"source-bib\\\"/>\\n <key variable=\\\"volume\\\"/>\\n <key variable=\\\"part-number\\\"/>\\n <key variable=\\\"event-date\\\"/>\\n <key macro=\\\"source-date-issued-or-status\\\"/>\\n <key macro=\\\"source-archive-bib\\\"/>\\n </sort>\\n <layout suffix=\\\".\\\">\\n <choose>\\n <if type=\\\"classic\\\">\\n <choose>\\n <if match=\\\"any\\\" variable=\\\"archive editor translator publisher\\\">\\n <text macro=\\\"bibliography-notes\\\"/>\\n </if>\\n </choose>\\n </if>\\n <else-if match=\\\"any\\\" type=\\\"entry entry-dictionary entry-encyclopedia\\\">\\n <choose>\\n <if variable=\\\"author\\\">\\n <!-- Signed reference entries appear in the bibliography (CMOS18 14.132) -->\\n <text macro=\\\"bibliography-notes\\\"/>\\n </if>\\n </choose>\\n </else-if>\\n <!-- social media content omitted from the bibliography (new in CMOS18 14.106; included in CMOS17 14.209) -->\\n <else-if type=\\\"post\\\"/>\\n <else-if match=\\\"any\\\" variable=\\\"archive archive-place container-title DOI number publisher references URL\\\">\\n <text macro=\\\"bibliography-notes\\\"/>\\n </else-if>\\n <!-- Personal communications only appear in the bibliography if the reader can retrieve them (CMOS18 14.13, 14.111) -->\\n <else-if match=\\\"any\\\" type=\\\"interview personal_communication\\\"/>\\n <!-- In note styles, the bibliography also omits inaccessible manuscripts (CMOS18 14.114), conference papers (new in CMOS18 14.115; included in CMOS17 14.217), and private documents (CMOS18 14.118) -->\\n <else-if match=\\\"any\\\" type=\\\"document manuscript paper-conference speech\\\"/>\\n <else>\\n <text macro=\\\"bibliography-notes\\\"/>\\n </else>\\n </choose>\\n </layout>\\n </bibliography>\\n</style>\\n\",\"ieee\":\"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n<style xmlns=\\\"http://purl.org/net/xbiblio/csl\\\" class=\\\"in-text\\\" version=\\\"1.0\\\" demote-non-dropping-particle=\\\"sort-only\\\">\\n <info>\\n <title>IEEE Reference Guide version 11.29.2023</title>\\n <title-short>Institute of Electrical and Electronics Engineers</title-short>\\n <id>http://www.zotero.org/styles/ieee</id>\\n <link href=\\\"http://www.zotero.org/styles/ieee\\\" rel=\\\"self\\\"/>\\n <link href=\\\"https://journals.ieeeauthorcenter.ieee.org/your-role-in-article-production/ieee-editorial-style-manual/\\\" rel=\\\"documentation\\\"/>\\n <author>\\n <name>Michael Berkowitz</name>\\n <email>mberkowi@gmu.edu</email>\\n </author>\\n <contributor>\\n <name>Julian Onions</name>\\n <email>julian.onions@gmail.com</email>\\n </contributor>\\n <contributor>\\n <name>Rintze Zelle</name>\\n <uri>http://twitter.com/rintzezelle</uri>\\n </contributor>\\n <contributor>\\n <name>Stephen Frank</name>\\n <uri>http://www.zotero.org/sfrank</uri>\\n </contributor>\\n <contributor>\\n <name>Sebastian Karcher</name>\\n </contributor>\\n <contributor>\\n <name>Giuseppe Silano</name>\\n <email>g.silano89@gmail.com</email>\\n <uri>http://giuseppesilano.net</uri>\\n </contributor>\\n <contributor>\\n <name>Patrick O'Brien</name>\\n </contributor>\\n <contributor>\\n <name>Brenton M. Wiernik</name>\\n </contributor>\\n <contributor>\\n <name>Oliver Couch</name>\\n <email>oliver.couch@gmail.com</email>\\n </contributor>\\n <contributor>\\n <name>Andrew Dunning</name>\\n <uri>https://orcid.org/0000-0003-0464-5036</uri>\\n </contributor>\\n <category citation-format=\\\"numeric\\\"/>\\n <category field=\\\"engineering\\\"/>\\n <category field=\\\"generic-base\\\"/>\\n <summary>IEEE style as per the 2023 guidelines.</summary>\\n <updated>2024-03-27T11:41:27+00:00</updated>\\n <rights license=\\\"http://creativecommons.org/licenses/by-sa/3.0/\\\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\\n </info>\\n <locale xml:lang=\\\"en\\\">\\n <date form=\\\"text\\\">\\n <date-part name=\\\"month\\\" form=\\\"short\\\" suffix=\\\" \\\"/>\\n <date-part name=\\\"day\\\" form=\\\"numeric-leading-zeros\\\" suffix=\\\", \\\"/>\\n <date-part name=\\\"year\\\"/>\\n </date>\\n <terms>\\n <term name=\\\"chapter\\\" form=\\\"short\\\">ch.</term>\\n <term name=\\\"chapter-number\\\" form=\\\"short\\\">ch.</term>\\n <term name=\\\"presented at\\\">presented at the</term>\\n <term name=\\\"available at\\\">available</term>\\n <!-- always use three-letter abbreviations for months -->\\n <term name=\\\"month-06\\\" form=\\\"short\\\">Jun.</term>\\n <term name=\\\"month-07\\\" form=\\\"short\\\">Jul.</term>\\n <term name=\\\"month-09\\\" form=\\\"short\\\">Sep.</term>\\n </terms>\\n </locale>\\n <!-- Macros -->\\n <macro name=\\\"status\\\">\\n <choose>\\n <if variable=\\\"page issue volume\\\" match=\\\"none\\\">\\n <text variable=\\\"status\\\" text-case=\\\"capitalize-first\\\" suffix=\\\"\\\" font-weight=\\\"bold\\\"/>\\n </if>\\n </choose>\\n </macro>\\n <macro name=\\\"edition\\\">\\n <choose>\\n <if type=\\\"bill book chapter graphic legal_case legislation motion_picture paper-conference report song\\\" match=\\\"any\\\">\\n <choose>\\n <if is-numeric=\\\"edition\\\">\\n <group delimiter=\\\" \\\">\\n <number variable=\\\"edition\\\" form=\\\"ordinal\\\"/>\\n <text term=\\\"edition\\\" form=\\\"short\\\"/>\\n </group>\\n </if>\\n <else>\\n <text variable=\\\"edition\\\" text-case=\\\"capitalize-first\\\" suffix=\\\".\\\"/>\\n </else>\\n </choose>\\n </if>\\n </choose>\\n </macro>\\n <macro name=\\\"issued\\\">\\n <choose>\\n <if type=\\\"article-journal report\\\" match=\\\"any\\\">\\n <date variable=\\\"issued\\\">\\n <date-part name=\\\"month\\\" form=\\\"short\\\" suffix=\\\" \\\"/>\\n <date-part name=\\\"year\\\" form=\\\"long\\\"/>\\n </date>\\n </if>\\n <else-if type=\\\"bill book chapter graphic legal_case legislation song thesis\\\" match=\\\"any\\\">\\n <date variable=\\\"issued\\\">\\n <date-part name=\\\"year\\\" form=\\\"long\\\"/>\\n </date>\\n </else-if>\\n <else-if type=\\\"paper-conference\\\" match=\\\"any\\\">\\n <date variable=\\\"issued\\\">\\n <date-part name=\\\"month\\\" form=\\\"short\\\"/>\\n <date-part name=\\\"year\\\" prefix=\\\" \\\"/>\\n </date>\\n </else-if>\\n <else-if type=\\\"motion_picture\\\" match=\\\"any\\\">\\n <date variable=\\\"issued\\\" form=\\\"text\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n </else-if>\\n <else>\\n <date variable=\\\"issued\\\" form=\\\"text\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"author\\\">\\n <names variable=\\\"author\\\">\\n <name and=\\\"text\\\" et-al-min=\\\"7\\\" et-al-use-first=\\\"1\\\" initialize-with=\\\". \\\"/>\\n <label form=\\\"short\\\" prefix=\\\", \\\" text-case=\\\"capitalize-first\\\"/>\\n <et-al font-style=\\\"italic\\\"/>\\n <substitute>\\n <names variable=\\\"editor\\\"/>\\n <names variable=\\\"translator\\\"/>\\n <text macro=\\\"director\\\"/>\\n </substitute>\\n </names>\\n </macro>\\n <macro name=\\\"editor\\\">\\n <names variable=\\\"editor\\\">\\n <name initialize-with=\\\". \\\" delimiter=\\\", \\\" and=\\\"text\\\"/>\\n <label form=\\\"short\\\" prefix=\\\", \\\" text-case=\\\"capitalize-first\\\"/>\\n </names>\\n </macro>\\n <macro name=\\\"director\\\">\\n <names variable=\\\"director\\\">\\n <name and=\\\"text\\\" et-al-min=\\\"7\\\" et-al-use-first=\\\"1\\\" initialize-with=\\\". \\\"/>\\n <et-al font-style=\\\"italic\\\"/>\\n </names>\\n </macro>\\n <macro name=\\\"locators\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"edition\\\"/>\\n <group delimiter=\\\" \\\">\\n <text term=\\\"volume\\\" form=\\\"short\\\"/>\\n <number variable=\\\"volume\\\" form=\\\"numeric\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <number variable=\\\"number-of-volumes\\\" form=\\\"numeric\\\"/>\\n <text term=\\\"volume\\\" form=\\\"short\\\" plural=\\\"true\\\"/>\\n </group>\\n <group delimiter=\\\" \\\">\\n <text term=\\\"issue\\\" form=\\\"short\\\"/>\\n <number variable=\\\"issue\\\" form=\\\"numeric\\\"/>\\n </group>\\n </group>\\n </macro>\\n <macro name=\\\"title\\\">\\n <choose>\\n <if type=\\\"bill book graphic legal_case legislation motion_picture song standard software\\\" match=\\\"any\\\">\\n <text variable=\\\"title\\\" font-style=\\\"italic\\\"/>\\n </if>\\n <else>\\n <text variable=\\\"title\\\" quotes=\\\"true\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"publisher\\\">\\n <choose>\\n <if type=\\\"bill book chapter graphic legal_case legislation motion_picture paper-conference song\\\" match=\\\"any\\\">\\n <group delimiter=\\\": \\\">\\n <text variable=\\\"publisher-place\\\"/>\\n <text variable=\\\"publisher\\\"/>\\n </group>\\n </if>\\n <else>\\n <group delimiter=\\\", \\\">\\n <text variable=\\\"publisher\\\"/>\\n <text variable=\\\"publisher-place\\\"/>\\n </group>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"event\\\">\\n <choose>\\n <!-- Published Conference Paper -->\\n <if type=\\\"paper-conference speech\\\" match=\\\"any\\\">\\n <choose>\\n <if variable=\\\"container-title\\\" match=\\\"any\\\">\\n <group delimiter=\\\" \\\">\\n <text term=\\\"in\\\"/>\\n <text variable=\\\"container-title\\\" font-style=\\\"italic\\\"/>\\n </group>\\n </if>\\n <!-- Unpublished Conference Paper -->\\n <else>\\n <group delimiter=\\\" \\\">\\n <text term=\\\"presented at\\\"/>\\n <text variable=\\\"event\\\"/>\\n </group>\\n </else>\\n </choose>\\n </if>\\n </choose>\\n </macro>\\n <macro name=\\\"access\\\">\\n <choose>\\n <if type=\\\"webpage post post-weblog\\\" match=\\\"any\\\">\\n <!-- https://url.com/ (accessed Mon. DD, YYYY). -->\\n <choose>\\n <if variable=\\\"URL\\\">\\n <group delimiter=\\\". \\\" prefix=\\\" \\\">\\n <group delimiter=\\\": \\\">\\n <text term=\\\"accessed\\\" text-case=\\\"capitalize-first\\\"/>\\n <date variable=\\\"accessed\\\" form=\\\"text\\\"/>\\n </group>\\n <text term=\\\"online\\\" prefix=\\\"[\\\" suffix=\\\"]\\\" text-case=\\\"capitalize-first\\\"/>\\n <group delimiter=\\\": \\\">\\n <text term=\\\"available at\\\" text-case=\\\"capitalize-first\\\"/>\\n <text variable=\\\"URL\\\"/>\\n </group>\\n </group>\\n </if>\\n </choose>\\n </if>\\n <else-if match=\\\"any\\\" variable=\\\"DOI\\\">\\n <!-- doi: 10.1000/xyz123. -->\\n <text variable=\\\"DOI\\\" prefix=\\\" doi: \\\" suffix=\\\".\\\"/>\\n </else-if>\\n <else-if variable=\\\"URL\\\">\\n <!-- Accessed: Mon. DD, YYYY. [Medium]. Available: https://URL.com/ -->\\n <group delimiter=\\\". \\\" prefix=\\\" \\\" suffix=\\\". \\\">\\n <!-- Accessed: Mon. DD, YYYY. -->\\n <group delimiter=\\\": \\\">\\n <text term=\\\"accessed\\\" text-case=\\\"capitalize-first\\\"/>\\n <date variable=\\\"accessed\\\" form=\\\"text\\\"/>\\n </group>\\n <!-- [Online Video]. -->\\n <group prefix=\\\"[\\\" suffix=\\\"]\\\" delimiter=\\\" \\\">\\n <choose>\\n <if variable=\\\"medium\\\" match=\\\"any\\\">\\n <text variable=\\\"medium\\\" text-case=\\\"capitalize-first\\\"/>\\n </if>\\n <else>\\n <text term=\\\"online\\\" text-case=\\\"capitalize-first\\\"/>\\n <choose>\\n <if type=\\\"motion_picture\\\">\\n <text term=\\\"video\\\" text-case=\\\"capitalize-first\\\"/>\\n </if>\\n </choose>\\n </else>\\n </choose>\\n </group>\\n </group>\\n <!-- Available: https://URL.com/ -->\\n <group delimiter=\\\": \\\" prefix=\\\" \\\">\\n <text term=\\\"available at\\\" text-case=\\\"capitalize-first\\\"/>\\n <text variable=\\\"URL\\\"/>\\n </group>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"page\\\">\\n <choose>\\n <if type=\\\"article-journal\\\" variable=\\\"number\\\" match=\\\"all\\\">\\n <group delimiter=\\\" \\\">\\n <text value=\\\"Art.\\\"/>\\n <text term=\\\"issue\\\" form=\\\"short\\\"/>\\n <text variable=\\\"number\\\"/>\\n </group>\\n </if>\\n <else>\\n <group delimiter=\\\" \\\">\\n <label variable=\\\"page\\\" form=\\\"short\\\"/>\\n <text variable=\\\"page\\\"/>\\n </group>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"citation-locator\\\">\\n <group delimiter=\\\" \\\">\\n <choose>\\n <if locator=\\\"page\\\">\\n <label variable=\\\"locator\\\" form=\\\"short\\\"/>\\n </if>\\n <else>\\n <label variable=\\\"locator\\\" form=\\\"short\\\" text-case=\\\"capitalize-first\\\"/>\\n </else>\\n </choose>\\n <text variable=\\\"locator\\\"/>\\n </group>\\n </macro>\\n <macro name=\\\"geographic-location\\\">\\n <group delimiter=\\\", \\\" suffix=\\\".\\\">\\n <choose>\\n <if variable=\\\"publisher-place\\\">\\n <text variable=\\\"publisher-place\\\" text-case=\\\"title\\\"/>\\n </if>\\n <else-if variable=\\\"event-place\\\">\\n <text variable=\\\"event-place\\\" text-case=\\\"title\\\"/>\\n </else-if>\\n </choose>\\n </group>\\n </macro>\\n <!-- Series -->\\n <macro name=\\\"collection\\\">\\n <choose>\\n <if variable=\\\"collection-title\\\" match=\\\"any\\\">\\n <text term=\\\"in\\\" suffix=\\\" \\\"/>\\n <group delimiter=\\\", \\\" suffix=\\\". \\\">\\n <text variable=\\\"collection-title\\\"/>\\n <text variable=\\\"collection-number\\\" prefix=\\\"no. \\\"/>\\n <text variable=\\\"volume\\\" prefix=\\\"vol. \\\"/>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <!-- Citation -->\\n <citation>\\n <sort>\\n <key variable=\\\"citation-number\\\"/>\\n </sort>\\n <layout delimiter=\\\", \\\">\\n <group prefix=\\\"[\\\" suffix=\\\"]\\\" delimiter=\\\", \\\">\\n <text variable=\\\"citation-number\\\"/>\\n <text macro=\\\"citation-locator\\\"/>\\n </group>\\n </layout>\\n </citation>\\n <!-- Bibliography -->\\n <bibliography entry-spacing=\\\"0\\\" second-field-align=\\\"flush\\\">\\n <layout>\\n <!-- Citation Number -->\\n <text variable=\\\"citation-number\\\" prefix=\\\"[\\\" suffix=\\\"]\\\"/>\\n <!-- Author(s) -->\\n <text macro=\\\"author\\\" suffix=\\\", \\\"/>\\n <!-- Rest of Citation -->\\n <choose>\\n <!-- Specific Formats -->\\n <if type=\\\"article-journal\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"title\\\"/>\\n <text variable=\\\"container-title\\\" font-style=\\\"italic\\\" form=\\\"short\\\"/>\\n <text macro=\\\"locators\\\"/>\\n <text macro=\\\"page\\\"/>\\n <text macro=\\\"issued\\\"/>\\n <text macro=\\\"status\\\"/>\\n </group>\\n <choose>\\n <if variable=\\\"URL DOI\\\" match=\\\"none\\\">\\n <text value=\\\".\\\"/>\\n </if>\\n <else>\\n <text value=\\\",\\\"/>\\n </else>\\n </choose>\\n <text macro=\\\"access\\\"/>\\n </if>\\n <else-if type=\\\"paper-conference speech\\\" match=\\\"any\\\">\\n <group delimiter=\\\", \\\" suffix=\\\", \\\">\\n <text macro=\\\"title\\\"/>\\n <text macro=\\\"event\\\"/>\\n <text macro=\\\"editor\\\"/>\\n </group>\\n <text macro=\\\"collection\\\"/>\\n <group delimiter=\\\", \\\" suffix=\\\".\\\">\\n <text macro=\\\"publisher\\\"/>\\n <text macro=\\\"issued\\\"/>\\n <text macro=\\\"page\\\"/>\\n <text macro=\\\"status\\\"/>\\n </group>\\n <text macro=\\\"access\\\"/>\\n </else-if>\\n <else-if type=\\\"chapter\\\">\\n <group delimiter=\\\", \\\" suffix=\\\".\\\">\\n <text macro=\\\"title\\\"/>\\n <group delimiter=\\\" \\\">\\n <text term=\\\"in\\\" suffix=\\\" \\\"/>\\n <text variable=\\\"container-title\\\" font-style=\\\"italic\\\"/>\\n </group>\\n <text macro=\\\"locators\\\"/>\\n <text macro=\\\"editor\\\"/>\\n <text macro=\\\"collection\\\"/>\\n <text macro=\\\"publisher\\\"/>\\n <text macro=\\\"issued\\\"/>\\n <group delimiter=\\\" \\\">\\n <label variable=\\\"chapter-number\\\" form=\\\"short\\\"/>\\n <text variable=\\\"chapter-number\\\"/>\\n </group>\\n <text macro=\\\"page\\\"/>\\n </group>\\n <text macro=\\\"access\\\"/>\\n </else-if>\\n <else-if type=\\\"report\\\">\\n <group delimiter=\\\", \\\" suffix=\\\".\\\">\\n <text macro=\\\"title\\\"/>\\n <text macro=\\\"publisher\\\"/>\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"genre\\\"/>\\n <text variable=\\\"number\\\"/>\\n </group>\\n <text macro=\\\"issued\\\"/>\\n </group>\\n <text macro=\\\"access\\\"/>\\n </else-if>\\n <else-if type=\\\"thesis\\\">\\n <group delimiter=\\\", \\\" suffix=\\\".\\\">\\n <text macro=\\\"title\\\"/>\\n <text variable=\\\"genre\\\"/>\\n <text macro=\\\"publisher\\\"/>\\n <text macro=\\\"issued\\\"/>\\n </group>\\n <text macro=\\\"access\\\"/>\\n </else-if>\\n <else-if type=\\\"software\\\">\\n <group delimiter=\\\". \\\" suffix=\\\".\\\">\\n <text macro=\\\"title\\\"/>\\n <text macro=\\\"issued\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n <text variable=\\\"genre\\\"/>\\n <text macro=\\\"publisher\\\"/>\\n </group>\\n <text macro=\\\"access\\\"/>\\n </else-if>\\n <else-if type=\\\"article\\\">\\n <group delimiter=\\\", \\\" suffix=\\\".\\\">\\n <text macro=\\\"title\\\"/>\\n <text macro=\\\"issued\\\"/>\\n <group delimiter=\\\": \\\">\\n <text macro=\\\"publisher\\\" font-style=\\\"italic\\\"/>\\n <text variable=\\\"number\\\"/>\\n </group>\\n </group>\\n <text macro=\\\"access\\\"/>\\n </else-if>\\n <else-if type=\\\"webpage post-weblog post\\\" match=\\\"any\\\">\\n <group delimiter=\\\", \\\" suffix=\\\".\\\">\\n <text macro=\\\"title\\\"/>\\n <text variable=\\\"container-title\\\"/>\\n </group>\\n <text macro=\\\"access\\\"/>\\n </else-if>\\n <else-if type=\\\"patent\\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"title\\\"/>\\n <text variable=\\\"number\\\"/>\\n <text macro=\\\"issued\\\"/>\\n </group>\\n <text macro=\\\"access\\\"/>\\n </else-if>\\n <!-- Online Video -->\\n <else-if type=\\\"motion_picture\\\">\\n <text macro=\\\"geographic-location\\\" suffix=\\\". \\\"/>\\n <group delimiter=\\\", \\\" suffix=\\\".\\\">\\n <text macro=\\\"title\\\"/>\\n <text macro=\\\"issued\\\"/>\\n </group>\\n <text macro=\\\"access\\\"/>\\n </else-if>\\n <else-if type=\\\"standard\\\">\\n <group delimiter=\\\", \\\" suffix=\\\".\\\">\\n <text macro=\\\"title\\\"/>\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"genre\\\"/>\\n <text variable=\\\"number\\\"/>\\n </group>\\n <text macro=\\\"geographic-location\\\"/>\\n <text macro=\\\"issued\\\"/>\\n </group>\\n <text macro=\\\"access\\\"/>\\n </else-if>\\n <!-- Generic/Fallback Formats -->\\n <else-if type=\\\"bill book graphic legal_case legislation report song\\\" match=\\\"any\\\">\\n <group delimiter=\\\", \\\" suffix=\\\". \\\">\\n <text macro=\\\"title\\\"/>\\n <text macro=\\\"locators\\\"/>\\n </group>\\n <text macro=\\\"collection\\\"/>\\n <group delimiter=\\\", \\\" suffix=\\\".\\\">\\n <text macro=\\\"publisher\\\"/>\\n <text macro=\\\"issued\\\"/>\\n <text macro=\\\"page\\\"/>\\n </group>\\n <text macro=\\\"access\\\"/>\\n </else-if>\\n <else-if type=\\\"article-magazine article-newspaper broadcast interview manuscript map patent personal_communication song speech thesis webpage\\\" match=\\\"any\\\">\\n <group delimiter=\\\", \\\" suffix=\\\".\\\">\\n <text macro=\\\"title\\\"/>\\n <text variable=\\\"container-title\\\" font-style=\\\"italic\\\"/>\\n <text macro=\\\"locators\\\"/>\\n <text macro=\\\"publisher\\\"/>\\n <text macro=\\\"page\\\"/>\\n <text macro=\\\"issued\\\"/>\\n </group>\\n <text macro=\\\"access\\\"/>\\n </else-if>\\n <else>\\n <group delimiter=\\\", \\\" suffix=\\\". \\\">\\n <text macro=\\\"title\\\"/>\\n <text variable=\\\"container-title\\\" font-style=\\\"italic\\\"/>\\n <text macro=\\\"locators\\\"/>\\n </group>\\n <text macro=\\\"collection\\\"/>\\n <group delimiter=\\\", \\\" suffix=\\\".\\\">\\n <text macro=\\\"publisher\\\"/>\\n <text macro=\\\"page\\\"/>\\n <text macro=\\\"issued\\\"/>\\n </group>\\n <text macro=\\\"access\\\"/>\\n </else>\\n </choose>\\n </layout>\\n </bibliography>\\n</style>\\n\",\"harvard-cite-them-right\":\"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n<style xmlns=\\\"http://purl.org/net/xbiblio/csl\\\" class=\\\"in-text\\\" version=\\\"1.0\\\" demote-non-dropping-particle=\\\"sort-only\\\">\\n <info>\\n <title>Cite Them Right 12th edition (author-date/Harvard)</title>\\n <id>http://www.zotero.org/styles/harvard-cite-them-right</id>\\n <link href=\\\"http://www.zotero.org/styles/harvard-cite-them-right\\\" rel=\\\"self\\\"/>\\n <link href=\\\"http://www.zotero.org/styles/harvard-cite-them-right-11th-edition\\\" rel=\\\"template\\\"/>\\n <link href=\\\"http://www.citethemrightonline.com/\\\" rel=\\\"documentation\\\"/>\\n <author>\\n <name>Patrick O'Brien</name>\\n </author>\\n <category citation-format=\\\"author-date\\\"/>\\n <category field=\\\"generic-base\\\"/>\\n <summary>Harvard according to Cite Them Right, 11th edition.</summary>\\n <updated>2026-02-12T10:08:06+00:00</updated>\\n <rights license=\\\"http://creativecommons.org/licenses/by-sa/3.0/\\\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\\n </info>\\n <locale xml:lang=\\\"en-GB\\\">\\n <terms>\\n <term name=\\\"editor\\\" form=\\\"short\\\">\\n <single>ed.</single>\\n <multiple>eds</multiple>\\n </term>\\n <term name=\\\"editortranslator\\\" form=\\\"verb\\\">edited and translated by</term>\\n <term name=\\\"edition\\\" form=\\\"short\\\">edn.</term>\\n </terms>\\n </locale>\\n <macro name=\\\"editor\\\">\\n <choose>\\n <if type=\\\"chapter paper-conference\\\" match=\\\"any\\\">\\n <group delimiter=\\\" \\\">\\n <text term=\\\"in\\\"/>\\n <names variable=\\\"container-author\\\" delimiter=\\\", \\\" suffix=\\\", \\\">\\n <name and=\\\"text\\\" initialize-with=\\\". \\\"/>\\n </names>\\n <choose>\\n <if variable=\\\"container-author\\\" match=\\\"none\\\">\\n <names variable=\\\"editor translator\\\" delimiter=\\\", \\\">\\n <name and=\\\"text\\\" initialize-with=\\\".\\\"/>\\n <label form=\\\"short\\\" prefix=\\\" (\\\" suffix=\\\")\\\"/>\\n </names>\\n </if>\\n </choose>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <macro name=\\\"secondary-contributors\\\">\\n <choose>\\n <if type=\\\"chapter paper-conference\\\" match=\\\"none\\\">\\n <names variable=\\\"editor translator\\\" delimiter=\\\". \\\">\\n <label form=\\\"verb\\\" text-case=\\\"capitalize-first\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize-with=\\\".\\\"/>\\n </names>\\n </if>\\n <else-if variable=\\\"container-author\\\" match=\\\"any\\\">\\n <names variable=\\\"editor translator\\\" delimiter=\\\". \\\">\\n <label form=\\\"verb\\\" text-case=\\\"capitalize-first\\\" suffix=\\\" \\\"/>\\n <name and=\\\"text\\\" initialize-with=\\\". \\\" delimiter=\\\", \\\"/>\\n </names>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"author\\\">\\n <names variable=\\\"author\\\">\\n <name and=\\\"text\\\" delimiter-precedes-last=\\\"never\\\" initialize-with=\\\".\\\" name-as-sort-order=\\\"all\\\"/>\\n <label form=\\\"short\\\" prefix=\\\" (\\\" suffix=\\\")\\\"/>\\n <et-al font-style=\\\"italic\\\"/>\\n <substitute>\\n <names variable=\\\"editor\\\"/>\\n <names variable=\\\"translator\\\"/>\\n <choose>\\n <if type=\\\"article-newspaper article-magazine article-journal\\\" match=\\\"any\\\">\\n <text variable=\\\"container-title\\\" text-case=\\\"title\\\" font-style=\\\"italic\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"title\\\"/>\\n </else>\\n </choose>\\n </substitute>\\n </names>\\n </macro>\\n <macro name=\\\"author-short\\\">\\n <names variable=\\\"author\\\">\\n <name form=\\\"short\\\" and=\\\"text\\\" delimiter=\\\", \\\" delimiter-precedes-last=\\\"never\\\" initialize-with=\\\". \\\"/>\\n <et-al font-style=\\\"italic\\\"/>\\n <substitute>\\n <names variable=\\\"editor\\\"/>\\n <names variable=\\\"translator\\\"/>\\n <choose>\\n <if type=\\\"article-newspaper article-magazine article-journal\\\" match=\\\"any\\\">\\n <text variable=\\\"container-title\\\" text-case=\\\"title\\\" font-style=\\\"italic\\\"/>\\n </if>\\n <else>\\n <text macro=\\\"title\\\"/>\\n </else>\\n </choose>\\n </substitute>\\n </names>\\n </macro>\\n <macro name=\\\"access\\\">\\n <choose>\\n <if variable=\\\"DOI\\\">\\n <group delimiter=\\\": \\\">\\n <text term=\\\"available at\\\" text-case=\\\"capitalize-first\\\"/>\\n <text variable=\\\"DOI\\\" prefix=\\\"https://doi.org/\\\"/>\\n </group>\\n </if>\\n <else-if variable=\\\"URL\\\">\\n <text term=\\\"available at\\\" suffix=\\\": \\\" text-case=\\\"capitalize-first\\\"/>\\n <text variable=\\\"URL\\\"/>\\n <group prefix=\\\" (\\\" delimiter=\\\": \\\" suffix=\\\")\\\">\\n <text term=\\\"accessed\\\" text-case=\\\"capitalize-first\\\"/>\\n <date form=\\\"text\\\" variable=\\\"accessed\\\">\\n <date-part name=\\\"day\\\"/>\\n <date-part name=\\\"month\\\"/>\\n <date-part name=\\\"year\\\"/>\\n </date>\\n </group>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"number-volumes\\\">\\n <choose>\\n <if variable=\\\"volume\\\" match=\\\"none\\\">\\n <group delimiter=\\\" \\\" prefix=\\\"(\\\" suffix=\\\")\\\">\\n <text variable=\\\"number-of-volumes\\\"/>\\n <label variable=\\\"volume\\\" form=\\\"short\\\" strip-periods=\\\"true\\\"/>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <macro name=\\\"title\\\">\\n <choose>\\n <if type=\\\"bill book legal_case legislation motion_picture report song thesis webpage graphic\\\" match=\\\"any\\\">\\n <group delimiter=\\\". \\\">\\n <group delimiter=\\\" \\\">\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"title\\\" font-style=\\\"italic\\\"/>\\n <text variable=\\\"medium\\\" prefix=\\\"[\\\" suffix=\\\"]\\\"/>\\n </group>\\n <text macro=\\\"number-volumes\\\"/>\\n </group>\\n <text macro=\\\"edition\\\"/>\\n </group>\\n </if>\\n <else>\\n <text variable=\\\"title\\\" form=\\\"long\\\" quotes=\\\"true\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"publisher\\\">\\n <choose>\\n <if type=\\\"thesis\\\">\\n <group delimiter=\\\". \\\">\\n <text variable=\\\"genre\\\"/>\\n <text variable=\\\"publisher\\\"/>\\n </group>\\n </if>\\n <else-if type=\\\"report\\\">\\n <group delimiter=\\\". \\\">\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"genre\\\"/>\\n <text variable=\\\"number\\\"/>\\n </group>\\n <group delimiter=\\\": \\\">\\n <text variable=\\\"publisher-place\\\"/>\\n <text variable=\\\"publisher\\\"/>\\n </group>\\n </group>\\n </else-if>\\n <else-if type=\\\"article-journal article-newspaper article-magazine\\\" match=\\\"none\\\">\\n <group delimiter=\\\" \\\">\\n <group delimiter=\\\", \\\">\\n <choose>\\n <if type=\\\"speech\\\" variable=\\\"event\\\" match=\\\"any\\\">\\n <text variable=\\\"event\\\" font-style=\\\"italic\\\"/>\\n </if>\\n </choose>\\n <group delimiter=\\\": \\\">\\n <text variable=\\\"publisher-place\\\"/>\\n <text variable=\\\"publisher\\\"/>\\n </group>\\n </group>\\n <group prefix=\\\"(\\\" suffix=\\\")\\\" delimiter=\\\", \\\">\\n <text variable=\\\"collection-title\\\"/>\\n <text variable=\\\"collection-number\\\"/>\\n </group>\\n </group>\\n </else-if>\\n </choose>\\n </macro>\\n <macro name=\\\"year-date\\\">\\n <choose>\\n <if variable=\\\"issued\\\">\\n <date variable=\\\"issued\\\">\\n <date-part name=\\\"year\\\"/>\\n </date>\\n <text variable=\\\"year-suffix\\\"/>\\n </if>\\n <else>\\n <text term=\\\"no date\\\"/>\\n <text variable=\\\"year-suffix\\\" prefix=\\\" \\\"/>\\n </else>\\n </choose>\\n </macro>\\n <macro name=\\\"locator\\\">\\n <choose>\\n <if type=\\\"article-journal\\\">\\n <text variable=\\\"volume\\\"/>\\n <text variable=\\\"issue\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n </if>\\n </choose>\\n </macro>\\n <macro name=\\\"published-date\\\">\\n <choose>\\n <if type=\\\"article-newspaper article-magazine post-weblog speech\\\" match=\\\"any\\\">\\n <date variable=\\\"issued\\\">\\n <date-part name=\\\"day\\\" suffix=\\\" \\\"/>\\n <date-part name=\\\"month\\\" form=\\\"long\\\"/>\\n </date>\\n </if>\\n </choose>\\n </macro>\\n <macro name=\\\"pages\\\">\\n <choose>\\n <if type=\\\"chapter paper-conference article-journal article article-magazine article-newspaper book review review-book report\\\" match=\\\"any\\\">\\n <group delimiter=\\\" \\\">\\n <label variable=\\\"page\\\" form=\\\"short\\\"/>\\n <text variable=\\\"page\\\"/>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <macro name=\\\"container-title\\\">\\n <choose>\\n <if variable=\\\"container-title\\\">\\n <group delimiter=\\\". \\\">\\n <group delimiter=\\\" \\\">\\n <text variable=\\\"container-title\\\" font-style=\\\"italic\\\"/>\\n <choose>\\n <if type=\\\"article article-journal\\\" match=\\\"any\\\">\\n <choose>\\n <if match=\\\"none\\\" variable=\\\"page volume\\\">\\n <text value=\\\"Preprint\\\" prefix=\\\"[\\\" suffix=\\\"]\\\"/>\\n </if>\\n </choose>\\n </if>\\n </choose>\\n </group>\\n <text macro=\\\"edition\\\"/>\\n </group>\\n </if>\\n </choose>\\n </macro>\\n <macro name=\\\"edition\\\">\\n <choose>\\n <if is-numeric=\\\"edition\\\">\\n <group delimiter=\\\" \\\">\\n <number variable=\\\"edition\\\" form=\\\"ordinal\\\"/>\\n <text term=\\\"edition\\\" form=\\\"short\\\" strip-periods=\\\"true\\\"/>\\n </group>\\n </if>\\n <else>\\n <text variable=\\\"edition\\\"/>\\n </else>\\n </choose>\\n </macro>\\n <citation et-al-min=\\\"4\\\" et-al-use-first=\\\"1\\\" disambiguate-add-year-suffix=\\\"true\\\" disambiguate-add-names=\\\"true\\\" disambiguate-add-givenname=\\\"true\\\" collapse=\\\"year\\\">\\n <sort>\\n <key macro=\\\"year-date\\\"/>\\n </sort>\\n <layout prefix=\\\"(\\\" suffix=\\\")\\\" delimiter=\\\"; \\\">\\n <group delimiter=\\\", \\\">\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"author-short\\\"/>\\n <text macro=\\\"year-date\\\"/>\\n </group>\\n <group>\\n <label variable=\\\"locator\\\" form=\\\"short\\\" suffix=\\\" \\\"/>\\n <text variable=\\\"locator\\\"/>\\n </group>\\n </group>\\n </layout>\\n </citation>\\n <bibliography and=\\\"text\\\" et-al-min=\\\"4\\\" et-al-use-first=\\\"1\\\">\\n <sort>\\n <key macro=\\\"author\\\"/>\\n <key macro=\\\"year-date\\\"/>\\n <key variable=\\\"title\\\"/>\\n </sort>\\n <layout suffix=\\\".\\\">\\n <group delimiter=\\\". \\\">\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"author\\\"/>\\n <text macro=\\\"year-date\\\" prefix=\\\"(\\\" suffix=\\\")\\\"/>\\n <group delimiter=\\\", \\\">\\n <text macro=\\\"title\\\"/>\\n <group delimiter=\\\" \\\">\\n <text macro=\\\"editor\\\"/>\\n <text macro=\\\"container-title\\\"/>\\n </group>\\n </group>\\n </group>\\n <text macro=\\\"secondary-contributors\\\"/>\\n <text macro=\\\"publisher\\\"/>\\n </group>\\n <group delimiter=\\\", \\\" prefix=\\\", \\\">\\n <text macro=\\\"locator\\\"/>\\n <text macro=\\\"published-date\\\"/>\\n <text macro=\\\"pages\\\"/>\\n </group>\\n <text macro=\\\"access\\\" prefix=\\\". \\\"/>\\n </layout>\\n </bibliography>\\n</style>\\n\"};\nexport const BUNDLED_CSL_LOCALE_EN_US: string = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n<locale xmlns=\\\"http://purl.org/net/xbiblio/csl\\\" version=\\\"1.0\\\" xml:lang=\\\"en-US\\\">\\n <!-- The abbreviations in this file follow the recommendations of The Chicago Manual of Style, 18th ed. (2024), sec. 10.48 (cited hereafter as CMOS), unless stated otherwise. -->\\n <!-- Additional abbreviations are from:\\n 1. Oxford Dictionary for Writers and Editors (2000), https://archive.org/details/oxfordstylemanua0000unse (cited hereafter as ODWE): reference has also been made to the New Oxford Dictionary for Writers and Editors (NODWE), but periods must be added to contractions in these later editions to reflect US English usage\\n 2. Oxford Dictionary of Abbreviations (2011), https://doi.org/10.1093/acref/9780199698295.001.0001 (cited hereafter as ODA)\\n -->\\n <info>\\n <translator>\\n <name>Andrew Dunning</name>\\n <uri>https://orcid.org/0000-0003-0464-5036</uri>\\n </translator>\\n <translator>\\n <name>Sebastian Karcher</name>\\n <uri>https://orcid.org/0000-0001-8249-7388</uri>\\n </translator>\\n <translator>\\n <name>Rintze M. Zelle</name>\\n <uri>https://orcid.org/0000-0003-1779-8883</uri>\\n </translator>\\n <translator>\\n <name>Denis Meier</name>\\n </translator>\\n <translator>\\n <name>Brenton M. Wiernik</name>\\n <uri>https://orcid.org/0000-0001-9560-6336</uri>\\n </translator>\\n <rights license=\\\"http://creativecommons.org/licenses/by-sa/3.0/\\\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\\n <updated>2026-01-10T00:00:00+00:00</updated>\\n </info>\\n <style-options punctuation-in-quote=\\\"true\\\"/>\\n <date form=\\\"text\\\">\\n <date-part name=\\\"month\\\" suffix=\\\" \\\"/>\\n <date-part name=\\\"day\\\" suffix=\\\", \\\"/>\\n <date-part name=\\\"year\\\"/>\\n </date>\\n <date form=\\\"numeric\\\">\\n <date-part name=\\\"month\\\" form=\\\"numeric-leading-zeros\\\" suffix=\\\"/\\\"/>\\n <date-part name=\\\"day\\\" form=\\\"numeric-leading-zeros\\\" suffix=\\\"/\\\"/>\\n <date-part name=\\\"year\\\"/>\\n </date>\\n <terms>\\n <!-- LONG GENERAL TERMS -->\\n <term name=\\\"accessed\\\">accessed</term>\\n <term name=\\\"advance-online-publication\\\">advance online publication</term>\\n <term name=\\\"album\\\">album</term>\\n <term name=\\\"and\\\">and</term>\\n <term name=\\\"and others\\\">and others</term>\\n <term name=\\\"anonymous\\\">anonymous</term>\\n <term name=\\\"at\\\">at</term>\\n <term name=\\\"audio-recording\\\">audio recording</term>\\n <term name=\\\"available at\\\">available at</term>\\n <term name=\\\"by\\\">by</term>\\n <term name=\\\"circa\\\">circa</term>\\n <term name=\\\"cited\\\">cited</term>\\n <term name=\\\"et-al\\\">et al.</term>\\n <term name=\\\"film\\\">film</term>\\n <term name=\\\"forthcoming\\\">forthcoming</term>\\n <term name=\\\"from\\\">from</term>\\n <term name=\\\"henceforth\\\">henceforth</term>\\n <term name=\\\"ibid\\\">ibid.</term>\\n <term name=\\\"in\\\">in</term>\\n <term name=\\\"in press\\\">in press</term>\\n <term name=\\\"internet\\\">internet</term>\\n <term name=\\\"letter\\\">letter</term>\\n <term name=\\\"loc-cit\\\">loc. cit.</term> <!-- like ibid., the abbreviated form is the regular form -->\\n <term name=\\\"no date\\\">no date</term>\\n <term name=\\\"no-place\\\">no place</term>\\n <term name=\\\"no-publisher\\\">no publisher</term>\\n <term name=\\\"on\\\">on</term>\\n <term name=\\\"online\\\">online</term>\\n <term name=\\\"op-cit\\\">op. cit.</term> <!-- like ibid., the abbreviated form is the regular form -->\\n <term name=\\\"original-work-published\\\">original work published</term>\\n <term name=\\\"personal-communication\\\">personal communication</term>\\n <term name=\\\"podcast\\\">podcast</term>\\n <term name=\\\"podcast-episode\\\">podcast episode</term>\\n <term name=\\\"preprint\\\">preprint</term>\\n <term name=\\\"presented at\\\">presented at the</term>\\n <term name=\\\"radio-broadcast\\\">radio broadcast</term>\\n <term name=\\\"radio-series\\\">radio series</term>\\n <term name=\\\"radio-series-episode\\\">radio series episode</term>\\n <term name=\\\"reference\\\">\\n <single>reference</single>\\n <multiple>references</multiple>\\n </term>\\n <term name=\\\"retrieved\\\">retrieved</term>\\n <term name=\\\"review-of\\\">review of</term>\\n <term name=\\\"scale\\\">scale</term>\\n <term name=\\\"special-issue\\\">special issue</term>\\n <term name=\\\"special-section\\\">special section</term>\\n <term name=\\\"television-broadcast\\\">television broadcast</term>\\n <term name=\\\"television-series\\\">television series</term>\\n <term name=\\\"television-series-episode\\\">television series episode</term>\\n <term name=\\\"video\\\">video</term>\\n <term name=\\\"working-paper\\\">working paper</term>\\n\\n <!-- SHORT GENERAL TERMS -->\\n <!-- Omitted short forms: accessed, album, and (symbol), and others, at (symbol), forthcoming, henceforth, ibid, in, in press, internet, loc-cit, on, online, op-cit, podcast, preprint, presented at -->\\n <term name=\\\"advance-online-publication\\\" form=\\\"short\\\">adv. online pub.</term> <!-- ODA -->\\n <term name=\\\"anonymous\\\" form=\\\"short\\\">anon.</term>\\n <term name=\\\"audio-recording\\\" form=\\\"short\\\">au. rec.</term> <!-- ODA -->\\n <term name=\\\"available at\\\" form=\\\"short\\\">avail. at</term> <!-- ODA -->\\n <term name=\\\"circa\\\" form=\\\"short\\\">c.</term>\\n <!-- CMOS 10.48 recommends \\\"ca.\\\" for \\\"circa\\\" but also allows \\\"c.\\\", which CSL has used historically -->\\n <term name=\\\"cited\\\" form=\\\"short\\\">cit.</term> <!-- ODA -->\\n <term name=\\\"film\\\" form=\\\"short\\\">flm.</term> <!-- ODA -->\\n <term name=\\\"from\\\" form=\\\"short\\\">fr.</term>\\n <term name=\\\"letter\\\" form=\\\"short\\\">let.</term> <!-- ODA -->\\n <term name=\\\"no date\\\" form=\\\"short\\\">n.d.</term>\\n <term name=\\\"no-place\\\" form=\\\"short\\\">n.p.</term>\\n <term name=\\\"no-publisher\\\" form=\\\"short\\\">n.p.</term>\\n <term name=\\\"original-work-published\\\" form=\\\"short\\\">orig. pub.</term> <!-- Oxford Guide to Style -->\\n <term name=\\\"personal-communication\\\" form=\\\"short\\\">pers. comm.</term>\\n <term name=\\\"podcast-episode\\\" form=\\\"short\\\">podcast ep.</term>\\n <term name=\\\"radio-broadcast\\\" form=\\\"short\\\">radio bdcst.</term> <!-- ODA -->\\n <term name=\\\"radio-series\\\" form=\\\"short\\\">radio ser.</term> <!-- ODA -->\\n <term name=\\\"radio-series-episode\\\" form=\\\"short\\\">radio ser. ep.</term> <!-- ODA -->\\n <term name=\\\"reference\\\" form=\\\"short\\\">\\n <single>ref.</single>\\n <multiple>refs.</multiple>\\n </term>\\n <term name=\\\"retrieved\\\" form=\\\"short\\\">rtvd.</term> <!-- ODA -->\\n <term name=\\\"review-of\\\" form=\\\"short\\\">rev. of</term>\\n <term name=\\\"scale\\\" form=\\\"short\\\">sc.</term> <!-- ODA -->\\n <term name=\\\"special-issue\\\" form=\\\"short\\\">spec. iss.</term> <!-- ODA -->\\n <term name=\\\"special-section\\\" form=\\\"short\\\">spec. sec.</term> <!-- ODA/CMOS -->\\n <term name=\\\"television-broadcast\\\" form=\\\"short\\\">TV bdcst.</term> <!-- ODA -->\\n <term name=\\\"television-series\\\" form=\\\"short\\\">TV ser.</term> <!-- ODA -->\\n <term name=\\\"television-series-episode\\\" form=\\\"short\\\">TV ser. ep.</term> <!-- ODA -->\\n <term name=\\\"video\\\" form=\\\"short\\\">vid.</term> <!-- ODA -->\\n <term name=\\\"working-paper\\\" form=\\\"short\\\">wkg. paper</term> <!-- ODA -->\\n\\n <!-- SYMBOLIC GENERAL FORMS -->\\n <term name=\\\"and\\\" form=\\\"symbol\\\">&</term>\\n <term name=\\\"at\\\" form=\\\"symbol\\\">@</term>\\n\\n <!-- LONG ITEM TYPE FORMS -->\\n <term name=\\\"article\\\">preprint</term>\\n <term name=\\\"article-journal\\\">journal article</term>\\n <term name=\\\"article-magazine\\\">magazine article</term>\\n <term name=\\\"article-newspaper\\\">newspaper article</term>\\n <term name=\\\"bill\\\">bill</term>\\n <!-- book is in the list of locator terms -->\\n <term name=\\\"broadcast\\\">broadcast</term>\\n <!-- chapter is in the list of locator terms -->\\n <term name=\\\"classic\\\">classical work</term>\\n <term name=\\\"collection\\\">archival collection</term>\\n <term name=\\\"dataset\\\">dataset</term>\\n <term name=\\\"document\\\">document</term>\\n <term name=\\\"entry\\\">entry</term>\\n <term name=\\\"entry-dictionary\\\">dictionary entry</term>\\n <term name=\\\"entry-encyclopedia\\\">encyclopedia entry</term>\\n <term name=\\\"event\\\">event</term>\\n <!-- figure is in the list of locator terms -->\\n <term name=\\\"graphic\\\">graphic</term>\\n <term name=\\\"hearing\\\">hearing</term>\\n <term name=\\\"interview\\\">interview</term>\\n <term name=\\\"legal_case\\\">legal case</term>\\n <term name=\\\"legislation\\\">legislation</term>\\n <term name=\\\"manuscript\\\">manuscript</term>\\n <term name=\\\"map\\\">map</term>\\n <term name=\\\"motion_picture\\\">video recording</term>\\n <term name=\\\"musical_score\\\">musical score</term>\\n <term name=\\\"pamphlet\\\">pamphlet</term>\\n <term name=\\\"paper-conference\\\">conference paper</term>\\n <term name=\\\"patent\\\">patent</term>\\n <term name=\\\"performance\\\">performance</term>\\n <term name=\\\"periodical\\\">periodical</term>\\n <term name=\\\"personal_communication\\\">personal communication</term>\\n <term name=\\\"post\\\">post</term>\\n <term name=\\\"post-weblog\\\">blog post</term>\\n <term name=\\\"regulation\\\">regulation</term>\\n <term name=\\\"report\\\">report</term>\\n <term name=\\\"review\\\">review</term>\\n <term name=\\\"review-book\\\">book review</term>\\n <term name=\\\"software\\\">software</term>\\n <term name=\\\"song\\\">audio recording</term>\\n <term name=\\\"speech\\\">presentation</term>\\n <term name=\\\"standard\\\">standard</term>\\n <term name=\\\"thesis\\\">thesis</term>\\n <term name=\\\"treaty\\\">treaty</term>\\n <term name=\\\"webpage\\\">webpage</term>\\n\\n <!-- SHORT ITEM TYPE FORMS -->\\n <!-- Omitted short forms: article, bill, entry, event, hearing, map, periodical, speech, treaty -->\\n <term name=\\\"article-journal\\\" form=\\\"short\\\">jour. art.</term> <!-- ODWE -->\\n <term name=\\\"article-magazine\\\" form=\\\"short\\\">mag. art.</term> <!-- ODWE -->\\n <term name=\\\"article-newspaper\\\" form=\\\"short\\\">newspaper art.</term>\\n <term name=\\\"broadcast\\\" form=\\\"short\\\">bdcst.</term> <!-- ODA -->\\n <!-- book is in the list of locator terms -->\\n <!-- chapter is in the list of locator terms -->\\n <term name=\\\"classic\\\" form=\\\"short\\\">class. wk.</term> <!-- ODWE -->\\n <term name=\\\"collection\\\" form=\\\"short\\\">arch. coll.</term> <!-- ODA -->\\n <term name=\\\"document\\\" form=\\\"short\\\">doc.</term>\\n <term name=\\\"entry-dictionary\\\" form=\\\"short\\\">dict. entry</term>\\n <term name=\\\"entry-encyclopedia\\\" form=\\\"short\\\">ency. entry</term>\\n <!-- figure is in the list of locator terms -->\\n <term name=\\\"graphic\\\" form=\\\"short\\\">gr.</term> <!-- ODA -->\\n <term name=\\\"interview\\\" form=\\\"short\\\">int.</term> <!-- ODA -->\\n <term name=\\\"legal_case\\\" form=\\\"short\\\">leg. case</term> <!-- ODA -->\\n <term name=\\\"legislation\\\" form=\\\"short\\\">legis.</term> <!-- ODA -->\\n <term name=\\\"manuscript\\\" form=\\\"short\\\">\\n <single>MS</single>\\n <multiple>MSS</multiple>\\n </term>\\n <term name=\\\"motion_picture\\\" form=\\\"short\\\">vid. rec.</term> <!-- ODA -->\\n <term name=\\\"musical_score\\\" form=\\\"short\\\">mus. score</term> <!-- ODWE -->\\n <term name=\\\"pamphlet\\\" form=\\\"short\\\">pam.</term> <!-- ODWE -->\\n <term name=\\\"paper-conference\\\" form=\\\"short\\\">conf. paper</term> <!-- ODA -->\\n <term name=\\\"patent\\\" form=\\\"short\\\">pat.</term> <!-- ODWE -->\\n <term name=\\\"performance\\\" form=\\\"short\\\">prfm.</term> <!-- ODA -->\\n <term name=\\\"personal_communication\\\" form=\\\"short\\\">pers. comm.</term>\\n <term name=\\\"regulation\\\" form=\\\"short\\\">reg.</term> <!-- ODA -->\\n <term name=\\\"report\\\" form=\\\"short\\\">rep.</term> <!-- ODWE -->\\n <term name=\\\"review\\\" form=\\\"short\\\">rev.</term>\\n <term name=\\\"review-book\\\" form=\\\"short\\\">bk. rev.</term>\\n <term name=\\\"software\\\" form=\\\"short\\\">sftw.</term> <!-- ODA -->\\n <term name=\\\"song\\\" form=\\\"short\\\">au. rec.</term> <!-- ODA -->\\n <term name=\\\"standard\\\" form=\\\"short\\\">std.</term> <!-- ODA -->\\n <term name=\\\"thesis\\\" form=\\\"short\\\">thes.</term> <!-- ODA -->\\n <term name=\\\"webpage\\\" form=\\\"short\\\">webpg.</term> <!-- ODA -->\\n\\n <!-- LONG VERB ITEM TYPE FORMS -->\\n <!-- Only where applicable -->\\n <term name=\\\"hearing\\\" form=\\\"verb\\\">testimony of</term>\\n <term name=\\\"review\\\" form=\\\"verb\\\">review of</term>\\n <term name=\\\"review-book\\\" form=\\\"verb\\\">review of the book</term>\\n\\n <!-- SHORT VERB ITEM TYPE FORMS -->\\n <!-- Only where applicable -->\\n <term name=\\\"hearing\\\" form=\\\"verb-short\\\">test. of</term> <!-- ODA -->\\n <term name=\\\"review\\\" form=\\\"verb-short\\\">rev. of</term>\\n <term name=\\\"review-book\\\" form=\\\"verb-short\\\">rev. of the bk.</term>\\n\\n <!-- HISTORICAL ERA TERMS -->\\n <term name=\\\"ad\\\"> AD</term>\\n <term name=\\\"bc\\\"> BC</term>\\n <term name=\\\"bce\\\"> BCE</term>\\n <term name=\\\"ce\\\"> CE</term>\\n\\n <!-- PUNCTUATION -->\\n <term name=\\\"open-quote\\\">“</term>\\n <term name=\\\"close-quote\\\">”</term>\\n <term name=\\\"open-inner-quote\\\">‘</term>\\n <term name=\\\"close-inner-quote\\\">’</term>\\n <term name=\\\"page-range-delimiter\\\">–</term>\\n <term name=\\\"colon\\\">:</term>\\n <term name=\\\"comma\\\">,</term>\\n <term name=\\\"semicolon\\\">;</term>\\n\\n <!-- ORDINALS -->\\n <term name=\\\"ordinal\\\">th</term>\\n <term name=\\\"ordinal-01\\\">st</term>\\n <term name=\\\"ordinal-02\\\">nd</term>\\n <term name=\\\"ordinal-03\\\">rd</term>\\n <term name=\\\"ordinal-11\\\">th</term>\\n <term name=\\\"ordinal-12\\\">th</term>\\n <term name=\\\"ordinal-13\\\">th</term>\\n\\n <!-- LONG ORDINALS -->\\n <term name=\\\"long-ordinal-01\\\">first</term>\\n <term name=\\\"long-ordinal-02\\\">second</term>\\n <term name=\\\"long-ordinal-03\\\">third</term>\\n <term name=\\\"long-ordinal-04\\\">fourth</term>\\n <term name=\\\"long-ordinal-05\\\">fifth</term>\\n <term name=\\\"long-ordinal-06\\\">sixth</term>\\n <term name=\\\"long-ordinal-07\\\">seventh</term>\\n <term name=\\\"long-ordinal-08\\\">eighth</term>\\n <term name=\\\"long-ordinal-09\\\">ninth</term>\\n <term name=\\\"long-ordinal-10\\\">tenth</term>\\n\\n <!-- LONG LOCATOR FORMS -->\\n <term name=\\\"act\\\">\\n <single>act</single>\\n <multiple>acts</multiple>\\n </term>\\n <term name=\\\"appendix\\\">\\n <single>appendix</single>\\n <multiple>appendices</multiple>\\n </term>\\n <term name=\\\"article-locator\\\">\\n <single>article</single>\\n <multiple>articles</multiple>\\n </term>\\n <term name=\\\"book\\\">\\n <single>book</single>\\n <multiple>books</multiple>\\n </term>\\n <term name=\\\"canon\\\">\\n <single>canon</single>\\n <multiple>canons</multiple>\\n </term>\\n <term name=\\\"chapter\\\">\\n <single>chapter</single>\\n <multiple>chapters</multiple>\\n </term>\\n <term name=\\\"column\\\">\\n <single>column</single>\\n <multiple>columns</multiple>\\n </term>\\n <term name=\\\"elocation\\\">\\n <single>location</single>\\n <multiple>locations</multiple>\\n </term>\\n <term name=\\\"equation\\\">\\n <single>equation</single>\\n <multiple>equations</multiple>\\n </term>\\n <term name=\\\"figure\\\">\\n <single>figure</single>\\n <multiple>figures</multiple>\\n </term>\\n <term name=\\\"folio\\\">\\n <single>folio</single>\\n <multiple>folios</multiple>\\n </term>\\n <term name=\\\"issue\\\">\\n <single>issue</single>\\n <multiple>issues</multiple>\\n </term>\\n <term name=\\\"line\\\">\\n <single>line</single>\\n <multiple>lines</multiple>\\n </term>\\n <term name=\\\"note\\\">\\n <single>note</single>\\n <multiple>notes</multiple>\\n </term>\\n <term name=\\\"opus\\\">\\n <single>opus</single>\\n <multiple>opera</multiple>\\n </term>\\n <term name=\\\"page\\\">\\n <single>page</single>\\n <multiple>pages</multiple>\\n </term>\\n <term name=\\\"paragraph\\\">\\n <single>paragraph</single>\\n <multiple>paragraphs</multiple>\\n </term>\\n <term name=\\\"part\\\">\\n <single>part</single>\\n <multiple>parts</multiple>\\n </term>\\n <term name=\\\"rule\\\">\\n <single>rule</single>\\n <multiple>rules</multiple>\\n </term>\\n <term name=\\\"scene\\\">\\n <single>scene</single>\\n <multiple>scenes</multiple>\\n </term>\\n <term name=\\\"section\\\">\\n <single>section</single>\\n <multiple>sections</multiple>\\n </term>\\n <term name=\\\"sub-verbo\\\">\\n <single>sub verbo</single>\\n <multiple>sub verbis</multiple>\\n </term>\\n <term name=\\\"supplement\\\">\\n <single>supplement</single>\\n <multiple>supplements</multiple>\\n </term>\\n <term name=\\\"table\\\">\\n <single>table</single>\\n <multiple>tables</multiple>\\n </term>\\n <!-- A timestamp is a composite of hours, minutes, etc. and therefore has no default label. -->\\n <term name=\\\"timestamp\\\"/>\\n <term name=\\\"title-locator\\\">\\n <single>title</single>\\n <multiple>titles</multiple>\\n </term>\\n <term name=\\\"verse\\\">\\n <single>verse</single>\\n <multiple>verses</multiple>\\n </term>\\n <term name=\\\"volume\\\">\\n <single>volume</single>\\n <multiple>volumes</multiple>\\n </term>\\n\\n <!-- SHORT LOCATOR FORMS -->\\n <!-- Omitted short forms: act, timestamp -->\\n <term name=\\\"appendix\\\" form=\\\"short\\\">\\n <single>app.</single>\\n <multiple>apps.</multiple>\\n </term>\\n <term name=\\\"article-locator\\\" form=\\\"short\\\">\\n <single>art.</single>\\n <multiple>arts.</multiple>\\n </term>\\n <term name=\\\"book\\\" form=\\\"short\\\">\\n <single>bk.</single>\\n <multiple>bks.</multiple>\\n </term>\\n <term name=\\\"canon\\\" form=\\\"short\\\">\\n <!-- Oxford Dictionary for Writers and Editors -->\\n <single>can.</single>\\n <multiple>cann.</multiple>\\n </term>\\n <term name=\\\"chapter\\\" form=\\\"short\\\">\\n <single>chap.</single>\\n <multiple>chaps.</multiple>\\n </term>\\n <term name=\\\"column\\\" form=\\\"short\\\">\\n <single>col.</single>\\n <multiple>cols.</multiple>\\n </term>\\n <term name=\\\"elocation\\\" form=\\\"short\\\">\\n <single>loc.</single>\\n <multiple>locs.</multiple>\\n </term>\\n <term name=\\\"equation\\\" form=\\\"short\\\">\\n <single>eq.</single>\\n <multiple>eqq.</multiple>\\n </term>\\n <term name=\\\"figure\\\" form=\\\"short\\\">\\n <single>fig.</single>\\n <multiple>figs.</multiple>\\n </term>\\n <term name=\\\"folio\\\" form=\\\"short\\\">\\n <single>fol.</single>\\n <multiple>fols.</multiple>\\n </term>\\n <term name=\\\"issue\\\" form=\\\"short\\\">\\n <single>no.</single>\\n <multiple>nos.</multiple>\\n </term>\\n <term name=\\\"line\\\" form=\\\"short\\\">\\n <single>l.</single>\\n <multiple>ll.</multiple>\\n </term>\\n <term name=\\\"note\\\" form=\\\"short\\\">\\n <single>n.</single>\\n <multiple>nn.</multiple>\\n </term>\\n <term name=\\\"opus\\\" form=\\\"short\\\">\\n <single>op.</single>\\n <multiple>opp.</multiple>\\n </term>\\n <term name=\\\"page\\\" form=\\\"short\\\">\\n <single>p.</single>\\n <multiple>pp.</multiple>\\n </term>\\n <term name=\\\"paragraph\\\" form=\\\"short\\\">\\n <single>para.</single>\\n <multiple>paras.</multiple>\\n </term>\\n <term name=\\\"part\\\" form=\\\"short\\\">\\n <single>pt.</single>\\n <multiple>pts.</multiple>\\n </term>\\n <term name=\\\"rule\\\" form=\\\"short\\\">\\n <!-- legal abbreviations in the Oxford Guide to Style, sec. 13.2.1 -->\\n <single>r.</single>\\n <multiple>rr.</multiple>\\n </term>\\n <term name=\\\"scene\\\" form=\\\"short\\\">\\n <single>sc.</single>\\n <multiple>scs.</multiple>\\n </term>\\n <term name=\\\"section\\\" form=\\\"short\\\">\\n <single>sec.</single>\\n <multiple>secs.</multiple>\\n </term>\\n <term name=\\\"sub-verbo\\\" form=\\\"short\\\">\\n <single>s.v.</single>\\n <multiple>s.vv.</multiple>\\n </term>\\n <term name=\\\"supplement\\\" form=\\\"short\\\">\\n <single>supp.</single>\\n <multiple>supps.</multiple>\\n </term>\\n <term name=\\\"table\\\" form=\\\"short\\\">\\n <!-- Oxford Dictionary of Abbreviations -->\\n <single>tbl.</single>\\n <multiple>tbls.</multiple>\\n </term>\\n <term name=\\\"title-locator\\\" form=\\\"short\\\">\\n <!-- Oxford Dictionary for Writers and Editors -->\\n <single>tit.</single>\\n <multiple>titt.</multiple>\\n </term>\\n <term name=\\\"verse\\\" form=\\\"short\\\">\\n <single>v.</single>\\n <multiple>vv.</multiple>\\n </term>\\n <term name=\\\"volume\\\" form=\\\"short\\\">\\n <single>vol.</single>\\n <multiple>vols.</multiple>\\n </term>\\n\\n <!-- SYMBOLIC LOCATOR FORMS -->\\n <term name=\\\"chapter\\\" form=\\\"symbol\\\">\\n <!-- caput/capita, esp. in legal works; cf. CMOS 14.196 -->\\n <single>c.</single>\\n <multiple>cc.</multiple>\\n </term>\\n <term name=\\\"paragraph\\\" form=\\\"symbol\\\">\\n <single>¶</single>\\n <multiple>¶¶</multiple>\\n </term>\\n <term name=\\\"section\\\" form=\\\"symbol\\\">\\n <single>§</single>\\n <multiple>§§</multiple>\\n </term>\\n\\n <!-- LONG NUMBER VARIABLE FORMS -->\\n <term name=\\\"chapter-number\\\">\\n <single>chapter</single>\\n <multiple>chapters</multiple>\\n </term>\\n <term name=\\\"citation-number\\\">\\n <single>citation</single>\\n <multiple>citations</multiple>\\n </term>\\n <term name=\\\"collection-number\\\">\\n <single>number</single>\\n <multiple>numbers</multiple>\\n </term>\\n <term name=\\\"edition\\\">\\n <single>edition</single>\\n <multiple>editions</multiple>\\n </term>\\n <term name=\\\"first-reference-note-number\\\">\\n <single>note</single>\\n <multiple>notes</multiple>\\n </term>\\n <term name=\\\"number\\\">\\n <single>number</single>\\n <multiple>numbers</multiple>\\n </term>\\n <term name=\\\"number-of-pages\\\">\\n <single>page</single>\\n <multiple>pages</multiple>\\n </term>\\n <term name=\\\"number-of-volumes\\\">\\n <single>volume</single>\\n <multiple>volumes</multiple>\\n </term>\\n <term name=\\\"page-first\\\">\\n <single>page</single>\\n <multiple>pages</multiple>\\n </term>\\n <term name=\\\"printing\\\">\\n <single>printing</single>\\n <multiple>printings</multiple>\\n </term>\\n <term name=\\\"version\\\">\\n <single>version</single>\\n <multiple>versions</multiple>\\n </term>\\n\\n <!-- SHORT NUMBER VARIABLE FORMS -->\\n <term name=\\\"chapter-number\\\" form=\\\"short\\\">\\n <single>chap.</single>\\n <multiple>chaps.</multiple>\\n </term>\\n <term name=\\\"citation-number\\\" form=\\\"short\\\">\\n <single>cit.</single>\\n <multiple>cits.</multiple>\\n </term>\\n <term name=\\\"collection-number\\\" form=\\\"short\\\">\\n <single>no.</single>\\n <multiple>nos.</multiple>\\n </term>\\n <term name=\\\"edition\\\" form=\\\"short\\\">\\n <single>ed.</single>\\n <multiple>eds.</multiple>\\n </term>\\n <term name=\\\"first-reference-note-number\\\" form=\\\"short\\\">\\n <single>n.</single>\\n <multiple>nn.</multiple>\\n </term>\\n <term name=\\\"number\\\" form=\\\"short\\\">\\n <single>no.</single>\\n <multiple>nos.</multiple>\\n </term>\\n <term name=\\\"number-of-pages\\\" form=\\\"short\\\">\\n <single>p.</single>\\n <multiple>pp.</multiple>\\n </term>\\n <term name=\\\"number-of-volumes\\\" form=\\\"short\\\">\\n <single>vol.</single>\\n <multiple>vols.</multiple>\\n </term>\\n <term name=\\\"page-first\\\" form=\\\"short\\\">\\n <single>p.</single>\\n <multiple>pp.</multiple>\\n </term>\\n <term name=\\\"printing\\\" form=\\\"short\\\">\\n <!-- Oxford Dictionary for Writers and Editors -->\\n <single>ptg.</single>\\n <multiple>ptgs.</multiple>\\n </term>\\n <term name=\\\"version\\\" form=\\\"short\\\">v.</term> <!-- no plural -->\\n\\n <!-- LONG ROLE FORMS -->\\n <term name=\\\"author\\\"/> <!-- generally blank -->\\n <term name=\\\"chair\\\">\\n <single>chair</single>\\n <multiple>chairs</multiple>\\n </term>\\n <term name=\\\"collection-editor\\\">\\n <single>editor</single>\\n <multiple>editors</multiple>\\n </term>\\n <term name=\\\"compiler\\\">\\n <single>compiler</single>\\n <multiple>compilers</multiple>\\n </term>\\n <term name=\\\"composer\\\"/> <!-- generally blank -->\\n <term name=\\\"container-author\\\"/> <!-- generally blank -->\\n <term name=\\\"contributor\\\">\\n <single>contributor</single>\\n <multiple>contributors</multiple>\\n </term>\\n <term name=\\\"curator\\\">\\n <single>curator</single>\\n <multiple>curators</multiple>\\n </term>\\n <term name=\\\"director\\\">\\n <single>director</single>\\n <multiple>directors</multiple>\\n </term>\\n <term name=\\\"editor\\\">\\n <single>editor</single>\\n <multiple>editors</multiple>\\n </term>\\n <term name=\\\"editor-translator\\\">\\n <single>editor & translator</single>\\n <multiple>editors & translators</multiple>\\n </term>\\n <term name=\\\"editortranslator\\\">\\n <single>editor & translator</single>\\n <multiple>editors & translators</multiple>\\n </term>\\n <term name=\\\"editorial-director\\\">\\n <single>editor</single>\\n <multiple>editors</multiple>\\n </term>\\n <term name=\\\"executive-producer\\\">\\n <single>executive producer</single>\\n <multiple>executive producers</multiple>\\n </term>\\n <term name=\\\"guest\\\">\\n <single>guest</single>\\n <multiple>guests</multiple>\\n </term>\\n <term name=\\\"host\\\">\\n <single>host</single>\\n <multiple>hosts</multiple>\\n </term>\\n <term name=\\\"illustrator\\\">\\n <single>illustrator</single>\\n <multiple>illustrators</multiple>\\n </term>\\n <term name=\\\"interviewer\\\"/> <!-- generally blank -->\\n <term name=\\\"narrator\\\">\\n <single>narrator</single>\\n <multiple>narrators</multiple>\\n </term>\\n <term name=\\\"organizer\\\">\\n <single>organizer</single>\\n <multiple>organizers</multiple>\\n </term>\\n <term name=\\\"original-author\\\"/> <!-- generally blank -->\\n <term name=\\\"performer\\\">\\n <single>performer</single>\\n <multiple>performers</multiple>\\n </term>\\n <term name=\\\"producer\\\">\\n <single>producer</single>\\n <multiple>producers</multiple>\\n </term>\\n <term name=\\\"recipient\\\"/> <!-- generally blank -->\\n <term name=\\\"reviewed-author\\\"/> <!-- generally blank -->\\n <term name=\\\"script-writer\\\">\\n <single>writer</single>\\n <multiple>writers</multiple>\\n </term>\\n <term name=\\\"series-creator\\\">\\n <single>series creator</single>\\n <multiple>series creators</multiple>\\n </term>\\n <term name=\\\"translator\\\">\\n <single>translator</single>\\n <multiple>translators</multiple>\\n </term>\\n\\n <!-- SHORT ROLE FORMS -->\\n <!-- Omitted roles:\\n author, chair, composer, container-author, guest, host, interviewer, original-author, recipient, reviewed-author\\n -->\\n <term name=\\\"collection-editor\\\" form=\\\"short\\\">\\n <single>ed.</single>\\n <multiple>eds.</multiple>\\n </term>\\n <term name=\\\"compiler\\\" form=\\\"short\\\">\\n <single>comp.</single>\\n <multiple>comps.</multiple>\\n </term>\\n <term name=\\\"contributor\\\" form=\\\"short\\\">\\n <!-- Oxford Dictionary of Abbreviations -->\\n <single>contrib.</single>\\n <multiple>contribs.</multiple>\\n </term>\\n <term name=\\\"curator\\\" form=\\\"short\\\">\\n <!-- Oxford Art Online <https://www.oxfordartonline.com/page/1661> -->\\n <single>cur.</single>\\n <multiple>curs.</multiple>\\n </term>\\n <term name=\\\"director\\\" form=\\\"short\\\">\\n <single>dir.</single>\\n <multiple>dirs.</multiple>\\n </term>\\n <term name=\\\"editor\\\" form=\\\"short\\\">\\n <single>ed.</single>\\n <multiple>eds.</multiple>\\n </term>\\n <term name=\\\"editor-translator\\\" form=\\\"short\\\">\\n <single>ed. & trans.</single>\\n <multiple>eds. & trans.</multiple>\\n </term>\\n <term name=\\\"editortranslator\\\" form=\\\"short\\\">\\n <single>ed. & trans.</single>\\n <multiple>eds. & trans.</multiple>\\n </term>\\n <term name=\\\"editorial-director\\\" form=\\\"short\\\">\\n <single>ed.</single>\\n <multiple>eds.</multiple>\\n </term>\\n <term name=\\\"executive-producer\\\" form=\\\"short\\\">\\n <!-- Oxford Dictionary of Abbreviations -->\\n <single>exec. prod.</single>\\n <multiple>exec. prods.</multiple>\\n </term>\\n <term name=\\\"illustrator\\\" form=\\\"short\\\">\\n <single>ill.</single>\\n <multiple>ills.</multiple>\\n </term>\\n <term name=\\\"narrator\\\" form=\\\"short\\\">\\n <!-- Oxford Dictionary of Abbreviations -->\\n <single>narr.</single>\\n <multiple>narrs.</multiple>\\n </term>\\n <term name=\\\"organizer\\\" form=\\\"short\\\">\\n <!-- possibly misleading: Oxford Dictionary of Abbreviations only defines this as organization or organized -->\\n <single>org.</single>\\n <multiple>orgs.</multiple>\\n </term>\\n <term name=\\\"performer\\\" form=\\\"short\\\">\\n <!-- Oxford Dictionary of Abbreviations -->\\n <single>perf.</single>\\n <multiple>perfs.</multiple>\\n </term>\\n <term name=\\\"producer\\\" form=\\\"short\\\">\\n <!-- Oxford Dictionary of Abbreviations -->\\n <single>prod.</single>\\n <multiple>prods.</multiple>\\n </term>\\n <term name=\\\"script-writer\\\" form=\\\"short\\\">\\n <!-- Oxford Dictionary of Abbreviations -->\\n <single>wrtr.</single>\\n <multiple>wrtrs.</multiple>\\n </term>\\n <term name=\\\"series-creator\\\" form=\\\"short\\\">\\n <single>ser. creator</single>\\n <multiple>ser. creators</multiple>\\n </term>\\n <term name=\\\"translator\\\" form=\\\"short\\\">trans.</term> <!-- no plural -->\\n\\n <!-- VERB ROLE FORMS -->\\n <term name=\\\"chair\\\" form=\\\"verb\\\">chaired by</term>\\n <term name=\\\"collection-editor\\\" form=\\\"verb\\\">edited by</term>\\n <term name=\\\"compiler\\\" form=\\\"verb\\\">compiled by</term>\\n <term name=\\\"composer\\\" form=\\\"verb\\\">composed by</term>\\n <term name=\\\"container-author\\\" form=\\\"verb\\\">by</term>\\n <term name=\\\"contributor\\\" form=\\\"verb\\\">with</term>\\n <term name=\\\"curator\\\" form=\\\"verb\\\">curated by</term>\\n <term name=\\\"director\\\" form=\\\"verb\\\">directed by</term>\\n <term name=\\\"editor\\\" form=\\\"verb\\\">edited by</term>\\n <term name=\\\"editor-translator\\\" form=\\\"verb\\\">edited & translated by</term>\\n <term name=\\\"editortranslator\\\" form=\\\"verb\\\">edited & translated by</term>\\n <term name=\\\"editorial-director\\\" form=\\\"verb\\\">edited by</term>\\n <term name=\\\"executive-producer\\\" form=\\\"verb\\\">executive produced by</term>\\n <term form=\\\"verb\\\" name=\\\"guest\\\">\\n <single>with guest</single>\\n <multiple>with guests</multiple>\\n </term>\\n <term name=\\\"host\\\" form=\\\"verb\\\">hosted by</term>\\n <term name=\\\"illustrator\\\" form=\\\"verb\\\">illustrated by</term>\\n <term name=\\\"interviewer\\\" form=\\\"verb\\\">interview by</term>\\n <term name=\\\"narrator\\\" form=\\\"verb\\\">narrated by</term>\\n <term name=\\\"organizer\\\" form=\\\"verb\\\">organized by</term>\\n <term name=\\\"original-author\\\" form=\\\"verb\\\">by</term>\\n <term name=\\\"performer\\\" form=\\\"verb\\\">performed by</term>\\n <term name=\\\"producer\\\" form=\\\"verb\\\">produced by</term>\\n <term name=\\\"recipient\\\" form=\\\"verb\\\">to</term>\\n <term name=\\\"reviewed-author\\\" form=\\\"verb\\\">by</term>\\n <term name=\\\"script-writer\\\" form=\\\"verb\\\">written by</term>\\n <term name=\\\"series-creator\\\" form=\\\"verb\\\">created by</term>\\n <term name=\\\"translator\\\" form=\\\"verb\\\">translated by</term>\\n\\n <!-- SHORT VERB ROLE FORMS -->\\n <!-- Omitted roles:\\n author, chair, container-author, contributor, guest, host, interviewer, original-author, recipient, reviewed-author, series-creator\\n -->\\n <term name=\\\"collection-editor\\\" form=\\\"verb-short\\\">ed. by</term>\\n <term name=\\\"compiler\\\" form=\\\"verb-short\\\">comp. by</term>\\n <term name=\\\"composer\\\" form=\\\"verb-short\\\">comp. by</term> <!-- ODWE -->\\n <term name=\\\"curator\\\" form=\\\"verb-short\\\">cur. by</term> <!-- Oxford Art Online -->\\n <term name=\\\"director\\\" form=\\\"verb-short\\\">dir. by</term>\\n <term name=\\\"editor\\\" form=\\\"verb-short\\\">ed. by</term>\\n <term name=\\\"editor-translator\\\" form=\\\"verb-short\\\">ed. & trans. by</term>\\n <term name=\\\"editortranslator\\\" form=\\\"verb-short\\\">ed. & trans. by</term>\\n <term name=\\\"editorial-director\\\" form=\\\"verb-short\\\">ed. by</term>\\n <term name=\\\"executive-producer\\\" form=\\\"verb-short\\\">exec. prod. by</term> <!-- ODA -->\\n <term name=\\\"illustrator\\\" form=\\\"verb-short\\\">ill. by</term>\\n <term name=\\\"narrator\\\" form=\\\"verb-short\\\">narr. by</term> <!-- ODA -->\\n <term name=\\\"organizer\\\" form=\\\"verb-short\\\">org. by</term> <!-- ODA -->\\n <term name=\\\"performer\\\" form=\\\"verb-short\\\">perf. by</term> <!-- ODA -->\\n <term name=\\\"producer\\\" form=\\\"verb-short\\\">prod. by</term> <!-- ODA -->\\n <term name=\\\"script-writer\\\" form=\\\"verb-short\\\">writ. by</term> <!-- ODA -->\\n <term name=\\\"translator\\\" form=\\\"verb-short\\\">trans. by</term>\\n\\n <!-- LONG MONTH FORMS -->\\n <term name=\\\"month-01\\\">January</term>\\n <term name=\\\"month-02\\\">February</term>\\n <term name=\\\"month-03\\\">March</term>\\n <term name=\\\"month-04\\\">April</term>\\n <term name=\\\"month-05\\\">May</term>\\n <term name=\\\"month-06\\\">June</term>\\n <term name=\\\"month-07\\\">July</term>\\n <term name=\\\"month-08\\\">August</term>\\n <term name=\\\"month-09\\\">September</term>\\n <term name=\\\"month-10\\\">October</term>\\n <term name=\\\"month-11\\\">November</term>\\n <term name=\\\"month-12\\\">December</term>\\n\\n <!-- SHORT MONTH FORMS -->\\n <!-- Chicago Manual of Style, 18th ed., sec. 10.44 (identical to New Hart's Rules, 2nd ed., sec. 10.2.6) -->\\n <term name=\\\"month-01\\\" form=\\\"short\\\">Jan.</term>\\n <term name=\\\"month-02\\\" form=\\\"short\\\">Feb.</term>\\n <term name=\\\"month-03\\\" form=\\\"short\\\">Mar.</term>\\n <term name=\\\"month-04\\\" form=\\\"short\\\">Apr.</term>\\n <term name=\\\"month-05\\\" form=\\\"short\\\">May</term>\\n <term name=\\\"month-06\\\" form=\\\"short\\\">June</term>\\n <term name=\\\"month-07\\\" form=\\\"short\\\">July</term>\\n <term name=\\\"month-08\\\" form=\\\"short\\\">Aug.</term>\\n <term name=\\\"month-09\\\" form=\\\"short\\\">Sept.</term>\\n <term name=\\\"month-10\\\" form=\\\"short\\\">Oct.</term>\\n <term name=\\\"month-11\\\" form=\\\"short\\\">Nov.</term>\\n <term name=\\\"month-12\\\" form=\\\"short\\\">Dec.</term>\\n\\n <!-- SEASONS -->\\n <term name=\\\"season-01\\\">Spring</term>\\n <term name=\\\"season-02\\\">Summer</term>\\n <term name=\\\"season-03\\\">Autumn</term>\\n <term name=\\\"season-04\\\">Winter</term>\\n </terms>\\n</locale>\\n\";\n","/**\n * DocTree → HTML. Two uses, one renderer:\n * • `documentToHtml` — a standalone, print-grade HTML file: CSS paged media\n * (@page size/margins/orientation, running header/footer margin boxes with\n * \"Page X of Y\", a different first page, named landscape pages per\n * section, columns, widow/orphan control, keep-with-next headings, no\n * breaks inside tables/code/figures, hyphenation), always light.\n * • `renderBlocksHtml` — the block renderer the EPUB writer reuses (XHTML).\n */\n\nimport { escapeHtml } from \"@ai-matrx/kit/html-escape\";\nimport { PAGE_BREAK_CLASS } from \"../directives\";\nimport { PAGE_SIZES, templateParts } from \"./settings\";\nimport { mathKey } from \"./math\";\nimport type { Block, Caption, DocTree, DocumentSettings, ImageMap, Inline, RunningTemplate } from \"./types\";\n\nexport interface HtmlRenderContext {\n tree: DocTree;\n images?: ImageMap | undefined;\n /** XHTML output (EPUB): self-closed void elements. */\n xhtml?: boolean;\n /** Where an in-document id lives (EPUB chapters split the document). */\n hrefFor?: (id: string) => string;\n /** Image URL override (EPUB packages images inside the book; the Markdown→HTML engine's asset port). `null` = unavailable. */\n srcFor?: (url: string) => string | null;\n}\n\nconst SAFE_URL = /^(?:https?:|mailto:|tel:|#|\\/|\\.{0,2}\\/|data:image\\/(?:png|jpe?g|gif|webp);)/i;\n\nfunction safeUrl(url: string): string | null {\n const u = url.trim();\n if (!u) return null;\n if (!/^[a-z][a-z0-9+.-]*:/i.test(u)) return u; // relative\n return SAFE_URL.test(u) ? u : null;\n}\n\nconst br = (x: HtmlRenderContext) => (x.xhtml ? \"<br/>\" : \"<br>\");\n\nexport function renderInlineHtml(nodes: Inline[], x: HtmlRenderContext): string {\n return nodes\n .map((n) => {\n switch (n.type) {\n case \"text\":\n return escapeHtml(n.value);\n case \"strong\":\n return `<strong>${renderInlineHtml(n.children, x)}</strong>`;\n case \"emphasis\":\n return `<em>${renderInlineHtml(n.children, x)}</em>`;\n case \"delete\":\n return `<del>${renderInlineHtml(n.children, x)}</del>`;\n case \"code\":\n return `<code>${escapeHtml(n.value)}</code>`;\n case \"break\":\n return br(x);\n case \"link\": {\n const href = safeUrl(n.url);\n const inner = renderInlineHtml(n.children, x);\n return href ? `<a href=\"${escapeHtml(href)}\">${inner}</a>` : inner;\n }\n case \"image\": {\n const src = imageSrc(n.url, x);\n if (!src) return escapeHtml(n.alt);\n return `<img class=\"doc-inline-img\" src=\"${escapeHtml(src)}\" alt=\"${escapeHtml(n.alt)}\"${x.xhtml ? \"/\" : \"\"}>`;\n }\n case \"xref\": {\n if (!n.resolved) return `<span class=\"doc-xref-missing\">${escapeHtml(n.label)}</span>`;\n const id = n.target.startsWith(\"sec:\") ? n.target.slice(4) : n.target;\n return `<a class=\"doc-xref\" href=\"${escapeHtml(href(id, x))}\">${escapeHtml(n.label)}</a>`;\n }\n case \"cite\":\n return n.resolved\n ? `<a class=\"doc-cite\" href=\"${escapeHtml(href(\"ref-\" + (n.keys[0] ?? \"\"), x))}\">${escapeHtml(n.label)}</a>`\n : `<span class=\"doc-cite doc-cite-missing\">${escapeHtml(n.label)}</span>`;\n case \"math\":\n return mathHtml(n.tex, n.display, x, true);\n case \"noteRef\":\n return `<sup class=\"doc-note-ref\"><a href=\"${escapeHtml(href(`note-${n.n}`, x))}\" id=\"noteref-${n.n}\">${n.n}</a></sup>`;\n default:\n return \"\";\n }\n })\n .join(\"\");\n}\n\n/** Typeset MathML (browsers and EPUB readers render it natively), or the TeX, marked. */\nfunction mathHtml(tex: string, display: boolean, x: HtmlRenderContext, inText = false): string {\n const m = x.tree.math.get(mathKey(tex, display));\n if (m?.mathml && !m.error) {\n if (!display) return `<span class=\"doc-math\">${m.mathml}</span>`;\n // Inside a paragraph a <div> is invalid (epubcheck RSC-005): a block-styled span.\n return inText ? `<span class=\"doc-math-display\">${m.mathml}</span>` : `<div class=\"doc-math-display\">${m.mathml}</div>`;\n }\n return `<code class=\"doc-math-tex\">${escapeHtml(display ? `$$${tex}$$` : `$${tex}$`)}</code>`;\n}\n\nconst href = (id: string, x: HtmlRenderContext) => (x.hrefFor ? x.hrefFor(id) : `#${id}`);\n\nfunction imageSrc(url: string, x: HtmlRenderContext): string | null {\n if (x.srcFor) {\n const src = x.srcFor(url);\n return src === null ? null : safeUrl(src);\n }\n const resolved = x.images?.get(url);\n if (resolved) return resolved.dataUrl;\n return safeUrl(url);\n}\n\nfunction captionHtml(c: Caption, tag: \"figcaption\" | \"caption\", x: HtmlRenderContext): string {\n const text = renderInlineHtml(c.children, x);\n return `<${tag} class=\"doc-caption\"><span class=\"doc-caption-label\">${c.label}</span>${text ? `: ${text}` : \"\"}</${tag}>`;\n}\n\nfunction tocHtml(x: HtmlRenderContext): string {\n const { tree } = x;\n const items = tree.toc\n .map(\n (e) =>\n `<li class=\"toc-l${e.level}\"><a href=\"${escapeHtml(href(e.id, x))}\"><span class=\"toc-text\">${escapeHtml(e.text)}</span><span class=\"toc-page\"></span></a></li>`,\n )\n .join(\"\");\n return `<nav class=\"doc-toc\" role=\"doc-toc\"><h2 class=\"doc-toc-title\">${escapeHtml(\n tree.settings.toc.title,\n )}</h2><ol>${items}</ol></nav>`;\n}\n\nexport function renderBlocksHtml(blocks: Block[], x: HtmlRenderContext): string {\n return blocks.map((b) => renderBlockHtml(b, x)).join(\"\\n\");\n}\n\nfunction renderBlockHtml(b: Block, x: HtmlRenderContext): string {\n switch (b.type) {\n case \"heading\": {\n const num = b.number ? `<span class=\"doc-heading-number\">${b.number}</span> ` : \"\";\n return `<h${b.level} id=\"${escapeHtml(b.id)}\" dir=\"auto\">${num}${renderInlineHtml(b.children, x)}</h${b.level}>`;\n }\n case \"paragraph\":\n return `<p dir=\"auto\">${renderInlineHtml(b.children, x)}</p>`;\n case \"list\": {\n const tag = b.ordered ? \"ol\" : \"ul\";\n const start = b.ordered && b.start !== 1 ? ` start=\"${b.start}\"` : \"\";\n const task = b.items.some((i) => i.checked !== null);\n const items = b.items\n .map((i) => {\n const box =\n i.checked === null\n ? \"\"\n : `<span class=\"doc-task-box${i.checked ? \" is-checked\" : \"\"}\" role=\"img\" aria-label=\"${i.checked ? \"done\" : \"not done\"}\"></span>`;\n const inner =\n i.children.length === 1 && i.children[0]?.type === \"paragraph\"\n ? renderInlineHtml(i.children[0].children, x)\n : renderBlocksHtml(i.children, x);\n return `<li dir=\"auto\"${i.checked !== null ? ' class=\"doc-task\"' : \"\"}>${box}${inner}</li>`;\n })\n .join(\"\");\n return `<${tag}${start}${task ? ' class=\"doc-task-list\"' : \"\"}>${items}</${tag}>`;\n }\n case \"blockquote\":\n return `<blockquote dir=\"auto\">${renderBlocksHtml(b.children, x)}</blockquote>`;\n case \"code\":\n return `<pre class=\"doc-code\"${b.lang ? ` data-language=\"${escapeHtml(b.lang)}\"` : \"\"}><code>${escapeHtml(\n b.value,\n )}</code></pre>`;\n case \"table\": {\n const al = (i: number) => {\n const a = b.align[i];\n return a ? ` style=\"text-align:${a}\"` : \"\";\n };\n const head = `<thead><tr>${b.header.map((c, i) => `<th dir=\"auto\"${al(i)}>${renderInlineHtml(c, x)}</th>`).join(\"\")}</tr></thead>`;\n const body = `<tbody>${b.rows\n .map((r) => `<tr>${r.map((c, i) => `<td dir=\"auto\"${al(i)}>${renderInlineHtml(c, x)}</td>`).join(\"\")}</tr>`)\n .join(\"\")}</tbody>`;\n const id = b.caption?.id ? ` id=\"tbl:${escapeHtml(b.caption.id)}\"` : \"\";\n return `<div class=\"doc-table-wrap\"${id}><table>${b.caption ? captionHtml(b.caption, \"caption\", x) : \"\"}${head}${body}</table></div>`;\n }\n case \"figure\": {\n const src = imageSrc(b.url, x);\n const id = b.caption?.id ? ` id=\"fig:${escapeHtml(b.caption.id)}\"` : \"\";\n const img = src\n ? `<img src=\"${escapeHtml(src)}\" alt=\"${escapeHtml(b.alt)}\"${x.xhtml ? \"/\" : \"\"}>`\n : `<div class=\"doc-image-missing\">Image unavailable: ${escapeHtml(b.alt || b.url)}</div>`;\n return `<figure class=\"doc-figure\"${id}>${img}${b.caption ? captionHtml(b.caption, \"figcaption\", x) : \"\"}</figure>`;\n }\n case \"rule\":\n return `<hr${x.xhtml ? \"/\" : \"\"}>`;\n case \"pageBreak\":\n return `<div class=\"${PAGE_BREAK_CLASS}\" role=\"separator\" aria-label=\"Page break\"></div>`;\n case \"toc\":\n return tocHtml(x);\n case \"math\":\n return mathHtml(b.tex, true, x);\n case \"notes\":\n return `<ol class=\"doc-notes\">${x.tree.notes\n .map(\n (n) =>\n `<li id=\"note-${n.n}\">${renderBlocksHtml(n.children, x)} <a class=\"doc-note-back\" href=\"${escapeHtml(\n href(`noteref-${n.n}`, x),\n )}\" aria-label=\"Back to text\">↩</a></li>`,\n )\n .join(\"\")}</ol>`;\n case \"bibliography\":\n return `<div class=\"doc-bibliography\" role=\"doc-bibliography\">${x.tree.bibliography\n .map((e) => `<p class=\"doc-ref\" id=\"ref-${escapeHtml(e.id)}\">${renderInlineHtml(e.children, x)}</p>`)\n .join(\"\")}</div>`;\n }\n}\n\nexport function coverHtml(s: DocumentSettings, x: HtmlRenderContext): string {\n const logo = s.logo ? imageSrc(s.logo, x) : null;\n return `<section class=\"doc-cover\">${logo ? `<img class=\"doc-cover-logo\" src=\"${escapeHtml(logo)}\" alt=\"\"${x.xhtml ? \"/\" : \"\"}>` : \"\"}<h1 class=\"doc-cover-title\">${escapeHtml(\n s.title ?? \"\",\n )}</h1>${s.subtitle ? `<p class=\"doc-cover-subtitle\">${escapeHtml(s.subtitle)}</p>` : \"\"}${\n s.author ? `<p class=\"doc-cover-author\">${escapeHtml(s.author)}</p>` : \"\"\n }${s.date ? `<p class=\"doc-cover-date\">${escapeHtml(s.date)}</p>` : \"\"}</section>`;\n}\n\n// ── print CSS ──────────────────────────────────────────────────────────────\n\n// A CSS string inside <style>: `<` / `>` are hex-escaped so author text (a\n// front-matter header/footer) can never close the element (`</style><script>`).\nconst cssString = (s: string) =>\n `\"${s\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/\"/g, '\\\\\"')\n .replace(/\\n/g, \" \")\n .replace(/</g, \"\\\\3C \")\n .replace(/>/g, \"\\\\3E \")}\"`;\n\nfunction marginContent(template: string | undefined, s: DocumentSettings): string {\n if (!template) return \"none\";\n return templateParts(template, s)\n .map((p) => (\"field\" in p ? `counter(${p.field})` : cssString(p.text)))\n .join(\" \");\n}\n\nfunction runningBoxes(t: RunningTemplate | null, where: \"top\" | \"bottom\", s: DocumentSettings): string {\n if (!t) return \"\";\n const box = (slot: \"left\" | \"center\" | \"right\") =>\n t[slot]\n ? `@${where}-${slot}{content:${marginContent(t[slot], s)};font:9pt/1.2 var(--doc-font);color:var(--matrx-print-muted,#6b7280);}`\n : \"\";\n return box(\"left\") + box(\"center\") + box(\"right\");\n}\n\nconst pt = (n: number) => `${Math.round(n * 100) / 100}pt`;\n\n/** The print stylesheet for a document's settings. Light mode, always. */\nexport function documentCss(s: DocumentSettings): string {\n const { width, height, margins: m } = s.page;\n const portrait = `${pt(width)} ${pt(height)}`;\n const landscape = `${pt(height)} ${pt(width)}`;\n const base = s.page.orientation === \"landscape\" ? landscape : portrait;\n const blankBoxes = [\"top\", \"bottom\"]\n .flatMap((w) => [\"left\", \"center\", \"right\"].map((sl) => `@${w}-${sl}{content:none;}`))\n .join(\"\");\n return `\n:root{color-scheme:light;--doc-font:\"Charter\",\"Georgia\",\"Cambria\",\"Times New Roman\",serif;--doc-sans:\"Inter\",\"Helvetica Neue\",\"Arial\",sans-serif;--doc-mono:\"SFMono-Regular\",\"Menlo\",\"Consolas\",\"Liberation Mono\",monospace;}\n@page{size:${base};margin:${pt(m.top)} ${pt(m.right)} ${pt(m.bottom)} ${pt(m.left)};${runningBoxes(s.header, \"top\", s)}${runningBoxes(s.footer, \"bottom\", s)}}\n@page doc-portrait{size:${portrait};}\n@page doc-landscape{size:${landscape};}\n${s.differentFirstPage ? `@page:first{${blankBoxes}}` : \"\"}\n@page doc-cover{${blankBoxes}}\nhtml{background:var(--matrx-print-page,#ffffff);}\nbody{margin:0;background:var(--matrx-print-page,#ffffff);color:var(--matrx-print-text,#1f2937);font:${pt(s.fontSize)}/1.5 var(--doc-font);-webkit-print-color-adjust:exact;print-color-adjust:exact;}\n.doc{max-width:${pt(width - m.left - m.right)};margin:0 auto;padding:48px 24px;}\n@media print{.doc{max-width:none;padding:0;}}\n.doc-section.doc-landscape{page:doc-landscape;}\n.doc-section.doc-portrait{page:doc-portrait;}\n@media screen{.doc-section.doc-landscape{max-width:none;}}\n.doc-section+.doc-section{break-before:page;}\n@media screen{.doc-section+.doc-section{border-top:1px dashed var(--matrx-print-rule,#d1d5db);margin-top:32px;padding-top:32px;}}\n.doc-cols-2{column-count:2;column-gap:0.3in;}\n.doc-cols-3{column-count:3;column-gap:0.25in;}\n.doc-cover{page:doc-cover;break-after:page;min-height:${pt(height - m.top - m.bottom)};display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:10pt;}\n@media screen{.doc-cover{min-height:60vh;border-bottom:1px dashed var(--matrx-print-rule,#d1d5db);margin-bottom:32px;}}\n.doc-cover-logo{max-height:72pt;max-width:40%;margin-bottom:24pt;}\n.doc-cover-title{font:700 30pt/1.15 var(--doc-sans);margin:0;letter-spacing:-0.01em;}\n.doc-cover-subtitle{font:400 16pt/1.3 var(--doc-sans);color:var(--matrx-print-muted,#4b5563);margin:0;}\n.doc-cover-author,.doc-cover-date{font:12pt/1.4 var(--doc-sans);color:var(--matrx-print-muted,#4b5563);margin:0;}\n.doc-cover-author{margin-top:36pt;}\np,li,dd{orphans:3;widows:3;}\np{margin:0 0 0.7em;${s.hyphenate ? \"hyphens:auto;-webkit-hyphens:auto;\" : \"\"}}\nh1,h2,h3,h4,h5,h6{font-family:var(--doc-sans);color:var(--matrx-print-heading,#111827);line-height:1.25;break-after:avoid;page-break-after:avoid;break-inside:avoid;hyphens:manual;}\nh1{font-size:${pt(s.fontSize * 1.8)};margin:1.2em 0 0.5em;}\nh2{font-size:${pt(s.fontSize * 1.45)};margin:1.1em 0 0.45em;}\nh3{font-size:${pt(s.fontSize * 1.2)};margin:1em 0 0.4em;}\nh4,h5,h6{font-size:${pt(s.fontSize * 1.05)};margin:0.9em 0 0.35em;}\n.doc-heading-number{color:var(--matrx-print-muted,#6b7280);margin-right:0.35em;}\na{color:var(--matrx-print-link,#1d4ed8);text-decoration:none;}\ncode{font:0.88em var(--doc-mono);background:var(--matrx-print-code-bg,#f3f4f6);padding:0.05em 0.3em;border-radius:3px;}\npre.doc-code{font:0.82em/1.45 var(--doc-mono);background:var(--matrx-print-code-bg,#f6f8fa);border:1px solid var(--matrx-print-rule,#e5e7eb);border-radius:4px;padding:8pt 10pt;white-space:pre-wrap;overflow-wrap:anywhere;break-inside:avoid;page-break-inside:avoid;}\npre.doc-code code{background:none;padding:0;font:inherit;}\nblockquote{margin:0 0 0.8em;padding:0.1em 0 0.1em 1em;border-left:3px solid var(--matrx-print-rule,#d1d5db);color:var(--matrx-print-muted,#4b5563);break-inside:avoid;}\nhr{border:0;border-top:1px solid var(--matrx-print-rule,#d1d5db);margin:1.2em 0;}\n.doc-table-wrap{margin:0 0 1em;break-inside:avoid;page-break-inside:avoid;}\ntable{border-collapse:collapse;width:100%;font-size:0.92em;}\nthead{display:table-header-group;}\ntr{break-inside:avoid;page-break-inside:avoid;}\nth,td{border-bottom:1px solid var(--matrx-print-rule,#e5e7eb);padding:4pt 6pt;text-align:left;vertical-align:top;}\nth{font-family:var(--doc-sans);font-weight:600;border-bottom:1.5px solid var(--matrx-print-heading,#111827);}\ntable caption{caption-side:top;text-align:left;margin-bottom:4pt;}\n.doc-caption{font:0.9em/1.4 var(--doc-sans);color:var(--matrx-print-muted,#4b5563);break-after:avoid;}\n.doc-caption-label{font-weight:600;color:var(--matrx-print-heading,#111827);}\n.doc-figure{margin:0 0 1em;text-align:center;break-inside:avoid;page-break-inside:avoid;}\n.doc-figure img{max-width:100%;max-height:${pt((height - m.top - m.bottom) * 0.7)};}\n.doc-figure figcaption{margin-top:4pt;}\n.doc-image-missing{border:1px dashed var(--matrx-print-rule,#d1d5db);padding:16pt;color:var(--matrx-print-muted,#6b7280);}\n.doc-inline-img{max-height:1.2em;vertical-align:middle;}\n.doc-math-display{display:block;margin:0.6em 0 0.9em;text-align:center;break-inside:avoid;overflow-x:auto;}\n.doc-math-display math{font-size:1.15em;}\n.doc-math-tex{color:var(--matrx-print-danger,#b91c1c);}\n.doc-task-list{list-style:none;padding-left:0.2em;}\n.doc-task-box{display:inline-block;width:0.8em;height:0.8em;border:1.2px solid var(--matrx-print-heading,#374151);border-radius:2px;margin-right:0.45em;vertical-align:-0.05em;}\n.doc-task-box.is-checked{background:var(--matrx-print-heading,#374151);}\n.doc-xref-missing,.doc-cite-missing{color:var(--matrx-print-danger,#b91c1c);font-weight:600;}\n.doc-toc{break-after:auto;}\n.doc-toc-title{font-size:${pt(s.fontSize * 1.45)};}\n.doc-toc ol{list-style:none;padding:0;margin:0;}\n.doc-toc li{margin:0.2em 0;}\n.doc-toc a{display:flex;gap:0.5em;color:inherit;}\n.doc-toc .toc-text{flex:1;}\n.doc-toc a::after{content:target-counter(attr(href url),page);}\n${[2, 3, 4, 5, 6].map((l) => `.doc-toc .toc-l${l}{padding-left:${(l - 1) * 1.2}em;}`).join(\"\")}\n.doc-toc .toc-l1{font-weight:600;}\n.doc-bibliography .doc-ref{padding-left:2em;text-indent:-2em;}\n.doc-notes{font-size:0.9em;}\n.doc-note-back{margin-left:0.3em;}\n.${PAGE_BREAK_CLASS}{break-after:page;page-break-after:always;height:0;}\n@media screen{.${PAGE_BREAK_CLASS}{height:auto;border-top:1px dashed var(--matrx-print-rule,#d1d5db);margin:24px 0;}}\n`.trim();\n}\n\nexport interface DocumentHtmlOptions {\n images?: ImageMap | undefined;\n /** Image URL override (see `HtmlRenderContext.srcFor`). */\n srcFor?: ((url: string) => string | null) | undefined;\n /**\n * Rewrites the rendered body (cover + sections) before it is placed in the\n * page — the Markdown→HTML engine renders kind atoms and applies the\n * allow-list here, so the trusted page shell and its CSS stay intact.\n */\n transformBody?: ((html: string) => string) | undefined;\n}\n\n/** A complete, standalone print-grade HTML document. */\nexport function documentToHtml(tree: DocTree, options: DocumentHtmlOptions = {}): string {\n const s = tree.settings;\n const x: HtmlRenderContext = { tree, images: options.images, ...(options.srcFor ? { srcFor: options.srcFor } : {}) };\n const sections = tree.sections\n .map((sec) => {\n const cls = [\n \"doc-section\",\n sec.orientation === s.page.orientation ? \"\" : `doc-${sec.orientation}`,\n sec.columns > 1 ? `doc-cols-${sec.columns}` : \"\",\n ]\n .filter(Boolean)\n .join(\" \");\n return `<section class=\"${cls}\">${renderBlocksHtml(sec.blocks, x)}</section>`;\n })\n .join(\"\\n\");\n const size = PAGE_SIZES[s.page.size].label;\n return `<!DOCTYPE html>\n<html lang=\"${escapeHtml(s.lang)}\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<meta name=\"color-scheme\" content=\"light\">\n<meta name=\"generator\" content=\"@ai-matrx/print/document (${size}, ${s.page.orientation})\">\n<title>${escapeHtml(s.title ?? \"Document\")}</title>\n${s.author ? `<meta name=\"author\" content=\"${escapeHtml(s.author)}\">` : \"\"}\n<style>${documentCss(s)}</style>\n</head>\n<body>\n<main class=\"doc\">\n${(options.transformBody ?? ((h: string) => h))(`${s.cover ? coverHtml(s, x) : \"\"}\n${sections}`)}\n</main>\n</body>\n</html>`;\n}\n","/**\n * @ai-matrx/print/directives — the ONE definition of the print directives\n * markdown can carry, shared by every surface that reads markdown.\n *\n * Why a separate, zero-dependency entry: the directive syntax has three\n * readers — this package's two converters (print window / PDF / HTML page),\n * the chat renderer's remark plugin (the on-screen preview), and any editor\n * that inserts one. If each re-derived the regex they would drift the first\n * time someone added an alias. `/markdown` carries ~20KB of stylesheet, so the\n * chat bundle imports the syntax from here instead and pays nothing.\n *\n * ── Page break ────────────────────────────────────────────────────────────\n * A line that is exactly one of these (case-insensitive, surrounding\n * whitespace ignored) forces the next content onto a new printed page:\n *\n * <!-- pagebreak --> ← canonical; invisible in any other renderer\n * <!-- page-break --> <!-- page break --> <!-- newpage -->\n * \\pagebreak \\newpage ← LaTeX / pandoc habit\n * <div style=\"page-break-after: always\"></div> ← Typora / VS Code habit\n * (also `page-break-before`, `break-after: page`, `break-before: page`,\n * and `<div class=\"page-break\"></div>` / `class=\"pagebreak\"`)\n *\n * On screen every surface draws the same idea: a dashed rule labelled\n * \"Page break\" with generous padding. In print it is a zero-height element\n * with `break-after: page`.\n */\n\n/** The form editors insert and docs recommend. */\nexport const PAGE_BREAK_MARKDOWN = \"<!-- pagebreak -->\";\n\n/** The class every surface puts on a rendered page break. */\nexport const PAGE_BREAK_CLASS = \"matrx-page-break\";\n\n/** Screen label for a rendered page break. */\nexport const PAGE_BREAK_LABEL = \"Page break\";\n\nconst COMMENT_FORM = /^<!--\\s*(?:page[\\s_-]?break|new[\\s_-]?page)\\s*-->$/i;\nconst LATEX_FORM = /^\\\\(?:pagebreak|newpage|clearpage)\\s*(?:\\{\\s*\\})?$/i;\nconst DIV_FORM = /^<div\\b([^>]*)>\\s*<\\/div>$|^<div\\b([^>]*)\\/>$/i;\nconst DIV_BREAK_ATTR =\n /(?:page-break-(?:after|before)\\s*:\\s*always|break-(?:after|before)\\s*:\\s*page|class\\s*=\\s*[\"'](?:[^\"']*\\s)?page-?break(?:\\s[^\"']*)?[\"'])/i;\n\n/** Columns of leading indentation (tab = 4, NBSP counts as a space). */\nfunction indentColumns(line: string): number {\n let cols = 0;\n for (const ch of line) {\n if (ch === \" \" || ch === \"\\u00A0\") cols += 1;\n else if (ch === \"\\t\") cols += 4;\n else break;\n }\n return cols;\n}\n\n/**\n * Is this single line a page-break directive? Indented four or more columns\n * it is not — in markdown that is a code block, and every surface must agree.\n */\nexport function isPageBreakLine(line: string): boolean {\n if (indentColumns(line) >= 4) return false;\n const t = line.trim();\n if (t.length < 8 || t.length > 200) return false;\n if (COMMENT_FORM.test(t) || LATEX_FORM.test(t)) return true;\n const div = DIV_FORM.exec(t);\n if (!div) return false;\n return DIV_BREAK_ATTR.test(div[1] ?? div[2] ?? \"\");\n}\n\n// ── Section break ─────────────────────────────────────────────────────────\n//\n// A section break is a page break that can also change the page layout for\n// everything after it (Word's \"Section break (next page)\"):\n//\n// <!-- section --> ← new page, same layout\n// <!-- section: landscape --> ← new page, landscape from here on\n// <!-- section landscape columns=2 --> ← landscape AND two columns\n// <!-- section portrait columns=1 --> ← back to the default layout\n//\n// Recognised words: `landscape` / `portrait`, `columns=N` (or `cols=N`,\n// `N columns`, 1–3). Unknown words are ignored, never an error — the break\n// still happens. Every page-break reader treats a section break as a break.\n\n/** The form editors insert for a plain section break. */\nexport const SECTION_BREAK_MARKDOWN = \"<!-- section -->\";\n\nexport interface SectionBreakDirective {\n /** Absent = inherit the document's orientation. */\n orientation?: \"portrait\" | \"landscape\";\n /** Absent = inherit the document's column count. 1–3. */\n columns?: 1 | 2 | 3;\n}\n\nconst SECTION_FORM = /^<!--\\s*section(?:[\\s_-]?break)?\\b\\s*:?\\s*([^>]*?)\\s*-->$/i;\n\n/** Parse a section-break line; `null` when the line is not one. */\nexport function parseSectionBreakLine(line: string): SectionBreakDirective | null {\n if (indentColumns(line) >= 4) return null;\n const m = SECTION_FORM.exec(line.trim());\n if (!m) return null;\n const words = (m[1] ?? \"\").toLowerCase();\n const out: SectionBreakDirective = {};\n if (/\\blandscape\\b/.test(words)) out.orientation = \"landscape\";\n else if (/\\bportrait\\b/.test(words)) out.orientation = \"portrait\";\n const cols = /\\b(?:columns?|cols?)\\s*[=:]\\s*(\\d)\\b/.exec(words) ?? /\\b(\\d)\\s*[-\\s]?columns?\\b/.exec(words);\n if (cols) {\n const n = Math.min(3, Math.max(1, Number(cols[1])));\n out.columns = n as 1 | 2 | 3;\n }\n return out;\n}\n\n// ── Table of contents / bibliography placement ───────────────────────────\n//\n// `[[toc]]`, `[toc]`, `[TOC]`, `${toc}`, `<!-- toc -->`, `\\tableofcontents`\n// put the table of contents at that spot (otherwise frontmatter `toc: true`\n// puts it at the start). `<!-- bibliography -->`, `[[bibliography]]`,\n// `\\printbibliography` put the reference list there (otherwise it closes the\n// document whenever something is cited).\n\nexport const TOC_MARKDOWN = \"[[toc]]\";\nexport const BIBLIOGRAPHY_MARKDOWN = \"<!-- bibliography -->\";\n\nconst TOC_FORM = /^(?:\\[\\[\\s*toc\\s*\\]\\]|\\[toc\\]|\\$\\{toc\\}|<!--\\s*toc\\s*-->|\\\\tableofcontents)$/i;\nconst BIBLIOGRAPHY_FORM =\n /^(?:\\[\\[\\s*(?:bibliography|references)\\s*\\]\\]|<!--\\s*(?:bibliography|references)\\s*-->|\\\\printbibliography|\\\\bibliography\\{[^}]*\\})$/i;\n\nexport function isTocLine(line: string): boolean {\n return indentColumns(line) < 4 && TOC_FORM.test(line.trim());\n}\n\nexport function isBibliographyLine(line: string): boolean {\n return indentColumns(line) < 4 && BIBLIOGRAPHY_FORM.test(line.trim());\n}\n\n/** Any directive that ends the current printed page (page or section break). */\nexport function isBreakLine(line: string): boolean {\n return isPageBreakLine(line) || parseSectionBreakLine(line) !== null;\n}\n\n/**\n * Split markdown into the pieces that belong on separate pages. Fence-aware:\n * a directive inside a ``` / ~~~ code block is code, not a break. Always\n * returns at least one piece; empty pieces (two breaks in a row, a break at\n * the very start or end) are kept out so no blank page is produced.\n */\nexport function splitAtPageBreaks(markdown: string): string[] {\n const lines = markdown.split(/\\r?\\n/);\n const pieces: string[] = [];\n let current: string[] = [];\n let fence: string | null = null;\n\n for (const line of lines) {\n // Any indent — the converters accept list-nested fences, so must this.\n const fenceMatch = /^\\s*(`{3,}|~{3,})/.exec(line);\n if (fenceMatch) {\n const marker = fenceMatch[1] as string;\n if (fence === null) fence = marker;\n else if (marker[0] === fence[0] && marker.length >= fence.length) fence = null;\n } else if (fence === null && isBreakLine(line)) {\n if (current.join(\"\\n\").trim()) pieces.push(current.join(\"\\n\"));\n current = [];\n continue;\n }\n current.push(line);\n }\n if (current.join(\"\\n\").trim() || pieces.length === 0) pieces.push(current.join(\"\\n\"));\n return pieces;\n}\n","/**\n * Citation SYNTAX (pandoc). Formatting is done by a real CSL processor —\n * citeproc-js over the official CSL styles (`./csl/engine.ts`).\n *\n * Syntax (pandoc): `[@smith2020]`, `[@smith2020, p. 4]`, `[@a; @b]`,\n * `[-@smith2020]` (suppress the author), and a bare `@smith2020` in running\n * text (narrative: \"Smith (2020)\") — the bare form only fires for a key that\n * is actually in the reference list, so an email or an @-handle is never\n * mistaken for a citation.\n */\n\n\nexport interface CiteRef {\n key: string;\n locator?: string | undefined;\n suppressAuthor: boolean;\n}\n\n/** Parse the inside of `[...]` into cite refs; null if it is not a citation. */\nexport function parseCitationGroup(inner: string): CiteRef[] | null {\n const parts = inner.split(\";\").map((p) => p.trim());\n if (parts.length === 0) return null;\n const refs: CiteRef[] = [];\n for (const part of parts) {\n const m = /^(-?)@([A-Za-z0-9_][\\w:.#$%&+?<>~/-]*?)(?:\\s*,\\s*(.+))?$/.exec(part);\n if (!m) return null;\n // `@fig:x` / `@tbl:x` / `@sec:x` are cross-references, not citations.\n if (/^(fig|tbl|sec|eq|lst):/i.test(m[2] as string)) return null;\n refs.push({ key: m[2] as string, locator: m[3]?.trim(), suppressAuthor: m[1] === \"-\" });\n }\n return refs;\n}\n\n/**\n * Every citation key a markdown body uses: bracketed groups and bare\n * namespaced keys (`@research:…`, `@file:…`). Used to ask a host resolver\n * for the references the frontmatter does not carry.\n */\nexport function scanCitationKeys(body: string): string[] {\n const keys = new Set<string>();\n for (const m of body.matchAll(/\\[(-?@[^[\\]]+)\\]/g)) for (const r of parseCitationGroup(m[1] as string) ?? []) keys.add(r.key);\n for (const m of body.matchAll(/(?:^|[^\\w@.\\\\])@([a-z][\\w-]*:[\\w.-]*\\w)/g)) {\n if (!/^(fig|tbl|sec|eq|lst):/i.test(m[1] as string)) keys.add(m[1] as string);\n }\n return [...keys];\n}\n","/**\n * markdown (+ frontmatter) → DocTree. The ONE parse every document output\n * (PDF, DOCX, EPUB, HTML) renders from.\n *\n * Grammar:\n * • CommonMark + GFM (tables, task lists, strikethrough, autolinks,\n * footnotes) via micromark/mdast — the reference parser, not a regex.\n * • Page/section breaks, TOC and bibliography placement come ONLY from\n * `../directives` (the grammar the chat preview and the print skins share).\n * • Captions + cross-references follow pandoc-crossref:\n * {#fig:growth} figure, numbered \"Figure N\"\n * Table: A caption {#tbl:sales} caption line before/after a table\n * ## Methods {#sec:methods} heading id (`{-}` = unnumbered)\n * see @fig:growth, @tbl:sales, @sec:methods\n * • Citations follow pandoc: [@key], [@key, p. 4], [@a; @b], [-@key], @key.\n */\n\nimport { fromMarkdown } from \"mdast-util-from-markdown\";\nimport { gfmFromMarkdown } from \"mdast-util-gfm\";\nimport { gfm } from \"micromark-extension-gfm\";\nimport type {\n Nodes as MdNode,\n Parents as MdParent,\n PhrasingContent,\n Root,\n RootContent,\n Table as MdTable,\n} from \"mdast\";\nimport {\n isBibliographyLine,\n isPageBreakLine,\n isTocLine,\n parseSectionBreakLine,\n type SectionBreakDirective,\n} from \"../directives\";\nimport { removeThinkingContent, unwrapArtifactsToMarkdown } from \"../markdown\";\nimport { extractMath, MATH_TOKEN_RE, type MathSpan } from \"./math\";\nimport { parseCitationGroup, type CiteRef } from \"./citations\";\nimport { bundledCslStyle, CitationEngine, cslLocaleTag, cslStyleId } from \"./csl/engine\";\nimport { BUNDLED_CSL_LOCALE_EN_US } from \"./csl/bundled\";\nimport { resolveSettings, splitFrontmatter, type ResolveSettingsOptions } from \"./settings\";\nimport type {\n Block,\n Caption,\n CslItem,\n DocSection,\n DocTree,\n DocumentNotice,\n DocumentSettings,\n Inline,\n ListItem,\n} from \"./types\";\n\nexport interface ParseDocumentOptions extends ResolveSettingsOptions {\n /** Where dropped/degraded content is announced (also collected on the tree). */\n onNotice?: (notice: DocumentNotice) => void;\n /**\n * CSL inputs loaded ahead of time (`prepareDocument` does this): style XML\n * by style id, and the locale XML for the document's language. Bundled\n * styles (apa, mla, chicago, chicago-notes, ieee, harvard) and en-US need\n * nothing here.\n */\n csl?: { styles?: Record<string, string> | undefined; locale?: string | undefined } | undefined;\n}\n\nconst MARK = \"matrx:\";\nconst FENCE_RE = /^\\s*(`{3,}|~{3,})/;\nconst TABLE_CAPTION_RE = /^\\s{0,3}(?:Table:|:)\\s+\\S/;\n\n/** Rewrite directive lines into canonical HTML comments the tree reads. Fence-aware. */\nfunction prepass(body: string): string {\n const lines = body.split(/\\r?\\n/);\n const out: string[] = [];\n let fence: string | null = null;\n const isTableLine = (l: string | undefined) => l !== undefined && /^\\s{0,3}\\|/.test(l);\n const prevNonBlank = (i: number) => {\n for (let j = i - 1; j >= 0; j--) if ((lines[j] as string).trim()) return lines[j];\n return undefined;\n };\n const nextNonBlank = (i: number) => {\n for (let j = i + 1; j < lines.length; j++) if ((lines[j] as string).trim()) return lines[j];\n return undefined;\n };\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i] as string;\n const fm = FENCE_RE.exec(line);\n if (fm) {\n const marker = fm[1] as string;\n if (fence === null) fence = marker;\n else if (marker[0] === fence[0] && marker.length >= fence.length) fence = null;\n out.push(line);\n continue;\n }\n if (fence !== null) {\n out.push(line);\n continue;\n }\n let directive: string | null = null;\n const section = parseSectionBreakLine(line);\n if (section) directive = `<!--${MARK}section ${JSON.stringify(section)}-->`;\n else if (isPageBreakLine(line)) directive = `<!--${MARK}pagebreak-->`;\n else if (isTocLine(line)) directive = `<!--${MARK}toc-->`;\n else if (isBibliographyLine(line)) directive = `<!--${MARK}bibliography-->`;\n if (directive) {\n out.push(\"\", directive, \"\");\n continue;\n }\n // A pandoc table caption glued to its table would otherwise become a row.\n if (TABLE_CAPTION_RE.test(line) && (isTableLine(prevNonBlank(i)) || isTableLine(nextNonBlank(i)))) {\n out.push(\"\", line.trim().replace(/^:\\s+/, \"Table: \"), \"\");\n continue;\n }\n out.push(line);\n }\n return out.join(\"\\n\");\n}\n\nconst slugify = (s: string): string =>\n s\n .toLowerCase()\n .normalize(\"NFKD\")\n .replace(/[̀-ͯ]/g, \"\")\n .replace(/[^\\w\\s-]/g, \"\")\n .trim()\n .replace(/\\s+/g, \"-\")\n .replace(/-+/g, \"-\") || \"section\";\n\nexport function plainText(inlines: Inline[]): string {\n return inlines\n .map((n) => {\n switch (n.type) {\n case \"text\":\n case \"code\":\n return n.value;\n case \"strong\":\n case \"emphasis\":\n case \"delete\":\n case \"link\":\n return plainText(n.children);\n case \"xref\":\n case \"cite\":\n return n.label;\n case \"image\":\n return n.alt;\n case \"math\":\n return n.tex;\n case \"break\":\n return \" \";\n default:\n return \"\";\n }\n })\n .join(\"\");\n}\n\ninterface Ctx {\n settings: DocumentSettings;\n notices: DocumentNotice[];\n notify: (n: DocumentNotice) => void;\n defs: Map<string, { url: string; title?: string | null | undefined }>;\n footnoteDefs: Map<string, RootContent[]>;\n noteOrder: Map<string, number>;\n refs: Map<string, CslItem>;\n /** The CSL processor, created on the first citation. */\n engine: () => CitationEngine;\n /** Math lifted out before parsing, addressed by token index. */\n math: MathSpan[];\n /** One counter for footnotes and note-style citations. */\n noteCount: number;\n citeNotes: Array<{ n: number; children: Block[] }>;\n htmlAnnounced: boolean;\n ids: Set<string>;\n figN: number;\n tblN: number;\n figures: Caption[];\n tables: Caption[];\n /** Pending xrefs, resolved once every id is known. */\n xrefs: Array<Extract<Inline, { type: \"xref\" }>>;\n headingIndex: Map<string, Extract<Block, { type: \"heading\" }>>;\n}\n\nfunction uniqueId(ctx: Ctx, base: string): string {\n let id = base;\n for (let n = 2; ctx.ids.has(id); n++) id = `${base}-${n}`;\n ctx.ids.add(id);\n return id;\n}\n\n// ── inline scanning: citations and cross-references inside text ────────────\n\nconst CITE_GROUP_RE = /\\[(-?@[^[\\]]+)\\]/g;\n// A bare key may carry a pandoc locator right after it: `@smith2020 [p. 4]`.\nconst BARE_RE = /(^|[^\\w@.\\\\])@((?:fig|tbl|sec|eq):[\\w-]+|[A-Za-z0-9_](?:[\\w:.#$%&+?<>~/-]*\\w)?)(?: \\[([^\\[\\]@]+)\\])?/g;\n\nfunction scanText(value: string, ctx: Ctx): Inline[] {\n const out: Inline[] = [];\n const pushText = (s: string) => {\n if (!s) return;\n const last = out[out.length - 1];\n if (last?.type === \"text\") last.value += s;\n else out.push({ type: \"text\", value: s });\n };\n const scanBare = (s: string) => {\n let last = 0;\n for (const m of s.matchAll(BARE_RE)) {\n const key = m[2] as string;\n const start = m.index! + (m[1] as string).length;\n const xm = /^(fig|tbl|sec|eq):(.+)$/.exec(key);\n if (xm) {\n pushText(s.slice(last, start));\n out.push(makeXref(`${xm[1]}:${xm[2]}`, ctx));\n last = start + key.length + 1;\n } else if (ctx.refs.has(key)) {\n pushText(s.slice(last, start));\n out.push(cite([{ key, locator: m[3]?.trim(), suppressAuthor: false }], ctx, true));\n last = start + key.length + 1 + (m[3] !== undefined ? m[3].length + 3 : 0);\n }\n }\n pushText(s.slice(last));\n };\n let last = 0;\n for (const m of value.matchAll(CITE_GROUP_RE)) {\n const inner = m[1] as string;\n const refs = parseCitationGroup(inner);\n const single = /^@((?:fig|tbl|sec|eq):[\\w-]+)$/.exec(inner.trim());\n if (!refs && !single) continue;\n scanBare(value.slice(last, m.index));\n if (single) out.push(makeXref(single[1] as string, ctx));\n else if (refs) {\n const missing = refs.filter((r) => !ctx.refs.has(r.key)).map((r) => r.key);\n if (missing.length) {\n ctx.notify({\n code: \"citation-unresolved\",\n message: `No reference was found for ${missing.map((k) => `@${k}`).join(\", \")}.`,\n remedy: \"Add it under `references:` in the settings at the top (id, title, author, issued), or fix the key's spelling.\",\n });\n out.push({ type: \"cite\", keys: refs.map((r) => r.key), label: `(${refs.map((r) => (ctx.refs.has(r.key) ? r.key : `${r.key}?`)).join(\"; \")})`, resolved: false });\n } else out.push(cite(refs, ctx, false));\n }\n last = m.index! + m[0].length;\n }\n scanBare(value.slice(last));\n return out;\n}\n\n/** Format a citation group through the CSL processor. */\nfunction cite(refs: CiteRef[], ctx: Ctx, narrative: boolean): Inline {\n const engine = ctx.engine();\n if (engine.isNote) {\n // A note style: the citation IS a numbered note.\n const n = ++ctx.noteCount;\n const res = engine.cite(refs, { noteIndex: n });\n const text: Extract<Inline, { type: \"text\" }> = { type: \"text\", value: res.label };\n res.onUpdate((l) => {\n text.value = l;\n });\n ctx.citeNotes.push({ n, children: [{ type: \"paragraph\", children: [text] }] });\n return { type: \"noteRef\", n };\n }\n const res = engine.cite(refs, { narrative });\n const node: Extract<Inline, { type: \"cite\" }> = { type: \"cite\", keys: refs.map((r) => r.key), label: res.label, resolved: true };\n res.onUpdate((l) => {\n node.label = l;\n });\n return node;\n}\n\nfunction makeXref(target: string, ctx: Ctx): Extract<Inline, { type: \"xref\" }> {\n const x = { type: \"xref\" as const, target, label: target, resolved: false };\n ctx.xrefs.push(x);\n return x;\n}\n\nfunction inlines(nodes: PhrasingContent[] | readonly MdNode[], ctx: Ctx): Inline[] {\n const out: Inline[] = [];\n for (const n of nodes as MdNode[]) {\n switch (n.type) {\n case \"text\": {\n let last = 0;\n for (const m of n.value.matchAll(MATH_TOKEN_RE)) {\n if (m.index! > last) out.push(...scanText(n.value.slice(last, m.index), ctx));\n const span = ctx.math[Number(m[1])];\n if (span) out.push({ type: \"math\", tex: span.tex, display: span.display });\n last = m.index! + m[0].length;\n }\n if (last < n.value.length) out.push(...scanText(n.value.slice(last), ctx));\n break;\n }\n case \"strong\":\n out.push({ type: \"strong\", children: inlines(n.children, ctx) });\n break;\n case \"emphasis\":\n out.push({ type: \"emphasis\", children: inlines(n.children, ctx) });\n break;\n case \"delete\":\n out.push({ type: \"delete\", children: inlines(n.children, ctx) });\n break;\n case \"inlineCode\":\n out.push({ type: \"code\", value: n.value });\n break;\n case \"break\":\n out.push({ type: \"break\" });\n break;\n case \"link\":\n out.push({ type: \"link\", url: n.url, children: inlines(n.children, ctx) });\n break;\n case \"image\":\n out.push({ type: \"image\", url: n.url, alt: n.alt ?? \"\" });\n break;\n case \"linkReference\": {\n const def = ctx.defs.get(n.identifier);\n const kids = inlines(n.children, ctx);\n if (def) out.push({ type: \"link\", url: def.url, children: kids });\n else out.push({ type: \"text\", value: \"[\" }, ...kids, { type: \"text\", value: \"]\" });\n break;\n }\n case \"imageReference\": {\n const def = ctx.defs.get(n.identifier);\n if (def) out.push({ type: \"image\", url: def.url, alt: n.alt ?? \"\" });\n break;\n }\n case \"footnoteReference\": {\n let num = ctx.noteOrder.get(n.identifier);\n if (num === undefined) {\n num = ++ctx.noteCount;\n ctx.noteOrder.set(n.identifier, num);\n }\n out.push({ type: \"noteRef\", n: num });\n break;\n }\n case \"html\":\n // Inline raw HTML: <br> is a line break; any other tag is dropped and\n // its text kept (the tags are separate nodes, the text between survives).\n if (/^<br\\s*\\/?>$/i.test(n.value.trim())) out.push({ type: \"break\" });\n else if (!/^<!--/.test(n.value)) announceHtml(ctx);\n break;\n default:\n break;\n }\n }\n return out;\n}\n\nfunction announceHtml(ctx: Ctx) {\n if (ctx.htmlAnnounced) return;\n ctx.htmlAnnounced = true;\n ctx.notify({\n code: \"html-stripped\",\n message: \"Raw HTML tags in the document were left out of the printed/exported file (their text is kept).\",\n remedy: \"Use markdown formatting instead of HTML tags; a page break is the line <!-- pagebreak -->.\",\n });\n}\n\n// ── blocks ─────────────────────────────────────────────────────────────────\n\ntype Directive =\n | { type: \"section\"; value: SectionBreakDirective }\n | { type: \"pagebreak\" }\n | { type: \"toc\" }\n | { type: \"bibliography\" };\n\nfunction directiveOf(node: RootContent): Directive | null {\n if (node.type !== \"html\") return null;\n const m = /^<!--matrx:(section|pagebreak|toc|bibliography)\\s*(.*?)-->$/.exec(node.value.trim());\n if (!m) return null;\n if (m[1] === \"section\") {\n try {\n return { type: \"section\", value: JSON.parse(m[2] || \"{}\") as SectionBreakDirective };\n } catch {\n return { type: \"section\", value: {} };\n }\n }\n return { type: m[1] as \"pagebreak\" | \"toc\" | \"bibliography\" };\n}\n\nconst ATTR_RE = /\\s*\\{([^{}]*)\\}\\s*$/;\n\n/** Pull a trailing pandoc attribute block `{#id .class -}` off inline content. */\nfunction takeAttributes(kids: Inline[]): { id?: string | undefined; unnumbered: boolean } {\n const last = kids[kids.length - 1];\n if (last?.type !== \"text\") return { unnumbered: false };\n const m = ATTR_RE.exec(last.value);\n if (!m) return { unnumbered: false };\n const attrs = (m[1] as string).trim().split(/\\s+/);\n if (!attrs.every((a) => /^(#[\\w:.-]+|\\.[\\w-]+|-|[\\w-]+=\\S+)$/.test(a))) return { unnumbered: false };\n last.value = last.value.slice(0, m.index).replace(/\\s+$/, \"\");\n if (!last.value) kids.pop();\n const id = attrs.find((a) => a.startsWith(\"#\"))?.slice(1);\n const unnumbered = attrs.includes(\"-\") || attrs.includes(\".unnumbered\");\n return { id, unnumbered };\n}\n\nfunction figureOf(node: RootContent, ctx: Ctx): Block | null {\n if (node.type !== \"paragraph\") return null;\n const kids = node.children.filter((c) => !(c.type === \"text\" && !c.value.trim()));\n const img = kids[0];\n if (!img || (img.type !== \"image\" && img.type !== \"imageReference\")) return null;\n let url: string;\n let alt = img.alt ?? \"\";\n if (img.type === \"image\") {\n url = img.url;\n if (!alt && img.title) alt = img.title;\n } else {\n const def = ctx.defs.get(img.identifier);\n if (!def) return null;\n url = def.url;\n }\n let id: string | undefined;\n if (kids.length === 2) {\n const tail = kids[1];\n const m = tail?.type === \"text\" ? /^\\s*\\{#fig:([\\w-]+)[^}]*\\}\\s*$/.exec(tail.value) : null;\n if (!m) return null;\n id = m[1];\n } else if (kids.length > 2) return null;\n const figure: Extract<Block, { type: \"figure\" }> = { type: \"figure\", url, alt };\n if (alt.trim() || id) {\n const number = ++ctx.figN;\n const children = alt.trim() ? scanText(alt, ctx) : [];\n const caption: Caption = { kind: \"fig\", id, number, label: `Figure ${number}`, children };\n if (id) uniqueId(ctx, `fig:${id}`);\n figure.caption = caption;\n ctx.figures.push(caption);\n }\n return figure;\n}\n\nfunction tableCaptionText(node: RootContent | undefined): PhrasingContent[] | null {\n if (!node || node.type !== \"paragraph\") return null;\n const first = node.children[0];\n if (first?.type !== \"text\" || !/^Table:\\s+/.test(first.value)) return null;\n const rest = [{ ...first, value: first.value.replace(/^Table:\\s+/, \"\") }, ...node.children.slice(1)];\n return rest as PhrasingContent[];\n}\n\nfunction convertBlocks(nodes: RootContent[], ctx: Ctx, out: Block[], allowDirectives = false): void {\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i] as RootContent;\n const block = convertBlock(nodes, i, ctx, allowDirectives);\n if (block === \"skip-next\") {\n i++;\n continue;\n }\n if (block) out.push(block);\n }\n}\n\nfunction convertTable(node: MdTable, captionNodes: PhrasingContent[] | null, ctx: Ctx): Block {\n const rows = node.children.map((row) => row.children.map((cell) => inlines(cell.children, ctx)));\n const table: Extract<Block, { type: \"table\" }> = {\n type: \"table\",\n align: (node.align ?? []).map((a) => a ?? null),\n header: rows[0] ?? [],\n rows: rows.slice(1),\n };\n if (captionNodes) {\n const kids = inlines(captionNodes, ctx);\n const { id } = takeAttributes(kids);\n const tid = id?.replace(/^tbl:/, \"\");\n const number = ++ctx.tblN;\n const caption: Caption = { kind: \"tbl\", id: tid, number, label: `Table ${number}`, children: kids };\n if (tid) uniqueId(ctx, `tbl:${tid}`);\n table.caption = caption;\n ctx.tables.push(caption);\n }\n return table;\n}\n\nfunction convertBlock(\n nodes: RootContent[],\n i: number,\n ctx: Ctx,\n allowDirectives: boolean,\n): Block | null | \"skip-next\" {\n const node = nodes[i] as RootContent;\n switch (node.type) {\n case \"heading\": {\n const children = inlines(node.children, ctx);\n const { id, unnumbered } = takeAttributes(children);\n const plain = plainText(children).trim();\n const hid = uniqueId(ctx, id ?? slugify(plain));\n const h: Extract<Block, { type: \"heading\" }> = {\n type: \"heading\",\n level: node.depth,\n id: hid,\n plain,\n children,\n numbered: !unnumbered,\n };\n ctx.headingIndex.set(hid, h);\n return h;\n }\n case \"paragraph\": {\n const fig = figureOf(node, ctx);\n if (fig) return fig;\n // A caption paragraph belongs to the adjacent table.\n const cap = tableCaptionText(node);\n if (cap) {\n const next = nodes[i + 1];\n const prev = nodes[i - 1];\n if (next?.type === \"table\") {\n const t = convertTable(next, cap, ctx);\n nodes[i + 1] = { type: \"html\", value: \"<!--matrx:consumed-->\" };\n return t;\n }\n if (prev?.type === \"table\") return null; // consumed by the table (below)\n }\n const conv = inlines(node.children, ctx);\n const kids = conv.filter((k) => !(k.type === \"text\" && !k.value.trim()));\n if (kids.length === 1 && kids[0]?.type === \"math\" && kids[0].display) return { type: \"math\", tex: kids[0].tex };\n return { type: \"paragraph\", children: conv };\n }\n case \"table\": {\n const next = nodes[i + 1];\n const cap = tableCaptionText(next);\n if (cap) {\n const t = convertTable(node, cap, ctx);\n nodes[i + 1] = { type: \"html\", value: \"<!--matrx:consumed-->\" };\n return t;\n }\n return convertTable(node, null, ctx);\n }\n case \"list\": {\n const items: ListItem[] = node.children.map((li) => {\n const children: Block[] = [];\n convertBlocks(li.children as RootContent[], ctx, children);\n return { checked: li.checked ?? null, children };\n });\n return { type: \"list\", ordered: Boolean(node.ordered), start: node.start ?? 1, items };\n }\n case \"blockquote\": {\n const children: Block[] = [];\n convertBlocks(node.children as RootContent[], ctx, children);\n return { type: \"blockquote\", children };\n }\n case \"code\":\n return { type: \"code\", lang: node.lang ?? \"\", value: node.value };\n case \"thematicBreak\":\n return { type: \"rule\" };\n case \"html\": {\n if (/^<!--matrx:consumed-->$/.test(node.value)) return null;\n if (/^\\s*<!--[\\s\\S]*-->\\s*$/.test(node.value)) return null; // comments are invisible\n if (/^\\s*<br\\s*\\/?>\\s*$/i.test(node.value)) return null;\n // Block HTML: keep the words, drop the tags.\n const text = node.value\n .replace(/<(script|style)\\b[\\s\\S]*?<\\/\\1>/gi, \"\")\n .replace(/<[^>]+>/g, \" \")\n .replace(/\\s+/g, \" \")\n .trim();\n if (/<(?!\\/?(?:artifact|flashcards)\\b)[a-z]/i.test(node.value)) announceHtml(ctx);\n return text ? { type: \"paragraph\", children: [{ type: \"text\", value: text }] } : null;\n }\n case \"math\" as string:\n return { type: \"code\", lang: \"math\", value: (node as unknown as { value: string }).value };\n default:\n void allowDirectives;\n return null;\n }\n}\n\nfunction resolveXrefs(ctx: Ctx) {\n const figs = new Map(ctx.figures.filter((c) => c.id).map((c) => [c.id as string, c]));\n const tbls = new Map(ctx.tables.filter((c) => c.id).map((c) => [c.id as string, c]));\n for (const x of ctx.xrefs) {\n const [kind, id] = x.target.split(/:(.*)/s) as [string, string];\n let label: string | undefined;\n if (kind === \"fig\") label = figs.get(id)?.label;\n else if (kind === \"tbl\") label = tbls.get(id)?.label;\n else if (kind === \"sec\") {\n const h = ctx.headingIndex.get(`sec:${id}`) ?? ctx.headingIndex.get(id);\n if (h) {\n label = h.number ? `Section ${h.number}` : `“${h.plain}”`;\n x.target = `sec:${h.id}`;\n }\n }\n if (label) {\n x.label = label;\n x.resolved = true;\n } else {\n x.label = \"??\";\n ctx.notify({\n code: \"xref-unresolved\",\n message: `The cross-reference @${x.target} points at nothing in this document.`,\n remedy:\n kind === \"sec\"\n ? `Give the heading an id: \\`## Title {#sec:${id}}\\`.`\n : kind === \"fig\"\n ? `Label the image: \\`{#fig:${id}}\\`.`\n : `Caption the table: a line \\`Table: Caption {#tbl:${id}}\\` right before or after it.`,\n });\n }\n }\n}\n\n/** Parse a markdown source (with optional frontmatter) into the document tree. */\nexport function parseDocument(source: string, options: ParseDocumentOptions = {}): DocTree {\n const notices: DocumentNotice[] = [];\n const notify = (n: DocumentNotice) => {\n notices.push(n);\n options.onNotice?.(n);\n };\n const sink: DocumentNotice[] = [];\n const fm = splitFrontmatter(source ?? \"\", sink);\n const settings = resolveSettings(fm.data, sink, options);\n for (const n of sink) notify(n);\n\n const body = removeThinkingContent(fm.body);\n // Artifact envelopes become their markdown (a table stays a table).\n const lifted = extractMath(unwrapArtifactsToMarkdown(body));\n const root = fromMarkdown(prepass(lifted.text), {\n extensions: [gfm()],\n mdastExtensions: [gfmFromMarkdown()],\n }) as Root;\n\n let engineInstance: CitationEngine | null = null;\n const ctx: Ctx = {\n settings,\n notices,\n notify,\n defs: new Map(),\n footnoteDefs: new Map(),\n noteOrder: new Map(),\n refs: new Map(settings.references.map((r) => [r.id, r])),\n engine: () => {\n if (!engineInstance) {\n const id = cslStyleId(settings.citationStyle);\n let xml = options.csl?.styles?.[id] ?? bundledCslStyle(id);\n if (!xml) {\n notify({\n code: \"setting-ignored\",\n message: `The citation style \"${settings.citationStyle}\" could not be loaded, so APA is used.`,\n remedy: \"Use a style name from the CSL repository (zotero.org/styles), e.g. `csl: nature`, or a .csl URL — and export while online so it can be fetched.\",\n });\n xml = bundledCslStyle(\"apa\") as string;\n }\n const tag = cslLocaleTag(settings.lang);\n const locale = options.csl?.locale ?? BUNDLED_CSL_LOCALE_EN_US;\n engineInstance = new CitationEngine(xml, locale, settings.references, tag === \"en-US\" || options.csl?.locale ? settings.lang : \"en-US\");\n }\n return engineInstance;\n },\n noteCount: 0,\n citeNotes: [],\n math: lifted.spans,\n htmlAnnounced: false,\n ids: new Set(),\n figN: 0,\n tblN: 0,\n figures: [],\n tables: [],\n xrefs: [],\n headingIndex: new Map(),\n };\n const visit = (n: MdNode) => {\n if (n.type === \"definition\") ctx.defs.set(n.identifier, { url: n.url, title: n.title });\n if (n.type === \"footnoteDefinition\") ctx.footnoteDefs.set(n.identifier, n.children as RootContent[]);\n if (\"children\" in n) for (const c of (n as MdParent).children) visit(c as MdNode);\n };\n visit(root);\n\n // Sections at section breaks; page breaks / toc / bibliography as blocks.\n const sections: DocSection[] = [\n { orientation: settings.page.orientation, columns: settings.columns, blocks: [] },\n ];\n let hasTocBlock = false;\n let hasBibBlock = false;\n const top = root.children.filter((n) => n.type !== \"definition\" && n.type !== \"footnoteDefinition\");\n for (let i = 0; i < top.length; i++) {\n const node = top[i] as RootContent;\n const d = directiveOf(node);\n const current = sections[sections.length - 1] as DocSection;\n if (d?.type === \"section\") {\n sections.push({\n orientation: d.value.orientation ?? settings.page.orientation,\n columns: d.value.columns ?? settings.columns,\n blocks: [],\n });\n continue;\n }\n if (d?.type === \"pagebreak\") {\n current.blocks.push({ type: \"pageBreak\" });\n continue;\n }\n if (d?.type === \"toc\") {\n if (!hasTocBlock) current.blocks.push({ type: \"toc\" });\n hasTocBlock = true;\n continue;\n }\n if (d?.type === \"bibliography\") {\n current.blocks.push({ type: \"bibliography\" });\n hasBibBlock = true;\n continue;\n }\n const block = convertBlock(top, i, ctx, true);\n if (block && block !== \"skip-next\") current.blocks.push(block);\n }\n // Drop sections a trailing/leading break left empty (no blank pages).\n const nonEmpty = sections.filter((s, idx) => s.blocks.length > 0 || idx === 0);\n sections.length = 0;\n sections.push(...nonEmpty);\n for (const s of sections) {\n while (s.blocks[0]?.type === \"pageBreak\") s.blocks.shift();\n while (s.blocks[s.blocks.length - 1]?.type === \"pageBreak\") s.blocks.pop();\n }\n\n // Section numbering (relative to the shallowest numbered heading level).\n const allHeadings: Array<Extract<Block, { type: \"heading\" }>> = [];\n const collect = (blocks: Block[]) => {\n for (const b of blocks) if (b.type === \"heading\") allHeadings.push(b);\n };\n for (const s of sections) collect(s.blocks);\n const minLevel = Math.min(7, ...allHeadings.map((h) => h.level));\n if (settings.numberSections) {\n const counters = [0, 0, 0, 0, 0, 0];\n for (const h of allHeadings) {\n if (!h.numbered) continue;\n const depth = h.level - minLevel;\n counters[depth] = (counters[depth] ?? 0) + 1;\n for (let d = depth + 1; d < 6; d++) counters[d] = 0;\n h.number = counters\n .slice(0, depth + 1)\n .map((c) => c || 1)\n .join(\".\");\n }\n }\n\n // Footnotes and note-style citations → endnotes, in number order.\n const notes: DocTree[\"notes\"] = [];\n for (const [identifier, n] of ctx.noteOrder.entries()) {\n const children: Block[] = [];\n convertBlocks(ctx.footnoteDefs.get(identifier) ?? [], ctx, children);\n notes.push({ n, children });\n }\n notes.push(...ctx.citeNotes);\n notes.sort((a, b) => a.n - b.n);\n const last = sections[sections.length - 1] as DocSection;\n const backLevel = minLevel <= 6 ? minLevel : 1;\n const backHeading = (plain: string, id: string): Block => {\n const h: Extract<Block, { type: \"heading\" }> = {\n type: \"heading\",\n level: backLevel,\n id: uniqueId(ctx, id),\n plain,\n children: [{ type: \"text\", value: plain }],\n numbered: false,\n };\n allHeadings.push(h);\n return h;\n };\n if (notes.length) last.blocks.push(backHeading(\"Notes\", \"notes\"), { type: \"notes\" });\n\n // Bibliography: the CSL processor's list of everything cited.\n const bibliography = engineInstance ? (engineInstance as CitationEngine).bibliography() : [];\n if (bibliography.length || hasBibBlock) {\n const heading = backHeading(settings.bibliographyTitle, \"references\");\n if (hasBibBlock) {\n for (const s of sections) {\n const idx = s.blocks.findIndex((b) => b.type === \"bibliography\");\n if (idx >= 0) {\n // The author already titled it (`# References {-}` above the\n // marker): use theirs, never a second heading (pandoc does the same).\n if (s.blocks[idx - 1]?.type !== \"heading\") s.blocks.splice(idx, 0, heading);\n else allHeadings.splice(allHeadings.indexOf(heading as Extract<Block, { type: \"heading\" }>), 1);\n break;\n }\n }\n } else {\n last.blocks.push(heading, { type: \"bibliography\" });\n }\n }\n\n // Table of contents.\n if (settings.toc.enabled && !hasTocBlock) {\n (sections[0] as DocSection).blocks.unshift({ type: \"toc\" }, { type: \"pageBreak\" });\n }\n const order: Array<Extract<Block, { type: \"heading\" }>> = [];\n for (const s of sections) for (const b of s.blocks) if (b.type === \"heading\") order.push(b);\n const toc = order\n .filter((h) => h.level - minLevel + 1 <= settings.toc.depth)\n .map((h) => ({ id: h.id, level: h.level - minLevel + 1, text: h.number ? `${h.number} ${h.plain}` : h.plain }));\n\n resolveXrefs(ctx);\n\n if (!sections.some((s) => s.blocks.length) && !settings.cover) {\n notify({\n code: \"empty-document\",\n message: \"The document has no content to print or export.\",\n remedy: \"Write something below the settings block (or remove the --- lines if they are not settings).\",\n });\n }\n\n return {\n settings,\n body,\n sections,\n toc,\n figures: ctx.figures,\n tables: ctx.tables,\n bibliography,\n notes,\n notices,\n math: new Map(),\n };\n}\n","/**\n * @ai-matrx/print/markdown — the SHIPPED DEFAULT markdown→HTML converter and\n * print stylesheet.\n *\n * Why this entry exists: `markdownToPdfBlob` used to declare its converter and\n * its stylesheet as REQUIRED injected ports (\"bring your own converter +\n * stylesheet\"). That is the exact failure THE ALL-INCLUSIVE LAW names — every\n * host had to build the hard half itself, and both hosts that tried ended up\n * with a different converter, a different stylesheet, and a different set of\n * bugs. The package now ships a complete, working default for both ports; the\n * injection seam survives as the OVERRIDE path, never as a prerequisite.\n *\n * Two skins, one vocabulary:\n * • \"document\" — `markdownToHtml` emits `.matrx-*`-classed HTML (tables,\n * nested lists, images, links, code, FAQ blocks, flashcards) and\n * `MARKDOWN_DOCUMENT_CSS` styles it. This is the PDF/publish/WordPress\n * lane.\n * • \"article\" — `markdownToArticleHtml` emits bare semantic tags and\n * `MARKDOWN_ARTICLE_CSS` gives them the serif AI-response look. This is\n * the print-window lane.\n *\n * Nothing here touches `window`/`document` at import time, and nothing here is\n * heavy — but it IS ~20KB of CSS, so `markdownToPdfBlob` reaches it through a\n * lazy `import(\"./markdown\")` and a consumer that never prints markdown pays\n * nothing.\n *\n * NOTHING FAILS SILENTLY: every case where the converter drops input it cannot\n * represent (a malformed flashcard, an empty document) is reported through the\n * optional `onNotice` sink with a concrete remedy, instead of vanishing.\n */\n\nimport { openPrintWindow, type PrintOutcome } from \"./core\";\nimport { escapeHtml } from \"@ai-matrx/kit/html-escape\";\nimport { codeSpanText, findTableEnd, mapCodeRanges, rowCells, tableStartsAt, unescapeCellPipes } from \"@ai-matrx/content-ir/source\";\nimport { PRINT_HTML_SCHEMA, sanitizePrintHtml } from \"./safe-html\";\nimport {\n MARKDOWN_ARTICLE_CSS,\n MARKDOWN_ARTICLE_TOKENS_CSS,\n MARKDOWN_DOCUMENT_CSS,\n MARKDOWN_DOCUMENT_TOKENS_CSS,\n MARKDOWN_PAGE_CSS,\n MARKDOWN_PAGE_PLAIN_CSS,\n MARKDOWN_SHARED_CSS,\n} from \"./markdown-css\";\nimport {\n PAGE_BREAK_CLASS,\n PAGE_BREAK_LABEL,\n PAGE_BREAK_MARKDOWN,\n isBibliographyLine,\n isBreakLine,\n isPageBreakLine,\n isTocLine,\n splitAtPageBreaks,\n} from \"./directives\";\n\nexport {\n MARKDOWN_ARTICLE_CSS,\n MARKDOWN_ARTICLE_TOKENS_CSS,\n MARKDOWN_DOCUMENT_CSS,\n MARKDOWN_DOCUMENT_TOKENS_CSS,\n MARKDOWN_PAGE_CSS,\n MARKDOWN_SHARED_CSS,\n PAGE_BREAK_CLASS,\n PAGE_BREAK_MARKDOWN,\n isPageBreakLine,\n splitAtPageBreaks,\n};\n\n/** Which shipped look to render markdown in. */\nexport type MarkdownSkin = \"document\" | \"article\";\n\n/**\n * A thing the converter could not represent, with the remedy. Announced, never\n * swallowed — a dropped card that says nothing is indistinguishable from a card\n * the author never wrote.\n */\nexport interface MarkdownNotice {\n code: \"flashcard-malformed\" | \"empty-output\" | \"html-stripped\";\n message: string;\n /** What the caller (or the author of the markdown) should do about it. */\n remedy: string;\n}\n\nexport interface MarkdownToHtmlOptions {\n /** Keep `<thinking>` / `<think>` / `<reasoning>` blocks. Default: false. */\n includeThinking?: boolean;\n /** Where dropped/degraded content is announced. */\n onNotice?: (notice: MarkdownNotice) => void;\n}\n\n// ─── thinking-block stripping ────────────────────────────────────────────────\n\n/**\n * Strip `<thinking>` / `<think>` / `<reasoning>` blocks from model output.\n *\n * All three tags are treated as equivalent — a host that handled only\n * `<thinking>` leaked raw reasoning into printed documents the moment a model\n * switched tag names, which is exactly the bug this package exists to stop\n * being re-solved per app.\n */\nexport function removeThinkingContent(content: string): string {\n if (!content) return \"\";\n\n // A hidden section leaves the paragraph structure around it intact: when it\n // sat between blank lines (its own paragraph), the text on either side stays\n // two paragraphs; only a section inside a paragraph collapses to a line\n // break. Replacing every section with one \"\\n\" merged two stored paragraphs\n // into one on screen (verify-RC-B5 round 3 F6).\n const hide = (_match: string, before: string, after: string) =>\n before.length >= 2 || after.length >= 2 ? \"\\n\\n\" : \"\\n\";\n let result = content\n .replace(/(\\n*)<thinking>[\\s\\S]*?<\\/thinking>(\\n*)/gi, hide)\n .replace(/(\\n*)<think>[\\s\\S]*?<\\/think>(\\n*)/gi, hide)\n .replace(/(\\n*)<reasoning>[\\s\\S]*?<\\/reasoning>(\\n*)/gi, hide);\n\n // 3+ newlines collapse to 2 — intentional paragraph breaks survive.\n result = result.replace(/\\n{3,}/g, \"\\n\\n\");\n return result.trim();\n}\n\n/** Does this content carry any reasoning block? */\nexport function hasThinkingContent(content: string): boolean {\n if (!content) return false;\n return /<thinking>|<think>|<reasoning>/i.test(content);\n}\n\n// ─── shared machinery: ONE pre-pass, ONE table/list/rule grammar ────────────\n//\n// Both skins used to carry their own table parser, their own list builder,\n// their own rule regex, and their own (or no) code-fence handling — and they\n// had drifted: the article skin had no nested lists, the document skin ran the\n// emphasis pass over code, neither understood a page break, and both pasted an\n// `<artifact>`'s raw HTML (its <html>, <body> and <script>) straight into the\n// host page. Everything below is shared; a skin supplies only class names and\n// the HTML for a code block / flashcard deck.\n\n// Private-use delimiters: they cannot collide with author text (the input is\n// scrubbed of them first) and no markdown pass treats them as syntax.\nconst TOKEN_OPEN = \"\\uE000\";\nconst TOKEN_CLOSE = \"\\uE001\";\nconst BLOCK_TOKEN = (i: number): string => `${TOKEN_OPEN}B${i}${TOKEN_CLOSE}`;\nconst INLINE_TOKEN = (i: number): string => `${TOKEN_OPEN}I${i}${TOKEN_CLOSE}`;\nconst TOKEN_RE = /\\uE000([BI])(\\d+)\\uE001/g;\nconst PARAGRAPH_WRAPPED_BLOCK_RE = /<p[^>]*>\\s*(\\uE000B\\d+\\uE001)\\s*<\\/p>/g;\n\n/** Converted HTML parked behind a placeholder so later passes cannot touch it. */\nclass Stash {\n private readonly items: string[] = [];\n\n block(html: string): string {\n return BLOCK_TOKEN(this.items.push(html) - 1);\n }\n\n inline(html: string): string {\n return INLINE_TOKEN(this.items.push(html) - 1);\n }\n\n restore(html: string): string {\n // Items can hold tokens of their own (inline code inside a link), so\n // restore until nothing is left — bounded, since items never self-nest.\n let out = html;\n for (let pass = 0; pass < 8 && out.includes(TOKEN_OPEN); pass++) {\n out = out\n .replace(PARAGRAPH_WRAPPED_BLOCK_RE, \"$1\")\n .replace(TOKEN_RE, (_m: string, _k: string, i: string) => this.items[Number(i)] ?? \"\");\n }\n return out;\n }\n}\n\ninterface SkinGrammar {\n skin: MarkdownSkin;\n table: string;\n thead: string;\n tbody: string;\n tr: string;\n th: string;\n td: string;\n ul: string;\n ol: string;\n ulNested: string;\n olNested: string;\n li: string;\n hr: string;\n del: string;\n strong: string;\n em: string;\n inlineCode: string;\n}\n\nconst DOCUMENT_GRAMMAR: SkinGrammar = {\n skin: \"document\",\n table: \"matrx-table\",\n thead: \"matrx-table-head\",\n tbody: \"matrx-table-body\",\n tr: \"matrx-table-row\",\n th: \"matrx-table-header\",\n td: \"matrx-table-cell\",\n ul: \"matrx-list matrx-bullet-list\",\n ol: \"matrx-list matrx-numbered-list\",\n ulNested: \"matrx-list matrx-bullet-list matrx-nested-list\",\n olNested: \"matrx-list matrx-numbered-list matrx-nested-list\",\n li: \"matrx-list-item\",\n hr: \"matrx-hr\",\n del: \"matrx-del\",\n strong: \"matrx-strong\",\n em: \"matrx-em\",\n inlineCode: \"matrx-inline-code\",\n};\n\nconst ARTICLE_GRAMMAR: SkinGrammar = {\n skin: \"article\",\n table: \"print-table\",\n thead: \"\",\n tbody: \"\",\n tr: \"\",\n th: \"\",\n td: \"\",\n ul: \"\",\n ol: \"\",\n ulNested: \"\",\n olNested: \"\",\n li: \"\",\n hr: \"\",\n del: \"\",\n strong: \"\",\n em: \"\",\n inlineCode: \"inline-code\",\n};\n\nconst cls = (...names: string[]): string => {\n const joined = names.filter(Boolean).join(\" \");\n return joined ? ` class=\"${joined}\"` : \"\";\n};\n\n/** The rendered page break — identical markup in both skins. */\nconst PAGE_BREAK_HTML = `<div class=\"${PAGE_BREAK_CLASS}\" role=\"separator\" aria-label=\"${PAGE_BREAK_LABEL}\" data-label=\"${PAGE_BREAK_LABEL}\"></div>`;\n\nfunction codeBlockHtml(g: SkinGrammar, code: string, language: string): string {\n const body = escapeHtml(code.replace(/\\n$/, \"\"));\n const lang = language.trim();\n if (g.skin === \"article\") {\n const label = lang ? `<span class=\"code-lang\">${escapeHtml(lang)}</span>` : \"\";\n return `<div class=\"code-block-wrapper\">${label}<pre class=\"code-block\"><code>${body}</code></pre></div>`;\n }\n const dataLang = lang ? ` data-language=\"${escapeHtml(lang)}\"` : \"\";\n return `<pre class=\"matrx-code-block\"${dataLang}><code class=\"matrx-code\">${body}</code></pre>`;\n}\n\n// ── artifacts ───────────────────────────────────────────────────────────────\n\n/** Artifact types whose body is source code, printed as its source. */\nconst CODE_ARTIFACT_LANGUAGE: Readonly<Record<string, string>> = {\n html: \"html\",\n react: \"tsx\",\n svg: \"svg\",\n mermaid: \"mermaid\",\n diff: \"diff\",\n iframe: \"html\",\n code: \"\",\n};\n\nconst ARTIFACT_TYPE_LABEL: Readonly<Record<string, string>> = {\n html: \"HTML\",\n svg: \"SVG\",\n react: \"React\",\n iframe: \"Embed\",\n};\n\nfunction parseTagAttributes(tag: string): Record<string, string> {\n const attrs: Record<string, string> = {};\n for (const m of tag.matchAll(/([a-zA-Z_][\\w-]*)\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)')/g)) {\n attrs[(m[1] as string).toLowerCase()] = m[2] ?? m[3] ?? \"\";\n }\n return attrs;\n}\n\nfunction artifactLabel(type: string): string {\n if (!type) return \"Artifact\";\n return (\n ARTIFACT_TYPE_LABEL[type] ??\n type.replace(/[-_]+/g, \" \").replace(/\\b\\w/g, (c) => c.toUpperCase())\n );\n}\n\n/**\n * `<artifact …>body</artifact>` envelopes as plain markdown — the SAME rules the\n * skins use for their titled panels, for pipelines that parse markdown (the\n * document writer): source-code types and JSON bodies become fenced code;\n * every other body (tables, checklists, notes) is markdown and is kept as is.\n * Fenced code is never touched.\n */\nexport function unwrapArtifactsToMarkdown(markdown: string): string {\n if (!/<artifact\\b/i.test(markdown)) return markdown;\n return markdown\n .split(/(^[ \\t]*(?:`{3,}|~{3,})[\\s\\S]*?^[ \\t]*(?:`{3,}|~{3,})[ \\t]*$)/m)\n .map((part, i) =>\n i % 2 === 1\n ? part\n : part.replace(/<artifact\\b((?:[^>\"']|\"[^\"]*\"|'[^']*')*?)>([\\s\\S]*?)<\\/artifact>/gi, (_m, tag: string, body: string) => {\n const attrs = parseTagAttributes(tag);\n const type = (attrs.type ?? \"\").toLowerCase();\n const trimmed = body.replace(/^\\n+|\\n+$/g, \"\");\n if (!trimmed.trim()) return \"\";\n if (/^\\s*(`{3,}|~{3,})/.test(trimmed)) return `\\n\\n${trimmed}\\n\\n`;\n if (type in CODE_ARTIFACT_LANGUAGE) {\n const lang = CODE_ARTIFACT_LANGUAGE[type] || attrs.language || attrs.lang || \"\";\n return `\\n\\n\\`\\`\\`\\`${lang}\\n${trimmed}\\n\\`\\`\\`\\`\\n\\n`;\n }\n if (looksLikeJson(trimmed)) return `\\n\\n\\`\\`\\`\\`json\\n${JSON.stringify(JSON.parse(trimmed), null, 2)}\\n\\`\\`\\`\\`\\n\\n`;\n return `\\n\\n${trimmed}\\n\\n`;\n }),\n )\n .join(\"\");\n}\n\nfunction looksLikeJson(body: string): boolean {\n const t = body.trim();\n if (!/^[[{]/.test(t)) return false;\n try {\n JSON.parse(t);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * An `<artifact type id version title>body</artifact>` block, rendered as a\n * titled panel. Source-code artifacts (html, react, svg, mermaid, diff, code)\n * and JSON bodies print as escaped source — never as live markup, which is\n * what used to inject a whole `<html>…<script>` document into the host page.\n * Everything else (checklists, flashcards, research, notes) is markdown and is\n * converted in the same skin.\n */\nfunction artifactHtml(\n g: SkinGrammar,\n attrs: Record<string, string>,\n body: string | null,\n ctx: ConvertContext,\n): string {\n const type = (attrs.type ?? \"\").toLowerCase();\n const title = attrs.title?.trim() ?? \"\";\n const header = `<div class=\"matrx-artifact-header\"><span class=\"matrx-artifact-kind\">${escapeHtml(\n artifactLabel(type),\n )}</span>${title ? `<span class=\"matrx-artifact-title\">${escapeHtml(title)}</span>` : \"\"}</div>`;\n\n let inner: string;\n const trimmed = (body ?? \"\").replace(/^\\n+|\\n+$/g, \"\");\n if (body === null || !trimmed.trim()) {\n inner = `<p class=\"matrx-artifact-empty\">Saved artifact — open it in AI Matrx to view its content.</p>`;\n } else if (/^\\s*(`{3,}|~{3,})/.test(trimmed)) {\n inner = convertBody(g.skin, trimmed, ctx);\n } else if (type in CODE_ARTIFACT_LANGUAGE) {\n inner = codeBlockHtml(g, trimmed, CODE_ARTIFACT_LANGUAGE[type] || attrs.language || attrs.lang || \"\");\n } else if (looksLikeJson(trimmed)) {\n inner = codeBlockHtml(g, JSON.stringify(JSON.parse(trimmed), null, 2), \"json\");\n } else {\n inner = convertBody(g.skin, trimmed, ctx);\n }\n\n return `<section class=\"matrx-artifact\" data-artifact-type=\"${escapeHtml(type || \"artifact\")}\">${header}<div class=\"matrx-artifact-body\">${inner}</div></section>`;\n}\n\n// ── flashcards ──────────────────────────────────────────────────────────────\n\ninterface ParsedCard {\n front: string;\n back: string;\n}\n\nfunction parseFlashcards(content: string, notice: MarkdownToHtmlOptions[\"onNotice\"]): ParsedCard[] {\n const cards: ParsedCard[] = [];\n for (const card of content.split(/\\n*---\\n*/g).map((c) => c.trim()).filter(Boolean)) {\n const front = card.match(/Front:\\s*(.+?)(?=\\n|$)/i)?.[1]?.trim();\n const back = card.match(/Back:\\s*([\\s\\S]+?)$/i)?.[1]?.trim();\n if (!front || !back) {\n // A card that silently disappears from a printed deck is a defect the\n // printer can see and the author cannot.\n notice?.({\n code: \"flashcard-malformed\",\n message: `A flashcard was skipped: it is missing a ${front ? \"Back:\" : \"Front:\"} line.`,\n remedy:\n 'Every card inside <flashcards> needs both \"Front: …\" and \"Back: …\", separated from the next card by ---.',\n });\n continue;\n }\n cards.push({ front, back });\n }\n return cards;\n}\n\nfunction flashcardsHtml(g: SkinGrammar, cards: ParsedCard[], ctx: ConvertContext): string {\n if (g.skin === \"article\") {\n // Paper cannot flip: print the deck as question / answer pairs.\n return `<div class=\"matrx-flashcards-print\">${cards\n .map(\n (c, i) =>\n `<div class=\"matrx-fc\"><div class=\"matrx-fc-front\"><span class=\"matrx-fc-num\">${\n i + 1\n }</span>${c.front}</div><div class=\"matrx-fc-back\">${c.back}</div></div>`,\n )\n .join(\"\")}</div>`;\n }\n let out = '<div class=\"matrx-flashcards-container\">\\n';\n for (const { front, back } of cards) {\n ctx.cardIndex++;\n const cardId = `card${ctx.cardIndex}`;\n out += ` <div class=\"matrx-flashcard\">\n <input type=\"checkbox\" class=\"matrx-flashcard-input\" id=\"${cardId}\">\n <label for=\"${cardId}\" class=\"matrx-flashcard-label\"></label>\n <div class=\"matrx-flashcard-inner\">\n <div class=\"matrx-flashcard-front\">\n <div class=\"matrx-flashcard-content\">\n <strong>${front}</strong>\n </div>\n <span class=\"matrx-flashcard-indicator\">CLICK TO FLIP</span>\n </div>\n <div class=\"matrx-flashcard-back\">\n <div class=\"matrx-flashcard-content\">\n ${back}\n </div>\n <span class=\"matrx-flashcard-indicator\">CLICK TO FLIP</span>\n </div>\n </div>\n </div>\n\n`;\n }\n return `${out}</div>\\n`;\n}\n\n// ── the pre-pass ────────────────────────────────────────────────────────────\n\ninterface ConvertContext {\n options: MarkdownToHtmlOptions;\n depth: number;\n cardIndex: number;\n strippedAnnounced: boolean;\n}\n\nconst FENCE_OPEN = /^(\\s*)(`{3,}|~{3,})\\s*([^\\s`]*)[^`]*$/;\n\n/**\n * Pull every region the markdown passes must not touch out of the text:\n * fenced code, `<artifact>` blocks, page-break directives, `<flashcards>`,\n * inline code — and remove what must never reach a printed page (scripts,\n * styles, a document shell, HTML comments). Returns the text with\n * placeholders; `stash.restore` puts the finished HTML back.\n */\nfunction protectRegions(markdown: string, g: SkinGrammar, stash: Stash, ctx: ConvertContext): string {\n const lines = markdown.split(/\\r?\\n/);\n const out: string[] = [];\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i] as string;\n\n // Fenced code (``` or ~~~, any indent, unclosed = to the end).\n const fence = FENCE_OPEN.exec(line);\n if (fence) {\n const marker = fence[2] as string;\n const code: string[] = [];\n let j = i + 1;\n for (; j < lines.length; j++) {\n const close = /^\\s*(`{3,}|~{3,})\\s*$/.exec(lines[j] as string);\n if (close && (close[1] as string)[0] === marker[0] && (close[1] as string).length >= marker.length) break;\n code.push(lines[j] as string);\n }\n const indent = (fence[1] as string).length;\n const dedented = code.map((l) => l.slice(Math.min(indent, l.length - l.trimStart().length)));\n out.push(stash.block(codeBlockHtml(g, dedented.join(\"\\n\"), fence[3] ?? \"\")));\n i = j;\n continue;\n }\n\n if (isBreakLine(line)) {\n out.push(stash.block(PAGE_BREAK_HTML));\n continue;\n }\n // Placement directives only mean something to the document pipeline\n // (@ai-matrx/print/document); a skin never prints them as literal text.\n if (isTocLine(line) || isBibliographyLine(line)) continue;\n\n // <artifact …>body</artifact> — the canonical materialized wire form.\n const open = /^\\s*<artifact\\b((?:[^>\"']|\"[^\"]*\"|'[^']*')*?)(\\/?)>(.*)$/i.exec(line);\n if (open) {\n const attrs = parseTagAttributes(open[1] ?? \"\");\n if (open[2] === \"/\") {\n out.push(stash.block(artifactHtml(g, attrs, null, ctx)));\n if (open[3]?.trim()) out.push(open[3]);\n continue;\n }\n const bodyLines: string[] = [];\n let rest = open[3] ?? \"\";\n let after = \"\";\n let j = i;\n let inFence: string | null = null;\n for (;;) {\n const closeAt = inFence ? -1 : rest.search(/<\\/artifact\\s*>/i);\n if (closeAt >= 0) {\n bodyLines.push(rest.slice(0, closeAt));\n after = rest.slice(closeAt).replace(/^<\\/artifact\\s*>/i, \"\");\n break;\n }\n bodyLines.push(rest);\n const f = /^\\s*(`{3,}|~{3,})/.exec(rest);\n if (f) {\n const m = f[1] as string;\n if (inFence === null) inFence = m;\n else if (m[0] === inFence[0] && m.length >= inFence.length) inFence = null;\n }\n j++;\n if (j >= lines.length) break;\n rest = lines[j] as string;\n }\n const html =\n ctx.depth >= 3\n ? codeBlockHtml(g, bodyLines.join(\"\\n\"), \"\")\n : artifactHtml(g, attrs, bodyLines.join(\"\\n\"), { ...ctx, depth: ctx.depth + 1 });\n out.push(stash.block(html));\n if (after.trim()) out.push(after);\n i = j;\n continue;\n }\n\n // A GFM table — found and split BEFORE any inline pass (THE rule,\n // @ai-matrx/content-ir/source), so code spans, escapes and emphasis are read\n // per cell exactly as GFM reads a cell, and a line that starts another block\n // (`> 8C | …`, `- x`) ends the table and is left for its own pass.\n if (tableStartsAt(lines, i)) {\n const end = findTableEnd(lines, i);\n out.push(stash.block(tableHtml(lines.slice(i, end), g, stash)));\n i = end - 1;\n continue;\n }\n\n out.push(line);\n }\n\n let text = out.join(\"\\n\");\n\n // Inline code FIRST: prose about HTML (\"put it in a `<script>` tag\") must\n // reach the page as code, not be read as markup by the passes below.\n text = text.replace(/`([^`\\n]+)`/g, (_m: string, code: string) =>\n stash.inline(`<code${cls(g.inlineCode)}>${escapeHtml(code)}</code>`),\n );\n // Backslash escapes (CommonMark): `\\*` is a literal `*`, `\\\\` a literal `\\` —\n // never syntax for the passes below, never a printed backslash.\n text = resolveEscapes(text, stash);\n\n // Comments are invisible by definition — page-break comments were already\n // taken above, so what remains is safe to drop without a notice.\n text = text.replace(/<!--[\\s\\S]*?-->/g, \"\");\n\n // A printed page and a published HTML page are not a place to run someone\n // else's script or restyle the host. Paired regions go whole; a stray\n // opening/closing tag goes alone (never \"everything to the end\"). Repeat\n // until stable so a split `<scr<script></script>ipt>` cannot reassemble.\n const before = text;\n for (let pass = 0; pass < 8; pass++) {\n const next = text\n .replace(/<(script|style|head)\\b[^>]*>[\\s\\S]*?<\\/\\1\\s*>/gi, \"\")\n .replace(/<\\/?(?:script|style|head|html|body)\\b[^>]*>/gi, \"\")\n .replace(/<!DOCTYPE[^>]*>/gi, \"\");\n if (next === text) break;\n text = next;\n }\n text = sanitizeRawTags(text);\n // The allow-list (`./safe-html`) is what actually guards the output; this\n // only decides whether the author is told something of theirs was dropped.\n if ((text !== before || hasDisallowedTag(text)) && !ctx.strippedAnnounced) {\n ctx.strippedAnnounced = true;\n ctx.options.onNotice?.({\n code: \"html-stripped\",\n message:\n \"Markup that is not on the safe list (a <script>, <style>, <iframe>, <form>, <object>/<embed>, <meta>, <link>, an on… event handler, inline style, or a javascript: URL) was removed from the rendered copy.\",\n remedy:\n 'To show a full HTML page, put it in an ```html fence or an <artifact type=\"html\"> block — it is printed as its source.',\n });\n }\n\n // Flashcard decks — behind placeholders so no markdown pass re-processes them.\n text = text.replace(/<flashcards>([\\s\\S]*?)<\\/flashcards>/gi, (_m: string, content: string) => {\n const cards = parseFlashcards(content, ctx.options.onNotice);\n return cards.length ? `\\n${stash.block(flashcardsHtml(g, cards, ctx))}\\n` : \"\";\n });\n\n return text;\n}\n\nconst ALLOWED_TAGS = new Set(PRINT_HTML_SCHEMA.tagNames ?? []);\n\n/** A raw tag the allow-list will drop (our own `<flashcards>` island excepted). */\nfunction hasDisallowedTag(text: string): boolean {\n for (const m of text.matchAll(/<\\/?([a-zA-Z][\\w:-]*)/g)) {\n const tag = (m[1] as string).toLowerCase();\n if (tag !== \"flashcards\" && !ALLOWED_TAGS.has(tag)) return true;\n }\n return false;\n}\n\nconst URL_ATTRS = new Set([\"href\", \"src\", \"action\", \"formaction\", \"xlink:href\", \"poster\", \"background\"]);\n\nfunction decodeForSchemeCheck(value: string): string {\n return value\n .replace(/&#x([0-9a-f]+);?/gi, (_m: string, h: string) => String.fromCharCode(parseInt(h, 16)))\n .replace(/&#(\\d+);?/g, (_m: string, d: string) => String.fromCharCode(Number(d)))\n .replace(/:/gi, \":\")\n .replace(/[\\u0000-\\u0020]+/g, \"\")\n .toLowerCase();\n}\n\n/**\n * Author raw HTML survives (the document skin feeds WordPress), but never with\n * an `on…` handler, a `srcdoc`, or a script-scheme URL — entity- and\n * whitespace-obfuscated forms included.\n */\nfunction sanitizeRawTags(text: string): string {\n return text.replace(\n /<([a-zA-Z][\\w:-]*)((?:[^>\"']|\"[^\"]*\"|'[^']*')*)>/g,\n (whole: string, tag: string, rawAttrs: string) => {\n if (!/[=\\s]/.test(rawAttrs)) return whole;\n let changed = false;\n const attrs = rawAttrs.replace(\n /(\\s+)([^\\s\"'=<>/]+)(\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s\"'>]+)))?/g,\n (m: string, _sp: string, name: string, _eq: string, dq?: string, sq?: string, bare?: string) => {\n const lower = name.toLowerCase();\n if (lower.startsWith(\"on\") || lower === \"srcdoc\") {\n changed = true;\n return \"\";\n }\n if (URL_ATTRS.has(lower)) {\n const value = decodeForSchemeCheck(dq ?? sq ?? bare ?? \"\");\n if (/^(?:javascript|vbscript):|^data:text\\/html/.test(value)) {\n changed = true;\n return ` ${name}=\"#\"`;\n }\n }\n return m;\n },\n );\n return changed ? `<${tag}${attrs}>` : whole;\n },\n );\n}\n\n/** A URL that can go in an attribute: no script schemes, no attribute breakout. */\nfunction safeUrl(url: string): string {\n const u = url.trim();\n if (/^(?:javascript|vbscript):|^data:text\\/html/.test(decodeForSchemeCheck(u))) return \"#\";\n return u.replace(/\"/g, \"%22\");\n}\n\n/**\n * Bold / italic / strikethrough, shared by both skins. Underscores follow the\n * CommonMark intraword rule — `snake_case_name` stays literal.\n */\nfunction convertEmphasis(html: string, g: SkinGrammar): string {\n const strong = `<strong${cls(g.strong)}>`;\n const em = `<em${cls(g.em)}>`;\n return html\n .replace(/\\*\\*\\*(?!\\s)(.+?)(?<!\\s)\\*\\*\\*/g, `${strong}${em}$1</em></strong>`)\n .replace(/\\*\\*(?!\\s)(.+?)(?<!\\s)\\*\\*/g, `${strong}$1</strong>`)\n .replace(/(?<![\\w*])\\*(?![\\s*])(.+?)(?<![\\s*])\\*(?![\\w*])/g, `${em}$1</em>`)\n .replace(/(?<![\\w_])___(?!\\s)(.+?)(?<!\\s)___(?![\\w_])/g, `${strong}${em}$1</em></strong>`)\n .replace(/(?<![\\w_])__(?!\\s)(.+?)(?<!\\s)__(?![\\w_])/g, `${strong}$1</strong>`)\n .replace(/(?<![\\w_])_(?![\\s_])(.+?)(?<![\\s_])_(?![\\w_])/g, `${em}$1</em>`)\n .replace(/~~(?!\\s)(.+?)(?<!\\s)~~/g, `<del${cls(g.del)}>$1</del>`);\n}\n\n/** `[text](url)` / `` with one level of parentheses in the URL. */\nconst LINK_URL = String.raw`((?:[^()\\s]|\\([^()\\s]*\\))+)(?:\\s+\"[^\"]*\")?`;\nconst IMAGE_RE = new RegExp(String.raw`!\\[([^\\]]*)\\]\\(` + LINK_URL + String.raw`\\)`, \"g\");\nconst LINK_RE = new RegExp(String.raw`\\[([^\\]]+)\\]\\(` + LINK_URL + String.raw`\\)`, \"g\");\n\n/** `***` accent rule, `#===` heavy rule, `---` / `___` plain rule. */\nfunction convertRules(html: string, g: SkinGrammar): string {\n return html\n .replace(/^\\s{0,3}#\\s*={3,}\\s*$/gm, `<hr${cls(g.hr, \"matrx-hr-heavy\")}>`)\n .replace(/^\\s{0,3}\\*(?:\\s*\\*){2,}\\s*$/gm, `<hr${cls(g.hr, \"matrx-hr-accent\")}>`)\n .replace(/^\\s{0,3}(?:-\\s*){3,}$/gm, `<hr${cls(g.hr)}>`)\n .replace(/^\\s{0,3}(?:_\\s*){3,}$/gm, `<hr${cls(g.hr)}>`);\n}\n\nfunction cellAlign(separator: string): string {\n const s = separator.trim();\n const left = s.startsWith(\":\");\n const right = s.endsWith(\":\");\n if (left && right) return ' style=\"text-align:center\"';\n if (right) return ' style=\"text-align:right\"';\n return \"\";\n}\n\n/** A CommonMark backslash escape: `\\` before ASCII punctuation. */\nconst ESCAPE_RE = /\\\\([!-\\/:-@[-`{-~])/g;\n\nfunction resolveEscapes(text: string, stash: Stash): string {\n return text.replace(ESCAPE_RE, (_m: string, ch: string) => stash.inline(escapeHtml(ch)));\n}\n\n/**\n * One cell's inline content, read the way GFM reads a cell: the table-level\n * `\\|` → `|` first (inside code spans too, spec example 200), then code spans,\n * backslash escapes, images, links and emphasis — never block syntax.\n */\nfunction cellInlineHtml(cell: string, g: SkinGrammar, stash: Stash): string {\n // Code spans by THE one code-range rule (@ai-matrx/content-ir/source).\n let t = mapCodeRanges(unescapeCellPipes(cell), (range, raw) =>\n range.kind === \"span\" ? stash.inline(`<code${cls(g.inlineCode)}>${escapeHtml(codeSpanText(raw))}</code>`) : raw,\n );\n t = resolveEscapes(t, stash);\n t = t.replace(IMAGE_RE, (_m: string, alt: string, url: string) =>\n stash.inline(`<img class=\"${g.skin === \"document\" ? \"matrx-image\" : \"print-image\"}\" src=\"${safeUrl(url)}\" alt=\"${escapeHtml(alt)}\" />`),\n );\n t = t.replace(LINK_RE, (_m: string, text: string, url: string) =>\n stash.inline(`<a${g.skin === \"document\" ? ' class=\"matrx-link\"' : \"\"} href=\"${safeUrl(url)}\">${convertEmphasis(text, g)}</a>`),\n );\n return convertEmphasis(t, g);\n}\n\n/**\n * A GFM table by THE rule (@ai-matrx/content-ir/source — the rule chat, the\n * editor and the server read tables by): edge pipes optional, `\\|` stays in its\n * cell, every row printed at the header's width (empty cells kept — columns\n * never shift), `:---:` alignment honoured, each cell read as inline content.\n */\nfunction tableHtml(lines: readonly string[], g: SkinGrammar, stash: Stash): string {\n const cellsOf = (line: string) => rowCells(line).map((cell) => cellInlineHtml(cell, g, stash));\n const headers = cellsOf(lines[0] ?? \"\");\n const aligns = rowCells(lines[1] ?? \"\").map(cellAlign);\n const rows = lines.slice(2).map((line) => {\n const cells = cellsOf(line);\n return headers.map((_h, k) => cells[k] ?? \"\");\n });\n let t = `<table${cls(g.table)}>\\n<thead${cls(g.thead)}>\\n<tr${cls(g.tr)}>\\n`;\n headers.forEach((h, k) => {\n t += `<th${cls(g.th)}${aligns[k] ?? \"\"}>${h}</th>\\n`;\n });\n t += \"</tr>\\n</thead>\\n\";\n if (rows.length > 0) {\n t += `<tbody${cls(g.tbody)}>\\n`;\n for (const row of rows) {\n t += `<tr${cls(g.tr)}>\\n`;\n row.forEach((c, k) => {\n t += `<td${cls(g.td)}${aligns[k] ?? \"\"}>${c}</td>\\n`;\n });\n t += \"</tr>\\n\";\n }\n t += \"</tbody>\\n\";\n }\n return `${t}</table>`;\n}\n\ninterface OpenList {\n type: \"ul\" | \"ol\";\n indent: number;\n}\n\n/** Nested ordered/bullet lists — indentation-driven open/close bookkeeping. */\nfunction convertLists(html: string, g: SkinGrammar): string {\n const lines = html.split(\"\\n\");\n let processed = \"\";\n const listStack: OpenList[] = [];\n let lastListItem: \"\" | \"ul\" | \"ol\" = \"\";\n const li = `<li${cls(g.li)}>`;\n\n const top = (): OpenList | undefined => listStack[listStack.length - 1];\n const openTag = (type: \"ul\" | \"ol\", nested: boolean): string =>\n type === \"ol\"\n ? `<ol${cls(nested ? g.olNested : g.ol)}>\\n`\n : `<ul${cls(nested ? g.ulNested : g.ul)}>\\n`;\n\n const popOne = (): void => {\n if (lastListItem) {\n processed += \"</li>\\n\";\n lastListItem = \"\";\n }\n const closing = listStack.pop();\n if (!closing) return;\n processed += closing.type === \"ol\" ? \"</ol>\\n\" : \"</ul>\\n\";\n if (listStack.length > 0) processed += \"</li>\\n\";\n };\n\n const closeDeeperThan = (indent: number): void => {\n while (listStack.length > 0 && (top() as OpenList).indent > indent) popOne();\n };\n\n for (const line of lines) {\n const numbered = line.match(/^(\\s*)(\\d+)[.)]\\s+(.+)$/);\n const bullet = numbered ? null : line.match(/^(\\s*)[*\\-+]\\s+(.+)$/);\n if (numbered || bullet) {\n const type: \"ul\" | \"ol\" = numbered ? \"ol\" : \"ul\";\n const indent = ((numbered ?? bullet) as RegExpMatchArray)[1]?.length ?? 0;\n const content = (numbered ? numbered[3] : (bullet as RegExpMatchArray)[2]) ?? \"\";\n const current = top();\n\n if (current && indent > current.indent) {\n processed += `\\n${openTag(type, true)}`;\n listStack.push({ type, indent });\n } else {\n closeDeeperThan(indent);\n if (lastListItem && top()?.indent === indent) processed += \"</li>\\n\";\n const now = top();\n if (now && now.indent === indent && now.type !== type) {\n // Same depth, other list type: close the old list, open the new one.\n const closing = listStack.pop() as OpenList;\n processed += closing.type === \"ol\" ? \"</ol>\\n\" : \"</ul>\\n\";\n }\n const after = top();\n if (!after || after.indent !== indent || after.type !== type) {\n processed += openTag(type, listStack.length > 0);\n listStack.push({ type, indent });\n }\n }\n processed += `${li}${content}`;\n lastListItem = type;\n continue;\n }\n\n if (line.trim() !== \"\") {\n while (listStack.length > 0) popOne();\n }\n processed += `${line}\\n`;\n }\n while (listStack.length > 0) popOne();\n\n // GFM task items: `- [ ] todo` / `- [x] done` print as real boxes.\n return processed.replace(\n /<li( class=\"([^\"]*)\")?>\\s*\\[([ xX])\\]\\s+/g,\n (_m: string, _c: string | undefined, classes: string | undefined, mark: string) =>\n `<li${cls(classes ?? \"\", \"matrx-task-item\")}><span class=\"matrx-task-box${\n mark === \" \" ? \"\" : \" is-checked\"\n }\" aria-hidden=\"true\"></span>`,\n );\n}\n\nfunction convertBody(skin: MarkdownSkin, markdown: string, ctx: ConvertContext): string {\n return skin === \"article\" ? articleBody(markdown, ctx) : documentBody(markdown, ctx);\n}\n\n/** Author text can never forge a placeholder. */\nfunction scrubTokens(markdown: string): string {\n return markdown.replace(/[\\uE000\\uE001]/g, \"\");\n}\n\nfunction newContext(options: MarkdownToHtmlOptions): ConvertContext {\n return { options, depth: 0, cardIndex: 0, strippedAnnounced: false };\n}\n\n// ─── document skin: markdown → `.matrx-*` HTML ───────────────────────────────\n\n/**\n * markdown → `.matrx-*`-classed HTML wrapped in `.matrx-content-container`.\n *\n * The class vocabulary is deliberate and non-configurable: it is what\n * `MARKDOWN_DOCUMENT_CSS` styles, what the PDF lane renders, and what a\n * WordPress theme targets. Handles (in this order, because the order is the\n * whole trick): the shared pre-pass (code, artifacts, page breaks, flashcards,\n * inline code, unsafe page markup) → rules → images → links → headings →\n * emphasis → nested/task lists → blockquotes → tables → block elements →\n * paragraphs → FAQ promotion → placeholder restoration.\n */\nexport function markdownToHtml(\n markdown: string,\n options: MarkdownToHtmlOptions = {},\n): string {\n if (!markdown) {\n options.onNotice?.({\n code: \"empty-output\",\n message: \"markdownToHtml received an empty string.\",\n remedy: \"Check the content is loaded before converting; nothing was rendered.\",\n });\n return \"\";\n }\n const source = scrubTokens(options.includeThinking ? markdown : removeThinkingContent(markdown));\n return sanitizePrintHtml(\n `<div class=\"matrx-content-container\">${documentBody(source, newContext(options))}</div>`,\n );\n}\n\nfunction documentBody(markdown: string, ctx: ConvertContext): string {\n const g = DOCUMENT_GRAMMAR;\n const stash = new Stash();\n let html = protectRegions(markdown, g, stash, ctx);\n\n // Rules before headings/lists so `---` / `#===` / `***` are never eaten.\n html = convertRules(html, g);\n\n // Images BEFORE links — `` is a superset of `[a](u)`.\n html = html.replace(IMAGE_RE, (_m: string, alt: string, url: string) =>\n stash.block(`<img class=\"matrx-image\" src=\"${safeUrl(url)}\" alt=\"${escapeHtml(alt)}\" />`),\n );\n html = html.replace(LINK_RE, (_m: string, text: string, url: string) =>\n stash.inline(`<a class=\"matrx-link\" href=\"${safeUrl(url)}\">${convertEmphasis(text, g)}</a>`),\n );\n\n html = html\n .replace(/^# (.+)$/gm, '<h1 class=\"matrx-h1\">$1</h1>')\n .replace(/^## (.+)$/gm, '<h2 class=\"matrx-h2\">$1</h2>')\n .replace(/^### (.+)$/gm, '<h3 class=\"matrx-h3\">$1</h3>')\n .replace(/^#### (.+)$/gm, '<h4 class=\"matrx-h4\">$1</h4>')\n .replace(/^##### (.+)$/gm, '<h5 class=\"matrx-h5\">$1</h5>')\n .replace(/^###### (.+)$/gm, '<h6 class=\"matrx-h6\">$1</h6>');\n\n // Lists BEFORE emphasis, so a bullet opening with bold (`* **A** and *b*`)\n // is still a bullet.\n html = convertLists(html, g);\n html = convertEmphasis(html, g);\n\n html = html.replace(/^> ?(.+)$/gm, '<blockquote class=\"matrx-blockquote\">$1</blockquote>');\n\n\n html = html\n .replace(/<table>/g, '<table class=\"matrx-table\">')\n .replace(/<thead>/g, '<thead class=\"matrx-table-head\">')\n .replace(/<tbody>/g, '<tbody class=\"matrx-table-body\">')\n .replace(/<tr>/g, '<tr class=\"matrx-table-row\">')\n .replace(/<th>/g, '<th class=\"matrx-table-header\">')\n .replace(/<td>/g, '<td class=\"matrx-table-cell\">');\n\n html = html.replace(/<img(?![^>]*class=)([^>]*)>/g, '<img class=\"matrx-image\"$1>');\n // Author divs join the vocabulary without losing their own class\n // (the old rewrite emitted two class attributes and the browser kept one).\n html = html.replace(/<div\\b([^>]*)>/g, (m: string, attrs: string) => {\n if (/\\bclass=\"matrx-/.test(attrs)) return m;\n if (/\\bclass=\"/.test(attrs)) return `<div${attrs.replace(/\\bclass=\"/, 'class=\"matrx-div ')}>`;\n return `<div class=\"matrx-div\"${attrs}>`;\n });\n html = html.replace(/<span(?![^>]*class=)([^>]*)>/g, '<span class=\"matrx-span\"$1>');\n\n html = html.replace(/^([^<\\n].+)$/gm, '<p class=\"matrx-paragraph\">$1</p>');\n html = html.replace(/<\\/p>\\s*<p class=\"matrx-paragraph\">/g, '</p><p class=\"matrx-paragraph\">');\n\n // Intro paragraph (first <p> after the h1) — before FAQ promotion.\n html = html.replace(\n /(<h1 class=\"matrx-h1\">[\\s\\S]*?<\\/h1>\\s*)<p class=\"matrx-paragraph\">((?:(?!\\uE000B)[\\s\\S])*?)<\\/p>/g,\n '$1<p class=\"matrx-intro\">$2</p>',\n );\n\n // FAQ promotion: bold questions and question headings become FAQ items.\n html = html.replace(\n /^<strong class=\"matrx-strong\">([^<]*\\?[^<]*)<\\/strong>$/gm,\n '<h3 class=\"matrx-h3\">$1</h3>',\n );\n html = html.replace(\n /<p class=\"matrx-paragraph\"><strong class=\"matrx-strong\">([^<]*\\?[^<]*)<\\/strong><\\/p>/g,\n '<h3 class=\"matrx-h3\">$1</h3>',\n );\n html = html.replace(\n /<h3 class=\"matrx-h3\">([^<]*\\?[^<]*)<\\/h3>/g,\n '<div class=\"matrx-faq-question\">$1</div>',\n );\n html = html.replace(\n /(<div class=\"matrx-faq-question\">[^<]*<\\/div>)\\s*(<p class=\"matrx-paragraph\">[\\s\\S]*?<\\/p>)/g,\n '<div class=\"matrx-faq-item\">$1<div class=\"matrx-faq-answer\">$2</div></div>',\n );\n html = html.replace(\n /(<div class=\"matrx-faq-question\">[^<]*<\\/div>)(?!\\s*<div class=\"matrx-faq-answer\">)/g,\n '<div class=\"matrx-faq-item\">$1<div class=\"matrx-faq-answer\"></div></div>',\n );\n html = html.replace(\n /(<div class=\"matrx-faq-answer\">)<p class=\"matrx-paragraph\">([\\s\\S]*?)<\\/p>(<\\/div>)/g,\n \"$1$2$3\",\n );\n\n return stash.restore(html);\n}\n\n// ─── article skin: markdown → bare semantic HTML ─────────────────────────────\n\n/**\n * markdown → bare semantic HTML (`h1`…`h6`, `p`, `ul`/`ol`, `blockquote`,\n * `.code-block-wrapper`, `.print-table`) for the article skin.\n *\n * Code is HTML-escaped in both skins (the shared pre-pass); a print window\n * never re-escapes, so unescaped code would render as markup.\n */\nexport function markdownToArticleHtml(\n markdown: string,\n options: MarkdownToHtmlOptions = {},\n): string {\n if (!markdown) {\n options.onNotice?.({\n code: \"empty-output\",\n message: \"markdownToArticleHtml received an empty string.\",\n remedy: \"Check the content is loaded before printing; nothing was rendered.\",\n });\n return \"\";\n }\n const source = scrubTokens(options.includeThinking ? markdown : removeThinkingContent(markdown));\n return sanitizePrintHtml(articleBody(source, newContext(options)));\n}\n\nfunction articleBody(markdown: string, ctx: ConvertContext): string {\n const g = ARTICLE_GRAMMAR;\n const stash = new Stash();\n let html = protectRegions(markdown, g, stash, ctx);\n html = convertRules(html, g);\n\n // Images BEFORE links — `` is a superset of `[a](u)`. Without this\n // pass an image fell through to the link pass and printed as a literal\n // \"!\" followed by a link (chat \"Print\", 2026-09-21).\n html = html.replace(IMAGE_RE, (_m: string, alt: string, url: string) =>\n stash.block(\n `<figure class=\"print-figure\"><img class=\"print-image\" src=\"${safeUrl(url)}\" alt=\"${escapeHtml(alt)}\" />${\n alt ? `<figcaption>${escapeHtml(alt)}</figcaption>` : \"\"\n }</figure>`,\n ),\n );\n html = html.replace(LINK_RE, (_m: string, text: string, url: string) =>\n stash.inline(`<a href=\"${safeUrl(url)}\">${convertEmphasis(text, g)}</a>`),\n );\n\n html = html\n .replace(/^#{6}\\s+(.+)$/gm, \"<h6>$1</h6>\")\n .replace(/^#{5}\\s+(.+)$/gm, \"<h5>$1</h5>\")\n .replace(/^#{4}\\s+(.+)$/gm, \"<h4>$1</h4>\")\n .replace(/^#{3}\\s+(.+)$/gm, \"<h3>$1</h3>\")\n .replace(/^#{2}\\s+(.+)$/gm, \"<h2>$1</h2>\")\n .replace(/^#{1}\\s+(.+)$/gm, \"<h1>$1</h1>\");\n\n html = html.replace(/^> ?(.+)$/gm, \"<blockquote>$1</blockquote>\");\n html = convertLists(html, g);\n html = convertEmphasis(html, g);\n\n html = html\n .split(\"\\n\")\n .map((line) => {\n const t = line.trim();\n if (!t) return \"\";\n if (\n /^<\\/?(h[1-6]|ul|ol|li|blockquote|pre|hr|table|thead|tbody|tr|th|td|div|figure|section)/.test(t) ||\n /^\\uE000B\\d+\\uE001$/.test(t)\n ) {\n return line;\n }\n return `<p>${t}</p>`;\n })\n .join(\"\\n\");\n\n return stash.restore(html).replace(/\\n{3,}/g, \"\\n\\n\").trim();\n}\n\n// ─── stylesheet + document composition ───────────────────────────────────────\n\n/**\n * The Print / Close action bar. The article sheet styles it already; the\n * document sheet is a content stylesheet with no chrome, so this ships beside\n * it — otherwise every host printing document-skin markdown gets two unstyled\n * browser buttons at the top of the page.\n */\nexport const PRINT_ACTIONS_CSS = `\n.print-actions { display: flex; gap: 10px; margin: 0 auto 28px; max-width: 800px; padding: 0 2rem 20px; border-bottom: 2px solid var(--matrx-print-border, #e1e1e1); }\n.print-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 20px; border-radius: 8px; font-size: 13px; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif; cursor: pointer; border: none; font-weight: 600; }\n.print-btn-primary { background: var(--matrx-print-accent, #667eea); color: var(--matrx-print-bg, #ffffff); }\n.print-btn-secondary { background: var(--matrx-print-surface, #f8f9fa); color: var(--matrx-print-fg-strong, #374151); border: 1px solid var(--matrx-print-border-muted, #d1d5db); }\n@media print { .print-actions { display: none !important; } }\n`;\n\nexport interface MarkdownStylesheetOptions {\n /** Which shipped look. Default: `\"document\"`. */\n skin?: MarkdownSkin;\n /**\n * Host brand overrides — a CSS string appended AFTER the package's default\n * token values, so `:root { --matrx-print-accent: #0f766e; }` wins. Token\n * VALUES are host-owned; the token CONTRACT and the structural CSS are not.\n */\n tokens?: string;\n /** Extra rules appended after everything else. */\n extraCss?: string;\n /**\n * Number printed pages (\"3 / 12\", bottom centre) via `@page` margin boxes.\n * Default: true. Page margins are set either way.\n */\n pageNumbers?: boolean;\n}\n\n/**\n * The complete default stylesheet for a skin: default token values, the\n * structural sheet, the rules both skins share (page breaks, artifacts, task\n * boxes, print hard parts), page geometry, then the host's overrides. Never returns an empty string.\n */\nexport function getMarkdownStylesheet(\n options: MarkdownStylesheetOptions = {},\n): string {\n const skin: MarkdownSkin = options.skin ?? \"document\";\n const base =\n skin === \"article\"\n ? `${MARKDOWN_ARTICLE_TOKENS_CSS}\\n${MARKDOWN_ARTICLE_CSS}`\n : `${MARKDOWN_DOCUMENT_TOKENS_CSS}\\n${MARKDOWN_DOCUMENT_CSS}`;\n const page = options.pageNumbers === false ? MARKDOWN_PAGE_PLAIN_CSS : MARKDOWN_PAGE_CSS;\n return [base, MARKDOWN_SHARED_CSS, page, options.tokens ?? \"\", options.extraCss ?? \"\"]\n .filter((part) => part.trim().length > 0)\n .join(\"\\n\");\n}\n\n/** Convert markdown with the converter that matches a skin. */\nexport function markdownToHtmlForSkin(\n markdown: string,\n skin: MarkdownSkin,\n options: MarkdownToHtmlOptions = {},\n): string {\n return skin === \"article\"\n ? markdownToArticleHtml(markdown, options)\n : markdownToHtml(markdown, options);\n}\n\nexport interface RenderMarkdownDocumentOptions extends MarkdownStylesheetOptions {\n title?: string;\n /** Override the shipped converter. The seam survives; it is no longer required. */\n convertToHtml?: (markdown: string) => string;\n /** Replace the whole stylesheet (not merely the tokens). */\n css?: string;\n onNotice?: (notice: MarkdownNotice) => void;\n /** Include the Print / Close action bar (hidden by `@media print`). */\n withPrintActions?: boolean;\n}\n\n/**\n * markdown → a complete, standalone, styled HTML document string.\n *\n * This is the one composition every lane uses — the print window, the PDF\n * capture host, and \"copy a full HTML page\". A host that builds its own\n * `<!DOCTYPE html>` wrapper around package CSS is re-implementing this.\n */\nexport function renderMarkdownDocument(\n markdown: string,\n options: RenderMarkdownDocumentOptions = {},\n): string {\n const skin: MarkdownSkin = options.skin ?? \"document\";\n const title = options.title ?? \"AI Response\";\n const convert =\n options.convertToHtml ??\n ((md: string) =>\n markdownToHtmlForSkin(\n md,\n skin,\n options.onNotice ? { onNotice: options.onNotice } : {},\n ));\n const bodyHtml = convert(markdown);\n const css =\n options.css ??\n getMarkdownStylesheet({\n skin,\n ...(options.tokens === undefined ? {} : { tokens: options.tokens }),\n ...(options.extraCss === undefined ? {} : { extraCss: options.extraCss }),\n });\n\n // The article sheet already styles the action bar; the document sheet is a\n // pure content stylesheet, so it gets the shared chrome appended.\n const chrome =\n options.withPrintActions && skin !== \"article\" ? PRINT_ACTIONS_CSS : \"\";\n\n const actions = options.withPrintActions\n ? '<div class=\"print-actions\"><button class=\"print-btn print-btn-primary\" onclick=\"window.print()\">Print / Save as PDF</button><button class=\"print-btn print-btn-secondary\" onclick=\"window.close()\">Close</button></div>'\n : \"\";\n\n return `<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\"><title>${escapeHtml(\n title,\n )}</title>\n<style>${css}${chrome}</style></head>\n<body>${actions}<div class=\"content\">${bodyHtml}</div></body></html>`;\n}\n\nexport interface PrintMarkdownOptions extends RenderMarkdownDocumentOptions {\n /** Window features for the print window. */\n windowFeatures?: string;\n}\n\n/**\n * Open a print window for a markdown string, in one call.\n *\n * Returns the `PrintOutcome` so the host can tell the user when the popup was\n * blocked and the `.html` download fallback fired instead — a silent fallback\n * is indistinguishable from \"print did nothing\".\n */\nexport function printMarkdown(\n markdown: string,\n options: PrintMarkdownOptions = {},\n): PrintOutcome {\n const title = options.title ?? \"AI Response\";\n const doc = renderMarkdownDocument(markdown, {\n ...options,\n title,\n withPrintActions: options.withPrintActions ?? true,\n });\n return options.windowFeatures === undefined\n ? openPrintWindow(doc, title)\n : openPrintWindow(doc, title, options.windowFeatures);\n}\n","/**\n * @ai-matrx/print/document — print-grade documents from markdown.\n *\n * ONE parsed tree (`parseDocument`) → PDF, DOCX, EPUB, HTML (+ the markdown\n * source itself), so every format carries the same page setup, cover, TOC,\n * numbered captions, cross-references, citations and bibliography.\n *\n * Settings live in the markdown's YAML frontmatter:\n *\n * ---\n * title: Quarterly Review\n * subtitle: Operations\n * author: Jane Park\n * date: today\n * cover: true\n * toc: true # or { depth: 2, title: Contents }\n * page: { size: a4, orientation: portrait, margins: 1in }\n * header: \"{title} | | {date}\" # left | center | right\n * footer: \"Page {page} of {pages}\"\n * firstPage: different\n * columns: 2\n * numberSections: true\n * csl: apa # apa | mla | chicago\n * references:\n * - id: smith2020\n * title: Paper Cuts\n * author: [Smith, Jane]\n * issued: 2020\n * ---\n *\n * Heavy engines (pdfmake, docx, jszip) load lazily when an export is called;\n * parsing and HTML are pure string work and safe on the server.\n */\n\nimport { documentToDocx } from \"./document/docx\";\nimport { documentToEpub } from \"./document/epub\";\nimport { documentToHtml } from \"./document/html\";\nimport { documentToPdf, headingPages, type FallbackFontLoaders } from \"./document/pdf\";\nimport { scanCitationKeys } from \"./document/citations\";\nimport { cslStyleId, loadCslLocale, loadCslStyle, type CslFetcher } from \"./document/csl/engine\";\nimport { resolveSettings, splitFrontmatter } from \"./document/settings\";\nimport { typesetMathSpans, type MathSpan } from \"./document/math\";\nimport { parseDocument, type ParseDocumentOptions } from \"./document/tree\";\nimport type { Block, CslItem, DocTree, DocumentNotice, ImageMap, Inline, ResolvedImage } from \"./document/types\";\n\nexport { parseDocument, plainText } from \"./document/tree\";\nexport { extractMath, mathKey, parseMathML } from \"./document/math\";\nexport type { MathSpan, TypesetMath } from \"./document/math\";\nexport type { ParseDocumentOptions } from \"./document/tree\";\nexport { documentToHtml, documentCss, renderBlocksHtml } from \"./document/html\";\nexport {\n buildPdfDefinition,\n countUnplacedWords,\n renderPdfDefinition,\n defaultEmojiFontLoader,\n defaultSymbolFontLoader,\n defaultCjkFontLoader,\n documentToPdf,\n parseUnicodeRangeCss,\n NOTO_CJK_BASE,\n NOTO_KR_BASE,\n NOTO_ARABIC_URL,\n NOTO_HEBREW_URL,\n NOTO_EMOJI_URL,\n NOTO_SYMBOLS_URL,\n} from \"./document/pdf\";\nexport type { CjkFontLoader, FallbackFontLoaders, FontLoader } from \"./document/pdf\";\nexport { documentToDocx } from \"./document/docx\";\nexport { documentToEpub } from \"./document/epub\";\nexport {\n PAGE_SIZES,\n DEFAULT_FOOTER,\n splitFrontmatter,\n resolveSettings,\n normalizeReference,\n parseLength,\n fillTemplate,\n} from \"./document/settings\";\nexport { parseCitationGroup, scanCitationKeys } from \"./document/citations\";\nexport {\n BUNDLED_STYLE_IDS,\n CitationEngine,\n CSL_STYLE_ALIASES,\n cslStyleId,\n defaultCslFetcher,\n loadCslLocale,\n loadCslStyle,\n parseLocator,\n} from \"./document/csl/engine\";\nexport type { CslFetcher } from \"./document/csl/engine\";\nexport type * from \"./document/types\";\n\nexport type DocumentFormat = \"pdf\" | \"docx\" | \"epub\" | \"html\" | \"markdown\";\n\nexport const DOCUMENT_FORMATS: ReadonlyArray<{ format: DocumentFormat; label: string; extension: string; mime: string }> = [\n { format: \"pdf\", label: \"PDF\", extension: \"pdf\", mime: \"application/pdf\" },\n { format: \"docx\", label: \"Word (.docx)\", extension: \"docx\", mime: \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\" },\n { format: \"epub\", label: \"EPUB\", extension: \"epub\", mime: \"application/epub+zip\" },\n { format: \"html\", label: \"Web page (.html)\", extension: \"html\", mime: \"text/html\" },\n { format: \"markdown\", label: \"Markdown\", extension: \"md\", mime: \"text/markdown\" },\n];\n\n// ── images: fetched once, shared by every format ──────────────────────────\n\nfunction sniff(bytes: Uint8Array): { mime: ResolvedImage[\"mime\"]; width: number; height: number } | null {\n const b = bytes;\n if (b[0] === 0x89 && b[1] === 0x50 && b[2] === 0x4e && b[3] === 0x47) {\n const dv = new DataView(b.buffer, b.byteOffset, b.byteLength);\n return { mime: \"image/png\", width: dv.getUint32(16), height: dv.getUint32(20) };\n }\n if (b[0] === 0x47 && b[1] === 0x49 && b[2] === 0x46) {\n return { mime: \"image/gif\", width: b[6]! | (b[7]! << 8), height: b[8]! | (b[9]! << 8) };\n }\n if (b[0] === 0xff && b[1] === 0xd8) {\n let i = 2;\n while (i + 9 < b.length) {\n if (b[i] !== 0xff) {\n i++;\n continue;\n }\n const marker = b[i + 1]!;\n const len = (b[i + 2]! << 8) | b[i + 3]!;\n if (marker >= 0xc0 && marker <= 0xcf && marker !== 0xc4 && marker !== 0xc8 && marker !== 0xcc) {\n return { mime: \"image/jpeg\", height: (b[i + 5]! << 8) | b[i + 6]!, width: (b[i + 7]! << 8) | b[i + 8]! };\n }\n i += 2 + len;\n }\n }\n return null;\n}\n\nfunction toBase64(bytes: Uint8Array): string {\n const g = globalThis as unknown as { Buffer?: { from: (b: Uint8Array) => { toString: (e: string) => string } } };\n if (g.Buffer) return g.Buffer.from(bytes).toString(\"base64\");\n let s = \"\";\n for (let i = 0; i < bytes.length; i += 0x8000) s += String.fromCharCode(...bytes.subarray(i, i + 0x8000));\n return btoa(s);\n}\n\nfunction fromBase64(b64: string): Uint8Array {\n const g = globalThis as unknown as { Buffer?: { from: (s: string, e: string) => Uint8Array } };\n if (g.Buffer) return new Uint8Array(g.Buffer.from(b64, \"base64\"));\n const bin = atob(b64);\n const out = new Uint8Array(bin.length);\n for (let i = 0; i < bin.length; i++) out[i] = bin.charCodeAt(i);\n return out;\n}\n\n/** Load image bytes for a URL. Default: data: URLs decode, http(s) fetches. */\nexport type ImageLoader = (url: string) => Promise<Uint8Array | null>;\n\nexport const defaultImageLoader: ImageLoader = async (url) => {\n const data = /^data:image\\/[\\w.+-]+;base64,(.*)$/i.exec(url);\n if (data) return fromBase64(data[1] as string);\n if (!/^https?:\\/\\//i.test(url) || typeof fetch !== \"function\") return null;\n const res = await fetch(url, { credentials: \"omit\" });\n if (!res.ok) return null;\n return new Uint8Array(await res.arrayBuffer());\n};\n\nfunction imageUrls(tree: DocTree): string[] {\n const urls = new Set<string>();\n const walk = (blocks: Block[]) => {\n for (const b of blocks) {\n if (b.type === \"figure\") urls.add(b.url);\n if (b.type === \"list\") for (const it of b.items) walk(it.children);\n if (b.type === \"blockquote\") walk(b.children);\n }\n };\n for (const s of tree.sections) walk(s.blocks);\n if (tree.settings.cover && tree.settings.logo) urls.add(tree.settings.logo);\n return [...urls];\n}\n\n/** Resolve every figure/logo image once. Failures are announced, never fatal. */\nexport async function resolveDocumentImages(\n tree: DocTree,\n loader: ImageLoader = defaultImageLoader,\n onNotice?: (n: DocumentNotice) => void,\n): Promise<ImageMap> {\n const map: ImageMap = new Map();\n await Promise.all(\n imageUrls(tree).map(async (url) => {\n let bytes: Uint8Array | null = null;\n try {\n bytes = await loader(url);\n } catch {\n bytes = null;\n }\n const info = bytes ? sniff(bytes) : null;\n if (!bytes || !info || !info.width || !info.height) {\n map.set(url, null);\n const n: DocumentNotice = {\n code: \"image-unavailable\",\n message: `An image could not be included: ${url.length > 90 ? `${url.slice(0, 87)}…` : url}`,\n remedy: bytes\n ? \"Use a PNG, JPEG or GIF image.\"\n : \"Use an image stored in AI Matrx (or any public https link that allows downloads); private or expired links cannot be printed.\",\n };\n tree.notices.push(n);\n onNotice?.(n);\n return;\n }\n map.set(url, { ...info, bytes, dataUrl: `data:${info.mime};base64,${toBase64(bytes)}` });\n }),\n );\n return map;\n}\n\n// ── one-call export ────────────────────────────────────────────────────────\n\nexport interface PrepareDocumentOptions extends ParseDocumentOptions {\n /**\n * The host's reference resolver: given citation keys the frontmatter does\n * not define (e.g. `research:<id>`, `file:<id>`), return CSL-JSON items for\n * the ones it knows. AI Matrx resolves its research sources and files.\n */\n resolveReferences?: ((keys: string[]) => Promise<CslItem[]>) | undefined;\n /** Fetches CSL styles/locales not bundled (default: the CSL repositories on GitHub). */\n cslFetcher?: CslFetcher | undefined;\n}\n\n/**\n * Parse with everything loaded: a citation style that is not bundled is\n * fetched by name (following a dependent style to its parent), the CSL locale\n * for `lang`, and references the host resolves. Use this (or exportDocument)\n * whenever the document may cite; `parseDocument` stays synchronous.\n */\nexport async function prepareDocument(source: string, options: PrepareDocumentOptions = {}): Promise<DocTree> {\n const fm = splitFrontmatter(source ?? \"\");\n const pre = resolveSettings(fm.data, [], options);\n const styleId = cslStyleId(pre.citationStyle);\n const keys = scanCitationKeys(fm.body);\n const styles: Record<string, string> = { ...(options.csl?.styles ?? {}) };\n let locale = options.csl?.locale;\n const known = new Set(pre.references.map((r) => r.id));\n const unknown = keys.filter((k) => !known.has(k));\n const [styleXml, localeXml, resolved] = await Promise.all([\n keys.length && !styles[styleId] ? loadCslStyle(styleId, options.cslFetcher).catch(() => null) : Promise.resolve(null),\n keys.length && !locale ? loadCslLocale(pre.lang, options.cslFetcher).catch(() => null) : Promise.resolve(null),\n unknown.length && options.resolveReferences ? options.resolveReferences(unknown).catch(() => []) : Promise.resolve([]),\n ]);\n if (styleXml) styles[styleId] = styleXml;\n if (localeXml) locale = localeXml;\n const tree = parseDocument(source, {\n ...options,\n references: [...(options.references ?? []), ...resolved],\n csl: { styles, locale },\n });\n await typesetDocumentMath(tree, options.onNotice);\n return tree;\n}\n\n/** Every math occurrence in the tree (text, headings, tables, captions, notes). */\nfunction mathSpans(tree: DocTree): MathSpan[] {\n const spans: MathSpan[] = [];\n const inl = (nodes: Inline[]) => {\n for (const n of nodes) {\n if (n.type === \"math\") spans.push({ tex: n.tex, display: n.display });\n if (\"children\" in n) inl(n.children);\n }\n };\n const blk = (blocks: Block[]) => {\n for (const b of blocks) {\n if (b.type === \"math\") spans.push({ tex: b.tex, display: true });\n if (b.type === \"heading\" || b.type === \"paragraph\") inl(b.children);\n if (b.type === \"list\") for (const it of b.items) blk(it.children);\n if (b.type === \"blockquote\") blk(b.children);\n if (b.type === \"table\") {\n for (const c of [...b.header, ...b.rows.flat()]) inl(c);\n if (b.caption) inl(b.caption.children);\n }\n if (b.type === \"figure\" && b.caption) inl(b.caption.children);\n }\n };\n for (const s of tree.sections) blk(s.blocks);\n for (const n of tree.notes) blk(n.children);\n return spans;\n}\n\n/** Typeset the tree's math (MathJax, loaded only when there is math). */\nexport async function typesetDocumentMath(tree: DocTree, onNotice?: (n: DocumentNotice) => void): Promise<void> {\n const spans = mathSpans(tree);\n if (spans.length === 0) return;\n tree.math = await typesetMathSpans(spans);\n const seen = new Set<string>();\n for (const [key, m] of tree.math) {\n if (!m.error || seen.has(m.error)) continue;\n seen.add(m.error);\n const n: DocumentNotice = {\n code: \"math-error\",\n message: `A formula could not be typeset (${m.error}): ${key.slice(2, 80)}`,\n remedy: \"Fix the TeX in that formula; it prints as source until it parses.\",\n };\n tree.notices.push(n);\n onNotice?.(n);\n }\n}\n\nexport interface ExportDocumentOptions extends PrepareDocumentOptions {\n /** File name without extension (default: the document title). */\n fileName?: string | undefined;\n imageLoader?: ImageLoader | undefined;\n /**\n * PDF fallback fonts, loaded only when the document has characters Roboto\n * cannot draw: `emoji` (default Noto Emoji) and `symbols` (default Noto Sans\n * Math — arrows, math, box drawing), both from jsDelivr at call time.\n */\n fonts?: FallbackFontLoaders | undefined;\n}\n\nexport interface DocumentExport {\n format: DocumentFormat;\n bytes: Uint8Array;\n mime: string;\n fileName: string;\n /** PDF only. */\n pageCount?: number | undefined;\n tree: DocTree;\n notices: DocumentNotice[];\n}\n\nconst safeName = (s: string) =>\n s\n .replace(/[\\\\/:*?\"<>|\\u0000-\\u001f]+/g, \" \")\n .replace(/\\s+/g, \" \")\n .trim()\n .slice(0, 120) || \"document\";\n\n/** Export a markdown source to any document format. */\nexport async function exportDocument(\n source: string,\n format: DocumentFormat,\n options: ExportDocumentOptions = {},\n): Promise<DocumentExport> {\n const tree = await prepareDocument(source, options);\n const meta = DOCUMENT_FORMATS.find((f) => f.format === format);\n if (!meta) throw new Error(`Unknown document format \"${format}\". Use one of: ${DOCUMENT_FORMATS.map((f) => f.format).join(\", \")}.`);\n const fileName = `${safeName(options.fileName ?? tree.settings.title ?? \"document\")}.${meta.extension}`;\n const enc = new TextEncoder();\n let bytes: Uint8Array;\n let pageCount: number | undefined;\n if (format === \"markdown\") {\n bytes = enc.encode(source);\n } else {\n const images = await resolveDocumentImages(tree, options.imageLoader, options.onNotice);\n if (format === \"html\") bytes = enc.encode(documentToHtml(tree, { images }));\n else if (format === \"pdf\") {\n const r = await documentToPdf(tree, images, options.fonts);\n bytes = r.bytes;\n pageCount = r.pageCount;\n } else if (format === \"docx\") {\n // Page numbers for the Word TOC come from the PDF layout — only when the\n // document HAS a table of contents, and never at the cost of the export.\n const hasToc = tree.sections.some((sec) => sec.blocks.some((blk) => blk.type === \"toc\"));\n let pages: Map<string, number> | undefined;\n if (hasToc) {\n try {\n pages = await headingPages(tree, images, options.fonts);\n } catch (err) {\n const n: DocumentNotice = {\n code: \"toc-pages-deferred\",\n message: `The Word file's table of contents lists every heading; its page numbers fill in when the file is opened (they could not be measured here: ${(err as Error).message}).`,\n remedy: \"Open the file in Word (or update fields) to show the page numbers.\",\n };\n tree.notices.push(n);\n options.onNotice?.(n);\n }\n }\n bytes = await documentToDocx(tree, { images, headingPages: pages });\n } else bytes = await documentToEpub(tree, { images });\n }\n return { format, bytes, mime: meta.mime, fileName, pageCount, tree, notices: tree.notices };\n}\n\n/** Browser helper: save an export through a download link. */\nexport function downloadDocumentExport(exp: DocumentExport): void {\n const blob = new Blob([exp.bytes as BlobPart], { type: exp.mime });\n const url = URL.createObjectURL(blob);\n const a = document.createElement(\"a\");\n a.href = url;\n a.download = exp.fileName;\n a.rel = \"noopener\";\n document.body.appendChild(a);\n a.click();\n a.remove();\n setTimeout(() => URL.revokeObjectURL(url), 30_000);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA6BA,IAAAA,iBAA+B;AAC/B,IAAAC,sBAA2B;A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AE,IAAI,SAAS,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,EAC1D,KAAK,MAAM,EACX,QAAQ,WAAW,MAAM,EACzB,KAAK;AAAA,IACV;AAAA,EACF;AACF;","names":["import_source","import_html_escape","import_hast_util_from_html","import_hast_util_to_html","last","href","out","CSL","c","parseYaml","href","import_html_escape","import_source","inlines","last","res"]}
|